/* ============================================================
   Batida de Armário — folha de estilo
   ============================================================ */
:root {
  --bg: #f2f6f4;
  --bg-soft: #e9f0ed;
  --surface: #ffffff;
  --surface-2: #f7faf9;
  --line: #dfe8e4;
  --line-strong: #cbd9d4;
  --text: #172522;
  --text-2: #526661;
  --text-3: #5f716c;
  --brand: #0f2e2a;
  --brand-2: #143d37;
  --brand-3: #0a201d;
  --accent: #0a8058;
  --accent-strong: #087a54;
  --accent-soft: #e3f7ee;
  --blue: #2563eb;
  --blue-soft: #e8efff;
  --amber: #b45309;
  --amber-soft: #fdf1dc;
  --red: #d92d20;
  --red-soft: #feebea;
  --purple: #7c3aed;
  --purple-soft: #f0eaff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(18, 39, 34, .04), 0 8px 24px rgba(18, 39, 34, .05);
  --shadow-lg: 0 24px 60px rgba(10, 30, 26, .22);
  --sidebar-w: 252px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 100% -10%, rgba(14, 159, 110, .07), transparent 60%),
    radial-gradient(800px 400px at 0% 100%, rgba(37, 99, 235, .04), transparent 60%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-strong); }
h1, h2, h3, p { margin: 0; }
kbd {
  font-family: inherit; font-size: 10.5px; font-weight: 600;
  background: #eef3f1; color: var(--text-2);
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  padding: 1px 5px; border-radius: 5px; white-space: nowrap;
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ============ ESTRUTURA ============ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(175deg, var(--brand) 0%, var(--brand-2) 70%, var(--brand-3) 100%);
  color: #dfece7; position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; padding: 22px 16px 16px;
  border-right: 1px solid rgba(255,255,255,.05);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 22px; }
