/* ============================================================
   PCP — Design System
   Neutral ramp from the brand palette:
     #f7f4ef  #e9e3db  #b2b5b8  #8a8f94  #4a4f55
   Warm/cream in light, refined near-black in dark (default).
   Single accent (indigo, tweakable). Geist-style grotesque.
   ============================================================ */

:root {
  --accent-h: 264;
  --accent: oklch(0.60 0.16 var(--accent-h));
  --accent-press: oklch(0.55 0.16 var(--accent-h));
  --accent-ink: #ffffff;
  --accent-tint: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 36%, transparent);

  --radius: 9px;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-lg: calc(var(--radius) + 4px);

  --nav-w: 244px;
  --top-h: 56px;

  /* density (overridden by [data-density]) */
  --row-h: 42px;
  --pad: 16px;
  --gap: 16px;

  --font: "Geist", "Hanken Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --num: "Geist", "Hanken Grotesk", system-ui, sans-serif;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}

[data-density="compact"]  { --row-h: 36px; --pad: 12px; --gap: 12px; }
[data-density="comfortable"] { --row-h: 50px; --pad: 22px; --gap: 22px; }

/* ---------------- DARK (default) ---------------- */
:root, [data-theme="dark"] {
  --bg:        #0b0c0e;
  --surface:   #141518;
  --raised:    #1a1c20;
  --sidebar:   #0e0f11;
  --overlay:   #16181c;

  --line:      #25272c;
  --line-soft: #1d1f23;
  --line-strong: #34373d;

  --ink:       #f3f2ef;
  --ink-soft:  #c0c2c5;
  --muted:     #8a8f94;
  --faint:     #5c6066;

  --ok:    oklch(0.70 0.13 155);
  --warn:  oklch(0.76 0.13 75);
  --crit:  oklch(0.66 0.16 22);
  --info:  oklch(0.70 0.10 230);

  --ok-tint:   color-mix(in srgb, var(--ok) 14%, transparent);
  --warn-tint: color-mix(in srgb, var(--warn) 15%, transparent);
  --crit-tint: color-mix(in srgb, var(--crit) 15%, transparent);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 8px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
  --scrim:     rgba(0,0,0,.6);
  color-scheme: dark;
}

/* ---------------- LIGHT — Minimalismo Corporativo ----------------
/* ---------------- LIGHT — Corporativo Sálvia (verde + neutros encorpados)
   Fundo grafite-sálvia claro · cards claros · acento verde-petróleo */
