/* ==========================================
   PraxisMed - Station Session (Checklist IA/Treinamento)
   Premium clinical chat interface
   ========================================== */

:root{
  --green:#0F8A56;
  --green-dark:#0A6B42;
  --green-tint:#E7F6EE;
  --green-tint-border:#BFE6D2;
  --ink:#111827;
  --text:#1F2430;
  --text-muted:#66707C;
  --text-faint:#98A1AC;
  --border:#E6E8EA;
  --bg:#F4F6F5;
  --card:#FFFFFF;
  --shadow: 0 1px 2px rgba(16,24,32,0.04), 0 2px 8px rgba(16,24,32,0.05);
}

body.dark-mode{
  --green:#22c55e;
  --green-dark:#16a34a;
  --green-tint:rgba(34,197,94,0.1);
  --green-tint-border:rgba(34,197,94,0.25);
  --ink:#e2e8f0;
  --text:#e2e8f0;
  --text-muted:#94a3b8;
  --text-faint:#64748b;
  --border:rgba(255,255,255,0.08);
  --bg:#0c0e16;
  --card:#161822;
  --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.3);
}

/* ═══════════ HEADER ═══════════ */

.sr-header{
  background:var(--card);
  border-bottom:1px solid var(--border);
  padding:16px 28px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  flex-wrap:wrap;
  flex-shrink:0;
}
.sr-header-left{ display:flex; align-items:flex-start; gap:16px; min-width:0; }
.sr-exit{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--card); border:1px solid var(--border); border-radius:10px;
  padding:9px 14px; font-size:0.84rem; font-weight:600; color:var(--text);
  cursor:pointer; flex-shrink:0; transition:all .15s; margin-top:2px;
}
.sr-exit:hover{ background:#F7F8F8; border-color:#D7DADD; }
.sr-exit svg{ width:15px; height:15px; }

body.dark-mode .sr-exit:hover{ background:rgba(255,255,255,0.05); border-color:rgba(255,255,255,0.15); }

.sr-icon-badge{
  width:42px; height:42px; border-radius:11px; background:var(--green);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.sr-icon-badge svg{ width:21px; height:21px; color:#fff; }

.sr-header-meta{ min-width:0; }
.sr-eyebrow{
  font-size:0.72rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase;
  color:var(--text-faint); margin-bottom:3px;
}
.sr-title{ font-size:1.32rem; font-weight:700; color:var(--ink); line-height:1.25; letter-spacing:-0.01em; }
.sr-tags-row{ display:flex; align-items:center; gap:9px; margin-top:8px; flex-wrap:wrap; }
.sr-tag{ display:flex; align-items:center; gap:5px; font-size:0.78rem; font-weight:600; color:var(--text-muted); }
.sr-tag svg{ width:14px; height:14px; }
.sr-tag-sep{ color:var(--text-faint); font-size:0.7rem; }
.sr-diff-pill{
  background:var(--green-tint); color:var(--green-dark); border:1px solid var(--green-tint-border);
  padding:4px 11px; border-radius:20px; font-size:0.76rem; font-weight:700;
}

.sr-header-right{ display:flex; align-items:center; gap:14px; flex-shrink:0; }
.sr-timer-card{
  background:var(--card); border:1px solid var(--border); border-radius:12px;
  padding:10px 18px; display:flex; align-items:center; gap:11px; box-shadow:var(--shadow);
}
.sr-timer-card[data-state="warning"]{ border-color:#f59e0b; background:rgba(245,158,11,0.05); }
.sr-timer-card[data-state="critical"]{ border-color:#ef4444; background:rgba(239,68,68,0.05); animation:pulse-critical 1s infinite; }
@keyframes pulse-critical{ 0%,100%{opacity:1} 50%{opacity:0.7} }

.sr-timer-icon{
  width:34px; height:34px; border-radius:9px; background:var(--green-tint);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.sr-timer-icon svg{ width:17px; height:17px; color:var(--green); }
.sr-timer-label{ font-size:0.66rem; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color:var(--text-faint); }
.sr-timer-value{ display:flex; align-items:baseline; gap:6px; }
.sr-timer-value strong{ font-size:1.32rem; font-weight:800; color:var(--ink); font-variant-numeric:tabular-nums; letter-spacing:-0.01em; }
.sr-timer-value span{ font-size:0.74rem; color:var(--text-faint); font-weight:600; }

.sr-finish-btn{
  display:inline-flex; align-items:center; gap:9px; background:var(--green); color:#fff;
  border:none; padding:14px 20px; border-radius:12px; font-weight:700; font-size:0.88rem;
  cursor:pointer; transition:background .15s; box-shadow:var(--shadow); white-space:nowrap;
}
.sr-finish-btn:hover{ background:var(--green-dark); }
.sr-finish-btn svg{ width:16px; height:16px; }

/* ═══════════ BODY GRID ═══════════ */

.sr-body{
  display:grid; grid-template-columns:1fr 320px; gap:20px;
  padding:20px 28px; max-width:1560px; margin:0 auto;
  flex:1; min-height:0; width:100%;
}
@media (max-width:980px){ .sr-body{ grid-template-columns:1fr; overflow-y:auto; } }

.sr-main{ display:flex; flex-direction:column; min-height:0; }

.sr-card{
  background:var(--card); border:1px solid var(--border); border-radius:16px; box-shadow:var(--shadow);
}

.sr-consulta-card{ display:flex; flex-direction:column; min-height:0; flex:1; padding:20px 22px 22px; }

.sr-sidebar{ overflow-y:auto; min-height:0; }

/* command card */
.sr-command-card{ position:relative; overflow:hidden; margin-bottom:20px; flex-shrink:0; }
.sr-command-header{
  display:flex; align-items:center; justify-content:space-between; cursor:pointer;
  padding:16px 24px; user-select:none; transition:background .15s;
}
.sr-command-header:hover{ background:rgba(0,0,0,0.02); }
body.dark-mode .sr-command-header:hover{ background:rgba(255,255,255,0.03); }
.sr-command-label{
  display:inline-block; background:var(--green); color:#fff; font-size:0.72rem; font-weight:700;
  letter-spacing:0.04em; text-transform:uppercase; padding:6px 13px; border-radius:8px; margin:0;
}
.sr-command-chevron{
  width:18px; height:18px; color:var(--text-muted); transition:transform .25s;
}
.sr-command-card.collapsed .sr-command-chevron{ transform:rotate(180deg); }
.sr-command-body{
  max-height:300px; overflow:hidden; transition:max-height .3s ease, padding .3s ease, opacity .2s ease;
  padding:0 24px 22px; opacity:1;
}
.sr-command-card.collapsed .sr-command-body{ max-height:0; padding-top:0; padding-bottom:0; opacity:0; }
.sr-command-text{ font-size:0.98rem; line-height:1.75; color:var(--text); max-width:78%; position:relative; z-index:2; }
.sr-command-watermark{
  position:absolute; right:22px; bottom:16px; text-align:right; opacity:0.5; pointer-events:none;
}
.sr-command-watermark .wm-title{ font-size:0.92rem; font-weight:700; color:#C9CFCB; letter-spacing:0.01em; }
.sr-command-watermark .wm-sub{ font-size:0.58rem; font-weight:700; letter-spacing:0.1em; color:#D6DBD8; margin-top:1px; }
.sr-command-fold{
  position:absolute; right:0; bottom:0; width:0; height:0;
  border-style:solid; border-width:0 0 26px 26px; border-color:transparent transparent var(--bg) transparent;
}
.sr-command-fold::before{
  content:''; position:absolute; right:0; bottom:0; width:0; height:0;
  border-style:solid; border-width:0 0 26px 26px;
  border-color:transparent transparent #fff transparent;
  filter:drop-shadow(-1px -1px 1px rgba(0,0,0,0.06));
}

body.dark-mode .sr-command-fold::before{
  border-color:transparent transparent #161822 transparent;
}

/* consulta section */
.sr-consulta-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.sr-consulta-title{ display:flex; align-items:center; gap:8px; font-size:0.86rem; font-weight:700; color:var(--ink); }
.sr-consulta-title svg{ width:16px; height:16px; color:var(--green); }
.sr-consulta-reg{ display:flex; align-items:center; gap:6px; font-size:0.78rem; color:var(--text-faint); font-weight:500; }
.sr-reg-dot{ width:6px; height:6px; border-radius:50%; background:var(--green); }

.sr-transcript{
  flex:1; min-height:0; overflow-y:auto; display:flex; flex-direction:column; gap:18px;
  padding-right:4px; margin-bottom:14px;
}
.sr-transcript-empty{ margin:auto; text-align:center; color:var(--text-faint); padding:50px 0; }
.sr-transcript-empty svg{ width:34px; height:34px; margin-bottom:10px; color:#C7CDD2; }
.sr-transcript-empty p{ font-weight:600; color:var(--text-muted); font-size:0.88rem; }

.sr-msg-row{ display:flex; gap:12px; max-width:80%; }
.sr-msg-row--doctor{ align-self:flex-end; flex-direction:row-reverse; }
.sr-msg-row--patient{ align-self:flex-start; }

.sr-avatar{ width:38px; height:38px; border-radius:50%; flex-shrink:0; overflow:hidden; }
.sr-avatar--patient{ background:linear-gradient(135deg,#F3D9C4,#E6B88A); display:flex; align-items:center; justify-content:center; }
.sr-avatar--patient svg{ width:22px; height:22px; color:#8B5E3C; }
.sr-avatar--doctor{ background:var(--green); display:flex; align-items:center; justify-content:center; }
.sr-avatar--doctor svg{ width:19px; height:19px; color:#fff; }

.sr-msg-body{ min-width:0; }
.sr-msg-meta{ display:flex; align-items:center; gap:7px; margin-bottom:5px; font-size:0.76rem; }
.sr-msg-row--doctor .sr-msg-meta{ justify-content:flex-end; }
.sr-msg-meta .who{ font-weight:700; }
.sr-msg-row--patient .who{ color:var(--green-dark); }
.sr-msg-row--doctor .who{ color:var(--ink); }
.sr-msg-meta .time{ color:var(--text-faint); font-weight:500; }

.sr-bubble{ padding:12px 15px; border-radius:14px; font-size:0.92rem; line-height:1.55; position:relative; }
.sr-msg-row--patient .sr-bubble{ background:#fff; border:1px solid var(--border); border-top-left-radius:4px; color:var(--text); }
.sr-msg-row--doctor .sr-bubble{ background:var(--green-tint); border:1px solid var(--green-tint-border); border-top-right-radius:4px; color:var(--ink); }
.sr-check{ display:flex; justify-content:flex-end; margin-top:4px; }
.sr-check svg{ width:13px; height:13px; color:var(--green); }

.sr-system-msg{
  align-self:center; font-size:0.72rem; font-weight:600; color:var(--text-faint);
  background:var(--bg); border:1px solid var(--border); padding:6px 14px; border-radius:20px;
}

.sr-composer-row{
  display:flex; align-items:center; gap:10px; border:1px solid var(--border); border-radius:14px;
  padding:6px 6px 6px 16px; background:#fff;
}
body.dark-mode .sr-composer-row{ background:rgba(255,255,255,0.03); }
.sr-composer-row input{ flex:1; border:none; outline:none; font-family:'Inter',sans-serif; font-size:0.9rem; padding:8px 0; color:var(--text); background:transparent; }
.sr-composer-row input::placeholder{ color:var(--text-faint); }
.sr-icon-btn{
  width:38px; height:38px; border-radius:10px; border:1px solid var(--border); background:#fff;
  display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; color:var(--text-muted); transition:all .15s;
}
.sr-icon-btn:hover{ background:#F7F8F8; }
.sr-icon-btn svg{ width:17px; height:17px; }
.sr-send-btn{ background:var(--green); border-color:var(--green); color:#fff; }
.sr-send-btn:hover{ background:var(--green-dark); }

body.dark-mode .sr-icon-btn{ background:rgba(255,255,255,0.03); border-color:rgba(255,255,255,0.1); }
body.dark-mode .sr-icon-btn:hover{ background:rgba(255,255,255,0.08); }

.sr-dica{ display:flex; align-items:center; gap:7px; margin-top:12px; font-size:0.78rem; color:var(--text-faint); }
.sr-dica svg{ width:14px; height:14px; color:var(--green); }

/* evaluation panel */
.sr-eval{ display:none; margin-top:16px; padding-top:16px; border-top:1px solid var(--border); }
.sr-eval-head{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.sr-eval-head svg{ width:17px; height:17px; color:var(--green); }
.sr-eval-head h3{ font-size:0.92rem; font-weight:700; color:var(--ink); }
.sr-eval p{ font-size:0.85rem; line-height:1.6; color:var(--text-muted); margin-bottom:6px; }
.sr-eval strong{ color:var(--ink); }

/* ═══════════ SIDEBAR ═══════════ */

.sr-sidebar{ display:flex; flex-direction:column; gap:20px; }
.sr-patient-card{ padding:18px 20px 20px; }
.sr-patient-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.sr-patient-head h4{ font-size:0.78rem; font-weight:700; letter-spacing:0.03em; text-transform:uppercase; color:var(--ink); }
.sr-menu-dots{ color:var(--text-faint); cursor:pointer; }
.sr-menu-dots svg{ width:17px; height:17px; }
.sr-patient-info{ display:flex; align-items:center; gap:13px; }
.sr-patient-photo{
  width:60px; height:60px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,#F3D9C4,#E6B88A); display:flex; align-items:center; justify-content:center;
}
.sr-patient-photo svg{ width:30px; height:30px; color:#8B5E3C; }
.sr-patient-name{ font-size:1rem; font-weight:700; color:var(--ink); }
.sr-patient-sub{ font-size:0.82rem; color:var(--text-muted); margin-top:2px; }
.sr-patient-divider{ height:1px; background:var(--border); margin:16px 0 12px; }
.sr-patient-status{ display:flex; align-items:center; gap:7px; font-size:0.82rem; color:var(--text-muted); font-weight:500; }
.sr-status-dot{ width:7px; height:7px; border-radius:50%; background:var(--text-faint); }
.sr-status-dot--active{ background:var(--green); }

.sr-exams-card{ padding:18px 20px 20px; }
.sr-exams-head{ display:flex; align-items:center; gap:8px; margin-bottom:16px; }
.sr-exams-head svg{ width:16px; height:16px; color:var(--ink); }
.sr-exams-head h4{ font-size:0.78rem; font-weight:700; letter-spacing:0.03em; text-transform:uppercase; color:var(--ink); }
.sr-exams-empty{ text-align:center; padding:18px 6px 22px; }
.sr-exams-empty-icon{
  width:56px; height:56px; border-radius:50%; background:var(--green-tint); display:flex;
  align-items:center; justify-content:center; margin:0 auto 14px;
}
.sr-exams-empty-icon svg{ width:26px; height:26px; color:var(--green); }
.sr-exams-empty p{ font-size:0.9rem; font-weight:700; color:var(--ink); margin-bottom:5px; }
.sr-exams-empty span{ font-size:0.8rem; color:var(--text-muted); line-height:1.5; }
.sr-exams-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.sr-exam-item{ display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid var(--green-tint-border); background:var(--green-tint); border-radius:10px; }
.sr-exam-item svg{ width:16px; height:16px; color:var(--green-dark); flex-shrink:0; }
.sr-exam-item span{ font-size:0.82rem; font-weight:600; color:var(--green-dark); }

.sr-lock-note{
  display:flex; align-items:flex-start; gap:9px; background:var(--bg); border:1px solid var(--border);
  border-radius:10px; padding:12px 13px; margin-top:4px;
}
.sr-lock-note svg{ width:15px; height:15px; color:var(--text-faint); flex-shrink:0; margin-top:1px; }
.sr-lock-note span{ font-size:0.78rem; color:var(--text-muted); line-height:1.5; }

/* ═══════════ PREP FULLSCREEN ═══════════ */

#view-estacao-room.sr-prep-active{
  background: linear-gradient(145deg, #0a2e1a 0%, #0f3d24 30%, #145230 60%, #0d3520 100%) !important;
}
#view-estacao-room.sr-prep-active::after{
  content:''; position:absolute; inset:0;
  background: url('/assets/backgrouds/Estacoes_light.jpg') center/cover no-repeat;
  opacity:0.12; pointer-events:none;
}
body.dark-mode #view-estacao-room.sr-prep-active{
  background: linear-gradient(145deg, #050a08 0%, #0a1a10 30%, #0f2818 60%, #081a10 100%) !important;
}
body.dark-mode #view-estacao-room.sr-prep-active::after{ opacity:0.06; }

.sr-prep-fullscreen{
  position:absolute; inset:0; z-index:200;
  display:flex; align-items:center; justify-content:center;
  padding:24px;
}
.sr-prep-fs-card{
  position:relative; z-index:1;
  background:rgba(255,255,255,0.95); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  border-radius:24px; max-width:540px; width:100%;
  padding:40px 36px 32px; text-align:center;
  box-shadow:0 32px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
}
.sr-prep-fs-badge{
  width:64px; height:64px; border-radius:18px; background:var(--green); margin:0 auto 20px;
  display:flex; align-items:center; justify-content:center;
}
.sr-prep-fs-badge svg{ width:30px; height:30px; color:#fff; }
.sr-prep-fs-area{
  font-size:0.68rem; font-weight:800; letter-spacing:0.1em; text-transform:uppercase;
  color:var(--green); margin-bottom:6px;
}
.sr-prep-fs-title{ font-size:1.6rem; font-weight:800; color:var(--ink); margin-bottom:8px; letter-spacing:-0.02em; }
.sr-prep-fs-sub{ font-size:0.88rem; color:var(--text-muted); line-height:1.5; margin-bottom:28px; }
.sr-prep-fs-meta{
  display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap;
  margin-bottom:28px;
}
.sr-prep-fs-meta-item{
  display:inline-flex; align-items:center; gap:5px; font-size:0.78rem; font-weight:600; color:var(--text-muted);
}
.sr-prep-fs-meta-item svg{ width:14px; height:14px; color:var(--green); }
.sr-prep-fs-meta-sep{ color:var(--text-faint); font-size:0.7rem; }
.sr-prep-fs-btn{
  width:100%; background:var(--green); color:#fff; border:none; padding:18px 24px;
  border-radius:14px; font-weight:800; font-size:1rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:10px;
  transition:all .2s; box-shadow:0 8px 24px rgba(15,138,86,0.35);
}
.sr-prep-fs-btn:hover{ background:var(--green-dark); transform:translateY(-1px); box-shadow:0 12px 32px rgba(15,138,86,0.4); }
.sr-prep-fs-btn svg{ width:18px; height:18px; }
.sr-prep-fs-footer{ font-size:0.75rem; color:var(--text-faint); margin-top:16px; }

body.dark-mode .sr-prep-fs-card{ background:rgba(22,24,34,0.95); box-shadow:0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06); }
body.dark-mode .sr-prep-fs-title{ color:#e2e8f0; }

@media (max-width:600px){
  .sr-prep-fs-card{ padding:32px 24px 24px; border-radius:20px; }
  .sr-prep-fs-badge{ width:52px; height:52px; border-radius:14px; margin-bottom:16px; }
  .sr-prep-fs-badge svg{ width:24px; height:24px; }
  .sr-prep-fs-title{ font-size:1.3rem; }
  .sr-prep-fs-sub{ font-size:0.82rem; margin-bottom:20px; }
  .sr-prep-fs-btn{ padding:16px 20px; font-size:0.92rem; }
}

/* ═══════════ RESPONSIVE ═══════════ */

@media (max-width:768px){
  .sr-header{ padding:12px 16px; }
  .sr-header-left{ gap:10px; }
  .sr-exit{ padding:7px 10px; font-size:0.78rem; }
  .sr-icon-badge{ width:36px; height:36px; border-radius:9px; }
  .sr-icon-badge svg{ width:18px; height:18px; }
  .sr-title{ font-size:1.1rem; }
  .sr-tags-row{ gap:6px; margin-top:6px; }
  .sr-tag{ font-size:0.72rem; }
  .sr-diff-pill{ font-size:0.7rem; padding:3px 8px; }
  .sr-header-right{ gap:8px; }
  .sr-timer-card{ padding:8px 12px; gap:8px; }
  .sr-timer-icon{ width:28px; height:28px; }
  .sr-timer-icon svg{ width:14px; height:14px; }
  .sr-timer-label{ font-size:0.6rem; }
  .sr-timer-value strong{ font-size:1.1rem; }
  .sr-timer-value span{ font-size:0.68rem; }
  .sr-finish-btn{ padding:10px 14px; font-size:0.8rem; gap:6px; }
  .sr-finish-btn svg{ width:14px; height:14px; }
  .sr-body{ padding:12px 16px; gap:12px; }
  .sr-command-card{ padding:16px 18px 20px; }
  .sr-command-text{ font-size:0.9rem; max-width:100%; }
  .sr-consulta-card{ padding:14px 16px 16px; }
  .sr-transcript{ gap:12px; }
  .sr-msg-row{ max-width:90%; gap:8px; }
  .sr-avatar{ width:32px; height:32px; }
  .sr-avatar--patient svg{ width:18px; height:18px; }
  .sr-avatar--doctor svg{ width:16px; height:16px; }
  .sr-bubble{ padding:10px 12px; font-size:0.86rem; }
  .sr-composer-row{ padding:4px 4px 4px 12px; }
  .sr-icon-btn{ width:34px; height:34px; }
  .sr-icon-btn svg{ width:15px; height:15px; }
  .sr-dica{ font-size:0.72rem; }
  .sr-patient-card{ padding:14px 16px 16px; }
  .sr-patient-photo{ width:48px; height:48px; }
  .sr-patient-photo svg{ width:24px; height:24px; }
  .sr-patient-name{ font-size:0.9rem; }
  .sr-patient-sub{ font-size:0.76rem; }
  .sr-exams-card{ padding:14px 16px 16px; }
  .sr-exams-empty-icon{ width:44px; height:44px; }
  .sr-exams-empty-icon svg{ width:20px; height:20px; }
  .sr-exams-empty p{ font-size:0.82rem; }
  .sr-exams-empty span{ font-size:0.74rem; }
  .sr-lock-note{ padding:10px 11px; }
  .sr-lock-note span{ font-size:0.72rem; }
  .sr-prep-card{ max-width:calc(100% - 32px); }
  .sr-prep-top{ padding:20px 22px 0; }
  .sr-prep-icon{ width:40px; height:40px; }
  .sr-prep-icon svg{ width:20px; height:20px; }
  .sr-prep-top h3{ font-size:1.05rem; }
  .sr-prep-body{ padding:0 22px 22px; }
  .sr-prep-body p{ padding:12px 14px; font-size:0.84rem; }
  .sr-prep-start{ padding:14px; font-size:0.86rem; }
}

@media (max-width:480px){
  .sr-header{ flex-direction:column; align-items:stretch; gap:12px; }
  .sr-header-left{ align-items:center; }
  .sr-header-right{ justify-content:space-between; }
  .sr-body{ grid-template-columns:1fr; }
  .sr-sidebar{ display:none; }
}
