/* ================= STARFLOW ================= */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../assets/fonts/outfit-1.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../assets/fonts/outfit-0.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #242424;
  --surface-3: #2f2f2f;
  --border: #353535;
  --text: #f5f5f5;
  --text-2: #c9c9c9;
  --muted: #9a9a9a;
  --primary: #ffc21a;
  --primary-hover: #ffd04d;
  --primary-text: #ffc21a;
  --on-primary: #111111;
  --grad: linear-gradient(120deg, #ffe27a 0%, #ffc21a 50%, #f2a900 100%);
  --green: #4cc38a;
  --teal: #3fc5c0;
  --amber: #ff9f43;
  --red: #f0626a;
  --blue: #6b9bff;
  --violet: #d6d6d6;
  --lilac: #8c8c8c;
  --pink: #ffc21a;
  --tile-bg: linear-gradient(145deg, #2c2c2c, #1b1b1b);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 10px;
  --top-h: 60px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme='light'] {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #efefef;
  --surface-3: #e2e2e2;
  --border: #d9d9d9;
  --text: #141414;
  --text-2: #444444;
  --muted: #6e6e6e;
  --primary: #ffc21a;
  --primary-hover: #f2b200;
  --primary-text: #8a6400;
  --on-primary: #111111;
  --green: #1f9d63;
  --teal: #11928e;
  --amber: #d9771f;
  --red: #d83c46;
  --blue: #3a6fe0;
  --violet: #4a4a4a;
  --lilac: #9a9a9a;
  --pink: #8a6400;
  --tile-bg: linear-gradient(145deg, #262626, #111111);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::selection { background: color-mix(in srgb, var(--primary) 32%, transparent); color: var(--text); }
input, textarea { caret-color: var(--primary-text); }
:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
.kpi b, .stat b, .oc-total, .item-total, .total-box b, .fin-total b, .st-cell, .st-price, .ofin-row b, .doc-totals td, .doc-amount {
  font-variant-numeric: tabular-nums;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 8px; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.ic { width: 22px; height: 22px; flex: none; }
.ic.xs { width: 14px; height: 14px; vertical-align: -2px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.75rem; }
.center { text-align: center; }
.pad { padding: 20px 0; }
.pad-y { padding: 12px 0; }
.pad-x { padding: 16px 16px 24px; max-width: 760px; margin: 0 auto; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.err-text { color: var(--red); }
.accent-text { color: var(--primary-text); }
.danger-text { color: var(--red) !important; }
.h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 24px 0 10px; font-weight: 600; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 34px; }
.logo-word { font-weight: 800; letter-spacing: 0.06em; font-size: 1.35rem; }
.logo-word b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.logo.big .logo-mark { width: 54px; height: 54px; }
.logo.big .logo-word { font-size: 2rem; }
.logo.small .logo-mark { width: 26px; height: 26px; }
.logo.small .logo-word { font-size: 1.05rem; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 1rem; transition: background 0.15s, transform 0.05s, border-color 0.15s;
  border: 1.5px solid transparent; white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.outline { background: transparent; border-color: var(--primary-text); color: var(--text); }
.btn.danger { background: var(--red); color: #fff; }
.btn.google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; font-size: 0.9rem; padding: 0 12px; }
.btn.tiny { min-height: 34px; padding: 0 11px; font-size: 0.8rem; background: var(--surface-3); border-radius: 8px; }
.btn.tiny.primary { background: var(--primary); color: var(--on-primary); }
.btn.tiny.primary:hover { background: var(--primary-hover); }
.receive-pending { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); animation: receivePulse 2.6s ease-in-out infinite; }
.paid-order-state { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; border: 1px solid color-mix(in srgb, var(--green) 45%, var(--border)); border-radius: var(--radius-sm); color: var(--green); font-weight: 700; }
@keyframes receivePulse { 0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 38%, transparent); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); } }
.logo-word b { background-size: 240% 100%; }
@keyframes logoGoldFlow { to { background-position: 240% 0; } }
html[data-platform='desktop'] .logo-word b { animation: logoGoldFlow 12s ease-in-out infinite alternate; }
html[data-platform='android'] body.drawer-open .dr-logo .logo-word b { animation: logoGoldFlow 5s ease-in-out infinite alternate; }
.btn.grow { flex: 1; }
.btn .ic { width: 20px; height: 20px; }
.btn-pair { display: flex; gap: 10px; }
.btn-pair > * { flex: 1; }
.btn-col { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.link { color: var(--primary-text); font-weight: 600; padding: 10px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--text); position: relative; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.accent { color: var(--primary-text); }
.round-btn { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--surface-3); flex: none; }
.round-btn .ic { width: 18px; height: 18px; }
.round-btn.accent { background: var(--primary); color: var(--on-primary); }

/* ---------- Auth / onboarding ---------- */
.auth { height: 100dvh; display: flex; flex-direction: column; max-width: 520px; margin: 0 auto; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 8px 8px 0; min-height: 56px; }
.auth-body { flex: 1; overflow: auto; padding: 16px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth-body .logo { margin: 8px 0 18px; }
.auth-body h2 { font-size: 1.6rem; margin-top: 8px; }
.auth-body p { max-width: 380px; }
.auth-body .alert-box { text-align: left; margin-top: 10px; }
.auth-foot { padding: 16px 24px 20px; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); }
.ob-art { position: relative; width: 220px; height: 220px; display: grid; place-items: center; margin: 10px 0; }
.ob-ring { position: absolute; border-radius: 50%; border: 2px solid var(--border); }
.ob-ring.r1 { inset: 0; }
.ob-ring.r2 { inset: 30px; border-color: var(--surface-3); background: var(--surface); }
.ob-ic { position: relative; width: 96px; height: 96px; border-radius: 28px; background: var(--grad); display: grid; place-items: center; color: #111; box-shadow: 0 16px 36px rgba(0, 0, 0, 0.42); }
.ob-ic .ic { width: 48px; height: 48px; stroke-width: 1.6; }
.ob-star { position: absolute; top: 18px; right: 28px; color: var(--primary); }
.ob-star .ic { width: 30px; height: 30px; fill: currentColor; }
.dots { display: flex; gap: 8px; margin: 6px 0; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.dots i.on { background: var(--primary-text); width: 22px; border-radius: 6px; }

/* ---------- Shell ---------- */
.shell { display: flex; height: 100dvh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100dvh; }
.topbar {
  height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  display: flex; align-items: center; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none;
}
.topbar h1 { flex: 1; text-align: center; font-size: 1.2rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-ic.ok { color: var(--green); }
.sync-ic.warn { color: var(--amber); }
.sync-ic.err { color: var(--red); }
.sync-ic .badge { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync-ic .badge.success { width: 12px; height: 12px; top: 7px; right: 7px; display: grid; place-items: center; color: #fff; background: var(--green); border: 2px solid var(--bg); font-size: 8px; font-style: normal; font-weight: 800; line-height: 1; }
.sync-ic .badge.success::after { content: '✓'; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.footer { flex: none; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg); }
.footer > * { max-width: 728px; margin: 0 auto; }
.footer[hidden] { display: none; }
body:not(.has-bnav) .footer { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.bottomnav { flex: none; display: flex; gap: 8px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--bg); }
.bottomnav[hidden] { display: none; }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border-radius: 14px; color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.bottomnav a.active { background: var(--surface-2); color: var(--primary-text); }
.has-bnav .footer { border-top: 0; padding-bottom: 4px; }
.route-error { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.route-error h2 { margin: 2px 0 0; }
.route-error p { max-width: 430px; color: var(--text-2); margin: 0 0 8px; }
.route-error-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: color-mix(in srgb, var(--red) 13%, var(--surface)); color: var(--red); }
.route-error-icon .ic { width: 26px; height: 26px; }

/* Drawer */
.drawer {
  position: fixed; inset: 0 auto 0 0; width: min(86vw, 340px); background: var(--surface); z-index: 40;
  transform: translateX(-105%); transition: transform 0.25s ease; overflow-y: auto; padding-top: env(safe-area-inset-top);
  display: flex; flex-direction: column;
}
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 39; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.drawer-open .drawer { transform: none; box-shadow: var(--shadow); }
.drawer-open .scrim { opacity: 1; pointer-events: auto; }
.dr-head { padding: 12px 16px 8px; position: relative; }
.dr-close { position: absolute; right: 8px; top: 8px; }
.dr-logo { padding: 8px 0 16px; }
.dr-profile { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--surface-2); }
.dr-profile b { display: block; font-size: 0.95rem; }
.dr-profile small { color: var(--muted); font-size: 0.8rem; display: block; overflow: hidden; text-overflow: ellipsis; }
.dr-nav { padding: 8px 8px 24px; }
.dr-nav h3 { font-size: 1.05rem; padding: 12px 12px 6px; }
.dr-nav hr { border: 0; border-top: 1px solid var(--border); margin: 10px 12px; }
.dr-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px; border-radius: 12px; font-size: 1.02rem; text-align: left; }
.dr-item > .ic:first-child { color: var(--primary-text); }
.dr-item span { flex: 1; }
.dr-item .chev { width: 18px; height: 18px; color: var(--muted); }
.dr-item:hover { background: var(--surface-2); }
.dr-item.active { background: var(--surface-2); color: var(--primary-text); }

@media (min-width: 1024px) {
  .drawer { position: sticky; top: 0; transform: none; height: 100dvh; border-right: 1px solid var(--border); flex: none; width: 290px; }
  .scrim, .dr-close, .menu-btn { display: none !important; }
  .topbar .menu-btn + h1 { margin-left: 52px; }
  html[data-platform='desktop'] .bottomnav { display: flex; justify-content: center; gap: 8px; padding: 8px 24px 10px; border-top: 1px solid var(--border); background: var(--surface); }
  html[data-platform='desktop'] .bottomnav a { flex: none; min-width: 140px; flex-direction: row; justify-content: center; gap: 9px; padding: 10px 18px; border: 1px solid transparent; border-radius: 12px; font-size: .95rem; }
  html[data-platform='desktop'] .bottomnav a.active { border-color: color-mix(in srgb, var(--primary) 38%, var(--border)); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
  html[data-platform='desktop'] .has-bnav .footer { padding-bottom: 8px; border-top: 1px solid var(--border); }
  .pad-x { padding: 24px 32px 40px; }
}

/* ---------- Cards e listas ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.order-card { display: flex; flex-direction: column; min-width: 0; gap: 4px; overflow-wrap: anywhere; transition: border-color 0.15s; }
.order-card:hover, .doc-card:hover { border-color: var(--primary-text); }
.oc-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.oc-client { font-weight: 600; font-size: 1.05rem; }
.oc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.oc-total { font-size: 1.05rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); white-space: nowrap; }
.pill i, .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.amber > i, .dot.amber { background: var(--amber); }
.blue > i, .dot.blue { background: var(--blue); }
.green > i, .dot.green { background: var(--green); }
.red > i, .dot.red { background: var(--red); }
.dot.teal { background: var(--teal); }
.dot.violet { background: var(--violet); }
.dot.lilac { background: var(--lilac); }
.dot.c1 { background: var(--primary); }
.dot.c2 { background: var(--lilac); }
.list-plain { display: flex; flex-direction: column; }
.row-link .grow { overflow-wrap: anywhere; }
.row-link {
  display: flex; align-items: center; gap: 12px; padding: 16px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.row-link:last-child { border-bottom: 0; }
.row-link > .ic:last-child { color: var(--primary-text); width: 20px; }
.row-link small { display: block; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-link:hover b { color: var(--primary-text); }
.row-right { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.row-right .ic { color: var(--primary-text); width: 20px; }
.dot-label { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--primary-text); flex: none; overflow: hidden; font-size: 0.95rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 64px; height: 64px; font-size: 1.3rem; }
.cat-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; color: var(--primary-text); flex: none; }
.stock-badge { font-size: 0.8rem; font-weight: 600; padding: 5px 10px; border-radius: 8px; background: var(--surface-2); white-space: nowrap; }
.stock-badge.low { background: color-mix(in srgb, var(--red) 22%, transparent); color: var(--red); }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.tabs button { flex: 1; padding: 14px 8px; color: var(--muted); font-weight: 500; font-size: 1rem; border-bottom: 3px solid transparent; }
.tabs button.active { color: var(--primary-text); border-color: var(--primary-text); }

/* Busca */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; margin-bottom: 12px; }
.search .ic { color: var(--muted); width: 20px; }
.search input { flex: 1; border: 0; background: none; outline: none; height: 46px; min-width: 0; }

/* Vazio */
.empty { text-align: center; padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ic { width: 150px; height: 150px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); margin-bottom: 18px; }
.empty-ic .ic { width: 60px; height: 60px; stroke-width: 1.5; }
.empty h3 { font-size: 1.15rem; }
.empty p { color: var(--text-2); max-width: 340px; }
.empty .btn { margin-top: 12px; }

/* ---------- Início ---------- */
.hello { margin: 4px 0 14px; }
.hello small { color: var(--muted); font-size: 0.95rem; }
.hello h1 { font-size: 1.45rem; }
.sync-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 16%, var(--surface)) 0%, var(--surface) 70%); border: 1px solid var(--border); margin-bottom: 14px;
}
.sync-card > .ic:first-child { width: 30px; height: 30px; color: var(--primary-text); }
.sync-card.ok > .ic:first-child { color: var(--green); }
.sync-card.warn > .ic:first-child { color: var(--amber); }
.sync-card.err > .ic:first-child { color: var(--red); }
.sync-card span { flex: 1; min-width: 0; }
.sync-card b { display: block; }
.sync-card small { color: var(--text-2); font-size: 0.85rem; }
.sync-card > .ic:last-child { color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 22px; font-size: 1.05rem; font-weight: 500; border: 1px solid transparent; transition: border-color 0.15s, transform 0.1s; }
.tile:hover { border-color: var(--border); }
.tile:active { transform: scale(0.98); }
.tile-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #ffc21a; background: var(--tile-bg); border: 1px solid rgba(255, 194, 26, 0.18); flex: none; }
.tile-ic .ic { width: 24px; height: 24px; }
.tile-ic.green { color: #4cc38a; }
.tile-ic.red { color: #f0626a; }
.morph-host { display: inline-grid; place-items: center; }
.shortcuts {
  display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; overflow-y: hidden;
  padding: 2px 16px 10px 2px; margin-right: -16px;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; overscroll-behavior-x: contain;
  scrollbar-width: none; user-select: none;
}
.shortcuts::-webkit-scrollbar { display: none; }
.shortcut {
  flex: 0 0 142px; width: 142px; min-height: 128px; background: var(--surface);
  border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column;
  justify-content: space-between; gap: 14px; text-align: left; font-weight: 500;
  border: 1px solid transparent; touch-action: pan-x pan-y;
}
.shortcut:hover { border-color: var(--border); }
.shortcut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shortcut-grid .shortcut { width: auto; }
.today { padding: 4px 12px; }
.today-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.today-row:last-child { border-bottom: 0; }
.today-row > .ic:first-child { color: var(--primary-text); }
.today-row span { flex: 1; min-width: 0; }
.today-row small { display: block; color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-row > .ic:last-child { color: var(--muted); width: 18px; }

/* ---------- Formulários ---------- */
.form { display: flex; flex-wrap: wrap; gap: 14px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.field.half { width: calc(50% - 6px); }
@media (max-width: 380px) { .field.half { width: 100%; } }
.field label { font-size: 0.85rem; color: var(--text-2); font-weight: 500; }
.field .help { color: var(--muted); font-size: 0.78rem; }
input:not([type=checkbox]):not([type=file]), select, textarea, .input, .fake-input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg); outline: none; transition: border-color 0.15s; font-size: 1rem;
}
.search input { border: 0 !important; background: none !important; padding: 0; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus, .fake-input:focus { border-color: var(--primary-text); }
.field.invalid input, .field.invalid select { border-color: var(--red); }
input[type=date], input[type=time] { min-height: 50px; }
.select { position: relative; cursor: pointer; user-select: none; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer; pointer-events: none; }
.select > .ic { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--primary-text); }
.input-affix { display: flex; align-items: stretch; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.input-affix:focus-within { border-color: var(--primary-text); }
.input-affix span { display: grid; place-items: center; padding: 0 12px; color: var(--muted); background: var(--surface-2); font-weight: 500; }
.input-affix input { border: 0 !important; border-radius: 0 !important; }
.form-section { width: 100%; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-text); margin-top: 8px; }
.form-hint { width: 100%; margin: 0; font-size: 0.85rem; color: var(--text-2); background: var(--surface-2); padding: 10px 12px; border-radius: var(--radius-sm); }
.form-live { width: 100%; }
.live-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface-2); }
.live-total b { font-size: 1.15rem; }
.check { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; cursor: pointer; padding: 4px 0; }
.check.half { width: calc(50% - 6px); }
.check input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.check-box { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border); display: grid; place-items: center; flex: none; }
.check-box .ic { width: 16px; height: 16px; opacity: 0; stroke-width: 3; color: var(--on-primary); }
.check input:checked + .check-box { background: var(--primary); border-color: var(--primary); }
.check input:checked + .check-box .ic { opacity: 1; }
.check input:focus-visible + .check-box { outline: 2px solid var(--primary-text); outline-offset: 2px; }
.period-select { margin-bottom: 14px; }
.period-select select { padding-left: 148px; font-weight: 600; font-size: 1.05rem; background: var(--surface); }
.ps-label { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-size: 0.92rem; pointer-events: none; }
.filter-select select { font-weight: 600; border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); background: color-mix(in srgb, var(--blue) 8%, var(--bg)); }
.toolbar-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.toolbar-2 .btn { min-height: 50px; }
.seg { display: flex; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; font-weight: 500; color: var(--text-2); }
.seg button.active { background: var(--primary); color: var(--on-primary); }

