:root {
  --bg: #07100f;
  --panel: #0c1917;
  --panel-2: #10221e;
  --line: #224039;
  --text: #f0f7f4;
  --muted: #91aaa3;
  --brand: #47e5a7;
  --brand-dark: #163b30;
  --blue: #69a9ff;
  --warn: #f5bd57;
  --danger: #ff7272;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 5%, rgba(71,229,167,.12), transparent 30rem),
    radial-gradient(circle at 100% 50%, rgba(105,169,255,.08), transparent 34rem),
    var(--bg);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }
.app-shell { min-height: 100vh; }
.loading-card, .login-card {
  width: min(460px, calc(100% - 32px));
  margin: 10vh auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(12,25,23,.94);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  color: #04110d; background: var(--brand); font-weight: 900; font-size: 24px;
}
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-row h1 { margin: 0; font-size: 24px; }
.brand-row p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.login-card h2 { margin: 30px 0 8px; }
.login-card > p { color: var(--muted); }
.register-card { margin-top: 3vh; margin-bottom: 3vh; }
.auth-switch {
  display: grid; gap: 10px; margin-top: 22px; padding-top: 18px;
  border-top: 1px solid var(--line); color: var(--muted); text-align: center;
  font-size: 13px;
}
.consent-field {
  display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 10px;
  align-items: start; margin: 18px 0; color: var(--muted);
  font-size: 12px; line-height: 1.45;
}
.consent-field input { width: 18px; height: 18px; margin: 1px 0 0; }
.field { display: grid; gap: 7px; margin: 16px 0; }
.field span, label > span { color: var(--muted); font-size: 13px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  background: #081411;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(71,229,167,.11);
}
textarea { min-height: 90px; resize: vertical; }
.primary, .secondary, .danger, .ghost {
  border: 1px solid transparent; border-radius: 12px; padding: 10px 15px;
  font-weight: 750;
}
.primary { color: #03110c; background: var(--brand); }
.primary:hover { filter: brightness(1.08); }
.secondary { color: var(--text); background: var(--brand-dark); border-color: #2d624e; }
.ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.danger { color: #ffeaea; background: #4c2023; border-color: #7c3036; }
button:disabled { opacity: .5; cursor: not-allowed; }
.full { width: 100%; }
.layout { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 18px;
  border-right: 1px solid var(--line); background: rgba(7,16,15,.88);
  backdrop-filter: blur(15px);
}
.sidebar .brand-row { padding: 4px 6px 25px; }
.nav { display: grid; gap: 6px; }
.nav button {
  text-align: left; color: var(--muted); padding: 11px 12px; border-radius: 11px;
  background: transparent; border: 0;
}
.nav button:hover, .nav button.active { color: var(--text); background: var(--panel-2); }
.sidebar-footer { position: absolute; bottom: 20px; left: 18px; right: 18px; }
.user-chip { padding: 12px; border: 1px solid var(--line); border-radius: 13px; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: var(--muted); margin-top: 4px; }
.content { min-width: 0; padding: 30px clamp(18px,4vw,54px) 70px; }
.topline { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.topline h2 { margin: 0; font-size: clamp(26px,4vw,40px); letter-spacing: -.04em; }
.topline p { margin: 8px 0 0; color: var(--muted); }
.worker-pill {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  border: 1px solid var(--line); padding: 9px 12px; border-radius: 999px;
  color: var(--muted); font-size: 13px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.online .dot { background: var(--brand); box-shadow: 0 0 12px rgba(71,229,167,.7); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.card {
  margin-top: 22px; padding: 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: rgba(12,25,23,.88);
}
.card h3 { margin: 0 0 14px; }
.upload-zone {
  border: 1px dashed #356556; border-radius: 16px; padding: 28px;
  text-align: center; background: rgba(71,229,167,.035);
}
.upload-zone.drag { border-color: var(--brand); background: rgba(71,229,167,.1); }
.upload-zone input { display: none; }
.file-queue { display: grid; gap: 8px; margin-top: 14px; }
.file-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px;
  background: #081411;
}
.file-row small { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 20px; }
.stat { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.stat strong { display: block; font-size: 25px; }
.stat span { color: var(--muted); font-size: 12px; }
.jobs { display: grid; gap: 10px; margin-top: 14px; }
.job {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px;
  padding: 15px; border: 1px solid var(--line); border-radius: 14px;
  background: #0a1614; transition: .15s ease;
}
.job:hover { border-color: #396a5b; transform: translateY(-1px); }
.job h4 { margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 12px; display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: #14231f;
}
.badge.completed { color: var(--brand); background: #133226; }
.badge.processing, .badge.leased { color: var(--blue); background: #14263d; }
.badge.failed { color: var(--danger); background: #3c1d21; }
.badge.queued { color: var(--warn); background: #382e18; }
.progress { height: 6px; background: #15241f; border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--brand); }
.back { margin-bottom: 18px; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; }
.detail-head h2 { margin: 0; }
.speaker-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 12px; }
.speaker-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #091512; }
.speaker-card h4 { margin: 0 0 8px; }
.speaker-card audio { width: 100%; height: 32px; margin: 5px 0; }
.speaker-card .suggest { color: var(--warn); font-size: 12px; }
.transcript { display: grid; gap: 4px; }
.segment {
  display: grid; grid-template-columns: 80px 150px minmax(0,1fr); gap: 12px;
  padding: 10px; border-bottom: 1px solid rgba(34,64,57,.6);
}
.segment time { color: var(--muted); font-variant-numeric: tabular-nums; }
.segment strong { color: var(--brand); }
.empty { color: var(--muted); text-align: center; padding: 34px 10px; }
.record-panel { text-align: center; padding: 32px; }
.record-button {
  width: 88px; height: 88px; border-radius: 50%; border: 8px solid #18332b;
  background: var(--danger); box-shadow: 0 0 0 1px #6f3337;
}
.record-button.active { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(255,114,114,.09); } }
.timer { font-variant-numeric: tabular-nums; font-size: 34px; margin: 18px; }
.toast {
  position: fixed; z-index: 50; right: 20px; top: 20px; max-width: 420px;
  padding: 13px 16px; border-radius: 12px; color: var(--text);
  background: #19372e; border: 1px solid #35705c; box-shadow: 0 15px 50px #0008;
}
.toast.error { background: #412126; border-color: #843c44; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-size: 12px; }
.password-callout {
  margin-top: 12px; padding: 14px; background: #2e2817; border: 1px solid #68592a;
  border-radius: 12px; word-break: break-all;
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { display: flex; overflow-x: auto; }
  .sidebar-footer { position: static; margin-top: 14px; }
  .grid.two, .stats { grid-template-columns: 1fr; }
  .segment { grid-template-columns: 65px minmax(0,1fr); }
  .segment p { grid-column: 1/-1; margin: 0; }
  .worker-pill { display: none; }
}
