:root {
  --bg: #0c0f14;
  --surface: #151a24;
  --border: #2a3344;
  --text: #e8ecf4;
  --muted: #8b95a8;
  --accent: #5b8def;
  --accent-hover: #7aa3f5;
  --danger: #f07178;
  --success: #7fd99a;
  --radius: 14px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.bg-glow {
  position: fixed;
  inset: -20% 0 auto;
  height: 60vh;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, #1a3a6e55, transparent);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.shell-wide {
  max-width: 720px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #3d5a9e);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.brand p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: 0 12px 40px #00000055;
}

.card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-large {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

#dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-secondary {
  width: 100%;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: #5b8def22;
}

.recordings-panel {
  margin-top: 1rem;
}

.recordings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.recordings-head .section-title {
  margin: 0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
}

.pagination .btn-page {
  min-width: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.pagination .btn-page:hover:not(:disabled) {
  border-color: var(--accent);
}

.pagination .btn-page.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination .btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
}

.dashboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.dashboard-head h2 {
  margin: 0;
}

.welcome {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem;
}

.meeting-result {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--border);
}

.result-label {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

#meeting-link {
  display: block;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--success);
  word-break: break-all;
  text-decoration: none;
}

#meeting-link:hover {
  text-decoration: underline;
}

.meeting-code {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.live-section {
  margin-bottom: 1.25rem;
}

.live-empty {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.live-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.live-table th,
.live-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.live-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg);
}

.live-table tbody tr:last-child td {
  border-bottom: none;
}

.live-table tbody tr:nth-child(even) {
  background: #0c0f1488;
}

.meeting-code-link {
  font-family: var(--mono);
  color: var(--success);
  text-decoration: none;
}

.meeting-code-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-on {
  background: #1a3d2a;
  color: var(--success);
}

.badge-off {
  background: #2a2e38;
  color: var(--muted);
}

.btn-stop {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-stop:hover:not(:disabled) {
  background: #f0717818;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: #000000aa;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px #00000088;
}

.modal-card h3 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.modal-actions .btn-primary {
  width: auto;
}