/* ---------- Editor de pedido ---------- */
.editor > * + * { margin-top: 14px; }
.ed-title { display: flex; justify-content: space-between; align-items: flex-start; }
.ed-title h1 { font-size: 1.35rem; }
.fake-input { display: flex; align-items: center; gap: 10px; text-align: left; color: var(--muted); }
.fake-input.filled { color: var(--text); }
.fake-input span { display: flex; flex-direction: column; }
.fake-input small { color: var(--muted); font-size: 0.85rem; }
.fake-input .ic { color: var(--primary-text); }
.status-select select { font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; background: var(--surface-2); font-size: 0.88rem; font-weight: 500; border: 1px solid var(--border); }
.chip .ic { width: 17px; height: 17px; color: var(--primary-text); }
.chip:hover { border-color: var(--primary-text); }
.chip.danger .ic, .chip.danger { color: var(--red); }
.ed-section { border-top: 1px solid var(--border); padding-top: 6px; }
.ed-head { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 0; }
.ed-head h2 { font-size: 1.5rem; font-weight: 700; }
.ed-head .round-btn { background: var(--text); color: var(--bg); }
.ed-body { display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; }
.ed-body[hidden] { display: none !important; }
.add-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.add-label { display: flex; align-items: center; gap: 12px; font-size: 1.08rem; font-weight: 500; }
.add-label .ic { color: var(--primary-text); width: 24px; height: 24px; }
.add-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; }
.add-btn .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.item-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); margin-left: 0; }
.item-row:hover { border-color: var(--primary-text); }
.item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-main small { color: var(--muted); font-size: 0.83rem; }
.item-total { white-space: nowrap; }
.item-total.neg { color: var(--red); }
.mini-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); width: 100%; text-align: left; border: 1px solid var(--border); }
.mini-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-row small { color: var(--muted); font-size: 0.83rem; }
.mini-row > .ic:first-child { color: var(--primary-text); }
.mini-row .ic.ok { color: var(--green); }
.fin-sum { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 10px; padding: 10px 2px; font-size: 0.9rem; color: var(--text-2); }
.fin-sum b { color: var(--text); }
.total-box { background: var(--surface-2); border-radius: var(--radius); padding: 14px 18px; display: flex; flex-direction: column; gap: 6px; }
.total-box > div { display: flex; justify-content: space-between; gap: 10px; }
.total-box .grand { font-size: 1.25rem; padding-top: 4px; }
.total-box .grand span { font-weight: 600; }
.order-acm { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); font-size: .85rem; }
.order-acm table { width: 100%; border-collapse: collapse; }
.order-acm th, .order-acm td { padding: 5px 4px; text-align: right; }
.order-acm th:first-child { text-align: left; }
.order-acm tbody th { font-weight: 400; }
.order-acm tbody th::first-letter { text-transform: uppercase; }
.order-acm td, .order-acm thead th:not(:first-child) { white-space: nowrap; }
.order-acm tfoot { border-top: 1px solid var(--border); font-weight: 600; }

