/* Conversational Patient Experience — V1
   Palette: warm paper, deep teal ink, terracotta accent. Clinical calm without the cold blue. */

:root {
  --paper: #fbf8f2;
  --shell: #fffdf9;
  --surface: #ffffff;
  --ink: #1c2b2b;
  --ink-soft: #46595a;
  --muted: #7c8b88;
  --line: #e9e2d6;
  --line-strong: #d9cfbe;
  --teal: #0d6b5f;
  --teal-deep: #094f46;
  --teal-soft: #e3f0eb;
  --terra: #bc5f31;
  --terra-soft: #f8e9df;
  --gold: #b5842f;
  --gold-soft: #f8efd9;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(28, 43, 43, 0.04), 0 8px 24px rgba(28, 43, 43, 0.05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

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

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

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

.brand { display: flex; gap: 11px; align-items: center; padding: 0 6px; }

.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--teal);
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Fraunces', serif; font-size: 19px; font-weight: 700;
}

.brand-name { font-family: 'Fraunces', serif; font-size: 19px; line-height: 1.1; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); padding: 0 10px 6px;
}
.nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; border-radius: 10px;
  color: var(--ink-soft); font-size: 14px; text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav a:hover { background: #f2ece1; color: var(--ink); }
.nav a.active { background: var(--teal); color: #fff; }
.nav a.active .count { background: rgba(255,255,255,0.22); color: #fff; }
.count {
  font-size: 11px; background: #efe8db; color: var(--ink-soft);
  padding: 1px 7px; border-radius: 999px;
}

.sidebar-foot {
  margin-top: auto; font-size: 11.5px; color: var(--muted);
  border-top: 1px solid var(--line); padding-top: 14px; line-height: 1.5;
}

.main { padding: 30px 34px 56px; max-width: 1240px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 27px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 62ch; }
.eyebrow {
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--terra); font-weight: 600;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 16.5px; }
.card-head .hint { font-size: 12px; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }

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

.stat { padding: 18px 20px; }
.stat .label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: 'Fraunces', serif; font-size: 30px; line-height: 1.1; margin-top: 6px; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.teal { background: var(--teal-soft); border-color: #cfe4dd; }
.stat.teal .value { color: var(--teal-deep); }
.stat.terra { background: var(--terra-soft); border-color: #efd8c8; }
.stat.terra .value { color: var(--terra); }

/* ------------------------------------------------------------------ table */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-weight: 600; font-size: 11px; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
}
td { padding: 11px 10px; border-bottom: 1px solid #f2ece2; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fdfbf6; }
.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ bits */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: #f2ece1; color: var(--ink-soft);
}
.chip.good { background: var(--teal-soft); color: var(--teal-deep); }
.chip.bad { background: var(--terra-soft); color: var(--terra); }
.chip.warn { background: var(--gold-soft); color: var(--gold); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-small { padding: 6px 11px; font-size: 12.5px; }

select, input[type=text], input[type=date], textarea {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 9px 11px; width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 2px solid #cfe4dd; border-color: var(--teal); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.quote {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 14.5px; line-height: 1.6; color: var(--ink-soft);
  border-left: 2.5px solid var(--line-strong); padding-left: 12px; margin: 8px 0;
}
.quote.bad { border-color: #e5c3ae; }
.quote.good { border-color: #b9d9cf; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.right { text-align: right; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11.5px; }

.bar { height: 6px; background: #f0e9dd; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.bar.terra > span { background: var(--terra); }

.empty {
  padding: 34px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fffdf9;
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .main { padding: 20px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

/* ---- language switch ---- */
.lang-switch {
  margin-top: auto;
  display: flex;
  gap: 6px;
  padding: 0 4px 12px;
}

.lang-switch a {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  text-decoration: none;
}

.lang-switch a:hover { border-color: var(--line-strong); color: var(--ink); }
.lang-switch a.on { background: var(--teal); border-color: var(--teal); color: #fff; }

.sidebar-foot { margin-top: 0; }


.btn { white-space: nowrap; }

/* ---- daily volume chart ---- */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
  padding-top: 8px;
}

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }

.chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  width: 100%;
  justify-content: center;
}

.chart-bar { width: 42%; border-radius: 4px 4px 0 0; min-height: 2px; }
.chart-bar.calls { background: var(--teal); opacity: 0.85; }
.chart-bar.neg { background: var(--terra); opacity: 0.75; }

.chart-label {
  font-size: 9.5px;
  color: var(--muted);
  margin-top: 6px;
  white-space: nowrap;
}

/* fourteen columns is more than enough labels; show alternate days */
.chart-col:nth-child(even) .chart-label { visibility: hidden; }
