/* =========================================================
   Universo da Madeira DF — Sistema de Propostas
   Tokens: Vinho (marca) · Cerne (madeira escura) · Cumaru (veio) · Cal (fundo)
   Tema: Admin.io (menu de ícones, barra superior, breadcrumbs, cards Material) nas cores da marca
   Tipos: Big Shoulders Display (títulos/números) · Open Sans (texto) · IBM Plex Mono (medidas/códigos)
   Assinatura: a trena — régua com marcações em cm.
   ========================================================= */
:root {
  --vinho: #6A2630;
  --vinho-2: #57202A;
  --vinho-escuro: #3E141B;
  --vinho-claro: #F4E9EA;
  --cerne: #1C1411;
  --cerne-2: #2A1F1B;
  --cerne-3: #3A2D27;
  --cumaru: #C4844A;
  --cumaru-escuro: #8E5527;
  --trena: #EBCB9E;
  --cal: #EFEEEC;
  --grafite: #34302D;
  --grafite-2: #2A2624;
  --papel: #FFFFFF;
  --tinta: #1E1A18;
  --tinta-2: #4A433F;
  --muted: #6F6762;
  --linha: #E3E1DD;
  --linha-2: #EEECE8;
  --pix: #0E7C6B;
  --pix-bg: #E2F2EE;
  --ok: #0E7C6B;
  --aviso: #A2620F;
  --aviso-bg: #FBF0DF;
  --erro: #B42318;
  --erro-bg: #FCECEA;
  --whats: #1F8F55;
  --r: 4px;
  --r-sm: 3px;
  --sombra: 0 1px 3px rgba(0, 0, 0, .10), 0 1px 2px rgba(0, 0, 0, .08);
  --f-display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --f-body: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15px/1.5 var(--f-body); color: var(--tinta); background: var(--cal); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: var(--vinho); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 3px solid var(--cumaru); outline-offset: 2px; border-radius: 4px; }
.ico { flex: none; }
.sr-only, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 10px; left: 10px; z-index: 99; background: #fff; padding: 10px 14px; border-radius: 4px; }
.mono { font-family: var(--f-mono); font-weight: 500; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Trena (assinatura) ---------- */
.ruler {
  --tick: rgba(30, 26, 24, .55);
  height: 14px; color: var(--tick);
  background:
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 8px) left bottom / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--tick) 0 1px, transparent 1px 40px) left bottom / 100% 9px no-repeat,
    repeating-linear-gradient(90deg, var(--tick) 0 1.5px, transparent 1.5px 80px) left bottom / 100% 14px no-repeat;
}
.ruler-light { --tick: rgba(235, 203, 158, .45); }
.ruler-vinho { --tick: rgba(106, 38, 48, .5); }