/* ---------- Cliente ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.profile-head h1 { font-size: 1.35rem; }
.info-list { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.info-list > div { display: flex; gap: 12px; align-items: flex-start; }
.info-list .ic { color: var(--primary-text); width: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: var(--radius-sm); padding: 12px; border: 1px solid var(--border); }
.stat small { color: var(--muted); font-size: 0.78rem; display: block; }
.stat b { font-size: 1rem; }
.alert-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--amber) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); margin-bottom: 14px; font-size: 0.92rem; }
.alert-box .ic { color: var(--amber); }

/* ---------- Agenda ---------- */
.day-head { font-size: 0.95rem; color: var(--text-2); margin: 18px 0 8px; text-transform: capitalize; }
.day-head.past { color: var(--muted); }
.appt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; background: var(--surface); border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--border); transition: all 0.15s ease; }
.appt-row:hover { border-color: var(--primary-text); }
.appt-row.is-done { opacity: 0.75; }
.appt-row.is-done .grow b { text-decoration: line-through; color: var(--text-2); }
.appt-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; cursor: pointer; }
.appt-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.appt-complete-btn { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-color: color-mix(in srgb, var(--primary) 50%, transparent); color: var(--primary-text); }
.appt-complete-btn:hover { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.appt-time { width: 54px; flex: none; display: flex; flex-direction: column; }
.appt-time small, .appt-row .grow small { color: var(--muted); font-size: 0.8rem; display: block; }
.appt-bar { width: 4px; border-radius: 4px; background: var(--blue); align-self: stretch; flex: none; }
.appt-bar.green { background: var(--green); }
.appt-bar.red { background: var(--red); }
.appt-row .pill { align-self: center; }
.calendar { background: var(--surface); border-radius: var(--radius); padding: 12px; border: 1px solid var(--border); }
.cal-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; font-size: 1.05rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid.wd span { color: var(--muted); font-size: 0.85rem; padding: 6px 0; font-weight: 600; }
.cal-day { aspect-ratio: 1; max-height: 52px; border-radius: 50%; display: grid; place-items: center; position: relative; font-size: 1rem; margin: 0 auto; width: 100%; max-width: 52px; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.today { color: var(--primary-text); font-weight: 700; }
.cal-day.sel { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.cal-day i { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); min-width: 6px; height: 6px; border-radius: 3px; background: var(--amber); font-size: 0; }
.cal-day.sel i { background: var(--on-primary); }

/* ---------- Financeiro ---------- */
.fin-card { margin-bottom: 14px; padding: 18px 20px; }
.fin-card h2 { font-size: 1.2rem; margin-bottom: 6px; }
.fin-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; }
.fin-row:hover .dot-label { color: var(--primary-text); }
.fin-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.08rem; padding-top: 10px; border-top: 1px solid var(--border); margin-top: 4px; }
.result-bar { text-align: center; font-size: 1.2rem; color: var(--primary-text); padding: 4px; }
.result-bar.neg b { color: var(--red); }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s ease; }
.tx-row:hover { background: color-mix(in srgb, var(--surface) 50%, transparent); }
.tx-row small { display: block; color: var(--muted); font-size: 0.82rem; }
.tx-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 0.8rem; }
.tx-client-tag, .tx-order-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); font-weight: 500; font-size: 0.78rem; }
.tx-client-tag { color: var(--primary-text); border-color: color-mix(in srgb, var(--primary-text) 30%, var(--border)); }
.fin-search-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 12px; }
.fin-search-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-clear-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; display: grid; place-items: center; border-radius: 4px; flex-shrink: 0; transition: all 0.15s ease; }
.search-clear-btn:hover { color: var(--text); background: var(--surface-2); }
.tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tx-right b { white-space: nowrap; }

