/* ============ Whisper API dashboard - Notion-style, clean white ============ */
:root {
  --bg:        #f7f7f5;
  --surface:   #ffffff;
  --text:      #37352f;
  --text-soft: #6b6a64;
  --muted:     #9b9a93;
  --border:    #e9e9e7;
  --border-2:  #ededeb;
  --accent:    #2f2f2f;
  --green:     #16a34a;
  --green-bg:  #e7f6ec;
  --red:       #dc2626;
  --red-bg:    #fce8e8;
  --amber:     #d97706;
  --amber-bg:  #fcf0dc;
  --blue:      #2563eb;
  --blue-bg:   #e6effd;
  --violet:    #7c3aed;
  --violet-bg: #efe9fc;
  --radius:    10px;
  --shadow:    0 1px 2px rgba(15,15,15,.05), 0 2px 8px rgba(15,15,15,.04);
}

* { box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Helvetica, Arial, sans-serif;
  font-size: 14px;
  margin: 0;
}
code { color: #b3431f; background: #f1f0ee; padding: .1em .4em; border-radius: 4px; font-size: .86em; }
.muted { color: var(--muted); }
.link { color: var(--blue); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* -------------------------------- Login ---------------------------------- */
.login-body { background: var(--bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-wrap { width: 100%; max-width: 380px; padding: 20px; text-align: center; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 38px 32px; box-shadow: var(--shadow); }
.login-logo { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.login-card h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-card .form-label { text-align: left; display: block; font-weight: 600; font-size: 13px; }
.login-alert { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.login-foot { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* -------------------------------- Topbar --------------------------------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 12px 22px; position: sticky; top: 0; z-index: 20; }
.topbar-left { display: flex; align-items: baseline; gap: 10px; }
.brand { font-weight: 700; font-size: 16px; }
.brand i { color: var(--accent); margin-right: 4px; }
.brand-sub { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); color: var(--text-soft); }
.pill i { font-size: 8px; vertical-align: middle; }
.pill.ok i { color: var(--green); }
.pill.bad i { color: var(--red); }

/* -------------------------------- Sections ------------------------------- */
.section-title { font-weight: 700; font-size: 15px; margin: 4px 0 14px; }
.section-title i { color: var(--text-soft); margin-right: 6px; }

/* ------------------------------- Stat cards ------------------------------ */
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: 100%; box-shadow: var(--shadow); }
.stat-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 10px; }
.stat-icon.green  { background: var(--green-bg);  color: var(--green); }
.stat-icon.blue   { background: var(--blue-bg);   color: var(--blue); }
.stat-icon.amber  { background: var(--amber-bg);  color: var(--amber); }
.stat-icon.violet { background: var(--violet-bg); color: var(--violet); }
.stat-label { color: var(--text-soft); font-size: 12px; font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.stat-foot { color: var(--muted); font-size: 12px; }

/* -------------------------------- Cards ---------------------------------- */
.card-n { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-n-head { padding: 13px 16px; border-bottom: 1px solid var(--border-2); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-n-head i { color: var(--text-soft); margin-right: 6px; }
.card-n-body { padding: 16px; }
.card-n-body.p-0 { padding: 0; }

/* -------------------------------- Tables --------------------------------- */
.table-n { font-size: 13px; }
.table-n thead th { background: #fbfbfa; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border-2); padding: 9px 16px; }
.table-n tbody td { padding: 10px 16px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.table-n tbody tr:last-child td { border-bottom: none; }

/* ------------------------------- Services -------------------------------- */
.svc { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-2); }
.svc:last-child { border-bottom: none; }
.svc-led { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.svc-led.ok  { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.svc-led.bad { background: var(--red);   box-shadow: 0 0 0 3px var(--red-bg); }
.svc-name { font-weight: 600; }
.svc-meta { color: var(--muted); font-size: 12px; }
.svc-right { margin-left: auto; text-align: right; }
.badge-n { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.badge-ok  { background: var(--green-bg); color: var(--green); }
.badge-bad { background: var(--red-bg);   color: var(--red); }

/* ------------------------------- Bar chart ------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column-reverse; min-width: 0; height: 100%; border-radius: 3px; overflow: hidden; background: #f3f3f1; }
.bar-ok   { background: var(--green); }
.bar-fail { background: var(--red); }
.bars-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--text-soft); }
.bars-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.dot-ok { background: var(--green); } .dot-fail { background: var(--red); }
.bars-legend .muted { margin-left: auto; }

/* ------------------------------- Endpoints ------------------------------- */
.ep { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border-2); }
.ep:last-of-type { border-bottom: none; }
.ep-m { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 5px; min-width: 42px; text-align: center; }
.ep-m.get  { background: var(--blue-bg);  color: var(--blue); }
.ep-m.post { background: var(--green-bg); color: var(--green); }
.ep-m.ws   { background: var(--violet-bg);color: var(--violet); }
.ep .muted { margin-left: auto; font-size: 12px; }
.ep-note { margin-top: 10px; font-size: 12px; color: var(--text-soft); background: var(--bg); border-radius: 8px; padding: 9px 11px; }

/* --------------------------------- Tabs ---------------------------------- */
.nav-n .nav-link { color: var(--text-soft); font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px 14px; }
.nav-n .nav-link.active { background: var(--accent); color: #fff; }

/* ------------------------------- Dropzone -------------------------------- */
.dropzone { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; cursor: pointer; transition: .15s; background: #fcfcfb; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-bg); }
.dropzone i { font-size: 26px; color: var(--text-soft); margin-bottom: 8px; }
.dropzone .link { font-weight: 600; }

/* --------------------------------- Mic ----------------------------------- */
.mic-box { display: flex; align-items: center; gap: 16px; }
.mic-meta { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* -------------------------------- Result --------------------------------- */
.result-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fcfcfb; }
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.result-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin: 10px 0 4px; }
.result-text { background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; padding: 11px 13px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; min-height: 42px; }
.result-text.corrected { border-color: var(--violet); background: var(--violet-bg); }
.result-json { background: #2b2b2b; color: #e6e6e6; border-radius: 8px; padding: 12px; font-size: 12px; margin-top: 10px; max-height: 280px; overflow: auto; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--text); border-radius: 50%; animation: rot .7s linear infinite; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ------------------------------- Key output ------------------------------ */
.keyout { display: flex; align-items: center; gap: 8px; background: #2b2b2b; border-radius: 8px; padding: 9px 12px; margin-top: 8px; }
.keyout code { background: none; color: #7ee0a0; flex: 1; word-break: break-all; }
.alert-n { background: var(--green-bg); color: var(--green); border-radius: 8px; padding: 9px 12px; font-size: 13px; }
.key-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.status-chip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.status-2xx { background: var(--green-bg); color: var(--green); }
.status-4xx { background: var(--amber-bg); color: var(--amber); }
.status-5xx { background: var(--red-bg); color: var(--red); }

/* --------------------------------- Misc ---------------------------------- */
.btn-dark { background: var(--accent); border-color: var(--accent); }
.btn-dark:hover { background: #000; border-color: #000; }
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.tab-pane-n { animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* --------------------------- Model & configurare ------------------------- */
.cfg-status { font-size: 12px; margin-top: 6px; min-height: 16px; color: var(--muted); }
.cfg-status.ok   { color: var(--green); }
.cfg-status.work { color: var(--amber); }
.cfg-status.err  { color: var(--red); }

/* ----------------------------- Demo: microfon ---------------------------- */
.mic-stage { display: flex; align-items: center; gap: 16px; background: #fcfcfb;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.mic-controls { display: flex; flex-direction: column; gap: 8px; align-items: center; flex: none; }
.mic-meta { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 7px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .2; } }
.viz { flex: 1; width: 100%; height: 90px; background: #fff; border: 1px solid var(--border-2);
  border-radius: 8px; }

/* ------------------------------- Live stats ------------------------------ */
.live-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.ls { background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px;
  padding: 9px 12px; text-align: center; }
.ls-v { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ls-l { display: block; font-size: 11px; color: var(--muted); }

/* ----------------------------- Textarea-uri ------------------------------ */
.ta-label { display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-soft); margin-bottom: 5px; }
.ta-label i { margin-right: 4px; }
.ta-live { color: var(--red); font-size: 10px; }
.ta-live i { font-size: 7px; animation: pulse 1s infinite; }
.ta { width: 100%; min-height: 130px; resize: vertical; font-size: 14px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 8px; padding: 11px 13px;
  background: var(--surface); color: var(--text); }
.ta:focus { outline: none; border-color: var(--blue); }
.ta-corrected { border-color: #d9cdf5; background: #faf8ff; }
.ta.flash { animation: flash .5s; }
@keyframes flash { from { background: var(--blue-bg); } }
.ta-corrected.flash { animation: flashv .5s; }
@keyframes flashv { from { background: var(--violet-bg); } }

.result-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.result-json { background: #2b2b2b; color: #e6e6e6; border-radius: 8px; padding: 12px;
  font-size: 12px; margin-top: 10px; max-height: 280px; overflow: auto; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border);
  border-top-color: var(--text); border-radius: 50%; animation: rot .7s linear infinite;
  vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .live-stats { grid-template-columns: repeat(2, 1fr); }
  .mic-stage { flex-direction: column; }
}
