:root {
  color-scheme: light;
  /* Cores do site da TS Madeiras */
  --ink: #2a2420; --ink-2: #4d4540; --ink-3: #6b625b;
  --paper: #f6f2ea; --surface: #fff; --surface-2: #fbf8f2; --line: #e6dfd3; --line-2: #cfc6b7;
  --pine: #2a2420; --pine-2: #3f362f; --pine-ink: #fdfcf8; --pine-muted: #bdb2a7;
  --accent: #d9202b; --accent-2: #b5161f; --accent-soft: #fdeeee;
  --chart: #b4571a; --chart-2: #97470f;
  --display: "Anton", Impact, "Arial Narrow Bold", "Helvetica Neue", Arial, sans-serif;
  --ok: #1f6f46; --ok-bg: #e4f2ea; --warn: #855700; --warn-bg: #fbf0d9;
  --bad: #a82319; --bad-bg: #fbe8e6; --info: #1c5a85; --info-bg: #e4eff7; --mute: #4a504b; --mute-bg: #ebebe6;
  --radius: 8px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 8px 24px rgba(20, 30, 25, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Escalas únicas: use estes tokens em vez de valores soltos */
  --on-strong: #fff; --gold: #efb73e; --line-strong: #a9a99e; --band: #f3f1ea; --surface-3: #f0f0ec;
  --ok-line: #9dcfb2; --ok-soft: #f6fbf8; --warn-line: #e2bf7f; --warn-soft: #fffaf0; --bad-line: #e5b3ae; --bad-soft: #fff6f5;
  --radius-xs: 4px; --radius-lg: 12px; --radius-pill: 999px;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, .06); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .3); --scrim: rgba(20, 30, 25, .45);
  --fs-2xs: .7rem; --fs-xs: .76rem; --fs-sm: .86rem; --fs-md: .92rem; --fs-base: 1rem; --fs-lg: 1.15rem; --fs-xl: 1.3rem; --fs-2xl: 1.6rem;
}
* { box-sizing: border-box; }
html { font-size: 14.5px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); line-height: 1.45; font-variant-numeric: tabular-nums; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.01em; line-height: 1.2; }
h2 { font-size: var(--fs-lg); font-weight: 620; }
h3 { font-size: var(--fs-md); font-weight: 620; }
a { color: var(--accent-2); }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--ink-3); }
.strong { font-weight: 620; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xs { display: flex; flex-direction: column; gap: 3px; }
.lbl { font-size: var(--fs-sm); font-weight: 560; color: var(--ink-2); }
.text-ok { color: var(--ok); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row.no-wrap { flex-wrap: nowrap; align-items: flex-start; }
.row.no-wrap svg { flex: none; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--pine); color: var(--pine-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: inherit; text-decoration: none; }
.brand svg { flex: none; }
.brand b { font-family: var(--display); font-size: var(--fs-xl); font-weight: 400; letter-spacing: .03em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px 12px; flex: 1; }
.nav-title { font-size: var(--fs-xs); letter-spacing: .05em; text-transform: uppercase; color: var(--pine-muted); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--pine-ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--pine-2); }
.nav a.active { background: var(--surface); color: var(--pine); font-weight: 620; }
.nav a svg { flex: none; opacity: .85; }
.nav .count { margin-left: auto; background: var(--accent); color: var(--on-strong); border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 650; min-width: 20px; text-align: center; padding: 0 6px; line-height: 20px; }
.nav a.active .count { background: var(--accent); }
.account { border-top: 1px solid var(--pine-2); padding: 12px 16px 14px; font-size: var(--fs-md); }
.account .who { font-weight: 600; }
.account .role { color: var(--pine-muted); font-size: var(--fs-sm); }
.account .row { margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--pine-muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--on-strong); }
.main { min-width: 0; padding: 24px 28px 48px; }
.topbar { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--ink-3); margin-top: 3px; }
.scrim { display: none; }

