/* ============================================================
   Escriba — Copiloto Clínico
   Design system "Clinical Calm": petróleo profundo, papel quente,
   âmbar de destaque. Tipografia: Bricolage Grotesque + Instrument Sans.
   ============================================================ */

:root {
  /* paleta */
  --ink:         #11302f;
  --ink-soft:    #3d5856;
  --ink-faint:   #6e8482;
  --petrol-950:  #062a2c;
  --petrol-900:  #0b3d3f;
  --petrol-800:  #0f4d50;
  --petrol-600:  #19696c;
  --petrol-100:  #d9eae8;
  --paper:       #f5f2ea;
  --paper-deep:  #ece8dd;
  --card:        #fffdf8;
  --line:        #e0dacb;
  --line-soft:   #eae5d8;
  --amber:       #c87f33;
  --amber-deep:  #a8651f;
  --amber-soft:  #f7e9d4;
  --amber-glow:  #e8b06a;
  --green:       #2e7d5b;
  --green-soft:  #def0e5;
  --red:         #b3402f;
  --red-soft:    #f7e0da;
  --blue:        #2f6b8f;
  --blue-soft:   #ddecf4;

  /* tipografia */
  --font-display: "Bricolage Grotesque", Georgia, serif;
  --font-body:    "Instrument Sans", "Segoe UI", sans-serif;
  --font-mono:    "Spline Sans Mono", Consolas, monospace;

  /* forma */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(17, 48, 47, .06), 0 4px 14px rgba(17, 48, 47, .05);
  --shadow-2: 0 2px 6px rgba(17, 48, 47, .08), 0 14px 36px rgba(17, 48, 47, .10);
  --shadow-amber: 0 6px 20px rgba(200, 127, 51, .35);

  --sidebar-w: 264px;
  --speed: .22s;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(25, 105, 108, .07), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(200, 127, 51, .06), transparent 55%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.18; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
::selection { background: rgba(232, 176, 106, .45); }

*:focus-visible {
  outline: 2px solid var(--petrol-600);
  outline-offset: 2px;
  border-radius: 6px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cdc6b4; border-radius: 8px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  flex-shrink: 0;
  display: flex; flex-direction: column;
  padding: 26px 18px 20px;
  color: #ecf4f1;
  background:
    radial-gradient(420px 300px at 110% -8%, rgba(232, 176, 106, .14), transparent 60%),
    radial-gradient(500px 380px at -30% 110%, rgba(47, 130, 133, .25), transparent 65%),
    linear-gradient(168deg, var(--petrol-900), var(--petrol-950) 70%);
  z-index: 20;
}

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--amber-glow);
  padding: 4px 8px; margin-bottom: 30px;
}
.brand-mark { display: grid; place-items: center; }
.brand-text { display: flex; flex-direction: column; color: #f3f7f4; }
.brand-text strong { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: #9fc0ba; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-md);
  color: #c5dcd6; text-decoration: none; font-weight: 500;
  transition: background var(--speed), color var(--speed), transform var(--speed);
}
.side-nav a svg {
  width: 19px; height: 19px; fill: none;
  stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.side-nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.side-nav a.active {
  background: linear-gradient(135deg, rgba(232, 176, 106, .22), rgba(232, 176, 106, .10));
  color: #ffe9c8;
  box-shadow: inset 0 0 0 1px rgba(232, 176, 106, .35);
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.api-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 13px; border-radius: 999px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12.5px; color: #cfe2dd;
}
.api-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #8aa49f; flex-shrink: 0; }
.api-pill.ok .dot { background: #5fd49a; box-shadow: 0 0 0 4px rgba(95, 212, 154, .18); }
.api-pill.off .dot { background: var(--amber-glow); box-shadow: 0 0 0 4px rgba(232, 176, 106, .18); }
.side-disclaimer { font-size: 12px; color: #8fb0aa; line-height: 1.5; padding: 0 4px; }
.side-disclaimer strong { color: #cfe2dd; }

.main { flex: 1; min-width: 0; padding: 40px clamp(22px, 4.5vw, 64px) 80px; }

/* ---------- componentes ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  border: none; border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600; font-size: 14.5px; letter-spacing: .01em;
  transition: transform var(--speed), box-shadow var(--speed), background var(--speed), opacity var(--speed);
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  box-shadow: var(--shadow-amber);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(200, 127, 51, .45); }

.btn-dark {
  color: #f0f6f3;
  background: linear-gradient(135deg, var(--petrol-800), var(--petrol-950));
  box-shadow: 0 4px 16px rgba(11, 61, 63, .30);
}
.btn-dark:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11, 61, 63, .40); }

.btn-ghost {
  background: transparent; color: var(--ink-soft);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-ghost:hover { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px #cfc7b2, var(--shadow-1); }

.btn-soft {
  background: var(--petrol-100); color: var(--petrol-800);
}
.btn-soft:hover { background: #cbe2df; transform: translateY(-1px); }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  transition: all var(--speed);
}
.icon-btn:hover { color: var(--ink); border-color: #cabfa4; box-shadow: var(--shadow-1); transform: translateY(-1px); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.danger:hover { color: var(--red); border-color: #ddb1a8; background: var(--red-soft); }

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-draft  { background: var(--amber-soft); color: var(--amber-deep); }
.badge-done   { background: var(--green-soft); color: var(--green); }
.badge-info   { background: var(--blue-soft); color: var(--blue); }

.chip {
  display: inline-flex; align-items: center;
  padding: 4px 11px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-soft);
  font-size: 12px; font-weight: 500;
}

/* inputs */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: .02em; }
.field .hint { font-size: 12px; color: var(--ink-faint); }

.input, .select, .textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  transition: border-color var(--speed), box-shadow var(--speed);
}
.input:hover, .select:hover, .textarea:hover { border-color: #cabfa4; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--petrol-600);
  box-shadow: 0 0 0 4px rgba(25, 105, 108, .12);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233d5856' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 38px; }

/* segmented control */
.segmented {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--paper-deep);
  padding: 5px; border-radius: var(--r-md);
}
.segmented button {
  flex: 1 0 auto;
  border: none; background: transparent;
  padding: 9px 14px; border-radius: 10px;
  font-weight: 500; font-size: 13.5px; color: var(--ink-soft);
  transition: all var(--speed);
}
.segmented button:hover { color: var(--ink); }
.segmented button.on {
  background: #fff; color: var(--petrol-800); font-weight: 600;
  box-shadow: 0 1px 4px rgba(17,48,47,.12);
}

/* ---------- dashboard ---------- */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 30px;
}
.hero .eyebrow {
  font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--amber-deep); font-weight: 600; margin-bottom: 10px;
}
.hero h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; max-width: 640px; }
.hero h1 em { font-style: italic; color: var(--petrol-600); }
.hero .sub { margin-top: 12px; color: var(--ink-soft); max-width: 560px; font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 34px; }
.stat {
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 4px;
  animation: rise .5s both;
}
.stat:nth-child(2) { animation-delay: .06s; }
.stat:nth-child(3) { animation-delay: .12s; }
.stat .num { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--petrol-800); }
.stat .lbl { font-size: 13px; color: var(--ink-faint); font-weight: 500; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 16px; }
.section-head h2 { font-size: 21px; font-weight: 650; }

.consult-list { display: flex; flex-direction: column; gap: 12px; }
.consult-item {
  display: flex; align-items: center; gap: 18px;
  padding: 18px 22px;
  cursor: pointer;
  transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed);
  animation: rise .45s both;
}
.consult-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #d6cdb6; }
.consult-item .c-main { flex: 1; min-width: 0; }
.consult-item .c-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 5px; }
.consult-item .c-title strong { font-size: 15.5px; }
.consult-item .c-preview {
  color: var(--ink-faint); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60ch;
}
.consult-item .c-date { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }

