/* Mubi Gestão — estilos
   Paleta: Asfalto (menu), Concreto (fundo), Cobalto (ação), Sinal (alertas), Coral (despesas) */
:root {
  --asfalto: #1d2430;
  --asfalto-2: #283244;
  --asfalto-3: #3a465c;
  --ink: #1b2230;
  --ink-2: #4f596b;
  --ink-3: #7c8697;
  --line: #e1e5eb;
  --line-2: #eef1f5;
  --bg: #eef0f3;
  --surface: #ffffff;
  --cobalto: #2a4bd7;
  --cobalto-d: #1f3bb0;
  --cobalto-l: #e9eeff;
  --cobalto-m: #c9d4ff;
  --sinal: #ffb020;
  --coral: #d4644a;
  --good: #1a7f52;
  --good-l: #e3f4eb;
  --warn: #9a5b00;
  --warn-l: #fff2d9;
  --bad: #b42318;
  --bad-l: #fdecea;
  --r: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(29, 36, 48, .06), 0 1px 1px rgba(29, 36, 48, .04);
  --shadow-lg: 0 18px 50px rgba(29, 36, 48, .22);
  --f-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-wide: "Archivo", "Manrope", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--f-ui); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cobalto); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
code { font-size: 12.5px; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--cobalto); outline-offset: 2px; }
.ic { flex: none; display: block; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.sp { flex: 1; }
.grow { flex: 1; min-width: 0; }
.pos-t { color: var(--good); }
.neg-t { color: var(--bad); }
.warn-t { color: var(--warn); }
.danger-t { color: var(--bad) !important; }
.only-m { display: none !important; }
[hidden] { display: none !important; }

/* marca provisória */
.wm { font-family: var(--f-wide); font-stretch: 125%; font-weight: 800; letter-spacing: -.02em; font-size: 22px; color: #fff; }
.wm::after { content: ""; display: inline-block; width: .32em; height: .32em; margin-left: .08em; background: var(--sinal); border-radius: 2px; transform: skewX(-12deg); }

/* ---------- carregamento ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--asfalto); }
.boot .wm { font-size: 40px; }
.boot-bar { width: 120px; height: 4px; background: var(--asfalto-3); border-radius: 4px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--cobalto-m); animation: load 1s ease-in-out infinite alternate; }
@keyframes load { from { transform: translateX(-40%); } to { transform: translateX(180%); } }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--surface); font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s; }
.btn.primary { background: var(--cobalto); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--cobalto-d); }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink-3); }
.btn.soft { background: var(--cobalto-l); color: var(--cobalto-d); }
.btn.soft:hover:not(:disabled) { background: var(--cobalto-m); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 46px; font-size: 15px; padding: 0 20px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; }
.link { background: none; border: 0; padding: 0; color: var(--cobalto); font-weight: 650; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.link:hover { text-decoration: underline; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- campos ---------- */
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.fld > span i { color: var(--bad); font-style: normal; }
.fld small { color: var(--ink-3); font-size: 12px; }
.fld input, .fld select, .fld textarea, .toolbar select, .cart-cust select {
  width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); outline: none; transition: border-color .12s, box-shadow .12s; }
.fld textarea { height: auto; padding: 9px 11px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .toolbar select:focus { border-color: var(--cobalto); box-shadow: 0 0 0 3px var(--cobalto-l); }
.fld input[readonly] { background: var(--line-2); color: var(--ink-2); }
.fld.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
.fld.inline input, .fld.inline select { width: 60%; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--cobalto); }
.grid2, .grid3, .grid4 { display: grid; gap: 0 14px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.sub-h { font-size: 13px; font-weight: 750; margin: 18px 0 10px; color: var(--ink); padding-top: 14px; border-top: 1px solid var(--line-2); }
.sub-h.first { margin-top: 0; padding-top: 0; border-top: 0; }
fieldset.perms { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 14px 10px; margin: 4px 0 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
fieldset.perms legend, fieldset.radios legend { font-size: 12.5px; font-weight: 650; color: var(--ink-2); padding: 0 4px; }
fieldset.perms:disabled { opacity: .5; }
fieldset.radios { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
fieldset.radios label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
fieldset.radios label:has(input:checked) { border-color: var(--cobalto); background: var(--cobalto-l); }
fieldset.radios input { accent-color: var(--cobalto); }
.alert { padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; margin: 0 0 12px; }
.alert.err { background: var(--bad-l); color: var(--bad); }
.alert.warn { background: var(--warn-l); color: var(--warn); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { background: var(--asfalto); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art .wm.big { font-size: 34px; }
.login-copy h2 { font-family: var(--f-wide); font-stretch: 118%; font-weight: 750; font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -.02em; line-height: 1.04; max-width: 13ch; }
.login-copy p { color: #b7c0cf; font-size: 15.5px; max-width: 44ch; margin: 16px 0 0; }
.lane { display: flex; gap: 22px; transform: skewX(-24deg); margin-left: -60px; }
.lane i { width: 56px; height: 8px; background: var(--sinal); border-radius: 2px; opacity: .9; }
.lane i:nth-child(n+4) { opacity: .35; }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-form form { width: min(380px, 100%); }
.login-form h1 { font-family: var(--f-wide); font-stretch: 112%; font-size: 28px; font-weight: 750; margin-bottom: 6px; }
.login-form p.muted { margin: 0 0 22px; }
.demo-box { margin-top: 26px; padding: 16px; border-radius: var(--r); background: var(--bg); }
.demo-box b { font-size: 13px; }
.demo-box p { font-size: 13px; color: var(--ink-2); margin: 4px 0 12px; }
.demo-box small { display: block; margin-top: 10px; color: var(--ink-3); }
.demo-btns { display: grid; gap: 8px; }
.demo-btns .btn { justify-content: flex-start; background: var(--surface); }

/* ---------- estrutura ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--asfalto); color: #c6cdd9; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 3px; }
.brand .scope { font-size: 12.5px; color: #8e99ab; }
#nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; flex: 1; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm); color: #c6cdd9; text-decoration: none; font-weight: 600; font-size: 13.5px; position: relative; }
.nav-i:hover { background: var(--asfalto-2); color: #fff; }
.nav-i.on { background: var(--asfalto-2); color: #fff; }
.nav-i.on::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sinal); }
.nav-i.on .ic { color: var(--sinal); }
.nb { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--cobalto); color: #fff; font-size: 11px; display: grid; place-items: center; }
.nb.warn { background: var(--asfalto-3); color: var(--sinal); }
.side-foot { padding: 16px 22px 22px; }
.demo-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sinal); }
.side-scrim { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-ctx { flex: 1; min-width: 0; }
.ctx-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.top-r { display: flex; align-items: center; gap: 8px; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--sinal); color: var(--asfalto); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.userbtn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 6px 4px 4px; border-radius: var(--r-sm); cursor: pointer; text-align: left; }
.userbtn:hover { background: var(--line-2); }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--cobalto-l); color: var(--cobalto-d); display: grid; place-items: center; font-weight: 750; font-size: 12.5px; flex: none; }
.av.sm { width: 30px; height: 30px; font-size: 11.5px; }
.un { display: flex; flex-direction: column; line-height: 1.2; }
.un b { font-size: 13px; }
.un small { font-size: 11.5px; color: var(--ink-3); }
.page { padding: 26px 28px 60px; max-width: 1400px; width: 100%; outline: none; }

/* popovers */
.pop { position: fixed; z-index: 60; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-lg); border: 1px solid var(--line); width: 340px; max-width: calc(100vw - 16px); overflow: hidden; animation: pop .14s ease-out; }
.pop.userpop { width: 250px; padding-bottom: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.pop-h.col { flex-direction: column; align-items: flex-start; gap: 1px; }
.pop-h small { color: var(--ink-3); font-size: 12px; }
.pop-list { max-height: 420px; overflow-y: auto; }
.pad { padding: 16px; }
.nt { display: flex; gap: 11px; width: 100%; padding: 11px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.nt:hover { background: var(--bg); }
.nt.unread { background: #f6f8ff; }
.nt-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--line-2); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.nt.unread .nt-ic { background: var(--cobalto-l); color: var(--cobalto); }
.nt-t { display: flex; flex-direction: column; min-width: 0; }
.nt-t b { font-size: 13px; }
.nt-t small { color: var(--ink-2); font-size: 12.5px; }
.nt-t em { color: var(--ink-3); font-size: 11.5px; font-style: normal; margin-top: 2px; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 14px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 13.5px; }
.mi:hover { background: var(--bg); }

/* ---------- cabeçalho de página ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph h1 { font-family: var(--f-wide); font-stretch: 112%; font-weight: 750; font-size: 26px; letter-spacing: -.015em; }
.ph p { margin: 6px 0 0; color: var(--ink-2); max-width: 75ch; }
.ph-a { display: flex; gap: 8px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--ink-2); font-weight: 650; cursor: pointer; padding: 0; margin-bottom: 10px; }
.back:hover { color: var(--cobalto); }

/* ---------- indicadores ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.hero-main { padding: 22px 24px; display: flex; flex-direction: column; gap: 4px; }
.hero-v { font-family: var(--f-wide); font-stretch: 122%; font-weight: 700; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.goal { padding: 22px 24px; background: var(--asfalto); color: #fff; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.goal-t { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: #b7c0cf; }
.goal-t b { font-family: var(--f-wide); font-stretch: 122%; font-size: 26px; color: #fff; }
.goal small { color: #b7c0cf; font-size: 12.5px; }
.charge { display: flex; align-items: center; gap: 4px; }
.charge .cells { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; padding: 4px; border: 2px solid #5b6880; border-radius: 6px; }
.charge .cells i { height: 18px; border-radius: 2px; background: rgba(255, 255, 255, .08); }
.charge .cells i.on { background: var(--cobalto-m); }
.charge.full .cells i.on { background: #7fd8a8; }
.charge .cap { width: 4px; height: 12px; border-radius: 0 2px 2px 0; background: #5b6880; }
.charge.sm .cells { padding: 3px; gap: 3px; border-color: var(--line); border-width: 1.5px; }
.charge.sm .cells i { height: 9px; background: var(--line-2); }
.charge.sm .cells i.on { background: var(--cobalto); }
.charge.sm.full .cells i.on { background: var(--good); }
.charge.sm .cap { background: var(--line); height: 8px; width: 3px; }
.kpis { display: grid; gap: 14px; margin-bottom: 16px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpis.compact .kpi { padding: 13px 16px; }
.k-l { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.hero .k-l { font-size: 13px; }
.k-v { font-family: var(--f-wide); font-stretch: 115%; font-weight: 700; font-size: 23px; letter-spacing: -.015em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact .k-v { font-size: 19px; }
.k-s { font-size: 12.5px; color: var(--ink-3); }
.kpi.attn { box-shadow: inset 3px 0 0 var(--sinal), var(--shadow); }
.kpi.warn .k-v { color: var(--warn); }
.kpi.bad .k-v { color: var(--bad); }
.kpi.neg .k-v { color: var(--bad); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* ---------- cartões e grades ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px 0; }
.card-h h2 { font-size: 14.5px; font-weight: 750; }
.card-b { padding: 14px 18px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 > .card, .grid-2-1 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-2-1, .grid-3 { margin-bottom: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list li .grow { display: flex; flex-direction: column; }
.list li.click { cursor: pointer; }
.list li.click:hover b { color: var(--cobalto); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--ink-3); padding: 40px 20px; gap: 6px; background: var(--surface); border-radius: var(--r); }
.card .empty, .modal .empty, .cart-lines .empty { background: none; }
.empty p { margin: 0; max-width: 42ch; }
.empty.sm { padding: 18px 10px; }

/* ---------- gráficos ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 10.5px; font-family: var(--f-ui); }
.chart .bar { fill: var(--cobalto); }
.chart .bar.b { fill: var(--coral); }
.chart .bh:hover .bar { fill: var(--cobalto-d); }
.chart .bh:hover .bar.b { fill: #b84e36; }
.chart .bh:hover rect { fill: rgba(42, 75, 215, .05); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw.a { background: var(--cobalto); }
.sw.b { background: var(--coral); }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hb-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.hb-l { font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-v { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.hb-track { height: 8px; background: var(--line-2); border-radius: 4px; margin-top: 5px; overflow: hidden; }
.hb-fill { height: 100%; border-radius: 4px; background: var(--ink-3); }
.hb-fill.cobalt { background: var(--cobalto); }
.hb-fill.coral { background: var(--coral); }
.hb-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
#tip { position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; background: var(--asfalto); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: pre-line; max-width: 280px; box-shadow: var(--shadow-lg); }

/* ---------- tabelas ---------- */
.tbl-wrap { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
.card .tbl-wrap, .modal .tbl-wrap { box-shadow: none; border: 1px solid var(--line-2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 650; color: var(--ink-3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tfoot td { padding: 11px 14px; border-top: 1px solid var(--line); background: #fafbfc; font-weight: 650; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .act { text-align: right; white-space: nowrap; width: 1%; }
.tbl .act > * { display: inline-flex; vertical-align: middle; margin-left: 4px; }
.tbl .w-th { width: 56px; padding-right: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f7f9ff; }
.tbl.compact td, .tbl.compact th { padding: 8px 10px; }
.nw { white-space: nowrap; }
.clip { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.who { display: flex; align-items: center; gap: 10px; }
.tag { font-style: normal; font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips i { font-style: normal; font-size: 11.5px; padding: 2px 7px; border-radius: 4px; background: var(--cobalto-l); color: var(--cobalto-d); }
.mv { font-weight: 650; font-size: 12.5px; }
.mv.entrada { color: var(--good); }
.mv.saida { color: var(--bad); }
.mv.ajuste { color: var(--warn); }

/* status */
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.good { background: var(--good-l); color: var(--good); }
.pill.warn { background: var(--warn-l); color: var(--warn); }
.pill.bad { background: var(--bad-l); color: var(--bad); }
.pill.info { background: var(--cobalto); color: #fff; }
.pill.cobalt { background: var(--cobalto-l); color: var(--cobalto-d); }
.pill.muted { background: var(--line-2); color: var(--ink-2); }

/* miniaturas */
.thumb { display: inline-grid; place-items: center; border-radius: 8px; overflow: hidden; background: var(--line-2); flex: none; vertical-align: middle; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.ph { background: linear-gradient(160deg, #e9eeff, #dfe5f2); color: #6f7fb8; }
.thumb.ph svg { width: 70%; height: 70%; }

/* ---------- barra de ferramentas, abas, segmentos ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select { width: auto; min-width: 170px; }
.toolbar p { margin: 0; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-3); min-width: 240px; }
.search:focus-within { border-color: var(--cobalto); box-shadow: 0 0 0 3px var(--cobalto-l); }
.search input { border: 0; outline: none; background: none; flex: 1; min-width: 0; color: var(--ink); }
.search.lg { height: 46px; font-size: 15px; }
.search.grow { flex: 1; }
.seg { display: inline-flex; background: var(--line-2); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button, .seg label span { border: 0; background: none; padding: 6px 11px; border-radius: 5px; cursor: pointer; font-weight: 650; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; display: block; }
.seg button small { color: var(--ink-3); font-weight: 600; margin-left: 2px; }
.seg button.on, .seg label input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { position: relative; }
.seg.full { display: flex; margin-bottom: 14px; }
.seg.full label { flex: 1; text-align: center; }
.seg.xs button { padding: 3px 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 16px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--cobalto); border-bottom-color: var(--cobalto); }
.tn { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--cobalto); color: #fff; font-size: 11px; padding: 0 5px; }
.month { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 2px; }
.month b { min-width: 150px; text-align: center; font-size: 13.5px; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 5px 12px; font-size: 12.5px; font-weight: 650; cursor: pointer; color: var(--ink-2); }
.chip.on { background: var(--asfalto); border-color: var(--asfalto); color: #fff; }

/* ---------- modal ---------- */
#modal-root { position: relative; z-index: 70; }
.modal-wrap { position: fixed; inset: 0; background: rgba(20, 26, 36, .5); display: grid; place-items: center; padding: 20px; animation: fade .14s ease-out; overflow-y: auto; }
.modal-wrap.out { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: rise .16s ease-out; }
.modal.sm { width: min(440px, 100%); }
.modal.lg { width: min(900px, 100%); }
@keyframes rise { from { transform: translateY(8px); opacity: .6; } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-h h3 { font-size: 16.5px; font-weight: 750; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.lead { font-size: 14.5px; margin: 0 0 12px; }
.note { background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; color: var(--ink-2); margin: 0 0 14px; }
.dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 18px; margin: 0 0 16px; }
.dl dt { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 600; }
.hist { margin-top: 14px; font-size: 13px; }
.hist summary { cursor: pointer; font-weight: 650; color: var(--ink-2); }
.hist ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.done-ic { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--good-l); color: var(--good); display: grid; place-items: center; }
.notif-res { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.notif-res li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.notif-res li .ic { color: var(--good); }
.notif-res li.no .ic { color: var(--warn); }
.notif-res li.sim .ic { color: var(--ink-3); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.steps-txt { padding-left: 18px; margin: 0 0 12px; display: grid; gap: 10px; color: var(--ink-2); }

/* passos do pedido */
.stepper { list-style: none; display: flex; padding: 0; margin: 4px 0 18px; gap: 0; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; font-size: 12px; color: var(--ink-3); gap: 4px; }
.stepper li::before { content: ""; position: absolute; top: 11px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.done::before, .stepper li.cur::before { background: var(--cobalto); }
.stepper li i { width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; z-index: 1; color: #fff; }
.stepper li.done i { background: var(--cobalto); border-color: var(--cobalto); }
.stepper li.cur i { background: var(--sinal); border-color: var(--sinal); color: var(--asfalto); }
.stepper li span { font-weight: 650; color: var(--ink-2); }
.stepper li.cur span { color: var(--ink); }
.stepper li small { font-size: 11px; }
.stepper.cancel { display: flex; gap: 10px; align-items: center; }

/* recibo */
.receipt { font-size: 13px; border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 14px; background: #fcfcfd; }
.rc-h { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; }
.rc-h b { font-size: 15px; }
.rc-h span { font-size: 11.5px; color: var(--ink-3); }
.rc-m { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--ink-2); }
.receipt table { width: 100%; margin: 10px 0; border-collapse: collapse; }
.receipt td { padding: 3px 0; }
.receipt td:last-child { text-align: right; white-space: nowrap; }
.rc-t { display: flex; justify-content: space-between; padding: 2px 0; }
.rc-t.big { font-weight: 800; font-size: 15px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.rc-f { text-align: center; color: var(--ink-3); font-size: 11.5px; margin: 12px 0 0; }
.rc-cancel { text-align: center; color: var(--bad); font-weight: 800; letter-spacing: .05em; }
#print-area { display: none; }

/* ---------- avisos ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 9px; background: var(--asfalto); color: #fff; padding: 11px 14px; border-radius: 9px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 420px; animation: rise .18s ease-out; transition: opacity .25s, transform .25s; }
.toast.ok .ic { color: #7fd8a8; }
.toast.err { background: var(--bad); }
.toast.info .ic { color: var(--sinal); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- franquias ---------- */
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.fr-card { text-align: left; background: var(--surface); border: 1px solid transparent; border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: border-color .12s; }
.fr-card:hover { border-color: var(--cobalto-m); }
.fr-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fr-top > span { display: flex; flex-direction: column; }
.fr-top b { font-size: 15.5px; }
.fr-top small { color: var(--ink-2); font-size: 12.5px; }
.fr-v { display: flex; flex-direction: column; }
.fr-v b { font-family: var(--f-wide); font-stretch: 118%; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 0; padding-top: 10px; border-top: 1px solid var(--line-2); }
.fr-dl dt { font-size: 11.5px; color: var(--ink-3); }
.fr-dl dd { margin: 0; font-weight: 700; }
.fr-own { display: flex; align-items: center; gap: 6px; font-size: 12.5px; flex-wrap: wrap; }
.fr-own .muted { margin-left: auto; }
.tab-body { min-height: 200px; }

/* ---------- produto ---------- */
.prod-form { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; }
.photo-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-prev .thumb { border-radius: var(--r); }
.photo-box small { font-size: 11.5px; }

/* ---------- PDV ---------- */
.pdv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.pdv-search { position: sticky; top: 60px; background: var(--bg); padding: 0 0 4px; z-index: 5; }
.pdv-search .search { margin-bottom: 12px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.pcard { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 1px solid transparent; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; transition: border-color .1s, transform .06s; }
.pcard:hover { border-color: var(--cobalto-m); }
.pcard:active { transform: scale(.98); }
.pcard.off { opacity: .55; cursor: not-allowed; }
.pcard .thumb { margin-bottom: 4px; }
.pc-n { font-weight: 650; font-size: 13px; line-height: 1.25; min-height: 2.5em; }
.pc-p { font-family: var(--f-wide); font-stretch: 112%; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.pc-s { font-size: 11.5px; }
.pc-q { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--cobalto); color: #fff; display: grid; place-items: center; font-size: 12px; }
.pdv-r, .shop-cart { position: sticky; top: 76px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.cart-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; }
.cart-h h2 { font-family: var(--f-wide); font-stretch: 112%; font-size: 17px; font-weight: 750; }
.cart-cust { display: flex; gap: 6px; padding: 0 18px 10px; }
.cart-lines { flex: 1; overflow-y: auto; padding: 0 18px; border-top: 1px solid var(--line-2); min-height: 90px; }
.cl { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.cl-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-n b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-n small { font-size: 11.5px; }
.cl-t { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 84px; text-align: right; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); }
.qty button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.qty button:hover { color: var(--cobalto); }
.qty b { min-width: 24px; text-align: center; font-size: 13px; }
.cart-f { padding: 14px 18px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.disc { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.disc-in { display: flex; gap: 6px; align-items: center; }
.disc-in input { width: 90px; height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 8px; text-align: right; }
.tot-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); }
.tot-row.big { color: var(--ink); align-items: baseline; }
.tot-row.big b { font-family: var(--f-wide); font-stretch: 120%; font-size: 28px; font-weight: 750; font-variant-numeric: tabular-nums; }
.pays { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pays button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 4px; font-weight: 650; font-size: 12.5px; cursor: pointer; }
.pays button.on { border-color: var(--cobalto); background: var(--cobalto-l); color: var(--cobalto-d); }

/* ---------- compras ---------- */
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ccard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.ccard.off { opacity: .65; }
.cc-img { position: relative; background: linear-gradient(160deg, #f3f5fb, #e6eaf3); display: grid; place-items: center; height: 150px; }
.cc-img .thumb { width: 100% !important; height: 150px !important; border-radius: 0; background: none; }
.cc-img .thumb.ph svg { width: 90px; height: 90px; }
.cc-flag { position: absolute; top: 10px; left: 10px; background: var(--bad); color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.cc-b { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cc-b h3 { font-size: 15.5px; font-weight: 750; }
.specs { list-style: none; padding: 0; margin: 4px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.specs li { display: flex; flex-direction: column; font-size: 12.5px; }
.specs span { color: var(--ink-3); font-size: 11.5px; }
.cc-price { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; }
.cc-price b { font-family: var(--f-wide); font-stretch: 116%; font-size: 21px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cc-price small { color: var(--ink-2); font-size: 12px; }
.cc-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cc-f small { font-size: 12px; }
.olist { display: grid; gap: 12px; }
.ocard { text-align: left; background: var(--surface); border: 1px solid transparent; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.ocard:hover { border-color: var(--cobalto-m); }
.oc-h { display: flex; gap: 10px; align-items: baseline; }
.ocard .stepper { margin: 8px 0 6px; }

/* ---------- comunicados ---------- */
.ann-list { display: grid; gap: 12px; max-width: 820px; }
.ann { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; }
.ann.pinned { box-shadow: inset 3px 0 0 var(--sinal), var(--shadow); }
.ann header { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.ann h3 { font-size: 16px; font-weight: 750; }
.ann p { margin: 0; color: var(--ink-2); }
.ann footer { margin-top: 12px; }
.pin { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--warn); }
.ann-mini { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.ann-mini:last-child { border-bottom: 0; }
.ann-mini .pin { vertical-align: -1px; }

/* ---------- responsivo ---------- */
@media (max-width: 1180px) {
  .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .pdv { grid-template-columns: minmax(0, 1fr) 340px; }
  .shop { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 900px) {
  .only-m { display: inline-grid !important; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; }
  body.nav-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(20, 26, 36, .45); z-index: 40; }
  .top { padding: 0 14px; }
  .page { padding: 18px 14px 50px; }
  .un { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .pdv, .shop { grid-template-columns: minmax(0, 1fr); }
  .pdv-r, .shop-cart { position: static; max-height: none; }
  .pdv-search { top: 60px; }
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-art { display: none; }
  .login-form .wm.only-m { display: inline-block !important; color: var(--asfalto); font-size: 30px; margin-bottom: 18px; }
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span3 { grid-column: span 2; }
  .prod-form { grid-template-columns: minmax(0, 1fr); }
  .search { min-width: 0; flex: 1; }
}
@media (max-width: 560px) {
  .kpis.k4, .kpis.k3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .k-v { font-size: 18px; }
  .grid2, .grid3, .grid4 { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  fieldset.perms { grid-template-columns: minmax(0, 1fr); }
  .tbl { font-size: 13px; }
  .ph h1 { font-size: 22px; }
  .stepper li span { font-size: 10.5px; }
  .stepper li small { display: none; }
  .modal-wrap { padding: 0; align-items: end; }
  .modal { border-radius: 14px 14px 0 0; max-height: 92vh; }
  #toasts { left: 12px; right: 12px; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block; }
  #print-area .receipt { border: 0; max-width: 80mm; margin: 0 auto; font-size: 12px; }
}
