/* Nuvê — sistema. Tokens: tinta, papel e as três cores de processo (ciano, magenta, amarelo). */
:root {
  --ink: #172033;
  --ink-2: #4b5567;
  --ink-3: #7a8396;
  --paper: #f5f6f8;
  --surface: #ffffff;
  --line: #dfe3ea;
  --line-2: #eceff3;
  --cyan: #0089c7;
  --cyan-d: #006b9c;
  --cyan-l: #e3f3fb;
  --magenta: #c9166b;
  --magenta-l: #fbe7f0;
  --yellow: #f0b800;
  --yellow-l: #fdf5d9;
  --green: #12805a;
  --green-l: #e2f4ec;
  --red: #c42f28;
  --red-l: #fbe9e8;
  --radius: 10px;
  --radius-s: 6px;
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
  --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--cyan-d); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px 8px 18px; }
.brand-name { font-family: var(--display); font-weight: 750; font-size: 1.35rem; letter-spacing: -.02em; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: .8rem; color: var(--ink-3); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: .95rem; }
.nav a:hover { background: var(--paper); }
.nav a.on { background: var(--cyan-l); color: var(--cyan-d); font-weight: 700; }
.nav a .lock, .nav a .tag { margin-left: auto; font-size: .72rem; padding: 1px 6px; border-radius: 99px; }
.nav a .lock { background: var(--yellow-l); color: #7a5b00; }
.nav a .tag { background: var(--magenta-l); color: var(--magenta); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .92rem; }
.top .emp { font-weight: 700; }
.top .menu-btn { display: none; }
.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-2); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.banner { padding: 10px 28px; font-size: .92rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner-trial { background: var(--yellow-l); color: #5e4600; border-bottom: 1px solid #f1e2a8; }
.banner-imp { background: var(--magenta); color: #fff; }
.banner-imp a { color: #fff; font-weight: 700; }

/* ---------- Blocos ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.panel > h2:first-child, .panel > h3:first-child { margin-bottom: 12px; }
.panel-flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

.figure { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.figure .label { color: var(--ink-2); font-size: .88rem; }
.figure .value { font-family: var(--display); font-size: 1.6rem; font-weight: 700; margin-top: 2px; }
.figure .hint { font-size: .82rem; color: var(--ink-3); }
.figure.c { border-top: 3px solid var(--cyan); }
.figure.m { border-top: 3px solid var(--magenta); }
.figure.y { border-top: 3px solid var(--yellow); }
.figure.k { border-top: 3px solid var(--ink); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: .93rem; }
.t th { text-align: left; font-weight: 700; color: var(--ink-2); font-size: .82rem; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #fafcfe; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tfoot td { font-weight: 700; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 34px 16px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- Formulários ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: .88rem; font-weight: 700; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); font-size: .93rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #cfd5df; border-radius: var(--radius-s); padding: 9px 11px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--cyan); transform: scale(1.1); }
input[type=color] { padding: 2px; height: 38px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-l); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.help { font-weight: 400; font-size: .8rem; color: var(--ink-3); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--display); }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 700; font-size: .93rem; padding: 9px 16px; border-radius: var(--radius-s); border: 1px solid #cfd5df; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--paper); }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn-primary:hover { background: var(--cyan-d); border-color: var(--cyan-d); }
.btn-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ink:hover { background: #0e1524; }
.btn-danger { color: var(--red); border-color: #e9b5b2; }
.btn-danger:hover { background: var(--red-l); }
.btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn-s { padding: 6px 10px; font-size: .85rem; }
.btn-l { padding: 13px 20px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--cyan-d); cursor: pointer; text-decoration: underline; }

/* ---------- Selos ---------- */
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.b-ok { background: var(--green-l); color: var(--green); }
.b-warn { background: var(--yellow-l); color: #7a5b00; }
.b-err { background: var(--red-l); color: var(--red); }
.b-info { background: var(--cyan-l); color: var(--cyan-d); }
.b-mag { background: var(--magenta-l); color: var(--magenta); }

/* ---------- Avisos ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-s); margin-bottom: 14px; font-size: .93rem; border: 1px solid; }
.alert-ok { background: var(--green-l); border-color: #b7e0cd; color: #0b5a3e; }
.alert-erro { background: var(--red-l); border-color: #f0c0bd; color: #8e1f1a; }
.alert-info { background: var(--cyan-l); border-color: #b9e0f2; color: #064f72; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toasts .alert { box-shadow: 0 6px 20px rgba(23, 32, 51, .12); margin: 0; max-width: 380px; }

/* ---------- Abas e filtros ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-2); font-weight: 700; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--cyan); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { min-width: 150px; }
.filters > input, .filters > select, .filters label input, .filters label select { width: auto; }
.filters > input[type=search] { flex: 0 1 320px; }
.filters input[type=search] { min-width: 240px; }

/* ---------- Modal ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(23, 32, 51, .28); color: var(--ink); }
dialog::backdrop { background: rgba(23, 32, 51, .45); }
.dlg-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; }
.dlg-head .x { margin-left: auto; background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--ink-2); }
.dlg-body { padding: 18px 20px; }
.dlg-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- PDV ---------- */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.pdv-search { position: relative; }
.pdv-search input { font-size: 1.1rem; padding: 13px 14px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 10px 30px rgba(23, 32, 51, .12); z-index: 30; max-height: 340px; overflow-y: auto; }
.suggest button { display: flex; width: 100%; gap: 10px; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line-2); text-align: left; font: inherit; cursor: pointer; }
.suggest button:hover, .suggest button.on { background: var(--cyan-l); }
.suggest .price { margin-left: auto; font-weight: 700; }
.cart td input { padding: 6px 8px; }
.cart .q { width: 84px; }
.cart .p { width: 110px; }
.total-box { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 18px 20px; }
.total-box .lbl { opacity: .75; font-size: .9rem; }
.total-box .big { font-family: var(--display); font-size: 2.4rem; font-weight: 750; letter-spacing: -.02em; }
.pay-row { display: grid; grid-template-columns: 1fr 120px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.sum-line { display: flex; justify-content: space-between; padding: 4px 0; font-size: .95rem; }
.sum-line.strong { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.kbd { font-size: .75rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-2); background: var(--surface); }

/* ---------- Quadro de produção (kanban) ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.col { background: #eceff3; border-radius: var(--radius); padding: 10px; min-height: 200px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; font-weight: 700; font-size: .92rem; }
.col-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.col-head .n { margin-left: auto; color: var(--ink-3); font-weight: 400; }
.col.drop { outline: 2px dashed var(--cyan); }
.os-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; text-decoration: none; color: var(--ink); cursor: grab; }
.os-card:hover { border-color: #b8c2d1; }
.os-card .t1 { font-weight: 700; font-size: .93rem; }
.os-card .t2 { font-size: .82rem; color: var(--ink-2); margin-top: 2px; }
.os-card .t3 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: .78rem; }
.os-card.late { border-left: 3px solid var(--red); }
.os-card.urg { border-left: 3px solid var(--magenta); }
.steps { display: flex; gap: 4px; margin: 6px 0 18px; flex-wrap: wrap; }
.steps form { margin: 0; }
.steps button { font: inherit; font-size: .85rem; font-weight: 700; padding: 7px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; border-radius: 99px; }
.steps button.done { background: var(--cyan-l); border-color: #b9e0f2; color: var(--cyan-d); }
.steps button.on { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 18px; border-left: 2px solid var(--line); position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--cyan); }
.timeline .when { color: var(--ink-3); font-size: .8rem; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.file { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); font-size: .8rem; text-decoration: none; color: var(--ink); }
.file .thumb { height: 92px; background: var(--paper) center/cover no-repeat; display: grid; place-items: center; color: var(--ink-3); font-weight: 700; }
.file .nm { padding: 6px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Autenticação ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth-card { width: min(460px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 30px 26px; }
.auth-card.wide { width: min(620px, 100%); }
.auth-title { font-size: 1.6rem; }
.auth-foot { margin-top: 16px; font-size: .92rem; color: var(--ink-2); text-align: center; }
.niche-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.niche-pick label { flex-direction: row; align-items: flex-start; gap: 9px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-weight: 700; color: var(--ink); cursor: pointer; }
.niche-pick label:has(input:checked) { border-color: var(--cyan); background: var(--cyan-l); }
.niche-pick small { display: block; font-weight: 400; color: var(--ink-2); font-size: .8rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .pdv, .split { grid-template-columns: 1fr; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .side.open { transform: none; }
  .top .menu-btn { display: inline-flex; }
  .top { padding: 10px 16px; }
  .content { padding: 18px 16px 50px; }
  .banner { padding: 10px 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .top .who .emp-name { display: none; }
  .niche-pick { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Impressão ---------- */
@media print {
  .side, .top, .banner, .no-print, .toasts { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .panel { border: 0; padding: 0; }
}
