/* ════════════════════════════════════════════════════════════════
   NexusCare — Plataforma Preditiva de Fluxos Hospitalares
   Folha de estilos principal
   ════════════════════════════════════════════════════════════════ */

:root {
  --bg:          #0b1220;
  --bg-soft:     #0f1a2e;
  --surface:     #ffffff;
  --surface-2:   #f4f7fb;
  --line:        #e4e9f2;
  --ink:         #0f172a;
  --ink-soft:    #475569;
  --muted:       #94a3b8;

  --brand:       #0ea5e9;   /* azul-ciano clínico */
  --brand-2:     #2dd4bf;   /* teal */
  --brand-deep:  #0c4a6e;
  --accent:      #6366f1;

  --ok:          #10b981;
  --warn:        #f59e0b;
  --high:        #f97316;
  --crit:        #ef4444;

  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 12px 30px -12px rgba(15, 23, 42, .25);
  --shadow-sm:   0 4px 14px -8px rgba(15, 23, 42, .3);
  --font:        'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--ink); background: var(--surface-2); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1180px, 92%); margin-inline: auto; }
.muted { color: var(--muted); font-size: .85rem; }
code { background: #0f172a10; padding: 2px 6px; border-radius: 6px; font-size: .85em; }

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .95rem; padding: .7rem 1.2rem;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 24px -10px var(--brand); }
.btn-ghost { background: transparent; border-color: #ffffff33; color: #fff; }
.pg-inicio .btn-ghost { color: #fff; }
.btn-block { width: 100%; justify-content: center; }

/* ════════════════ NAV PÚBLICA + HERO ════════════════ */
.pg-inicio { background: var(--bg); color: #e2e8f0; }

.nav-public { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px);
  background: rgba(11, 18, 32, .72); border-bottom: 1px solid #ffffff14; }
.nav-public-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; }
.nav-public-links { display: flex; align-items: center; gap: 1.6rem; }
.nav-public-links a { color: #cbd5e1; font-weight: 500; font-size: .95rem; }
.nav-public-links a:hover { color: #fff; }

.brand { display: inline-flex; align-items: center; gap: .65rem; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 1.4rem; }
.brand-text { font-weight: 800; font-size: 1.25rem; color: #fff; letter-spacing: -.02em; }
.brand-text small { font-weight: 500; color: var(--brand-2); margin-left: 4px; font-size: .65em; text-transform: uppercase; letter-spacing: .1em; }

.hero { padding: clamp(3rem, 8vw, 6rem) 0; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: -30% -10% auto auto; width: 60%; height: 120%;
  background: radial-gradient(closest-side, rgba(14,165,233,.22), transparent 70%); pointer-events: none; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; position: relative; }
.hero-copy h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.05; font-weight: 900; letter-spacing: -.03em; color: #fff; margin: 1.1rem 0; }
.hero-copy h1 span { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { color: #aab8cc; font-size: 1.06rem; max-width: 56ch; }
.hero-copy em { color: #e2e8f0; font-style: normal; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: .45rem; font-size: .82rem; font-weight: 600;
  color: var(--brand-2); background: #2dd4bf18; border: 1px solid #2dd4bf33; padding: .4rem .85rem; border-radius: 999px; }
.hero-cta { display: flex; gap: .8rem; margin: 1.8rem 0; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2.2rem; margin-top: 1.5rem; }
.hero-stats strong { display: block; font-size: 1.7rem; color: #fff; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: .82rem; }

/* Hero visual card */
.hero-visual { display: grid; place-items: center; }
.hv-card { width: 100%; max-width: 360px; background: linear-gradient(160deg, #13213b, #0d1830);
  border: 1px solid #ffffff14; border-radius: 22px; padding: 1.5rem; box-shadow: var(--shadow); }
.hv-card-head { display: flex; justify-content: space-between; align-items: center; color: #cbd5e1; font-size: .85rem; font-weight: 600; }
.hv-card-head i { color: var(--brand-2); }
.hv-badge { font-size: .7rem; padding: .25rem .6rem; border-radius: 999px; font-weight: 700; }
.hv-badge--elevado { background: #f9731622; color: #fdba74; }
.hv-metric { margin: 1.1rem 0 .3rem; }
.hv-metric strong { font-size: 3rem; font-weight: 900; color: #fff; line-height: 1; }
.hv-metric span { color: var(--muted); font-size: .85rem; margin-left: .4rem; }
.hv-bars { display: flex; align-items: flex-end; gap: .5rem; height: 90px; margin: 1.2rem 0; }
.hv-bars span { flex: 1; height: var(--h); border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); opacity: .85; }
.hv-foot { color: #cbd5e1; font-size: .85rem; border-top: 1px solid #ffffff14; padding-top: .9rem; }
.hv-foot i { color: var(--brand-2); }

/* ════════════════ SECÇÕES ════════════════ */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section--alt { background: var(--bg-soft); }
.section-title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 800; text-align: center; color: #fff; letter-spacing: -.02em; }
.section-lead { text-align: center; color: var(--muted); max-width: 60ch; margin: .8rem auto 2.6rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.feature, .layer { background: #ffffff08; border: 1px solid #ffffff12; border-radius: var(--radius); padding: 1.6rem; }
.feature i { font-size: 2rem; color: var(--brand-2); }
.feature h3, .layer h3 { color: #fff; margin: .8rem 0 .4rem; font-size: 1.15rem; }
.feature p, .layer p { color: var(--muted); font-size: .92rem; }
.layer-tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--brand-2); font-weight: 700; }
.layer h3 { display: flex; align-items: center; gap: .5rem; }
.layer h3 i { font-size: 1.5rem; }
.layer--ai { border-color: #2dd4bf44; background: linear-gradient(160deg, #2dd4bf12, transparent); }

/* Flow */
.flow { list-style: none; max-width: 720px; margin: 0 auto; display: grid; gap: 1rem; }
.flow li { display: flex; gap: 1rem; align-items: flex-start; background: #ffffff08; border: 1px solid #ffffff12; border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.flow li span { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; }
.flow h4 { color: #fff; font-size: 1.02rem; }
.flow p { color: var(--muted); font-size: .9rem; }
.flow-cta { text-align: center; margin-top: 2.4rem; }

/* Footer público */
.footer-public { background: var(--bg); border-top: 1px solid #ffffff12; padding: 2.4rem 0; color: var(--muted); }
.footer-public-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.footer-public p { font-size: .85rem; }
.brand-text--foot { font-size: 1.1rem; }
.footer-hospital { display: grid; gap: .1rem; }
.footer-hospital strong { color: #e2e8f0; font-size: .95rem; }
.footer-hospital small { font-size: .78rem; }

/* ════════════════ AUTENTICAÇÃO ════════════════ */
.pg-login { background: radial-gradient(120% 100% at 50% 0%, #14233f, #0b1220); min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-card { background: #fff; border-radius: 22px; padding: 2.4rem; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.auth-brand { display: flex; align-items: center; gap: .6rem; justify-content: center; margin-bottom: 1.4rem; }
.auth-brand .brand-text { color: var(--ink); }
.auth-brand .brand-text small { color: var(--brand); }
.auth-card h1 { font-size: 1.5rem; text-align: center; }
.auth-sub { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.6rem; }
.auth-form label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin: .9rem 0 .35rem; }
.field { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 12px; padding: .1rem .9rem; background: var(--surface-2); transition: border .2s, box-shadow .2s; }
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px #0ea5e91f; background: #fff; }
.field i { color: var(--muted); font-size: 1.2rem; }
.field input { border: none; outline: none; background: transparent; padding: .8rem 0; width: 100%; font-size: .95rem; }
.auth-form .btn { margin-top: 1.4rem; }
.auth-hint { margin-top: 1.4rem; font-size: .82rem; color: var(--ink-soft); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: .7rem .9rem; }
.auth-back { display: block; text-align: center; margin-top: 1.2rem; color: var(--muted); font-size: .88rem; }
.auth-back:hover { color: var(--brand); }

.alert { display: flex; align-items: center; gap: .5rem; border-radius: 10px; padding: .75rem 1rem; font-size: .9rem; margin-bottom: 1rem; }
.alert-erro { background: #ef44441a; color: #b91c1c; border: 1px solid #ef444433; }

/* ════════════════ APP SHELL ════════════════ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar { width: 248px; flex: none; background: var(--bg); color: #cbd5e1; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.2rem; border-bottom: 1px solid #ffffff12; }
.sb-logo { display: flex; align-items: center; gap: .55rem; }
.sb-logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 1.25rem; }
.sb-logo-text { font-weight: 800; color: #fff; font-size: 1.05rem; }
.sb-logo-text small { display: block; font-size: .58rem; color: var(--brand-2); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.sb-close { display: none; background: none; border: none; color: #cbd5e1; font-size: 1.5rem; cursor: pointer; }

.sb-nav { flex: 1; padding: 1.2rem .8rem; overflow-y: auto; }
.sb-group { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: #64748b; font-weight: 700; padding: .8rem .7rem .4rem; }
.sb-nav ul { list-style: none; }
.sb-nav li a { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border-radius: 10px; color: #cbd5e1; font-weight: 500; font-size: .94rem; transition: background .15s, color .15s; }
.sb-nav li a i { font-size: 1.25rem; }
.sb-nav li a:hover { background: #ffffff0d; color: #fff; }
.sb-nav li.active a { background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 18px -10px var(--brand); }

.sb-foot { padding: 1rem; border-top: 1px solid #ffffff12; }
.sb-user { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.sb-user i { font-size: 2rem; color: var(--brand-2); }
.sb-user strong { display: block; color: #fff; font-size: .9rem; }
.sb-user small { color: var(--muted); font-size: .75rem; text-transform: capitalize; }
.sb-logout { display: flex; align-items: center; gap: .5rem; color: #fca5a5; font-size: .88rem; font-weight: 500; padding: .5rem; border-radius: 8px; }
.sb-logout:hover { background: #ef44441a; }

.sb-overlay { display: none; }

/* Main */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.6rem; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.sb-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink); }
.topbar-title h1 { font-size: 1.2rem; text-transform: capitalize; }
.topbar-title span { font-size: .82rem; color: var(--muted); }
.topbar-meta { margin-left: auto; text-align: right; }
.topbar-meta .clock { display: block; font-weight: 800; font-size: 1.1rem; color: var(--brand-deep); }
.topbar-meta .date { font-size: .78rem; color: var(--muted); }

.app-content { padding: 1.6rem; display: grid; gap: 1.4rem; }
.app-footer { margin-top: auto; padding: 1.2rem 1.6rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .8rem; text-align: center; }

/* ── Banner motor IA ─────────────────────────────────────── */
.engine-banner { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: 12px; font-size: .9rem; font-weight: 500; }
.engine-banner i { font-size: 1.2rem; }
.engine-banner.is-online { background: #10b9811a; color: #047857; border: 1px solid #10b98133; }
.engine-banner.is-offline { background: #f59e0b1a; color: #b45309; border: 1px solid #f59e0b33; }
.engine-refresh { margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .8rem; font-weight: 600; font-size: .82rem; cursor: pointer; color: var(--ink); }
.engine-refresh:hover { border-color: var(--brand); color: var(--brand); }

/* ── Banner de risco ─────────────────────────────────────── */
.risk-banner { display: flex; align-items: center; gap: 1.2rem; padding: 1.3rem 1.5rem; border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--risk) 16%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--risk) 35%, var(--line)); box-shadow: var(--shadow-sm); }
.risk-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; background: var(--risk); color: #fff; font-size: 1.8rem; }
.risk-label { font-size: .82rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.risk-level { display: block; font-size: 1.9rem; font-weight: 900; color: var(--risk); letter-spacing: -.01em; }
.risk-conf { margin-left: auto; text-align: right; }
.risk-conf span { font-size: .78rem; color: var(--muted); }
.risk-conf strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink); }

/* ── KPIs ────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow-sm); }
.kpi-ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.kpi-body span { font-size: .8rem; color: var(--ink-soft); }
.kpi-body strong { display: block; font-size: 1.8rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi-body strong small { font-size: .6em; font-weight: 600; color: var(--muted); }

/* ── Cards ───────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.card-head h2 { font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.card-head h2 i { color: var(--brand); }
.legend { font-size: .8rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: .3rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--prev { background: var(--brand); }
.dot--med { background: var(--muted); }

.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 1.4rem; }

/* Contentor de gráfico com altura fixa — evita o loop de crescimento do Chart.js */
.chart-box { position: relative; width: 100%; height: 300px; }
.chart-box--sm { height: 240px; }
.chart-box canvas { max-width: 100%; }

/* Context list */
.context-list { list-style: none; display: grid; gap: .2rem; }
.context-list li { display: flex; align-items: center; gap: .7rem; padding: .65rem .3rem; border-bottom: 1px dashed var(--line); }
.context-list li:last-child { border-bottom: none; }
.context-list li i { font-size: 1.2rem; color: var(--brand); width: 24px; }
.context-list li span { color: var(--ink-soft); font-size: .9rem; }
.context-list li strong { margin-left: auto; font-weight: 700; }

/* ── Tabelas ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .7rem .8rem; border-bottom: 2px solid var(--line); }
.table td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: var(--surface-2); }
.table .empty { text-align: center; color: var(--muted); padding: 1.6rem; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); }
.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .76rem; font-weight: 600; padding: .25rem .6rem; border-radius: 8px; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line); }
.tag--ai { background: #2dd4bf18; color: #0f766e; border-color: #2dd4bf44; }

/* ════════════════ DASHBOARD OPERACIONAL ════════════════ */

/* Semáforo de prontidão */
.semaforo-panel { --risk: #10b981; display: flex; align-items: center; gap: 1.6rem;
  background: linear-gradient(120deg, color-mix(in srgb, var(--risk) 14%, #fff), #fff);
  border: 1px solid color-mix(in srgb, var(--risk) 38%, var(--line));
  border-radius: var(--radius); padding: 1.5rem 1.8rem; box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.semaforo-panel.s-VERDE    { --risk: #10b981; }
.semaforo-panel.s-AMARELO  { --risk: #f59e0b; }
.semaforo-panel.s-VERMELHO { --risk: #ef4444; }

.semaforo-lamp { display: flex; flex-direction: column; gap: .55rem; padding: .8rem .65rem;
  background: #0b1220; border-radius: 14px; flex: none; }
.lamp { width: 30px; height: 30px; border-radius: 50%; opacity: .18; transition: opacity .25s, box-shadow .25s; }
.lamp-red   { background: #ef4444; }
.lamp-amber { background: #f59e0b; }
.lamp-green { background: #10b981; }
.s-VERMELHO .lamp-red   { opacity: 1; box-shadow: 0 0 18px 2px #ef4444aa; }
.s-AMARELO  .lamp-amber { opacity: 1; box-shadow: 0 0 18px 2px #f59e0baa; }
.s-VERDE    .lamp-green { opacity: 1; box-shadow: 0 0 18px 2px #10b981aa; }

.semaforo-body { flex: 1; min-width: 220px; }
.semaforo-kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; }
.semaforo-estado { display: block; font-size: 2.2rem; font-weight: 900; color: var(--risk); line-height: 1.1; letter-spacing: -.01em; }
.semaforo-prontidao { color: var(--ink-soft); font-size: .95rem; margin: .2rem 0 .7rem; max-width: 52ch; }
.semaforo-meta { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .84rem; color: var(--ink-soft); }
.semaforo-meta i { color: var(--risk); }
.semaforo-meta b { color: var(--ink); }

.semaforo-nowcast { flex: none; min-width: 180px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: .9rem 1rem; display: grid; gap: .15rem; }
.semaforo-nowcast > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: .25rem; }
.semaforo-nowcast small { font-size: .82rem; color: var(--ink-soft); }
.semaforo-nowcast b { color: var(--ink); }
.origem-tag { margin-top: .4rem; display: inline-block; width: fit-content; font-size: .7rem; font-weight: 700;
  padding: .15rem .5rem; border-radius: 6px; background: #94a3b81f; color: var(--ink-soft); }
.origem-tag.is-ia { background: #2dd4bf22; color: #0f766e; }

/* KPI compactos (6 colunas) */
.kpi-grid--6 { grid-template-columns: repeat(6, 1fr); }
.kpi--sm { padding: .9rem; gap: .7rem; }
.kpi--sm .kpi-ic { width: 40px; height: 40px; font-size: 1.2rem; }
.kpi--sm .kpi-body strong { font-size: 1.4rem; }
.kpi--sm .kpi-body span small { font-weight: 400; }

/* Lista Manchester */
.manchester-list { list-style: none; display: grid; gap: .7rem; }
.manchester-list li { display: flex; align-items: center; gap: .7rem; }
.m-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.m-nome { width: 150px; flex: none; font-size: .88rem; font-weight: 600; }
.m-nome small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; }
.m-bar { flex: 1; height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.m-bar span { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.m-num { width: 34px; text-align: right; font-weight: 800; font-size: 1.05rem; }
.m-alvo-aviso { margin-top: 1rem; font-size: .85rem; color: #b45309; background: #f59e0b14; border: 1px solid #f59e0b33;
  border-radius: 10px; padding: .6rem .9rem; display: flex; align-items: center; gap: .4rem; }

/* Alertas */
.alertas-list { display: grid; gap: .7rem; }
.alerta-item { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .9rem; border-radius: 12px; border-left: 4px solid; }
.alerta-item i { font-size: 1.2rem; margin-top: .1rem; }
.alerta-item strong { font-size: .82rem; text-transform: capitalize; letter-spacing: .01em; }
.alerta-item p { font-size: .85rem; color: var(--ink-soft); margin-top: .1rem; }
.alerta-item.sev-vermelho { background: #ef44440f; border-color: #ef4444; }
.alerta-item.sev-vermelho i { color: #ef4444; }
.alerta-item.sev-amarelo  { background: #f59e0b0f; border-color: #f59e0b; }
.alerta-item.sev-amarelo i { color: #f59e0b; }
.alerta-item.sev-verde    { background: #10b9810f; border-color: #10b981; }
.sem-alertas { display: flex; align-items: center; gap: .5rem; color: #047857; background: #10b9811a; border: 1px solid #10b98133;
  border-radius: 10px; padding: .9rem 1rem; font-size: .9rem; }

/* Tempo excedido na tabela */
.tempo-excedido { color: #ef4444; font-weight: 700; }

/* Equipa em serviço */
.equipa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.equipa-chip { display: flex; align-items: center; gap: .7rem; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .9rem; border-left: 4px solid var(--muted); }
.equipa-chip i { font-size: 1.4rem; color: var(--muted); }
.equipa-chip strong { display: block; font-size: .9rem; }
.equipa-chip small { color: var(--muted); font-size: .76rem; }
.equipa-chip.cat-medico { border-left-color: #0ea5e9; } .equipa-chip.cat-medico i { color: #0ea5e9; }
.equipa-chip.cat-enfermeiro { border-left-color: #10b981; } .equipa-chip.cat-enfermeiro i { color: #10b981; }
.equipa-chip.cat-auxiliar { border-left-color: #f59e0b; } .equipa-chip.cat-auxiliar i { color: #f59e0b; }
.equipa-chip.cat-administrativo { border-left-color: #6366f1; } .equipa-chip.cat-administrativo i { color: #6366f1; }

/* ════════════════ RESPONSIVO ════════════════ */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .grid-3 { grid-template-columns: 1fr; }
  .dash-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid--6 { grid-template-columns: repeat(3, 1fr); }
  .semaforo-nowcast { width: 100%; }
}
@media (max-width: 760px) {
  .nav-public-links a:not(.btn) { display: none; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sb-close { display: block; }
  .sb-toggle { display: block; }
  .sb-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
  .hero-stats { gap: 1.2rem; flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .kpi-grid, .kpi-grid--6 { grid-template-columns: 1fr; }
  .semaforo-panel { flex-direction: column; align-items: flex-start; }
}