.empty {
  padding: 60px 30px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.empty svg { width: 130px; height: auto; }
.empty h3 { font-size: 22px; font-weight: 650; }
.empty p { color: var(--ink-soft); max-width: 420px; }
.empty .actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ---------- nova consulta ---------- */
.page-head { margin-bottom: 26px; }
.page-head .crumb {
  font-size: 13px; color: var(--ink-faint); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px;
}
.page-head .crumb:hover { color: var(--petrol-800); }
.page-head h1 { font-size: clamp(26px, 3.2vw, 34px); font-weight: 700; }
.page-head .sub { color: var(--ink-soft); margin-top: 8px; }

.nova-grid {
  display: grid; grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 22px; align-items: start;
}
.panel { padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.panel h2 { font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 10px; }
.panel h2 .step {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--petrol-100); color: var(--petrol-800);
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
}
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.calc-value { padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--line); background: var(--line-soft); font-weight: 700; color: var(--ink-soft); font-size: 14px; }
@media (max-width: 560px) { .card-grid { grid-template-columns: 1fr 1fr; } }
.gest-insights { margin: 2px 0 4px; }
.gest-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.gest-alert, .gest-next { border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.gest-alert { background: rgba(179,64,47,.08); border: 1px solid rgba(179,64,47,.28); }
.gest-alert strong { color: #b3402f; }
.gest-next { background: var(--line-soft); border: 1px solid var(--line); }
.gest-next strong { color: #9b3b6a; }
.gest-alert ul, .gest-next ul { margin: 6px 0 0; padding-left: 18px; }
.gest-alert li, .gest-next li { margin: 2px 0; }
.gest-evo { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.gest-evo-title { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; }
.gest-table-wrap { overflow-x: auto; }
.gest-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gest-table th { text-align: left; font-size: 11px; color: var(--ink-faint); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.gest-table td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.gest-table tr.cur-row { background: var(--line-soft); }
.gest-table td.cur { font-weight: 700; }
.gest-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.gest-chart { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--line-soft); }
.gest-chart-h { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.gest-chart-svg { width: 100%; height: auto; display: block; }
.mel-preview { max-width: 260px; max-height: 260px; border-radius: 12px; margin: 12px 0; border: 1px solid var(--line); }
.mel-result { margin-top: 6px; }
.mel-card { border-radius: 14px; padding: 16px 18px; border: 1px solid var(--line); }
.mel-card.mel-high { background: rgba(179,64,47,.08); border-color: rgba(179,64,47,.35); }
.mel-card.mel-low { background: rgba(46,125,91,.08); border-color: rgba(46,125,91,.3); }
.mel-pct { font-size: 34px; font-weight: 800; line-height: 1; }
.mel-high .mel-pct { color: #b3402f; }
.mel-low .mel-pct { color: #2e7d5b; }
.mel-lbl { font-weight: 600; margin: 4px 0 10px; }
.mel-bar { height: 8px; border-radius: 6px; background: var(--line-soft); overflow: hidden; }
.mel-bar span { display: block; height: 100%; background: linear-gradient(90deg,#2e7d5b,#e0b34a,#b3402f); }
.mel-history { margin-top: 8px; }
.mel-hist-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0; color: var(--ink-soft); }
.mel-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mel-dot.hi { background: #b3402f; } .mel-dot.lo { background: #2e7d5b; }
.mel-when { margin-left: auto; color: var(--ink-faint); font-size: 11.5px; }
/* galeria de lesões de pele */
.lesion-upload { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.lesion-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.lesion-card { border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: var(--line-soft); display: flex; flex-direction: column; gap: 6px; }
.lesion-pick { font-size: 11px; color: var(--ink-faint); display: flex; align-items: center; gap: 5px; }
.lesion-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: #00000010; }
.lesion-label { font-size: 12px; padding: 5px 8px; }
.lesion-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lesion-mel { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.lesion-mel.hi { background: rgba(179,64,47,.14); color: #b3402f; }
.lesion-mel.lo { background: rgba(46,125,91,.14); color: #2e7d5b; }
.lesion-actions { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.lesion-compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lesion-cmp { margin: 0; }
.lesion-cmp img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.lesion-cmp figcaption { font-size: 11.5px; color: var(--ink-soft); margin-top: 4px; }
.lesion-compare { margin-top: 12px; }

.transcript-zone { position: relative; }
.transcript-zone .textarea { min-height: 320px; font-size: 15px; padding-bottom: 52px; }
.transcript-tools {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  display: flex; align-items: center; gap: 10px;
  pointer-events: none;
}
.transcript-tools > * { pointer-events: auto; }
.char-count { margin-left: auto; font-size: 12px; color: var(--ink-faint); font-family: var(--font-mono); background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: 8px; }

.mic-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink-soft);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  transition: all var(--speed);
}
.mic-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mic-btn:hover { border-color: var(--petrol-600); color: var(--petrol-800); }
.mic-btn.rec {
  background: var(--red); border-color: var(--red); color: #fff;
  animation: micPulse 1.6s ease-out infinite;
}
@keyframes micPulse {
  0%   { box-shadow: 0 0 0 0 rgba(179, 64, 47, .45); }
  100% { box-shadow: 0 0 0 14px rgba(179, 64, 47, 0); }
}
.interim {
  margin-top: 8px; font-size: 13.5px; color: var(--ink-faint); font-style: italic; min-height: 20px;
}

.gen-bar {
  margin-top: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--petrol-900), var(--petrol-950));
  border-radius: var(--r-lg);
  color: #d9e9e4;
  box-shadow: 0 10px 30px rgba(6, 42, 44, .25);
}
.gen-bar .note { font-size: 13px; max-width: 480px; color: #a9c6bf; }
.gen-bar .note strong { color: #ffe9c8; }
.gen-bar .actions { display: flex; gap: 10px; align-items: center; }

.demo-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--amber-soft); border: 1px solid #ecd3ad;
  padding: 13px 16px; border-radius: var(--r-md);
  font-size: 13.5px; color: var(--amber-deep);
}

/* ---------- overlay de geração ---------- */
.gen-overlay[hidden] { display: none; }
.gen-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(6, 32, 33, .55);
  backdrop-filter: blur(8px);
  animation: fadeIn .25s both;
}
.gen-card {
  width: min(480px, calc(100vw - 40px));
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 34px 36px 28px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: popIn .35s cubic-bezier(.2, 1.4, .4, 1) both;
}
.gen-pulse { width: 100%; height: 64px; color: var(--petrol-600); }
.gen-pulse svg { width: 100%; height: 100%; }
.gen-pulse path { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.pulse-track { stroke: var(--line); }
.pulse-line {
  stroke: var(--amber);
  stroke-dasharray: 130 620;
  animation: pulseSweep 2.1s linear infinite;
}
@keyframes pulseSweep { from { stroke-dashoffset: 750; } to { stroke-dashoffset: 0; } }

.gen-title { font-size: 23px; font-weight: 700; margin-top: 8px; }
.gen-sub { font-size: 13px; color: var(--ink-faint); font-family: var(--font-mono); }

.gen-stages {
  list-style: none; margin: 18px 0 16px; padding: 0;
  width: 100%; display: flex; flex-direction: column; gap: 9px;
}
.gen-stages li {
  display: flex; align-items: center; gap: 11px;
  font-size: 14px; color: var(--ink-faint);
  transition: color var(--speed);
}
.gen-stages li .tick {
  display: inline-grid; place-items: center;
  width: 21px; height: 21px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--line); background: #fff;
  transition: all var(--speed);
}
.gen-stages li .tick svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.gen-stages li.doing { color: var(--ink); font-weight: 600; }
.gen-stages li.doing .tick { border-color: var(--amber); animation: spinDot 1s linear infinite; border-top-color: transparent; }
.gen-stages li.done { color: var(--ink-soft); }
.gen-stages li.done .tick { background: var(--green); border-color: var(--green); }
.gen-stages li.done .tick svg { opacity: 1; }
@keyframes spinDot { to { transform: rotate(360deg); } }

/* ---------- revisão ---------- */
.review-head {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.review-head .titles { flex: 1; min-width: 240px; }
.review-head h1 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.review-head .meta-line { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.review-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.review-grid {
  display: grid;
  grid-template-columns: 198px minmax(0, 1fr) 308px;
  gap: 20px; align-items: start;
}

.doc-nav {
  position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px;
}
.doc-nav button {
  display: flex; align-items: center; gap: 10px;
  border: none; background: transparent; text-align: left;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  transition: all var(--speed);
}
.doc-nav button .n-ico { font-size: 15px; width: 20px; text-align: center; }
.doc-nav button:hover { background: var(--paper-deep); color: var(--ink); }
.doc-nav button.on {
  background: var(--petrol-900); color: #ffe9c8; font-weight: 600;
  box-shadow: 0 4px 14px rgba(6,42,44,.25);
}

.doc-panel { padding: 28px 30px; animation: rise .35s both; }
.doc-panel + .doc-panel { margin-top: 18px; }
.doc-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.doc-panel-head h2 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.doc-panel-head .tools { display: flex; gap: 8px; }

.doc-fields { display: flex; flex-direction: column; gap: 18px; }
.doc-fields .field > label { color: var(--petrol-800); text-transform: uppercase; font-size: 11.5px; letter-spacing: .1em; }
.auto-ta { overflow: hidden; }

.hypo-card, .exam-card {
  border: 1px solid var(--line-soft);
  background: #fcfaf4;
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.hypo-card .idx {
  position: absolute; top: -10px; left: 16px;
  background: var(--petrol-800); color: #ffe9c8;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 999px;
}
.mini-remove {
  position: absolute; top: 10px; right: 10px;
  border: none; background: transparent; color: var(--ink-faint);
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
}
.mini-remove:hover { background: var(--red-soft); color: var(--red); }
.add-row {
  border: 1.5px dashed var(--line); background: transparent;
  border-radius: var(--r-md); padding: 11px;
  color: var(--ink-faint); font-weight: 600; font-size: 13.5px;
  transition: all var(--speed);
}
.add-row:hover { border-color: var(--petrol-600); color: var(--petrol-800); background: rgba(25,105,108,.04); }

.safety-strip {
  margin-top: 22px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12.5px; color: var(--ink-faint);
  border-top: 1px dashed var(--line); padding-top: 14px;
}
.safety-strip svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; fill: none; stroke: var(--amber-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* coluna direita */
.rail { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.rail-card { padding: 20px 22px; }
.rail-card h3 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.rail-card h3 .count {
  margin-left: auto;
  background: var(--paper-deep); color: var(--ink-soft);
  font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
}
.rail-card.alerts { border-left: 4px solid var(--amber); }
.rail-card.alerts h3 { color: var(--amber-deep); }
.rail-card ul { margin: 0; padding: 0 0 0 2px; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.rail-card ul li {
  font-size: 13px; color: var(--ink-soft); line-height: 1.45;
  padding-left: 18px; position: relative;
}
.rail-card ul li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}
.rail-card.missing ul li::before { background: var(--blue); }

.checklist { display: flex; flex-direction: column; gap: 4px; }
.checklist label {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; line-height: 1.45; color: var(--ink-soft);
  cursor: pointer; transition: background var(--speed);
}
.checklist label:hover { background: var(--paper-deep); }
.checklist input {
  appearance: none; flex-shrink: 0; margin-top: 1px;
  width: 19px; height: 19px; border-radius: 6px;
  border: 1.7px solid #c2b89e; background: #fff;
  display: grid; place-items: center;
  transition: all var(--speed); cursor: pointer;
}
.checklist input::after {
  content: ""; width: 10px; height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
  transform: scale(0); transition: transform .18s cubic-bezier(.2, 1.6, .4, 1);
}
.checklist input:checked { background: var(--green); border-color: var(--green); }
.checklist input:checked::after { transform: scale(1); }
.checklist label.ok { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: rgba(46,125,91,.5); }

.progress-track {
  height: 7px; border-radius: 999px; background: var(--paper-deep);
  overflow: hidden; margin: 12px 0 14px;
}
.progress-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--green), #51a981);
  transition: width .4s cubic-bezier(.3, 1, .4, 1);
}
.finish-btn { width: 100%; }

/* ---------- autenticação ---------- */
body.locked .shell { display: none; }

.auth-screen {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-columns: minmax(380px, 46%) 1fr;
  background: var(--paper);
}
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 52px;
  color: #ecf4f1;
  background:
    radial-gradient(560px 420px at 110% -10%, rgba(232, 176, 106, .18), transparent 60%),
    radial-gradient(640px 480px at -20% 115%, rgba(47, 130, 133, .30), transparent 65%),
    linear-gradient(160deg, var(--petrol-900), var(--petrol-950) 70%);
}
.auth-brand .brand { margin-bottom: 0; }
.auth-pitch h2 {
  font-size: clamp(28px, 3.2vw, 40px); font-weight: 700; color: #f3f7f4;
  max-width: 420px; margin-bottom: 18px;
}
.auth-pitch h2 em { font-style: italic; color: var(--amber-glow); }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 13px; }
.auth-points li {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14.5px; color: #b9d2cc; max-width: 400px;
}
.auth-points li::before {
  content: ""; flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 50%;
  background: rgba(232,176,106,.18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8b06a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat;
}
.auth-brand .fineprint { font-size: 12px; color: #7fa39c; max-width: 380px; }

.auth-side {
  display: grid; place-items: center; padding: 40px 24px;
  overflow-y: auto;
}
.auth-box { width: min(420px, 100%); }
.auth-box h1 { font-size: 27px; font-weight: 700; margin-bottom: 6px; }
.auth-box .sub { color: var(--ink-soft); margin-bottom: 26px; }
.auth-tabs { display: flex; gap: 6px; background: var(--paper-deep); padding: 5px; border-radius: var(--r-md); margin-bottom: 24px; }
.auth-tabs button {
  flex: 1; border: none; background: transparent;
  padding: 10px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-soft);
  transition: all var(--speed);
}
.auth-tabs button.on { background: #fff; color: var(--petrol-800); box-shadow: 0 1px 4px rgba(17,48,47,.12); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn { margin-top: 6px; }
.auth-error {
  background: var(--red-soft); color: var(--red);
  border: 1px solid #e7c0b8; border-radius: var(--r-sm);
  padding: 11px 14px; font-size: 13.5px; font-weight: 500;
}

@media (max-width: 900px) {
  .auth-screen { grid-template-columns: 1fr; overflow-y: auto; display: block; }
  .auth-brand { padding: 30px 26px; gap: 22px; }
  .auth-pitch h2 { font-size: 24px; margin-bottom: 12px; }
  .auth-points { display: none; }
  .auth-side { padding: 32px 22px 60px; }
}

.divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 18px; color: var(--ink-faint); font-size: 12.5px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.btn-google {
  width: 100%;
  background: #fff; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
  gap: 11px;
}
.btn-google:hover { box-shadow: inset 0 0 0 1.5px #cfc7b2, var(--shadow-1); transform: translateY(-1px); }

/* ---------- usuário na sidebar ---------- */
.side-user { margin-top: 18px; }
.user-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--r-md);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--amber-glow), var(--amber));
  color: var(--petrol-950); font-weight: 700; font-size: 14px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-card .u-info { min-width: 0; flex: 1; }
.user-card .u-name {
  font-size: 13.5px; font-weight: 600; color: #ecf4f1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-card .u-sub { font-size: 11.5px; color: #8fb0aa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card .u-exit {
  border: none; background: transparent; color: #8fb0aa;
  font-size: 11.5px; font-weight: 600; padding: 4px 6px; border-radius: 6px;
}
.user-card .u-exit:hover { color: #ffd9a8; background: rgba(255,255,255,.07); }

/* ---------- áudio da consulta ---------- */
.audio-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audio-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--petrol-100); color: var(--petrol-800);
  border-radius: 999px; padding: 7px 8px 7px 14px;
  font-size: 13px; font-weight: 600;
}
.audio-chip .x {
  border: none; background: rgba(255,255,255,.6); color: var(--petrol-800);
  width: 22px; height: 22px; border-radius: 50%; font-size: 11px;
  display: grid; place-items: center;
}
.audio-chip .x:hover { background: var(--red-soft); color: var(--red); }
.rec-timer { font-family: var(--font-mono); font-size: 12.5px; color: var(--red); font-weight: 600; }

.audio-player-card audio { width: 100%; margin-top: 10px; }

/* ---------- pacientes ---------- */
.patients-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.patient-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; cursor: pointer;
  transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed);
  animation: rise .45s both;
}
.patient-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #d6cdb6; }
.patient-card .p-info { flex: 1; min-width: 0; }
.patient-card strong { font-size: 16px; display: block; margin-bottom: 5px; }
.patient-card .p-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.patient-card .p-meta { font-size: 12.5px; color: var(--ink-faint); }
.patient-card .p-arrow { color: var(--ink-faint); font-size: 18px; transition: transform var(--speed), color var(--speed); }
.patient-card:hover .p-arrow { transform: translateX(3px); color: var(--petrol-800); }

.avatar-lg {
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--petrol-600), var(--petrol-900));
  color: #ffe9c8; font-weight: 700; font-size: 15px;
  font-family: var(--font-body);
}

.chip-link { text-decoration: none; transition: background var(--speed), color var(--speed); }
.chip-link:hover { background: var(--petrol-100); color: var(--petrol-800); }

/* ---------- linha do tempo do prontuário ---------- */
.timeline { display: flex; flex-direction: column; max-width: 820px; }
.tl-item { display: flex; gap: 18px; animation: rise .45s both; }
.tl-marker { display: flex; flex-direction: column; align-items: center; width: 22px; flex-shrink: 0; }
.tl-dot {
  width: 14px; height: 14px; border-radius: 50%; margin-top: 26px; flex-shrink: 0;
  background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft);
}
.tl-dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.tl-line { flex: 1; width: 2px; background: var(--line); margin-top: 6px; min-height: 26px; }
.tl-card {
  flex: 1; padding: 18px 22px; margin-bottom: 16px; cursor: pointer;
  transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed);
}
.tl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: #d6cdb6; }
.tl-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 7px; }
.tl-head strong { font-size: 14.5px; color: var(--petrol-800); }
.tl-complaint {
  font-size: 13.5px; color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72ch;
}

/* ---------- contato do paciente ---------- */
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  text-decoration: none; transition: all var(--speed);
}
.contact-btn:hover { border-color: var(--petrol-600); color: var(--petrol-800); transform: translateY(-1px); box-shadow: var(--shadow-1); }

/* ---------- templates de receita ---------- */
.tpl-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--paper-deep); border-radius: var(--r-md); padding: 10px 12px;
}
.tpl-bar .select { background-color: #fff; }

/* ---------- agenda ---------- */
.agenda-day { margin-bottom: 26px; max-width: 920px; }
.agenda-day-title {
  font-size: 17px; font-weight: 700; margin-bottom: 12px;
  text-transform: capitalize; display: flex; align-items: center;
}
.appt-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.appt-row:last-child { border-bottom: none; }
.appt-row.cancelled { opacity: .55; }
.appt-row.cancelled .appt-name { text-decoration: line-through; }
.appt-time { display: flex; flex-direction: column; min-width: 64px; }
.appt-time strong { font-family: var(--font-display); font-size: 17px; color: var(--petrol-800); }
.appt-time span { font-size: 11.5px; color: var(--ink-faint); }
.appt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.appt-name { font-weight: 600; font-size: 14.5px; color: var(--ink); text-decoration: none; }
a.appt-name:hover { color: var(--petrol-800); text-decoration: underline; }
.appt-status {
  border: none; border-radius: 999px;
  padding: 6px 14px; font-size: 12px; font-weight: 700;
  transition: transform var(--speed), filter var(--speed);
}
.appt-status:hover { transform: translateY(-1px); filter: brightness(.96); }
.appt-status.st-agendado   { background: var(--amber-soft); color: var(--amber-deep); }
.appt-status.st-confirmado { background: var(--blue-soft); color: var(--blue); }
.appt-status.st-realizado  { background: var(--green-soft); color: var(--green); }
.appt-status.st-cancelado  { background: var(--red-soft); color: var(--red); }

.today-strip {
  padding: 16px 22px; margin-bottom: 28px;
  border-left: 4px solid var(--petrol-600);
}
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 9px; }
.today-head strong { font-size: 14.5px; color: var(--petrol-800); }
.today-link { font-size: 13px; color: var(--amber-deep); text-decoration: none; font-weight: 600; }
.today-link:hover { text-decoration: underline; }
.today-items { display: flex; gap: 8px; flex-wrap: wrap; }
.today-item {
  background: var(--paper-deep); border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; color: var(--ink-soft);
}
.today-item strong { color: var(--petrol-800); }
.today-item em { font-style: normal; color: var(--ink-faint); }

