:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf1;
  --line-2: #d6dce6;
  --accent: #2f5bea;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --warn: #a16207;
  --warn-soft: #fef9e7;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px rgb(15 23 42 / .05);
  --shadow-lg: 0 24px 64px rgb(15 23 42 / .22);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f16;
    --surface: #131a24;
    --surface-2: #19212d;
    --ink: #e8edf5;
    --ink-2: #c3ccd9;
    --muted: #8b97a8;
    --line: #232d3b;
    --line-2: #2e3a4b;
    --accent: #6d8dff;
    --accent-ink: #0b0f16;
    --accent-soft: #1b2440;
    --danger: #f87171;
    --danger-soft: #2a1618;
    --ok: #4ade80;
    --ok-soft: #102419;
    --warn: #facc15;
    --warn-soft: #2a2410;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-lg: 0 24px 64px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: scale(.98); }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 14px rgb(47 91 234 / .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.lg { min-height: 48px; width: 100%; font-size: 15px; }
.btn.subtle { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
}
.icon-btn.ghost { border-color: transparent; background: var(--surface-2); }
.icon-btn:hover { color: var(--danger); }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, calc((100vw - 1240px) / 2)) 10px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand img { border-radius: 10px; }
.brand div { min-width: 0; }
.brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.brand small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) {
  .topbar .btn.primary { padding: 0 12px; }
  .brand img { width: 30px; height: 30px; }
}

.avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: linear-gradient(135deg, #6d8dff, #2f5bea); color: #fff;
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
}
.menu-list button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 10px; font-size: 14px; }
.menu-list button:hover { background: var(--surface-2); }
.menu-list .sair { color: var(--danger); }
.menu-list .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-list .who small { display: block; color: var(--muted); font-size: 12px; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 110px; }

.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 200px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-head p::first-letter { text-transform: uppercase; }

/* ---------- Indicadores / filtros ---------- */
.kpis { display: grid; gap: 10px; grid-template-columns: repeat(5, 1fr); margin-bottom: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpis .kpi:first-child { grid-column: span 2; } }
.kpi {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi b { font-size: 30px; line-height: 1; letter-spacing: -.03em; font-weight: 700; }
.kpi .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.kpi.alerta b { color: var(--danger); }
.kpi.ok b { color: var(--ok); }
.kpi:hover { border-color: var(--line-2); }
.kpi.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 13px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 500;
}
.chip b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; }
.chip.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.chip.on b { background: rgb(255 255 255 / .18); }

.search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin: 4px 0 8px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; border: 0; background: none; outline: none; height: 100%; color: var(--ink); min-width: 0; }

/* ---------- Lista de pacientes ---------- */
.grupo h2 { display: flex; align-items: center; gap: 10px; font-size: 15px; margin: 26px 0 12px; letter-spacing: -.01em; }
.grupo h2 i { width: 12px; height: 12px; border-radius: 4px; }
.grupo h2 span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 1px 9px; border-radius: 999px; }
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
@media (max-width: 420px) { .cards { grid-template-columns: 1fr; } }

