/* ============================================
   War Room Planner — Emergência HSL
   ============================================ */

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

:root {
  --navy:    #1e3a5f;
  --navy-d:  #162d4a;
  --blue:    #2563eb;
  --blue-l:  #eff6ff;
  --medica:  #dc2626;
  --enf:     #059669;
  --rec:     #7c3aed;
  --out:     #d97706;
  --geral:   #2563eb;
  --bg:      #f1f5f9;
  --card:    #ffffff;
  --border:  #e2e8f0;
  --text:    #1e293b;
  --muted:   #64748b;
  --success: #059669;
  --danger:  #dc2626;
  --warn:    #d97706;
  --radius:  10px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
}

html, body { height: 100%; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
ul { list-style: none; }

/* ---- Layout ---- */
#app { display: flex; height: 100vh; overflow: hidden; }

/* ---- Login ---- */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--navy) 0%, #2563eb 100%);
}
.login-card {
  background: #fff; border-radius: 16px; padding: 40px 48px;
  width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  text-align: center;
}
/* Logo Emerg+ na tela de login */
.login-brand-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, var(--navy) 0%, #2563eb 100%);
  color: #fff; font-size: 22px; font-weight: 900; margin: 0 auto 12px;
  letter-spacing: -1px;
}
.login-brand-logo span { color: #60a5fa; font-size: 28px; font-weight: 900; }
.login-logo-img  { width: 72px; height: 72px; border-radius: 16px; object-fit: contain; margin: 0 auto 12px; display: block; }
.login-brand-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px !important; }
.login-card h1 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.login-card p  { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-card input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; margin-bottom: 12px; outline: none;
  transition: border-color .2s;
}
.login-card input:focus { border-color: var(--blue); }
.login-card .btn-primary { width: 100%; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---- Sidebar ---- */
#sidebar {
  width: 220px; min-width: 220px; background: var(--navy);
  display: flex; flex-direction: column; height: 100%;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 16px; border-bottom: 1px solid rgba(255,255,255,.1);
}

/* Logo Emerg+ na sidebar */
.brand-logo { margin-bottom: 10px; }
.brand-logo-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  color: #fff; font-size: 16px; font-weight: 900; letter-spacing: -1px;
  box-shadow: 0 2px 8px rgba(37,99,235,.4);
}
.brand-logo-placeholder span { color: #bfdbfe; font-size: 20px; font-weight: 900; }

.brand-logo-img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; display: block; }