.brand-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.22);
  overflow: hidden; flex: 0 0 40px;
}
.brand-icon .icon { width: 22px; height: 22px; stroke-width: 1.7; }
.brand-icon.has-logo { background: #fff; padding: 3px; }
.brand-icon.has-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14.5px; color: #fff; letter-spacing: .1px; }
.brand-text span { font-size: 11px; color: #8fb0a7; margin-top: 3px; letter-spacing: .3px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group + .nav-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.nav-title { padding: 0 11px 4px; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6f9289; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: transparent; border: 0; color: #a9c2bb;
  padding: 10px 11px; border-radius: 10px; text-align: left;
  font-size: 13.5px; font-weight: 500; transition: .16s ease;
}
.nav-item .icon { width: 19px; height: 19px; opacity: .9; }
.nav-item:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.10); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav-item.active .icon { color: var(--accent); }
.nav-item kbd { margin-left: auto; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); color: #9ab8b0; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 19px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 20px; background: rgba(217,45,32,.18); color: #ff9c94;
  font-size: 10.5px; font-weight: 700;
}
.nav-badge:empty, .nav-badge.zero { display: none; }
.sidebar-foot { margin-top: auto; padding: 16px 6px 2px; display: flex; flex-direction: column; gap: 10px; }
.sync-pill {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  font-size: 11px; color: #9dbab2; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.07); padding: 5px 9px; border-radius: 20px;
}
.sync-pill i { width: 7px; height: 7px; border-radius: 50%; background: #36d399; box-shadow: 0 0 0 3px rgba(54,211,153,.13); }
.sync-pill.saving i { background: #fbbf24; animation: pulse 1s infinite; }
.sync-pill.offline i { background: #f87171; box-shadow: 0 0 0 3px rgba(248,113,113,.13); }
.sync-pill.local i { background: #93c5fd; }
@keyframes pulse { 50% { opacity: .35; } }
.store-line { display: flex; align-items: center; gap: 7px; color: #7fa39a; font-size: 11.5px; padding: 0 3px; }
.store-line .icon { width: 14px; height: 14px; }
.version-line { color: #52776e; font-size: 10.5px; padding: 0 3px; }

.main { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 15px 28px; background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
}
.menu-btn { display: none !important; }
.page-heading { min-width: 0; }
.page-heading h1 { font-size: 21px; letter-spacing: -.4px; font-weight: 700; }
.page-heading p { font-size: 12.5px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px 28px 48px; max-width: 1500px; }
.view { display: none; animation: fadeUp .28s ease; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============ COMPONENTES ============ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -.15px; }
.card-head p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 > .card { margin-bottom: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 14px; font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--text); transition: .15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(14,159,110,.22); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--text-2); }
.btn-ghost:hover { border-color: #b6c9c2; color: var(--text); background: var(--surface-2); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b42318; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); background: #fff; color: var(--text-2);
  border-radius: 9px; transition: .15s;
}
.icon-btn:hover { color: var(--text); border-color: #b6c9c2; background: var(--surface-2); }
.input {
  width: 100%; border: 1px solid var(--line-strong); background: #fff;
  border-radius: var(--radius-sm); padding: 9px 11px; font-size: 13px;
  outline: none; transition: .15s; min-width: 0;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,159,110,.12); }
.input-sm { padding: 7px 10px; font-size: 12px; width: 220px; }
.select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f918c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.search-wrap { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-3); }
.search-wrap input { padding-left: 36px; }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .select { width: auto; min-width: 150px; }
.toolbar-spacer { flex: 1; }
.head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--text-2); font-size: 13px; line-height: 1.6; }
.hint { color: var(--text-3); font-size: 11.5px; line-height: 1.5; margin-top: 10px; }
.hidden { display: none !important; }
.show-sm { display: none; }

/* ============ HERO / ESTATÍSTICAS ============ */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-2) 60%, var(--accent-strong) 100%);
  color: #fff; border-radius: 18px; padding: 26px 28px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 30px; box-shadow: 0 14px 40px rgba(10,40,34,.18);
}
.hero::after {
  content: ""; position: absolute; width: 380px; height: 380px; right: -100px; top: -160px;
  background: radial-gradient(circle, rgba(54,211,153,.22), transparent 65%); pointer-events: none;
}
.hero-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: #8fe0c1; font-weight: 600; }
.hero-kicker .live-dot { background: #36d399; }
.hero h2 { font-size: 25px; line-height: 1.2; margin: 9px 0 7px; letter-spacing: -.5px; }
.hero p { color: #a9c9bf; font-size: 13px; max-width: 560px; line-height: 1.55; }
.hero-actions { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }
.hero .btn-primary { background: var(--accent); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.hero .btn-primary:hover { background: var(--accent-strong); }
.hero .btn-hero-ghost { background: rgba(255,255,255,.08); color: #e8f4f0; border-color: rgba(255,255,255,.16); }
.hero .btn-hero-ghost:hover { background: rgba(255,255,255,.14); }
.hero-ring-wrap { display: flex; align-items: center; gap: 22px; position: relative; z-index: 1; }
.hero-ring {
  --p: 0;
  width: 128px; height: 128px; border-radius: 50%;
  background: conic-gradient(#36d399 calc(var(--p) * 1%), rgba(255,255,255,.12) 0);
  display: grid; place-items: center; position: relative;
}
.hero-ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #10342e; }
.hero-ring-inner { position: relative; text-align: center; }
.hero-ring-inner strong { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.8px; }
.hero-ring-inner span { font-size: 10.5px; color: #9dc2b7; text-transform: uppercase; letter-spacing: .5px; }
.hero-mini { display: grid; gap: 12px; }
.hero-mini div { display: flex; flex-direction: column; }
.hero-mini strong { font-size: 18px; letter-spacing: -.3px; }
.hero-mini span { font-size: 10.5px; color: #9dc2b7; text-transform: uppercase; letter-spacing: .4px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px; box-shadow: var(--shadow); display: flex; gap: 13px; align-items: flex-start;
}
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon.green { background: var(--accent-soft); color: var(--accent-strong); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-body { min-width: 0; }
.stat-label { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -.6px; line-height: 1.2; margin-top: 2px; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.stat-foot { font-size: 11px; color: var(--text-3); margin-top: 3px; }

/* ============ SEÇÕES / BARRAS ============ */
.section-list { display: flex; flex-direction: column; gap: 13px; }
.section-row { display: grid; grid-template-columns: 130px 1fr 74px; gap: 12px; align-items: center; }
.section-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.section-bar { height: 8px; border-radius: 8px; background: #edf2f0; overflow: hidden; position: relative; }
.section-bar span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width .5s ease; }
.section-bar span.warn { background: linear-gradient(90deg, #f59e0b, #d97706); }
.section-meta { text-align: right; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.section-meta b { color: var(--text-2); font-weight: 600; }
.section-meta .div-count { color: var(--red); font-weight: 600; }

.progress-line { height: 8px; border-radius: 8px; background: #edf2f0; overflow: hidden; }
.progress-line span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); border-radius: 8px; }

/* ============ HISTÓRICO ============ */
.mini-history, .readings-list { display: flex; flex-direction: column; }
.history-item, .reading-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 2px;
  border-bottom: 1px solid #eef3f1; min-width: 0;
}
.history-item:last-child, .reading-item:last-child { border-bottom: 0; }
.history-dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--accent-soft); color: var(--accent-strong); }
.history-dot .icon { width: 15px; height: 15px; }
.history-dot.blue { background: var(--blue-soft); color: var(--blue); }
.history-dot.amber { background: var(--amber-soft); color: var(--amber); }
.history-main { min-width: 0; flex: 1; }
.history-main strong { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-main span { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-side { text-align: right; flex: 0 0 auto; }
.history-side b { display: block; font-size: 12.5px; }
.history-side span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }

/* ============ BADGES ============ */
.badge, .status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 650; padding: 3px 8px; border-radius: 20px;
  white-space: nowrap; letter-spacing: .1px;
}
.badge::before, .status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok, .status-ok { background: var(--accent-soft); color: var(--accent-strong); }
.badge-div, .status-div { background: var(--red-soft); color: var(--red); }
.badge-pend, .status-pend { background: #eef2f1; color: #63756f; }
.badge-tratado, .status-tratado { background: var(--blue-soft); color: var(--blue); }
.badge-warn { background: var(--amber-soft); color: var(--amber); }
.badge-neutral { background: #eef2f1; color: var(--text-2); }
.badge-out { background: var(--purple-soft); color: var(--purple); }
.diff { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.diff.pos { color: var(--blue); }
.diff.neg { color: var(--red); }
.diff.zero { color: var(--accent-strong); }

/* ============ BATIDA ============ */
.scan-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.scan-column { display: flex; flex-direction: column; gap: 18px; }
.scan-column .card { margin-bottom: 0; }
.scan-card { padding: 20px 22px 22px; border: 1px solid #cfe6dd; background: linear-gradient(180deg, #ffffff, #fbfdfc); }
.scan-status { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); font-weight: 500; margin-bottom: 16px; }
.scan-session { margin-left: auto; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); font-weight: 400; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(14,159,110,.14); animation: pulse 2s infinite; flex: 0 0 auto; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.qty-row label { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.qty-stepper { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.qty-btn { width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-2); font-size: 16px; line-height: 1; }
.qty-btn:hover { background: var(--bg-soft); }
.qty-stepper input { width: 46px; border: 0; text-align: center; font-weight: 650; font-size: 13px; outline: none; -moz-appearance: textfield; }
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.scan-input-wrap {
  display: flex; align-items: center; gap: 0;
  border: 2px solid var(--accent); border-radius: 12px; background: #fff;
  box-shadow: 0 0 0 4px rgba(14,159,110,.09); overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.scan-input-wrap.error { border-color: var(--red); box-shadow: 0 0 0 4px rgba(217,45,32,.1); }
.scan-input-wrap.ok { border-color: var(--accent); }
.scan-icon { margin-left: 14px; width: 22px; height: 22px; color: var(--accent-strong); }
.scan-input-wrap input {
  flex: 1; min-width: 0; border: 0; outline: none; padding: 15px 12px;
  font-size: 17px; font-weight: 600; letter-spacing: .3px; background: transparent;
}
.scan-input-wrap input::placeholder { font-size: 13px; font-weight: 400; letter-spacing: 0; color: #9aada7; }
.scan-submit { margin: 5px; border-radius: 8px; padding: 10px 18px; }
.scan-hints { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 10.5px; color: var(--text-3); }
.scan-hints span { display: inline-flex; align-items: center; gap: 5px; }
.scan-feedback { margin-top: 17px; border-radius: 12px; padding: 14px; background: var(--accent-soft); border: 1px solid #bfe9d8; animation: fadeUp .2s ease; }
.scan-feedback.err { background: var(--red-soft); border-color: #f5c2be; }
.scan-feedback-head { display: flex; align-items: flex-start; gap: 10px; }
.scan-feedback-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #fff; color: var(--accent-strong); flex: 0 0 auto; }
.scan-feedback.err .scan-feedback-icon { color: var(--red); }
.scan-feedback-main { min-width: 0; flex: 1; }
.scan-feedback-main strong { display: block; font-size: 13px; line-height: 1.35; }
.scan-feedback-main span { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.scan-feedback-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.scan-feedback-actions { display: flex; gap: 6px; margin-top: 11px; }
.session-card .card-head { margin-bottom: 10px; }
.session-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.session-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; }
.session-stat b { display: block; font-size: 19px; letter-spacing: -.4px; }
.session-stat span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.session-stat.red b { color: var(--red); }
.session-stat.blue b { color: var(--blue); }
.session-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.session-actions .btn { flex: 1; }
.readings-card { position: sticky; top: 86px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.readings-card .card-head { margin-bottom: 8px; }
.readings-card .readings-list { overflow-y: auto; min-height: 220px; }
.reading-item { cursor: pointer; }
.reading-item:hover { background: var(--surface-2); }
.reading-qty { font-weight: 700; font-size: 13px; color: var(--accent-strong); background: var(--accent-soft); padding: 3px 8px; border-radius: 7px; }
.reading-item.undo .reading-qty { color: var(--text-3); background: #eef2f1; }
.reading-item .history-main strong { font-size: 12px; }
.reading-item .history-main span { font-size: 10.5px; }

/* ============ TABELAS ============ */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-3); font-weight: 650; padding: 9px 10px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap;
}
th:first-child { border-radius: 8px 0 0 0; }
th:last-child { border-radius: 0 8px 0 0; }
td { padding: 9px 10px; border-bottom: 1px solid #eef3f1; vertical-align: middle; }
tbody tr:hover { background: #fbfdfc; }
tbody tr.clickable { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
.td-code { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 11.5px; white-space: nowrap; }
.td-prod { min-width: 260px; }
.td-prod strong { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.td-prod span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.td-actions { text-align: right; white-space: nowrap; }
.td-actions .icon-btn { width: 28px; height: 28px; border-radius: 7px; }
.td-actions .icon-btn .icon { width: 14px; height: 14px; }
.count-input { width: 70px; text-align: center; padding: 6px 4px; border: 1px solid var(--line-strong); border-radius: 7px; font-weight: 650; font-size: 12.5px; outline: none; }
.count-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,159,110,.1); }
.count-input.empty { background: #fbfcfc; color: var(--text-3); font-weight: 500; }
.qty-inline { display: inline-flex; align-items: center; gap: 2px; }
.qty-inline button { width: 24px; height: 26px; border: 1px solid var(--line-strong); background: #fff; color: var(--text-2); border-radius: 6px; font-size: 13px; line-height: 1; }
.qty-inline button:hover { background: var(--bg-soft); }
.table-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); margin-bottom: 10px; }
.table-summary b { color: var(--text-2); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; flex-wrap: wrap; }
.pagination-info { font-size: 11.5px; color: var(--text-3); }
.page-btns { display: flex; gap: 4px; }
.page-btn { min-width: 30px; height: 30px; border: 1px solid var(--line-strong); background: #fff; border-radius: 7px; font-size: 12px; color: var(--text-2); padding: 0 8px; }
.page-btn:hover { background: var(--surface-2); }
.page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.page-btn:disabled { opacity: .4; pointer-events: none; }
.empty-state { text-align: center; padding: 34px 18px; color: var(--text-3); }
.empty-state .icon { width: 30px; height: 30px; opacity: .45; margin-bottom: 8px; }
.empty-state strong { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 3px; }
.empty-state span { font-size: 11.5px; }
.sem-batida-box { text-align: center; padding: 26px 18px 30px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.sem-batida-box .empty-state { padding: 10px 18px 18px; }
.sem-batida-box .empty-state .icon { width: 38px; height: 38px; opacity: .55; margin-bottom: 12px; }
.sem-batida-box .empty-state strong { font-size: 15px; }
.sem-batida-box .empty-state span { display: block; max-width: 520px; margin: 0 auto; line-height: 1.55; }
.sem-batida-box .btn, .sem-batida-box .badge { margin-top: 2px; }
.hero-hint { font-size: 11.5px !important; opacity: .72; margin-top: -2px; }
.import-summary-block + .import-summary-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.import-summary-title { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.import-summary-list .stats-grid { margin-bottom: 0; }
.import-summary-list .info-item strong { font-size: 12px; }
@media (max-width: 720px) {
  .sem-batida-box { padding: 20px 12px 24px; }
}

/* ============ RELATÓRIOS ============ */
.report-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.report-actions h2 { font-size: 18px; letter-spacing: -.3px; }
.report-actions p { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.accuracy-bar { height: 6px; width: 100px; background: #edf2f0; border-radius: 6px; overflow: hidden; display: inline-block; vertical-align: middle; }
.accuracy-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.accuracy-bar span.warn { background: var(--amber); }
.accuracy-bar span.bad { background: var(--red); }
.accuracy-cell { display: inline-flex; align-items: center; gap: 7px; }
.section-table td { font-size: 12px; }
.obs-cell { max-width: 360px; font-size: 11.5px; color: var(--text-2); }

/* ============ FORMULÁRIOS / DADOS ============ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.field .input { width: 100%; }
.switch-field { grid-column: span 2; flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.switch { appearance: none; width: 38px; height: 22px; background: #d7e2de; border-radius: 20px; position: relative; cursor: pointer; transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch:checked { background: var(--accent); }
.switch:checked::after { left: 19px; }
.import-box { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 11px; background: var(--surface-2); }
.import-box > .icon { width: 26px; height: 26px; color: var(--accent-strong); flex: 0 0 auto; }
.import-box > div { flex: 1; min-width: 0; }
.import-box strong { display: block; font-size: 12.5px; }
.import-box span { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.radio-row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 13px; }
.radio { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.radio input { accent-color: var(--accent); width: 15px; height: 15px; }
.radio small { color: var(--text-3); font-size: 10.5px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.danger-card { border-color: #f0d6d3; }
.maintenance-list { display: flex; flex-direction: column; }
.maintenance-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid #eef3f1; }
.maintenance-item:last-child { border-bottom: 0; padding-bottom: 0; }
.maintenance-item strong { display: block; font-size: 12.5px; font-weight: 600; }
.maintenance-item span { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.45; }
.maintenance-item .btn { flex: 0 0 auto; }
.info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.info-item { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.info-item span { display: block; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.info-item strong { display: block; font-size: 13px; margin-top: 3px; word-break: break-word; }

/* ============ TOASTS ============ */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; min-width: 250px; max-width: 380px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 11px 13px; box-shadow: 0 12px 30px rgba(10,30,26,.16);
  font-size: 12.5px; pointer-events: auto; animation: toastIn .22s ease;
}
.toast .icon { width: 17px; height: 17px; color: var(--accent-strong); margin-top: 1px; flex: 0 0 auto; }
.toast div { flex: 1; line-height: 1.4; }
.toast strong { display: block; font-size: 12.5px; }
.toast span { color: var(--text-2); font-size: 11.5px; }
.toast.error { border-left-color: var(--red); }
.toast.error .icon { color: var(--red); }
.toast.warn { border-left-color: var(--amber); }
.toast.warn .icon { color: var(--amber); }
.toast.info { border-left-color: var(--blue); }
.toast.info .icon { color: var(--blue); }
.toast.hide { animation: toastOut .2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(14px); } }

/* ============ MODAIS ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 24, 21, .48); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px); animation: fadeIn .15s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal.lg { max-width: 720px; }
.modal.xl { max-width: 900px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; letter-spacing: -.2px; }
.modal-head p { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.modal-close { width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-3); border-radius: 8px; display: grid; place-items: center; }
.modal-close:hover { background: var(--bg-soft); color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.modal-foot .btn-danger { margin-right: auto; }
.modal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-form .full { grid-column: span 2; }
.modal-form .field span { font-size: 11px; }
.modal-note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 11.5px; color: var(--text-2); line-height: 1.5; margin-bottom: 14px; }
.search-results { max-height: 320px; overflow-y: auto; margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; }
.search-result { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid #eef3f1; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-2); }
.search-result div { flex: 1; min-width: 0; }
.search-result strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
.search-result .btn { flex: 0 0 auto; }
.product-summary { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.product-summary strong { display: block; font-size: 13px; line-height: 1.4; }
.product-summary span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.product-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.product-facts div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.product-facts span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-3); margin: 0; }
.product-facts b { display: block; font-size: 14px; margin-top: 1px; }
.ean-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ean-chip { display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; padding: 4px 7px; font-size: 10.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ean-chip button { border: 0; background: transparent; color: var(--text-3); padding: 0; display: inline-grid; place-items: center; }
.ean-chip button:hover { color: var(--red); }
.ean-chip .icon { width: 11px; height: 11px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid .full { grid-column: span 2; }
.count-editor { display: flex; align-items: center; gap: 8px; }
.count-editor input { width: 90px; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-2); padding: 8px 0; cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }
.help-list { display: flex; flex-direction: column; gap: 14px; }
.help-item { display: flex; gap: 11px; }
.help-num { width: 25px; height: 25px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.help-item strong { display: block; font-size: 12.5px; margin-bottom: 2px; }
.help-item span { font-size: 11.5px; color: var(--text-2); line-height: 1.5; }
.scanner-tip { display: flex; gap: 10px; background: var(--accent-soft); border: 1px solid #c4ead9; border-radius: 10px; padding: 11px 13px; font-size: 11.5px; color: #216a52; line-height: 1.5; margin-top: 14px; }
.scanner-tip .icon { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }

/* ============ CÓDIGO DE BARRAS / CÂMERA / AÇÕES ============ */
.btn-danger-ghost { color: var(--red); border-color: #efc9c5; background: #fff; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.scan-camera-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.scan-camera-row span { font-size: 10.5px; color: var(--text-3); line-height: 1.4; }
.scan-filter-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.scan-filter-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.scan-filter-switch > span { min-width: 0; }
.scan-filter-switch strong { display: block; font-size: 12px; font-weight: 600; }
.scan-filter-switch small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.scan-filter-switch .switch:disabled { opacity: .6; cursor: not-allowed; }
.scan-actions-card { padding: 12px 16px; }
.scan-actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-actions-row .btn { flex: 1 1 auto; }
.camera-box { position: relative; overflow: hidden; border-radius: 12px; background: #081614; aspect-ratio: 4 / 3; }
.camera-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-frame { position: absolute; inset: 18% 10%; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.22); pointer-events: none; }
.wizard-option { display: flex; align-items: flex-start; gap: 10px; margin-top: 13px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.wizard-option input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; }
.wizard-option strong { display: block; font-size: 12px; }
.wizard-option small { display: block; font-size: 10.5px; color: var(--text-3); line-height: 1.45; margin-top: 2px; }
.import-box input[type="file"] { max-width: 240px; font-size: 11px; }

/* ============ RESPONSIVO ============ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .scan-layout { grid-template-columns: 1fr; }
  .readings-card { position: static; max-height: none; }
  .readings-card .readings-list { max-height: 360px; }
}
@media (max-width: 960px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; width: 252px; flex-basis: 252px; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; width: 100%; }
  .menu-btn { display: inline-grid !important; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 42px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; padding: 22px; }
  .hero-ring-wrap { width: 100%; justify-content: space-between; }
}
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .show-sm { display: inline; }
  .stats-grid, .stats-grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 13px; gap: 10px; }
  .stat-value { font-size: 20px; }
  .stat-icon { width: 32px; height: 32px; }
  .page-heading h1 { font-size: 18px; }
  .page-heading p { display: none; }
  .card { padding: 16px; }
  .scan-card { padding: 16px; }
  .scan-input-wrap { flex-wrap: wrap; }
  .scan-input-wrap input { padding: 13px 8px; font-size: 16px; width: 100%; flex: 1 1 100%; }
  .scan-submit { width: calc(100% - 10px); margin: 0 5px 5px; }
  .scan-icon { display: none; }
  .session-stats { grid-template-columns: 1fr 1fr 1fr; }
  .session-actions .btn { flex: 1 1 100%; }
  .scan-actions-row .btn { flex: 1 1 calc(50% - 8px); }
  .scan-camera-row { align-items: flex-start; flex-direction: column; }
  .scan-filter-switch { align-items: flex-start; }
  .import-box { flex-wrap: wrap; }
  .import-box input[type="file"] { max-width: 100%; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .switch-field { grid-column: span 1; }
  .modal-form, .detail-grid { grid-template-columns: 1fr; }
  .modal-form .full, .detail-grid .full { grid-column: span 1; }
  .product-facts { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr 1fr; }
  .toolbar .select, .toolbar .search-wrap { width: 100%; flex: 1 1 100%; }
  .input-sm { width: 100%; }
  .section-row { grid-template-columns: 96px 1fr 70px; }
  .hero-ring { width: 106px; height: 106px; }
  .hero-ring-inner strong { font-size: 21px; }
  .report-actions { align-items: flex-start; }
  .maintenance-item { align-items: flex-start; flex-direction: column; gap: 8px; }
  .maintenance-item .btn { align-self: flex-start; }
  .td-prod { min-width: 210px; }
}
@media (max-width: 430px) {
  .stats-grid, .stats-grid-4 { grid-template-columns: 1fr; }
  .hero-ring-wrap { flex-direction: column; align-items: flex-start; }
  .hero-mini { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .session-stats { grid-template-columns: 1fr; }
}

/* ============ IMPRESSÃO ============ */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; font-size: 10pt; }
  .app-shell, .toast-container, #modal-root { display: none !important; }
  #print-area { display: block !important; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #0f2e2a; padding-bottom: 8px; margin-bottom: 12px; }
  .print-head h1 { font-size: 16pt; margin: 0; }
  .print-head p { font-size: 8.5pt; color: #555; margin: 3px 0 0; }
  .print-head .print-logo { font-size: 9pt; text-align: right; color: #555; }
  .print-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
  .print-meta div { border: 1px solid #ddd; border-radius: 5px; padding: 6px 8px; }
  .print-meta span { display: block; font-size: 7pt; text-transform: uppercase; color: #777; }
  .print-meta b { display: block; font-size: 11pt; margin-top: 1px; }
  .print-section { margin-top: 14px; page-break-inside: avoid; }
  .print-section h2 { font-size: 11pt; margin: 0 0 5px; }
  #print-area table { width: 100%; border-collapse: collapse; font-size: 8pt; }
  #print-area th { background: #f0f4f2; border: 1px solid #ccc; padding: 4px 5px; font-size: 7pt; }
  #print-area td { border: 1px solid #ddd; padding: 3px 5px; }
  #print-area tr { page-break-inside: avoid; }
  .print-foot { margin-top: 24px; display: flex; justify-content: space-between; font-size: 8pt; color: #666; }
  .print-sign { margin-top: 34px; border-top: 1px solid #666; width: 240px; text-align: center; padding-top: 4px; font-size: 8pt; }
  .print-summary-line { display: flex; gap: 16px; font-size: 8.5pt; margin: 6px 0 10px; }
}

/* ============ LOGIN ============ */
body.auth-lock { overflow: hidden; }
body.auth-lock .app-shell { display: none; }
.login-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 20px;
  background:
    radial-gradient(700px 340px at 85% 10%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 60%),
    radial-gradient(600px 360px at 10% 90%, rgba(37,99,235,.12), transparent 60%),
    linear-gradient(160deg, var(--brand), var(--brand-3));
}
.login-card {
  width: 100%; max-width: 390px; background: var(--surface);
  border-radius: 18px; padding: 28px 26px 22px; box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.5);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-logo {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #fff;
  box-shadow: 0 8px 20px rgba(14,159,110,.32);
}
.login-logo .icon { width: 24px; height: 24px; }
.login-brand h1 { font-size: 18px; letter-spacing: -.2px; }
.login-brand p { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.login-card .field { margin-bottom: 12px; }
.login-error {
  font-size: 12px; color: var(--red); background: var(--red-soft);
  border: 1px solid #f5c2be; border-radius: 8px; padding: 8px 10px; margin: 2px 0 12px;
}
.btn-block { width: 100%; justify-content: center; padding: 10px 14px; font-size: 13.5px; }
.login-foot { margin-top: 16px; font-size: 11px; color: var(--text-3); text-align: center; line-height: 1.5; }
.login-copy { font-size: 10.5px; color: #7fa39a; letter-spacing: .4px; text-transform: uppercase; }
.login-setup-head { margin: -4px 0 16px; }
.login-kicker { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--accent); margin-bottom: 5px; }
.login-setup-head h2 { font-size: 16px; letter-spacing: -.2px; margin-bottom: 5px; }
.login-setup-head p { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.login-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-grid .field { margin-bottom: 12px; }
@media (max-width: 420px) { .login-grid { grid-template-columns: 1fr; gap: 0; } }

/* ============ USUÁRIO NO MENU ============ */
.user-card {
  display: flex; align-items: center; gap: 8px; padding: 8px 7px;
  border-radius: 10px; background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.075); margin-bottom: 10px;
}
.user-card.pending { border-color: rgba(245,158,11,.55); box-shadow: 0 0 0 1px rgba(245,158,11,.16); }
.user-avatar {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .4px;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-meta strong { font-size: 11px; color: #eef7f3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 10px; color: #8fb0a7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-action {
  width: 24px; height: 24px; border-radius: 7px; flex: 0 0 24px;
  background: transparent; border: 1px solid transparent; color: #9dbab1;
}
.user-action:hover { background: rgba(255,255,255,.10); color: #fff; }
.user-action .icon { width: 14px; height: 14px; }

/* ============ USUÁRIOS ============ */
.role-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  white-space: nowrap;
}
.role-admin { background: var(--purple-soft); color: var(--purple); }
.role-supervisor { background: var(--blue-soft); color: var(--blue); }
.role-operador { background: var(--bg-soft); color: var(--text-2); }
.role-bipador { background: var(--accent-soft); color: var(--accent-strong); }
.role-pending { background: var(--amber-soft); color: var(--amber); }
.users-table td { vertical-align: middle; }
.users-table .td-actions { display: flex; gap: 5px; justify-content: flex-end; }
.user-inactive { opacity: .58; }
.perfis-table th:not(:first-child), .perfis-table td:not(:first-child) { text-align: center; }
.perfis-table .ok { color: var(--accent-strong); font-weight: 700; }
.perfis-table .no { color: var(--text-3); }

/* ============ APARÊNCIA E FARMÁCIAS ============ */
.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.color-input {
  width: 100%; height: 42px; padding: 3px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface);
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch { border: 0; border-radius: 6px; }
.theme-logo-row {
  display: flex; align-items: center; gap: 14px; margin: 16px 0;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.theme-logo-preview {
  width: 66px; height: 66px; flex: 0 0 66px; border-radius: 14px;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong)); color: #fff;
}
.theme-logo-preview .icon { width: 30px; height: 30px; }
.theme-logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.theme-logo-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.theme-logo-copy strong { font-size: 13px; }
.theme-logo-copy > span { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.theme-logo-copy .button-row { margin-top: 6px; }
.farmacia-cell { display: flex; align-items: center; gap: 9px; }
.farmacia-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: 0 0 9px; }
.farmacia-dot.inactive { background: var(--text-3); opacity: .5; }
.farmacia-sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
/* ============ HISTÓRICO E NOVA BATIDA ============ */
.batida-resumo { margin-bottom: 16px; }
.batida-resumo .stats-grid { margin-bottom: 14px; }
.wizard-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.wizard-step {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 12px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.wizard-step.ok { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.wizard-step-head { display: flex; align-items: flex-start; gap: 10px; }
.wizard-step-head strong { display: block; font-size: 13px; }
.wizard-step-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-3); line-height: 1.45; }
.wizard-num {
  width: 24px; height: 24px; border-radius: 8px; flex: 0 0 24px;
  display: grid; place-items: center; font-size: 12px; font-weight: 800;
  color: var(--accent-strong); background: var(--accent-soft);
}
.wizard-step-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0 34px; }
.wizard-file { font-size: 11.5px; color: var(--text-3); overflow-wrap: anywhere; }
.wizard-step.ok .wizard-file { color: var(--accent-strong); font-weight: 600; }
@media (max-width: 760px) {
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batida-resumo .info-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .login-card { padding: 22px 18px 18px; }
  .users-table .td-actions { flex-direction: column; align-items: flex-end; }
}