/* ---------- financeiro ---------- */
.month-nav {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; font-size: 16px;
}
.pay-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; }
.pay-value { font-family: var(--font-display); font-size: 17px; color: var(--amber-deep); white-space: nowrap; }
.pay-value.ok { color: var(--green); }

/* ---------- perfil ---------- */
.profile-grid { display: grid; grid-template-columns: minmax(300px, 520px); gap: 22px; }

/* ---------- papéis ---------- */
body.role-recepcao #sideNav a[data-route="home"],
body.role-recepcao #sideNav a[data-route="nova"] { display: none; }

/* ---------- LGPD ---------- */
.consent-check {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--green-soft); border: 1px solid #bfdfcd;
  border-radius: var(--r-md); padding: 13px 15px;
  font-size: 13px; line-height: 1.5; color: var(--green); cursor: pointer;
}
.consent-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--green); flex-shrink: 0; }

.invite-code {
  font-family: var(--font-mono); font-size: 19px; letter-spacing: .18em;
  background: var(--petrol-950); color: var(--amber-glow);
  padding: 9px 18px; border-radius: 10px;
}

.team-list { display: flex; flex-direction: column; gap: 6px; }
.team-row {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 10px; background: var(--paper-deep);
  font-size: 13.5px;
}
.team-name { flex: 1; font-weight: 600; }
.code-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--r-md);
}