/* Cartões e tabelas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 14px 16px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
table.data th { text-align: left; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th.right, table.data td.right { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--surface-2); }
table.data tfoot td { font-weight: 620; background: var(--surface-2); border-top: 1px solid var(--line-2); border-bottom: 0; }
.cell-title { font-weight: 560; }
table.data td.col-wide { min-width: 170px; }
table.data.compact th, table.data.compact td { padding-left: 7px; padding-right: 7px; }
table.data.compact th:first-child, table.data.compact td:first-child { padding-left: 14px; }
.cell-sub { color: var(--ink-3); font-size: var(--fs-sm); }
.empty { text-align: center; padding: 36px 20px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: var(--fs-base); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); }

/* Botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; min-height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; font-weight: 560; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-strong); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: var(--on-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--mute-bg); }
.btn.small { min-height: 30px; padding: 4px 9px; font-size: var(--fs-md); }
.btn.large { min-height: 48px; padding: 10px 18px; font-size: var(--fs-base); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span.lbl { font-size: var(--fs-sm); font-weight: 560; color: var(--ink-2); }
.field .hint { font-size: var(--fs-sm); color: var(--ink-3); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 36px; width: 100%; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); flex: none; margin: 0; }
input.num { text-align: right; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.filters .field { min-width: 150px; }
.filters .search { flex: 1 1 240px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a, .tabs button { background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; font-weight: 560; color: var(--ink-3); padding: 8px 12px; cursor: pointer; text-decoration: none; white-space: nowrap; margin-bottom: -1px; }
.tabs a.active, .tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.whatsapp-text { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: var(--fs-md); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; max-height: 280px; overflow-y: auto; }
.card-tabs { margin: 0; padding: 4px 12px 0; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button { flex: 1 1 96px; min-width: 88px; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer; text-align: left; font: inherit; }
.segmented button b { display: block; font-weight: 620; }
.segmented button span { font-size: var(--fs-sm); color: var(--ink-3); }
.segmented button:hover:not(:disabled) { border-color: var(--accent); }
.segmented button:disabled { opacity: .5; cursor: not-allowed; background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: var(--radius-pill); padding: 5px 12px; min-height: 32px; font: inherit; font-weight: 520; cursor: pointer; white-space: nowrap; }
.chip:hover:not(:disabled) { border-color: var(--accent); }
.chip:disabled { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
input.table-input { min-width: 92px; min-height: 32px; padding: 4px 8px; }
input.small-input { min-width: 66px; width: 72px; }
table.data.posts { font-size: var(--fs-sm); }
table.data.posts td, table.data.posts th { padding: 5px 7px; }
.house-layout { display: grid; grid-template-columns: minmax(280px, 520px) minmax(0, 1fr); gap: 16px; align-items: start; }
.house { width: 100%; height: auto; display: block; }
.house-area { cursor: pointer; outline: none; }
.house-fill { stroke: var(--ink); stroke-width: 2; transition: fill .12s; }
.wall { fill: #efe3d0; } .paint { fill: #e9d5b0; } .wood { fill: #d9b98c; } .tile { fill: #b5532a; } .door { fill: #8a5a33; }
.metal { fill: #e0e0e0; } .window { fill: #cfe3ee; } .deck { fill: #b98d5c; } .post { fill: #7d6242; }
.house-line { stroke: #7d6242; stroke-width: 2; }
.house-brick { stroke: #dbcbb2; stroke-width: 1; }
.house-pill { fill: var(--on-strong); stroke: var(--ink); stroke-width: 1.5; }
.house-label { font: 600 14px var(--font); fill: var(--ink); pointer-events: none; }
.house-area:hover .house-pill, .house-area:focus-visible .house-pill { stroke: var(--accent); stroke-width: 3; }
.house-area.active .house-pill { fill: var(--accent); stroke: var(--accent); }
.house-area.active .house-label { fill: var(--on-strong); }
.house-area.active .house-fill { stroke: var(--accent); stroke-width: 3; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-strong); font-weight: 620; }
.segmented button.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* Selos */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; }
.tone-ok { color: var(--ok); background: var(--ok-bg); }
.tone-warn { color: var(--warn); background: var(--warn-bg); }
.tone-bad { color: var(--bad); background: var(--bad-bg); }
.tone-info { color: var(--info); background: var(--info-bg); }
.tone-mute { color: var(--mute); background: var(--mute-bg); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); font-size: var(--fs-md); }
.notice svg { flex: none; margin-top: 1px; }
.notice .grow { min-width: 0; }

/* Indicadores */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; text-decoration: none; color: inherit; display: block; min-width: 0; }
a.tile:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.tile .lbl { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 520; }
.tile .val { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.015em; margin-top: 2px; line-height: 1.2; overflow-wrap: anywhere; }
.tile .sub { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; }
.tile.attention { border-color: var(--warn-line); background: var(--warn-soft); }
.tile.alert { border-color: var(--bad-line); background: var(--bad-soft); }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; align-items: start; }

