/* Gestão de Férias v2 — estilo iOS, a partir de prototype/styles.css.
   Tokens: docs/DESIGN-IOS.md. Todas as cores vêm das variáveis abaixo. */
:root {
  --tint: #6e275d;
  --on-tint: #ffffff;
  --tint-soft: #f4ebf2;
  --tint-ring-track: #efe6ee;
  --bg: #f2f2f7;
  --surface: #ffffff;
  --fill: #e3e3e8;
  --field: #efeff4;
  --label: #1c1c1e;
  --secondary: #6e6e73;
  --placeholder: #8a8a8e;
  --separator: #c6c6c8;
  --chevron: #b0b0b5;
  --grabber: #c7c7cc;
  --destructive: #c4161c;
  --pending-mark: #c76a00;
  --pill-pending-bg: #fff1df;  --pill-pending-fg: #9a4d00;
  --pill-approved-bg: #e3f5e8; --pill-approved-fg: #1b6b34;
  --pill-rejected-bg: #fde8e8; --pill-rejected-fg: #b3261e;
  --pill-cancelled-bg: #ececf0; --pill-cancelled-fg: #55555a;
  /* Uma cor por pessoa no calendário (classe pc0–pc9 = id % 10). Só para marcas (pontos, barras, fundos), nunca texto. */
  --pessoa-0: #6e275d; --pessoa-1: #1f6fb2; --pessoa-2: #2e8b57; --pessoa-3: #c76a00; --pessoa-4: #b3261e;
  --pessoa-5: #6a4fc2; --pessoa-6: #00838f; --pessoa-7: #8d6e00; --pessoa-8: #c2185b; --pessoa-9: #546e7a;
  --frame-bg: #d9d6dc;
  --frame-shadow: 0 30px 80px rgba(40, 10, 35, .25);
  --scrim: rgba(0, 0, 0, .32);
  --tabbar-bg: rgba(249, 249, 249, .92);
  --tabbar-line: rgba(60, 60, 67, .29);
  --material: rgba(242, 242, 247, .97);
  --material-line: #b5b5ba;
  --toast-bg: rgba(28, 28, 30, .94);
  --shadow-sheet: 0 -8px 30px rgba(0, 0, 0, .18);
  --shadow-seg: 0 3px 8px rgba(0, 0, 0, .12), 0 1px 1px rgba(0, 0, 0, .04);
  --shadow-toast: 0 8px 24px rgba(0, 0, 0, .2);
  --radius-group: 12px; --radius-card: 16px; --radius-button: 14px; --radius-sheet: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--frame-bg); font-family: var(--font); color: var(--label); -webkit-font-smoothing: antialiased; display: flex; align-items: center; justify-content: center; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:active:not(:disabled) { opacity: .6; }
button:disabled { opacity: .5; cursor: progress; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }
::placeholder { color: var(--placeholder); }
h1, h2, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Moldura: 390×844 no computador, ecrã inteiro no telemóvel */
.phone { position: relative; width: 390px; height: min(844px, 100dvh); overflow: hidden; background: var(--bg); border-radius: 44px; box-shadow: var(--frame-shadow); }
@media (max-width: 500px), (max-height: 700px) { body { display: block; } .phone { width: 100%; height: 100dvh; border-radius: 0; box-shadow: none; } }
.content { position: absolute; inset: 0 0 calc(83px + var(--safe-bottom)) 0; overflow-y: auto; }
.screen { padding: calc(24px + var(--safe-top)) 16px 28px; display: flex; flex-direction: column; gap: 18px; }
.loading { min-height: 100%; display: flex; align-items: center; justify-content: center; color: var(--secondary); }

/* Tipografia iOS */
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.eyebrow { font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--secondary); }
.section-header { padding: 0 16px; font-size: 13px; line-height: 18px; font-weight: 400; text-transform: uppercase; color: var(--secondary); }
.section-header--spaced { margin-top: 16px; }
.footnote { padding: 0 16px; font-size: 13px; line-height: 18px; color: var(--secondary); }
.footnote.is-error { color: var(--destructive); }
.secondary { color: var(--secondary); }
.subhead { font-size: 17px; color: var(--secondary); }

