/* =====================================================================
   QUPERA CONSOLE — Swiss editorial admin
   Light, restrained, data-dense but calm. Inter for interface, a serif
   for display numerals so figures read as editorial rather than telemetry.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Newsreader:opsz,wght@6..72,300;6..72,400&display=swap');

:root {
  /* Neutrals carry the design; colour is reserved for meaning. */
  --paper:      #ffffff;
  --surface:    #fafaf9;
  --surface-2:  #f5f5f4;
  --line:       #e7e5e4;
  --line-firm:  #d6d3d1;

  --ink:        #1c1917;
  --ink-2:      #57534e;
  --ink-3:      #8a8580;

  /* Qupera navy + gold, muted for a light interface. */
  --accent:     #1e3a5f;
  --accent-sub: #eef2f7;
  --gold:       #a1802c;

  --ok:         #15803d;
  --ok-sub:     #f0fdf4;
  --warn:       #b45309;
  --warn-sub:   #fffbeb;
  --bad:        #b91c1c;
  --bad-sub:    #fef2f2;

  --radius: 4px;      /* Swiss: crisp, not pillowy */
  --gap: 20px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 1px 8px rgba(28, 25, 23, .03);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

@media (max-width: 768px) { body { font-size: 16px; } }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 26px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.brand { padding: 0 24px 24px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand .name {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: -.015em;
  line-height: 1;
  color: var(--ink);
}
.brand .sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-3);
  margin-top: 7px;
}

.nav { display: flex; flex-direction: column; gap: 1px; padding: 0 12px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: background-color .15s ease, color .15s ease;
  cursor: pointer;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--accent-sub); color: var(--accent); font-weight: 600; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke-width: 1.6; }

.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
  padding: 20px 24px 7px;
  font-weight: 600;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 24px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}

.main { padding: 34px 40px 72px; max-width: 1360px; }

/* --------------------------------------------------------------- header */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 400;
  letter-spacing: -.02em;
  margin: 0;
  line-height: 1.1;
}
.page-head .lede { color: var(--ink-2); font-size: 14px; margin-top: 6px; }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.card-head h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
  margin: 0;
  font-weight: 600;
}
.card-body { padding: 20px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: var(--gap); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.grid.two { grid-template-columns: 1.55fr 1fr; align-items: start; }

@media (max-width: 1080px) { .grid.two { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- stats */

.stat { padding: 18px 20px; }
.stat .k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-3);
  font-weight: 600;
}
.stat .v {
  font-family: var(--serif);
  font-size: 39px;
  line-height: 1.05;
  margin-top: 9px;
  letter-spacing: -.02em;
}
.stat .foot { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.stat .v.muted { color: var(--ink-3); }

/* --------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface);
}
tbody td { padding: 13px 20px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: var(--surface); }
td.num, th.num { text-align: right; }
td.tight { white-space: nowrap; }

.table-scroll { overflow-x: auto; }

/* --------------------------------------------------------------- pieces */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill.ok   { background: var(--ok-sub);   color: var(--ok); }
.pill.warn { background: var(--warn-sub); color: var(--warn); }
.pill.bad  { background: var(--bad-sub);  color: var(--bad); }
.pill.calm { background: var(--surface-2); color: var(--ink-2); }
.pill.gold { background: #fdf8ec; color: var(--gold); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-firm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #16304f; }
.btn.danger { color: var(--bad); border-color: #f3d3d3; }
.btn.danger:hover { background: var(--bad-sub); }
.btn.small { min-height: 31px; padding: 0 11px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- forms */

label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }

input[type=text], input[type=password], input[type=email], input[type=number],
select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-firm);
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-sub);
}
textarea {
  min-height: 150px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
}

.field { margin-bottom: 17px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
@media (max-width: 700px) { .field-row { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- notice */

.notice {
  padding: 12px 15px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1px solid;
}
.notice.ok   { background: var(--ok-sub);   border-color: #bbf7d0; color: #14532d; }
.notice.bad  { background: var(--bad-sub);  border-color: #fecaca; color: #7f1d1d; }
.notice.warn { background: var(--warn-sub); border-color: #fde68a; color: #78350f; }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-family: var(--serif); font-size: 19px; color: var(--ink-2); margin-bottom: 5px; }

/* ------------------------------------------------------------ transcript */

.turn { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 9px 0; }
.turn + .turn { border-top: 1px solid var(--line); }
.turn .who {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--ink-3);
  padding-top: 3px;
  font-weight: 600;
}
.turn.assistant .who { color: var(--accent); }

/* ----------------------------------------------------------------- login */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface);
}
.login {
  width: 100%;
  max-width: 372px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 34px;
  box-shadow: var(--shadow);
}
.login .name {
  font-family: var(--serif);
  font-size: 31px;
  text-align: center;
  letter-spacing: -.02em;
}
.login .sub {
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-3);
  margin: 8px 0 30px;
}

/* ------------------------------------------------------------------ misc */

.bar { height: 5px; background: var(--surface-2); border-radius: 100px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 100px; }

.split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 3px; }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 128px 1fr; gap: 9px 18px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 18px 0;
  }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 24px 18px 56px; }
  .page-head h1 { font-size: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