.card {
  --card-ink: var(--ink); --card-muted: var(--muted); --card-line: var(--line); --card-chip: var(--surface-2);
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); color: var(--card-ink);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(15 23 42 / .1); border-color: var(--line-2); }
.card-head { display: flex; gap: 12px; align-items: center; }
.leito {
  flex: 0 0 auto; min-width: 54px; padding: 6px 8px; border-radius: 12px; text-align: center; line-height: 1.05;
  font-weight: 800; font-size: 18px; letter-spacing: -.02em;
  background: color-mix(in srgb, var(--setor) 16%, transparent); color: color-mix(in srgb, var(--setor) 75%, var(--card-ink));
  border: 1px solid color-mix(in srgb, var(--setor) 35%, transparent);
}
.leito small { display: block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.card-id { flex: 1; min-width: 0; }
.card-id .nome { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.card-id .meta { font-size: 13px; color: var(--card-muted); }

.status {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
}
.status small { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; opacity: .9; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.late { background: var(--danger-soft); color: var(--danger); }

.hd { font-size: 14px; color: var(--card-ink); }
.hd span { font-size: 11px; font-weight: 700; letter-spacing: .05em; color: var(--card-muted); margin-right: 6px; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 8px; background: var(--card-chip); color: var(--card-ink); }
.badge.vm { background: var(--danger); color: #fff; }
.badge.iso { background: #fff; color: #000; }
.badge.atb { background: var(--accent-soft); color: var(--accent); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.falta { padding-top: 12px; border-top: 1px solid var(--card-line); }
.falta-titulo {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--danger); margin-bottom: 8px;
}
.falta-itens { display: flex; flex-wrap: wrap; gap: 6px; }
.pend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 5px 11px; border-radius: 999px; border: 1px solid transparent;
  background: var(--danger-soft); color: var(--danger); font-weight: 600;
}
button.pend svg { opacity: .4; }
button.pend:hover { border-color: var(--danger); }
button.pend:hover svg { opacity: 1; }
.pronto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 6px 12px; border-radius: 999px; }
.atualizado { font-size: 11.5px; color: var(--card-muted); }

/* Paciente em isolamento: card preto */
.card.iso {
  --card-ink: #f1f5f9; --card-muted: #94a3b8; --card-line: #273142; --card-chip: #1c2533;
  background: var(--iso); border-color: #000;
}
.card.iso .leito { background: #fff; color: #000; border-color: #fff; }
.card.iso .status { background: #1c2533; color: #c7d2fe; }
.card.iso .status.ok { color: #86efac; }
.card.iso .status.late { color: #fca5a5; }
.card.iso .badge.atb, .card.iso .badge.info { background: #1e2a4a; color: #a5b4fc; }
.card.iso .badge.warn { background: #3a2f0b; color: #fde68a; }
.card.iso .pend { background: #3b1113; color: #fecaca; }
.card.iso .falta-titulo { color: #fca5a5; }
.card.iso .pronto { background: #0f2a1a; color: #86efac; }

.vazio { text-align: center; color: var(--muted); padding: 56px 16px; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); margin-top: 16px; }
.vazio b { color: var(--ink); }

.fab {
  position: fixed; right: max(16px, calc((100vw - 1240px) / 2)); bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 15;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px 0 18px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px;
  box-shadow: 0 10px 28px rgb(47 91 234 / .45);
}
.fab:hover { filter: brightness(1.06); }

/* ---------- Formulário (painel lateral) ---------- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 40; display: flex; justify-content: flex-end;
  background: rgb(15 23 42 / .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fade .18s ease-out;
}
.sheet {
  width: 100%; max-width: 720px; height: 100%; background: var(--bg);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slide .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet > form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.sheet.small { max-width: 520px; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@media (max-width: 640px) { @keyframes slide { from { transform: translateY(40px); opacity: .4; } } }

.sheet-head {
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 14px) 20px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-head small { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px calc(env(safe-area-inset-bottom) + 12px); background: var(--surface); border-top: 1px solid var(--line);
}
.foot-msg { flex: 1; font-size: 13px; color: var(--muted); }
.foot-msg.erro { color: var(--danger); font-weight: 600; }

.fsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.fsec h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 15px; letter-spacing: -.01em; }
.fsec h3 span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent); font-size: 13px;
}
.row { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.label em, .mini em { color: var(--danger); font-style: normal; margin-left: 3px; }
.field input, .field select, .field textarea, .mini input {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus, .mini input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.calc { font-size: 13px; color: var(--accent); font-weight: 600; min-height: 1em; }
.field .msg, .sub > .msg { display: none; color: var(--danger); font-size: 12.5px; font-weight: 600; }
.field.invalid > .msg, .sub.invalid > .msg { display: block; }
.field.invalid input, .field.invalid textarea, .sub.invalid .mini input:placeholder-shown, .sub.invalid input:invalid { border-color: var(--danger); background: var(--danger-soft); }
.field.invalid > .opts .opt span { border-color: var(--danger); }
.field.invalid > .label { color: var(--danger); }
.sub.invalid { border-color: var(--danger); }
.sub.vazao.invalid .mini input { border-color: var(--danger); background: var(--danger-soft); }

/* Opções em forma de botões (radio / checkbox) */
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 15px;
  border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); font-size: 14px; font-weight: 500;
  user-select: none; cursor: pointer; transition: all .12s;
}
.opt span:hover { border-color: var(--muted); }
.opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opts.seg .opt { flex: 1; }
.opts.seg .opt span { width: 100%; justify-content: center; min-width: 76px; }
.opts.setores .opt { flex: 1; }
.opts.setores .opt span { width: 100%; justify-content: center; min-height: 52px; font-weight: 600; }
.opts.setores .opt span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.opts.setores .opt input:checked + span { background: var(--c); border-color: var(--c); color: #fff; }
.opts.setores .opt input:checked + span::before { background: #fff; }
.opts.lista { flex-direction: column; }
.opts.lista .opt span { width: 100%; }
.opts.pendencia .opt input:checked + span { background: var(--danger); border-color: var(--danger); color: #fff; }
.opt.nenhum input:checked + span { background: var(--ok); border-color: var(--ok); color: #fff; }

.sub {
  margin: -4px 0 16px; padding: 14px 14px 2px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.sub .field input, .sub .mini input { background: var(--surface); }
.sub.vazao { margin-top: 10px; padding-bottom: 14px; max-width: 280px; }
.mini { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.unit { display: flex; align-items: center; gap: 8px; }
.unit span { color: var(--muted); font-weight: 600; font-size: 14px; }
.hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: -6px 0 16px; }
.hint.late { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.iso-hint { background: #0b0f14; color: #f1f5f9; border-color: #000; }

.atb-row { display: grid; grid-template-columns: 1fr 210px 42px; gap: 10px; align-items: end; margin-bottom: 12px; }
@media (max-width: 560px) { .atb-row { grid-template-columns: 1fr 42px; } .atb-row .mini:nth-child(2) { grid-column: 1; grid-row: 2; } }
#atb-box { padding-bottom: 14px; }
#atb-box > .msg { margin: -4px 0 10px; }

.form-extra { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-top: 4px; }
.hist-item { font-size: 13px; padding: 6px 0; border-top: 1px solid var(--line); }
.hist-item:first-of-type { border-top: 0; }
.erro { color: var(--danger); font-weight: 600; font-size: 14px; margin: 6px 0; }

@media (max-width: 640px) {
  .sheet-body { padding: 12px 12px 20px; }
  .fsec { padding: 16px 14px; }
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%), var(--bg);
}
.login { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.login img { border-radius: 14px; margin-bottom: 14px; }
.login h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.login p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

/* ---------- Listas (saídas, usuários) ---------- */
.lista { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lista-item { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.lista-item:first-child { border-top: 0; }
.lista-item.inativo { opacity: .5; }
.lista-item .grow { flex: 1; min-width: 180px; }
.lista-item small { color: var(--muted); display: block; font-size: 12.5px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
#uform .btn.primary { margin-top: 8px; }

#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--surface); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 60;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.erro { background: var(--danger); color: #fff; }

/* ---------- Carência contratual ---------- */
.aviso-carencia {
  display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; padding: 16px 18px;
  border-radius: var(--radius); background: var(--carencia); color: #fff;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--carencia) 35%, transparent);
}
.aviso-icone { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: rgb(255 255 255 / .18); }
.aviso-icone svg { width: 22px; height: 22px; }
.aviso-texto { flex: 1; min-width: 0; }
.aviso-texto > b { font-size: 16px; display: block; margin: 2px 0 6px; }
.aviso-texto ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.aviso-texto li b { display: inline-block; min-width: 34px; padding: 0 6px; margin-right: 6px; border-radius: 6px; background: rgb(255 255 255 / .2); text-align: center; }
.aviso-acoes { display: flex; gap: 6px; align-items: center; }
.aviso-acoes .btn { background: #fff; color: var(--carencia); border-color: #fff; }
.aviso-acoes .icon-btn { background: rgb(255 255 255 / .15); color: #fff; }
@media (max-width: 560px) {
  .aviso-carencia { flex-wrap: wrap; }
  .aviso-acoes { width: 100%; }
  .aviso-acoes .btn { flex: 1; }
}

.card.carencia { border: 3px solid var(--carencia); padding-top: 0; box-shadow: 0 6px 22px color-mix(in srgb, var(--carencia) 22%, transparent); }
.faixa-carencia {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 -16px; padding: 8px 16px; background: var(--carencia); color: #fff;
  border-radius: 14px 14px 0 0; font-size: 12.5px;
}
.faixa-carencia b { letter-spacing: .06em; font-size: 12.5px; }
.faixa-carencia span { opacity: .9; font-weight: 600; }
.faixa-carencia span:not(:empty)::before { content: "· "; }

/* ---------- Telegraves ---------- */
.tele { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tele span { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--card-muted); }
.tele b { padding: 2px 10px; border-radius: 8px; background: var(--card-chip); }
.tele.uti b { background: var(--danger); color: #fff; }
.kpi.info b { color: var(--accent); }

.opts.prioridades .opt span { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; line-height: 1.35; }
.opts.prioridades .opt small { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.opts.prioridades .opt input:checked + span small { color: inherit; opacity: .9; }

/* ---------- Relatórios mensais ---------- */
.select {
  height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 600; font-size: 14px;
}
.kpi.static { cursor: default; }
.kpi.static:hover { border-color: var(--line); }
.rel-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); margin-bottom: 14px; }
@media (max-width: 420px) { .rel-grid { grid-template-columns: 1fr; } }
.rel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.rel-card h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.rel-card > .muted { margin: 2px 0 14px; }

.bars { display: flex; flex-direction: column; gap: 4px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 70px; gap: 10px; align-items: center; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; }
.bar-row:hover { background: var(--surface-2); }
.bar-label { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 12px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 0; }
.bar-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.bar-val small { color: var(--muted); }

.colunas { display: flex; align-items: flex-end; gap: 2px; height: 150px; padding-top: 8px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; cursor: default; }
.col-fill { width: 100%; max-width: 16px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.col:hover .col-fill { filter: brightness(1.15); }
.col small { height: 14px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.tabela-wrap { overflow-x: auto; margin: 12px -18px -18px; }
.tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.tabela th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabela td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.tabela td small { display: block; color: var(--muted); font-size: 12px; }
.tabela tbody tr:hover { background: var(--surface-2); }
.tabela tbody tr:last-child td { border-bottom: 0; }

/* ---------- Acesso / cadastro ---------- */
.login-hint { margin: 14px 0 0 !important; font-size: 13px !important; text-align: center; }
.login .btn.ghost { margin-top: 4px; color: var(--muted); }
.tag.pendente { background: var(--warn-soft); color: var(--warn); }
.cadastro-ok { border-color: var(--ok); }
.cadastro-ok h3 { color: var(--ok); }
.cadastro-ok p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.cadastro-ok pre {
  white-space: pre-wrap; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px;
}
.tabela .anon { color: var(--muted); font-style: italic; font-weight: 500; }