/* Editor de venda */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.editor .side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.combo { position: relative; }
.combo .icon-in { position: absolute; left: 10px; top: 10px; color: var(--ink-3); pointer-events: none; }
.combo input { padding-left: 34px; }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; padding: 4px; }
.combo-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; align-items: center; }
.combo-item:hover, .combo-item.active { background: var(--accent-soft); }
.combo-empty { padding: 12px; color: var(--ink-3); }
.item-panel { border: 1px solid var(--accent); background: var(--surface-2); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.measure-line { display: flex; flex-wrap: wrap; gap: 4px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; }
.measure-line div { display: flex; flex-direction: column; }
.measure-line .k { font-size: var(--fs-xs); color: var(--ink-3); }
.measure-line .v { font-weight: 620; }
.totals { display: flex; flex-direction: column; gap: 5px; }
.totals .line { display: flex; justify-content: space-between; gap: 12px; }
.totals .line.total { font-size: var(--fs-xl); font-weight: 680; border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 3px; }
.meter { height: 6px; background: var(--mute-bg); border-radius: var(--radius-xs); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter i.over { background: var(--bad); }

/* Etapas do pedido */
.steps { display: flex; gap: 0; list-style: none; padding: 0; margin: 0; overflow-x: auto; }
.steps li { flex: 1 1 0; min-width: 96px; position: relative; padding-top: 22px; font-size: var(--fs-sm); color: var(--ink-3); text-align: center; }
.steps li::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 2px; background: var(--line-2); }
.steps li:first-child::before { left: 50%; }
.steps li:last-child::before { right: 50%; }
.steps li::after { content: ""; position: absolute; top: 3px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.steps li.done::before, .steps li.current::before { background: var(--ok); }
.steps li.done::after { background: var(--ok); border-color: var(--ok); }
.steps li.current { color: var(--ink); font-weight: 620; }
.steps li.current::after { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.steps li.current::before { background: linear-gradient(90deg, var(--ok) 50%, var(--line-2) 50%); }
.steps li.current:first-child::before { background: var(--line-2); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline li { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; font-size: var(--fs-md); }
.timeline .when { color: var(--ink-3); font-size: var(--fs-sm); }
.info-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; }
.info-list dt { color: var(--ink-3); font-size: var(--fs-md); }
.info-list dd { margin: 0; overflow-wrap: anywhere; }

/* Pátio e entregas: telas de toque */
.job { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
a.job:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.job .num { font-size: var(--fs-lg); font-weight: 680; }
.job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.pick-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; }
.pick-item.done { border-color: var(--ok-line); background: var(--ok-soft); }
.pick-item.short { border-color: var(--bad-line); background: var(--bad-soft); }
.pick-item .loc { display: inline-block; background: var(--pine); color: var(--on-strong); font-size: var(--fs-sm); font-weight: 620; padding: 2px 8px; border-radius: var(--radius-xs); margin-bottom: 5px; }
.pick-item .ask { font-size: var(--fs-xl); font-weight: 680; margin-top: 4px; }
.pick-qty { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; }
.pick-qty input { text-align: center; font-size: var(--fs-lg); font-weight: 650; padding: 4px; min-height: 44px; }
.pick-qty button { min-height: 44px; padding: 0; }
.sticky-actions { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5; }
.sticky-actions .btn { flex: 1 1 180px; }
.collect { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 650; }

/* Matriz de permissões */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 270px; }
.matrix thead th { position: sticky; top: 0; z-index: 2; }
.matrix thead th:first-child { z-index: 3; background: var(--surface-2); }
.matrix .group td { background: var(--surface-2); font-weight: 620; text-align: left; color: var(--ink-2); }
.matrix input.limit { width: 76px; text-align: right; }

/* Gráfico de barras */
.chart { position: relative; }
.chart-plot { position: relative; height: 200px; margin-left: 66px; }
.chart-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.chart-tick { position: absolute; right: 100%; margin-right: 8px; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; transform: translateY(-50%); }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.chart-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; background: none; border: 0; padding: 0 1px; cursor: default; }
.chart-col:hover, .chart-col:focus-visible { background: var(--surface-2); }
.chart-col i { display: block; width: 100%; max-width: 24px; background: var(--chart); border-radius: 4px 4px 0 0; }
.chart-col:hover i, .chart-col:focus-visible i { background: var(--chart-2); }
.chart-axis { display: flex; margin-left: 66px; margin-top: 4px; }
.chart-axis span { flex: 1 1 0; min-width: 0; font-size: var(--fs-xs); color: var(--ink-3); text-align: center; white-space: nowrap; overflow: visible; }
.chart-tip { position: absolute; z-index: 10; background: var(--ink); color: var(--on-strong); border-radius: var(--radius-sm); padding: 6px 10px; font-size: var(--fs-sm); pointer-events: none; white-space: nowrap; transform: translate(-50%, -100%); }
.chart-tip b { display: block; font-size: var(--fs-base); }

/* Janelas e avisos */
dialog.modal { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: var(--shadow); color: var(--ink); }
dialog.modal.wide { width: min(780px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: var(--scrim); }
dialog.modal form, dialog.modal > .modal-frame { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.modal-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--on-strong); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 520; }
.toast.error { background: var(--bad); }
.toast.ok { background: var(--ok); }

/* Entrada */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--pine); }
.login-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; width: min(380px, 100%); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-brand h1 { font-family: var(--display); font-size: var(--fs-2xl); font-weight: 400; letter-spacing: .03em; text-transform: uppercase; }
.login-tagline { font-family: var(--display); color: var(--pine-ink); font-size: clamp(1.8rem, 5vw, 2.9rem); line-height: 1.12; text-transform: uppercase; text-align: center; letter-spacing: .01em; margin-bottom: 22px; }
.login-tagline span { color: var(--gold); display: block; }
.login-wrap { display: flex; flex-direction: column; align-items: center; width: min(420px, 100%); }
.demo-bar { background: var(--gold); color: var(--ink); padding: 6px 28px; font-size: var(--fs-md); font-weight: 560; }

