/* Hemerológio – sistema visual. Cores e tipos vêm do manual da marca (pasta /brand). */
@font-face { font-family: "Figtree"; src: url("/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light;
  --campo: #0A4F4B; --aurora: #FFB224; --on-aurora: #2B1D00;
  --bg: #F1F6F5; --surface: #FFFFFF; --surface-2: #E7EFED; --ink: #0B1F1E; --ink-2: #48605D; --line: #D3DFDC;
  --btn: #0A4F4B; --on-btn: #FFFFFF; --link: #0B655F; --focus: #0B655F;
  --wait: #7A5200; --wait-soft: #FFF2D6; --wait-line: #F0B13C;
  --ok: #136C43; --ok-soft: #DDF2E6; --bad: #B3261E; --bad-soft: #FBE5E2; --mute-soft: #E6ECEB;
  --shadow: 0 1px 2px rgba(10, 79, 75, .06), 0 6px 20px rgba(10, 79, 75, .07);
  --radius: 14px; --nav-h: 64px;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #071615; --surface: #0E2422; --surface-2: #153330; --ink: #E8F1EF; --ink-2: #9DB5B1;
    --line: #274743; --btn: #5AD4C5; --on-btn: #04211F; --link: #7CE0D3; --focus: #7CE0D3;
    --wait: #FFCB66; --wait-soft: #3A2A05; --wait-line: #B98312;
    --ok: #74D9A5; --ok-soft: #0F3324; --bad: #FF9A90; --bad-soft: #40160F; --mute-soft: #1A3532;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
h1, h2, .display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 1.75rem; line-height: 1.15; margin: .2em 0 .5em; }
h2 { font-size: 1.3rem; margin: 1.4em 0 .5em; }
h3 { font-size: 1.05rem; margin: 0 0 .25em; font-weight: 700; }
p { margin: .5em 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--aurora); color: var(--on-aurora); padding: 10px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.ic { width: 1.35em; height: 1.35em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -.25em; }

/* ---------- cabeçalho e navegação ---------- */
#top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; background: var(--campo); color: #fff;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); }
#top .brand { display: flex; margin-right: auto; }
#top .brand img { height: 30px; width: auto; display: block; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { color: #fff; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; position: relative; }
.icon-btn:hover, .icon-btn.on { background: rgba(255, 255, 255, .14); }
.icon-btn .ic { width: 26px; height: 26px; }
#badge { position: absolute; top: 3px; right: 1px; background: var(--aurora); color: var(--on-aurora); font-size: .72rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }
#nav { display: flex; }
#nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: .78rem; font-weight: 600; position: relative; }
#nav a .n { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--aurora); color: var(--on-aurora); font-size: .7rem; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
@media (max-width: 899px) {
  #nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  #nav a { flex: 1; justify-content: center; color: var(--ink-2); }
  #nav a.on { color: var(--link); }
  #nav a.on::before { content: ""; position: absolute; top: 0; width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--aurora); }
  #nav:empty, body.no-nav #nav { display: none; }
  body:not(.no-nav) main { padding-bottom: calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
}
@media (min-width: 900px) {
  #nav { gap: 4px; margin-right: 12px; }
  #nav a { flex-direction: row; gap: 8px; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: .95rem; opacity: .85; }
  #nav a.on, #nav a:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
  #nav a .n { position: static; }
}
/* chave Cirurgião | Hospital e aviso de novidade no outro modo */
#top { flex-wrap: wrap; }
#modes, #modealert { flex-basis: 100%; order: 9; }
.modeseg { display: flex; gap: 4px; max-width: 440px; margin: 0 auto; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .13); }
.modeseg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 0; border-radius: 999px; background: transparent; color: #fff; font: 700 .98rem var(--font); cursor: pointer; }
.modeseg button[aria-pressed="true"] { background: #fff; color: #0A4F4B; }
.modeseg .n { background: var(--aurora); color: var(--on-aurora); border-radius: 999px; padding: 0 7px; font-size: .78rem; font-weight: 800; }
#modealert { order: 10; display: flex; align-items: center; gap: 10px; background: var(--aurora); color: var(--on-aurora); border-radius: 12px; padding: 8px 6px 8px 14px; font-size: .95rem; }
#modealert[hidden] { display: none !important; }
#modealert .grow { flex: 1; }
#modealert .btn { background: #0A4F4B; color: #fff; }
#modealert .icon-btn { color: var(--on-aurora); width: 40px; height: 40px; }
.linkbox { font: .9rem ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 10px; padding: 12px; word-break: break-all; user-select: all; }
#offline { background: var(--wait-soft); color: var(--wait); text-align: center; padding: 8px 16px; font-weight: 600; font-size: .95rem; }

main { max-width: 760px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); outline: none; }
main.wide { max-width: 1280px; }
.center { text-align: center; }
.muted { color: var(--ink-2); }
.small { font-size: .88rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > * { margin: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 4px; }

/* ---------- superfícies ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card.next { background: var(--campo); color: #fff; border-color: transparent; box-shadow: var(--shadow); }
.card.next .muted, .card.next .eyebrow { color: rgba(255, 255, 255, .78); }
.card.next .when { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.15; }
.info { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 20px; border-radius: 12px; border: 2px solid var(--btn);
  background: var(--btn); color: var(--on-btn); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; filter: none; }
.btn.ghost { background: transparent; color: var(--link); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.aurora { background: var(--aurora); border-color: var(--aurora); color: var(--on-aurora); }
.btn.sm { min-height: 44px; padding: 6px 14px; font-size: .95rem; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 64px; font-size: 1.15rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }

/* ---------- formulários ---------- */
.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 700; margin: 0 0 6px; }
.req { color: var(--bad); }
.hint { font-size: .88rem; color: var(--ink-2); margin: 4px 0 0; }
input, select, textarea { width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); min-height: 52px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea { min-height: 92px; resize: vertical; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 4px 0; cursor: pointer; }
.check input { width: 26px; height: 26px; min-height: 0; flex-shrink: 0; accent-color: var(--btn); padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.upper { text-transform: uppercase; }

/* ---------- situação ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: .84rem; font-weight: 700; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-pending { background: var(--wait-soft); color: var(--wait); }
.st-confirmed, .st-approved { background: var(--ok-soft); color: var(--ok); }
.st-rejected, .st-revoked { background: var(--bad-soft); color: var(--bad); }
.st-cancelled { background: var(--mute-soft); color: var(--ink-2); }
.tag { display: inline-block; font-style: normal; font-size: .78rem; font-weight: 800; letter-spacing: .04em; background: var(--bad-soft); color: var(--bad); border-radius: 6px; padding: 1px 7px; margin-right: 4px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ---------- início ---------- */
.tiles { display: grid; gap: 12px; }
@media (min-width: 620px) { .tiles { grid-template-columns: 1fr 1fr; } .tiles .span { grid-column: 1 / -1; } }
.tile { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font: inherit; font-weight: 700; text-align: left; width: 100%; cursor: pointer; }
.tile:hover { border-color: var(--link); }
.tile .ico { width: 50px; height: 50px; display: grid; place-items: center; background: var(--surface-2); color: var(--link); border-radius: 12px; flex-shrink: 0; }
.tile .ico .ic { width: 26px; height: 26px; }
.tile .sub { display: block; font-weight: 400; font-size: .9rem; color: var(--ink-2); }
.tile .count { margin-left: auto; background: var(--aurora); color: var(--on-aurora); border-radius: 999px; padding: 2px 11px; font-size: .9rem; font-weight: 800; }
.tile.cta { background: var(--aurora); border-color: var(--aurora); color: var(--on-aurora); font-size: 1.2rem; padding: 20px 16px; box-shadow: var(--shadow); }
.tile.cta .ico { background: rgba(43, 29, 0, .12); color: var(--on-aurora); }
.tile.cta .sub { color: var(--on-aurora); opacity: .8; }

/* ---------- agendamento ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--aurora); }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; margin: 0 -16px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.day { flex: 0 0 74px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.day .dow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.day .num { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.05; }
.day .free { font-size: .72rem; font-weight: 700; color: var(--ok); }
.day.off { opacity: .55; }
.day.off .free { color: var(--ink-2); }
.day.sel { background: var(--campo); border-color: var(--campo); color: #fff; }
.day.sel .dow, .day.sel .free { color: rgba(255, 255, 255, .85); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 12px; }
.seg button { font: inherit; font-weight: 600; font-size: .92rem; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.period { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 12px 0 6px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { min-height: 50px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.slot:hover { border-color: var(--link); }
.slot.sel { background: var(--aurora); border-color: var(--aurora); color: var(--on-aurora); }
.selbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
  padding: 12px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.selbar .in { max-width: 728px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.has-selbar { padding-bottom: 120px; }
.success { text-align: center; padding: 28px 6px; }
.success .seal { width: 96px; height: 96px; margin: 0 auto 8px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }
.success .seal .ic { width: 52px; height: 52px; stroke-width: 2.5; }

/* ---------- painel do hospital ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 16px; padding: 2px 16px; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .95rem; }
.tabs a.on { background: var(--campo); color: #fff; border-color: var(--campo); }
.tabs .n { background: var(--aurora); color: var(--on-aurora); border-radius: 999px; padding: 0 8px; font-size: .8rem; }
.datebar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.datebar input { flex: 1; min-width: 172px; max-width: 220px; }
.datebar .btn { min-width: 52px; padding: 0 14px; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 14px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-family: var(--display); font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.stats span { font-size: .84rem; color: var(--ink-2); }

.tl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tl { display: grid; min-width: min-content; }
.tl-head { position: sticky; top: 0; padding: 10px 12px; font-weight: 700; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tl-head small { color: var(--ink-2); font-weight: 400; }
.tl-gutter { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.tl-hours { position: relative; }
.tl-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-size: .8rem; color: var(--ink-2); }
.tl-body { position: relative; border-left: 1px solid var(--line); cursor: copy;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% var(--hour, 90px); background-position: 0 var(--off, 0); }
.blk { position: absolute; left: 4px; right: 4px; overflow: hidden; text-align: left; font: inherit; font-size: .86rem; line-height: 1.25; color: var(--ink); cursor: pointer;
  border: 0; border-left: 5px solid var(--ok); border-radius: 8px; background: var(--ok-soft); padding: 4px 8px; }
.blk:hover { filter: brightness(.97); z-index: 1; box-shadow: var(--shadow); }
.blk { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; }
.blk b { display: block; }
.blk .tag { font-style: normal; display: inline-block; }
.blk span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.pending { border-left-color: var(--wait-line); background: var(--wait-soft); outline: 2px dashed var(--wait-line); outline-offset: -2px; }
.blk.internal { border-left-color: var(--ink-2); background: var(--mute-soft); }
.turn { position: absolute; left: 4px; right: 4px; border-radius: 0 0 6px 6px; pointer-events: none; opacity: .6;
  background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 7px); }
.now { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 1; pointer-events: none; }
.now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); margin: 10px 2px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.legend .l-ok { background: var(--ok-soft); border-left: 4px solid var(--ok); }
.legend .l-wait { background: var(--wait-soft); outline: 1px dashed var(--wait-line); }
.legend .l-int { background: var(--mute-soft); border-left: 4px solid var(--ink-2); }
.legend .l-turn { background: repeating-linear-gradient(135deg, var(--line) 0 2px, transparent 2px 6px); }
.hours-row { display: grid; grid-template-columns: minmax(120px, 1fr) 1fr 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.listrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.listrow:last-child { border-bottom: 0; }
.listrow.unread { background: var(--wait-soft); }
.print-only { display: none; }

/* ---------- diálogo e avisos ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog.wide { width: min(680px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(4, 26, 25, .55); }
.dlg-in { padding: 22px 20px 20px; }
.dlg-in h2 { margin: 0 44px 8px 0; }
.dlg-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.dlg-x:hover { background: var(--surface-2); }
.secret { font: 700 1.5rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; background: var(--surface-2); border-radius: 10px; padding: 14px; text-align: center; user-select: all; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; visibility: hidden; background: var(--ink); color: var(--bg);
  padding: 13px 20px; border-radius: 12px; max-width: calc(100% - 32px); transition: transform .2s, opacity .2s; z-index: 60; font-weight: 600; box-shadow: var(--shadow); }
#toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
#toast.bad { background: var(--bad); color: #fff; }
@media (prefers-color-scheme: dark) { #toast.bad { color: #2A0906; } }

/* ---------- entrada ---------- */
body.auth { background: var(--campo); }
body.auth main { max-width: 980px; padding-top: max(28px, env(safe-area-inset-top)); display: grid; gap: 24px; }
.hero { color: #fff; padding: 12px 4px 0; }
.hero img { height: 44px; width: auto; }
.hero .slogan { font-family: var(--display); font-weight: 600; font-size: clamp(2.3rem, 9vw, 4rem); line-height: 1.02; letter-spacing: -.02em; margin: 28px 0 12px; text-wrap: balance; }
.hero .slogan em { font-style: normal; color: var(--aurora); }
.hero p { color: rgba(255, 255, 255, .82); max-width: 34ch; font-size: 1.1rem; }
.auth-card { background: var(--surface); border-radius: 20px; padding: 22px 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.auth-card h1 { font-size: 1.4rem; }
@media (min-width: 860px) { body.auth main { grid-template-columns: 1.1fr 1fr; align-items: center; min-height: 100dvh; padding-block: 40px; } .hero .slogan { margin-top: 56px; } }
.prose { max-width: 65ch; }
.prose h2 { font-size: 1.15rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- impressão do mapa ---------- */
@media print {
  #top, #nav, .tabs, .datebar, .legend, .tl-wrap, .no-print, #toast, #offline { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  main, main.wide { max-width: none; padding: 0; }
  .print-only { display: block; }
  .print-only table { width: 100%; border-collapse: collapse; }
  .print-only th, .print-only td { border: 1px solid #999; padding: 4px 6px; text-align: left; vertical-align: top; font-size: 10pt; }
  .print-only caption { font: 600 14pt var(--display); text-align: left; padding-bottom: 6px; }
}

/* ajustes finos */
a.card { display: block; text-decoration: none; color: inherit; }
a.card.next { color: #fff; }
#swh { max-width: 360px; margin-bottom: 12px; }
.dlg-in .err { margin-right: 40px; }

/* documentos */
.ico-sm { width: 40px; height: 40px; display: grid; place-items: center; background: var(--surface-2); color: var(--link); border-radius: 10px; flex-shrink: 0; }
.docimg { display: block; max-width: 100%; max-height: 70dvh; margin: 0 auto; border-radius: 8px; }
details.docs { margin: 10px 0 4px; }
details.docs summary { cursor: pointer; font-weight: 600; color: var(--link); min-height: 32px; }
details.docs .card { margin-top: 8px; }
input[type=file] { padding: 10px; }
.danger-link { color: var(--bad); }
#pushask { align-items: center; }
.prose .tablewrap { overflow-x: auto; margin: 10px 0 16px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; min-width: 480px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.prose h3 { margin-top: 1.2em; }

/* semana */
.wk { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.wk-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-day.today { border-color: var(--link); box-shadow: 0 0 0 2px color-mix(in srgb, var(--link) 25%, transparent); }
.wk-head { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.wk-head span { font-size: .8rem; color: var(--ink-2); }
.wk-item { display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: var(--ink); font-size: .84rem; line-height: 1.25; padding: 6px 8px; border-radius: 8px; background: var(--ok-soft); border-left: 4px solid var(--ok); }
.wk-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-item.pending { background: var(--wait-soft); border-left-color: var(--wait-line, var(--wait)); }
.wk-item .chip { align-self: flex-start; font-size: .72rem; padding: 1px 8px; }
/* relatórios */
#per { align-items: center; }
#per input[type=date] { max-width: 170px; }
.stats.rep { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 16px; }
.stats.rep div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.grid-rep { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 34%) 1fr 48px; gap: 10px; align-items: center; margin: 8px 0; font-size: .92rem; }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row b { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--link); border-radius: 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th { font-size: .8rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }

/* duas etapas */
.qr { display: block; width: 220px; max-width: 70%; margin: 8px auto; image-rendering: pixelated; border-radius: 8px; background: #fff; padding: 6px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.codes code, .secret-inline { font: 600 1rem ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 8px; padding: 8px; text-align: center; user-select: all; }
.secret-inline { padding: 2px 6px; font-size: .9rem; word-break: break-all; }
.steps-list { padding-left: 20px; } .steps-list li { margin: 6px 0; }
/* blocos */
.tl-block { position: absolute; left: 2px; right: 2px; border-radius: 6px; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--link) 10%, transparent) 0 8px, transparent 8px 16px); border: 1px dashed color-mix(in srgb, var(--link) 45%, transparent); pointer-events: none; }
.tl-block span { position: absolute; right: 6px; bottom: 4px; font-size: .72rem; font-weight: 700; color: var(--link); opacity: .85; }
.tl-block.released { opacity: .45; }
.slot.myblock { border-color: var(--link); }
/* produção */
.stats.rep .warn b { color: var(--wait); } .stats.rep .bad b { color: var(--bad); }
.pad { padding: 14px 16px; }
h2.first { margin-top: .4em; }
.block { display: block; }
.neg { color: var(--bad); font-weight: 700; }
button.listrow { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.listrow:last-child { border-bottom: 0; }
button.listrow:hover { background: var(--surface-2); }
.todo { flex-wrap: nowrap; }
.todo .count { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--aurora); color: var(--on-aurora); font-weight: 800; padding: 0 8px; }
.todo .grow { font-weight: 600; }
.todo .sub { display: block; font-weight: 400; font-size: .88rem; color: var(--ink-2); }
.todo .cta { color: var(--link); font-weight: 700; white-space: nowrap; }
.bar-row.money { grid-template-columns: 74px 1fr minmax(96px, auto); }
.bar-row.bad .bar i { background: var(--bad); } .bar-row.bad b { color: var(--bad); }
.tablewrap { overflow-x: auto; }
/* lançamento: códigos, memória de cálculo */
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chipbtn { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font: inherit; font-size: .9rem; font-weight: 600; padding: 6px 12px 6px 8px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; }
.chipbtn:hover { border-color: var(--link); }
.chipbtn .ic { width: 1em; height: 1em; color: var(--link); }
.item { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.item input, .item select { min-height: 40px; padding: 6px 10px; }
.item input { margin: 4px 0; }
.tagq { font-size: .8rem; font-weight: 800; background: var(--aurora); color: var(--on-aurora); border-radius: 6px; padding: 0 6px; }
.row.tight { gap: 6px 14px; }
.mini { display: flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--ink-2); }
.mini select { width: auto; }
.icon-x { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-x:hover { background: var(--mute-soft); color: var(--bad); }
.found { display: block; width: 100%; text-align: left; font: inherit; font-size: .95rem; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; }
.found:hover { border-color: var(--link); }
.calc:not(:empty) { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 4px 0 14px; background: var(--surface-2); }
.calc-line { display: grid; grid-template-columns: 1fr auto minmax(92px, auto); gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.calc-line small { display: block; color: var(--ink-2); font-size: .8rem; }
.calc-line span:nth-child(2) { color: var(--ink-2); }
.calc-line b, .calc-total b { text-align: right; }
.calc-total { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; font-weight: 700; font-size: 1.05rem; }
.calc-total b { font-family: var(--display); font-size: 1.25rem; }
.calc-note { font-size: .86rem; color: var(--ink-2); margin: 6px 0 0; }
.calc-note.warn { color: var(--wait); font-weight: 600; }
.hint.up { margin: -8px 0 14px; }
details.more { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--link); min-height: 48px; display: flex; align-items: center; }
details.more[open] summary { margin-bottom: 6px; }
/* conferência */
.conf { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.conf:last-child { border-bottom: 0; }
.conf-sel { display: grid; place-items: center; padding: 0 4px 0 14px; cursor: pointer; }
.conf-sel input { width: 24px; height: 24px; min-height: 0; padding: 0; accent-color: var(--btn); }
.conf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px 12px 10px; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.conf-main:hover { background: var(--surface-2); }
.conf-vals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0; }
.conf-vals div { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.conf-vals span { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.conf-vals b { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .95rem; }
.conf-vals small { font-weight: 500; font-size: .72rem; color: var(--ink-2); }
.conf-vals .neg { background: var(--bad-soft); } .conf-vals .neg b, .conf-vals .neg span { color: var(--bad); }
.conf-actions { margin: 4px 0 8px; }
.tbl.pay td .sub { display: block; font-size: .8rem; color: var(--ink-2); }
.tbl.pay tr.on td { background: var(--surface-2); }
.tbl.pay td:first-child { min-width: 150px; }
.tbl.pay .linkbtn { text-align: left; font-weight: 600; }
.seg.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -4px 10px; padding: 2px 4px; scrollbar-width: none; }
.seg.scroll button { flex-shrink: 0; white-space: nowrap; }
.per .row { flex-wrap: nowrap; }
.per input[type=date] { flex: 1; min-width: 0; padding-inline: 8px; font-size: .92rem; }
label.listrow { flex-wrap: nowrap; cursor: pointer; align-items: flex-start; }
label.listrow input[type=checkbox] { width: 24px; height: 24px; min-height: 0; padding: 0; margin-top: 2px; flex-shrink: 0; accent-color: var(--btn); }
.item input.short { width: 110px; margin: 0; }
.field.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.field.inline label { margin: 0; font-weight: 600; }
.field.inline input.short { width: 84px; min-height: 44px; padding: 8px 12px; }
.field.inline .hint { flex-basis: 100%; margin: 0; }
.grid2.keep { grid-template-columns: 1fr 1fr; }
.linkbtn.small { font-size: .86rem; }
.codechip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: .9rem; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ink); }
.codechip button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer; }
.codechip button .ic { width: 1em; height: 1em; }
#proccodes .hint { margin-top: 6px; }
/* manual técnico */
.doc-int { max-width: 860px; margin: 0 auto; padding: 28px 20px 60px; }
.doc-int pre { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: .85rem; }
.doc-int code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; }