[data-theme="light"] {
  --bg:        #e7ebe9;
  --surface:   #f5f8f7;
  --raised:    #eef2f0;
  --sidebar:   #dde3e1;
  --overlay:   #f7faf9;

  --line:      #d2dad7;
  --line-soft: #dde3e0;
  --line-strong: #bbc6c2;

  --ink:       #28302d;
  --ink-soft:  #424c48;
  --muted:     #6d7975;
  --faint:     #9aa5a0;

  --ok:    oklch(0.50 0.10 158);
  --warn:  oklch(0.58 0.12 60);
  --crit:  oklch(0.52 0.16 25);
  --info:  #1b365d;

  --ok-tint:   color-mix(in srgb, var(--ok) 13%, transparent);
  --warn-tint: color-mix(in srgb, var(--warn) 15%, transparent);
  --crit-tint: color-mix(in srgb, var(--crit) 13%, transparent);

  --accent-ink: #ffffff;
  --shadow-sm: 0 1px 2px rgba(34,44,40,.07);
  --shadow:    0 10px 30px rgba(34,44,40,.10);
  --shadow-lg: 0 24px 60px rgba(20,46,40,.18);
  --scrim:     rgba(30,38,35,.38);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
.num, .tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
::selection { background: var(--accent-tint); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   APP SHELL
   ============================================================ */
#root, .app { height: 100%; }
.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  grid-template-rows: 100%;
  overflow: hidden;
}
.app.nav-collapsed { --nav-w: 64px; }

.main {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--top-h) 1fr;
  overflow: hidden;
}
.view {
  overflow: auto;
  padding: 26px 30px 60px;
  scroll-behavior: smooth;
}
.view-inner { max-width: 1280px; margin: 0 auto; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.sb-top { padding: 12px 12px 8px; }
.workspace {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px; border-radius: var(--radius);
  border: 1px solid transparent; background: transparent;
  cursor: pointer; color: var(--ink); transition: background .12s var(--ease);
}
.workspace:hover { background: var(--raised); }
.ws-logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
  color: var(--accent-ink); letter-spacing: -0.03em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.ws-meta { min-width: 0; flex: 1; text-align: left; }
.ws-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-caret { color: var(--muted); flex: none; }

.sb-search {
  margin: 4px 12px 10px;
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg);
  color: var(--muted); cursor: text; transition: border-color .12s;
}
.sb-search:hover { border-color: var(--line-strong); }
.sb-search .kbd { margin-left: auto; }
.sb-search span.lbl { font-size: 12.5px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; min-height: 0; }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 14px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  height: 34px; padding: 0 9px; border-radius: var(--radius);
  color: var(--ink-soft); cursor: pointer; position: relative;
  transition: background .1s var(--ease), color .1s;
  white-space: nowrap;
}
.nav-item:hover { background: var(--raised); color: var(--ink); }
.nav-item.active { background: var(--accent-tint); color: var(--ink); }
.nav-item.active .ico { color: var(--accent); }
.nav-item .ico { color: var(--muted); flex: none; transition: color .1s; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .lbl { font-size: 13.5px; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count {
  font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 1px 7px;
}
.nav-item .count.alert { color: var(--crit); border-color: var(--crit-tint); background: var(--crit-tint); }

.nav-item .nav-caret { color: var(--faint); margin-left: auto; flex: none; transition: transform .16s ease; }
.nav-item .nav-caret:not(.open) { transform: rotate(-90deg); }
.nav-item.parent-active { color: var(--ink); }
.nav-item.parent-active .ico { color: var(--accent); }
.nav-sub { margin: 1px 0 3px; position: relative; }
.nav-sub::before { content: ""; position: absolute; left: 17px; top: 3px; bottom: 5px; width: 1px; background: var(--line); }
.nav-item.sub { height: 31px; padding-left: 32px; }
.nav-item.sub .lbl { font-size: 12.5px; }
.app.nav-collapsed .nav-sub, .app.nav-collapsed .nav-caret { display: none; }

.mkt-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  color: var(--ink-soft); background: var(--raised); border: 1px solid var(--line);
  border-radius: 20px; padding: 1px 9px 1px 7px; margin-right: 10px; vertical-align: 1px; }
.mkt-chip .ico { color: var(--accent); }

.app.nav-collapsed .ws-meta, .app.nav-collapsed .ws-caret,
.app.nav-collapsed .nav-item .lbl, .app.nav-collapsed .nav-item .count,
.app.nav-collapsed .nav-group, .app.nav-collapsed .sb-search span,
.app.nav-collapsed .sb-foot-meta { display: none; }
.app.nav-collapsed .sb-search { justify-content: center; }
.app.nav-collapsed .workspace { justify-content: center; }

.sb-foot { border-top: 1px solid var(--line); padding: 10px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--radius); cursor: pointer; }
.sb-user:hover { background: var(--raised); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--line-strong); color: var(--ink);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  z-index: 20;
}
.tb-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-crumb .ico-btn { margin-right: 2px; }
.tb-title { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.tb-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tb-spacer { flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 8px; }

/* connection pill */
.conn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 11px; border-radius: 20px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  transition: border-color .14s var(--ease), color .14s var(--ease);
}
.conn:hover { border-color: var(--line-strong); }
.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); position: relative; flex: none; }
.conn.online .dot { box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s var(--ease) infinite; }
.conn.offline { color: var(--warn); border-color: var(--warn-tint); background: var(--warn-tint); }
.conn.offline .dot { background: var(--warn); animation: none; }
.conn.syncing .dot { background: var(--info); animation: none; }
.conn .qbadge { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 5px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* offline banner */
.offline-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 12.5px; font-weight: 500;
  background: var(--warn-tint); color: var(--warn);
  border-bottom: 1px solid var(--warn-tint);
}
.offline-banner b { color: var(--ink); }
.offline-banner .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: var(--radius);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: background .12s var(--ease), border-color .12s, transform .04s, box-shadow .12s;
}
.btn:hover { background: var(--raised); border-color: var(--muted); }
.btn:active { transform: translateY(.5px); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 38px; padding: 0 18px; font-size: 14px; }
.btn.primary {
  background: var(--accent); border-color: transparent; color: var(--accent-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, var(--shadow-sm);
}
.btn.primary:hover { background: var(--accent-press); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.ghost:hover { background: var(--raised); color: var(--ink); }
.btn.danger { color: var(--crit); border-color: var(--crit-tint); }
.btn.danger:hover { background: var(--crit-tint); border-color: var(--crit); }
.btn .ico { opacity: .85; }
.btn.is-disabled, .btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.ico-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--radius); border: 1px solid transparent; background: transparent;
  color: var(--ink-soft); cursor: pointer; transition: background .12s, color .12s;
  flex: none;
}
.ico-btn:hover { background: var(--raised); color: var(--ink); }
.ico-btn.bordered { border-color: var(--line); background: var(--surface); }
.ico-btn.bordered:hover { border-color: var(--line-strong); }