/* Logótipo no topo do Resumo: sem caixa nem fundo, à esquerda; avatar à direita na mesma linha. */
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: -6px; }
.brand-logo { display: block; height: 40px; width: auto; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head__text { display: flex; flex-direction: column; gap: 2px; }
.avatar-btn { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 9999px; background: var(--tint); color: var(--on-tint); font-size: 15px; font-weight: 600; }
.round-btn { width: 44px; height: 44px; border: 0; border-radius: 9999px; background: var(--tint); color: var(--on-tint); display: flex; align-items: center; justify-content: center; }

/* Botões */
.btn { min-height: 50px; border: 0; border-radius: var(--radius-button); background: var(--tint); color: var(--on-tint); font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn--plain { background: var(--surface); color: var(--destructive); }
.btn--destructive-text { background: var(--surface); color: var(--destructive); font-weight: 400; border-radius: var(--radius-group); }
.btn--spaced { margin-top: 16px; }
.nav-btn { min-height: 44px; padding: 0 8px; border: 0; background: transparent; font-size: 17px; color: var(--tint); }
.nav-btn--bold { font-weight: 600; }

/* Saldo */
.balance { background: var(--surface); border-radius: var(--radius-card); padding: 20px; display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 124px; height: 124px; flex-shrink: 0; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--tint-ring-track); }
.ring__approved { stroke: var(--tint); }
.ring__pending { stroke: var(--pending-mark); }
.ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring__num { font-size: 36px; line-height: 40px; font-weight: 700; letter-spacing: -.5px; }
.ring__num.is-error { color: var(--destructive); }
.ring__word { font-size: 12px; line-height: 16px; color: var(--secondary); }
.balance__rows { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.balance__row { display: flex; justify-content: space-between; font-size: 15px; line-height: 20px; }
.balance__row span:first-child { display: flex; align-items: center; gap: 6px; color: var(--secondary); }
.balance__row span:last-child { font-weight: 600; }
.balance__row--sub { margin-top: -6px; font-size: 13px; line-height: 18px; }
.balance__row--sub span:first-child { padding-left: 14px; }
.balance__row--sub span:last-child { font-weight: 400; color: var(--secondary); }
.dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--tint); display: inline-block; }
.dot--pending { background: var(--pending-mark); }

/* Listas agrupadas */
.group { background: var(--surface); border-radius: var(--radius-group); overflow: hidden; }
.section { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 14px 8px 16px; border: 0; background: var(--surface); text-align: left; color: var(--label); }
.row + .row { border-top: .5px solid var(--separator); }
.row--compact { min-height: 56px; }
.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 17px; line-height: 22px; }
.row__sub { font-size: 15px; line-height: 20px; color: var(--secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { flex-shrink: 0; color: var(--chevron); }
.date-badge { width: 44px; height: 48px; flex-shrink: 0; border-radius: 10px; background: var(--tint-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.date-badge__mon { font-size: 11px; line-height: 13px; font-weight: 700; text-transform: uppercase; color: var(--tint); }
.date-badge__day { font-size: 20px; line-height: 24px; font-weight: 700; }
.initials { width: 40px; height: 40px; flex-shrink: 0; border-radius: 9999px; background: var(--tint-soft); color: var(--tint); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.initials--lg { width: 72px; height: 72px; font-size: 26px; }
.bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--tint); }
.bar--pending { background: var(--pending-mark); }
.alert-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border: 0; border-radius: var(--radius-group); background: var(--surface); text-align: left; }
.alert-row__icon { width: 32px; height: 32px; border-radius: 8px; background: var(--pending-mark); color: var(--on-tint); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alert-row__title { flex: 1; font-size: 17px; line-height: 22px; }
.badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 9999px; background: var(--tint); color: var(--on-tint); font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.empty { padding: 36px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--chevron); }
.empty__title { font-size: 17px; font-weight: 600; color: var(--label); }
.empty__text, .empty-line { font-size: 15px; color: var(--secondary); }
.empty-line { padding: 14px 16px; }
.info-row { min-height: 44px; padding: 11px 16px; display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }
.info-row + .info-row { margin-left: 16px; padding-left: 0; border-top: .5px solid var(--separator); }
.info-row span:last-child { color: var(--secondary); text-align: right; }

/* Etiquetas de estado */
.pill { flex-shrink: 0; padding: 3px 9px; border-radius: 9999px; font-size: 13px; line-height: 18px; font-weight: 600; }
.pill--Pendente  { background: var(--pill-pending-bg);  color: var(--pill-pending-fg); }
.pill--Aprovado  { background: var(--pill-approved-bg); color: var(--pill-approved-fg); }
.pill--Rejeitado { background: var(--pill-rejected-bg); color: var(--pill-rejected-fg); }
.pill--Cancelado { background: var(--pill-cancelled-bg); color: var(--pill-cancelled-fg); }

/* Segmented control e pesquisa */
.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 2px; border-radius: 9px; background: var(--fill); flex: 1; }
.segmented button { min-height: 32px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 600; }
.segmented button[aria-selected="true"] { background: var(--surface); box-shadow: var(--shadow-seg); }
.search { min-height: 36px; padding: 0 8px; border-radius: 10px; background: var(--fill); display: flex; align-items: center; gap: 6px; color: var(--secondary); }
.search input { flex: 1; min-width: 0; min-height: 36px; border: 0; background: transparent; font-size: 17px; color: var(--label); outline-offset: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; }
.pill-select { min-height: 36px; padding: 0 10px; border: 0; border-radius: 9999px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--tint); }

