/* ============================================================
   SmartUniformes — Sistema de Controle de Uniformes (PWA)
   Smart Hospital · Hotelaria / Rouparia
   Marca: navy #183E75 · cyan #2FC5F4
   ============================================================ */

:root {
  --brand-navy: #183E75;
  --brand-navy-deep: #12315E;
  --brand-navy-soft: #1E4A8A;
  --brand-cyan: #2FC5F4;
  --brand-cyan-soft: #E3F6FD;

  --surface: #F5F7FA;
  --card: #FFFFFF;
  --border: #E4E7EC;
  --border-soft: #EEF1F5;

  --ink: #1B2430;
  --ink-2: #5A6472;
  --ink-3: #8A93A0;

  --chart-1: #2B5CAD; /* entregas */
  --chart-2: #1F9D62; /* devoluções */
  --chart-3: #0E9BC7;
  --chart-4: #B26A00;
  --chart-5: #8757C9;

  --good: #1F9D62;
  --good-bg: #E7F6EF;
  --warn: #B26A00;
  --warn-bg: #FCF3E3;
  --serious: #C2410C;
  --serious-bg: #FDEEE5;
  --crit: #B3261E;
  --crit-bg: #FBEAE9;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 8px 40px rgba(16,24,40,.18);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14.5px; }

/* ---------- App shell ---------- */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px; flex: 0 0 236px;
  background: linear-gradient(178deg, var(--brand-navy) 0%, var(--brand-navy-deep) 100%);
  color: #fff;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 30;
}
.sidebar .brand {
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar .brand img { width: 148px; display: block; }
.sidebar .brand .app-name {
  margin-top: 10px; font-size: 15px; font-weight: 600; letter-spacing: .2px;
}
.sidebar .brand .app-sub {
  font-size: 11.5px; color: rgba(255,255,255,.62); margin-top: 1px;
}
.nav { padding: 10px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0;
  color: rgba(255,255,255,.82); text-decoration: none;
  border-radius: 10px; font-size: 14px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(47,197,244,.16); color: #fff; }
.nav a.active svg { opacity: 1; color: var(--brand-cyan); }
.nav .nav-sep {
  margin: 12px 12px 6px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.4);
}
.nav a .badge-count {
  margin-left: auto; background: var(--crit); color: #fff;
  font-size: 11px; font-weight: 700; min-width: 19px; height: 19px;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}
.sidebar .foot {
  padding: 12px 16px; font-size: 11px; color: rgba(255,255,255,.5);
  border-top: 1px solid rgba(255,255,255,.12);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 26px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 650; }
.topbar .spacer { flex: 1; }
.topbar .rouparia-select {
  display: flex; align-items: center; gap: 8px;
  background: var(--brand-cyan-soft); border: 1px solid #BFE9F9;
  padding: 6px 10px; border-radius: 10px; font-size: 13px; color: var(--brand-navy);
}
.topbar .rouparia-select select {
  border: 0; background: transparent; font-weight: 600; color: var(--brand-navy);
  outline: none; font-size: 13px; cursor: pointer;
}
.operator-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 6px 5px 12px; border: 1px solid var(--border); border-radius: 24px;
  background: var(--card); font-size: 13px;
}
.operator-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-navy); color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.operator-chip button {
  border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 12px;
  padding: 2px 6px;
}
.operator-chip button:hover { color: var(--crit); }