.kbd {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 18px; height: 19px; padding: 0 5px; border-radius: 5px;
  font-size: 11px; font-weight: 600; font-family: var(--num);
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  box-shadow: 0 1px 0 var(--line);
}

/* ============================================================
   CARDS / SURFACES
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card-pad { padding: var(--pad); }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card-head h3 { margin: 0; font-size: 13.5px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .spacer { flex: 1; }

/* section heading */
.page-head { margin-bottom: 20px; }
.crumb { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 6px; }
.page-title { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.page-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.head-row { display: flex; align-items: flex-end; gap: 16px; }
.head-row > :first-child { flex: 1 1 auto; min-width: 0; }
.head-row .spacer { display: none; }
.head-row > .row { flex: none; }

.sec-label {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 10px; margin: 26px 0 12px;
}
.sec-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metrics { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 15px 16px; position: relative; overflow: hidden;
  transition: border-color .14s, transform .14s var(--ease);
}
.metric.clickable { cursor: pointer; }
.metric.clickable:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.metric .m-top { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.metric .m-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-soft); flex: none; }
.metric .m-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.metric .m-value { font-size: 26px; font-weight: 640; letter-spacing: -0.025em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.metric .m-value .unit { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.metric .m-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; margin-top: 5px; color: var(--muted); }
.metric .m-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric .m-delta.up { color: var(--ok); }
.metric .m-delta.down { color: var(--crit); }

.metric.is-crit { border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); background: color-mix(in srgb, var(--crit) 6%, var(--surface)); }
.metric.is-crit .m-ico { color: var(--crit); background: var(--crit-tint); border-color: transparent; }
.metric.is-crit .m-value { color: var(--crit); }
.metric.is-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.metric.is-warn .m-ico { color: var(--warn); background: var(--warn-tint); border-color: transparent; }
.metric.is-ok .m-ico { color: var(--ok); background: var(--ok-tint); border-color: transparent; }
.metric .spark { position: absolute; right: 0; bottom: 0; opacity: .5; pointer-events: none; }

/* ============================================================
   BADGES / CHIPS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
}
.badge.dotted::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.ok   { color: var(--ok);   background: var(--ok-tint);   border-color: transparent; }
.badge.warn { color: var(--warn); background: var(--warn-tint); border-color: transparent; }
.badge.crit { color: var(--crit); background: var(--crit-tint); border-color: transparent; }
.badge.info { color: var(--info); background: color-mix(in srgb, var(--info) 14%, transparent); border-color: transparent; }
.badge.accent { color: var(--accent); background: var(--accent-tint); border-color: transparent; }
.badge.solid-crit { color: #fff; background: var(--crit); border-color: transparent; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 6px 0 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
}
.chip b { color: var(--ink); font-weight: 600; }
.chip .x { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.chip .x:hover { background: var(--crit-tint); color: var(--crit); }

/* ============================================================
   TABLE
   ============================================================ */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); padding: 0 14px; height: 36px; position: sticky; top: 0;
  background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1;
  user-select: none;
}
table.tbl th.sortable { cursor: pointer; }
table.tbl th.sortable:hover { color: var(--ink); }
table.tbl th .sort-ico { opacity: .5; vertical-align: middle; margin-left: 3px; }
table.tbl th.num, table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td { padding: 0 14px; height: var(--row-h); border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
table.tbl tbody tr { transition: background .1s; }
table.tbl tbody tr:hover { background: var(--raised); }
table.tbl tbody tr.selected { background: var(--accent-tint); }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl td .strong { color: var(--ink); font-weight: 550; }
table.tbl tr.row-crit > td:first-child { box-shadow: inset 3px 0 0 var(--crit); }
table.tbl tr.row-crit { background: color-mix(in srgb, var(--crit) 5%, transparent); }
table.tbl tr.row-warn > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.tbl tr.row-warn { background: color-mix(in srgb, var(--warn) 5%, transparent); }
.mono { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.sku { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 7px; overflow: hidden; background: var(--surface); }
.stepper button { width: 26px; height: 26px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; }
.stepper button:hover { background: var(--raised); color: var(--ink); }
.stepper button.minus:hover { color: var(--crit); }
.stepper button.plus:hover { color: var(--ok); }
.stepper .v { min-width: 38px; text-align: center; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line); border-right: 1px solid var(--line); height: 26px; display: grid; place-items: center; }
.flash-ok { animation: flashok .6s var(--ease); }
@keyframes flashok { 0% { background: var(--ok-tint); } 100% { background: transparent; } }

/* progress bar */
.bar { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .5s var(--ease); }
.bar.ok > span { background: var(--ok); }
.bar.warn > span { background: var(--warn); }
.bar.crit > span { background: var(--crit); }

/* ============================================================
   SEARCH INPUT / FILTERS
   ============================================================ */
.input {
  display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 11px;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--ink); font-size: 13px; font-family: inherit; }
