/* Gestor de Escala · SAMU CISDESTE
   Mesma família visual dos módulos do 6ceoa (casca com barra lateral, blocos, abas no celular),
   com a paleta e a tipografia do SAMU. */
:root {
  --bg: #f5f6f8; --side: #ffffff; --card: #ffffff; --card2: #f7f8fa; --hover: #eff1f5; --line: #e3e6ec; --line2: #d3d8e1;
  --text: #0f1524; --soft: #3b4458; --muted: #69748a;
  --accent: #2454d6; --accent-bg: rgba(36, 84, 214, .09); --accent-2: #1d43ad;
  --brand: #d7263d;
  --ok: #0f8a5f; --ok-bg: rgba(15, 138, 95, .1);
  --warn: #a96300; --warn-bg: rgba(214, 140, 0, .13);
  --bad: #cf2338; --bad-bg: rgba(207, 35, 56, .09);
  --troca: #0b7285; --troca-bg: rgba(11, 114, 133, .11);
  --extra: #6d3fd6; --extra-bg: rgba(109, 63, 214, .1);
  --dia: #a35400; --dia-bg: #fff2d6; --noite: #3f3bb5; --noite-bg: #e6e8ff;
  --ferias: #8a6d00; --ferias-bg: #fff4bf;
  --shadow: 0 1px 2px rgba(15, 21, 36, .05), 0 6px 20px rgba(15, 21, 36, .05);
  --shadow-lg: 0 24px 64px rgba(15, 21, 36, .2);
  --r: 12px; --r-lg: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c1018; --side: #111723; --card: #141b28; --card2: #18202f; --hover: #1d2738; --line: #243046; --line2: #2f3c55;
  --text: #e7ebf3; --soft: #bcc5d6; --muted: #8692a8;
  --accent: #7593ff; --accent-bg: rgba(117, 147, 255, .14); --accent-2: #9db1ff;
  --ok: #3ccf91; --ok-bg: rgba(60, 207, 145, .13); --warn: #f2b138; --warn-bg: rgba(242, 177, 56, .14);
  --bad: #ff6b7d; --bad-bg: rgba(255, 107, 125, .13); --troca: #4cc7dc; --troca-bg: rgba(76, 199, 220, .13);
  --extra: #b49bff; --extra-bg: rgba(180, 155, 255, .14);
  --dia: #f4b860; --dia-bg: rgba(244, 184, 96, .14); --noite: #a9b0ff; --noite-bg: rgba(169, 176, 255, .14);
  --ferias: #f0d26a; --ferias-bg: rgba(240, 210, 106, .13);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1018; --side: #111723; --card: #141b28; --card2: #18202f; --hover: #1d2738; --line: #243046; --line2: #2f3c55;
    --text: #e7ebf3; --soft: #bcc5d6; --muted: #8692a8;
    --accent: #7593ff; --accent-bg: rgba(117, 147, 255, .14); --accent-2: #9db1ff;
    --ok: #3ccf91; --ok-bg: rgba(60, 207, 145, .13); --warn: #f2b138; --warn-bg: rgba(242, 177, 56, .14);
    --bad: #ff6b7d; --bad-bg: rgba(255, 107, 125, .13); --troca: #4cc7dc; --troca-bg: rgba(76, 199, 220, .13);
    --extra: #b49bff; --extra-bg: rgba(180, 155, 255, .14);
    --dia: #f4b860; --dia-bg: rgba(244, 184, 96, .14); --noite: #a9b0ff; --noite-bg: rgba(169, 176, 255, .14);
    --ferias: #f0d26a; --ferias-bg: rgba(240, 210, 106, .13);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ícones (SVG via máscara) ---------- */
.ico { display: inline-block; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(80% 60% at 100% 0%, var(--accent-bg), transparent 60%), radial-gradient(60% 50% at 0% 100%, rgba(215, 38, 61, .08), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; animation: fade .25s ease; }
.login-card p { margin: 0; }
.login-err { color: var(--bad); background: var(--bad-bg); border-radius: 10px; padding: 8px 12px; font-size: 13px; }

/* ---------- casca ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; text-decoration: none; }
.brand i { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #ef4058, #b5162b); display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(215, 38, 61, .3); position: relative; }
.brand i::after { content: ''; width: 16px; height: 16px; background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 2h6v7h7v6h-7v7H9v-7H2V9h7z'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 2h6v7h7v6h-7v7H9v-7H2V9h7z'/%3E%3C/svg%3E") center/contain no-repeat; }
.brand b { display: block; font-size: 15px; letter-spacing: -.01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand.big i { width: 44px; height: 44px; border-radius: 13px; }
.brand.big i::after { width: 20px; height: 20px; }
.brand.big b { font-size: 19px; }
.ng { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nl { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--soft); text-decoration: none; font-weight: 500; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; }
.nl .ico { opacity: .8; }
.nl:hover { background: var(--hover); color: var(--text); }
.nl.on { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.nl .cnt { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.nl .cnt.acc { background: var(--accent); }
.sfoot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 6px 0; border-top: 1px solid var(--line); }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line2); display: grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; }
.me .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .nm small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.me button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; padding: 4px; }
.mbar, .scrim, .tabbar { display: none; }
.main { padding: 26px 32px 64px; width: 100%; min-width: 0; animation: fade .2s ease; }

/* ---------- cabeçalhos ---------- */
.ph { display: flex; align-items: flex-end; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; font-weight: 700; }
.ph .lead { margin: 4px 0 0; color: var(--muted); }
.ph .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow { margin: 0 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.sec { margin-top: 26px; }
.sec-h { display: flex; align-items: center; gap: 6px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-h h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.sec-h .sub { color: var(--muted); font-size: 13px; }
.sec-h .act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; color: var(--text); transition: background .12s, transform .06s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.98); }
.btn.pri { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(36, 84, 214, .25); }
.btn.pri:hover { background: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: transparent; color: #fff; }
.btn.bad { background: var(--bad); border-color: transparent; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.btn .ico { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.busy { pointer-events: none; opacity: .7; }
.btn.busy::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.ib { width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--soft); cursor: pointer; display: inline-grid; place-items: center; flex: none; text-decoration: none; }
.ib:hover { background: var(--hover); }
.link { color: var(--accent); background: none; border: 0; font-weight: 600; cursor: pointer; padding: 0; text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span { font-size: 12px; font-weight: 600; color: var(--soft); }
.fld small { color: var(--muted); font-size: 12px; }
.inp, .fld input, .fld select, .fld textarea, select.inp { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); outline: none; width: 100%; min-width: 0; }
.fld textarea { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.inp.sm { height: 32px; font-size: 13px; border-radius: 8px; padding: 0 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--card); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check b { display: block; font-size: 13px; }
.check small { color: var(--muted); font-size: 12px; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-bg); }
.switch { position: relative; width: 38px; height: 22px; flex: none; appearance: none; -webkit-appearance: none; background: var(--line2); border-radius: 99px; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(16px); }
.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { height: 30px; padding: 0 12px; border-radius: 8px; border: 0; background: none; font-weight: 600; font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(15, 21, 36, .1); }
.seg button .n { margin-left: 5px; font-size: 11px; color: var(--muted); }
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.datenav { display: inline-flex; align-items: center; gap: 2px; background: var(--card); border: 1px solid var(--line2); border-radius: 10px; padding: 2px; }
.datenav button { height: 30px; min-width: 30px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--soft); padding: 0 8px; }
.datenav button:hover { background: var(--hover); }
.datenav .lbl { padding: 0 8px; font-weight: 700; font-size: 13px; white-space: nowrap; min-width: 120px; text-align: center; }
.datenav input[type=date], .datenav input[type=month] { border: 0; background: none; height: 30px; padding: 0 6px; font-weight: 700; outline: none; }

/* ---------- blocos ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; text-decoration: none; display: block; position: relative; overflow: hidden; }
a.tile:hover { border-color: var(--line2); }
.tile .k { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tile .k::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.tile.ok .k::before { background: var(--ok); } .tile.warn .k::before { background: var(--warn); } .tile.bad .k::before { background: var(--bad); } .tile.acc .k::before { background: var(--accent); }
.tile .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; white-space: nowrap; }
.tile .v small { font-size: 15px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile .meter { height: 5px; border-radius: 99px; background: var(--card2); margin-top: 10px; overflow: hidden; }
.tile .meter i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.tile.bad .v { color: var(--bad); } .tile.warn .v { color: var(--warn); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.panel > h3 { margin: 0 0 12px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel > h3 .act { margin-left: auto; }
.panel.flush { padding: 0; overflow: hidden; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.empty { text-align: center; color: var(--muted); padding: 26px 16px; border: 1px dashed var(--line2); border-radius: var(--r); }
.empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.empty.ok b { color: var(--ok); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); color: var(--soft); font-size: 13px; margin-bottom: 14px; }
.note.warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.note.bad { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
.note.acc { background: var(--accent-bg); border-color: transparent; color: var(--accent); }
.note.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.note b { font-weight: 700; }
.note .grow { flex: 1; min-width: 0; }
.note .ico { margin-top: 1px; }
.alerta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--bad-bg), transparent 85%), var(--card); border: 1px solid var(--line); border-left: 4px solid var(--bad); box-shadow: var(--shadow); margin-bottom: 16px; }
.alerta .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: pulse 1.6s ease infinite; flex: none; }
.alerta b { font-size: 15px; }
.alerta p { margin: 2px 0 0; color: var(--soft); font-size: 13px; }
.alerta.a36 { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-bg), transparent 85%), var(--card); }
.alerta.a36 .dot { background: var(--warn); }
.alerta .l36 { display: grid; gap: 8px; margin-top: 10px; }
.alerta .i36 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.alerta .i36 b { font-size: 14px; }
.alerta .i36 small { display: block; color: var(--soft); font-size: 12.5px; line-height: 1.5; }

/* ---------- pills, chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--card2); border: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.pill.acc { color: var(--accent); background: var(--accent-bg); border-color: transparent; }
.pill.troca { color: var(--troca); background: var(--troca-bg); border-color: transparent; }
.pill.extra { color: var(--extra); background: var(--extra-bg); border-color: transparent; }
.pill.ferias { color: var(--ferias); background: var(--ferias-bg); border-color: transparent; }
.pill.dash { background: none; border-style: dashed; }
.t { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; font-size: 11px; font-weight: 700; flex: none; font-family: 'IBM Plex Mono', monospace; }
.t.D { background: var(--dia-bg); color: var(--dia); }
.t.N { background: var(--noite-bg); color: var(--noite); }
.code { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok); }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease infinite; }

/* ---------- listas ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; }
.li .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .grow small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li.click { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; margin: 0 -8px; }
.li.click:hover { background: var(--hover); }
.datebox { width: 44px; text-align: center; flex: none; line-height: 1.1; }
.datebox b { display: block; font-size: 17px; letter-spacing: -.02em; }
.datebox small { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.more { margin-top: 8px; }

/* ---------- tabelas ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--card2); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--hover); }
.tbl tr.grp td { background: var(--card2); font-weight: 700; font-size: 12px; color: var(--soft); padding: 7px 12px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input[type=checkbox]:not(.switch) { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- cartões das bases (plantões do dia) ---------- */
.bases { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.bc.bad { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); box-shadow: 0 0 0 3px var(--bad-bg), var(--shadow); }
.bc.wide { grid-column: span 2; }
.bc-h { display: flex; align-items: center; gap: 8px; }
.bc-h b { font-size: 14px; }
.bc-h .sig { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--muted); font-weight: 600; }
.bc-h .act { margin-left: auto; display: flex; gap: 4px; }
.slot { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--card2); border: 1px solid transparent; cursor: pointer; min-width: 0; text-align: left; width: 100%; }
.slot:hover { border-color: var(--line2); }
.slot .nm { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .nm small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.slot.agora { box-shadow: inset 3px 0 0 var(--accent); }
.slot.s-troca { background: var(--troca-bg); }
.slot.s-extra { background: var(--extra-bg); }
.slot.s-aberto { background: var(--warn-bg); }
.slot.s-aberto .nm { color: var(--warn); }
.slot.s-descoberto { background: var(--bad-bg); }
.slot.s-descoberto .nm { color: var(--bad); }
.slots-jf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.slots-jf .col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.slots-jf .col h4 { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.slots-jf .slot { padding: 4px 8px; }
.flag { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.flag.warn { background: var(--warn); } .flag.bad { background: var(--bad); } .flag.troca { background: var(--troca); } .flag.extra { background: var(--extra); }

/* ---------- calendário mensal ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; padding: 4px 0; }
.cal .day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day.out { background: transparent; border-style: dashed; opacity: .45; }
.cal .day.hoje { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
.cal .day .dn { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; }
.cal .day .dn .fer { font-size: 10px; font-weight: 600; color: var(--bad); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .day.feriado .dn > span:first-child { color: var(--bad); }
.cal .cell { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: 7px; background: var(--card2); font-size: 12px; cursor: pointer; border: 1px solid transparent; min-width: 0; width: 100%; text-align: left; }
.cal .cell:hover { border-color: var(--line2); }
.cal .cell .t { width: 18px; height: 18px; font-size: 10px; border-radius: 5px; }
.cal .cell span.n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal .cell.s-troca { background: var(--troca-bg); color: var(--troca); }
.cal .cell.s-extra { background: var(--extra-bg); color: var(--extra); }
.cal .cell.s-aberto { background: var(--warn-bg); color: var(--warn); }
.cal .cell.s-descoberto { background: var(--bad-bg); color: var(--bad); }
.cal .cell.prev { box-shadow: inset 0 0 0 1px var(--ferias); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; background: var(--card2); border: 1px solid var(--line2); }
.legend i.troca { background: var(--troca-bg); border-color: var(--troca); } .legend i.extra { background: var(--extra-bg); border-color: var(--extra); }
.legend i.aberto { background: var(--warn-bg); border-color: var(--warn); } .legend i.descoberto { background: var(--bad-bg); border-color: var(--bad); }
.legend i.prev { background: none; border-color: var(--ferias); }

/* ---------- matriz semanal ---------- */
.mx { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 980px; }
.mx th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 8px; background: var(--card2); border-bottom: 1px solid var(--line); text-align: left; position: sticky; top: 0; z-index: 1; }
.mx th.on { color: var(--accent); }
.mx td { border-bottom: 1px solid var(--line); padding: 6px; vertical-align: top; }
.mx td.bn { font-weight: 700; white-space: nowrap; padding-left: 12px; width: 150px; }
.mx td.bn small { display: block; color: var(--muted); font-weight: 500; font-size: 11.5px; }
.mx .c2 { display: flex; flex-direction: column; gap: 3px; }
.mx .cell { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 7px; background: var(--card2); font-size: 12px; cursor: pointer; border: 1px solid transparent; width: 100%; text-align: left; min-width: 0; }
.mx .cell:hover { border-color: var(--line2); }
.mx .cell .t { width: 18px; height: 18px; font-size: 10px; border-radius: 5px; }
.mx .cell .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mx .cell .alt { font-size: 10px; font-weight: 700; color: var(--accent); }
.mx .cell.s-troca { background: var(--troca-bg); color: var(--troca); } .mx .cell.s-extra { background: var(--extra-bg); color: var(--extra); }
.mx .cell.s-aberto { background: var(--warn-bg); color: var(--warn); } .mx .cell.s-descoberto { background: var(--bad-bg); color: var(--bad); }
.mx .cell.vazio { background: none; border: 1px dashed var(--line2); color: var(--muted); }
.mx tr.jf .c2 { max-height: none; }

/* ---------- planilha de férias ---------- */
.fx { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1100px; font-size: 12.5px; table-layout: fixed; }
.fx th:first-child { width: 230px; }
.fx th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 9px 6px; background: var(--card2); border-bottom: 1px solid var(--line); text-align: center; position: sticky; top: 0; z-index: 1; }
.fx th:first-child { text-align: left; padding-left: 12px; }
.fx th.cur { color: var(--accent); }
.fx td { border-bottom: 1px solid var(--line); padding: 4px; text-align: center; height: 34px; }
.fx td:first-child { text-align: left; padding-left: 12px; white-space: nowrap; font-weight: 600; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.fx tr.grp td { background: var(--card2); font-weight: 700; font-size: 12px; text-align: left; color: var(--soft); }
.fx tr.grp td .pill { margin-left: 4px; }
.fx td.m { cursor: pointer; }
.fx td.m:hover { background: var(--hover); }
.fx td.m.cur { background: color-mix(in srgb, var(--accent-bg) 50%, transparent); }
.fbar { display: block; border-radius: 6px; padding: 3px 4px; font-size: 11px; font-weight: 700; background: var(--ferias-bg); color: var(--ferias); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbar.prev { background: none; box-shadow: inset 0 0 0 1.5px var(--ferias); }
.fbar.lic { background: var(--bad-bg); color: var(--bad); }
.fbar.ped { background: none; border: 1px dashed var(--accent); color: var(--accent); padding: 2px 4px; }
.fcount { font-size: 11px; color: var(--muted); }
.fcount.warn { color: var(--warn); font-weight: 700; }

/* ---------- folha (drawer/modal) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 1000; display: flex; justify-content: flex-end; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(8, 12, 20, .42); animation: fade .15s ease; }
.sheet { position: relative; width: min(560px, 100%); height: 100%; background: var(--card); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .2s ease; }
.sheet-wrap.center { align-items: center; justify-content: center; padding: 16px; }
.sheet-wrap.center .sheet { height: auto; max-height: calc(100vh - 32px); border-radius: 18px; width: min(640px, 100%); animation: fade .18s ease; }
.sheet-wrap.center.wide .sheet { width: min(860px, 100%); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sh-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.sh-h h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.sh-h p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.sh-h .ib { margin: -6px -8px 0 auto; }
.sh-b { padding: 18px 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 14px; }
.sh-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--card); }
.sh-f .left { margin-right: auto; display: flex; gap: 8px; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card2); }
.box h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.msg { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: #e8fbe9; color: #111b21; border-radius: 10px 10px 10px 2px; padding: 10px 12px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); font-family: system-ui, sans-serif; max-width: 460px; }
:root[data-theme="dark"] .msg { background: #144d37; color: #e9edef; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg { background: #144d37; color: #e9edef; } }
.msgs { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--card2); }
.msgs .to { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- seletor de profissional ---------- */
.pick { position: relative; }
.pick-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 4px; }
.pick-list button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick-list button:hover, .pick-list button.on { background: var(--hover); }
.pick-list button small { color: var(--muted); margin-left: auto; font-size: 11.5px; white-space: nowrap; }
.pick-sel { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent-bg); font-weight: 600; }
.pick-sel span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- impacto ---------- */
.imp { display: flex; flex-direction: column; gap: 6px; }
.imp .it { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.imp .it .grow small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- avatar/perfil ---------- */
.hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero .avatar { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), #6c4ee0); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 1100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow-lg); animation: fade .18s ease; max-width: min(420px, calc(100vw - 32px)); }
.toast.bad { background: var(--bad); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

.skel { height: 80px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--card2), var(--hover), var(--card2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fatal { text-align: center; padding: 70px 16px; }
.fatal b { display: block; font-size: 18px; margin-bottom: 6px; }
.fatal code { background: var(--card2); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; }

/* ---------- responsivo ---------- */
@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.c3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 900; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; z-index: 899; background: rgba(8, 12, 20, .4); }
  .mbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); padding: calc(8px + env(safe-area-inset-top)) 10px 8px; border-bottom: 1px solid var(--line); }
  .mbar b { flex: 1; text-align: center; font-size: 15px; }
  .main { padding: 18px 16px 120px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 800; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--side) 94%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border: 0; background: none; position: relative; cursor: pointer; }
  .tabbar .on { color: var(--accent); }
  .tabbar .ico { width: 22px; height: 22px; }
  .tabbar .dot { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10px; display: grid; place-items: center; }
  .cols, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .bc.wide { grid-column: auto; }
  .toasts { left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: stretch; }
  .sheet-wrap { justify-content: center; align-items: flex-end; }
  .sheet, .sheet-wrap.center .sheet { width: 100%; height: auto; max-height: 92vh; border-radius: 18px 18px 0 0; animation: up .22s ease; }
  .sheet-wrap.center { padding: 0; align-items: flex-end; }
  .sh-f { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .ph h1 { font-size: 21px; }
  .ph .act { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 14px; }
  .tile .v { font-size: 24px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 96px minmax(0, 1fr); }
  .cal { gap: 3px; }
  .cal .wd { font-size: 10px; }
  .cal .day { min-height: 70px; padding: 3px; border-radius: 8px; }
  .cal .day .dn { font-size: 11px; }
  .cal .day .dn .fer { display: none; }
  .cal .cell { padding: 2px 3px; font-size: 10px; gap: 2px; }
  .cal .cell .t { width: 13px; height: 13px; font-size: 8px; border-radius: 3px; }
  .slots-jf { grid-template-columns: minmax(0, 1fr); }
  .datenav .lbl { min-width: 0; }
  .bar { gap: 6px; }
}

/* ---------- impressão (formato das planilhas) ---------- */
.print-area { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; color: #000; }
  .app, .login, .sheet-wrap, .toasts { display: none !important; }
  .print-area { display: block; font-family: Arial, sans-serif; font-size: 11px; color: #000; }
  .print-area h1 { font-size: 16px; margin: 0 0 2px; }
  .print-area h2 { font-size: 13px; margin: 14px 0 6px; }
  .print-area p { margin: 2px 0; }
  .print-area table { width: 100%; border-collapse: collapse; margin-top: 6px; page-break-inside: avoid; }
  .print-area th, .print-area td { border: 1px solid #555; padding: 4px 5px; text-align: center; vertical-align: middle; }
  .print-area th { background: #dfe6f3; }
  .print-area td.l { text-align: left; }
  .print-area .ttl { background: #b8c8e8; font-weight: 700; font-size: 13px; }
  .print-area .fer { background: #fff3b0; }
  .print-area .pb { page-break-before: always; }
  .print-area .rod { margin-top: 10px; font-size: 9px; color: #555; }
}
.cobbar { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; flex-wrap: wrap; }
.cobbar #pkC { min-width: 220px; }
.imp .it input[type=checkbox] { width: 16px; height: 16px; flex: none; }

/* ---- Extras: lista por dia com cor de urgência ---- */
.xleg { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 14px; font-size: 12.5px; color: var(--soft); }
.xl { display: inline-flex; align-items: center; gap: 6px; }
.xl i { width: 10px; height: 10px; border-radius: 3px; background: var(--line2); }
.xl b { color: var(--text); }
.xl.u0 i { background: var(--bad); } .xl.u1 i { background: #e8701a; } .xl.u3 i { background: var(--warn); } .xl.u7 i { background: var(--accent); } .xl.pego i { background: var(--ok); }
.xlist { display: grid; gap: 14px; }
.xday { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px 12px; box-shadow: var(--shadow); }
.xday.hoje { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.xday.passado { opacity: .6; }
.xday header { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; }
.xday header b { font-size: 14px; }
.xc { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); border-left: 5px solid var(--accent); background: var(--card); cursor: pointer; margin-top: 6px; transition: background .15s; }
.xc:hover { background: var(--hover); }
.xc .grow b { font-size: 14.5px; }
.xc .grow b small, .xc .xb small { font-weight: 500; color: var(--muted); font-size: 12px; }
.xc .grow > small { display: block; color: var(--soft); font-size: 12.5px; margin-top: 1px; }
.xc .xs { font-size: 12px; font-weight: 700; white-space: nowrap; }
.xc.u0 { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-bg), transparent 70%), var(--card); } .xc.u0 .xs { color: var(--bad); }
.xc.u1 { border-left-color: #e8701a; background: linear-gradient(90deg, rgba(232, 112, 26, .12), transparent 70%), var(--card); } .xc.u1 .xs { color: #e8701a; }
.xc.u3 { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-bg), transparent 70%), var(--card); } .xc.u3 .xs { color: var(--warn); }
.xc.u7 .xs { color: var(--accent); }
.xc.pego, .xc.canc, .xc.passado { padding: 6px 12px; border-left-color: var(--ok); background: var(--card2); font-size: 13px; }
.xc.pego .xb, .xc.canc .xb { font-weight: 600; }
.xc .xh { color: var(--muted); font-size: 12px; font-family: 'IBM Plex Mono', monospace; }
.xc.pego .xq { color: var(--ok); font-weight: 700; }
.xc.canc { border-left-color: var(--line2); opacity: .55; } .xc.canc .xb { text-decoration: line-through; } .xc.canc .xq { color: var(--muted); }
.xc.passado { border-left-color: var(--line2); }
.xc input[type=checkbox] { flex: none; }
@media (max-width: 640px) {
  .xc { flex-wrap: wrap; gap: 6px 10px; }
  .xc .xs { order: 5; width: 100%; padding-left: 32px; }
  .xc .code { margin-left: auto; }
  .xc.pego .xh { display: none; }
}

/* Cobertura hoje: chips dos plantões sem médico */
.tile .chips-desc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cdesc { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 99px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: filter .15s, transform .15s; }
.cdesc:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cdesc.sem { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.cdesc.anun { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

/* Selo "férias": médico cobrindo férias de alguém */
.selo-fer { display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 4px; font-size: 9.5px; font-weight: 700; line-height: 15px; vertical-align: 1px; text-transform: uppercase; letter-spacing: .03em; background: var(--ferias-bg); color: var(--ferias); border: 1px solid color-mix(in srgb, var(--ferias) 30%, transparent); white-space: nowrap; }

/* ================= Início: painel do plantão ================= */
.pn-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 14px 22px; margin-bottom: 18px; }
.pn-hl h1 { margin: 2px 0 8px; font-size: 26px; letter-spacing: -.02em; font-weight: 700; }
.pn-turno { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pn-tb { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; }
.pn-tb.D { background: var(--dia-bg); color: var(--dia); } .pn-tb.N { background: var(--noite-bg); color: var(--noite); }
.pn-prog { height: 4px; border-radius: 99px; background: var(--line); margin-top: 10px; max-width: 420px; overflow: hidden; }
.pn-prog i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.pn-kpis { display: flex; gap: 10px; }
.pn-k { display: flex; flex-direction: column; gap: 2px; min-width: 112px; padding: 10px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.pn-k:hover { transform: translateY(-1px); border-color: var(--line2); }
.pn-k small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pn-k b { font-size: 22px; font-family: 'IBM Plex Mono', monospace; letter-spacing: -.03em; line-height: 1.1; }
.pn-k b span { font-size: 14px; color: var(--muted); }
.pn-k.ok b { color: var(--ok); } .pn-k.bad b { color: var(--bad); } .pn-k.warn b { color: var(--warn); } .pn-k.acc b { color: var(--accent); }
.pn-act { display: flex; gap: 8px; flex-wrap: wrap; }

.pn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.pn-main, .pn-side { display: grid; gap: 16px; min-width: 0; }
.pn-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.pn-ch { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pn-ch h2 { margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.pn-ch .seg { margin-left: auto; }
.pn-cs { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }
.pn-cs.ok { background: var(--ok-bg); color: var(--ok); } .pn-cs.bad { background: var(--bad-bg); color: var(--bad); }
.pn-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; }
.pn-meter { height: 3px; border-radius: 99px; background: var(--bad-bg); margin: -4px 0 12px; overflow: hidden; }
.pn-meter i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.seg.sm button { padding: 3px 8px; font-size: 12px; }
.seg button .n { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 2px; }

/* barra do vSky */
.pn-vb { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--r); background: var(--card2); border: 1px solid var(--line); font-size: 12.5px; }
.pn-vb.old { border-style: dashed; }
.pn-vb .grow { flex: 1; }
.pn-vt { display: inline-flex; align-items: center; gap: 6px; color: var(--soft); }
.pn-vs { display: inline-flex; align-items: center; gap: 5px; color: var(--soft); font-weight: 600; }
.pn-vs i { width: 8px; height: 8px; border-radius: 50%; }
.pn-vs i.ok { background: var(--ok); } .pn-vs i.no { background: transparent; border: 2px solid var(--muted); width: 9px; height: 9px; } .pn-vs i.warn { background: var(--warn); }
.pn-vs.bad { color: var(--bad); }

/* quadro das bases */
.pn-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pn-bc { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.pn-bc.wide { grid-column: 1 / -1; }
.pn-bc.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.pn-bc.aereo { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pn-bc header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--card2); border-bottom: 1px solid var(--line); }
.pn-bc header b { font-size: 13.5px; }
.pn-bc header .sig { font-size: 11px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-cnt { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.pn-cnt.ok { background: var(--ok-bg); color: var(--ok); } .pn-cnt.bad { background: var(--bad-bg); color: var(--bad); }
.pn-sls { display: grid; }
.pn-bc.wide .pn-sls { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pn-sl { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.pn-sls > .pn-sl:first-child { border-top: 0; }
.pn-bc.wide .pn-sls > .pn-sl { border-top: 1px solid var(--line); }
.pn-sl:hover { background: var(--hover); }
.pn-sl.static { cursor: default; } .pn-sl.static:hover { background: none; }
.pn-nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-nm b { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-nm small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-sl.vazio { background: linear-gradient(90deg, var(--bad-bg), transparent 80%); }
.pn-sl.vazio b { color: var(--bad); }
.pn-tag { flex: none; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; }
.pn-tag.ex { background: var(--extra-bg); color: var(--extra); } .pn-tag.tr { background: var(--troca-bg); color: var(--troca); }
.pn-pr { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.pn-pr i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pn-pr.ok { color: var(--ok); } .pn-pr.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.pn-pr.no i { border: 2px solid var(--muted); }
.pn-pr.warn { color: var(--warn); } .pn-pr.warn i { background: var(--warn); }
.pn-pr.off i { background: var(--line2); }

/* próximos 7 dias */
.pn-g { display: grid; grid-template-columns: minmax(70px, auto) repeat(var(--n), minmax(0, 1fr)); gap: 4px; align-items: center; }
.pn-gh { text-align: center; }
.pn-gh.d { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--soft); padding: 2px 0 4px; border-radius: 8px; }
.pn-gh.d b { font-family: 'IBM Plex Mono', monospace; font-size: 14px; }
.pn-gh.d small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.pn-gh.d.hoje { background: var(--accent-bg); color: var(--accent); }
.pn-gb { font-size: 12px; font-weight: 600; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
.pn-gc { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; height: 22px; text-decoration: none; }
.pn-gc i { border-radius: 4px; transition: transform .1s; }
.pn-gc:hover i { transform: scaleY(1.15); }
.pn-gc i.c, .pn-leg i.c { background: color-mix(in srgb, var(--ok) 28%, transparent); }
.pn-gc i.a, .pn-leg i.a { background: var(--warn); }
.pn-gc i.x, .pn-leg i.x { background: var(--bad); }
.pn-gc i.nd { background: var(--card2); }
.pn-leg { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--soft); }
.pn-leg span { display: inline-flex; align-items: center; gap: 6px; }
.pn-leg i { width: 14px; height: 10px; border-radius: 3px; }

/* fila "Precisa de você" */
.pn-fila { display: grid; gap: 8px; }
.pn-q { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); text-decoration: none; color: inherit; }
.pn-q.click, a.pn-q { cursor: pointer; } .pn-q.click:hover, a.pn-q:hover { background: var(--hover); }
.pn-q.crit { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: linear-gradient(90deg, var(--bad-bg), transparent 85%), var(--card); }
.pn-q.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: linear-gradient(90deg, var(--warn-bg), transparent 85%), var(--card); }
.pn-q b { font-size: 13.5px; display: block; }
.pn-q small { display: block; color: var(--soft); font-size: 12px; margin-top: 2px; line-height: 1.45; }
.pn-qi { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--card2); color: var(--muted); }
.pn-q.crit .pn-qi { background: var(--bad); color: #fff; } .pn-q.warn .pn-qi { background: var(--warn); color: #fff; } .pn-qi.acc { background: var(--accent-bg); color: var(--accent); }
.pn-qa { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pn-go { flex: none; color: var(--muted); align-self: center; }
.pn-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pn-chip { height: 24px; padding: 0 9px; border-radius: 99px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; }
.pn-chip.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.pn-tudo { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 8px; text-align: center; color: var(--ok); }
.pn-tudo b { font-size: 14px; } .pn-tudo small { color: var(--muted); }
.pn-tudo .ico { width: 26px; height: 26px; }

/* listas laterais */
.pn-al { display: grid; }
.pn-ai { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--line); min-width: 0; }
.pn-ai:first-child { border-top: 0; }
.pn-ai.click { cursor: pointer; } .pn-ai.click:hover { background: var(--hover); border-radius: 8px; }
.pn-ai .grow { min-width: 0; }
.pn-ai b { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-ai small { font-size: 11.5px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-af { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pn-dt { flex: none; display: flex; flex-direction: column; align-items: center; width: 34px; padding: 2px 0; border-radius: 8px; background: var(--card2); }
.pn-dt b { font-family: 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1.2; } .pn-dt small { font-size: 9.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.pn-dt.u0 { background: var(--bad-bg); color: var(--bad); } .pn-dt.u1 { background: var(--warn-bg); color: var(--warn); }
.pn-vazio { padding: 14px 4px; color: var(--muted); font-size: 13px; }

/* folha da comparação */
.pn-cg { margin-bottom: 16px; }
.pn-cg h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 13.5px; }
.pn-cg h4 i { width: 9px; height: 9px; border-radius: 50%; }
.pn-cg h4 i.ok { background: var(--ok); } .pn-cg h4 i.no { background: var(--bad); } .pn-cg h4 i.warn { background: var(--warn); } .pn-cg h4 i.off { background: var(--line2); }
.pn-cg > p { margin: 0 0 6px; }
.pn-cl { display: flex; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 5px; }
.pn-cl b { font-size: 13px; } .pn-cl small { display: block; font-size: 12px; color: var(--soft); }

@media (max-width: 1200px) {
  .pn-grid { grid-template-columns: minmax(0, 1fr); }
  .pn-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
@media (max-width: 640px) {
  .pn-hl h1 { font-size: 22px; }
  .pn-kpis { overflow-x: auto; }
  .pn-k { min-width: 100px; }
  .pn-ch .seg { margin-left: 0; width: 100%; }
  .pn-board { grid-template-columns: minmax(0, 1fr); }
  .pn-bc.wide .pn-sls { grid-template-columns: minmax(0, 1fr); }
  .pn-card { padding: 14px; }
  .pn-g { grid-template-columns: 56px repeat(var(--n), minmax(0, 1fr)); gap: 3px; }
  .pn-gb { font-size: 11px; }
}

.pn-nm small.pn-nl { color: var(--warn); font-weight: 600; }
@media (max-width: 1200px) {
  .pn-grid { display: flex; flex-direction: column; }
  .pn-side { display: contents; }
  .pn-fila-card { order: -1; }
  .pn-main { order: 0; width: 100%; }
  .pn-side > .pn-card:not(.pn-fila-card) { order: 1; }
}

/* Janela vSky Regulação × escala */
.vc-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.vc-s { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.vc-s:hover { background: var(--hover); }
.vc-s b { font-family: 'IBM Plex Mono', monospace; font-size: 22px; line-height: 1.1; letter-spacing: -.03em; }
.vc-s b span { font-size: 13px; color: var(--muted); }
.vc-s small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.vc-s.ok b { color: var(--ok); } .vc-s.bad b { color: var(--bad); } .vc-s.warn b { color: var(--warn); } .vc-s.off b { color: var(--soft); }
.vc-s.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.vc-tabs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vc-g { margin-bottom: 18px; }
.vc-g h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 14px; }
.vc-g h4 i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.vc-g h4 i.ok, .vc-hi i.ok { background: var(--ok); } .vc-g h4 i.bad, .vc-hi i.bad { background: var(--bad); } .vc-g h4 i.warn, .vc-hi i.warn { background: var(--warn); } .vc-g h4 i.off { background: var(--line2); }
.vc-g > p { margin: 0 0 8px; font-size: 12.5px; color: var(--muted); }
.vc-l { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.vc-r { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.vc-r:first-child { border-top: 0; }
.vc-r.bad { border-left-color: var(--bad); } .vc-r.warn { border-left-color: var(--warn); } .vc-r.ok { border-left-color: var(--ok); } .vc-r.off { border-left-color: var(--line2); }
.vc-p { min-width: 0; } .vc-p b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .vc-p small { font-size: 11.5px; color: var(--muted); }
.vc-c { min-width: 0; font-size: 12.5px; } .vc-c small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.vc-c span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--soft); }
.vc-a { display: flex; gap: 2px; }
.vc-h { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.vc-h h4 { margin: 0 0 8px; font-size: 13px; }
.vc-hl { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.vc-hi { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); font-size: 12px; max-width: 220px; }
.vc-hi b { width: 100%; font-size: 12px; } .vc-hi span { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--soft); }
.vc-hi i { width: 7px; height: 7px; border-radius: 50%; } .vc-hi small { width: 100%; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .vc-stats { display: flex; flex: none; overflow-x: auto; padding-bottom: 2px; }
  .vc-s { flex: 0 0 auto; min-width: 96px; padding: 8px 10px; }
  .vc-s b { font-size: 19px; }
  .vc-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px 10px; }
  .vc-p { grid-column: 1 / 3; }
  .vc-a { grid-row: 1; grid-column: 3; }
  .vc-c span { white-space: normal; }
}

/* Base com dois médicos no turno (Manhuaçu): em tela grande, duas colunas lado a lado */
@media (min-width: 900px) {
  .pn-bc.dupla { grid-column: span 2; }
  .pn-bc.dupla .pn-sls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pn-bc.dupla .pn-sls > .pn-sl { border-top: 1px solid var(--line); }
  .pn-bc.dupla .pn-sls > .pn-sl:nth-child(-n+2) { border-top: 0; }
  .pn-bc.dupla .pn-sls > .pn-sl:nth-child(even) { border-left: 1px solid var(--line); }
}

/* Médico logado no vSky no lugar do escalado */
.pn-sl.subst { background: linear-gradient(90deg, var(--warn-bg), transparent 80%); box-shadow: inset 3px 0 0 var(--warn); }
.pn-sl.subst .pn-nm small { color: var(--warn); font-weight: 600; }
.pn-tag.vs { background: var(--warn-bg); color: var(--warn); }
.pn-sl.alerta-v { box-shadow: inset 3px 0 0 var(--warn); }
.pn-nm small.pn-nl { white-space: normal; line-height: 1.35; margin-top: 2px; }
.xg7 { margin-bottom: 14px; }

/* Resumo do plantão com divergência no vSky (clique no plantão do Início) */
.pn-nm small.pn-nl.tr { color: var(--troca); }
.sh-b.rs { display: grid; gap: 10px; }
.rs-c { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--line2); border-radius: var(--r); background: var(--card2); }
.rs-c.warn { border-left-color: var(--warn); } .rs-c.tr { border-left-color: var(--troca); }
.rs-c > small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.rs-n { font-size: 16px; }
.rs-st { font-size: 13px; font-weight: 600; } .rs-st.bad { color: var(--bad); } .rs-st.warn { color: var(--warn); } .rs-st.ok { color: var(--ok); } .rs-st.off { color: var(--muted); }
.rs-ct { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 13px; }
.rs-c .btn { justify-self: start; margin-top: 4px; }

/* Sobreaviso da coordenação */
.sa-lista { display: grid; gap: 12px; }
.sa-bh { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sa-bh .btn { margin-left: auto; }
.sa-ds { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.sa-d { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.sa-d:hover:not(:disabled) { border-color: var(--accent); }
.sa-d:disabled { cursor: default; }
.sa-d small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.sa-d b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-d.on { background: var(--accent-bg); border-color: transparent; }
.sa-d.vz b { color: var(--warn); font-weight: 600; }
.sa-d.hoje { box-shadow: inset 0 0 0 2px var(--accent); }
.sa-d.pass { opacity: .6; }
.sa-d.pass.vz b { color: var(--muted); }
.sa-cs { display: flex; flex-wrap: wrap; gap: 8px; }
.sa-cs .btn { display: inline-flex; flex-direction: column; align-items: flex-start; height: auto; padding: 8px 12px; gap: 0; }
.sa-cs .btn small { font-size: 11px; font-weight: 500; }
.sa-cl { display: grid; grid-template-columns: 1fr 150px auto; gap: 6px; align-items: center; }
@media (max-width: 520px) { .sa-cl { grid-template-columns: 1fr 120px auto; } }