.audit-list { margin-top: 14px; max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.audit-row {
  display: flex; gap: 12px; font-size: 12.5px; color: var(--ink-soft);
  padding: 7px 10px; border-radius: 8px;
}
.audit-row:nth-child(odd) { background: var(--paper-deep); }
.audit-ts { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); white-space: nowrap; margin-top: 1px; }

/* ---------- lembretes ---------- */
.reminder-item { text-decoration: none; cursor: pointer; transition: all var(--speed); }
.reminder-item:hover { background: var(--amber-soft); color: var(--amber-deep); }
.reminder-item.sent { background: var(--green-soft); color: var(--green); }

/* ---------- gráfico financeiro ---------- */
.fin-row { display: grid; grid-template-columns: minmax(320px, 1.4fr) minmax(260px, 1fr); gap: 16px; margin-bottom: 26px; }
@media (max-width: 900px) { .fin-row { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 14px; padding-top: 16px; min-height: 160px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 52px; border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #cfe2dd, #b5d2cb);
  transition: height .5s cubic-bezier(.3, 1, .4, 1);
}
.bar.on { background: linear-gradient(180deg, var(--amber-glow), var(--amber)); }
.bar-lbl { font-size: 11.5px; color: var(--ink-faint); text-transform: capitalize; }
.bar-val { font-size: 10.5px; color: var(--ink-soft); font-family: var(--font-mono); }
.method-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.method-row:last-of-type { border-bottom: none; }

/* ---------- consulta ao vivo ---------- */
.rec-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #ff6b52; flex-shrink: 0;
  animation: recBlink 1.4s ease-in-out infinite;
}
@keyframes recBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.live-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.live-id { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-id strong { font-family: var(--font-display); font-size: 21px; }
.live-rec {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--petrol-950); color: #ffd9cd;
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  padding: 6px 13px; border-radius: 999px;
}
.live-timer {
  font-family: var(--font-mono); font-size: 14px; color: var(--ink-soft);
  background: var(--paper-deep); padding: 5px 12px; border-radius: 999px;
}