.input input::placeholder { color: var(--muted); }
.input .ico { color: var(--muted); flex: none; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; }
.seg button { height: 26px; padding: 0 12px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; font-size: 12.5px; font-weight: 550; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ============================================================
   SIDE PANEL (detail)
   ============================================================ */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: var(--gap); align-items: start; }
@media (max-width: 1180px) { .detail-grid { grid-template-columns: 1fr; } }
.side-panel { position: sticky; top: 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; color: var(--ink); font-weight: 500; }

/* empty / placeholder */
.empty { text-align: center; padding: 46px 24px; color: var(--muted); }
.empty .e-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--bg); border: 1px solid var(--line); color: var(--faint); }
.empty h4 { margin: 0 0 4px; color: var(--ink); font-size: 14px; font-weight: 600; }
.empty p { margin: 0 auto 16px; font-size: 13px; max-width: 320px; }

.img-slot { border: 1px dashed var(--line-strong); border-radius: var(--radius); background:
  repeating-linear-gradient(45deg, transparent, transparent 7px, color-mix(in srgb, var(--muted) 8%, transparent) 7px, color-mix(in srgb, var(--muted) 8%, transparent) 8px);
  display: grid; place-items: center; color: var(--muted); font-family: var(--num); font-size: 11px; }

/* ============================================================
   KANBAN
   ============================================================ */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(266px, 1fr); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 280px); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 11px 13px; position: sticky; top: 0; }