/* Documentos para imprimir */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 32px; max-width: 960px; margin: 0 auto; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.doc-title { text-align: right; }
.doc-title h1 { font-size: var(--fs-xl); }
.doc-block { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin-bottom: 14px; }
.doc table.data { font-size: var(--fs-md); }
.doc table.data th { background: var(--surface-3); color: var(--ink); }
.doc-totals { display: flex; justify-content: flex-end; margin-top: 12px; }
.doc-totals .totals { width: min(310px, 100%); }
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 48px; }
.doc-sign div { border-top: 1px solid var(--ink); padding-top: 4px; font-size: var(--fs-sm); text-align: center; }
.doc-terms { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); white-space: pre-wrap; }
.check-box { display: inline-block; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: var(--radius-xs); vertical-align: middle; }
.print-bar { max-width: 960px; margin: 0 auto 12px; display: flex; gap: 8px; justify-content: flex-end; }
.sheet-mark { background: var(--gold); color: var(--ink); font-weight: 650; text-align: center; padding: 4px 8px; margin-bottom: 12px; border-radius: var(--radius-xs); font-size: var(--fs-sm); }
.sheet-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 3px solid var(--accent); padding-bottom: 12px; margin-bottom: 14px; }
.sheet-brand { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.sheet-brand svg { flex: none; }
.sheet-store { font-family: var(--display); font-size: var(--fs-2xl); letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }
.sheet-number { text-align: right; margin-left: auto; }
.sheet-kind { font-family: var(--display); font-weight: 400; font-size: var(--fs-2xl); letter-spacing: .03em; text-transform: uppercase; color: var(--accent); line-height: 1.1; }
.sheet-id { font-size: var(--fs-lg); font-weight: 680; }
.sheet-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.sheet-box { border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.sheet-box h3, .sheet-terms h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 6px; font-weight: 650; }
.sheet .sheet-n { width: 40px; color: var(--ink-3); }
.sheet-items td { padding-top: 7px; padding-bottom: 7px; }
.sheet-summary { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: 12px; flex-wrap: wrap; }
.sheet-summary .totals { width: min(310px, 100%); margin-left: auto; }
.sheet-notes { margin-top: 12px; font-size: var(--fs-md); overflow-wrap: anywhere; }
.sheet-alert { border: 2px solid var(--accent); border-radius: var(--radius-sm); color: var(--accent-2); font-weight: 700; text-align: center; padding: 8px 12px; margin: 14px 0 0; }
.sheet-terms { margin-top: 12px; }
.sheet-terms ul { margin: 0; padding-left: 18px; font-size: var(--fs-md); display: flex; flex-direction: column; gap: 3px; }
.sheet-foot { margin-top: 14px; text-align: center; font-size: var(--fs-sm); color: var(--ink-3); }

@media (max-width: 1080px) {
  .house-layout { grid-template-columns: minmax(0, 1fr); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor .side { position: static; }
}
@media (max-width: 820px) {
  html { font-size: 15px; }
  input, select, textarea { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 0; left: 0; width: 264px; height: auto; transform: translateX(-100%); transition: transform .18s ease; }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; background: var(--pine); color: var(--on-strong); padding: 8px 12px; }
  .topbar button { background: none; border: 0; color: inherit; padding: 6px; display: flex; cursor: pointer; }
  .topbar b { font-weight: 650; }
  .main { padding: 16px 16px 40px; }
  .form-grid .span-2 { grid-column: auto; }
  .columns { grid-template-columns: minmax(0, 1fr); }
  .doc { padding: 16px; }
  .doc-block { grid-template-columns: 1fr; }
  .sheet-boxes { grid-template-columns: 1fr; }
  .sheet-number { text-align: left; margin-left: 0; }
  .pick-item { grid-template-columns: minmax(0, 1fr); }
  .chart-plot, .chart-axis { margin-left: 54px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toasts { left: 16px; right: 16px; max-width: none; bottom: auto; top: 58px; }
  .demo-bar { padding: 6px 16px; }
}
@media print {
  @page { margin: 12mm; }
  body { background: var(--surface); }
  .sidebar, .topbar, .print-bar, .toasts, .no-print { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .doc { border: 0; padding: 0; max-width: none; border-radius: 0; }
  .doc table.data th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.data { page-break-inside: auto; }
  table.data tr { page-break-inside: avoid; }
  table.data thead { display: table-header-group; }
  .sheet-alert, .sheet-head, .sheet-mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet-summary, .sheet-terms, .doc-sign { page-break-inside: avoid; }
  .doc-sign { margin-top: 36px; }
}
table.data td.col-wide input { min-width: 250px; }

/* Boas-vindas depois do login */
.welcome { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; background: var(--pine); color: var(--pine-ink); text-align: center; cursor: pointer; transition: opacity .3s ease; animation: welcome-in .35s ease both; }
.welcome.leaving { opacity: 0; }
.welcome-hello { font-size: clamp(1.5rem, 4.5vw, 2.5rem); font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.welcome-call { font-family: var(--display); font-size: clamp(2.1rem, 7vw, 4.2rem); line-height: 1.1; letter-spacing: .01em; text-transform: uppercase; color: var(--gold); opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .45s ease; }
.welcome-call.show { opacity: 1; transform: none; }
.welcome-skip { position: absolute; bottom: 24px; color: var(--pine-muted); font-size: var(--fs-sm); }
@keyframes welcome-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .welcome, .welcome-call { animation: none; transition: none; }
}
@media print { .welcome { display: none; } }

/* Painel organizado por assunto */
.panel-section { display: flex; flex-direction: column; gap: 8px; }
.panel-section > h2 { font-size: var(--fs-base); font-weight: 650; color: var(--ink-2); margin: 0; }
.todo-list { display: flex; flex-direction: column; overflow: hidden; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 11px 15px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); min-width: 0; }
.todo-item:first-child { border-top: 0; }
.todo-item:hover { background: var(--surface-2); }
.todo-item.alert > svg:first-child { color: var(--bad); }
.todo-item.attention > svg:first-child { color: var(--warn); }
.todo-item > svg:last-child { color: var(--ink-3); flex: none; }

/* Fotos dos materiais */
.thumb { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); color: var(--line-2); vertical-align: middle; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.lg { width: 100%; height: 100%; border: 0; border-radius: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.photo-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.photo-card.drop { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.photo-open { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--surface-2); cursor: pointer; }
.photo-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.photo-card-body .row { margin-top: auto; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.photo-item { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.photo-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.danger-link { color: var(--bad); }
.progress-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress-line progress { flex: 1 1 180px; height: 8px; accent-color: var(--accent); }
.block { display: block; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check input { margin-top: 3px; flex: none; width: auto; }
.center { display: flex; justify-content: center; }
.photo-item .link-btn { color: var(--info); text-decoration: underline; }
.photo-item .link-btn.danger-link { color: var(--bad); }

/* Tela separada: vendedor, separação e entregas não têm menu */
.shell.simple { grid-template-columns: minmax(0, 1fr); }
.shell.simple .sidebar { display: none; }
.shell.simple .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; background: var(--pine); color: var(--pine-ink); padding: 10px 16px; }
.top-home { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.top-account { margin-left: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.top-account .link-btn { padding: 0; }
.shell.simple .topbar button.link-btn { display: inline; }
.top-name { font-size: var(--fs-sm); color: var(--pine-muted); }
.big-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.big-button { display: flex; flex-direction: column; gap: 6px; padding: 20px; min-height: 124px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; }
.big-button:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.big-button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-strong); }
.big-button.primary:hover { background: var(--accent-2); }
.big-button.attention { border-color: var(--warn-line); background: var(--warn-soft); }
.big-button.alert { border-color: var(--bad-line); background: var(--bad-soft); }
.big-label { font-size: var(--fs-lg); font-weight: 650; }
.big-sub { font-size: var(--fs-sm); color: var(--ink-3); }
.big-button.primary .big-sub { color: inherit; }

/* Meta da loja e foto da nota */
.goal { display: flex; flex-direction: column; gap: 8px; }
.goal progress { width: 100%; height: 10px; accent-color: var(--accent); }
.goal-count { font-size: var(--fs-lg); white-space: nowrap; }
.proof-box .photo-strip { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }

/* Ranking de pontos */
.points-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.points-list li { display: flex; gap: 10px; align-items: flex-start; }
.points-list li.mine { background: var(--surface-2); border-radius: var(--radius-sm); box-shadow: 0 0 0 6px var(--surface-2); }
.points-list progress { width: 100%; height: 8px; accent-color: var(--accent); }
.points-pos { font-weight: 650; min-width: 28px; color: var(--ink-3); }

/* Ponto */
.clock-card { align-items: stretch; text-align: center; }
.clock-now { font-size: 3rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; }
.clock-call { font-size: var(--fs-lg); font-weight: 620; }
.link-btn.dark { color: var(--ink-3); text-decoration: underline; align-self: center; }
.welcome-work { font-size: clamp(1.2rem, 3.5vw, 1.8rem); font-weight: 600; }
.welcome-time { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 650; letter-spacing: -.02em; }

/* Botão de olho nos campos de senha */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > input { padding-right: 42px; }
.pw-toggle { position: absolute; top: 0; right: 0; height: 100%; width: 40px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 0; min-height: 0; }
.pw-toggle:hover { color: var(--ink); }

/* Cadastro e termo do primeiro acesso */
.login.onboarding { align-items: flex-start; padding: 24px 16px; overflow-y: auto; }
.onboarding-card { width: min(720px, 100%); }
.onb-title { font-size: var(--fs-base); margin: 6px 0 0; }
.contract-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; max-height: 320px; overflow-y: auto; font-size: var(--fs-md); line-height: 1.5; }
.kv-list { display: grid; gap: 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.kv b { text-align: right; }

/* Consultar preços */
.price-list { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.price-values { text-align: right; white-space: nowrap; font-size: var(--fs-base); }
.bad-text { color: var(--bad); }
@media (max-width: 560px) { .price-row { flex-wrap: wrap; } .price-values { width: 100%; text-align: left; } }

/* Notas de venda */
.proof-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.proof-thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line-2); display: block; }

/* Folha de ponto */
.sign-line { display: inline-block; width: 140px; border-bottom: 1px solid var(--ink-3); height: 1em; }

/* Câmera do ponto */
.cam-modal { width: min(560px, 100%); }
.cam-video { width: 100%; max-height: 60vh; background: #000; border-radius: var(--radius-sm); transform: scaleX(-1); }

/* Consultar preços em grade */
.price-list, .price-row { display: none; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.product-card-head { display: flex; gap: 10px; align-items: center; }
.product-square { width: 64px; height: 64px; flex: none; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.product-square img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-square .thumb { border: 0; width: 100%; height: 100%; }
.option-list { display: flex; flex-direction: column; gap: 4px; }
.option-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "stock stock"; gap: 2px 8px; text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 6px 8px; font: inherit; color: inherit; cursor: pointer; }
.option-row:hover { border-color: var(--line-2); }
.option-name { grid-area: name; font-weight: 560; overflow-wrap: anywhere; }
.option-price { grid-area: price; font-weight: 650; white-space: nowrap; }
.option-price small { font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.option-stock { grid-area: stock; font-size: var(--fs-sm); }
.option-stock.tone-ok { color: var(--ok); }
.option-stock.tone-warn { color: var(--warn); }
.option-stock.tone-bad { color: var(--bad); font-weight: 600; }
.option-stock.tone-mute { color: var(--ink-3); }
.detail-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.detail-photo { width: 160px; height: 160px; flex: none; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.price-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.price-chip { border: 1px solid var(--line-2); border-radius: var(--radius); padding: 6px 10px; }

/* Assistente de orçamento */
.assist-row { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.assist-row.status-nao_achei { border-color: var(--bad-line); }
.assist-row.status-confirmar { border-color: var(--warn-line); }
.assist-raw { font-style: italic; color: var(--ink-2); }

.write-line { display: inline-block; width: 110px; border-bottom: 1px solid var(--ink-3); height: 1em; }

/* Escolher cliente no orçamento */
.picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 55vh; overflow-y: auto; margin-top: 8px; }
.picker-row { text-align: left; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; color: inherit; cursor: pointer; }
.picker-row:hover { border-color: var(--line-2); }

/* Impressões do RH */
.warning-reason { border: 1px solid var(--ink); border-radius: var(--radius-xs); padding: 10px 12px; margin: 12px 0; white-space: pre-wrap; font-size: var(--fs-md); }
.page-break { height: 24px; }
@media print { .page-break { page-break-after: always; height: 0; } }
[hidden] { display: none !important; }
.rh-item { display: grid; grid-template-columns: minmax(0, 1fr) 130px 80px 40px; gap: 8px; align-items: center; }
.rh-item input { width: 100%; }

/* Visão geral: pizza e barras em escada */
:root { --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-other: #a19a92; }
.section-title { font-size: var(--fs-base); margin: 10px 0 0; color: var(--ink-2); }
.viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.viz-grid > .card { margin: 0; }
.pie { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pie-svg { width: 170px; height: 170px; flex: 0 0 auto; }
.pie-slice { stroke: var(--surface); stroke-width: 2; transition: opacity .15s; cursor: default; outline: none; }
.pie-slice.dim { opacity: .3; }
.pie-center-val { font-size: 14px; font-weight: 700; fill: var(--ink); }
.pie-center-lbl { font-size: 11px; fill: var(--ink-3); }
.pie-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 180px; min-width: 0; display: grid; gap: 6px; }
.pie-row { display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 8px; font-size: var(--fs-md); transition: opacity .15s; }
.pie-row.dim { opacity: .45; }
.pie-key { width: 12px; height: 12px; border-radius: var(--radius-xs); margin-top: 4px; }
.pie-name { font-weight: 560; overflow-wrap: anywhere; }
.pie-val { grid-column: 2; color: var(--ink-2); font-size: var(--fs-sm); }
.stairs { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.stair { display: grid; grid-template-columns: minmax(80px, 30%) minmax(0, 1fr) 10.5em; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.stair-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stair-track { height: 14px; background: var(--surface-2); border-radius: var(--radius-xs); overflow: hidden; }
.stair-track i { display: block; height: 100%; background: var(--chart); opacity: .75; border-radius: 0 4px 4px 0; }
.stair-track i.top { opacity: 1; }
.stair:hover .stair-track i { opacity: 1; background: var(--chart-2); }
.stair-val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
@media (max-width: 520px) { .stair { grid-template-columns: minmax(0, 1fr) auto; } .stair-track { grid-column: 1 / -1; grid-row: 2; } }
.witness-note { margin-top: 28px; }
.center-note { text-align: center; }

/* Nota fiscal */
.fiscal-note { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fiscal-note:last-of-type { border-bottom: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.input-ncm { width: 8.5em; }
.input-short { width: 5em; }

/* Financeiro */
.fin-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.fin-tile.fin-bad .val { color: var(--bad); }
.fin-tile.fin-warn .val { color: var(--warn); }
.fin-tile.fin-ok .val { color: var(--ok); }
.fin-filters { align-items: flex-end; }
.text-bad { color: var(--bad); }

/* Segurança */
.sec-check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sec-check:last-child { border-bottom: 0; }
.sec-check > .badge { min-width: 70px; justify-content: center; text-align: center; }

/* Despesas */
.exp-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.exp-cat { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 10px 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.exp-cat:hover { border-color: var(--line-2); }
.exp-cat.active { border-color: var(--accent); color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.tabs .count { margin-left: 6px; background: var(--accent); color: var(--on-strong); border-radius: var(--radius-pill); font-size: var(--fs-xs); padding: 0 6px; }
.month-label { min-width: 150px; text-align: center; align-self: center; }
.fin-filters select { width: auto; }
.blank-field .opt { margin-right: 14px; white-space: nowrap; }
.blank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 6px 0 12px; }
.blank-field { display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.blank-field.wide { grid-column: 1 / -1; flex-wrap: wrap; }
.blank-line { flex: 1; border-bottom: 1px solid var(--ink-3); min-width: 60px; height: 1.1em; }
.check-box.checked { text-align: center; line-height: 14px; font-size: 12px; font-weight: 700; }
.glue-box { border: 2px dashed var(--ink-3); border-radius: var(--radius-sm); min-height: 300px; margin-top: 22px; padding: 10px 14px; display: flex; flex-direction: column; justify-content: space-between; }
.glue-box.small { min-height: 130px; margin-top: 10px; }
.glue-title { text-align: center; color: var(--ink-3); font-weight: 600; letter-spacing: .02em; }
.glue-checks { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.doc-sign.one { grid-template-columns: 1fr; max-width: 420px; margin-top: 36px; }
.doc-sign.tight { margin-top: 30px; }
.half-sheet .doc-head { margin-bottom: 8px; padding-bottom: 8px; }
.half-sheet .doc-head h2 { font-size: var(--fs-base); }
.cut-line { border-top: 1px dashed var(--ink-3); margin: 18px 0; text-align: center; font-size: var(--fs-xs); color: var(--ink-3); line-height: 0; }
.blank-table td { height: 30px; }
.blank-table td, .blank-table th { border: 1px solid #bbb; }
@media (max-width: 640px) { .blank-grid { grid-template-columns: 1fr; } }
@media print {
  .two-up .half-sheet { height: 128mm; overflow: hidden; }
  .cut-line { margin: 6px 0; }
  .glue-box { page-break-inside: avoid; }
  .blank-table td { height: 9.5mm; }
}
.voucher .doc-terms + p { margin-top: 10px; }
.rh-falta { display: grid; grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.rh-falta input, .rh-falta select { width: 100%; }
@media (max-width: 640px) { .rh-falta { grid-template-columns: 1fr 1fr; } }
.stub { margin-top: 22px; }
.stub-box { border: 1px solid var(--ink-3); border-radius: var(--radius-sm); padding: 10px 14px; display: grid; gap: 4px; }
.stub-sign { margin-top: 26px; }
@media print {
  .doc-falta { font-size: var(--fs-md); }
  .doc-falta .doc-sign { margin-top: 26px; }
  .doc-falta .doc-terms { margin-top: 8px; }
  .stub { page-break-inside: avoid; margin-top: 14px; }
}
@media print {
  .doc-falta table.data td, .doc-falta table.data th { padding-top: 4px; padding-bottom: 4px; }
  .doc-falta .doc-head { padding-bottom: 8px; margin-bottom: 10px; }
  .doc-falta .warning-reason { margin: 8px 0; padding: 6px 10px; }
  .doc-falta .witness-note { margin-top: 14px; }
  .doc-falta .stub-sign { margin-top: 20px; }
}

/* Exames ocupacionais */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }
.doc-sub { font-size: var(--fs-md); margin: 14px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.print-grid { font-size: var(--fs-md); }

/* Calendário de faltas */
.cal-wrap { overflow-x: auto; }
table.cal { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
.cal th, .cal td { border: 1px solid var(--line); text-align: center; padding: 0; height: 34px; min-width: 26px; }
.cal .cal-name { text-align: left; padding: 4px 10px; min-width: 170px; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.cal th.cal-day { font-weight: 600; line-height: 1.1; padding: 3px 0; }
.cal .cal-wd { font-size: var(--fs-2xs); color: var(--ink-3); font-weight: 500; }
.cal .cal-sun { color: var(--bad); }
.cal .cal-today { box-shadow: inset 0 -3px 0 var(--accent); }
.cal .cal-total { min-width: 56px; padding: 0 6px; }
.cal-off { background: repeating-linear-gradient(45deg, #f3f1ec, #f3f1ec 4px, #e9e6df 4px, #e9e6df 8px); }
.cal-future { background: #fafaf7; color: var(--ink-3); }
.cal-click { cursor: pointer; }
.cal-click:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell { font-weight: 700; }
.cal-injustificada { background: #f6d5d2; color: #8f1d14; }
.cal-justificada { background: #fbe7c2; color: #7a4b00; }
.cal-atestado { background: #d4e6f7; color: #0f4a80; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.cal-chip { display: inline-block; min-width: 22px; height: 20px; line-height: 20px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-xs); font-style: normal; font-weight: 700; }
@media print {
  table.cal { font-size: var(--fs-2xs); }
  .cal th, .cal td { height: 22px; min-width: 16px; }
  .cal .cal-name { min-width: 110px; padding: 2px 4px; }
  .cal-injustificada, .cal-justificada, .cal-atestado, .cal-off { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Check list da separação */
.pick-checklist { margin-top: 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 10px 14px; page-break-inside: avoid; }
.pick-checklist h3 { font-size: var(--fs-md); margin-bottom: 8px; }
.pick-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; font-size: var(--fs-sm); }
.pick-notes { display: flex; gap: 6px; margin-top: 12px; align-items: baseline; }
.sign-line.short { width: 80px; }
td.col-check, th.col-check { text-align: center; width: 70px; }
@media (max-width: 640px) { .pick-checks { grid-template-columns: 1fr; } }
.ficha-upload { align-items: flex-end; }
.ficha-upload input[type=file] { max-width: 280px; }
.freight-info:empty { display: none; }
.freight-info { border-left: 3px solid var(--accent); padding: 6px 10px; background: var(--surface); }
.text-warn { color: var(--warn); }
.check-box.big { width: 20px; height: 20px; }
.doc-sign.three { grid-template-columns: 1fr 1fr 1fr; gap: 24px; }

/* Pedido impresso compacto: cabe mais itens por folha */
.sheet.compact { padding: 18px 22px; font-size: var(--fs-sm); }
.sheet.compact .sheet-head { padding-bottom: 6px; margin-bottom: 8px; gap: 12px; border-bottom-width: 2px; }
.sheet.compact .sheet-store { font-size: var(--fs-base); }
.sheet.compact .sheet-kind { font-size: var(--fs-lg); }
.sheet.compact .sheet-id { font-size: var(--fs-md); }
.sheet.compact .small { font-size: var(--fs-xs); }
.sheet.compact .sheet-boxes { gap: 8px; margin-bottom: 8px; }
.sheet.compact .sheet-box { padding: 6px 9px; }
.sheet.compact .sheet-box h3, .sheet.compact .sheet-terms h3 { font-size: var(--fs-2xs); margin-bottom: 3px; }
.sheet.compact .stack-xs { gap: 1px; }
.sheet.compact table.data { font-size: var(--fs-sm); }
.sheet.compact table.data th { padding: 4px 6px; font-size: var(--fs-2xs); }
.sheet.compact .sheet-items td { padding: 3px 6px; }
.sheet.compact .cell-sub { font-size: var(--fs-2xs); }
.sheet.compact .sheet-summary { margin-top: 6px; gap: 12px; }
.sheet.compact .totals .line { padding: 2px 0; font-size: var(--fs-sm); }
.sheet.compact .totals .line.total { font-size: var(--fs-base); }
.sheet.compact .sheet-notes { margin-top: 6px; font-size: var(--fs-sm); }
.sheet.compact .sheet-alert { margin-top: 8px; padding: 4px 8px; font-size: var(--fs-xs); }
.sheet.compact .sheet-terms { margin-top: 6px; }
.sheet.compact .sheet-terms ul { font-size: var(--fs-xs); gap: 0; }
.sheet.compact .doc-sign { margin-top: 26px; gap: 28px; }
.sheet.compact .doc-sign div { font-size: var(--fs-xs); }
.sheet.compact .sheet-foot { margin-top: 6px; font-size: var(--fs-2xs); }
.totals .line.discount { color: var(--ok); font-weight: 650; }
/* Medida da peça: grande e em caixa, para 3,00 m não ser confundido com 3,50 m */
.piece-size { display: inline-block; font-weight: 800; font-size: 1.05em; border: 1.5px solid var(--ink); border-radius: var(--radius-xs); padding: 0 5px; letter-spacing: .02em; white-space: nowrap; }
.piece-dim { font-weight: 650; }
.piece-qty { font-size: 1.05em; }
table.data tr.band td { background: var(--band); }
@media print {
  @page { margin: 8mm; }
  table.data tr.band td { background: #f0eee6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet.compact .doc-sign { margin-top: 22px; }
}

/* Esqueleto de carregamento */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skeleton { animation: sk-in .2s .15s both; }
.sk-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; }
.sk-card { padding: 6px 16px; }
.sk-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.sk-row:last-child { border-bottom: 0; }
.sk { display: block; height: 12px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 50%, var(--line) 100%); background-size: 200% 100%; animation: sk-shine 1.3s linear infinite; }
.sk-short { width: 72px; flex: 0 0 auto; }
.sk-title { width: 240px; height: 22px; }
.sk-btn { width: 140px; height: 36px; border-radius: var(--radius-sm); }
@keyframes sk-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sk-shine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton, .sk { animation: none; } }
.list-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.sk-w0 { width: 38%; } .sk-w1 { width: 52%; } .sk-w2 { width: 44%; } .sk-w3 { width: 60%; } .sk-w4 { width: 34%; } .sk-w5 { width: 48%; }

/* Microfone do assistente */
.btn.recording { background: var(--accent); border-color: var(--accent); color: var(--on-strong); animation: rec-pulse 1.4s ease-in-out infinite; }
@keyframes rec-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 32, 43, .35); } 50% { box-shadow: 0 0 0 6px rgba(217, 32, 43, 0); } }
@media (prefers-reduced-motion: reduce) { .btn.recording { animation: none; } }
.voice-status { flex: 1 1 220px; }