/* ---------- Estrutura (tema Admin.io adaptado à marca) ---------- */
.app { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-rows: auto auto 1fr; min-height: 100vh; }
.nav-min .app { grid-template-columns: 76px minmax(0, 1fr); }
.side {
  grid-row: 1 / span 3; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 40; scrollbar-width: none;
  display: flex; flex-direction: column; background: var(--grafite); color: #B9AFA7;
  box-shadow: 1px 0 3px rgba(0, 0, 0, .18);
}
.side::-webkit-scrollbar { display: none; }
.side-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 8px 18px; background: var(--grafite-2); color: #fff; text-align: center; }
.side-brand:hover { text-decoration: none; }
.brand-circle { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #F4EFE9; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.side-name { font-family: var(--f-display); font-weight: 800; font-size: 14px; line-height: 1; letter-spacing: .05em; text-transform: uppercase; color: #E9E1D9; }
.wordmark { font-family: var(--f-display); font-weight: 800; font-size: 19px; line-height: .95; letter-spacing: .03em; text-transform: uppercase; }
.wordmark small { display: inline-block; font-family: var(--f-mono); font-size: 10px; letter-spacing: .05em; padding: 2px 4px 1px; margin-left: 2px; border-radius: 3px; background: var(--vinho); color: #fff; vertical-align: 2px; }
.nav { display: flex; flex-direction: column; }
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 6px 16px; border-left: 3px solid transparent; color: #A69C94; font-size: 13px; text-align: center; transition: background .15s, color .15s; }
.nav a .ico { color: #E4DCD5; }
.nav a:hover { background: rgba(255, 255, 255, .04); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .07); border-left-color: var(--cumaru); color: #fff; }
.nav .badge { position: absolute; top: 10px; left: calc(50% + 8px); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #C62828; color: #fff; font: 700 11px/20px var(--f-body); text-align: center; }
.side-foot { margin-top: auto; padding: 8px 0 12px; }
.logout { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 14px 6px; border: 0; background: none; color: #A69C94; font-size: 13px; }
.logout:hover { color: #fff; background: rgba(255, 255, 255, .04); }
.nav-min .side-name, .nav-min .nav a span, .nav-min .logout span { display: none; }
.nav-min .brand-circle { width: 52px; height: 52px; }
.nav-min .brand-circle .brand-mark { width: 38px; height: 38px; }
.nav-min .nav .badge { left: calc(50% + 4px); }

.topbar { grid-column: 2; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 76px; padding-right: clamp(14px, 2.5vw, 32px); background: var(--papel); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .06); }
.topbar .square { display: grid; place-items: center; width: 56px; height: 44px; margin-right: 18px; border: 0; border-radius: 0 3px 3px 0; background: var(--vinho); color: #fff; box-shadow: 0 2px 5px rgba(106, 38, 48, .35); }
.topbar .square:hover { background: var(--vinho-2); }
.quick { display: flex; gap: 2px; }
.quick a { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: var(--vinho); transition: background .15s; }
.quick a:hover, .quick a.on { background: var(--vinho-claro); text-decoration: none; }
.quick .dot { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #C62828; color: #fff; font: 700 10.5px/18px var(--f-body); text-align: center; }
.top-brand { display: none; align-items: center; gap: 8px; color: var(--tinta); }
.top-brand:hover { text-decoration: none; }
.hello { margin-left: auto; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 28px; color: var(--muted); }
.hello:hover, .hello.on { background: var(--linha-2); text-decoration: none; }
.hello-text { text-align: right; font-size: 13.5px; line-height: 1.25; }
.hello-text strong { color: var(--tinta); font-weight: 600; }
.hello-text small { display: block; font-size: 11.5px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--vinho); color: #fff; font-weight: 700; flex: none; }
.crumbs { grid-column: 2; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 clamp(18px, 3vw, 40px); background: #E8E6E3; color: var(--muted); font-size: 13.5px; }
.crumbs a { color: var(--muted); display: inline-flex; }
.crumbs a:hover { color: var(--vinho); }
.crumbs .sep { color: #B9B3AD; }
.crumbs .cur { color: var(--tinta-2); }
.scrim { display: none; }
.main { grid-column: 2; padding: 28px clamp(18px, 3vw, 40px) 80px; min-width: 0; max-width: 1520px; width: 100%; }

/* ---------- Cabeçalho de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.page-head h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(32px, 4vw, 44px); line-height: .92; letter-spacing: .01em; text-transform: uppercase; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.section-title { font-family: var(--f-display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
  border: 1px solid #D6D2CD; border-radius: 3px; background: var(--papel); color: var(--tinta);
  font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { text-decoration: none; border-color: #CFCBC5; background: #FBFAF9; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--vinho); border-color: var(--vinho); color: #fff; box-shadow: 0 2px 5px rgba(106, 38, 48, .3); }
.btn.primary:hover { background: var(--vinho-2); border-color: var(--vinho-2); }
.btn.dark { background: var(--cerne); border-color: var(--cerne); color: #fff; }
.btn.pix { background: var(--pix); border-color: var(--pix); color: #fff; }
.btn.whats { background: var(--whats); border-color: var(--whats); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(30, 26, 24, .05); }
.btn.danger { color: var(--erro); }
.btn.danger:hover { background: var(--erro-bg); border-color: #F1C4BF; }
.btn.sm { height: 34px; padding: 0 11px; font-size: 12px; border-radius: 4px; }
.btn.lg { height: 54px; padding: 0 22px; font-size: 14.5px; border-radius: 4px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 42px; padding: 0; }
.btn.sm.icon-only { width: 34px; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 4px; background: transparent; color: inherit; }
.icon-btn.accent { background: var(--vinho); color: #fff; }

/* ---------- Cartões ---------- */
.card { background: var(--papel); border: 1px solid var(--linha); border-radius: var(--r); box-shadow: var(--sombra); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--linha-2); }
.card-head h2, .card-head h3 { font-size: 16px; font-weight: 700; }
.card-body { padding: 18px 22px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 13px; border: 1.5px solid var(--linha); border-radius: 4px;
  background: var(--papel); font-size: 15.5px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background: var(--papel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236F6762' stroke-width='1.8' fill='none'/%3E%3C/svg%3E") no-repeat right 13px center; }
.input:hover, .select:hover, .textarea:hover { border-color: #D2CEC8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--vinho); box-shadow: 0 0 0 4px rgba(106, 38, 48, .12); }
.input.invalid { border-color: var(--erro); box-shadow: 0 0 0 4px rgba(180, 35, 24, .1); }
.input.valid { border-color: var(--ok); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; height: 46px; margin-left: -1.5px; }
.input-affix { position: relative; }
.input-affix > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-affix .input { padding-left: 38px; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.c-12 { grid-column: span 12; } .c-8 { grid-column: span 8; } .c-6 { grid-column: span 6; } .c-5 { grid-column: span 5; }
.c-4 { grid-column: span 4; } .c-3 { grid-column: span 3; } .c-2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; user-select: none; }
.check input { width: 19px; height: 19px; accent-color: var(--vinho); }
.seg { display: inline-flex; padding: 3px; background: var(--linha-2); border-radius: 4px; gap: 2px; }
.seg button, .seg a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 0; background: none; padding: 7px 12px; border-radius: 4px; font-weight: 600; font-size: 13.5px; color: var(--tinta-2); }
.seg button.on, .seg a.on { background: var(--papel); color: var(--tinta); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg a:hover { text-decoration: none; }
.field-status { font-size: 12.5px; min-height: 18px; }
.field-status.ok { color: var(--ok); }
.field-status.erro { color: var(--erro); }

/* ---------- Alertas, pílulas, toasts ---------- */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; font-weight: 500; }
.alert.ok { background: var(--pix-bg); color: #0B5D50; }
.alert.erro { background: var(--erro-bg); color: var(--erro); }
.alert.aviso { background: var(--aviso-bg); color: #7A4A0C; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; background: var(--linha-2); color: var(--tinta-2); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.aberta { background: #EBEFF5; color: #2F4A70; }
.pill.aprovada { background: var(--pix-bg); color: #0B6B5C; }
.pill.recusada, .pill.cancelada { background: var(--erro-bg); color: var(--erro); }
.pill.expirada { background: var(--aviso-bg); color: var(--aviso); }
.pill.rascunho { background: transparent; color: var(--muted); border: 1.5px dashed #CFCAC3; }
.pill.novo { background: var(--vinho-claro); color: var(--vinho); }
.pill.convertido { background: var(--pix-bg); color: #0B6B5C; }
.pill.perdido { background: var(--linha-2); color: var(--muted); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 12px 16px; border-radius: 4px; background: var(--cerne); color: #fff; font-weight: 500; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .4); animation: toast-in .25s ease-out; }
.toast.erro { background: var(--erro); }
.toast.ok .ico { color: #7FE0C9; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 11px 14px; text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--linha); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--linha-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FBFAF8; }
.table .right { text-align: right; }
.table .strong { font-weight: 600; }
.row-link { color: var(--tinta); font-weight: 600; }
.cell-sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .ico { margin: 0 auto 12px; color: #BDB5AC; }
.empty strong { display: block; color: var(--tinta); font-size: 16px; margin-bottom: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--linha-2); }

/* ---------- Filtros ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .grow { flex: 1 1 240px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; border-bottom: 1px solid var(--linha); }
.tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--tinta); text-decoration: none; }
.tabs a.on { color: var(--vinho); border-color: var(--vinho); }
.tabs .count { font: 500 11.5px var(--f-mono); color: var(--muted); background: var(--linha-2); border-radius: 6px; padding: 1px 6px; }

/* ---------- Painel ---------- */
.kpis { display: grid; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { position: relative; padding: 18px 20px 20px; border-radius: var(--r); background: var(--papel); border: 1px solid var(--linha); box-shadow: var(--sombra); overflow: hidden; }
.kpi .label { display: block; font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi .value { display: block; margin-top: 10px; font-family: var(--f-display); font-weight: 800; font-size: 36px; line-height: 1; letter-spacing: .005em; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: .55em; font-weight: 700; margin-right: 3px; }
.kpi .sub { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); }
.kpi.hero { background: var(--vinho); border-color: var(--vinho); color: #fff; padding-bottom: 30px; }
.kpi.hero .label, .kpi.hero .sub { color: rgba(255, 255, 255, .72); }
.kpi.hero .value { font-size: 46px; }
.kpi.hero .ruler { position: absolute; left: 0; right: 0; bottom: 0; --tick: rgba(255, 255, 255, .35); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.chart { padding: 8px 18px 14px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .bar { fill: var(--vinho); }
.chart .bar:hover { fill: var(--cumaru-escuro); }
.chart .grid line { stroke: var(--linha-2); }
.chart text { font-family: var(--f-mono); font-size: 10.5px; fill: var(--muted); }
.top-list { list-style: none; margin: 0; padding: 6px 22px 16px; }
.top-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--linha-2); }
.top-list li:last-child { border-bottom: 0; }
.top-list .meter { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--linha-2); overflow: hidden; }
.top-list .meter i { display: block; height: 100%; background: var(--cumaru); border-radius: 3px; }
.period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.period form { display: flex; gap: 6px; align-items: center; }
.period .input { height: 38px; width: 150px; font-size: 14px; }

/* ---------- Montador de proposta ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.builder-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.step-title { display: flex; align-items: center; gap: 10px; }
.step-title h2 { font-family: var(--f-display); font-weight: 800; font-size: 21px; text-transform: uppercase; letter-spacing: .02em; }
.doc-switch { display: flex; gap: 10px; align-items: flex-start; }
.doc-switch .field { flex: 1; }
.client-found { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 4px; background: var(--pix-bg); color: #0B5D50; font-size: 13.5px; font-weight: 500; }
.client-search { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--papel); border: 1px solid var(--linha); border-radius: 4px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .25); overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; border-bottom: 1px solid var(--linha-2); }
.suggest button:hover, .suggest button.on { background: #F8F5F2; }
.suggest small { display: block; color: var(--muted); }
.more-toggle { border: 0; background: none; color: var(--vinho); font-weight: 600; padding: 4px 0; display: inline-flex; gap: 6px; align-items: center; }

.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cat-tab { display: flex; align-items: center; gap: 8px; flex: none; height: 42px; padding: 0 14px; border-radius: 21px; border: 1.5px solid var(--linha); background: var(--papel); font-weight: 600; font-size: 14px; color: var(--tinta-2); }
.cat-tab:hover { border-color: #CFC9C2; }
.cat-tab.on { background: var(--cerne); border-color: var(--cerne); color: #fff; }
.cat-tab .ico { opacity: .85; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.prod-card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 1.5px solid var(--linha); border-radius: 4px; background: var(--papel); overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s; }
.prod-card:hover { border-color: var(--cumaru); transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(28, 20, 17, .35); }
.prod-card.on { border-color: var(--vinho); box-shadow: 0 0 0 3px rgba(106, 38, 48, .15); }
.prod-card .thumb { aspect-ratio: 4 / 3; background: #6A2A2E; display: grid; place-items: center; overflow: hidden; }
.prod-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-card .thumb.contain img { object-fit: contain; padding: 6px; }
.prod-card .meta { padding: 10px 12px 12px; }
.prod-card .meta strong { display: block; font-size: 14px; line-height: 1.25; }
.prod-card .meta small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.search-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.search-row .input-affix { flex: 1; }
.search-row .input-affix .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-row .input-affix .input { padding-left: 42px; }

.config-panel { margin-top: 16px; border: 1.5px solid var(--cerne); border-radius: 4px; overflow: hidden; background: var(--papel); animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.config-head { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--cerne); color: #fff; }
.config-head img { width: 54px; height: 54px; border-radius: 4px; object-fit: cover; background: #6A2A2E; }
.config-head strong { display: block; font-size: 16px; }
.config-head small { color: #CBBFB4; }
.config-head .btn { margin-left: auto; color: #fff; }
.config-body { padding: 18px 16px; display: flex; flex-direction: column; gap: 18px; }
.opt-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--tinta-2); }
.opt-label .mono { font-size: 11px; color: var(--muted); font-weight: 500; }

/* Trena — seletor de medidas */
.trena { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(58px, 1fr); border-radius: 6px; background: var(--trena); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 1px 0 rgba(0, 0, 0, .05); overflow-x: auto; scrollbar-width: thin; }
.trena button {
  position: relative; height: 80px; border: 0; border-right: 1px solid rgba(30, 26, 24, .35); background:
    repeating-linear-gradient(90deg, rgba(30, 26, 24, .55) 0 1px, transparent 1px 10%) left top / 100% 9px no-repeat,
    linear-gradient(90deg, rgba(30, 26, 24, .7) 0 1px, transparent 1px) 50% top / 1px 15px no-repeat;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 4px 9px; color: var(--cerne);
}
.trena button:last-child { border-right: 0; }
.trena button b { font-family: var(--f-mono); font-weight: 500; font-size: 17px; letter-spacing: -.02em; line-height: 1; }
.trena button small { font-family: var(--f-mono); font-size: 10px; opacity: .7; margin-top: 3px; }
.trena button:hover { background-color: rgba(255, 255, 255, .35); }
.trena button.on { background-color: var(--vinho); color: #fff; }
.trena button.on::after { content: ''; position: absolute; left: 50%; bottom: -1px; transform: translateX(-50%); border: 7px solid transparent; border-bottom-color: var(--papel); }
.trena button .price { position: absolute; top: 18px; left: 0; right: 0; font: 600 10.5px var(--f-body); opacity: .75; }
.trena button.zero .price { color: var(--erro); opacity: 1; }
.trena button.on.zero .price { color: #FFD3CE; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 1.5px solid var(--linha); border-radius: 19px; background: var(--papel); font-weight: 600; font-size: 13.5px; }
.chip:hover { border-color: #CEC8C0; }
.chip.on { border-color: var(--vinho); background: var(--vinho-claro); color: var(--vinho); }
.chip .sw { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); flex: none; }
.chip small { color: var(--muted); font-weight: 500; }
.config-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 14px 16px; border-top: 1px solid var(--linha-2); background: #FBFAF8; }
.config-foot .field { width: 140px; }
.config-foot .price-preview { margin-left: auto; text-align: right; }
.config-foot .price-preview small { display: block; color: var(--muted); font-size: 12px; }
.config-foot .price-preview strong { font-family: var(--f-display); font-size: 28px; font-weight: 800; }
.stepper { display: flex; height: 46px; border: 1.5px solid var(--linha); border-radius: 4px; overflow: hidden; background: var(--papel); }
.stepper button { width: 40px; border: 0; background: #F6F4F1; font-size: 20px; font-weight: 600; color: var(--tinta-2); }
.stepper input { width: 100%; min-width: 0; border: 0; text-align: center; font: 600 16px var(--f-body); font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: none; }
.area-calc { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px; border-radius: 4px; background: #F7F3EE; }
.area-calc .field { width: 120px; }
.area-calc .eq { font-family: var(--f-mono); color: var(--muted); padding-bottom: 12px; }

.items-table td { vertical-align: top; }
.items-table .desc { width: 100%; min-width: 220px; }
.items-table .code { font-family: var(--f-mono); font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.items-table textarea { width: 100%; border: 1.5px solid transparent; border-radius: 4px; padding: 6px 8px; margin: -7px -9px; resize: none; background: transparent; font-weight: 600; line-height: 1.35; overflow: hidden; }
.items-table textarea:hover { border-color: var(--linha); }
.items-table textarea:focus { outline: none; border-color: var(--vinho); background: var(--papel); }
.items-table .qty, .items-table .price { width: 108px; height: 38px; padding: 0 9px; border: 1.5px solid var(--linha); border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.items-table .qty:focus, .items-table .price:focus { outline: none; border-color: var(--vinho); }
.items-table .price.zero { border-color: #E9A39B; background: var(--erro-bg); }
.items-table .unit { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); text-align: right; }
.items-table .line-total { font-weight: 700; white-space: nowrap; padding-top: 22px; }
.items-table .tools { white-space: nowrap; padding-top: 16px; }
.items-empty { display: flex; align-items: center; gap: 14px; padding: 22px; color: var(--muted); }
.items-foot { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--linha-2); }
.snippets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.snippets button { border: 1px dashed #CDC6BD; background: #FBF9F6; border-radius: 4px; padding: 5px 10px; font-size: 12.5px; color: var(--tinta-2); text-align: left; }
.snippets button:hover { border-color: var(--cumaru); background: #FFF; }

.summary { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.summary-card { background: var(--cerne); color: #EDE5DD; border-radius: 4px; overflow: hidden; box-shadow: 0 20px 40px -24px rgba(28, 20, 17, .6); }
.summary-card .top { padding: 20px 20px 16px; }
.summary-card .line { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 14px; color: #CDBFB3; }
.summary-card .line b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.summary-card .discount { display: flex; gap: 6px; margin: 8px 0 6px; }
.summary-card .discount .seg { background: rgba(255, 255, 255, .08); }
.summary-card .discount .seg button { color: #CDBFB3; padding: 7px 10px; }
.summary-card .discount .seg button.on { background: #fff; color: var(--cerne); }
.summary-card .discount input { flex: 1; min-width: 0; height: 38px; border-radius: 4px; border: 1.5px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06); color: #fff; padding: 0 10px; text-align: right; font-variant-numeric: tabular-nums; }
.summary-card .discount input:focus { outline: none; border-color: var(--cumaru); }
.pix-total { padding: 18px 20px 20px; background: var(--vinho); position: relative; }
.pix-total .label { display: flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.pix-total .value { display: block; margin-top: 6px; font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.pix-total .ruler { position: absolute; left: 0; right: 0; bottom: 0; --tick: rgba(255, 255, 255, .3); height: 10px; }
.installments { padding: 14px 20px 18px; }
.installments .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.installments .head span { display: flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #A99B8F; }
.installments .head select { height: 30px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .18); background: var(--cerne-2); color: #fff; padding: 0 6px; font-size: 13px; }
.inst-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; font-size: 13px; }
.inst-list div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px dashed rgba(255, 255, 255, .08); color: #CDBFB3; font-variant-numeric: tabular-nums; }
.inst-list b { color: #fff; font-weight: 600; }
.inst-off { color: #A99B8F; font-size: 13px; }
.summary .btn.lg { height: 56px; }
.summary .save-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.validity-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.validity-chips button { white-space: nowrap; border: 1px solid var(--linha); background: var(--papel); border-radius: 7px; padding: 3px 8px; font: 500 12px var(--f-mono); color: var(--tinta-2); }
.validity-chips button.on { border-color: var(--vinho); color: var(--vinho); background: var(--vinho-claro); }
.mobile-bar { display: none; }

.items-table tr.flash td { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { background: #FBEBD8; } 100% { background: transparent; } }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; padding: 7px 10px; border-radius: 4px; background: var(--cerne); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .4); }

/* ---------- Visualização da proposta (interno) ---------- */
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.doc-toolbar .spacer { flex: 1; }
.status-strip { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; padding: 14px 18px; margin-bottom: 18px; border-radius: 4px; background: var(--papel); border: 1px solid var(--linha); }
.status-strip .item { display: flex; flex-direction: column; gap: 2px; }
.status-strip .item small { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.status-strip .item b { font-weight: 600; }
.doc-frame { background: #E7E4DF; border-radius: 4px; padding: clamp(10px, 3vw, 36px); }

/* ---------- Produtos ---------- */
.products-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.cat-list { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.cat-list button { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border: 0; border-radius: 4px; background: none; text-align: left; font-weight: 600; color: var(--tinta-2); }
.cat-list button:hover { background: #F6F3EF; }
.cat-list button.on { background: var(--cerne); color: #fff; }
.cat-list button .n { margin-left: auto; font: 500 11.5px var(--f-mono); opacity: .7; }
.cat-list .add-cat { color: var(--vinho); margin-top: 6px; border-top: 1px solid var(--linha-2); border-radius: 0 0 9px 9px; padding-top: 12px; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; border-radius: 4px; background: var(--papel); border: 1px solid var(--linha); overflow: hidden; box-shadow: var(--sombra); transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -18px rgba(28, 20, 17, .45); }
.pcard.off { opacity: .6; }
.pcard .thumb { position: relative; aspect-ratio: 16 / 11; background: #6A2A2E; overflow: hidden; border: 0; padding: 0; width: 100%; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pcard .thumb .tag { position: absolute; left: 10px; top: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(28, 20, 17, .78); color: #fff; font: 500 11px var(--f-mono); letter-spacing: .04em; }
.pcard .thumb .tag.off { background: var(--erro); }
.pcard .body { padding: 14px 16px 12px; flex: 1; }
.pcard h3 { font-size: 16px; font-weight: 700; }
.pcard .brand-line { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.pcard .sizes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.pcard .sizes span { font: 500 11.5px var(--f-mono); padding: 3px 6px; border-radius: 5px; background: #F4EFE8; color: var(--tinta-2); }
.pcard .sizes span.zero { background: var(--erro-bg); color: var(--erro); }
.pcard .price-range { margin-top: 10px; font-weight: 700; }
.pcard .foot { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--linha-2); }
.pcard .foot .btn { flex: 1; }
.pcard.add { align-items: center; justify-content: center; min-height: 280px; border: 2px dashed #D5CFC7; background: transparent; box-shadow: none; color: var(--vinho); font-weight: 700; gap: 10px; }
.pcard.add:hover { border-color: var(--vinho); background: #fff; }
.price-table input { width: 120px; height: 36px; padding: 0 9px; border: 1.5px solid transparent; border-radius: 4px; background: #F7F5F2; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.price-table input.code-in { width: 130px; text-align: left; font: 500 13px var(--f-mono); }
.price-table input:hover { border-color: var(--linha); }
.price-table input:focus { outline: none; border-color: var(--vinho); background: #fff; }
.price-table input.saved { border-color: var(--ok); background: var(--pix-bg); }
.price-table input.zero { background: var(--erro-bg); }
.price-table .group td { background: #F6F3EF; font-weight: 700; padding: 9px 14px; }

/* Editor de produto */
.editor-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 22px; }
.dropzone { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; border: 2px dashed #D3CCC3; border-radius: 4px; background: #FAF8F5; text-align: center; color: var(--muted); overflow: hidden; cursor: pointer; }
.dropzone.drag { border-color: var(--vinho); background: var(--vinho-claro); }
.dropzone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone .dz-text { padding: 16px; font-size: 13.5px; }
.dropzone .dz-text .ico { margin: 0 auto 8px; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.var-table td { padding: 6px 6px; }
.var-table input { width: 100%; height: 38px; padding: 0 9px; border: 1.5px solid var(--linha); border-radius: 4px; }
.var-table input:focus { outline: none; border-color: var(--vinho); }
.var-table .code-in { font: 500 13.5px var(--f-mono); text-transform: uppercase; }
.var-table .price-in { text-align: right; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-group { border: 1px solid var(--linha); border-radius: 4px; padding: 12px; background: #FCFBFA; }
.opt-group + .opt-group { margin-top: 10px; }
.opt-group .head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.opt-group .head .input { height: 38px; font-weight: 600; }
.opt-vals { display: flex; flex-direction: column; gap: 6px; }
.opt-val { display: grid; grid-template-columns: 34px minmax(0, 1fr) 120px 34px; gap: 6px; align-items: center; }
.opt-val.no-color { grid-template-columns: minmax(0, 1fr) 120px 34px; }
.opt-val input[type="color"] { width: 34px; height: 34px; padding: 0; border: 1px solid var(--linha); border-radius: 4px; background: none; }
.opt-val .input { height: 36px; font-size: 14px; }

/* ---------- Diálogos ---------- */
.modal { width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 4px; background: var(--papel); color: var(--tinta); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.modal.wide { width: min(1040px, calc(100vw - 24px)); }
.modal.narrow { width: min(460px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(28, 20, 17, .55); backdrop-filter: blur(3px); }
.modal[open] { display: flex; flex-direction: column; animation: rise .2s ease-out; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--linha-2); }
.modal-head h2 { font-family: var(--f-display); font-weight: 800; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--linha-2); background: #FBFAF8; }
.modal-foot .left { margin-right: auto; }

/* ---------- Configurações ---------- */
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.rates-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.rate-cell { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px solid var(--linha); border-radius: 4px; background: #FCFBFA; }
.rate-cell label { font: 500 11.5px var(--f-mono); color: var(--muted); }
.rate-cell .input-affix span { left: auto; right: 10px; }
.rate-cell .input { height: 38px; padding: 0 26px 0 10px; text-align: right; font-weight: 600; }
.rate-cell .sim { font-size: 12px; color: var(--tinta-2); font-variant-numeric: tabular-nums; }
.users-list .table td { padding: 11px 14px; }

/* =========================================================
   Login
   ========================================================= */
.auth-body { background: var(--cerne); color: #EFE7DF; min-height: 100vh; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, 540px); min-height: 100vh; }
.auth-stage { position: relative; overflow: hidden; background: #2A1F1B; }
.auth-stage .slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transform: scale(1.06); transition: opacity 1.6s ease, transform 9s linear; }
.auth-stage .slide.on { opacity: 1; transform: scale(1); }
.auth-stage::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(28, 20, 17, .15) 0%, rgba(28, 20, 17, 0) 35%, rgba(28, 20, 17, .82) 100%), linear-gradient(90deg, rgba(28, 20, 17, 0) 70%, rgba(28, 20, 17, .45)); }
.auth-copy { position: absolute; left: clamp(24px, 5vw, 64px); right: clamp(24px, 5vw, 64px); bottom: clamp(28px, 6vh, 64px); z-index: 2; }
.auth-copy .kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--trena); }
.auth-copy h2 { margin-top: 12px; font-family: var(--f-display); font-weight: 800; font-size: clamp(44px, 6.2vw, 96px); line-height: .86; text-transform: uppercase; letter-spacing: .005em; color: #fff; max-width: 11ch; }
.auth-copy h2 em { font-style: normal; color: var(--trena); }
.auth-copy .caption { display: flex; gap: 18px; align-items: center; margin-top: 22px; font-family: var(--f-mono); font-size: 12.5px; color: rgba(255, 255, 255, .75); }
.auth-copy .dots { display: flex; gap: 6px; }
.auth-copy .dots i { width: 22px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); transition: background .4s; }
.auth-copy .dots i.on { background: var(--trena); }
.auth-panel { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(28px, 4.5vw, 64px); background: var(--cerne); }
.auth-panel::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 16px; --tick: rgba(235, 203, 158, .4);
  background:
    repeating-linear-gradient(180deg, var(--tick) 0 1px, transparent 1px 8px) left top / 6px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--tick) 0 1px, transparent 1px 40px) left top / 10px 100% no-repeat,
    repeating-linear-gradient(180deg, var(--trena) 0 1.5px, transparent 1.5px 80px) left top / 16px 100% no-repeat;
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.auth-brand .wordmark { font-size: 25px; color: #fff; }
.auth-brand .sys { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: #A99B8F; margin-top: 6px; text-transform: uppercase; }
.auth h1 { font-family: var(--f-display); font-weight: 800; font-size: 54px; line-height: .9; text-transform: uppercase; color: #fff; }
.auth .lead { margin: 12px 0 28px; color: #B9ADA2; font-size: 16px; max-width: 38ch; }
.auth form { display: flex; flex-direction: column; gap: 18px; }
.auth .field > label { color: #D8CDC3; font-size: 14px; }
.auth .input { height: 62px; padding: 0 18px; font-size: 18px; border-radius: 13px; border: 1.5px solid #4A3B34; background: #261C18; color: #fff; }
.auth .input::placeholder { color: #8C7F75; }
.auth .input:hover { border-color: #5C4A41; }
.auth .input:focus { border-color: var(--trena); box-shadow: 0 0 0 4px rgba(235, 203, 158, .14); }
.auth .pass-wrap { position: relative; }
.auth .pass-wrap .input { padding-right: 60px; }
.auth .pass-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border: 0; border-radius: 10px; background: none; color: #B9ADA2; display: grid; place-items: center; }
.auth .pass-toggle:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.captcha-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: center; }
.captcha-img { width: 160px; height: 62px; border-radius: 12px; background: #F6F1EA; object-fit: cover; }
.captcha-refresh { width: 46px; height: 62px; border: 1.5px solid #4A3B34; border-radius: 12px; background: #261C18; color: #D8CDC3; display: grid; place-items: center; }
.captcha-refresh:hover { border-color: var(--trena); color: #fff; }
.auth .captcha .input { text-transform: uppercase; letter-spacing: .25em; font-family: var(--f-mono); font-weight: 500; }
.auth .row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.auth .check { color: #D8CDC3; }
.auth .check input { accent-color: var(--trena); }
.auth a { color: var(--trena); font-weight: 600; }
.auth .btn.primary { height: 62px; border-radius: 13px; font-size: 17px; background: var(--vinho); border-color: var(--vinho); }
.auth .btn.primary:hover { background: #7A2D38; }
.auth .alert { margin: 0; }
.auth .alert.erro { background: rgba(180, 35, 24, .16); color: #FFC9C2; }
.auth .alert.ok { background: rgba(14, 124, 107, .2); color: #A7EBDC; }
.auth-foot { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--f-mono); font-size: 11.5px; color: #8C7F75; }

/* =========================================================
   Responsivo
   ========================================================= */
@media (max-width: 1240px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi.hero { grid-column: span 3; }
  .builder { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1060px) {
  .dash-grid { grid-template-columns: 1fr; }
  .builder { grid-template-columns: 1fr; }
  .summary { position: static; }
  .products-layout { grid-template-columns: 1fr; }
  .cat-list { position: static; flex-direction: row; overflow-x: auto; }
  .cat-list button { flex: none; }
  .cat-list .add-cat { border-top: 0; margin-top: 0; padding-top: 10px; }
  .rates-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-stage { min-height: 38vh; }
  .auth-copy h2 { font-size: clamp(38px, 9vw, 64px); }
  .auth-panel::before { display: none; }
}
@media (max-width: 980px) {
  .app, .nav-min .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 150px; transform: translateX(-100%); transition: transform .25s ease; }
  .menu-open .side { transform: none; }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(28, 20, 17, .5); }
  .nav-min .nav a span, .nav-min .logout span { display: inline; }
  .nav-min .side-name { display: block; }
  .nav-min .brand-circle { width: 84px; height: 84px; }
  .nav-min .brand-circle .brand-mark { width: 58px; height: 58px; }
  .topbar, .crumbs, .main { grid-column: 1; }
  .topbar { height: 62px; gap: 4px; padding-right: 8px; }
  .topbar .square { width: 48px; height: 40px; margin-right: 4px; }
  .quick a:not(:first-child) { display: none; }
  .top-brand { display: flex; margin-right: auto; }
  .top-brand .wordmark { font-size: 16px; }
  .hello { margin-left: 0; padding: 4px; }
  .hello-text { display: none; }
  .crumbs { min-height: 40px; font-size: 12.5px; }
  .main { padding-top: 20px; }
  .editor-grid { grid-template-columns: 1fr; }
  .dropzone { aspect-ratio: 16 / 9; max-height: 220px; }
}
@media (max-width: 720px) {
  .period, .period form { width: 100%; flex-wrap: wrap; }
  .period .input { flex: 1 1 130px; width: auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi.hero { grid-column: span 2; }
  .kpi .value { font-size: 28px; }
  .kpi.hero .value { font-size: 38px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: span 12; }
  .form-grid > .c-3, .form-grid > .c-2 { grid-column: span 6; }
  .rates-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--linha-2); }
  .items-table td { padding: 0; border: 0; }
  .items-table td.desc { grid-column: 1 / -1; }
  .items-table .line-total, .items-table .tools { padding-top: 6px; }
  .items-table textarea { margin: 0; }
  .summary-card .pix-total .value { font-size: 40px; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; gap: 10px; align-items: center; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--cerne); color: #fff; box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, .4); }
  .mobile-bar .t { flex: 1; }
  .mobile-bar small { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: #A99B8F; text-transform: uppercase; }
  .mobile-bar strong { font-family: var(--f-display); font-size: 26px; font-weight: 800; }
  .builder-page .main { padding-bottom: 110px; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--linha-2); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .table.responsive td::before { content: attr(data-th); font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
  .table.responsive td.primary-cell { display: block; text-align: left; margin-bottom: 4px; }
  .table.responsive td.primary-cell::before { content: none; }
  .auth-panel { padding: 32px 22px 40px; }
  .auth h1 { font-size: 44px; }
  .auth-brand { margin-bottom: 26px; }
  .captcha-row { grid-template-columns: minmax(0, 1fr) auto; }
  .captcha-img { width: 100%; max-width: 220px; }
  .captcha-row .input { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .auth-stage .slide { transform: none; }
}
