/* =====================================================================
   Yestriva One · protótipo v1 · camada do protótipo sobre tokens + componentes
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--y-surface); color: var(--y-text); font-family: var(--y-font-text); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* ---------- Palco: telefone no computador, tela cheia no celular ---------- */
.stagewrap { min-height: 100%; }
.aside { display: none; }
.device { position: fixed; inset: 0; background: var(--y-bg); }
.app { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--y-bg); }

@media (min-width: 760px) and (min-height: 640px) {
  .stagewrap { display: flex; align-items: center; justify-content: center; gap: 56px; padding: 24px; min-height: 100vh; }
  .aside { display: block; max-width: 300px; }
  .aside__logo svg { height: 40px; width: auto; display: block; }
  .aside h1 { font: 700 22px/1.25 var(--y-font-display); letter-spacing: var(--y-tracking-display); margin: 20px 0 10px; }
  .aside p { color: var(--y-text-2); margin: 0 0 12px; line-height: 1.5; }
  .aside__tag { display: inline-block; background: var(--y-warning-bg); color: var(--y-warning) !important; font-weight: 600; font-size: 14px; padding: 4px 10px; border-radius: 8px; }
  .aside__small { font-size: 14px; }
  .device { position: relative; inset: auto; width: 390px; height: min(844px, calc(100vh - 48px)); border-radius: 46px; border: 11px solid #0B0F17; box-shadow: 0 30px 60px rgba(0, 26, 64, .22); overflow: hidden; flex: none; }
  .is-framed .hdr { padding-top: 14px; }
}

/* ---------- Estrutura da tela ---------- */
.hdr { flex: none; padding-top: max(env(safe-area-inset-top), 4px); background: var(--y-bg); z-index: var(--y-z-header); }
.hdr .y-header { min-height: 60px; }
.hdr--shadow { box-shadow: 0 1px 0 var(--y-border); }
.main { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 16px 28px; outline: none; }
.main--flush { padding-left: 0; padding-right: 0; }
.foot { flex: none; padding: 12px 16px 12px; background: var(--y-bg); border-top: 1px solid var(--y-border); display: flex; flex-direction: column; gap: 8px; }
.foot__row { display: flex; gap: 8px; }
.foot__row > * { flex: 1; }
.tabbar { flex: none; position: relative; z-index: var(--y-z-tabbar); }
.tabbar .y-work { min-width: 72px; }
.tabbar.is-hidden { display: none; }

.clockbar { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(max(env(safe-area-inset-top), 0px) + 6px) 8px 6px 16px; background: var(--y-brand-navy); color: #fff; font-size: 14px; font-weight: 600; }
.clockbar + .hdr { padding-top: 4px; }
.clockbar__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--y-brand-yellow); box-shadow: 0 0 0 4px rgba(251, 199, 0, .25); flex: none; animation: y-pulse 1.6s ease-in-out infinite; }
.clockbar__text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clockbar__time { font-variant-numeric: tabular-nums; flex: none; }
.clockbar button { min-height: 44px; min-width: 48px; padding: 0 14px; border-radius: 10px; border: 1.5px solid #A9B6CC; background: transparent; color: #fff; font-weight: 600; cursor: pointer; }
.clockbar button:active { background: #133166; }
@keyframes y-pulse { 50% { box-shadow: 0 0 0 7px rgba(251, 199, 0, .08); } }
@media (prefers-reduced-motion: reduce) { .clockbar__dot { animation: none; } }

/* ---------- Utilitários ---------- */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.hstack { display: flex; align-items: center; gap: 8px; }
.hstack--wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.money { font: 700 var(--y-text-2xl)/1.1 var(--y-font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.money--sm { font-size: var(--y-text-xl); }
.strong { font-weight: 700; }
.small { font-size: var(--y-text-sm); }
.xs { font-size: var(--y-text-xs); }
.t-success { color: var(--y-success); }
.t-danger { color: var(--y-danger); }
.t-warning { color: var(--y-warning); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-label { font-size: var(--y-text-xs); font-weight: 600; letter-spacing: var(--y-tracking-caps); text-transform: uppercase; color: var(--y-text-2); margin: 24px 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.section-label:first-child { margin-top: 8px; }
.note { font-size: var(--y-text-sm); color: var(--y-text-2); margin: 0; line-height: 1.45; }
.demo-note { font-size: var(--y-text-xs); color: var(--y-text-2); text-align: center; margin: 20px 0 0; line-height: 1.45; }
.demo-note b { color: var(--y-warning); }
.demo-chip { background: var(--y-warning-bg); color: var(--y-warning); }
.y-card + .y-card, .y-todo + .y-todo, .y-job + .y-job { margin-top: 8px; }
.stack > .y-card + .y-card, .stack > .y-job + .y-job, .stack > .y-todo + .y-todo { margin-top: 0; }
.y-card h3 { font: 600 var(--y-text-lg)/1.3 var(--y-font-text); margin: 0 0 4px; }
.y-card p { margin: 0; }
.y-card--hi { background: var(--y-brand-navy); color: #fff; }
.y-card--hi .y-muted, .y-card--hi .note { color: #A9B6CC; }
.y-card--outline { background: transparent; border: 1.5px dashed var(--y-border-strong); }
.y-card--danger { background: var(--y-danger-bg); }
.y-card--danger h3 { color: var(--y-danger); }
.y-card--ok { background: var(--y-success-bg); }
.y-card--warn { background: var(--y-warning-bg); }
.y-card--warn h3 { color: var(--y-warning); }
.y-btn .y-icon { width: 22px; height: 22px; }
.y-btn--danger { background: transparent; color: var(--y-danger); border-color: var(--y-danger); }
.y-btn--on-navy { background: transparent; color: #fff; border-color: #A9B6CC; }
.y-btn--on-navy:active { background: #133166; }
.y-btn--ghost { background: var(--y-surface); color: var(--y-text); }
.y-btn--ghost:active { background: var(--y-surface-2); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow > .y-btn { flex: 1 1 0; min-width: 0; padding: 0 12px; }
.y-header .y-chip { flex: none; }
.y-header__title { font-size: 1.25rem; }
.y-header--large .y-header__title { font-size: var(--y-text-2xl); }
.y-row { font-size: 15px; }
.y-row--total { border-top: 2px solid var(--y-text); padding-top: 12px; }
.y-row--total > span:first-child { color: var(--y-text); font-weight: 700; }
.y-row--total > :last-child { font: 700 var(--y-text-xl) var(--y-font-display); font-variant-numeric: tabular-nums; }
.y-row .num { font-variant-numeric: tabular-nums; }
.y-list-item { min-height: 64px; }
.y-list--card { background: var(--y-surface); border-radius: var(--y-radius-lg); overflow: hidden; }
.y-list--card .y-list-item:last-child { border-bottom: 0; }
.y-list-item__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--y-surface-2); flex: none; }
.y-list--card .y-list-item__icon { background: var(--y-bg); }
.y-list-item__end { display: flex; align-items: center; gap: 6px; flex: none; }
.y-list-item[aria-disabled="true"] { color: var(--y-text-2); }
.badge-soon { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--y-surface-2); color: var(--y-text-2); }
.y-avatar--lg { width: 64px; height: 64px; font-size: 20px; }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
textarea.y-input { min-height: 104px; padding: 14px 16px; resize: vertical; line-height: 1.45; }
select.y-input { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.y-input--sm { min-height: 48px; padding: 0 12px; }
.y-input--num { font-variant-numeric: tabular-nums; }
.y-field__row { display: flex; gap: 12px; }
.y-field__row > * { flex: 1; min-width: 0; }
.y-field__prefix { position: absolute; left: 16px; color: var(--y-text-2); pointer-events: none; }
.y-field__control--prefix .y-input { padding-left: 32px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 8px 0; cursor: pointer; }
.switch__text { flex: 1; min-width: 0; }
.switch__text small { display: block; color: var(--y-text-2); font-size: var(--y-text-sm); }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 16px; background: var(--y-border-strong); position: relative; flex: none; cursor: pointer; transition: background var(--y-dur-base); margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--y-dur-base) var(--y-ease-out); }
.switch input:checked { background: var(--y-selected-bg); }
.switch input:checked::after { transform: translateX(20px); background: var(--y-selected-text); }
.switch + .switch { border-top: 1px solid var(--y-border); }
.y-segmented button { padding: 0 6px; font-size: 15px; }
.y-segmented--4 button { font-size: 14px; }
.chiprow { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chiprow::-webkit-scrollbar { display: none; }
.fchip { flex: none; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--y-border); background: var(--y-bg); color: var(--y-text); font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; }
.fchip[aria-pressed="true"] { background: var(--y-selected-bg); color: var(--y-selected-text); border-color: var(--y-selected-bg); }
.fchip .num { opacity: .75; margin-left: 4px; }

/* ---------- Etapas (7) ---------- */
.stages { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.stages .y-stage__label { font-size: 10.5px; }
.stage-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 4px; }
.stage-mini i { height: 4px; border-radius: 2px; background: var(--y-border); }
.stage-mini i.d { background: var(--y-text); }
.stage-mini i.c { background: var(--y-primary-bg); box-shadow: inset 0 0 0 1px var(--y-text); }
.stage-mini.is-paid i { background: var(--y-success); }

/* ---------- Tarefas ---------- */
.task { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 8px 8px 12px; border: 0; border-bottom: 1px solid var(--y-border); background: transparent; color: var(--y-text); text-align: left; cursor: pointer; }
.task:last-child { border-bottom: 0; }
.task:active { background: var(--y-surface-2); }
.task:disabled { color: var(--y-disabled-text); cursor: not-allowed; }
.task__box { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--y-border-strong); display: grid; place-items: center; flex: none; background: var(--y-bg); }
.task.is-done .task__box { background: var(--y-success); border-color: var(--y-success); color: var(--y-bg); }
.task.is-done .task__label { color: var(--y-text-2); text-decoration: line-through; text-decoration-thickness: 1px; }
.task__label { flex: 1; min-width: 0; font-size: 16px; }
.task__photo { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: var(--y-warning-bg); color: var(--y-warning); flex: none; }
.task.is-done .task__photo { background: var(--y-success-bg); color: var(--y-success); }
.task__thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--y-surface-2); }
.y-icon--xs { width: 16px; height: 16px; }

/* ---------- Fotos ---------- */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--y-surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 10, 30, .75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--y-border-strong); background: transparent; color: var(--y-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 600; font-size: 14px; cursor: pointer; }
.receipt-preview { width: 100%; max-height: 220px; object-fit: contain; border-radius: 12px; background: var(--y-surface); display: block; }

/* ---------- Orçamento ---------- */
.opt { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 14px 16px; border-radius: var(--y-radius-lg); border: 1.5px solid var(--y-border); background: var(--y-bg); color: var(--y-text); text-align: left; cursor: pointer; min-height: 64px; }
.opt[aria-checked="true"] { border: 2px solid var(--y-text); box-shadow: inset 0 0 0 1px var(--y-text); }
.opt__radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--y-border-strong); flex: none; margin-top: 1px; display: grid; place-items: center; }
.opt[aria-checked="true"] .opt__radio { border-color: var(--y-text); }
.opt[aria-checked="true"] .opt__radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--y-text); }
.opt__body { flex: 1; min-width: 0; }
.opt__body b { display: block; font-size: 17px; }
.opt__body small { display: block; color: var(--y-text-2); font-size: 14px; }
.opt__price { font: 700 17px var(--y-font-text); font-variant-numeric: tabular-nums; }
.extra { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--y-surface); color: var(--y-text); cursor: pointer; text-align: left; }
.extra .task__box { width: 26px; height: 26px; }
.extra[aria-checked="true"] .task__box { background: var(--y-text); border-color: var(--y-text); color: var(--y-bg); }
.line { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--y-border); }
.line:first-child { border-top: 0; }
.line__body { flex: 1; min-width: 0; }
.line__body b { display: block; font-weight: 600; font-size: 15px; }
.line__body small { display: block; color: var(--y-text-2); font-size: 13px; }
.line__amt { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 15px; text-align: right; }
.line .y-icon-btn { margin-right: -8px; color: var(--y-text-2); }
.margin-box { border: 1.5px dashed var(--y-border-strong); border-radius: var(--y-radius-lg); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.client-view { padding-bottom: 8px; }
.legal { border-radius: var(--y-radius-lg); background: var(--y-surface); padding: 14px 16px; }
.legal b { display: block; margin-bottom: 4px; }
.legal p { margin: 0; font-size: 14px; color: var(--y-text-2); }
.legal--rc { background: var(--y-surface); border-left: 4px solid var(--y-text); }

/* ---------- Assinatura ---------- */
.sigbox { position: relative; border: 1.5px solid var(--y-border-strong); border-radius: var(--y-radius-lg); background: #fff; height: 180px; touch-action: none; overflow: hidden; }
.sigbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.sigbox__hint { position: absolute; left: 16px; right: 16px; bottom: 36px; border-bottom: 1.5px solid #B4BECC; color: #6B7A90; font-size: 14px; padding-bottom: 4px; pointer-events: none; }
.sigbox.has-ink .sigbox__hint span { visibility: hidden; }
.sigbox__clear { position: absolute; top: 4px; right: 4px; min-height: 44px; padding: 0 12px; border: 0; background: transparent; color: #001A40; text-decoration: underline; font-weight: 600; cursor: pointer; }
.sig-img { height: 64px; width: auto; max-width: 100%; display: block; background: #fff; border-radius: 8px; }

/* ---------- Agenda ---------- */
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day { min-height: 64px; border-radius: 12px; border: 0; background: var(--y-surface); color: var(--y-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; padding: 4px 0; }
.cal-day small { font-size: 12px; color: var(--y-text-2); font-weight: 600; }
.cal-day b { font-size: 17px; font-variant-numeric: tabular-nums; }
.cal-day i { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.cal-day i.on { background: var(--y-text); }
.cal-day[aria-pressed="true"] { background: var(--y-selected-bg); color: var(--y-selected-text); }
.cal-day[aria-pressed="true"] small { color: inherit; opacity: .8; }
.cal-day[aria-pressed="true"] i.on { background: var(--y-primary-bg); }
.slot { display: flex; gap: 12px; align-items: stretch; }
.slot__time { width: 52px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 14px; font-size: 15px; }
.slot__time small { display: block; font-weight: 500; color: var(--y-text-2); font-size: 12px; }
.slot .y-job { min-height: 72px; }
.slot--free { color: var(--y-text-2); font-size: 14px; padding: 6px 0 6px 64px; }

/* ---------- Certificado: circuitos ---------- */
.circ { background: var(--y-surface); border-radius: var(--y-radius-lg); overflow: hidden; }
.circ + .circ { margin-top: 8px; }
.circ.is-bad { box-shadow: inset 4px 0 0 var(--y-danger); }
.circ.is-warn { box-shadow: inset 4px 0 0 var(--y-warning); }
.circ__head { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 10px 12px 10px 16px; border: 0; background: transparent; color: var(--y-text); text-align: left; cursor: pointer; }
.circ__no { width: 32px; height: 32px; border-radius: 50%; background: var(--y-bg); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 14px; }
.circ__body { flex: 1; min-width: 0; }
.circ__body b { display: block; font-size: 15px; }
.circ__vals { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--y-text-2); font-variant-numeric: tabular-nums; }
.circ__vals .bad { color: var(--y-danger); font-weight: 700; }
.circ__status { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; }
.circ__edit { padding: 4px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.circ__edit .y-field__label { font-size: 13px; }
.circ__edit .full { grid-column: 1 / -1; }
.circ__calc { grid-column: 1 / -1; font-size: 14px; border-radius: 12px; padding: 10px 12px; background: var(--y-bg); line-height: 1.5; }
.circ__calc b { font-variant-numeric: tabular-nums; }
.circ__calc.is-bad { background: var(--y-danger-bg); color: var(--y-danger); }
.circ__calc.is-bad span { color: var(--y-text); }
.circ__tools { grid-column: 1 / -1; display: flex; gap: 8px; }
.circ__tools .y-btn { flex: 1; padding: 0 8px; font-size: 15px; }
.obs-code { display: inline-grid; place-items: center; min-width: 40px; height: 28px; padding: 0 6px; border-radius: 8px; font-weight: 700; font-size: 13px; flex: none; }
.obs-code--C1, .obs-code--C2 { background: var(--y-danger-bg); color: var(--y-danger); }
.obs-code--C3 { background: var(--y-warning-bg); color: var(--y-warning); }
.obs-code--FI { background: var(--y-surface-2); color: var(--y-text); }
.verdict { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--y-radius-lg); }
.verdict--bad { background: var(--y-danger-bg); color: var(--y-danger); }
.verdict--ok { background: var(--y-success-bg); color: var(--y-success); }
.verdict span { color: var(--y-text); }
.verdict b { font-size: 17px; }

/* ---------- Números ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: var(--y-surface); border-radius: var(--y-radius-lg); padding: 14px 16px; }
.stat small { display: block; color: var(--y-text-2); font-size: 14px; font-weight: 600; }
.stat b { display: block; font: 700 22px/1.2 var(--y-font-display); font-variant-numeric: tabular-nums; margin-top: 4px; }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; height: 150px; margin-top: 12px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar i { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: var(--y-text); min-height: 4px; }
.bar.is-now i { background: var(--y-primary-bg); box-shadow: inset 0 0 0 1.5px var(--y-text); }
.bar small { font-size: 12px; color: var(--y-text-2); font-weight: 600; }
.bar span { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- PDF (pré-visualização) ---------- */
.pdfwrap { background: var(--y-surface-2); margin: 0 -16px; padding: 16px; }
.pdf { background: #fff; color: #001A40; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 26, 64, .18); padding: 22px 18px 18px; font-size: 11px; line-height: 1.45; aspect-ratio: 210 / 297; overflow: hidden; display: flex; flex-direction: column; gap: 10px; }
.pdf__top { display: flex; justify-content: space-between; gap: 10px; }
.pdf__top svg { height: 26px; width: auto; }
.pdf h4 { margin: 0; font: 700 16px var(--y-font-display); }
.pdf table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pdf th { text-align: left; font-weight: 700; border-bottom: 1.5px solid #001A40; padding: 3px 0; }
.pdf td { padding: 3px 0; border-bottom: 1px solid #D5DCE6; }
.pdf td:last-child, .pdf th:last-child { text-align: right; }
.pdf .tot td { border: 0; padding: 2px 0; }
.pdf .tot .big td { font-weight: 700; font-size: 13px; border-top: 1.5px solid #001A40; padding-top: 5px; }
.pdf__muted { color: #4A5A73; }
.pdf__box { border: 1px solid #001A40; padding: 6px 8px; border-radius: 3px; }
.pdf__foot { margin-top: auto; border-top: 1px solid #D5DCE6; padding-top: 6px; color: #4A5A73; font-size: 9.5px; }
.pdf__stamp { align-self: flex-start; font-weight: 700; color: #8A5300; background: #FFF3DC; padding: 2px 6px; border-radius: 3px; font-size: 10px; }

/* ---------- Camadas: folha, diálogo, toast ---------- */
.layer { position: absolute; inset: 0; z-index: var(--y-z-sheet); pointer-events: none; }
.layer > * { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: var(--y-overlay); animation: y-fade var(--y-dur-slow) var(--y-ease-out); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90%; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: y-up var(--y-dur-slow) var(--y-ease-out); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet__head .y-sheet__title { margin: 0; }
.sheet .y-action-grid { grid-template-columns: 1fr 1fr 1fr; }
.sheet .y-action { min-height: 92px; padding: 10px; align-items: center; text-align: center; font-size: 14px; line-height: 1.25; gap: 8px; }
.sheet .y-action .y-icon { width: 26px; height: 26px; }
.sheet .y-action--soon { color: var(--y-text-2); }
.sheet__ctx { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 14px; color: var(--y-text-2); }
.dialog { position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); background: var(--y-surface-raised); border-radius: var(--y-radius-xl); padding: 24px 20px 20px; box-shadow: var(--y-shadow-lg); animation: y-pop var(--y-dur-slow) var(--y-ease-out); max-height: 86%; overflow-y: auto; }
.dialog h2 { font: 700 var(--y-text-xl)/1.25 var(--y-font-display); margin: 0 0 8px; }
.dialog p { margin: 0 0 16px; color: var(--y-text-2); }
.dialog .stack-sm { margin-top: 8px; }
@keyframes y-fade { from { opacity: 0; } }
@keyframes y-up { from { transform: translateY(100%); } }
@keyframes y-pop { from { opacity: 0; transform: translateY(-46%) scale(.97); } }
.toast { position: absolute; left: 16px; right: 16px; bottom: 96px; z-index: var(--y-z-toast); background: var(--y-text); color: var(--y-bg); border-radius: 14px; padding: 14px 16px; font-size: 15px; font-weight: 500; box-shadow: var(--y-shadow-lg); opacity: 0; transform: translateY(8px); transition: opacity var(--y-dur-base), transform var(--y-dur-base) var(--y-ease-out); pointer-events: none; }
.toast.is-on { opacity: 1; transform: none; }
.toast b { font-weight: 700; }

/* ---------- Entrada ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; padding: 24px 4px 8px; }
.auth__logo svg { height: 44px; width: auto; display: block; }
.auth h1 { font: 700 var(--y-text-2xl)/1.2 var(--y-font-display); letter-spacing: var(--y-tracking-display); margin: 32px 0 6px; }
.auth > p { color: var(--y-text-2); margin: 0 0 24px; }
.steps-dots { display: flex; gap: 6px; margin: 4px 0 0; }
.steps-dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--y-border); }
.steps-dots i.on { background: var(--y-text); }

/* ---------- Momento "feito" (sempre na cor da marca) ---------- */
.done { position: absolute; inset: 0; background: var(--y-brand-navy); color: #fff; display: flex; flex-direction: column; align-items: center; padding: max(env(safe-area-inset-top), 24px) 24px calc(24px + env(safe-area-inset-bottom)); z-index: 50; }
.done__center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; width: 100%; }
.stage3d { width: 200px; height: 200px; perspective: 700px; position: relative; margin-bottom: 22px; }
.floor { position: absolute; left: 50%; bottom: -6px; width: 150px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), rgba(0,0,0,0)); opacity: 0; }
.y3d { position: absolute; inset: 0; transform-style: preserve-3d; }
.part { position: absolute; inset: 0; transform-style: preserve-3d; }
.part svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; backface-visibility: visible; }
.stem { transform-origin: 50% 95%; }
.tip { transform-origin: 75% 24%; }
.glow { position: absolute; left: 75%; top: 24%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; background: radial-gradient(closest-side, rgba(251,199,0,.55), rgba(251,199,0,0)); opacity: 0; transform: translateZ(-14px); pointer-events: none; }
.ring { position: absolute; left: 75%; top: 24%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; border: 3px solid var(--y-brand-yellow); opacity: 0; transform: translateZ(30px); }
.done h2 { font: 700 30px/1.15 var(--y-font-display); letter-spacing: var(--y-tracking-display); margin: 0; }
.done p { margin: 0; color: #A9B6CC; font-size: 16px; }
.done .done__money { font: 700 28px var(--y-font-display); color: #fff !important; font-variant-numeric: tabular-nums; margin-top: 4px !important; }
.done__card { width: 100%; background: #0A2550; border-radius: 16px; padding: 4px 16px; margin-top: 20px; text-align: left; }
.done__card .y-row { border-color: #1E3B6E; }
.done__card .y-row > span:first-child { color: #A9B6CC; }
.done__card .t-success { color: #5FD99A; }
.done__actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.done .y-btn--primary { background: #FBC700; color: #001A40; }

/* Ações rápidas com ícone em cima (cabem a 360 px) */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick .y-btn { flex-direction: column; gap: 4px; min-height: 64px; padding: 6px 4px; font-size: 14px; line-height: 1.2; text-align: center; }
.y-card .quick .y-btn--ghost { background: var(--y-bg); }

/* No escuro, o cartão de destaque não pode sumir no fundo marinho */
[data-theme="dark"] .y-card--hi { background: var(--y-surface); box-shadow: inset 0 0 0 2px var(--y-brand-yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .y-card--hi { background: var(--y-surface); box-shadow: inset 0 0 0 2px var(--y-brand-yellow); } }

/* Logo no topo da Home */
.hdr__logo { padding: 10px 16px 0; }
.hdr__logo svg { height: 26px; width: auto; display: block; }
/* Abertura */
.splash { cursor: pointer; }
.splash__logo svg { height: 40px; width: auto; display: block; margin: 0 auto 6px; }
