:root {
  --ink: #0B1B2E;
  --panel: #12253D;
  --panel-2: #182E4A;
  --brass: #C9A227;
  --brass-dim: #8A711D;
  --teal: #2F8F94;
  --coral: #C1633A;
  --sage: #6E9B6E;
  --cream: #F4F0E6;
  --slate: #8FA1B8;
  --line: rgba(244,240,230,0.09);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #060D18;
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  padding: 32px 12px;
}
.phone {
  width: 390px;
  max-width: 100%;
  background: var(--ink);
  border-radius: 34px;
  border: 1px solid rgba(244,240,230,0.08);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  color: var(--cream);
}
header {
  padding: 22px 22px 18px;
  background: linear-gradient(180deg, #0D2038, var(--ink));
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand svg { flex-shrink: 0; }
.brand-name {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.greet { font-size: 13px; color: var(--slate); margin-bottom: 2px; }
.clinic-name {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 500;
}
.clinic-select {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--cream);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  appearance: none;
  cursor: pointer;
  width: 100%;
}
.clinic-select:focus { outline: none; }
.period-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
  color: var(--slate);
}
.period-pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.02em;
}
.period-input {
  color: var(--cream);
  color-scheme: dark;
  cursor: pointer;
}

main { padding: 18px 18px 8px; min-height: 480px; }
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brass);
  font-weight: 600;
  margin: 22px 0 10px;
}
.section-label:first-child { margin-top: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 18px;
  margin-bottom: 12px;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.card-title { font-size: 14px; color: var(--slate); font-weight: 500; }
.card-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--brass);
  font-weight: 600;
}
.card-value {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 12px;
}
.card-value small { font-size: 15px; color: var(--slate); font-weight: 400; }

.gauge {
  position: relative;
  height: 8px;
  background: rgba(244,240,230,0.08);
  border-radius: 4px;
  margin-top: 4px;
}
.gauge-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--brass-dim), var(--brass));
  border-radius: 4px;
}
.gauge-tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--cream);
  opacity: 0.6;
}
.gauge-tick::after {
  content: attr(data-label);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: var(--slate);
  white-space: nowrap;
}
.readout-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--slate);
}
.readout-row b { color: var(--cream); font-weight: 600; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-item .bar-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.bar-item .bar-top span:first-child { color: var(--cream); }
.bar-item .bar-top span:last-child { font-family: 'IBM Plex Mono', monospace; color: var(--slate); font-size: 12px; }
.bar-track { height: 6px; background: rgba(244,240,230,0.08); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 3px; }

.lead-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.lead-item:last-child { border-bottom: none; }
.lead-name { font-size: 14px; font-weight: 500; }
.lead-tag {
  display: inline-block;
  margin-top: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--teal);
  background: rgba(47,143,148,0.12);
  border: 1px solid rgba(47,143,148,0.3);
  border-radius: 5px;
  padding: 2px 6px;
}
.lead-source { font-size: 11px; color: var(--slate); margin-top: 3px; }
.lead-status {
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--slate);
  text-align: right;
}

.status-list { display: flex; flex-direction: column; gap: 10px; }
.status-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.status-item .row1 { display: flex; justify-content: space-between; margin-bottom: 6px; }
.status-item .row1 span:first-child { font-size: 13px; font-weight: 500; }
.status-item .row1 span:last-child { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--slate); }

nav.tabbar {
  display: flex;
  border-top: 1px solid var(--line);
  background: #0A1830;
}
nav.tabbar button {
  flex: 1;
  background: none;
  border: none;
  color: var(--slate);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  padding: 12px 4px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
nav.tabbar button.active { color: var(--brass); }
nav.tabbar button svg { stroke: currentColor; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.empty-hint { color: var(--slate); font-size: 12px; padding: 8px 0 16px; }