.kcol-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.kcol-head .t { font-size: 12.5px; font-weight: 600; }
.kcol-head .n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 0 7px; }
.kcol-body { padding: 4px 9px 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; }
.kcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px; cursor: pointer; transition: border-color .12s, transform .08s, box-shadow .12s;
}
.kcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kcard .kc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.kcard .os { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.kcard .kc-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.kcard .kc-cli { font-size: 12px; color: var(--muted); }
.kcard .kc-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); }
.kcard .kc-foot .spacer { flex: 1; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   TIMELINE / GANTT (PCP programação)
   ============================================================ */
.gantt { overflow-x: auto; }
.gantt-grid { display: grid; min-width: 760px; }
.gantt-row { display: grid; grid-template-columns: 190px 1fr; border-bottom: 1px solid var(--line-soft); align-items: center; }
.gantt-row.head { border-bottom: 1px solid var(--line); }
.gantt-res { padding: 10px 12px; font-size: 12.5px; }
.gantt-res .r-name { font-weight: 600; color: var(--ink); }
.gantt-res .r-sub { font-size: 11px; color: var(--muted); }
.gantt-track { position: relative; height: 100%; min-height: 46px; border-left: 1px solid var(--line); }
.gantt-cols { position: absolute; inset: 0; display: grid; }
.gantt-cols > div { border-right: 1px solid var(--line-soft); }
.gantt-days { display: grid; }
.gantt-days > div { padding: 8px 0; text-align: center; font-size: 11px; color: var(--muted); border-right: 1px solid var(--line-soft); }
.gbar { position: absolute; top: 8px; height: 30px; border-radius: 6px; display: flex; align-items: center; gap: 6px; padding: 0 9px; font-size: 11.5px; font-weight: 600; color: var(--accent-ink); cursor: pointer; overflow: hidden; transition: transform .1s, box-shadow .12s; }
.gbar:hover { box-shadow: var(--shadow); transform: translateY(-1px); z-index: 2; }
.gbar.b-accent { background: var(--accent); }
.gbar.b-warn { background: var(--warn); color: #1c1407; }
.gbar.b-crit { background: var(--crit); color: #fff; }
.gbar.b-ok { background: var(--ok); color: #07120b; }

/* ============================================================
   COMMAND PALETTE (⌘K)
   ============================================================ */
.cmdk-scrim { position: fixed; inset: 0; z-index: 200; background: var(--scrim); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding-top: 13vh; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.cmdk { width: min(580px, 92vw); background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .14s var(--ease); }
@keyframes pop { from { transform: translateY(-8px) scale(.98); opacity: 0; } }
.cmdk-in { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cmdk-in input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--ink); font-size: 15px; font-family: inherit; }
.cmdk-in input::placeholder { color: var(--muted); }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 7px; }
.cmdk-sec { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 10px 9px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; color: var(--ink-soft); }
.cmdk-item .ico { color: var(--muted); flex: none; }
.cmdk-item .t { font-size: 13.5px; color: var(--ink); flex: 1; }
.cmdk-item .t .sub { color: var(--muted); font-weight: 400; margin-left: 7px; font-size: 12px; }
.cmdk-item .type { font-size: 11px; color: var(--muted); }
.cmdk-item.active { background: var(--accent-tint); }
.cmdk-item.active .ico { color: var(--accent); }
.cmdk-foot { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.cmdk-foot .k { display: inline-flex; align-items: center; gap: 5px; }

/* ============================================================
   TOASTS
   ============================================================ */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast { display: flex; align-items: center; gap: 11px; padding: 11px 13px; min-width: 280px; max-width: 440px;
  background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: toastin .26s var(--ease); }
@keyframes toastin { from { transform: translateY(14px); opacity: 0; } }
.toast .t-ico { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.toast.ok .t-ico { background: var(--ok-tint); color: var(--ok); }
.toast.crit .t-ico { background: var(--crit-tint); color: var(--crit); }
.toast.info .t-ico { background: var(--accent-tint); color: var(--accent); }
.toast .t-msg { font-size: 13px; flex: 1; color: var(--ink); }
.toast .t-act { font-size: 12.5px; font-weight: 600; color: var(--accent); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.toast .t-act:hover { background: var(--accent-tint); }

/* skeleton */
.sk { background: linear-gradient(90deg, var(--line-soft) 25%, var(--line) 37%, var(--line-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* utility */
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 980px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.hide { display: none !important; }

/* ============================================================
   MODALS / DRAWERS / FORMS
   ============================================================ */
.modal-scrim {
  position: fixed; inset: 0; z-index: 180; background: var(--scrim);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 7vh 20px 40px; overflow-y: auto; animation: fade .14s;
}
.modal {
  width: 100%; background: var(--overlay); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; max-height: 86vh; animation: pop .16s var(--ease);
}
.modal.sm { max-width: 440px; }
.modal.md { max-width: 580px; }
.modal.lg { max-width: 760px; }
.modal.xl { max-width: 960px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head .m-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--accent-tint); color: var(--accent); }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.modal-foot .spacer { flex: 1; }
.modal-foot .hintnote { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* form fields */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > .lbl { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field > .lbl .req { color: var(--crit); margin-left: 2px; }
.field > .lbl .opt { color: var(--muted); font-weight: 400; margin-left: 6px; }
.field .help { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.fld {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-family: inherit; outline: 0; transition: border-color .12s, box-shadow .12s;
}
.fld:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.fld::placeholder { color: var(--muted); }
textarea.fld { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select.fld { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8f94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px; }
.fld-wrap { position: relative; display: flex; align-items: center; }
.fld-wrap .pre { position: absolute; left: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
.fld-wrap .pre + .fld { padding-left: 32px; }
.fld-wrap .ico-in { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.fld-wrap .ico-in + .fld { padding-left: 36px; }

.field-grid { display: grid; gap: 14px; }
.field-grid.c2 { grid-template-columns: 1fr 1fr; }
.field-grid.c3 { grid-template-columns: 1fr 1fr 1fr; }
.field-grid .field { margin-bottom: 0; }
.form-sec { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; display: flex; align-items: center; gap: 10px; }
.form-sec::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form-sec:not(:first-child) { margin-top: 22px; }

/* chip-style radio group (status / prioridade / modo) */
.choice { display: flex; gap: 7px; flex-wrap: wrap; }
.choice button { height: 34px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; transition: all .12s; }
.choice button:hover { border-color: var(--muted); }
.choice button.on { border-color: var(--accent); background: var(--accent-tint); color: var(--ink); }
.choice button.on .dotc { background: var(--accent); }
.choice .dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.prio-scale { display: flex; gap: 4px; }
.prio-scale button { width: 32px; height: 32px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; font-family: inherit; }
.prio-scale button.on { background: var(--accent); border-color: transparent; color: var(--accent-ink); }

/* line items (pedido) */
.lines { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lines .lrow { display: grid; grid-template-columns: 1fr 78px 110px 110px 34px; gap: 0; align-items: center; border-bottom: 1px solid var(--line-soft); }
.lines .lrow.lhead { background: var(--surface); }
.lines .lrow.lhead > div { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; }
.lines .lrow > div { padding: 6px 8px; }
.lines .lrow .fld { height: 32px; border-color: transparent; background: transparent; border-radius: 0; box-shadow: none; }
.lines .lrow .fld:focus { background: var(--surface); border-color: var(--accent); box-shadow: none; }
.lines .lrow.ltot { background: var(--surface); }
.lines .lrow.ltot > div { padding: 11px 12px; font-weight: 600; }

/* autocomplete */
.ac { position: relative; }
.ac-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; max-height: 220px; overflow-y: auto; }
.ac-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.ac-item:hover, .ac-item.on { background: var(--accent-tint); }
.ac-item .t { font-size: 13px; color: var(--ink); }
.ac-item .s { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* checklist (etapas) */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.check-item:hover { border-color: var(--line-strong); }
.check-item .box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; color: transparent; transition: all .12s; }
.check-item.done .box { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.check-item.done .nm { color: var(--muted); text-decoration: line-through; }
.check-item .nm { font-size: 13.5px; flex: 1; }
.check-item .meta { font-size: 11.5px; color: var(--muted); }
.check-item .order { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); flex: none; }

/* upload zone */
.upzone { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); padding: 22px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.upzone:hover { border-color: var(--accent); background: var(--accent-tint); }
.upzone .uz-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); display: grid; place-items: center; margin: 0 auto 10px; color: var(--muted); }
.upzone .uz-t { font-size: 13px; color: var(--ink); font-weight: 500; }
.upzone .uz-s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* summary box (receber compra, totals) */
.sumbox { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.sumbox .srow { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.sumbox .srow.tot { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 650; font-size: 15px; }
.sumbox .srow .v { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ============================================================
   DROPDOWN MENU (row actions ···)
   ============================================================ */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 60; min-width: 170px;
  background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 5px; animation: pop .12s var(--ease);
}
.menu.up { top: auto; bottom: calc(100% + 4px); }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 7px; font-size: 13px; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: var(--raised); color: var(--ink); }
.menu-item .ico { color: var(--muted); }
.menu-item.danger { color: var(--crit); }
.menu-item.danger:hover { background: var(--crit-tint); }
.menu-item.danger .ico { color: var(--crit); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 3px; }
.menu-scrim { position: fixed; inset: 0; z-index: 55; }

/* confirm dialog accent on the icon */
.modal-head .m-ic.danger { background: var(--crit-tint); color: var(--crit); }
.confirm-msg { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }
.confirm-msg b { color: var(--ink); }

/* ============================================================
   SCANNER
   ============================================================ */
.scanner-view {
  position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(120% 80% at 50% 30%, #1c2330, #0a0d12);
  display: grid; place-items: center; border: 1px solid var(--line);
}
.scanner-view .frame { width: 64%; height: 42%; border-radius: 10px; position: relative; }
.scanner-view .frame::before, .scanner-view .frame::after,
.scanner-view .frame > i:nth-child(1), .scanner-view .frame > i:nth-child(2) { content: ""; position: absolute; width: 26px; height: 26px; border: 3px solid var(--accent); }
.scanner-view .frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.scanner-view .frame::after { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.scanner-view .frame > i:nth-child(1) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.scanner-view .frame > i:nth-child(2) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scanner-view .laser { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--accent); box-shadow: 0 0 12px 2px var(--accent); border-radius: 2px; animation: scanmove 2.2s var(--ease) infinite; }
@keyframes scanmove { 0%,100% { top: 32%; } 50% { top: 66%; } }
.scanner-view .hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ============================================================
   LOGIN
   ============================================================ */
.login {
  height: 100%; display: grid; place-items: center; background: var(--bg); position: relative; overflow: hidden;
}
.login::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 80% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent 80%);
  mask-image: radial-gradient(80% 70% at 50% 40%, #000, transparent 80%);
  opacity: .6; pointer-events: none;
}
.login-card {
  position: relative; z-index: 1; width: min(400px, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 30px 28px;
}
.login-logo { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: var(--accent-ink);
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); margin-bottom: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.login-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.login-head .login-logo { margin-bottom: 16px; }
.login-card h1 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin: 0 0 4px; }
.login-card .lsub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.login-card .lrow { display: flex; align-items: center; gap: 8px; margin: 14px 0; font-size: 12.5px; color: var(--muted); }
.login-card .lrow input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.login-foot a { color: var(--accent); cursor: pointer; }
.check-line { display: inline-flex; align-items: center; gap: 7px; }

/* OP / pedido detail bits */
.stage-list { display: flex; flex-direction: column; gap: 7px; }
.kv-big { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kv-big .b { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; }
.kv-big .b .l { font-size: 11px; color: var(--muted); }
.kv-big .b .v { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* ============================================================
   SCANNER — live webcam feed
   ============================================================ */
.scanner-view .scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0a0d12; }
.scanner-view.is-off .scan-video { opacity: 0; }
.scanner-view .frame { z-index: 1; }
.scanner-view .scan-off { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 22px; color: var(--muted); }
.scanner-view .scan-off > .ico { color: #aeb2b8; }
.scanner-view .scan-off-t { font-size: 13px; color: #d4d7db; font-weight: 550; }
.scanner-view .scan-off-s { font-size: 11.5px; color: var(--muted); max-width: 260px; line-height: 1.45; }
.scanner-view.is-found .frame::before, .scanner-view.is-found .frame::after,
.scanner-view.is-found .frame > i:nth-child(1), .scanner-view.is-found .frame > i:nth-child(2) { border-color: var(--ok); }
.scanner-view .hint { z-index: 2; text-shadow: 0 1px 3px rgba(0,0,0,.6); color: #cfd2d6; }

/* ============================================================
   MOBILE / RESPONSIVO
   ============================================================ */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.25);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open::before {
    content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55;
  }
  .app.nav-collapsed .sidebar { transform: translateX(-100%); }
  .main { grid-template-rows: var(--top-h) 1fr; min-width: 0; }
  .view { padding: 12px; }
  .view-inner { max-width: 100%; }
  .topbar { padding: 0 12px; gap: 6px; }
  .tb-actions .sb-search { display: none; }
  .page-head h1.page-title, .page-title { font-size: 20px; }
  .page-sub { font-size: 12px; }
  .metrics { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .metric { padding: 12px; }
  .grid2, .grid3, .detail-grid { grid-template-columns: 1fr !important; }
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .field-grid.c2, .field-grid.c3 { grid-template-columns: 1fr !important; }
  .toolbar { flex-wrap: wrap; row-gap: 8px; }
  .row.gap8 { flex-wrap: wrap; row-gap: 8px; }
  .modal-shell { width: calc(100vw - 16px) !important; max-width: 100% !important; max-height: calc(100vh - 16px); }
  .modal-foot { flex-wrap: wrap; row-gap: 8px; }
  .tbl-wrap { overflow-x: auto; }
  .tbl { min-width: 560px; }
  .kanban { grid-template-columns: 1fr; }
  .tweaks-panel { display: none; }
  /* esconde elementos decorativos da topbar pra ganhar espaço */
  .tb-crumb .crumb { display: none; }
}

/* ============================================================
   PRINT — clean document via #print-root
   ============================================================ */
#print-root { display: none; }
@media print {
  body { background: #fff !important; }
  #root, .tweaks-panel, .toasts, .modal-scrim, .cmdk-scrim, .offline-banner { display: none !important; }
  #print-root { display: block !important; }
  @page { margin: 14mm; }
}
