:root {
  --bg: #0b1020;
  --bg2: #121933;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef2ff;
  --muted: #9aa6c4;
  --accent: #6d7cff;
  --accent-2: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: Manrope, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(109, 124, 255, 0.28), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(34, 211, 238, 0.18), transparent 55%),
    linear-gradient(180deg, #070b18, #0b1020 40%, #0a0f1c);
  min-height: 100vh;
}

a { color: var(--accent-2); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.boot { padding: 40px; color: var(--muted); }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.brand-badge {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 800;
}
.brand h1 { margin: 0; font-size: 1.25rem; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 16px;
  background: rgba(0,0,0,0.25);
  padding: 6px;
  border-radius: 14px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}
.tab.active {
  background: rgba(109, 124, 255, 0.25);
  color: white;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}
.field input, .field select, .field textarea, .input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: rgba(109, 124, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(109, 124, 255, 0.15);
}
.field textarea { min-height: 110px; resize: vertical; }

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #6d7cff, #4f5ff0);
  color: white;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: white;
  border: 1px solid var(--border);
}
.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.btn-sm { padding: 8px 12px; font-size: 0.85rem; border-radius: 10px; }
.btn-block { width: 100%; }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
.error {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}
.success {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 6px;
}
.nav-item.active, .nav-item:hover {
  background: rgba(109, 124, 255, 0.18);
  color: white;
}
.user-box {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.main { padding: 24px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar h2 { margin: 0; font-size: 1.45rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.toolbar .spacer { flex: 1; }

.table-wrap { overflow: auto; border-radius: 14px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
}
tr:hover td { background: rgba(255,255,255,0.02); }
.muted { color: var(--muted); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.badge.uploaded { background: rgba(148,163,184,0.15); color: #cbd5e1; }
.badge.transcribing, .badge.analyzing { background: rgba(251,191,36,0.15); color: #fde68a; }
.badge.ready { background: rgba(52,211,153,0.15); color: #a7f3d0; }
.badge.error { background: rgba(248,113,113,0.15); color: #fecaca; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 50;
}
.modal {
  width: min(720px, 100%);
  background: #121933;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow: auto;
}
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

.speaker {
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 0 12px 12px 0;
}
.speaker.s2 { border-left-color: var(--accent-2); }
.speaker.s3 { border-left-color: #a78bfa; }
.speaker .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 4px; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .sidebar .brand { width: 100%; }
  .user-box { width: 100%; border: 0; padding-top: 8px; }
  .grid-2 { grid-template-columns: 1fr; }
}