.live-grid {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 20px; align-items: start;
}
@media (max-width: 980px) { .live-grid { grid-template-columns: 1fr; } }

.live-left h2, .live-right h2 { display: flex; align-items: center; gap: 10px; }
.live-ta { min-height: 56vh; font-size: 15px; line-height: 1.7; }
.live-right { position: sticky; top: 20px; border-top: 4px solid var(--amber); }
.live-right h2 .count { margin-left: auto; background: var(--paper-deep); font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 999px; color: var(--ink-soft); }

.cov-list { display: flex; flex-direction: column; gap: 5px; }
.cov-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--ink-faint);
  padding: 4px 2px; transition: color var(--speed);
}
.cov-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--paper-deep); border: 1.5px solid var(--line);
  transition: all .35s;
}
.cov-item.parcial { color: var(--ink-soft); }
.cov-item.parcial .cov-dot { background: var(--amber-glow); border-color: var(--amber); }
.cov-item.coberto { color: var(--ink); }
.cov-item.coberto .cov-dot { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.live-alerts { display: flex; flex-direction: column; gap: 8px; min-height: 10px; }
.live-alert {
  background: var(--amber-soft); border: 1px solid #ecd3ad;
  border-radius: var(--r-sm); padding: 10px 13px;
  font-size: 12.5px; color: var(--amber-deep); line-height: 1.45;
  animation: rise .4s both;
}
.live-questions { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; min-height: 10px; }
.live-questions li { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; animation: rise .4s both; }
.live-status { font-size: 11.5px; color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------- Sentinela ---------- */
.sentinel-card {
  padding: 24px 28px;
  border-top: 4px solid var(--petrol-600);
  background:
    radial-gradient(480px 200px at 100% 0%, rgba(25, 105, 108, .06), transparent 60%),
    var(--card);
  max-width: 920px;
}
.sent-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sent-head h3 { font-size: 16.5px; font-weight: 700; color: var(--petrol-800); }
.sent-briefing {
  margin: 16px 0 18px; padding: 14px 18px;
  border-left: 3px solid var(--amber);
  background: #fcfaf4; border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 14.5px; line-height: 1.65; color: var(--ink);
  font-style: normal;
}
.sent-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.sent-sub {
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--petrol-800); margin: 0 0 10px;
}
.sent-pend-list { display: flex; flex-direction: column; gap: 8px; }
.sent-pend {
  display: flex; align-items: center; gap: 11px;
  background: #fcfaf4; border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 10px 13px;
}
.pend-type {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 999px; flex-shrink: 0;
}
.pend-type.blue   { background: var(--blue-soft); color: var(--blue); }
.pend-type.amber  { background: var(--amber-soft); color: var(--amber-deep); }
.pend-type.petrol { background: var(--petrol-100); color: var(--petrol-800); }
.pend-type.red    { background: var(--red-soft); color: var(--red); }
.pend-type.gray   { background: var(--paper-deep); color: var(--ink-soft); }
.pend-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pend-body span { font-size: 13px; line-height: 1.4; }
.pend-body small { font-size: 11px; color: var(--ink-faint); }
.sent-attn { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sent-attn li {
  font-size: 13px; color: var(--ink-soft); line-height: 1.45;
  padding-left: 17px; position: relative;
}
.sent-attn li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--petrol-600);
}
.sent-foot { margin-top: 18px; font-size: 11.5px; color: var(--ink-faint); border-top: 1px dashed var(--line); padding-top: 11px; }

.param-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.param-card {
  background: #fcfaf4; border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 13px 15px 11px; display: flex; flex-direction: column; gap: 6px;
}
.param-name { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); letter-spacing: .03em; }
.spark { width: 100%; height: 40px; }
.spark polyline { fill: none; stroke: var(--petrol-600); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--amber); }
.param-val { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
.param-val.down { color: var(--green); }
.param-val.up { color: var(--amber-deep); }

/* radar no início */
.radar-card { padding: 18px 22px; margin-bottom: 26px; border-left: 4px solid var(--amber); }
.radar-list { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
.radar-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px;
}
.radar-row:hover { background: var(--paper-deep); }
.radar-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); flex-shrink: 0; }
.radar-dot.high { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.radar-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.radar-name { font-size: 13.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.radar-name:hover { color: var(--petrol-800); text-decoration: underline; }
.radar-sum { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radar-days { font-family: var(--font-mono); font-size: 12px; color: var(--amber-deep); font-weight: 600; }

/* ---------- exames laboratoriais ---------- */
.patient-extras {
  display: grid; grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 1fr);
  gap: 16px; margin-bottom: 24px; align-items: start; max-width: 1100px;
}
@media (max-width: 980px) { .patient-extras { grid-template-columns: 1fr; } }

.labs-card h3, .ask-card h3 { display: flex; align-items: center; gap: 10px; }
.lab-item {
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 11px 14px; margin-top: 10px; background: #fcfaf4;
}
.lab-item summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  cursor: pointer; font-size: 13.5px; list-style: none;
}
.lab-item summary::-webkit-details-marker { display: none; }
.lab-summary { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 8px; }
.lab-table { display: flex; flex-direction: column; gap: 2px; }
.lab-row {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 28px;
  gap: 8px; align-items: center;
  font-size: 12.5px; padding: 6px 8px; border-radius: 7px;
}
.lab-row:nth-child(odd) { background: rgba(255,255,255,.6); }
.lab-row.alto, .lab-row.baixo { background: var(--amber-soft); }
.lr-name { font-weight: 600; color: var(--ink); }
.lr-val { font-family: var(--font-mono); }
.lr-ref { color: var(--ink-faint); font-size: 11.5px; }
.lr-flag { text-align: center; font-weight: 700; }
.lr-flag.normal { color: var(--green); }
.lr-flag.alto { color: var(--red); }
.lr-flag.baixo { color: var(--blue); }

/* ---------- pergunte ao prontuário ---------- */
.ask-msgs {
  display: flex; flex-direction: column; gap: 9px;
  max-height: 320px; overflow-y: auto;
  margin: 12px 0; padding-right: 4px;
}
.ask-bubble {
  max-width: 88%; padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.5; animation: rise .3s both;
}
.ask-bubble.bot { background: var(--paper-deep); color: var(--ink); border-bottom-left-radius: 4px; align-self: flex-start; }
.ask-bubble.me { background: var(--petrol-800); color: #eef6f2; border-bottom-right-radius: 4px; align-self: flex-end; }
.ask-bubble.thinking { color: var(--ink-faint); font-style: italic; animation: pulseSoft 1.4s ease-in-out infinite; }
@keyframes pulseSoft { 50% { opacity: .5; } }
.ask-form { display: flex; gap: 8px; }
.ask-form .input { flex: 1; }

/* ---------- CID-10 ---------- */
.cid-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cid-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--blue-soft); color: var(--blue);
  border-radius: 999px; padding: 6px 8px 6px 13px;
  font-size: 12.5px;
}
.cid-chip b { font-family: var(--font-mono); }
.cid-chip .x {
  border: none; background: rgba(255,255,255,.65); color: var(--blue);
  width: 20px; height: 20px; border-radius: 50%; font-size: 10px;
  display: grid; place-items: center; cursor: pointer;
}
.cid-chip .x:hover { background: var(--red-soft); color: var(--red); }

