/* ==========================================================================
   Vostiq — design system enxuto
   Tinta escura + papel quente + acento "rosewood". Tipografia: Fraunces (marca) / Inter (UI).
   ========================================================================== */
:root {
    --ink: #1c1a22;
    --ink-2: #3a3644;
    --muted: #7b7584;
    --line: #e7e2dc;
    --line-2: #d8d1c8;
    --paper: #f7f4f0;
    --card: #ffffff;
    --accent: #a3485a;
    --accent-ink: #7f3243;
    --accent-soft: #f6e8eb;
    --ok: #2f7a55;
    --ok-soft: #e4f2ea;
    --warn: #a86a12;
    --warn-soft: #fbf0dc;
    --danger: #b3261e;
    --danger-soft: #fbe7e5;
    --info: #2f5f98;
    --info-soft: #e5eef8;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgba(28, 26, 34, .05), 0 4px 16px rgba(28, 26, 34, .05);
    --sidebar: 248px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --brand: "Fraunces", Georgia, serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-family: var(--brand); font-weight: 600; font-size: 26px; margin: 4px 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.upper { text-transform: uppercase; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.grow { flex: 1; }

/* ---------- Shell ---------- */
.boot, .loading { display: grid; place-items: center; min-height: 160px; }
.boot { min-height: 100vh; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--ink); color: #d9d4de; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 20; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; color: #fff; text-decoration: none !important; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: var(--brand); font-weight: 600; font-size: 18px; }
.brand-name { font-family: var(--brand); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.brand.big .brand-mark { width: 44px; height: 44px; font-size: 26px; border-radius: 12px; }
.brand.big .brand-name { font-size: 34px; color: #fff; }
.empresa { margin: 4px 12px 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(255,255,255,.06); display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #fff; }
.empresa span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empresa:hover { background: rgba(255,255,255,.1); }
.nav-section { text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: #8e8798; margin: 16px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: #d9d4de; text-decoration: none !important; font-size: 13.5px; }
.nav-item i { font-size: 15px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(163,72,90,.28); color: #fff; }
.nav-item.active i { color: #f0b9c4; opacity: 1; }
.user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.user-info { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.user-info strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info small { color: #8e8798; }
.user .btn-icon { color: #b8b0c2; }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.content { padding: 24px 32px 48px; max-width: 1400px; }
.topbar-mobile { display: none; }

/* ---------- Page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head.pad { padding: 14px 18px 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols-2.wide-left { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty i { font-size: 34px; display: block; margin-bottom: 8px; opacity: .6; }
.empty.sm { padding: 24px 16px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis.mini { grid-template-columns: repeat(4, 1fr); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none !important; }
.kpi small { color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; }
.kpi strong { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; }
.kpi.link:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.kpi.alert-kpi { border-color: #efc1bc; background: linear-gradient(180deg, #fff, var(--danger-soft)); }
.kpi.alert-kpi strong { color: var(--danger); }

/* ---------- Forms ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { background: #f3f0ec; color: var(--muted); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=color] { padding: 2px; height: 38px; }
input.sm { padding: 5px 7px; width: 90px; }
input.num { text-align: right; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.readonly { padding: 8px 10px; background: #f3f0ec; border-radius: var(--radius-sm); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.form-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.form-row.tight { margin: 6px 0 12px; }
.switch, .check { display: flex; align-items: center; gap: 8px; margin: 8px 0; cursor: pointer; user-select: none; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar select, .toolbar > input { width: auto; min-width: 170px; }
.search { position: relative; flex: 1; min-width: 240px; }
.search > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 34px; }
.search.sm { max-width: 260px; margin-bottom: 8px; }
.search.com-acao { display: flex; gap: 8px; align-items: center; }
.search.com-acao input { flex: 1; min-width: 0; }
.search.com-acao .btn { flex: none; white-space: nowrap; }
.input-action { display: flex; gap: 6px; }
.input-action > input { flex: 1; min-width: 0; }
.inline-inputs { display: inline-flex; align-items: center; gap: 6px; }
.inline-inputs input { width: 80px; }

/* ---------- Buttons ---------- */
.btn { font: inherit; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { background: #faf8f6; border-color: #c8c0b6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(28,26,34,.05); }
.btn-ghost.danger { color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }
.btn-icon { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--muted); font-size: 15px; line-height: 1; }
.btn-icon:hover { background: rgba(28,26,34,.06); color: var(--ink); }
.btn-icon.danger:hover { color: var(--danger); }
.link { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 0 4px; font: inherit; text-decoration: underline; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; }
.seg button { font: inherit; border: 0; background: #fff; padding: 7px 14px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--ink); color: #fff; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { font: inherit; border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- Chips / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: #f1ece6; color: var(--ink-2); font-size: 12px; border: 1px solid transparent; }
.chip.strong { background: var(--ink); color: #fff; }
.chip.toggle { cursor: pointer; font: inherit; font-size: 12.5px; padding: 5px 11px; background: #fff; border-color: var(--line-2); }
.chip.toggle.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; font-family: var(--font); letter-spacing: .01em; }
.badge.neutral { background: #eeeae5; color: var(--ink-2); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge.success { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.swatch { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); vertical-align: -2px; }
.swatch.lg { width: 34px; height: 34px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fcfbf9; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f0ece7; vertical-align: middle; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fbf9f7; }
.table tr.inativo td { opacity: .5; }
.table tr.row-alert td { background: #fff8f7; }
.table .thumb { width: 44px; }
.table .thumb img { width: 36px; height: 44px; object-fit: cover; border-radius: 4px; }
.table .thumb i { color: #cfc8bf; font-size: 20px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 10px; }
.pager .muted { margin-right: auto; }

/* ---------- Grade (matriz cor × tamanho) ---------- */
.grade-wrap { overflow-x: auto; margin: 6px 0 10px; }
.grade { border-collapse: separate; border-spacing: 0; min-width: 100%; font-variant-numeric: tabular-nums; }
.grade th, .grade td { border-bottom: 1px solid var(--line); border-right: 1px solid #f0ece7; padding: 8px 10px; text-align: center; }
.grade thead th { background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; position: sticky; top: 0; }
.grade thead th:first-child { border-top-left-radius: 8px; }
.grade thead th:last-child { border-top-right-radius: 8px; }
.grade .grade-corner { text-align: left; font-weight: 500; color: #bdb5c6; }
.grade .grade-row { text-align: left; white-space: nowrap; font-weight: 500; background: #fcfbf9; display: table-cell; }
.grade .grade-row .swatch { margin-right: 6px; }
.grade .grade-total { background: #f6f2ee; font-weight: 600; }
.grade tfoot th, .grade tfoot td { background: #f6f2ee; font-weight: 600; }
.grade-vazia { color: #d3ccc3; background: repeating-linear-gradient(45deg, #fff, #fff 4px, #faf7f4 4px, #faf7f4 8px); }
.grade-saldo strong { display: block; font-size: 15px; }
.grade-saldo small { color: var(--warn); font-size: 10.5px; }
.grade-saldo.baixo { background: var(--danger-soft); }
.grade-saldo.baixo strong { color: var(--danger); }
.grade-saldo.neg strong { color: var(--danger); }
.grade-saldo.inativo { opacity: .45; }
.grade-input { padding: 4px 6px !important; min-width: 70px; }
.grade-input input { width: 62px; text-align: center; padding: 6px 4px; border-color: var(--line); }
.grade-input.on { background: var(--accent-soft); }
.grade-input.on input { border-color: var(--accent); font-weight: 600; }
.grade-input small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.grade-input small.neg { color: var(--danger); }

/* ---------- Busca com dropdown ---------- */
.busca-produto { position: relative; }
.dropdown { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(28,26,34,.12); list-style: none; margin: 0; padding: 4px; max-height: 320px; overflow-y: auto; }
.dropdown li { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.dropdown li:hover { background: var(--accent-soft); }
.picked { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fcfbf9; }
.picked strong { flex: 1; }

/* ---------- Totais / pagamentos ---------- */
.totals dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0 0 10px; align-items: center; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals dd input.sm { width: 100px; }
.total-line { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 10px; border-top: 1px dashed var(--line-2); }
.total-line strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.total-line.pending strong { color: var(--warn); }
.total-line.ok strong { color: var(--ok); }
.pay-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0ece7; }
.pay-form { margin-top: 14px; }
.troco { background: var(--ok-soft); color: var(--ok); padding: 8px 12px; border-radius: var(--radius-sm); }

/* ---------- Tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.tiles.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tile { font: inherit; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.tile.left { align-items: flex-start; }
.tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.tile.inativo { opacity: .5; }

/* ---------- Alertas, modal, toasts ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); background: #f1ece6; margin-bottom: 14px; flex-wrap: wrap; }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.info { background: var(--info-soft); color: var(--info); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(28,26,34,.42); z-index: 50; }
.modal { position: fixed; z-index: 51; top: 6vh; left: 50%; transform: translateX(-50%); width: min(560px, 94vw); max-height: 88vh; display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(28,26,34,.25); }
.modal.wide { width: min(980px, 96vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fcfbf9; border-radius: 0 0 14px 14px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); cursor: pointer; animation: toast-in .2s ease-out; }
.toast.sucesso i { color: #8fd9b0; }
.toast.erro { background: #5b1611; }
.toast.erro i { color: #ffb4ab; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 8px 0; border-bottom: 1px solid #f0ece7; display: flex; gap: 10px; align-items: center; }

/* ---------- Gráfico de barras simples ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.bar-col:hover .bar { opacity: 1; }
.bar-col small { color: var(--muted); font-size: 10.5px; }

/* ---------- Telas públicas ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 1.1fr); }
.auth-side { background: var(--ink); color: #d9d4de; padding: 56px; display: flex; flex-direction: column; justify-content: center; gap: 18px; background-image: radial-gradient(circle at 80% 20%, rgba(163,72,90,.35), transparent 50%); }
.auth-tagline { font-family: var(--brand); font-size: 26px; line-height: 1.25; color: #fff; max-width: 420px; margin: 8px 0; }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-points i { color: #f0b9c4; margin-right: 8px; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box.wide { max-width: 620px; }
.auth-box h1 { font-size: 30px; }
.empresa-list { display: grid; gap: 10px; margin: 18px 0; }
.empresa-card { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius); cursor: pointer; }
.empresa-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
    .cols-2, .cols-2.wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .shell.menu-open .sidebar { transform: none; }
    .main { margin-left: 0; }
    .topbar-mobile { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
    .topbar-mobile .btn-icon { color: #fff; font-size: 22px; }
    .content { padding: 16px; }
    .form-grid, .form-grid.three { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .kpis.mini { grid-template-columns: 1fr 1fr; }
}

/* ---------- Impressão (pedido) ---------- */
@media print {
    .sidebar, .topbar-mobile, .actions, .toasts, .pay-form, .busca-produto, .btn, .btn-icon, .form-row { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .cols-2, .cols-2.wide-left { grid-template-columns: 1fr; }
    input, select, textarea { border: 0; padding: 0; background: none; }
    body { background: #fff; }
}

/* Expedição */
.steps { list-style: none; margin: 10px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: etapa; }
.steps li { counter-increment: etapa; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.steps li::before { content: counter(etapa); width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex: none; }
.steps li.done { color: var(--ok); }
.steps li.done::before { content: "¹3"; background: var(--ok-soft); border-color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now::before { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.romaneio-assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.romaneio-assinaturas div { border-top: 1px solid var(--ink); padding-top: 6px; font-size: 12px; text-align: center; }
.print-only { display: none; }
@media print {
  .print-only { display: block; }
  .no-print, .sidebar, .topbar-mobile, .toasts, .actions { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
}

/* Campo de documento (CPF/CNPJ) */
.hint { font-size: 11.5px; line-height: 1.3; color: var(--muted); }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }
input.invalido { border-color: var(--danger); }
.req::after { content: " *"; color: var(--danger); }
.dropdown li.acao { color: var(--accent-ink); font-weight: 500; }
.card.tinted { background: var(--bg-soft, #faf8f5); padding: 10px 12px; margin: 6px 0 10px; }
.cliente-resumo { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.cliente-resumo .chip { margin-left: 4px; }

/* ---- Compras, devolução, relatórios, etiquetas, recibo, relacionamento ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ico { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.timeline .corpo { flex: 1; min-width: 0; }
.timeline .corpo small { color: var(--muted); }
.timeline .valor { white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline .valor.neg { color: var(--danger); }
.bar { height: 8px; border-radius: 999px; background: #eeeae5; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.radio-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.radio-list label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; }
.radio-list label.on { border-color: var(--accent); background: var(--accent-soft); }
.radio-list small { display: block; color: var(--muted); }
.csv-box { width: 100%; min-height: 160px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
tr.rejeitada td { background: var(--danger-soft); }
.num.neg { color: var(--danger); }

/* Etiquetas: 50 x 30 mm na impressão */
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.etiqueta { width: 50mm; height: 30mm; box-sizing: border-box; border: 1px dashed var(--line-2); border-radius: 3px; padding: 1.5mm 2mm; background: #fff; color: #000; display: flex; flex-direction: column; overflow: hidden; break-inside: avoid; }
.etiqueta .nome { font-size: 8.5pt; font-weight: 700; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
.etiqueta .var { font-size: 7.5pt; }
.etiqueta .preco { font-size: 13pt; font-weight: 800; }
.etiqueta .ean { width: 100%; height: 9mm; margin-top: auto; }
.etiqueta .cod { font-size: 6.5pt; text-align: center; letter-spacing: .08em; }
@media print {
    .etiquetas { gap: 0; }
    .etiqueta { border: 0; border-radius: 0; page-break-after: always; margin: 0; }
    @page { margin: 4mm; }
}

/* Recibo nao fiscal (cupom) */
.recibo { max-width: 380px; margin: 0 auto; background: #fff; padding: 18px 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; color: #000; border: 1px solid var(--line); }
.recibo h1 { font-size: 15px; text-align: center; margin: 0 0 2px; }
.recibo .centro { text-align: center; }
.recibo hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.recibo table { width: 100%; border-collapse: collapse; }
.recibo td { padding: 1px 0; vertical-align: top; }
.recibo td.num { text-align: right; white-space: nowrap; }
.recibo .total td { font-weight: 700; font-size: 14px; }
@media print { .recibo { border: 0; max-width: none; padding: 0; } }

/* ---------- CRM: funil Kanban, semáforo, drawer 360º, Meu dia ---------- */
.crm-filtros .check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.crm-resumo { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.crm-resumo strong { color: var(--ink); }

.semaforo { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.semaforo i { font-size: 10px; }
.semaforo.verde { color: var(--ok); }
.semaforo.amarelo { color: #c98a00; }
.semaforo.vermelho { color: var(--danger); }

.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; scroll-snap-type: x proximity; }
.kcol { flex: 0 0 292px; background: #efeae3; border-radius: var(--radius); border-top: 3px solid var(--cor, var(--line-2)); display: flex; flex-direction: column; max-height: calc(100vh - 270px); min-height: 160px; scroll-snap-align: start; transition: background .12s, box-shadow .12s; }
.kcol.alvo { background: #e6dfd5; box-shadow: inset 0 0 0 2px var(--accent); }
.kcol > header { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.kcol .titulo { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.kcol .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--cor, var(--muted)); flex: none; }
.kcol .auto { color: var(--muted); font-size: 12px; }
.kcol .totais { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.kcol .totais .qtd { background: #fff; border-radius: 999px; padding: 0 8px; font-weight: 600; color: var(--ink-2); }
.kcards { padding: 0 8px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 60px; }
.kvazio { border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); padding: 18px 8px; text-align: center; font-size: 12px; color: var(--muted); }
.kcard { background: var(--card); border-radius: var(--radius-sm); padding: 10px 11px; box-shadow: var(--shadow); cursor: grab; border: 1px solid transparent; display: flex; flex-direction: column; gap: 5px; }
.kcard:hover, .kcard:focus-visible { border-color: var(--accent); outline: none; }
.kcard:active { cursor: grabbing; }
.kcard.arrastando { opacity: .4; transform: rotate(1.5deg); }
.kcard.encerrado { opacity: .75; cursor: pointer; }
.kcard .linha { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kcard .nome { font-size: 13.5px; line-height: 1.25; word-break: break-word; }
.kcard .sub { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.kcard .rodape { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.kcard .rodape .valor { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
.kcard .meta { display: inline-flex; gap: 7px; align-items: center; font-size: 11.5px; color: var(--muted); }
.kcard .meta .warn { color: var(--warn); }
.kcard .meta .danger { color: var(--danger); }
.kcard .meta .ok { color: var(--ok); }
.ktags { display: flex; gap: 4px; flex-wrap: wrap; }
.ktag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); margin: 0 4px 2px 0; font-weight: 600; }
.ktag .btn-icon { padding: 0; font-size: 12px; line-height: 1; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(28, 26, 34, .35); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--paper); z-index: 61; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(28, 26, 34, .18); animation: drawer-in .16s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px 12px; background: var(--card); border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0 0 3px; font-size: 18px; }
.drawer-body { padding: 14px 18px 40px; overflow-y: auto; flex: 1; }
.drawer-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.drawer-sec { background: var(--card); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.drawer-sec h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.drawer-sec.fim { background: transparent; box-shadow: none; padding: 0; }
.dados { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 13.5px; }
.dados dt { color: var(--muted); }
.dados dd { margin: 0; word-break: break-word; }
.etapas-linha { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.etapa-pill { font: inherit; font-size: 12px; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 4px 11px; cursor: pointer; color: var(--ink-2); }
.etapa-pill.on { background: var(--cor, var(--ink)); border-color: var(--cor, var(--ink)); color: #fff; font-weight: 600; }
.btn-wa { background: #1fa855; border-color: #1fa855; color: #fff; text-decoration: none; }
.btn-wa:hover { background: #178a45; color: #fff; }
.tarefas { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tarefas li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: #faf8f5; border-radius: var(--radius-sm); border-left: 3px solid var(--line-2); }
.tarefas li.atrasada { border-left-color: var(--danger); background: var(--danger-soft); }
.tarefas.grande li { padding: 10px 12px; }
.kpi.alerta strong { color: var(--danger); }
.meudia { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.meudia .card { margin-bottom: 14px; }
.meudia h2 { font-size: 15px; display: flex; gap: 8px; align-items: center; }
.fila { list-style: none; margin: 0; padding: 0; }
.fila li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.fila li:last-child { border-bottom: 0; }
.fila .grow { flex: 1; min-width: 0; }
.danger { color: var(--danger); }
.pad { padding: 0 16px; }

@media (max-width: 860px) {
    .meudia { grid-template-columns: 1fr; }
    .kcol { flex-basis: 84vw; max-height: none; }
    .dados { grid-template-columns: 100px 1fr; }
}
h1:focus { outline: none; } /* FocusOnNavigate foca o título ao navegar; sem anel de foco fora de campos */
input[type="color"] { width: 52px; min-width: 52px; height: 38px; padding: 3px; cursor: pointer; flex: none; }
.drawer .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