.content { padding: 24px 26px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

/* ---------- Cards / layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 16px; }
.card h2 { font-size: 15.5px; margin: 0 0 4px; font-weight: 650; }
.card .card-sub { font-size: 12.5px; color: var(--ink-2); margin: 0 0 14px; }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1020px) { .grid-2 { grid-template-columns: 1fr; } }

/* KPI stat tiles */
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; position: relative; overflow: hidden;
}
.kpi .kpi-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.kpi .kpi-value { font-size: 30px; font-weight: 700; margin-top: 4px; letter-spacing: -.5px; }
.kpi .kpi-foot { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.kpi .kpi-foot .up { color: var(--good); font-weight: 600; }
.kpi .kpi-foot .down { color: var(--crit); font-weight: 600; }
.kpi.kpi-alert { border-left: 4px solid var(--crit); }
.kpi.kpi-warn { border-left: 4px solid var(--warn); }
.kpi.kpi-ok { border-left: 4px solid var(--good); }
.kpi.kpi-brand { border-left: 4px solid var(--brand-cyan); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--ink);
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .15s; text-decoration: none;
}
.btn:hover { border-color: #C9CFD8; background: #F8FAFC; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-navy-soft); }
.btn.cyan { background: var(--brand-cyan); border-color: var(--brand-cyan); color: #0A2A4A; }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand-navy); }
.btn.ghost:hover { background: var(--brand-cyan-soft); }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 17px; height: 17px; }
/* estado ligado (ex.: lanterna do leitor de documento) */
.btn.on { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.btn.ghost.on { color: #fff; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; background: #fff; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand-cyan); box-shadow: 0 0 0 3px rgba(47,197,244,.18); }
.input-search { position: relative; }
.input-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-3); pointer-events: none;
}
.input-search .input { padding-left: 34px; }

/* ---------- Badges & pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.pill.good { background: var(--good-bg); color: #14683F; }
.pill.warn { background: var(--warn-bg); color: #7A4A05; }
.pill.serious { background: var(--serious-bg); color: #92300A; }
.pill.crit { background: var(--crit-bg); color: #8C1D17; }
.pill.info { background: var(--brand-cyan-soft); color: var(--brand-navy); }
.pill.neutral { background: #EEF1F5; color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); font-weight: 700; padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tbody tr:hover { background: #F8FAFC; }
.tbl tr.clickable { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }

/* ---------- Wizard / stepper ---------- */
.stepper { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.step-chip {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  padding: 7px 13px; border-radius: 22px; background: #EEF1F5; color: var(--ink-3);
}
.step-chip .n {
  width: 20px; height: 20px; border-radius: 50%; background: #D9DEE6; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.step-chip.active { background: var(--brand-navy); color: #fff; }
.step-chip.active .n { background: var(--brand-cyan); color: #0A2A4A; }
.step-chip.done { background: var(--good-bg); color: #14683F; }
.step-chip.done .n { background: var(--good); color: #fff; }

.wizard-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: space-between; }
.wizard-actions .right { display: flex; gap: 10px; margin-left: auto; }

/* Employee pick cards */
.emp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-top: 12px; }
.emp-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
  cursor: pointer; transition: all .12s; background: #fff; display: flex; gap: 11px; align-items: center;
}
.emp-card:hover { border-color: var(--brand-cyan); box-shadow: 0 2px 10px rgba(47,197,244,.15); }
.emp-card.selected { border-color: var(--brand-navy); background: var(--brand-cyan-soft); }
.emp-card .avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  background: var(--brand-navy); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.emp-card .nm { font-weight: 650; font-size: 13.5px; }
.emp-card .meta { font-size: 12px; color: var(--ink-2); }

/* Catalog item cards */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cat-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #fff; }
.cat-card .cat-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cat-card .cat-name { font-weight: 650; font-size: 14px; }
.cat-card .cat-stock { font-size: 11.5px; color: var(--ink-3); }
.size-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; border-top: 1px dashed var(--border-soft); }
.size-row .sz { font-weight: 700; font-size: 12.5px; width: 34px; color: var(--ink-2); }
.size-row .avail { font-size: 11.5px; color: var(--ink-3); flex: 1; }
.size-row .avail.low { color: var(--warn); font-weight: 600; }
.size-row .avail.zero { color: var(--crit); font-weight: 600; }
.qty-ctrl { display: inline-flex; align-items: center; gap: 2px; }
.qty-ctrl button {
  width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; font-size: 15px; font-weight: 700; color: var(--brand-navy);
  display: inline-flex; align-items: center; justify-content: center;
}
.qty-ctrl button:hover:not(:disabled) { background: var(--brand-cyan-soft); border-color: var(--brand-cyan); }
.qty-ctrl button:disabled { opacity: .35; cursor: not-allowed; }
.qty-ctrl .q { width: 30px; text-align: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

.cart-bar {
  position: sticky; bottom: 14px; margin-top: 18px;
  background: var(--brand-navy); color: #fff; border-radius: 14px;
  padding: 13px 18px; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-lg);
}
.cart-bar .sum { font-size: 13.5px; }
.cart-bar .sum b { font-size: 16px; }

/* ---------- Camera / photo ---------- */
.cam-stage {
  position: relative; border-radius: 14px; overflow: hidden; background: #0B1320;
  aspect-ratio: 4 / 3; max-width: 640px; margin: 0 auto;
}
.cam-stage video, .cam-stage img.shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-guide {
  position: absolute; inset: 8% 6%; border: 2px dashed rgba(47,197,244,.75);
  border-radius: 12px; pointer-events: none;
}
.cam-guide::after {
  content: "Posicione as peças na bancada, dentro da moldura";
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  background: rgba(10,20,40,.72); color: #fff; font-size: 12px; padding: 4px 12px;
  border-radius: 14px; white-space: nowrap;
}
/* moldura de documento: alterna vertical (crachá) e horizontal (CNH/RG) */
.cam-guide.doc-frame {
  inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%);
  height: 86%; width: auto; aspect-ratio: 0.63;   /* vertical: crachá */
  border-radius: 14px;
}
.cam-guide.doc-frame.horizontal {
  height: auto; width: 88%; aspect-ratio: 1.58;   /* horizontal: CNH, RG aberto */
}
.cam-guide.doc-frame::after { content: attr(data-label); }

/* seletor de orientação */
.orient-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--card);
}
.orient-switch button {
  border: 0; background: transparent; padding: 7px 14px; font-size: 13px;
  font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.orient-switch button.on { background: var(--brand-navy); color: #fff; }

.cam-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.cam-error {
  padding: 30px 20px; text-align: center; color: #fff; font-size: 13.5px;
  display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center;
  height: 100%;
}

/* IA analysis */
.ia-box { max-width: 640px; margin: 0 auto; }
.ia-photo { border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
.ia-photo img { width: 100%; display: block; }
.ia-progress { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--brand-cyan-soft); border-radius: 12px; font-size: 13.5px; color: var(--brand-navy); font-weight: 600; }
.spinner {
  width: 22px; height: 22px; border: 3px solid rgba(24,62,117,.2); border-top-color: var(--brand-navy);
  border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 22px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ia-result { border-radius: 12px; padding: 16px; }
.ia-result.ok { background: var(--good-bg); border: 1px solid #BCE5D0; }
.ia-result.diverge { background: var(--warn-bg); border: 1px solid #F0DBB0; }
.ia-result h3 { margin: 0 0 6px; font-size: 15px; }
.ia-compare { display: flex; gap: 20px; margin: 10px 0; }
.ia-compare .col { text-align: center; }
.ia-compare .col .v { font-size: 26px; font-weight: 700; }
.ia-compare .col .l { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }

/* PIN pad & signature */
.confirm-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.confirm-tabs button {
  flex: 1; padding: 10px; border-radius: 10px; border: 1.5px solid var(--border);
  background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.confirm-tabs button.active { border-color: var(--brand-navy); background: var(--brand-cyan-soft); color: var(--brand-navy); }
.pin-display { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.pin-display .d {
  width: 44px; height: 52px; border: 1.5px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700;
  background: #fff;
}
.pin-display .d.filled { border-color: var(--brand-navy); background: var(--brand-cyan-soft); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; justify-content: center; }
.pin-pad button {
  height: 52px; border-radius: 12px; border: 1px solid var(--border); background: #fff;
  font-size: 19px; font-weight: 650; cursor: pointer;
}
.pin-pad button:hover { background: var(--brand-cyan-soft); }
.sig-pad { border: 1.5px dashed var(--border); border-radius: 12px; background: #fff; touch-action: none; width: 100%; }
.pin-error { color: var(--crit); text-align: center; font-weight: 600; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- Receipt ---------- */
.receipt { max-width: 560px; margin: 0 auto; text-align: center; }
.receipt .ok-ico {
  width: 64px; height: 64px; border-radius: 50%; background: var(--good-bg);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.receipt .ok-ico svg { width: 32px; height: 32px; color: var(--good); }
.receipt-doc {
  text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  margin-top: 16px; background: #fff;
}
.receipt-doc .rrow { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13.5px; }
.receipt-doc .rrow .k { color: var(--ink-2); }
.receipt-doc hr { border: 0; border-top: 1px dashed var(--border); margin: 10px 0; }
.qr-holder { display: flex; justify-content: center; padding: 10px 0; }
.qr-holder svg { width: 130px; height: 130px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,18,32,.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; padding: 22px;
}
.modal.wide { max-width: 760px; }
.modal h2 { margin: 0 0 14px; font-size: 17px; }
.modal .modal-close { float: right; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--ink-3); }

/* ---------- Charts ---------- */
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.chart-legend .li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.chart-legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.chart-tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  background: #10192B; color: #fff; border-radius: 9px; padding: 8px 11px;
  font-size: 12px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .1s;
  max-width: 240px;
}
.chart-tooltip .tt-title { font-weight: 700; margin-bottom: 4px; color: #B8C4D4; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 7px; padding: 1px 0; }
.chart-tooltip .sw { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.chart-svg { width: 100%; display: block; }
.chart-svg text { font-family: var(--font); }

/* ---------- Alerts view ---------- */
.alert-card {
  border: 1px solid var(--border); border-left: 4px solid var(--warn);
  border-radius: 12px; padding: 14px 16px; background: #fff; margin-bottom: 10px;
  display: flex; gap: 14px; align-items: flex-start;
}
.alert-card.crit { border-left-color: var(--crit); }
.alert-card .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); display: flex; align-items: center; justify-content: center; flex: 0 0 36px; }
.alert-card.crit .ico { background: var(--crit-bg); color: var(--crit); }
.alert-card .ttl { font-weight: 650; font-size: 14px; }
.alert-card .desc { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.alert-card .acts { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------- Audit ---------- */
.audit-photo-thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 7px; cursor: pointer; border: 1px solid var(--border); }
.audit-detail { background: #F8FAFC; border-radius: 10px; padding: 14px; }
.audit-detail img.full { max-width: 320px; border-radius: 10px; display: block; margin-top: 8px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; width: 100%; flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--brand-navy) 0%, var(--brand-navy-deep) 60%, #0D2547 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 430px; padding: 34px 32px;
}
.login-card .logo { width: 190px; display: block; margin: 0 auto 8px; }
.login-card h1 { font-size: 19px; text-align: center; margin: 12px 0 2px; }
.login-card .sub { text-align: center; color: var(--ink-2); font-size: 13px; margin-bottom: 22px; }
.op-list { display: flex; flex-direction: column; gap: 8px; }
.op-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .12s;
}
.op-item:hover, .op-item.selected { border-color: var(--brand-navy); background: var(--brand-cyan-soft); }
.demo-hint {
  margin-top: 18px; font-size: 12px; color: var(--ink-3); text-align: center;
  background: #F8FAFC; border-radius: 10px; padding: 10px;
}

/* ---------- Badge (crachá) & labels ---------- */
.badge-card {
  width: 320px; border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  margin: 0 auto; background: #fff;
}
.badge-card .bd-head { background: var(--brand-navy); padding: 14px 18px; }
.badge-card .bd-head img { width: 120px; }
.badge-card .bd-body { padding: 18px; display: flex; gap: 14px; align-items: center; }
.badge-card .bd-body .qr svg { width: 92px; height: 92px; display: block; }
.badge-card .bd-nm { font-weight: 700; font-size: 15px; }
.badge-card .bd-meta { font-size: 12px; color: var(--ink-2); }
.badge-card .bd-foot { border-top: 2px solid var(--brand-cyan); padding: 8px 18px; font-size: 10.5px; color: var(--ink-3); }

.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.label-item {
  border: 1px dashed var(--ink-3); border-radius: 8px; padding: 10px;
  display: flex; gap: 10px; align-items: center; background: #fff;
}
.label-item svg { width: 62px; height: 62px; flex: 0 0 62px; }
.label-item .li-id { font-weight: 700; font-size: 11.5px; word-break: break-all; }
.label-item .li-meta { font-size: 10.5px; color: var(--ink-2); }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.empty-state svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: .5; }
.toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar-row .grow { flex: 1; min-width: 200px; }
.section-title { font-size: 16px; font-weight: 700; margin: 26px 0 12px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.text-center { text-align: center; }

.toast-holder { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #10192B; color: #fff; padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 10px; align-items: center;
  animation: toastIn .25s ease;
}
.toast.good { border-left: 4px solid var(--good); }
.toast.bad { border-left: 4px solid var(--crit); }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } }

/* ---------- Print ---------- */
#print-root { display: none; }
@media print {
  body > #app, .toast-holder, .modal-overlay { display: none !important; }
  #print-root { display: block !important; padding: 10mm; }
  body { background: #fff; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { width: 68px; flex-basis: 68px; }
  .sidebar .brand { padding: 14px 10px; }
  .sidebar .brand img { width: 46px; }
  .sidebar .brand .app-name, .sidebar .brand .app-sub, .sidebar .foot,
  .nav a span, .nav .nav-sep { display: none; }
  .nav a { justify-content: center; padding: 12px; }
  .nav a .badge-count { position: absolute; margin-left: 20px; margin-top: -18px; }
  .content { padding: 16px 14px 60px; }
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
}

/* ---------- Assistente de voz ---------- */
.mic-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--brand-navy); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.mic-btn:hover { background: var(--brand-cyan-soft); border-color: var(--brand-cyan); }
.mic-btn.listening {
  background: var(--crit); border-color: var(--crit); color: #fff;
  animation: micPulse 1.1s ease infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179,38,30,.35); }
  50% { box-shadow: 0 0 0 9px rgba(179,38,30,0); }
}

/* ---------- Chat "converse com seus dados" ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand-navy); color: var(--brand-cyan);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-drawer {
  position: fixed; right: 22px; bottom: 86px; z-index: 95;
  width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: 70vh;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: none; flex-direction: column; overflow: hidden;
}
.chat-drawer.open { display: flex; }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-navy); color: #fff; padding: 12px 14px;
}
.chat-head svg { color: var(--brand-cyan); }
.chat-head .muted { color: rgba(255,255,255,.6); }
.chat-head .chat-close {
  margin-left: auto; border: 0; background: none; color: rgba(255,255,255,.7);
  font-size: 20px; cursor: pointer;
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg {
  max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.5;
}
.chat-msg.bot { background: #F1F4F8; border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-msg.user { background: var(--brand-navy); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-msg a { color: var(--brand-navy); font-weight: 600; }
.chat-suggest { display: flex; gap: 6px; padding: 0 12px 8px; flex-wrap: wrap; }
.chat-suggest button {
  border: 1px solid var(--border); background: #fff; border-radius: 16px;
  padding: 4px 11px; font-size: 11.5px; cursor: pointer; color: var(--ink-2); font-weight: 600;
}
.chat-suggest button:hover { border-color: var(--brand-cyan); background: var(--brand-cyan-soft); }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-input .input { flex: 1; }
.chat-input .btn { padding: 8px 14px; }

.kpi.clicavel { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.kpi.clicavel:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(16,24,40,.12); }