/* ---------- triagem da receita ---------- */
.rxcheck-results { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rxcheck-item {
  border-radius: var(--r-sm); padding: 10px 14px;
  font-size: 13px; line-height: 1.45; border: 1px solid;
  animation: rise .35s both;
}
.rxcheck-item.alerta  { background: var(--red-soft); color: var(--red); border-color: #e7c0b8; font-weight: 600; }
.rxcheck-item.atencao { background: var(--amber-soft); color: var(--amber-deep); border-color: #ecd3ad; }
.rxcheck-item.info    { background: var(--blue-soft); color: var(--blue); border-color: #c4dcea; }

/* ---------- busca global (Ctrl+K) ---------- */
.gsearch-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(6, 32, 33, .45);
  backdrop-filter: blur(5px);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh;
  animation: fadeIn .15s both;
}
.gsearch-box {
  width: min(620px, calc(100vw - 40px));
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  overflow: hidden;
  animation: popIn .25s cubic-bezier(.2, 1.4, .4, 1) both;
}
.gsearch-input {
  width: 100%; border: none; outline: none;
  font: inherit; font-size: 16.5px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: transparent; color: var(--ink);
}
.gsearch-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.gsearch-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); padding: 10px 14px 4px;
}
.gsearch-item {
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 14px; border-radius: 10px; cursor: pointer;
}
.gsearch-item strong { font-size: 14px; }
.gsearch-item span { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-item.on { background: var(--petrol-900); }
.gsearch-item.on strong { color: #ffe9c8; }
.gsearch-item.on span { color: #9fc0ba; }
.gsearch-hint { padding: 16px 14px; font-size: 13px; color: var(--ink-faint); }

/* ---------- Pix ---------- */
.pix-box { padding: 26px; display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.pix-head { display: flex; flex-direction: column; gap: 3px; text-align: center; }
.pix-head strong { font-family: var(--font-display); font-size: 19px; color: var(--petrol-800); }
.pix-qr { display: grid; place-items: center; padding: 6px; }
.pix-qr svg { width: 220px; height: 220px; border: 1px solid var(--line-soft); border-radius: 12px; padding: 8px; background: #fff; }

/* ---------- bloqueio pessoal na agenda ---------- */
.appt-row.block {
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(17,48,47,.03) 10px 20px), var(--paper-deep);
}
.appt-row.block .appt-name { color: var(--ink-soft); }

/* ---------- toasts ---------- */
.toast-zone {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: flex-end;
}
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--petrol-950); color: #e8f2ee;
  padding: 13px 19px; border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.30);
  font-size: 14px; font-weight: 500;
  animation: toastIn .35s cubic-bezier(.2, 1.3, .4, 1) both;
  max-width: 380px;
}
.toast.out { animation: toastOut .3s ease both; }
.toast .t-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.toast.ok .t-dot { background: #5fd49a; }
.toast.err .t-dot { background: #ff8d77; }
.toast.info .t-dot { background: var(--amber-glow); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- animações utilitárias ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }

.fade-in { animation: rise .4s both; }

/* ---------- responsivo ---------- */
@media (max-width: 1240px) {
  .review-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .nova-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .rail { position: static; }
}
/* ---------- navegação mobile: drawer + hambúrguer ---------- */
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    position: fixed; top: 10px; left: 10px; z-index: 80;
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.16); color: #fff;
    background: linear-gradient(168deg, var(--petrol-900), var(--petrol-950));
    box-shadow: 0 4px 16px rgba(0,0,0,.32);
  }
  body.locked .nav-toggle { display: none; }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 70;
    background: rgba(2, 18, 20, .55);
  }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 75;
    width: 82%; max-width: 300px; height: 100%;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 22px 16px 20px;
    transform: translateX(-100%); transition: transform .25s ease;
    overflow-y: auto;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 50px rgba(0,0,0,.55); }
  .brand { margin-bottom: 24px; }
  .side-nav { flex-direction: column; margin: 0; gap: 6px; overflow: visible; }
  .side-nav a { flex: 0 0 auto; font-size: 15px; padding: 11px 14px; white-space: normal; }
  .side-foot { display: flex; }
  .side-user { margin-top: 18px; }
  .main { padding: 64px 22px 60px; }
}

/* ---------- celular (≤640px) — conteúdo empilhado ---------- */
@media (max-width: 640px) {
  .shell { overflow-x: hidden; }
  .main { padding: 60px 13px 72px; }
  .page-head h1, .hero h1 { font-size: clamp(23px, 7vw, 30px); }
  .review-head { flex-direction: column; align-items: stretch; }
  .review-actions { gap: 6px; flex-wrap: wrap; }
  .review-actions .btn { padding: 9px 12px; font-size: 13px; }
  .card { padding: 16px 14px; }
  .card-grid, .duo, .nova-grid, .cockpit-grid, .review-grid,
  .patient-extras, .fin-row, .live-grid, .profile-grid,
  .gest-charts, .sent-cols { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .gen-bar { flex-direction: column; align-items: stretch; }
  .gsearch-box, .pix-box, .modal, .modal-box { max-width: 94vw; }
  .lab-table { font-size: 12px; }
  textarea, input, .input, .textarea, .select { max-width: 100%; }
  table { display: block; overflow-x: auto; }
  .transcript-zone .textarea { padding-bottom: 16px; }
  .transcript-tools { position: static; inset: auto; flex-wrap: wrap; margin-top: 8px; }
  .transcript-tools .char-count { margin-left: 0; }
}

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

/* ---------- Sala Escriba (teleconsulta integrada) ---------- */
.tv-wrap { margin: 0 0 12px; }
.tv-stage {
  position: relative; border-radius: 14px; overflow: hidden;
  background: #04181a; aspect-ratio: 16 / 9;
}
.tv-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-remote { position: absolute; inset: 0; }
.tv-local {
  position: absolute; right: 10px; bottom: 10px;
  width: 22%; max-width: 150px; aspect-ratio: 4 / 3; height: auto;
  border-radius: 10px; border: 2px solid rgba(250, 246, 239, .45);
  transform: scaleX(-1); background: #0a2123;
}
.tv-status {
  position: absolute; inset: 0; display: grid; place-content: center;
  color: #faf6ef; font-size: 13.5px; text-align: center; padding: 14px;
  background: rgba(4, 24, 26, .55);
}
.tv-status:empty { display: none; }
.tv-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ============================================================
   Camada de modernizacao - profundidade, luz e micro-interacoes
   ============================================================ */

/* entrada mais viva das views */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* sidebar: trilho ambar no item ativo */
.side-nav a { position: relative; }
.side-nav a.active::before {
  content: ''; position: absolute; left: -18px; top: 9px; bottom: 9px; width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--amber-glow), var(--amber));
  box-shadow: 0 0 14px rgba(232, 176, 106, .6);
}

/* hero com ornamento de luz e malha pontilhada */
.hero { position: relative; z-index: 0; }
.hero::before {
  content: ''; position: absolute; right: 40px; top: -50px;
  width: 320px; height: 280px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 32% 32%, rgba(232, 176, 106, .25), transparent 58%),
    radial-gradient(circle at 70% 72%, rgba(25, 105, 108, .20), transparent 60%);
  filter: blur(6px);
}
.hero::after {
  content: ''; position: absolute; right: 0; top: -20px;
  width: 360px; height: 230px; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(17, 48, 47, .16) 1.2px, transparent 1.7px);
  background-size: 19px 19px;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent);
          mask-image: radial-gradient(closest-side, #000 30%, transparent);
}

/* cards de metrica: fio de luz no topo + numeros em gradiente */
.stat { position: relative; overflow: hidden; transition: transform var(--speed), box-shadow var(--speed); }
.stat::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--amber-glow), var(--amber) 45%, transparent 92%);
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.stat .num { font-variant-numeric: tabular-nums; }
.stat .num:not([style]) {
  background: linear-gradient(120deg, var(--petrol-950), var(--petrol-600));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* linhas clicaveis respiram no hover */
.appt-row { transition: background var(--speed); }
.appt-row:not(.block):hover { background: rgba(25, 105, 108, .05); }

/* botao primario: brilho que percorre no hover */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -65%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-18deg);
  transition: left .5s ease;
  pointer-events: none;
}
.btn-primary:hover::after { left: 125%; }

/* foco dos campos com anel suave */
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--petrol-600);
  box-shadow: 0 0 0 3.5px rgba(25, 105, 108, .13);
  outline: none;
}

/* ilustracao dos estados vazios flutua de leve */
.empty svg { animation: floatY 5.5s ease-in-out infinite; }
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