/* Calendário */
.cal { background: var(--surface); border-radius: var(--radius-card); padding: 14px 10px 10px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; }
.cal__title { font-size: 20px; line-height: 25px; font-weight: 600; }
.cal__nav { display: flex; gap: 4px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 9999px; background: transparent; color: var(--tint); display: flex; align-items: center; justify-content: center; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal__wd { padding-bottom: 6px; text-align: center; font-size: 13px; font-weight: 600; color: var(--secondary); }
.cal__day { height: 50px; padding: 3px 0 0; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cal__num { width: 34px; height: 34px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.cal__day.is-weekend .cal__num { color: var(--secondary); }
.cal__day.is-holiday .cal__num { color: var(--secondary); text-decoration: underline dotted; text-underline-offset: 3px; }
.cal__day.is-today .cal__num { color: var(--tint); font-weight: 700; }
.cal__day.is-selected .cal__num { background: var(--label); color: var(--on-tint); font-weight: 600; text-decoration: none; }
.cal__day.is-selected.is-today .cal__num { background: var(--tint); }
.cal__dots { display: flex; gap: 3px; height: 6px; }
.cal__dots i { width: 6px; height: 6px; border-radius: 9999px; background: var(--c, var(--tint)); }
.cal__dots i.is-pending, .legend .dot.is-pending { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--c, var(--tint)); }
.cal__more { font-size: 10px; line-height: 6px; color: var(--secondary); }
/* Pessoa escolhida: os dias de férias ficam pintados com a cor dela. */
.cal__day.is-off .cal__num { background: color-mix(in srgb, var(--c) 22%, var(--surface)); font-weight: 600; }
.cal__day.is-off.is-pending .cal__num { background: var(--surface); box-shadow: inset 0 0 0 2px var(--c); }
.cal__day.is-off.is-selected .cal__num { background: var(--c); color: var(--on-tint); box-shadow: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0 16px; font-size: 13px; color: var(--secondary); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend .dot, .bar.has-c { background: var(--c); }
.bar.has-c.is-pending { background: repeating-linear-gradient(var(--c) 0 5px, transparent 5px 9px); }
.cal-filter { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-filter .pill-select { flex: 1; min-width: 0; max-width: 100%; }
.pc0 { --c: var(--pessoa-0); } .pc1 { --c: var(--pessoa-1); } .pc2 { --c: var(--pessoa-2); } .pc3 { --c: var(--pessoa-3); } .pc4 { --c: var(--pessoa-4); }
.pc5 { --c: var(--pessoa-5); } .pc6 { --c: var(--pessoa-6); } .pc7 { --c: var(--pessoa-7); } .pc8 { --c: var(--pessoa-8); } .pc9 { --c: var(--pessoa-9); }

/* Barra de separadores */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(83px + var(--safe-bottom)); padding: 7px 8px var(--safe-bottom); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--tabbar-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: .5px solid var(--tabbar-line); z-index: 5; }
.tabbar:empty { display: none; }
.tab { height: 48px; padding: 0; border: 0; background: transparent; font-size: 10px; line-height: 12px; font-weight: 600; color: var(--secondary); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tab[aria-current="page"] { color: var(--tint); }
.tab__icon { position: relative; display: flex; }
.tab__badge { position: absolute; top: -3px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9999px; background: var(--destructive); color: var(--on-tint); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* Folhas, alertas, toast */
.scrim { position: absolute; inset: 0; z-index: 20; border: 0; background: var(--scrim); animation: fade .2s ease; }
.scrim--top { z-index: 30; }
.sheet { position: absolute; left: 0; right: 0; top: calc(48px + var(--safe-top)); bottom: 0; z-index: 21; background: var(--bg); border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: var(--shadow-sheet); display: flex; flex-direction: column; overflow: hidden; animation: up .32s cubic-bezier(.2, .8, .2, 1); }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--grabber); align-self: center; margin-top: 6px; flex-shrink: 0; }
.sheet__nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 8px 10px; flex-shrink: 0; }
.sheet__nav > :first-child { justify-self: start; }
.sheet__nav > :last-child { justify-self: end; }
.sheet__title { font-size: 17px; font-weight: 600; }
.sheet__body { flex: 1; overflow-y: auto; padding: 8px 16px calc(28px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; }
.sheet__body > * { flex-shrink: 0; } /* listas longas fazem scroll, em vez de encolherem */
.sheet__body--gap { gap: 20px; }
.field-row { min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; }
.field-row + .field-row { margin-left: 16px; padding-left: 0; border-top: .5px solid var(--separator); }
.field-input { width: 100%; min-height: 48px; padding: 0 16px; border: 0; background: transparent; font-size: 17px; color: var(--label); }
.group > .field-input + .field-input { border-top: .5px solid var(--separator); }
.field-row .field-input--right { flex: 1; min-width: 0; padding: 0; text-align: right; color: var(--secondary); }
select.field-input--right { appearance: none; -webkit-appearance: none; text-align-last: right; cursor: pointer; color: var(--tint); }
.switch { width: 51px; height: 31px; accent-color: var(--tint); cursor: pointer; }
.sheet > form { display: contents; } /* formulários que envolvem a barra e o corpo da folha */
.signed-out--form { justify-content: flex-start; padding-top: calc(48px + var(--safe-top)); }
.signed-out--form .nav-btn { align-self: center; margin-top: 8px; }
.date-input { min-height: 36px; border: 0; border-radius: 8px; background: var(--field); padding: 6px 10px; font-size: 17px; color: var(--tint); accent-color: var(--tint); }
.summary { background: var(--surface); border-radius: var(--radius-group); padding: 16px; display: flex; justify-content: space-around; text-align: center; margin-top: 12px; }
.summary__num { display: block; font-size: 28px; line-height: 34px; font-weight: 700; }
.summary__num.is-error { color: var(--destructive); }
.summary__label { font-size: 13px; color: var(--secondary); }
.summary__sep { width: .5px; background: var(--separator); }
.comment { min-height: 96px; resize: none; border: 0; border-radius: var(--radius-group); background: var(--surface); padding: 12px 16px; font-size: 17px; line-height: 22px; }
.detail-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 4px; }
.detail-hero h2 { font-size: 28px; line-height: 34px; font-weight: 700; }
.detail-hero--center { align-items: center; text-align: center; gap: 8px; }
.detail-hero--center h2 { font-size: 22px; line-height: 28px; margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.alert-wrap { position: absolute; inset: 0; z-index: 30; background: var(--scrim); display: flex; align-items: center; justify-content: center; animation: fade .15s ease; }
.alert { width: 270px; border-radius: 14px; background: var(--material); overflow: hidden; text-align: center; animation: pop .2s ease; }
.alert__text { padding: 19px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.alert__title { font-size: 17px; line-height: 22px; font-weight: 600; }
.alert__msg { font-size: 13px; line-height: 18px; }
.alert__field { margin-top: 10px; min-height: 72px; resize: none; border: .5px solid var(--material-line); border-radius: 8px; background: var(--surface); padding: 8px 10px; font-size: 15px; line-height: 20px; text-align: left; }
.alert__msg--error { color: var(--destructive); }
.alert__actions--normal button + button { color: var(--tint); }
.temp-code { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface); font: 600 20px/26px ui-monospace, "SF Mono", Consolas, monospace; letter-spacing: 1px; user-select: all; }
.alert__actions { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid var(--material-line); }
.alert__actions button { min-height: 44px; border: 0; background: transparent; font-size: 17px; color: var(--tint); }
.alert__actions button + button { border-left: .5px solid var(--material-line); font-weight: 600; color: var(--destructive); }

.action-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(30px + var(--safe-bottom)); z-index: 31; display: flex; flex-direction: column; gap: 8px; animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.action-sheet__group { border-radius: 14px; background: var(--material); overflow: hidden; text-align: center; }
.action-sheet__group p { padding: 14px 16px; font-size: 13px; line-height: 18px; color: var(--secondary); }
.action-sheet button { width: 100%; height: 57px; border: 0; background: transparent; font-size: 20px; color: var(--destructive); }
.action-sheet__group button { border-top: .5px solid var(--separator); }
.action-sheet__group button.is-default { color: var(--tint); }
.action-sheet > button { border-radius: 14px; background: var(--surface); font-weight: 600; color: var(--tint); }

.toast { position: absolute; top: calc(16px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 40; padding: 10px 16px; border-radius: 9999px; background: var(--toast-bg); color: var(--on-tint); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; box-shadow: var(--shadow-toast); animation: drop .25s ease; }
.toast--error { background: var(--destructive); white-space: normal; width: max-content; max-width: calc(100% - 32px); }

/* Entrar / sessão terminada */
.signed-out { position: absolute; inset: 0; z-index: 50; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px; text-align: center; overflow-y: auto; }
.signed-out__logo { display: block; width: 240px; max-width: 80%; height: auto; }
.signed-out h1 { margin-top: 12px; font-size: 28px; line-height: 34px; }
.signed-out .btn { margin-top: 20px; }
.login { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 12px; text-align: left; }
.login .group { background: var(--bg); }
.login input { width: 100%; min-height: 48px; padding: 0 16px; border: 0; background: transparent; font-size: 17px; }
.login input + input, .login .field-sep { border-top: .5px solid var(--separator); }
.login .footnote { padding: 0 4px; }
.signed-out__link { margin-top: 8px; padding: 12px; font-size: 15px; color: var(--tint); }

/* Aviso de privacidade (privacidade.html) */
.doc { position: absolute; inset: 0; overflow-y: auto; padding: calc(12px + var(--safe-top)) 16px calc(32px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }
.doc > * { flex-shrink: 0; }
.doc__nav { margin: 0 -8px; }
.doc__nav .nav-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; text-decoration: none; }
.doc__lead { font-size: 17px; line-height: 24px; color: var(--secondary); margin-bottom: 8px; }
.doc .section-header { margin-top: 12px; }
.doc__card { padding: 4px 16px; }
.doc__card p { padding: 10px 0; font-size: 15px; line-height: 21px; }
.doc__card p + p { border-top: .5px solid var(--separator); }
.doc__todo { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--pill-pending-bg); color: var(--pill-pending-fg); font-weight: 600; }

@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(1.1); opacity: 0; } }
@keyframes drop { from { transform: translate(-50%, -20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Mapa anual (só aprovadoras): a toda a largura, fora da moldura de iPhone ---------- */
.pill-btn { min-height: 36px; margin-bottom: 3px; padding: 0 14px; border: 0; border-radius: 9999px; background: var(--tint); color: var(--on-tint); font-size: 15px; font-weight: 600; white-space: nowrap; }
#mapa[hidden] { display: none; }
body.com-mapa { overflow: hidden; }
.mapa { position: fixed; inset: 0; z-index: 60; overflow: auto; background: var(--bg); color: var(--label); font-family: var(--font); }
.mapa__barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: calc(10px + var(--safe-top)) 16px 10px; background: var(--surface); border-bottom: .5px solid var(--separator); }
.mapa__titulo { display: flex; align-items: center; gap: 2px; margin-right: auto; }
.mapa__titulo h1 { margin: 0 4px; font-size: 22px; line-height: 28px; font-weight: 700; }
.mapa__titulo .icon-btn { font-size: 26px; line-height: 1; }
.mapa__filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mapa__filtros .pill-select { background: var(--fill); }
.mapa__check { display: flex; align-items: center; gap: 6px; min-height: 36px; font-size: 15px; }
.mapa__check input { width: 18px; height: 18px; accent-color: var(--tint); }
.mapa__acao { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 0; border-radius: 9999px; background: var(--tint); color: var(--on-tint); font-size: 15px; font-weight: 600; text-decoration: none; }
.mapa__acao--sec { background: var(--fill); color: var(--tint); }
.mapa__meses { display: flex; gap: 4px; width: 100%; overflow-x: auto; }
.mapa__meses button { flex-shrink: 0; min-height: 36px; padding: 0 12px; border: 0; border-radius: 9999px; background: var(--fill); font-size: 13px; font-weight: 600; }
.mapa__corpo { padding: 12px 16px calc(24px + var(--safe-bottom)); }
.mapa__vazio, .mapa__resumo { margin: 4px 4px 10px; font-size: 15px; color: var(--secondary); }
.mapa__aviso { color: var(--destructive); }
.mapa__scroll { overflow-x: auto; background: var(--surface); border-radius: var(--radius-group); }
.mapa__tabela { border-collapse: separate; border-spacing: 0; font-size: 11px; }
.m-nome { position: sticky; left: 0; z-index: 2; min-width: 180px; max-width: 180px; padding: 4px 10px; overflow: hidden; background: var(--surface); border-right: .5px solid var(--separator); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; text-overflow: ellipsis; }
.m-nome small { display: block; font-size: 11px; font-weight: 400; color: var(--secondary); }
.m-nome .dot { margin-right: 6px; background: var(--c); }
thead .m-nome { z-index: 3; }
.m-mes { padding: 8px 4px 2px; border-left: .5px solid var(--separator); font-size: 12px; font-weight: 700; text-align: left; color: var(--tint); }
.m-dia { width: 18px; min-width: 18px; padding: 2px 0 4px; font-weight: 400; text-align: center; color: var(--secondary); }
.m-c { width: 18px; min-width: 18px; height: 28px; padding: 0; border-bottom: .5px solid var(--separator); }
.m-livre { background: var(--fill); }
.m-A { background: var(--c); cursor: pointer; }
.m-P { background: repeating-linear-gradient(135deg, var(--c) 0 2px, var(--surface) 2px 5px); cursor: pointer; }
.m-hoje { box-shadow: inset 1px 0 0 var(--label), inset -1px 0 0 var(--label); }
.m-dia.m-hoje { color: var(--label); font-weight: 700; }
.m-inicio-mes { border-left: .5px solid var(--separator); }
.m-aus .m-nome { font-weight: 700; }
.m-aus .m-c { border-bottom: 0; font-size: 10px; text-align: center; color: var(--secondary); }
.m-aus .m-alerta { background: var(--pill-rejected-bg); color: var(--destructive); font-weight: 700; }
.mapa__legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 4px; font-size: 13px; color: var(--secondary); }
.mapa__legenda i { display: inline-block; width: 14px; height: 14px; margin-right: 6px; border-radius: 3px; vertical-align: -2px; }
.lg-A { background: var(--tint); }
.lg-P { background: repeating-linear-gradient(135deg, var(--tint) 0 2px, var(--surface) 2px 5px); box-shadow: inset 0 0 0 1px var(--tint); }
.lg-livre { background: var(--fill); }
.lg-alerta { background: var(--pill-rejected-bg); box-shadow: inset 0 0 0 1px var(--destructive); }
.mapa__totais { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; max-width: 900px; }
.mapa__totais-t { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.mapa__totais-t th, .mapa__totais-t td { padding: 8px 10px; border-bottom: .5px solid var(--separator); text-align: right; }
.mapa__totais-t th:nth-child(-n+2), .mapa__totais-t td:nth-child(-n+2) { text-align: left; }
.mapa__totais-t thead th { font-size: 12px; font-weight: 600; color: var(--secondary); }
.mapa__rest { font-weight: 700; }
.mapa__rest.is-error { color: var(--destructive); }
.mapa__impressao { display: none; }
@media (max-width: 600px) {
  .m-nome { min-width: 118px; max-width: 118px; padding: 4px 8px; font-size: 12px; }
  .mapa__titulo h1 { font-size: 20px; }
  .mapa__totais { overflow-x: auto; }
}

/* Impressão do mapa: A4 deitado, um trimestre por página, totais no fim. */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.com-mapa { display: block; overflow: visible; background: var(--surface); }
  body.com-mapa > :not(#mapa) { display: none !important; }
  .mapa { position: static; display: block; background: var(--surface); }
  .mapa__barra, .mapa__corpo > :not(.mapa__impressao) { display: none !important; }
  .mapa__corpo { overflow: visible; padding: 0; }
  .mapa__impressao { display: block; }
  .imp-pagina { break-after: page; page-break-after: always; }
  .imp-pagina:last-child { break-after: auto; page-break-after: auto; }
  .imp-pagina h2 { margin: 0 0 4mm; font-size: 13px; color: var(--tint); }
  .imp-tabela { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 6.5px; }
  .imp-tabela th, .imp-tabela td { height: 11px; padding: 0; border: .3px solid var(--separator); }
  .imp-tabela .m-nome { position: static; width: 30mm; min-width: 0; max-width: none; padding: 0 2px; font-size: 7.5px; }
  .imp-tabela .m-nome small { font-size: 6px; }
  .imp-tabela .m-dia, .imp-tabela .m-c { width: auto; min-width: 0; }
  .imp-tabela .m-mes { padding: 1px 2px; font-size: 8px; }
  .mapa__totais-t { font-size: 10px; }
  .mapa__totais-t th, .mapa__totais-t td { padding: 3px 6px; }
}