/* ---------- Gestão ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.kpi small { color: var(--muted); font-size: 0.82rem; }
.kpi b { font-size: 1.2rem; }
.kpi span { color: var(--muted); font-size: 0.78rem; }
.chart-card { margin-bottom: 14px; padding: 18px; }
.cc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cc-head h2 { font-size: 1.15rem; }
.cc-head .info { color: var(--muted); cursor: help; }
.chart-empty { background: var(--surface-2); border-radius: var(--radius-sm); padding: 32px 12px; text-align: center; color: var(--muted); }
.chart-empty .ic { width: 64px; height: 64px; stroke-width: 1.4; }
.chart-empty p { margin: 10px 0 0; color: var(--text-2); }
.legend { display: flex; gap: 16px; font-size: 0.85rem; color: var(--text-2); margin-bottom: 6px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; opacity: 0.6; }
.chart .grid.base { opacity: 1; }
.chart .axis { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .bar.c1 { fill: var(--primary); }
.chart .bar.c2 { fill: var(--lilac); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: var(--text); fill-opacity: 0.04; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar-label { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; margin-bottom: 4px; }
.hbar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 5px; background: var(--primary); }
.hbar-fill.c2 { background: var(--lilac); }
.hbar-fill.s-amber { background: var(--amber); }
.hbar-fill.s-blue { background: var(--blue); }
.hbar-fill.s-green { background: var(--green); }
.hbar-fill.s-red { background: var(--red); }
.chart-tip { position: fixed; z-index: 100; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); padding: 8px 12px; border-radius: 10px; font-size: 0.85rem; box-shadow: var(--shadow); pointer-events: none; display: none; max-width: 260px; }
.chart-tip div { display: flex; align-items: center; gap: 6px; margin-top: 3px; }

/* ---------- Configurações ---------- */
.settings-card { display: flex; flex-direction: column; gap: 12px; }
.acct { display: flex; align-items: center; gap: 12px; }
.acct img { width: 44px; height: 44px; border-radius: 50%; }
.acct small { display: block; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 0.95rem; }
.kv span { color: var(--text-2); }
.logo-upload { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.logo-upload .btn { margin-top: 6px; }
.logo-prev { width: 88px; height: 88px; border-radius: var(--radius); background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; border: 1px dashed var(--border); }
.logo-prev img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sig-card { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.sig-prev { background: #fff; border-radius: var(--radius-sm); min-height: 96px; display: grid; place-items: center; padding: 10px; }
.sig-prev img { max-width: 100%; max-height: 90px; }
.sig-prev .muted { color: #777; display: flex; align-items: center; gap: 6px; }
.sig-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sig-pad { position: relative; background: #fff; border-radius: var(--radius-sm); border: 2px dashed var(--border); height: 240px; margin-top: 8px; }
.sig-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-line { position: absolute; left: 24px; right: 24px; bottom: 56px; border-top: 1.5px solid #c9c9c9; pointer-events: none; }
.space-card { display: flex; flex-direction: column; gap: 8px; }
.space-name { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; flex-wrap: wrap; }
.space-name > .ic { color: var(--primary-text); }
.add-member, .create-card { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }
.member-row small { display: block; color: var(--muted); font-size: 0.8rem; }
.member-row b { word-break: break-all; font-weight: 600; }
.select.mini select { min-height: 38px; padding: 6px 34px 6px 10px; font-size: 0.85rem; width: auto; }
.select.mini > .ic { right: 8px; width: 16px; height: 16px; }
.team-row .btn.tiny { margin-left: 6px; }
.team-row .pill { margin-left: 4px; }
.signed-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.signed-banner > .ic:first-child { width: 26px; height: 26px; }
.signed-banner span { flex: 1; min-width: 0; }
.signed-banner b { display: block; }
.signed-banner small { color: var(--text-2); font-size: 0.82rem; }
.signed-banner.ok { border-color: color-mix(in srgb, var(--green) 50%, transparent); background: color-mix(in srgb, var(--green) 12%, var(--surface)); }
.signed-banner.ok > .ic:first-child { color: var(--green); }
.signed-banner.wait > .ic:first-child { color: var(--primary-text); }
.chip.chip-accent { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.chip.chip-accent .ic { color: var(--on-primary); }
.link-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; font-size: 0.85rem; word-break: break-all; margin: 10px 0; border: 1px dashed var(--border); }
.sig-result p { margin-top: 10px; }
.faq { background: var(--surface); border-radius: var(--radius-sm); margin-bottom: 8px; border: 1px solid var(--border); }
.faq summary { list-style: none; padding: 16px; font-weight: 600; display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { color: var(--primary-text); transition: transform 0.2s; }
.faq p { padding: 0 16px 16px; color: var(--text-2); margin: 0; }

/* ---------- Janelas ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s; }
.sheet {
  position: relative; background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; transform: translateY(30px); opacity: 0; transition: transform 0.22s ease, opacity 0.22s;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-wrap.open .sheet-scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
@media (min-width: 640px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 20px; }
  .sheet.small { max-width: 420px; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 10px 6px 20px; }
.sheet-head h2 { font-size: 1.2rem; }
.sheet-body { padding: 8px 20px 20px; overflow-y: auto; }
.sheet-foot { padding: 12px 20px 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.dialog-msg { color: var(--text-2); font-size: 1rem; }
.choice-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pick-add { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px; border-radius: var(--radius-sm); color: var(--primary-text); font-weight: 600; background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--primary-text) 45%, var(--border)); margin-bottom: 10px; transition: background 0.16s ease, border-color 0.16s ease; }
.pick-add:hover { background: var(--surface-3); border-color: var(--primary-text); }
.pick-list { display: flex; flex-direction: column; gap: 2px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 14px 10px; border-bottom: 1px solid var(--border); border-radius: var(--radius-sm); transition: background 0.15s ease; }
.pick-row:hover { background: var(--surface-2); }
.pick-row:hover b { color: var(--primary-text); }
.pick-row.active { background: color-mix(in srgb, var(--primary) 12%, var(--surface-2)); border-bottom-color: transparent; }
.pick-row.active b { color: var(--primary-text); }
.pick-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; color: transparent; flex-shrink: 0; transition: all 0.16s ease; }
.pick-row.active .pick-check { border-color: var(--primary); background: var(--primary); color: #0F0F0F; }
.pick-check .ic { width: 14px; height: 14px; stroke-width: 3; }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick-main small { color: var(--muted); font-size: 0.83rem; }
.pick-right { color: var(--text-2); font-size: 0.9rem; white-space: nowrap; }

/* ---------- Avisos ---------- */
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 90; pointer-events: none; padding: 0 16px; }
.toast { background: var(--surface-3); color: var(--text); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; opacity: 0; transform: translateY(10px); transition: opacity 0.22s ease, transform 0.22s ease; max-width: 480px; text-align: center; border: 1px solid color-mix(in srgb, var(--primary-text) 42%, var(--border)); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { border-color: color-mix(in srgb, var(--green) 50%, var(--border)); }
.toast.error { border-color: color-mix(in srgb, var(--red) 55%, var(--border)); }

/* ---------- Terceirizador (Estrelinha), Detalhes, Fotos, Filtros, PCP e Estoque ---------- */
.star-btn {
  width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--muted); transition: transform 0.15s, color 0.15s, background 0.15s; flex: none;
}
.star-btn:hover { background: var(--surface-2); color: var(--primary-text); }
.star-btn.on { color: #ffc21a; }
.star-btn.on .ic { fill: #ffc21a; transform: scale(1.06); }
.star-btn.big { width: 46px; height: 46px; background: var(--surface-2); }
.outsourcer-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700;
  padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, #ffc21a 18%, var(--surface-2));
  color: var(--primary-text); border: 1px solid color-mix(in srgb, #ffc21a 40%, transparent); vertical-align: middle;
}
.outsourcer-pill .ic { width: 13px; height: 13px; fill: currentColor; }

.ed-head-right { display: inline-flex; align-items: center; gap: 8px; }
.detail-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 4px; border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.detail-row:last-of-type { border-bottom: 0; }
.detail-row:hover b { color: var(--primary-text); }
.detail-ic {
  width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2);
  display: grid; place-items: center; color: var(--primary-text); flex: none;
}
.detail-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.detail-main b { font-size: 1.02rem; font-weight: 600; }
.detail-main small { color: var(--muted); font-size: 0.85rem; }
.detail-chev { color: var(--muted); display: grid; place-items: center; }
.add-btn.small { width: 30px; height: 30px; }
.add-btn.small .ic { width: 17px; height: 17px; }

.cond-mode-list { display: flex; flex-direction: column; gap: 10px; }
.cond-mode-btn {
  width: 100%; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1.5px solid var(--border); font-weight: 600; font-size: 1rem; text-align: center; transition: all 0.15s;
}
.cond-mode-btn.active, .cond-mode-btn:hover { border-color: var(--primary-text); background: color-mix(in srgb, var(--primary) 16%, var(--surface-2)); color: var(--primary-text); }
.cond-mode-row { display: flex; gap: 10px; }
.cond-pill-btn {
  flex: 1; padding: 12px 10px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1.5px solid var(--border); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.cond-pill-btn small { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.cond-pill-btn.active { border-color: var(--primary-text); background: color-mix(in srgb, var(--primary) 16%, var(--surface-2)); color: var(--primary-text); }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; margin-bottom: 8px; }
.photo-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; }
.photo-card img { width: 100%; height: 120px; object-fit: cover; background: #000; }
.photo-cap { border: 0 !important; border-top: 1px solid var(--border) !important; border-radius: 0 !important; min-height: 36px !important; padding: 6px 8px !important; font-size: 0.82rem !important; }
.photo-del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,0.7); color: var(--red); display: grid; place-items: center; }

/* Filtro de pedidos */
.search-filter-row { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.filter-btn { min-height: 46px; padding: 0 14px; border: 1px solid var(--border); }
.filter-btn.active { border-color: var(--primary-text); color: var(--primary-text); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }
.filter-cards { display: flex; flex-direction: column; gap: 10px; }
.filter-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.filter-card > label:first-child { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.tx-btns { display: flex; gap: 6px; align-items: center; }

/* Quadro PCP Kanban */
.pcp-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px 6px; }
.pcp-toolbar .search { flex: 1 1 180px; }
.pcp-toolbar .select, .pcp-toolbar select { min-width: 0; max-width: 100%; }
.pcp-alert-btn { border-color: var(--amber) !important; color: var(--amber) !important; }
.pcp-stage-bar {
  display: flex; align-items: center; gap: 6px; padding: 4px 10px 6px;
  background: var(--bg); border-bottom: 1px solid var(--border); position: sticky; top: 49px; z-index: 2;
}
.pcp-nav-arrow {
  width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2);
  border: 1px solid var(--border); display: grid; place-items: center; flex: none; color: var(--primary-text);
}
.pcp-nav-arrow .ic { width: 16px; height: 16px; }
.pcp-stage-nav {
  display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden;
  flex: 1; min-width: 0; padding: 2px 2px; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y;
}
.pcp-stage-nav::-webkit-scrollbar { display: none; }
.pcp-stage-pill {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 99px; background: var(--surface);
  border: 1.5px solid var(--border); font-size: 0.76rem; font-weight: 700;
  color: var(--text-2); white-space: nowrap; transition: all 0.15s;
}
.pcp-stage-pill b {
  background: var(--surface-3); color: var(--text); padding: 1px 6px; border-radius: 99px; font-size: 0.72rem;
}
.pcp-stage-pill.active {
  border-color: var(--primary-text); background: color-mix(in srgb, var(--primary) 18%, var(--surface)); color: var(--primary-text);
}
.pcp-Board-wrap { width: 100%; overflow: hidden; }
.pcp-board {
  display: flex; flex-wrap: nowrap; gap: 12px; width: 100%; max-width: 100%;
  overflow-x: auto; overflow-y: hidden; padding: 10px 24px 28px 16px;
  min-height: calc(100dvh - 250px); align-items: flex-start;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; overscroll-behavior-x: contain;
}
.pcp-col {
  flex: 0 0 280px; width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); display: flex; flex-direction: column; max-height: calc(100dvh - 265px);
  overflow: hidden; touch-action: pan-x pan-y;
}
.pcp-col.violet { border-color: color-mix(in srgb, #7c6bff 38%, var(--border)); }
.pcp-col.amber { border-color: color-mix(in srgb, var(--amber) 38%, var(--border)); }
.pcp-col.blue { border-color: color-mix(in srgb, var(--blue) 38%, var(--border)); }
.pcp-col.green { border-color: color-mix(in srgb, var(--green) 38%, var(--border)); }
.pcp-col.teal { border-color: color-mix(in srgb, var(--teal) 38%, var(--border)); }
.pcp-col.red { border-color: color-mix(in srgb, var(--red) 38%, var(--border)); }
.pcp-col-head { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); touch-action: pan-x pan-y; }
.pcp-col-title { font-weight: 800; font-size: 0.86rem; letter-spacing: 0.04em; margin-bottom: 4px; }
.pcp-col.violet .pcp-col-title { color: #9c8fff; }
.pcp-col.amber .pcp-col-title { color: var(--amber); }
.pcp-col.blue .pcp-col-title { color: var(--blue); }
.pcp-col.green .pcp-col-title { color: var(--green); }
.pcp-col.teal .pcp-col-title { color: var(--teal); }
.pcp-col.red .pcp-col-title { color: var(--red); }
.pcp-col-sub { display: flex; justify-content: space-between; font-size: 0.76rem; color: var(--muted); }
.pcp-col-sub b { color: var(--text-2); }
.pcp-col-body {
  padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 120px; touch-action: pan-x pan-y;
}
.pcp-col-body.drag-over {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  outline: 2px dashed var(--primary-text); outline-offset: -4px; border-radius: 8px;
}
.pcp-empty { text-align: center; padding: 28px 10px; color: var(--muted); font-size: 0.82rem; border: 1px dashed var(--border); border-radius: 8px; }
.pcp-card[hidden], .pcp-empty[hidden] { display: none !important; }
.pcp-card {
  background: var(--bg); border: 1px solid color-mix(in srgb, var(--blue) 36%, var(--border));
  border-radius: 10px; padding: 10px 10px 0; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2); cursor: grab; touch-action: pan-x pan-y; user-select: none;
}
.pcp-col.violet .pcp-card { border-color: color-mix(in srgb, #7c6bff 36%, var(--border)); }
.pcp-col.amber .pcp-card { border-color: color-mix(in srgb, var(--amber) 36%, var(--border)); }
.pcp-col.green .pcp-card { border-color: color-mix(in srgb, var(--green) 36%, var(--border)); }
.pcp-col.red .pcp-card { border-color: color-mix(in srgb, var(--red) 36%, var(--border)); }
.pcp-card.stale { border-color: color-mix(in srgb, var(--amber) 60%, var(--border)); }
.pcp-card.dragging { opacity: 0.35; transform: scale(0.97); }
.pcp-card-ghost {
  position: fixed !important; z-index: 9999 !important; pointer-events: none !important;
  opacity: 0.94 !important; transform: rotate(2deg) scale(1.03) !important;
  box-shadow: 0 18px 38px rgba(0,0,0,0.55) !important; border-color: var(--primary-text) !important;
}
.pcp-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.pcp-num { display: block; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.pcp-title { display: block; font-weight: 800; font-size: 0.92rem; text-transform: uppercase; color: var(--text); margin: 1px 0; }
.pcp-title:hover { color: var(--primary-text); }
.pcp-client { font-size: 0.78rem; color: var(--text-2); text-transform: uppercase; }
.pcp-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: none;
}
.pcp-avatar .ic { width: 17px; height: 17px; }
.pcp-mid { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.pcp-left-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pcp-task-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--text-2); padding: 2px 0; }
.pcp-task-btn .ic { width: 14px; height: 14px; color: var(--green); }
.pcp-tag-btn {
  font-size: 0.74rem; padding: 2px 7px; border-radius: 6px; background: var(--surface-2);
  color: var(--muted); font-weight: 600;
}
.pcp-tag-btn.filled { background: color-mix(in srgb, var(--amber) 20%, var(--surface-2)); color: var(--amber); }
.pcp-stale-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 0.7rem; font-weight: 700;
  color: var(--amber); background: color-mix(in srgb, var(--amber) 16%, transparent); padding: 2px 6px; border-radius: 6px;
}
.pcp-stale-badge .ic { width: 12px; height: 12px; }
.pcp-side-icons { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.pcp-ic-btn { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.pcp-ic-btn:hover { background: var(--surface-2); color: var(--text); }
.pcp-ic-btn.green { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pcp-ic-btn.active { color: var(--blue); }
.pcp-ic-btn .ic { width: 15px; height: 15px; }
.pcp-foot {
  margin: 4px -10px 0; padding: 6px 10px; background: color-mix(in srgb, var(--red) 12%, var(--surface-2));
  border-top: 1px solid var(--border); border-radius: 0 0 9px 9px;
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.pcp-date { font-size: 0.76rem; font-weight: 700; color: var(--text-2); }
.pcp-timer-wrap { display: flex; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 6px; padding: 2px 6px; }
.pcp-timer-btn { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 700; color: var(--text); }
.pcp-timer-btn.running { color: var(--green); }
.pcp-timer-btn .ic { width: 13px; height: 13px; }
.pcp-open-btn { display: grid; place-items: center; color: var(--text-2); padding-left: 4px; border-left: 1px solid var(--border); }
.pcp-open-btn .ic { width: 14px; height: 14px; }

/* Tabela de Estoque avançada */
.wide-pad { max-width: 1120px; }
.stock-tabs { overflow-x: auto; white-space: nowrap; }
.stock-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.stock-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.stock-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.stock-table th {
  text-align: left; padding: 12px 10px; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.stock-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.stock-table tr:last-child td { border-bottom: 0; }
.stock-table tbody tr { cursor: pointer; transition: background 0.12s; }
.stock-table tbody tr:hover { background: var(--surface-2); }
.stock-table .c { text-align: center; }
.st-id { font-weight: 700; color: var(--muted); width: 48px; }
.st-type {
  display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.76rem; font-weight: 700;
  background: color-mix(in srgb, var(--blue) 18%, var(--surface-2)); color: var(--blue); white-space: nowrap;
}
.st-name b { margin-right: 6px; }
.st-spec {
  display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 0.73rem; font-weight: 700; margin-right: 4px; white-space: nowrap;
}
.st-spec.gray { background: var(--surface-3); color: var(--text-2); }
.st-spec.green { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green); }
.st-price { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.st-brand { color: var(--text-2); font-size: 0.86rem; }
.st-bars { display: inline-grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden; min-width: 150px; border: 1px solid var(--border); }
.st-cell { padding: 4px 10px; text-align: right; font-size: 0.84rem; }
.st-cell.ok { background: color-mix(in srgb, var(--green) 22%, var(--surface-2)); color: var(--green); }
.st-cell.low { background: color-mix(in srgb, var(--red) 22%, var(--surface-2)); color: var(--red); }
.st-rep { color: var(--muted); font-weight: 600; }
.st-act { width: 34px; height: 34px; }
.st-quick-btns { display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; }
.st-qbtn {
  min-height: 34px; padding: 5px 11px; border-radius: 7px; font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border); transition: transform 0.1s, background 0.15s;
}
.st-qbtn:active { transform: scale(0.96); }
.st-qbtn.in { background: color-mix(in srgb, var(--green) 16%, var(--surface-2)); color: var(--green); border-color: color-mix(in srgb, var(--green) 36%, var(--border)); }
.st-qbtn.out { background: color-mix(in srgb, var(--red) 16%, var(--surface-2)); color: var(--red); border-color: color-mix(in srgb, var(--red) 36%, var(--border)); }
.hscroll-grabbing, .hscroll-grabbing * { cursor: grabbing !important; user-select: none !important; }
.shortcuts { cursor: grab; user-select: none; }
.pcp-board { cursor: grab; }

/* Abas internas do Pedido (pedido | agenda | financeiro) */
.ord-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 4; margin-bottom: 12px;
}
.ord-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 6px; font-size: 0.82rem; font-weight: 600; color: var(--muted);
  border-bottom: 2.5px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.ord-tab .ic { width: 20px; height: 20px; }
.ord-tab.on { color: var(--primary-text); border-bottom-color: var(--primary-text); }
.ord-tab-ic-wrap { position: relative; display: inline-flex; }
.ord-tab-dot {
  position: absolute; top: -2px; right: -5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); border: 1.5px solid var(--surface);
}
.ord-field-row {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 12px 2px; border-bottom: 1px solid var(--border); text-align: left; gap: 10px;
}
.ord-field-row > span { min-width: 0; overflow-wrap: anywhere; }
.ord-field-row small { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.ord-field-row b { display: block; font-size: 0.96rem; font-weight: 500; color: var(--text); }
.ord-foot-total {
  text-align: center; font-size: 0.95rem; font-weight: 700; color: var(--primary-text);
  margin-bottom: 8px;
}
.ord-foot-result {
  text-align: center; font-size: 1.05rem; font-weight: 700; color: var(--primary-text);
  padding: 6px 0;
}
.ofin-sec-title { font-size: 1.2rem; font-weight: 800; margin: 16px 0 8px; color: var(--text); }
.ofin-empty-txt { color: var(--text-2); font-size: 0.92rem; line-height: 1.45; margin: 4px 0 14px; }
.ofin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; margin-top: 16px;
}
.ofin-card-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.ofin-card-head h3 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.ofin-info-ic {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted);
  color: var(--muted); display: inline-grid; place-items: center; font-size: 0.76rem; font-weight: 700;
}
.ofin-donut-wrap { display: flex; justify-content: center; align-items: center; padding: 6px 0 14px; }
.ofin-row {
  display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 0.95rem;
}
.ofin-row.total { font-weight: 800; font-size: 1rem; padding-bottom: 8px; }
.ofin-lbl { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.dot.gray { background: #6b7280; }
.ofin-empty-chart {
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 28px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--muted); text-align: center;
}
.ofin-bars { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
.ofin-bar-item { display: flex; flex-direction: column; gap: 5px; }
.ofin-bar-top { display: flex; justify-content: space-between; font-size: 0.88rem; }
.ofin-bar-track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ofin-bar-fill { height: 100%; border-radius: 99px; transition: width 0.25s; }
.ofin-bar-fill.green { background: var(--green); }
.ofin-bar-fill.red { background: var(--red); }

/* ---------- Documento (pré-visualização e impressão) ---------- */
.doc-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 4px; }
.paper-wrap { padding: 8px 12px 32px; overflow-x: auto; }
.paper { background: #fff; color: #1a1a1a; width: 100%; max-width: 820px; margin: 0 auto; border-radius: 6px; box-shadow: var(--shadow); padding: 56px 52px; }
.setup-banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); margin-bottom: 4px; }
.setup-banner > .ic:first-child { color: var(--primary-text); width: 28px; height: 28px; }
.setup-banner span { flex: 1; }
.setup-banner b { display: block; }
.setup-banner small { color: var(--text-2); }
#print-root { display: none; }
.doc { font-family: var(--font); font-size: 13px; color: #1a1a1a; line-height: 1.45; }
.doc p { margin: 0 0 3px; }
.doc-head { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 4px solid #ffc21a; margin-bottom: 16px; }
.doc-brand { display: flex; gap: 14px; align-items: center; }
.doc-brand img { max-width: 160px; max-height: 84px; object-fit: contain; }
.doc-brand h1 { font-size: 20px; margin-bottom: 3px; color: #1a1a1a; }
.doc-brand p { color: #555; font-size: 11.5px; }
.doc-id { text-align: right; white-space: nowrap; }
.doc-id h2 { font-size: 18px; letter-spacing: 0.08em; color: #111; margin-bottom: 4px; }
.doc-box { border: 1px solid #ddd; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; break-inside: avoid; page-break-inside: avoid; }
.doc-box h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #8a6400; margin-bottom: 6px; }
.doc-ref { margin-top: 6px !important; padding-top: 6px; border-top: 1px dashed #ddd; }
.doc-items { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.doc-items th { background: #fff3c4; color: #111; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding: 8px; text-align: left; }
.doc-items td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: top; }
.doc-items td small { display: block; color: #666; font-size: 11px; }
.doc-items .c { text-align: center; white-space: nowrap; }
.doc-items .r { text-align: right; white-space: nowrap; }
.doc-totals { margin-left: auto; min-width: 260px; border-collapse: separate; border-spacing: 0; margin-bottom: 14px; }
.doc-totals td { padding: 4px 8px; }
.doc-totals td:last-child { text-align: right; white-space: nowrap; }
.doc-totals .grand td + td { box-shadow: -2px 0 0 #111; }
.doc-totals .grand td { background: #111; color: #ffc21a; font-weight: 700; font-size: 15px; padding: 8px; }
.doc-pay-section { margin-bottom: 14px; break-inside: avoid; page-break-inside: avoid; }
.doc-sec-bar { background: #f2f2f2; color: #111; font-weight: 700; font-size: 14px; padding: 6px 10px; margin-bottom: 10px; border-radius: 4px; }
.doc-pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; padding: 0 6px; }
.doc-pay-grid h4 { margin: 0 0 3px; font-size: 12px; font-weight: 700; color: #111; }
.doc-pay-grid p { margin: 0; font-size: 12px; color: #333; line-height: 1.45; }
.doc-conds p { margin-bottom: 4px; }
.doc-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.doc-photo { margin: 0; border: 1px solid #eee; border-radius: 6px; padding: 6px; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.doc-photo img { max-width: 100%; max-height: 200px; object-fit: contain; border-radius: 4px; }
.doc-photo figcaption { font-size: 11px; color: #555; margin-top: 4px; }
.layout-3d-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 10px; }
.layout-3d-card { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); position: relative; }
.layout-3d-card .photo-slot-head { display: flex; align-items: center; justify-content: space-between; }
.layout-3d-card .photo-del { position: static; width: 32px; height: 32px; }
.layout-3d-card img { width: 100%; aspect-ratio: 16 / 9; height: auto; max-height: 220px; object-fit: cover; border-radius: 8px; border: 1.5px solid var(--primary); background: #111; }
.doc-3d-page {
  break-before: page;
  page-break-inside: avoid;
  break-inside: avoid;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.doc-3d-banner {
  background: linear-gradient(120deg, #ffe27a 0%, #ffc21a 55%, #f2a900 100%);
  background-color: #ffc21a;
  color: #111111;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(17, 17, 17, 0.12);
}
.doc-3d-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.doc-3d-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  break-inside: avoid;
  page-break-inside: avoid;
}
.doc-3d-label {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1a1a1a;
  text-align: center;
  margin: 0 0 8px !important;
}
.doc-3d-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 2.5px solid #ffc21a;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-3d-page.single-photo .doc-3d-frame {
  max-height: 112mm;
}
.doc-3d-page.two-photos .doc-3d-frame {
  max-height: 98mm;
}
.doc-3d-page.portrait-pair .doc-3d-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.doc-3d-item.portrait-photo .doc-3d-frame {
  aspect-ratio: 9 / 16;
  max-height: none;
}
.doc-3d-item.portrait-photo .doc-3d-frame {
  width: min(100%, 360px);
  margin-inline: auto;
}
.doc-3d-page.portrait-pair .doc-3d-item.portrait-photo .doc-3d-frame {
  width: 100%;
}
.doc-3d-page.portrait-pair .doc-3d-item:not(.portrait-photo) .doc-3d-frame {
  aspect-ratio: 16 / 9;
  max-height: 98mm;
  width: 100%;
}
.doc-3d-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.doc-sign { display: flex; gap: 40px; margin-top: 28px; align-items: flex-start; break-inside: avoid; page-break-inside: avoid; }
.doc-sig-box { height: 68px; display: flex; align-items: flex-end; justify-content: center; }
.doc-sig { display: block; max-width: min(220px, 100%); max-height: 64px; margin: 0 auto -4px; object-fit: contain; }
.doc-sign > div { min-width: 0; flex: 1; text-align: center; }
.doc-sign.single > div { max-width: 340px; margin: 0 auto; }
.doc-sign > div:only-child { max-width: 340px; margin: 0 auto; }
.doc-sign span { display: block; border-top: 1px solid #333; margin-bottom: 6px; }
.doc-sign small { color: #666; font-size: 11px; }
.doc-receipt { padding: 20px 6px; font-size: 15px; line-height: 1.8; }
.doc-amount { font-size: 26px; font-weight: 800; text-align: right; color: #111; margin-bottom: 16px !important; }
.doc-city { text-align: right; margin-top: 18px !important; }
.doc-foot { margin-top: 26px; text-align: center; color: #aaa; font-size: 10px; }
@media (max-width: 560px) {
  .paper { padding: 22px 18px; }
  .doc { font-size: 11px; }
  .doc-head { flex-direction: column; }
  .doc-id { text-align: left; }
  .doc-items th, .doc-items td { padding: 5px 4px; }
  .doc-pay-grid { grid-template-columns: 1fr; gap: 8px; }
  .doc-photos { grid-template-columns: 1fr; }
  .doc-sign { gap: 16px; }
  .doc-sign small { font-size: 9px; }
}

/* Geração de PDF no Android: sempre em tamanho A4 de computador */
.pdf-render { position: fixed; left: -10000px; top: 0; width: 760px; background: #fff; }
.pdf-render .doc { font-size: 12px; }
.pdf-render .doc-head { flex-direction: row; }
.pdf-render .doc-id { text-align: right; }
.pdf-render .doc-items th, .pdf-render .doc-items td { padding: 8px; }
.pdf-render .doc-items tr { break-inside: avoid; page-break-inside: avoid; }

.doc-os-thumb { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.doc-os-thumb img { width: 80px; height: 56px; object-fit: contain; }
.doc-os-image { margin: 4mm 0; text-align: center; break-inside: avoid; }
.doc-os-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 145mm; margin: 0 auto; }
.doc-os-image figcaption { margin-top: 2mm; color: #444; }
.doc-os-extra { break-before: page; page-break-before: always; }
.doc-os-extra .doc-os-image img { max-height: 210mm; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  :root, :root[data-theme] {
    --bg: #ffffff !important;
    --surface: #ffffff !important;
    color-scheme: light !important;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1a1a1a !important;
  }
  #app, #overlay-root, #toast-root, .chart-tip { display: none !important; }
  #print-root { display: block !important; background: #ffffff !important; margin: 0 !important; padding: 0 !important; }
  .doc { font-size: 12px; background: #ffffff !important; }
  #print-root, #print-root > .doc { border: 0 !important; outline: 0 !important; box-shadow: none !important; }
  .doc-items tr { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Caixa do dia (Dinheiro físico) ---------- */
.cash-hero {
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 16%, var(--surface)) 0%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--border));
  margin-bottom: 14px;
}
.cash-hero-top {
  margin-bottom: 14px;
}
.cash-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--primary-text);
  margin-bottom: 4px;
}
.cash-badge .ic {
  width: 15px;
  height: 15px;
}
.cash-balance {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin: 2px 0 4px;
  line-height: 1.15;
}
.cash-balance.neg {
  color: var(--red);
}
.cash-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.cash-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.cash-stat small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 2px;
}
.cash-stat b {
  font-size: 0.92rem;
}
@media (max-width: 480px) {
  .cash-hero-grid {
    grid-template-columns: 1fr;
  }
  .cash-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .cash-stat small {
    margin-bottom: 0;
  }
}
.cash-quick-card {
  margin-bottom: 16px;
}
.cash-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.cash-quick-head h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}
.cash-kind-toggle {
  display: inline-flex;
  gap: 6px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.cash-kind-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.cash-kind-btn .ic {
  width: 15px;
  height: 15px;
}
.cash-kind-btn.in.on {
  background: color-mix(in srgb, var(--green) 22%, var(--surface-3));
  color: var(--green);
}
.cash-kind-btn.out.on {
  background: color-mix(in srgb, var(--red) 22%, var(--surface-3));
  color: var(--red);
}
.cash-client-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cash-client-wrap input {
  flex: 1;
}
.cash-mov-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.cash-mov-row:last-child {
  border-bottom: 0;
}
.cash-mov-row:hover {
  background: var(--surface-2);
}
.cash-mov-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}
.cash-mov-ic .ic {
  width: 17px;
  height: 17px;
}
.cash-mov-ic.in {
  background: color-mix(in srgb, var(--green) 18%, var(--surface-2));
  color: var(--green);
}
.cash-mov-ic.out {
  background: color-mix(in srgb, var(--red) 18%, var(--surface-2));
  color: var(--red);
}
.cash-mov-row .grow b {
  display: block;
  font-size: 0.94rem;
}
.cash-mov-row .grow small {
  display: block;
  color: var(--text-2);
  font-size: 0.78rem;
  margin-top: 1px;
}
.cash-mov-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.cash-day-card {
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s, transform 0.1s;
}
.cash-day-card:hover {
  border-color: var(--primary);
}
.cash-day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.cash-day-head b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.98rem;
}
.cash-day-head b .ic {
  width: 17px;
  height: 17px;
  color: var(--primary-text);
}
.cash-day-head small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}
.cash-day-close-bal {
  text-align: right;
}
.cash-day-close-bal small {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}
.cash-day-close-bal b {
  display: block;
  font-size: 1.04rem;
}
.cash-day-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.8rem;
  padding: 8px 10px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.cash-day-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cash-mini-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-2);
  padding: 2px 0;
}
.cash-day-summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.cash-day-summary .kv.total {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-size: 0.98rem;
}

/* ==========================================================================
   NOVU NOTIFICATION SYSTEM & CUSTOM LUXURY PICKER STYLES
   ========================================================================== */

/* Topbar Novu Bell Button & Badge */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.novu-bell-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.novu-bell-btn.has-unread {
  color: var(--primary-text);
}
.novu-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  pointer-events: none;
  line-height: 1;
}

/* Novu Drawer Overlay & Panel */
body.novu-open {
  overflow: hidden !important;
}
.novu-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  overflow: hidden;
  box-sizing: border-box;
  animation: novuFadeIn 0.2s ease;
}
.novu-overlay.closing {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
@keyframes novuFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.novu-inbox-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 440px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  position: relative;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  animation: novuDrawerIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes novuDrawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
@media (max-width: 600px) {
  .novu-inbox-panel {
    max-width: 100vw;
    width: 100vw;
    border-left: 0;
  }
}
.novu-header {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: max(12px, calc(12px + env(safe-area-inset-top)));
  padding-bottom: 12px;
  padding-left: max(14px, calc(14px + env(safe-area-inset-left)));
  padding-right: max(14px, calc(14px + env(safe-area-inset-right)));
  position: relative;
  z-index: 10;
}
.novu-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.novu-bell-icon {
  flex-shrink: 0;
  color: var(--primary-text);
  display: grid;
  place-items: center;
}
.novu-bell-icon .ic {
  width: 20px;
  height: 20px;
}
.novu-header h2 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.novu-chip {
  flex-shrink: 0;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
}
.novu-chip.gold {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-text);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.novu-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.novu-header-actions .icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.novu-header-actions .icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.novu-header-actions .icon-btn:active {
  transform: scale(0.92);
}
.novu-header-actions .icon-btn .ic {
  width: 18px;
  height: 18px;
}
@media (max-width: 400px) {
  .novu-header {
    padding-left: max(10px, calc(10px + env(safe-area-inset-left)));
    padding-right: max(10px, calc(10px + env(safe-area-inset-right)));
    gap: 6px;
  }
  .novu-header h2 {
    font-size: 0.95rem;
  }
  .novu-header-actions .icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
}
.novu-tabs {
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  padding-left: max(14px, calc(14px + env(safe-area-inset-left)));
  padding-right: max(14px, calc(14px + env(safe-area-inset-right)));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.novu-tabs::-webkit-scrollbar {
  display: none;
}
.novu-tab {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.novu-tab:hover {
  background: var(--surface);
  border-color: var(--primary-text);
  color: var(--text);
}
.novu-tab.active {
  background: var(--primary);
  color: var(--on-primary);
  border-color: var(--primary);
  font-weight: 600;
}
.novu-body {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 14px;
  padding-left: max(14px, calc(14px + env(safe-area-inset-left)));
  padding-right: max(14px, calc(14px + env(safe-area-inset-right)));
  padding-bottom: max(20px, calc(16px + env(safe-area-inset-bottom)));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.novu-item {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.15s ease;
  position: relative;
}
.novu-item.unread {
  border-color: color-mix(in srgb, var(--primary) 35%, transparent);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}
.novu-item-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.novu-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.novu-cat-icon .ic {
  width: 18px;
  height: 18px;
}
.novu-cat-icon.amber { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-text); }
.novu-cat-icon.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green); }
.novu-cat-icon.red { background: color-mix(in srgb, var(--red) 18%, transparent); color: var(--red); }
.novu-cat-icon.purple { background: color-mix(in srgb, #a855f7 18%, transparent); color: #c084fc; }
.novu-cat-icon.blue { background: color-mix(in srgb, #3b82f6 18%, transparent); color: #60a5fa; }
.novu-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}
.novu-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.novu-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.novu-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
  min-width: 0;
}
.novu-time, .novu-item-time {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.novu-item-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
}
.novu-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.novu-btn-read, .novu-btn-del {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  padding: 4px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-size: 0.75rem;
}
.novu-btn-read:hover {
  background: var(--surface);
  color: var(--green);
  border-color: var(--green);
}
.novu-btn-del:hover {
  background: var(--surface);
  color: var(--red);
  border-color: var(--red);
}
.novu-empty {
  margin: auto 0;
  text-align: center;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.novu-empty-art {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.novu-empty-ic {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.novu-empty-ic .ic {
  width: 28px;
  height: 28px;
}
.novu-empty-star {
  position: absolute;
  top: -4px;
  right: -4px;
  color: var(--primary-text);
}
.novu-empty-star .ic {
  width: 20px;
  height: 20px;
}

/* Modal de Preferências de Notificação (Novu Preferences) */
.novu-prefs-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 500px;
  margin: auto;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 32px);
  animation: novuPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 600px) {
  .novu-prefs-panel {
    border-radius: 0;
    height: 100%;
    max-height: 100dvh;
    max-width: 100vw;
    width: 100vw;
    margin: 0;
    border: none;
  }
}
.novu-prefs-body {
  box-sizing: border-box;
  width: 100%;
  padding: 16px 18px;
  padding-left: max(16px, calc(16px + env(safe-area-inset-left)));
  padding-right: max(16px, calc(16px + env(safe-area-inset-right)));
  padding-bottom: max(24px, calc(20px + env(safe-area-inset-bottom)));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
}
.novu-pref-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.novu-pref-group > b {
  font-size: 0.85rem;
  color: var(--primary-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Custom Select Picker Modal (Substitui o Select Nativo do Android) */
.custom-select-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 12px;
}
.csp-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-weight: 600;
  padding: 12px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  margin-bottom: 2px;
}
.csp-add-btn .ic {
  width: 18px;
  height: 18px;
}
.csp-search {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 4px;
}
.csp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 2px;
}
.csp-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.csp-item:hover, .csp-item:focus {
  background: var(--surface-2);
  border-color: var(--border-hover, var(--primary-text));
}
.csp-item.selected {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  border-color: var(--primary);
  font-weight: 600;
  color: var(--primary-text);
}
.csp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.csp-item.selected .csp-dot {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}
.csp-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.csp-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}
.csp-check .ic {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* Proteção de layout para telas estreitas: rótulos e botões não invadem elementos vizinhos. */
.btn { min-width: 0; max-width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
.btn > .ic { flex: none; }
.grow { min-width: 0; }
.team-row { min-width: 0; }
.team-row-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; min-width: 0; }
.home-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.home-kpi { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.home-kpi small, .home-kpi span { color: var(--muted); font-size: 0.8rem; }
.home-kpi b { font-size: 1.25rem; overflow-wrap: anywhere; }
.home-kpi span { line-height: 1.35; }
.today-row.attention { color: var(--red); }
.order-flow { margin: 8px 0 14px; padding: 14px; }
.order-flow-head, .order-flow-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.order-flow-head > div, .order-flow-next > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.order-flow-head small, .order-flow-next small, .order-flow-next span { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.order-flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.order-flow-step { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 0.76rem; }
.order-flow-step i { width: 24px; height: 24px; display: grid; place-items: center; flex: none; border-radius: 50%; border: 1px solid var(--border); font-style: normal; font-weight: 700; }
.order-flow-step.done { color: var(--green); }
.order-flow-step.done i { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--surface)); }
.order-flow-step.current { color: var(--primary-text); font-weight: 700; }
.order-flow-step.current i { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 15%, var(--surface)); }
.order-flow-next { padding-top: 12px; border-top: 1px solid var(--border); }
.order-flow-next b { overflow-wrap: anywhere; }
.order-margin-inline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 0.83rem; }
.order-margin-inline small { flex-basis: 100%; color: var(--muted); }
.order-cost-card > .muted { line-height: 1.5; }
.backup-pending { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--amber) 12%, var(--surface)); color: var(--text-2); font-size: 0.83rem; line-height: 1.45; }
.cloud-economy { display: grid; gap: 0; }
.cloud-economy > div { min-width: 0; display: grid; gap: 4px; padding: 12px 0; }
.cloud-economy > div + div { border-top: 1px solid var(--border); }
.cloud-economy b { overflow-wrap: anywhere; }
.cloud-economy small { color: var(--muted); line-height: 1.5; }
.member-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.member-row > .avatar { grid-column: 1; grid-row: 1; }
.member-row > .grow { grid-column: 2; grid-row: 1; min-width: 0; overflow-wrap: anywhere; }
.member-actions { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.space-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.space-actions .btn { flex: 1 1 210px; }

@media (max-width: 600px) {
  .pad-x { padding-left: 14px; padding-right: 14px; }
  .home-kpis { gap: 8px; }
  .home-kpi { padding: 12px; }
  .home-kpi b { font-size: 1.1rem; }
  .today-row { align-items: flex-start; gap: 9px; }
  .today-row small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .order-flow { padding: 12px; }
  .order-flow-head, .order-flow-next { align-items: flex-start; flex-wrap: wrap; }
  .order-flow-next > div { flex-basis: 100%; }
  .order-flow-next .btn { width: 100%; }
  .order-flow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .order-flow-step { overflow-wrap: anywhere; }
  .order-cost-card .ofin-row { gap: 6px; flex-wrap: wrap; }
  .btn-pair, .toolbar-2, .search-filter-row { flex-wrap: wrap; }
  .btn-pair > *, .toolbar-2 > *, .search-filter-row > * { min-width: 0; max-width: 100%; }
  .oc-top, .oc-bottom { flex-wrap: wrap; }
  .oc-client, .oc-total { min-width: 0; overflow-wrap: anywhere; }
  .mini-row, .appt-row { min-width: 0; flex-wrap: wrap; }
  .mini-row .grow, .appt-row .grow { min-width: 0; overflow-wrap: anywhere; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .space-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .space-actions .btn { width: 100%; }
  input, select, textarea { min-width: 0; max-width: 100%; }
  .pill, .stock-badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .team-row { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: start; column-gap: 12px; row-gap: 8px; }
  .team-row > .cat-ic { grid-column: 1; grid-row: 1 / span 2; }
  .team-row > .grow { grid-column: 2; grid-row: 1; overflow-wrap: anywhere; }
  .team-row-meta { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .member-row { grid-template-columns: 42px minmax(0, 1fr); row-gap: 8px; }
  .member-row > .avatar { grid-column: 1; grid-row: 1 / span 2; }
  .member-row > .grow { grid-column: 2; grid-row: 1; }
  .member-actions { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .member-actions .select { flex: 1 1 150px; min-width: 0; max-width: 240px; }
  .member-actions .select select { width: 100%; }
  .tx-row {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    grid-template-areas: "dot main" ". actions";
    align-items: start;
    gap: 8px 10px;
    padding: 14px 0;
    min-width: 0;
  }
  .tx-row > .dot { grid-area: dot; margin-top: 6px; }
  .tx-row > .grow { grid-area: main; min-width: 0; width: 100%; overflow-wrap: anywhere; }
  .tx-row > .tx-right {
    grid-area: actions;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    width: 100%;
  }
  .tx-row .tx-right > b { align-self: flex-end; }
  .tx-row .tx-btns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    width: 100%;
    gap: 6px;
  }
  .tx-row .tx-btns .btn {
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
    padding: 7px 8px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }
  .tx-meta { min-width: 0; line-height: 1.4; }
  .tx-client-tag, .tx-order-tag { max-width: 100%; overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .home-kpis { grid-template-columns: 1fr; }
  .tile { padding: 12px; font-size: 0.95rem; }
  .order-flow-step { font-size: 0.7rem; }
}

/* ---------- Agenda: escolha entre privada e geral ---------- */
.agenda-chooser { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; padding-bottom: 20px; }
.agenda-chooser > p { margin: 0 0 2px; }
.agenda-choice {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  padding: 18px 16px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.agenda-choice:hover, .agenda-choice:focus-visible { border-color: var(--primary); }
.agenda-choice:active { transform: scale(0.99); }
.agenda-choice .grow { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.agenda-choice b { font-size: 1.05rem; }
.agenda-choice small { color: var(--muted); line-height: 1.35; }
.agenda-choice-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.agenda-choice-ic .ic { width: 24px; height: 24px; }
.agenda-choice-ic.privada { color: var(--primary-text); background: color-mix(in srgb, var(--primary) 16%, var(--surface-2)); }
.agenda-choice-ic.geral { color: var(--teal); background: color-mix(in srgb, var(--teal) 16%, var(--surface-2)); }
.agenda-choice-count { flex: none; display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.8rem; white-space: nowrap; }
.agenda-scope { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; }
.agenda-scope-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); }
.agenda-scope-seg a {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px;
  border-radius: 9px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.9rem;
}
.agenda-scope-seg a .ic { width: 16px; height: 16px; }
.agenda-scope-seg a.active { background: var(--primary); color: var(--on-primary); }
.agenda-scope > small { line-height: 1.35; }
.wa-config { display: grid; gap: 12px; }
.wa-config [hidden] { display: none !important; }
.wa-config-head { display: flex; align-items: center; gap: 10px; }
.wa-config-head > .ic { color: var(--green); }
.wa-config-head small, .wa-config [data-models] small { display: block; }
.wa-config-head .chip { white-space: nowrap; }
.wa-config form > * { grid-column: 1 / -1; }
.wa-protected { border-radius: 12px; background: var(--surface-2); padding: 12px; }
.wa-protected b { display: flex; align-items: center; gap: 6px; }
.wa-protected .ic { color: var(--green); }
.wa-protected small { display: block; color: var(--muted); margin-top: 6px; }
.wa-config [data-diagnosis]:empty { display: none; }