/* acessibilidade: respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   Cockpit do medico (pagina inicial)
   ============================================================ */
.cockpit-hero .eyebrow { display: flex; align-items: center; gap: 8px; }
.ck-clock {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--petrol-800); background: var(--petrol-100);
  padding: 2px 10px; border-radius: 999px; letter-spacing: .06em;
}
.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.stat .sub2 { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }

.cockpit-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  gap: 20px; align-items: start; margin-bottom: 36px;
}
@media (max-width: 1080px) { .cockpit-grid { grid-template-columns: 1fr; } }

.ck-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ck-rail .card { margin-bottom: 0; }
.ck-rail .radar-card .today-head strong { font-size: 13.5px; }

.tl-card { padding: 24px 22px; gap: 12px; }
.tl-head { display: flex; align-items: center; justify-content: space-between; }
.tl-head h2 { font-size: 18px; font-weight: 650; }
.tl-occ { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-faint); }
.tl-occ .progress-track { flex: 1; }

.tl-list { display: flex; flex-direction: column; }
.tl-row {
  display: flex; gap: 14px; align-items: center;
  padding: 13px 12px; border-radius: 14px;
  transition: background var(--speed);
}
.tl-row + .tl-row { border-top: 1px dashed var(--line-soft); }
.tl-row:hover { background: rgba(25, 105, 108, .05); }
.tl-row.past { opacity: .5; }
.tl-row.next {
  background: linear-gradient(135deg, rgba(232, 176, 106, .16), rgba(232, 176, 106, .05));
  box-shadow: inset 0 0 0 1.5px rgba(200, 127, 51, .35);
  opacity: 1;
}
.tl-time { width: 72px; flex-shrink: 0; display: flex; flex-direction: column; }
.tl-time strong { font-family: var(--font-display); font-size: 17px; color: var(--petrol-800); }
.tl-time span { font-size: 11.5px; color: var(--ink-faint); }
.tl-eta { color: var(--amber-deep) !important; font-weight: 700; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex-shrink: 0; }
.tl-dot.st-confirmado { background: var(--blue); }
.tl-dot.st-chegou { background: var(--amber); box-shadow: 0 0 0 4px rgba(200, 127, 51, .20); animation: chegouPulse 2s ease-out infinite; }
.tl-dot.st-realizado { background: var(--green); }
@keyframes chegouPulse {
  0%   { box-shadow: 0 0 0 0 rgba(200, 127, 51, .35); }
  100% { box-shadow: 0 0 0 9px rgba(200, 127, 51, 0); }
}
.tl-main { flex: 1; min-width: 0; }
.tl-name { font-weight: 600; color: var(--ink); text-decoration: none; }
a.tl-name:hover { color: var(--petrol-800); text-decoration: underline; }
.tl-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.tl-status { color: var(--ink-faint); font-size: 12px; }
.tl-actions { display: flex; gap: 8px; flex-shrink: 0; }
.tl-free { padding: 22px 6px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-amber { background: var(--amber-soft); color: var(--amber-deep); font-weight: 700; }

/* check-in da recepcao */
.appt-status.st-chegou { background: var(--amber-soft); color: var(--amber-deep); }

/* cockpit acionavel: KPIs e pendencias sao atalhos */
.stat-act { cursor: pointer; }
.stat-act::after {
  content: '>'; position: absolute; top: 12px; right: 14px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  color: var(--ink-faint); opacity: 0; transform: translateX(-4px);
  transition: opacity var(--speed), transform var(--speed);
}
.stat-act:hover::after { opacity: 1; transform: translateX(0); }
.stat-act:hover .lbl { color: var(--petrol-800); }

.pend-act {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: #fff; padding: 9px 12px; font: inherit; font-size: 13px;
  transition: border-color var(--speed), background var(--speed), transform var(--speed);
}
.pend-act:hover { border-color: var(--amber); background: var(--amber-soft); transform: translateX(2px); }
.pend-go { font-size: 12px; font-weight: 700; color: var(--amber-deep); white-space: nowrap; }
.tl-row { cursor: pointer; }

/* ============================================================
   TEMA NOCT - cockpit escuro (padrao). Vidro, aurora e brilho.
   Alterna com o botao no rodape da sidebar; claro continua disponivel.
   ============================================================ */
html.noct {
  --ink:        #e9f2ef;
  --ink-soft:   #b9cfc9;
  --ink-faint:  #84a09a;
  --petrol-950: #041316;
  --petrol-900: #07252a;
  --petrol-800: #9fd8d0;
  --petrol-600: #56b3a9;
  --petrol-100: #11363a;
  --paper:      #051517;
  --paper-deep: #07191c;
  --card:       #0b2326;
  --line:       #1c4046;
  --line-soft:  #143036;
  --amber:      #e09a4a;
  --amber-deep: #ffca8f;
  --amber-soft: #2e2010;
  --amber-glow: #ffc176;
  --green:      #6fe0a8;
  --green-soft: #0d2e22;
  --red:        #ff9b85;
  --red-soft:   #381912;
  --blue:       #8fd0f5;
  --blue-soft:  #0e2c3d;
  --shadow-1: 0 1px 2px rgba(0,0,0,.45), 0 6px 18px rgba(0,0,0,.35);
  --shadow-2: 0 4px 10px rgba(0,0,0,.5), 0 18px 50px rgba(0,0,0,.45);
  --shadow-amber: 0 8px 28px rgba(224,154,74,.35);
  color-scheme: dark;
  background:
    radial-gradient(1000px 600px at 85% -15%, rgba(224,154,74,.13), transparent 60%),
    radial-gradient(1200px 800px at -20% 25%, rgba(31,122,118,.24), transparent 62%),
    radial-gradient(900px 700px at 115% 85%, rgba(47,107,143,.18), transparent 58%),
    linear-gradient(180deg, #04181b, #020d0d 85%);
  background-attachment: fixed;
}
html.noct body { background: transparent; }

/* aurora viva ao fundo */
html.noct body::before {
  content: ''; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(640px 440px at 28% 18%, rgba(86,179,169,.14), transparent 60%),
    radial-gradient(720px 520px at 78% 78%, rgba(224,154,74,.09), transparent 60%);
  filter: blur(46px);
  animation: aurora 16s ease-in-out infinite alternate;
}
@keyframes aurora {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(3%, 4%, 0) scale(1.1); }
}

/* cartoes de vidro */
html.noct .card {
  background: linear-gradient(160deg, rgba(22,52,56,.72), rgba(9,26,29,.82));
  border: 1px solid rgba(159,216,208,.10);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* sidebar flutuante de vidro */
html.noct .sidebar {
  margin: 14px 0 14px 14px;
  height: calc(100vh - 28px);
  top: 14px;
  border-radius: 26px;
  border: 1px solid rgba(159,216,208,.10);
  background:
    radial-gradient(420px 300px at 110% -8%, rgba(255,193,118,.10), transparent 60%),
    linear-gradient(168deg, rgba(8,34,38,.94), rgba(3,15,17,.97));
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}

/* campos */
html.noct .input, html.noct .select, html.noct .textarea {
  background: rgba(4,19,22,.55);
  color: var(--ink);
  border-color: var(--line);
}
html.noct .input::placeholder, html.noct .textarea::placeholder { color: #5d7c76; }
html.noct .input:focus, html.noct .select:focus, html.noct .textarea:focus {
  border-color: var(--petrol-600);
  box-shadow: 0 0 0 3.5px rgba(86,179,169,.18);
}

/* botoes */
html.noct .btn-primary {
  background: linear-gradient(135deg, #ffc176, #e0883a);
  color: #2a1607;
}
html.noct .btn-dark {
  background: rgba(159,216,208,.10);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(159,216,208,.22);
}
html.noct .btn-dark:hover { background: rgba(159,216,208,.16); box-shadow: inset 0 0 0 1px rgba(159,216,208,.3); }
html.noct .btn-ghost:hover { background: rgba(159,216,208,.10); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(159,216,208,.25); }

/* pecas que assumiam fundo claro */
html.noct .mic-btn { background: rgba(4,19,22,.6); color: var(--ink-soft); }
html.noct .segmented button.on,
html.noct .auth-tabs button.on { background: rgba(159,216,208,.16); color: var(--ink); box-shadow: none; }
html.noct .char-count { background: rgba(4,19,22,.8); }
html.noct .pend-act { background: rgba(4,19,22,.5); }
html.noct .pend-act:hover { background: var(--amber-soft); }
html.noct .lab-row:nth-child(odd) { background: rgba(159,216,208,.05); }
html.noct .icon-btn { background: rgba(159,216,208,.10); color: var(--petrol-800); }
html.noct .pix-qr svg { background: #fff; } /* QR precisa de fundo branco para leitura */
html.noct ::-webkit-scrollbar-thumb { background: #1d4046; border-color: transparent; }

/* cockpit no escuro */
html.noct .stat .num:not([style]) {
  background: linear-gradient(120deg, #eafff9, #8fd0c9);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
html.noct .hero::after { background-image: radial-gradient(rgba(159,216,208,.25) 1.2px, transparent 1.7px); }
html.noct .hero h1 em { color: #8fd0c9; }
html.noct .tl-row:hover { background: rgba(159,216,208,.07); }
html.noct .tl-row.next {
  background: linear-gradient(135deg, rgba(255,193,118,.14), rgba(255,193,118,.04));
  box-shadow: inset 0 0 0 1.5px rgba(224,154,74,.4);
}
html.noct .gen-bar { background: linear-gradient(135deg, rgba(8,34,38,.9), rgba(3,15,17,.95)); border: 1px solid rgba(159,216,208,.12); }
html.noct .auth-error { border-color: #5c2c22; }
html.noct .today-strip { border-left-width: 3px; }

/* toggle de tema (vive no rodape da sidebar, nos dois temas) */
.theme-toggle {
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  background: rgba(255,255,255,.06); color: #cfe2dd;
  padding: 8px 13px; font-size: 12.5px; font-weight: 600;
  transition: background var(--speed);
}
.theme-toggle:hover { background: rgba(255,255,255,.13); }

/* ---------- importador de pacientes ---------- */
.import-zone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--r-lg);
  transition: border-color var(--speed), background var(--speed);
}
.import-zone:hover, .import-zone.over { border-color: var(--amber); background: var(--amber-soft); }
.import-map {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px; margin: 6px 0 10px;
}
.import-col {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px; border: 1px solid var(--line-soft); border-radius: var(--r-md);
}
.imp-header { font-weight: 700; font-size: 13px; color: var(--petrol-800); }
.imp-sample { font-size: 11.5px; color: var(--ink-faint); min-height: 16px; }
html.noct .import-zone:hover, html.noct .import-zone.over { background: var(--amber-soft); }

/* risco de falta (no-show) */
.chip-risk { border: none; cursor: pointer; font-weight: 700; transition: transform var(--speed), filter var(--speed); }
.chip-risk:hover { transform: translateY(-1px); filter: brightness(.95); }
.chip-risk.alto { background: var(--red-soft); color: var(--red); }
.chip-risk.medio { background: var(--amber-soft); color: var(--amber-deep); }

/* Noct: ficha do paciente — fundos claros hardcoded viravam texto invisivel */
html.noct .sent-briefing,
html.noct .sent-pend,
html.noct .param-card,
html.noct .lab-item { background: rgba(4, 19, 22, .5); }
html.noct .sentinel-card {
  background:
    radial-gradient(480px 200px at 100% 0%, rgba(86, 179, 169, .08), transparent 60%),
    linear-gradient(160deg, rgba(22, 52, 56, .72), rgba(9, 26, 29, .82));
}
html.noct .contact-btn { background: rgba(159, 216, 208, .08); }
html.noct .contact-btn:hover { color: var(--petrol-800); background: rgba(159, 216, 208, .14); }
html.noct .tpl-bar { background: rgba(4, 19, 22, .5); }
html.noct .tpl-bar .select { background-color: rgba(4, 19, 22, .6); }
html.noct .ask-bubble.me { background: #155e57; color: #eafff9; }
html.noct .ask-bubble.bot { background: rgba(159, 216, 208, .10); }
html.noct .tl-card:hover { border-color: var(--line); }
html.noct .radar-row:hover { background: rgba(159, 216, 208, .07); }
html.noct .lab-row.alto, html.noct .lab-row.baixo { background: var(--amber-soft); }

/* alinhamento da ficha do paciente: mesmas larguras em todas as seções */
.sentinel-card, .patient-extras, .timeline { max-width: 1100px; }

/* ---------- paywall / planos ---------- */
.pay-overlay {
  position: fixed; inset: 0; z-index: 160;
  display: grid; place-items: center; padding: 20px;
  background: rgba(4, 19, 22, .6); backdrop-filter: blur(8px);
  animation: fadeIn .2s both;
}
.pay-modal {
  position: relative; width: min(760px, 100%);
  max-height: calc(100vh - 40px); overflow: auto;
  padding: 30px 32px; display: flex; flex-direction: column; gap: 16px;
}
.pay-modal h2 { font-size: 24px; }
.pay-close { position: absolute; top: 14px; right: 14px; }
.pay-reason {
  background: var(--amber-soft); color: var(--amber-deep);
  border-radius: var(--r-md); padding: 11px 14px; font-size: 13.5px; font-weight: 600;
}
.plan-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.plan-card {
  position: relative; display: flex; flex-direction: column; gap: 5px; text-align: left;
  border: 2px solid var(--line); border-radius: var(--r-lg); background: transparent;
  padding: 18px 16px 14px; font: inherit; color: var(--ink); cursor: pointer;
  transition: border-color var(--speed), transform var(--speed), box-shadow var(--speed);
}
.plan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.plan-card.on { border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.plan-card.featured { border-color: var(--petrol-600); }
.plan-tag {
  position: absolute; top: -10px; left: 14px;
  background: var(--petrol-600); color: #fff;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px;
}
.plan-name { font-family: var(--font-display); font-size: 18px; }
.plan-price { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--petrol-800); }
.plan-price em { font-style: normal; font-size: 13px; color: var(--ink-faint); font-weight: 400; }
.plan-quota { font-size: 13px; font-weight: 700; color: var(--amber-deep); }
.plan-blurb { font-size: 12px; color: var(--ink-faint); line-height: 1.4; }
.pay-form { display: flex; flex-direction: column; gap: 10px; }
.pay-cardline {
  background: var(--green-soft); color: var(--green);
  border-radius: var(--r-md); padding: 11px 14px; font-size: 13.5px; font-weight: 600;
}
.pay-fine { font-size: 11.5px; color: var(--ink-faint); text-align: center; }

/* ---------- assinatura digital da receita ---------- */
.sign-block {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--r-md);
  border: 1px dashed var(--line); background: var(--paper-deep);
  display: flex; flex-direction: column; gap: 8px;
}
.sign-block.signed { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.sign-block.pending { border-color: var(--amber); background: var(--amber-soft); }
.sign-title { font-size: 14.5px; color: var(--petrol-800); }
.sign-title.ok { color: var(--green); }
.sign-actions { display: flex; gap: 8px; flex-wrap: wrap; }
html.noct .sign-block { background: rgba(4,19,22,.4); }
html.noct .sign-block.signed { background: var(--green-soft); }
html.noct .sign-block.pending { background: var(--amber-soft); }

.sign-steps { margin: 4px 0 0; padding-left: 20px; font-size: 13px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 5px; }
.sign-steps a { color: var(--petrol-600); font-weight: 600; }
html.noct .sign-steps a { color: var(--petrol-800); }

/* Noct: correcoes de contraste */
html.noct .hypo-card, html.noct .exam-card { background: rgba(4,19,22,.45); border-color: var(--line); }
html.noct .btn-google { background: rgba(159,216,208,.08); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
html.noct .btn-google:hover { background: rgba(159,216,208,.14); box-shadow: inset 0 0 0 1.5px rgba(159,216,208,.3); }