.sidebar-brand h2 { color: #fff; font-size: 15px; font-weight: 700; margin-top: 0; }
.brand-emerg { font-size: 12px; font-weight: 700; margin-top: 2px; color: #60a5fa; letter-spacing: .3px; }
.brand-emerg span { color: #bfdbfe; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { padding: 12px 16px 4px; font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; color: rgba(255,255,255,.7); font-size: 13px;
  border-radius: 0; transition: background .15s, color .15s; cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover  { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #60a5fa; }
.nav-item .icon  { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-time { color: rgba(255,255,255,.5); font-size: 12px; }
.sidebar-time .clock { font-size: 20px; font-weight: 700; color: #60a5fa; }

/* ---- Main Content ---- */
#main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: #fff; border-bottom: 1px solid var(--border);
  min-height: 60px;
}
.topbar-title h1 { font-size: 18px; font-weight: 700; color: var(--navy); }
.topbar-title p  { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions  { display: flex; gap: 8px; }

.page { flex: 1; overflow-y: auto; padding: 24px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px; font-weight: 500;
  font-size: 13px; transition: all .15s; white-space: nowrap;
}
.btn-primary   { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-navy      { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-d); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline   { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { background: var(--bg); }
.btn-ghost     { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm        { padding: 5px 10px; font-size: 12px; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ---- Cards ---- */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-size: 15px; font-weight: 600; color: var(--navy); }
.card-body  { padding: 20px; }

/* ---- Dashboard ---- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px 20px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.blue::before   { background: var(--blue); }
.stat-card.green::before  { background: var(--success); }
.stat-card.red::before    { background: var(--danger); }
.stat-card.amber::before  { background: var(--warn); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--navy); margin: 4px 0 2px; }
.stat-sub   { font-size: 12px; color: var(--muted); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---- Meeting List Items ---- */
.meeting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.meeting-item:last-child { border-bottom: none; }
.meeting-item-left { display: flex; align-items: center; gap: 12px; }
.meeting-date-badge {
  background: var(--blue-l); color: var(--blue);
  border-radius: 8px; padding: 6px 10px; text-align: center;
  min-width: 52px;
}
.meeting-date-badge .day  { font-size: 18px; font-weight: 700; line-height: 1; }
.meeting-date-badge .month { font-size: 10px; text-transform: uppercase; font-weight: 600; }
.meeting-info h3   { font-size: 14px; font-weight: 600; }
.meeting-info p    { font-size: 12px; color: var(--muted); margin-top: 2px; }
.meeting-item-actions { display: flex; gap: 6px; }

/* ---- Status Badge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #166534; }
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-blue   { background: #dbeafe; color: #1e40af; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-violet { background: #ede9fe; color: #5b21b6; }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 9px 18px; font-size: 13px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; gap: 6px; border-radius: 6px 6px 0 0;
}
.tab:hover   { color: var(--text); background: var(--bg); }
.tab.active  { color: var(--navy); border-bottom-color: var(--blue); font-weight: 600; }
.tab .dot    { width: 8px; height: 8px; border-radius: 50%; }
.tab-medica   .dot { background: var(--medica); }
.tab-enf      .dot { background: var(--enf); }
.tab-rec      .dot { background: var(--rec); }
.tab-out      .dot { background: var(--out); }

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

/* ---- Sector Header ---- */
.sector-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.sector-indicator {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
}
.sector-indicator.medica   { background: var(--medica); }
.sector-indicator.enfermagem { background: var(--enf); }
.sector-indicator.recepcao { background: var(--rec); }
.sector-indicator.outras   { background: var(--out); }
.sector-indicator.geral    { background: var(--geral); }
.sector-label { font-size: 13px; font-weight: 600; color: var(--navy); }

/* ---- Notes Editor ---- */
.notes-editor {
  width: 100%; min-height: 180px; padding: 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  resize: vertical; line-height: 1.7; outline: none;
  transition: border-color .2s; background: #fff; color: var(--text);
}
.notes-editor:focus { border-color: var(--blue); }

/* ---- Tasks ---- */
.task-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-check {
  margin-top: 2px; width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--blue); cursor: pointer;
}
.task-body { flex: 1; min-width: 0; }
.task-desc { font-size: 13px; line-height: 1.5; }
.task-desc.done { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.task-responsible { font-size: 11px; color: var(--muted); }
.task-deadline { font-size: 11px; color: var(--muted); }
.task-actions { display: flex; gap: 4px; align-items: flex-start; }

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 32px; text-align: center; cursor: pointer;
  transition: all .2s; background: #fafafa;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--blue); background: var(--blue-l);
}
.upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { color: var(--muted); font-size: 13px; }
.upload-zone strong { color: var(--blue); }

/* ---- Form Elements ---- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border);
  border-radius: 8px; outline: none; transition: border-color .2s;
  background: #fff;
}
.form-control:focus { border-color: var(--blue); }
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ---- Modal ---- */
#modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  align-items: center; justify-content: center;
}
#modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 24px;
  width: 640px; max-width: 96vw; max-height: 92vh;
  overflow-y: auto; box-shadow: var(--shadow-md);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--navy); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---- Table ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 12px; text-align: left; font-size: 11px;
  font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; border-bottom: 2px solid var(--border);
  background: #f8fafc;
}
.data-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  font-size: 13px; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f8fafc; }

/* ---- Priority ---- */
.priority-alta   { color: var(--danger); }
.priority-media  { color: var(--warn); }
.priority-baixa  { color: var(--muted); }

/* ---- Empty State ---- */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ---- Toast ---- */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999;
}
.toast {
  background: var(--navy); color: #fff; padding: 12px 16px;
  border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-md);
  max-width: 320px; animation: slideIn .2s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.warn    { background: var(--warn); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- Spinner ---- */
.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- History Filter ---- */
.filter-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-row.cols-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  #sidebar { width: 60px; min-width: 60px; }
  .sidebar-brand h2, .sidebar-brand p, .nav-item span,
  .nav-section, .sidebar-time { display: none; }
  .nav-item { justify-content: center; }
  .stats-grid { grid-template-columns: 1fr; }
  .page { padding: 12px; }
}

/* ---- Sector color borders on cards ---- */
.sector-card-medica   { border-left: 4px solid var(--medica) !important; }
.sector-card-enfermagem { border-left: 4px solid var(--enf) !important; }
.sector-card-recepcao { border-left: 4px solid var(--rec) !important; }
.sector-card-outras   { border-left: 4px solid var(--out) !important; }
.sector-card-geral    { border-left: 4px solid var(--geral) !important; }

/* ---- PDF button ---- */
.pdf-options { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Analysis Items ---- */
.analysis-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap;
}
.analysis-item:last-child { border-bottom: none; }
.analysis-item-left  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.analysis-item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.analysis-problem {
  font-size: 13px; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 340px;
}
.analysis-date { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---- Alert ---- */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
}
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warn    { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ============================================
   HOSPITAIS — Santa Luzia / Santa Helena
   ============================================ */

/* Variáveis dos hospitais */
:root {
  --luzia:   #1e3a5f;
  --luzia-l: #dbeafe;
  --helena:  #047857;
  --helena-l:#d1fae5;
}

/* Badge de pendências na nav */
.nav-badge {
  background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; margin-left: auto;
}

/* ---- Blink: tarefas com +7 dias sem resolução ---- */
@keyframes blink-overdue {
  0%, 100% { background-color: transparent; }
  50%       { background-color: rgba(220, 38, 38, 0.08); }
}
.task-overdue {
  animation: blink-overdue 2s ease-in-out infinite;
  border-left: 3px solid var(--danger) !important;
  border-radius: 4px;
  padding-left: 8px !important;
}
.task-overdue .task-desc { color: var(--danger); font-weight: 500; }
.overdue-badge {
  background: #fee2e2; color: #991b1b; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; white-space: nowrap;
}

/* ---- Hospital Header Banner ---- */
.hospital-header {
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px;
  color: #fff; position: relative; overflow: hidden;
}
.hospital-header.luzia    { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); }
.hospital-header.helena   { background: linear-gradient(135deg, #047857 0%, #10b981 100%); }
.hospital-header.esperanca{ background: linear-gradient(135deg, #92400e 0%, #f59e0b 100%); }
.hospital-header h2 { font-size: 20px; font-weight: 700; }
.hospital-header p  { font-size: 13px; opacity: .8; margin-top: 4px; }
.hospital-header .hosp-icon {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 60px; opacity: .15;
}
.hospital-stats {
  display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap;
}
.hospital-stat { text-align: center; }
.hospital-stat .hval { font-size: 24px; font-weight: 700; }
.hospital-stat .hlabel { font-size: 11px; opacity: .8; }

/* ---- Hospital Task Card ---- */
.hosp-task-card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 12px;
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.hosp-task-card:hover { box-shadow: var(--shadow-md); }
.hosp-task-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; cursor: default;
}
.hosp-task-body { flex: 1; min-width: 0; }
.hosp-task-desc { font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--text); }
.hosp-task-desc.done { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.hosp-task-meta { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.hosp-task-actions { display: flex; gap: 4px; align-items: flex-start; flex-shrink: 0; }

/* ---- Task Observation Field ---- */
.task-observation {
  border-top: 1px dashed var(--border);
  padding: 10px 16px 14px 44px;
}
.obs-label {
  font-size: 10px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.obs-textarea {
  width: 100%; min-height: 56px; max-height: 180px;
  padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 6px; resize: vertical; font-size: 12px;
  line-height: 1.6; outline: none; transition: border-color .2s;
  font-family: inherit; background: #fafafa; color: var(--text);
}
.obs-textarea:focus { border-color: var(--blue); background: #fff; }
.obs-save-btn {
  margin-top: 4px; font-size: 11px; padding: 3px 8px;
  border-radius: 4px; background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; color: var(--muted); transition: all .15s;
}
.obs-save-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- Pendências page ---- */
.pendencias-filter {
  display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.hospital-pill {
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 2px solid transparent; transition: all .15s;
}
.hospital-pill.all      { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.hospital-pill.luzia    { background: var(--luzia-l); color: var(--luzia); border-color: #93c5fd; }
.hospital-pill.helena   { background: var(--helena-l); color: var(--helena); border-color: #6ee7b7; }
.hospital-pill.none     { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.hospital-pill.esperanca{ background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.hospital-pill.active { opacity: 1; box-shadow: 0 0 0 2px rgba(37,99,235,.3); }
.hospital-pill:not(.active) { opacity: .7; }

/* Botões de atribuição de hospital */
.assign-btn {
  font-size: 11px; padding: 3px 10px; border-radius: 14px; font-weight: 600;
  cursor: pointer; border: 1.5px solid; transition: all .15s; white-space: nowrap;
}
.assign-btn.luzia    { color: var(--luzia); border-color: #93c5fd; background: var(--luzia-l); }
.assign-btn.luzia:hover    { background: var(--luzia); color: #fff; }
.assign-btn.helena   { color: var(--helena); border-color: #6ee7b7; background: var(--helena-l); }
.assign-btn.helena:hover   { background: var(--helena); color: #fff; }
.assign-btn.esperanca{ color: #92400e; border-color: #f59e0b; background: #fef3c7; }
.assign-btn.esperanca:hover{ background: #f59e0b; color: #fff; }

/* ---- Dashboard hospital strip ---- */
.hosp-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px;
}
.hosp-strip-card {
  border-radius: var(--radius); padding: 16px 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow); color: #fff;
  position: relative; overflow: hidden;
}
.hosp-strip-card.luzia     { background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); }
.hosp-strip-card.helena    { background: linear-gradient(135deg, #047857 0%, #10b981 100%); }
.hosp-strip-card.esperanca { background: linear-gradient(135deg, #92400e 0%, #f59e0b 100%); }
.hosp-strip-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.hosp-strip-card .hs-stats { display: flex; gap: 20px; }
.hosp-strip-card .hs-num { font-size: 28px; font-weight: 700; }
.hosp-strip-card .hs-lbl { font-size: 11px; opacity: .75; margin-top: 2px; }
.hosp-strip-card .hs-icon {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 56px; opacity: .12;
}

/* ---- SWOT Analysis ---- */
.swot-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.swot-quadrant {
  border-radius: 8px; padding: 14px;
  border: 1px solid var(--border);
}
.swot-quadrant.forcas      { background: #f0fdf4; border-color: #bbf7d0; }
.swot-quadrant.fraquezas   { background: #fff1f2; border-color: #fecdd3; }
.swot-quadrant.oportunidades { background: #eff6ff; border-color: #bfdbfe; }
.swot-quadrant.ameacas     { background: #fffbeb; border-color: #fde68a; }
.swot-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 10px;
}
.swot-quadrant.forcas .swot-title      { color: #166534; }
.swot-quadrant.fraquezas .swot-title   { color: #9f1239; }
.swot-quadrant.oportunidades .swot-title { color: #1e40af; }
.swot-quadrant.ameacas .swot-title     { color: #92400e; }
.swot-item {
  margin-bottom: 8px;
}
.swot-item-label { font-size: 12px; font-weight: 600; color: var(--text); }
.swot-item-detail { font-size: 11px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

/* ---- AI Analysis selector ---- */
.ai-type-selector {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.ai-type-btn {
  flex: 1; padding: 12px 8px; border-radius: 8px; text-align: center;
  border: 2px solid var(--border); cursor: pointer; transition: all .15s;
  background: #fff;
}
.ai-type-btn:hover { border-color: var(--blue); }
.ai-type-btn.active { border-color: var(--blue); background: var(--blue-l); }
.ai-type-btn .ai-icon { font-size: 22px; margin-bottom: 4px; }
.ai-type-btn .ai-label { font-size: 12px; font-weight: 600; color: var(--navy); }
.ai-type-btn .ai-desc  { font-size: 10px; color: var(--muted); margin-top: 2px; }

/* Hospital badge na nav active state */
.nav-item[data-view="luzia"].active  { border-left-color: #60a5fa; }
.nav-item[data-view="helena"].active { border-left-color: #34d399; }
.nav-item[data-view="pendencias"].active { border-left-color: #fbbf24; }

/* ============================================================
   AUTH — email field + change-password screen
   ============================================================ */
#login-screen,
#changepw-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--navy) 0%, #1e40af 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.login-card input + input { margin-top: 8px; }

#changepw-screen .login-card input { margin-top: 0; }
#changepw-screen .login-card input + input { margin-top: 8px; }

/* sidebar user info */
.sidebar-user {
  padding: 10px 16px 6px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user-name {
  font-size: 12px; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: rgba(255,255,255,.55); margin-top: 2px;
}

/* badge variants */
.badge-blue  { background:#dbeafe; color:#1d4ed8; }
.badge-gray  { background:#f1f5f9; color:#475569; }
.badge-green { background:#d1fae5; color:#065f46; }

/* topbar TDAH button */
.tdah-toggle-btn {
  background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0;
}
.tdah-toggle-btn:hover { background: #dcfce7; }

/* ============================================================
   MODO FOCO TDAH — painel lateral deslizante
   ============================================================ */
.tdah-panel {
  position: fixed; top: 0; right: -420px; width: 400px; height: 100vh;
  background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 9998; overflow-y: auto;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; gap: 0;
  font-family: var(--font, 'Inter', sans-serif);
}
.tdah-panel--open { right: 0; }

.tdah-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  position: sticky; top: 0; z-index: 1;
}
.tdah-title { margin: 0; font-size: 17px; font-weight: 700; color: var(--navy); }
.tdah-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--muted); padding: 4px 8px; border-radius: 6px;
}
.tdah-close:hover { background: var(--bg); color: var(--text); }

.tdah-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.tdah-section h3 {
  margin: 0 0 12px; font-size: 13px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}

/* Focus task */
.tdah-focus-task {
  background: var(--blue-l); border: 1px solid #bfdbfe;
  border-radius: 10px; padding: 12px 14px;
}
.tdah-focus-task.tdah-focus-empty { background: #fafafa; border-color: var(--border); }
.tdah-focus-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--blue); color: #fff;
  padding: 2px 8px; border-radius: 20px; margin-bottom: 6px;
}
.tdah-focus-title {
  margin: 0; font-size: 14px; font-weight: 600; color: var(--navy); line-height: 1.4;
}
.tdah-focus-hosp {
  display: inline-block; margin-top: 6px; font-size: 11px; color: var(--muted);
}

/* Pomodoro ring */
.tdah-timer-wrap {
  position: relative; width: 120px; height: 120px; margin: 0 auto 12px;
}
.tdah-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.tdah-ring-bg {
  fill: none; stroke: #e2e8f0; stroke-width: 8;
}
.tdah-ring-progress {
  fill: none; stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.726; /* 2π×52 */
  transition: stroke-dashoffset .8s linear, stroke .4s;
}
.tdah-timer-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.tdah-timer-label {
  font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1;
}
.tdah-timer-mode {
  font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 600;
}
.tdah-timer-btns {
  display: flex; gap: 8px; justify-content: center; margin-top: 4px;
}

/* Micro-steps */
.tdah-steps-list, .tdah-captures-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px;
  max-height: 180px; overflow-y: auto;
}
.tdah-step {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 8px; padding: 8px 10px;
  font-size: 13px;
}
.tdah-step.done .tdah-step-text {
  text-decoration: line-through; color: var(--muted);
}
.tdah-step-check, .tdah-step-del {
  background: none; border: none; cursor: pointer; font-size: 15px;
  padding: 0 2px; flex-shrink: 0;
}
.tdah-step-del { color: #cbd5e1; margin-left: auto; }
.tdah-step-del:hover { color: #ef4444; }
.tdah-step-text { flex: 1; line-height: 1.4; }

/* Capture */
.tdah-capture-item {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 10px; font-size: 12px;
}
.tdah-capture-ts {
  flex-shrink: 0; font-size: 10px; color: var(--muted);
  background: #fef3c7; padding: 1px 6px; border-radius: 4px; margin-top: 1px;
}
.tdah-capture-text { flex: 1; line-height: 1.4; color: var(--text); }

/* Add row */
.tdah-add-row {
  display: flex; gap: 6px; align-items: center;
}
.tdah-input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; outline: none;
  font-family: inherit; color: var(--text); background: #fff;
}
.tdah-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.tdah-empty {
  margin: 0; font-size: 12px; color: var(--muted);
  text-align: center; padding: 12px 0; font-style: italic;
}

@media (max-width: 480px) {
  .tdah-panel { width: 100vw; right: -100vw; }
}
