﻿:root {
  --sidebar-compact: 76px;
  --sidebar-expanded: 284px;
  --ink: #111827;
  --soft: #314155;
  --muted: #667085;
  --line: #d9e3ec;
  --line-strong: #b9c9d8;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --nav: #071521;
  --brand: #106b91;
  --blue: #1478a6;
  --cyan: #20c7d9;
  --green: #16a36a;
  --red: #d92d20;
  --amber: #d98a00;
  --violet: #6658d3;
  --surface: #f8fafc;
  --surface-strong: #edf4f8;
  --shadow: 0 18px 44px rgba(17, 24, 39, .08);
  --shadow-soft: 0 8px 22px rgba(17, 24, 39, .06);
  --ring-blue: rgba(32, 199, 217, .26);
  --ring-green: rgba(22, 163, 106, .22);
  --ring-red: rgba(217, 45, 32, .2);
  --ring-amber: rgba(217, 138, 0, .22);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 18% 0%, rgba(32,199,217,.12), transparent 340px), radial-gradient(circle at 92% 8%, rgba(102,88,211,.08), transparent 280px), linear-gradient(180deg, #f8fbfd 0%, var(--bg) 320px); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { min-height: 40px; border: 0; border-radius: 7px; background: linear-gradient(135deg, var(--blue), #0f668f); color: white; padding: 9px 14px; font-weight: 850; cursor: pointer; transition: background .14s ease, border-color .14s ease, color .14s ease, filter .14s ease, transform .14s ease, box-shadow .14s ease; }
button:hover { filter: brightness(1.02); box-shadow: 0 8px 20px rgba(20, 120, 166, .16); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--ring-blue); }
button:disabled { cursor: not-allowed; filter: none; opacity: 1; box-shadow: none; background: #eef4f8; color: var(--muted); border: 1px solid var(--line); }
button.ghost { background: #ffffff; color: var(--ink); border: 1px solid #c8d5df; box-shadow: 0 1px 0 rgba(255,255,255,.8), 0 5px 14px rgba(17,24,39,.04); }
button.success { background: linear-gradient(135deg, var(--green), #08784f); box-shadow: 0 10px 24px rgba(22,163,106,.16); }
button.danger { background: linear-gradient(135deg, #c2413a, #8f211c); color: white; box-shadow: 0 10px 24px rgba(194,65,58,.15); }
button.success:disabled,
button.primary:disabled,
button.ghost:disabled,
button.danger:disabled { background: #eef4f8; color: var(--muted); border: 1px solid var(--line); }
.hidden { display: none !important; }
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 16%, rgba(32,199,217,.24), transparent 280px),
    linear-gradient(145deg, #06111d 0%, #071521 54%, #0c2437 100%);
}
.boot-card {
  display: grid;
  justify-items: center;
  gap: 13px;
  color: #ffffff;
}
.boot-card .brand-mark {
  width: 58px;
  height: 58px;
  font-size: 30px;
  box-shadow: 0 16px 44px rgba(32,199,217,.24);
}
.boot-card strong {
  font-size: 22px;
  line-height: 1;
}
.boot-card i {
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255,255,255,.18);
  border-top-color: #20c7d9;
  border-radius: 999px;
  animation: boot-spin .8s linear infinite;
}
@keyframes boot-spin {
  to { transform: rotate(360deg); }
}
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 16%, rgba(32,199,217,.28), transparent 280px),
    radial-gradient(circle at 84% 78%, rgba(22,163,106,.16), transparent 340px),
    linear-gradient(145deg, #06111d 0%, #071521 46%, #0c2437 100%);
}
.login-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 76%, transparent);
}
.login-panel {
  position: relative;
  width: min(940px, 100%);
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 34px 90px rgba(0,0,0,.34), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.login-hero {
  position: relative;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: stretch;
  gap: 42px;
  padding: 34px;
  overflow: hidden;
  color: white;
  background: linear-gradient(145deg, #071521 0%, #0b263c 56%, #0f526a 100%);
}
.login-hero::after {
  content: "";
  position: absolute;
  inset: auto -70px -130px auto;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(32,199,217,.32), transparent 62%);
}
.login-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .72;
}
.login-orbit span {
  position: absolute;
  border: 1px solid rgba(147,225,236,.22);
  border-radius: 999px;
}
.login-orbit span:nth-child(1) { width: 260px; height: 260px; right: -62px; top: -58px; }
.login-orbit span:nth-child(2) { width: 150px; height: 150px; right: 70px; bottom: 86px; }
.login-orbit span:nth-child(3) { width: 82px; height: 82px; left: 34px; bottom: 128px; background: rgba(32,199,217,.08); }
.login-brand,
.login-hero > div:not(.login-orbit) {
  position: relative;
  z-index: 1;
}
.login-brand { margin-bottom: 0; }
.login-brand .brand-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 28px; }
.login-brand strong { color: white; font-size: 18px; }
.login-brand small { color: #b9d7e5; }
.login-kicker {
  margin: 0 0 8px;
  color: #7de9f4;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}
.login-hero h1 {
  max-width: 430px;
  margin: 0;
  color: white;
  font-size: 48px;
  line-height: 1;
  align-self: center;
}
.login-copy {
  max-width: 410px;
  margin: 16px 0 0;
  color: #c4d6e2;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 750;
}
.login-signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.login-signal-grid div {
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}
.login-signal-grid span,
.login-signal-grid small {
  display: block;
  color: #a9c5d6;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.login-signal-grid strong {
  display: block;
  margin: 6px 0 4px;
  color: white;
  font-size: 30px;
  line-height: 1;
}
.login-form-card {
  display: grid;
  align-content: center;
  padding: 36px 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(32,199,217,.12), transparent 210px),
    linear-gradient(180deg, #ffffff, #f8fbfd);
}
.login-form-head { margin-bottom: 22px; }
.login-form-head h2 { margin: 0; font-size: 28px; letter-spacing: 0; }
.login-form-head span { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; font-weight: 750; }
.brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #20c7d9, #106b91); color: white; font-size: 22px; font-weight: 900; box-shadow: 0 10px 28px rgba(32,199,217,.24); }
.brand-row strong, .brand-row small { display: block; }
.brand-row small { color: var(--muted); }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; color: #344054; font-size: 12px; font-weight: 850; }
input, select, textarea { width: 100%; border: 1px solid #cbd5df; border-radius: 7px; padding: 10px 11px; color: var(--ink); background: white; transition: border-color .14s ease, box-shadow .14s ease, background .14s ease; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--ring-blue); background: #fbfeff; }
.primary { background: var(--blue); }
.form-error { min-height: 18px; margin: 0; color: var(--red); font-weight: 800; }
.demo-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.demo-users button { min-height: 36px; background: #eef4f8; color: var(--ink); border: 1px solid var(--line); font-size: 12px; }
.login-form-card form { gap: 15px; }
.login-form-card label { color: #1f2f43; font-size: 12px; }
.login-form-card input {
  min-height: 48px;
  border-color: #c5d3df;
  border-radius: 10px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 1px 0 rgba(255,255,255,.88) inset;
}
.login-form-card .primary {
  min-height: 50px;
  margin-top: 2px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1478a6, #0c88aa);
  box-shadow: 0 14px 28px rgba(20,120,166,.2);
  font-size: 15px;
}
.login-form-card .form-error { font-size: 12px; }
.login-form-card .demo-users { margin-top: 18px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-compact) minmax(0, 1fr); }
.toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 15px;
  border: 1px solid #b8e1c9;
  border-radius: 8px;
  background: #f3fbf7;
  color: #146c43;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .16);
  font-weight: 900;
}
.toast.error {
  border-color: #efc0ba;
  background: #fff8f7;
  color: var(--red);
}
.sidebar { position: sticky; top: 0; z-index: 30; width: var(--sidebar-compact); height: 100vh; display: flex; flex-direction: column; gap: 16px; overflow: hidden; padding: 16px 10px; background: linear-gradient(180deg, #071521 0%, #0d2238 52%, #081827 100%); color: white; border-right: 1px solid rgba(255,255,255,.08); box-shadow: inset -1px 0 0 rgba(255,255,255,.04), 18px 0 60px rgba(15,35,58,.08); transition: width .18s ease, padding .18s ease, box-shadow .18s ease; }
.sidebar:hover,
.sidebar:focus-within { width: var(--sidebar-expanded); padding: 20px; box-shadow: 22px 0 64px rgba(15,35,58,.22), inset -1px 0 0 rgba(255,255,255,.04); }
.sidebar .brand-row { margin-bottom: 0; }
.sidebar .brand-row small { color: #b7c5d3; }
.sidebar .brand-row { justify-content: center; min-width: 0; }
.sidebar:hover .brand-row,
.sidebar:focus-within .brand-row { justify-content: flex-start; }
.sidebar .brand-row > div,
.sidebar .side-title span,
.sidebar .store-item span,
.sidebar .store-item small { opacity: 0; visibility: hidden; white-space: nowrap; transition: opacity .12s ease, visibility .12s ease; }
.sidebar:hover .brand-row > div,
.sidebar:focus-within .brand-row > div,
.sidebar:hover .side-title span,
.sidebar:focus-within .side-title span,
.sidebar:hover .store-item span,
.sidebar:focus-within .store-item span,
.sidebar:hover .store-item small,
.sidebar:focus-within .store-item small { opacity: 1; visibility: visible; }
.nav, #storeList, .list, .cards-list { display: grid; gap: 9px; }
.nav button, .store-item { width: 100%; position: relative; text-align: left; background: rgba(255,255,255,.045); color: white; border: 1px solid rgba(255,255,255,.12); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.nav button { min-height: 44px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; overflow: hidden; padding: 8px 12px; font-size: 15px; }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); color: #d6e1eb; }
.nav-icon svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; shape-rendering: geometricPrecision; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar:not(:hover):not(:focus-within) .nav button { grid-template-columns: 1fr; place-items: center; padding: 0; }
.sidebar:not(:hover):not(:focus-within) .nav-label { display: none; }
.sidebar:not(:hover):not(:focus-within) .nav-icon { width: 34px; height: 34px; background: rgba(255,255,255,.08); }
.sidebar:not(:hover):not(:focus-within) .nav-icon svg { width: 19px; height: 19px; }
.nav button.active .nav-icon { background: rgba(32,199,217,.14); color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(32,199,217,.24), 0 0 18px rgba(32,199,217,.2); }
.nav button.active, .store-item.active { background: linear-gradient(135deg, #ffffff, #edfaff); color: var(--ink); box-shadow: 0 14px 30px rgba(0,0,0,.18), inset 3px 0 0 var(--cyan); }
.nav button:not(.active):hover, .store-item:not(.active):hover { background: rgba(255,255,255,.09); border-color: rgba(32,199,217,.32); }
.store-menu { min-height: 0; overflow: hidden auto; }
.side-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #d6e1eb; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.side-title button { width: 30px; min-width: 30px; min-height: 30px; padding: 0; }
.store-item { border-radius: 7px; padding: 12px 13px; font-weight: 800; }
.sidebar:not(:hover):not(:focus-within) .store-item { display: grid; place-items: center; min-height: 48px; padding: 0; color: transparent; }
.sidebar:not(:hover):not(:focus-within) .store-item::after { content: attr(data-store-code); color: #d6e1eb; font-size: 11px; font-weight: 950; }
.sidebar:not(:hover):not(:focus-within) .store-item.active::after { color: var(--ink); }
.store-item small { display: block; margin-top: 3px; opacity: .72; }
.store-item.archived:not(.active) { opacity: .58; }
.store-item.archived span { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(214,225,235,.35); }
.logout { margin-top: auto; overflow: hidden; white-space: nowrap; }
.sidebar:not(:hover):not(:focus-within) .logout { display: grid; place-items: center; padding: 0; color: transparent; font-size: 0; }
.sidebar:not(:hover):not(:focus-within) .logout::after { content: "Salir"; color: var(--ink); font-size: 10px; font-weight: 950; }
.content { min-width: 0; max-width: 1460px; width: 100%; padding: 30px 34px 52px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin: -30px -34px 24px; padding: 24px 34px 18px; background: rgba(248,251,253,.82); border-bottom: 1px solid rgba(217,227,236,.7); backdrop-filter: blur(16px); }
.topbar-actions { display: grid; justify-items: end; gap: 10px; }
.top-nav { display: none; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.72); box-shadow: var(--shadow-soft); }
.top-nav button { min-height: 34px; display: block; padding: 7px 11px; border: 0; background: transparent; color: var(--soft); box-shadow: none; font-size: 12px; }
.top-nav .nav-icon { display: none; }
.top-nav button.active { background: var(--ink); color: white; box-shadow: 0 8px 18px rgba(17,24,39,.14); }
.store-context { margin-top: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
body[data-role="admin"] .sidebar { gap: 16px; }
body[data-role="admin"] .sidebar .nav { display: none; }
body[data-role="admin"] .store-menu { flex: 1; }
body[data-role="admin"] .store-item { min-height: 66px; display: grid; align-content: center; border-color: rgba(255,255,255,.13); }
body[data-role="admin"] .store-item.active { border-color: rgba(32,199,217,.75); }
body[data-role="admin"] .top-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; }
body:not([data-role="admin"]) .store-menu { display: none; }
body[data-role="admin"] .sidebar:not(:hover):not(:focus-within) .store-item {
  width: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  color: transparent;
}
body[data-role="admin"] .sidebar:not(:hover):not(:focus-within) .store-item span,
body[data-role="admin"] .sidebar:not(:hover):not(:focus-within) .store-item small {
  display: none;
}
body[data-role="admin"] .sidebar:not(:hover):not(:focus-within) .store-item::after {
  content: attr(data-store-code);
  color: #d6e1eb;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}
body[data-role="admin"] .sidebar:not(:hover):not(:focus-within) .store-item.active::after {
  color: var(--ink);
}
.eyebrow { margin: 0 0 5px; color: var(--brand); font-size: 12px; font-weight: 950; text-transform: uppercase; }
.help-tip { position: relative; display: inline-flex !important; align-items: center; width: fit-content; cursor: help; overflow: visible; }
.floating-help { position: fixed; z-index: 500; max-width: min(320px, calc(100vw - 24px)); padding: 10px 11px; border: 1px solid rgba(32,199,217,.28); border-radius: 8px; background: #071521; color: white; box-shadow: 0 18px 42px rgba(7,21,33,.24); font-size: 12px; font-weight: 750; line-height: 1.35; opacity: 0; pointer-events: none; transform: translateY(-4px); transition: opacity .12s ease, transform .12s ease; }
.floating-help.visible { opacity: 1; transform: translateY(0); }
h1, h2 { margin: 0; }
h1 { font-size: 34px; line-height: 1.05; letter-spacing: 0; }
h2 { font-size: 19px; }
.session-pill, .badge { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; border-radius: 999px; background: #fff8e8; color: #8a4f00; border: 1px solid #f0cf8b; padding: 5px 10px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; box-shadow: 0 0 12px currentColor; }
.session-pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--green); box-shadow: 0 0 12px var(--green); }
.badge.ok { background: #eafaf1; border-color: #abe8c9; color: #08784f; }
.badge.live { background: #eafcff; border-color: #a8e8f0; color: #0b6f7d; }
.badge.closed { background: #eef2f6; border-color: #d6dde5; color: #526171; }
.view { display: none; }
.view.active { display: grid; gap: 20px; }
.role-home { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 12px; }
.home-action { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 92px; padding: 18px 20px; border: 1px solid rgba(32,199,217,.34); border-radius: 8px; background: linear-gradient(135deg, #071521 0%, #0e2a43 100%); color: white; box-shadow: 0 20px 54px rgba(7,21,33,.18); }
.home-action.quiet { border-color: rgba(217,227,236,.9); background: linear-gradient(180deg, #ffffff, #f8fbfd); color: var(--ink); box-shadow: var(--shadow-soft); }
.home-action span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.home-action:not(.quiet) span { color: #9de8f1; }
.home-action strong { display: block; margin-top: 5px; font-size: 18px; line-height: 1.25; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.38fr) minmax(330px, .62fr); align-items: start; }
.panel, .phone-stage { min-width: 0; background: rgba(255,255,255,.98); border: 1px solid rgba(185,201,216,.74); border-radius: 8px; box-shadow: 0 18px 48px rgba(17,24,39,.07); }
.panel { padding: 0; overflow: hidden; }
.panel > :not(.panel-head) { margin-left: 20px; margin-right: 20px; }
.panel > :last-child { margin-bottom: 20px; }
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin: 0 0 18px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-grid div, .store-profile div, .stock-progress, .count-line-stats div, .card, .empty { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 12px; }
.metric-grid div { position: relative; min-height: 96px; overflow: hidden; background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%); box-shadow: var(--shadow-soft); }
.metric-grid div::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--cyan), transparent); opacity: .82; }
.metric-grid span, .store-profile span, .stock-progress span { display: block; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.metric-grid strong { display: block; margin-top: 7px; font-size: 30px; line-height: 1; }
.admin-control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr); gap: 14px; margin-bottom: 14px; }
.attention-list { display: grid; gap: 8px; }
.attention-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 8px; background: linear-gradient(180deg, #ffffff, #fbfdff); cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.attention-card:hover { border-color: #9ec8df; box-shadow: 0 12px 28px rgba(32,199,217,.12); transform: translateY(-1px); }
.attention-card.overdue { border-left-color: var(--red); }
.attention-card span,
.attention-card small,
.timeline-item small,
.timeline-item span,
.store-health-card span,
.store-health-card small,
.store-health-card em { display: block; color: var(--muted); font-size: 12px; font-weight: 850; }
.attention-card span,
.store-health-card span { color: var(--brand); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.attention-card strong { display: block; margin: 3px 0; font-size: 15px; }
.store-health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.store-health-card { min-height: 118px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); text-align: left; cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.store-health-card:hover,
.store-health-card.active { border-color: #9ec8df; box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.store-health-card.active { outline: 2px solid rgba(31,111,159,.18); }
.store-health-card strong { display: block; margin-top: 5px; font-size: 15px; }
.store-health-card em { margin: 9px 0 5px; color: var(--ink); font-style: normal; }
.store-health-card::before { content: ""; display: block; height: 3px; margin: -12px -12px 10px; border-radius: 8px 8px 0 0; background: var(--green); box-shadow: 0 0 14px var(--ring-green); }
.store-health-card.needs-review::before { background: var(--amber); box-shadow: 0 0 14px var(--ring-amber); }
.store-health-card.in-progress::before { background: var(--cyan); box-shadow: 0 0 14px var(--ring-blue); }
.store-health-card.needs-review,
.store-health-card.in-progress,
.store-health-card.ok { background: linear-gradient(180deg, #ffffff, #fbfdff); }
.diff-summary-card {
  display: grid;
  gap: 7px;
  width: min(540px, 100%);
  min-height: 112px;
  padding: 18px 20px;
  border: 1px solid rgba(217,138,0,.32);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: linear-gradient(135deg, #fffaf0 0%, #ffffff 58%, #f2fcff 100%);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 18px 42px rgba(17,24,39,.08);
}
.diff-summary-card.clean {
  border-color: rgba(15,169,102,.34);
  border-left-color: var(--green);
  background: linear-gradient(135deg, #f0fbf5 0%, #ffffff 68%);
}
.diff-summary-card:hover {
  border-color: rgba(31,111,159,.38);
  box-shadow: 0 22px 52px rgba(17,24,39,.11);
  transform: translateY(-1px);
}
.diff-summary-card span { color: var(--brand); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.diff-summary-card strong { font-size: 22px; line-height: 1.15; }
.diff-summary-card em { color: var(--muted); font-size: 13px; font-style: normal; font-weight: 850; line-height: 1.35; }
.calendar-panel { margin-top: 14px; }
.calendar-head { align-items: center; }
.calendar-controls { display: inline-flex; align-items: center; gap: 8px; }
.calendar-controls strong { min-width: 170px; color: var(--ink); font-size: 15px; text-align: center; }
.icon-btn { width: 38px; min-width: 38px; min-height: 38px; padding: 0; font-size: 24px; line-height: 1; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.calendar-dot { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: #f8fbfd; color: var(--soft); font-size: 11px; font-weight: 900; }
.calendar-dot::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--amber); box-shadow: 0 0 10px rgba(217,138,0,.25); }
.calendar-dot.live::before { background: var(--cyan); box-shadow: 0 0 10px var(--ring-blue); }
.calendar-dot.ok::before { background: var(--green); box-shadow: 0 0 10px var(--ring-green); }
.calendar-dot.closed::before { background: #8796a6; box-shadow: none; }
.inventory-calendar { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.calendar-weekdays,
.calendar-grid { min-width: 980px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #edf5fa; }
.calendar-weekdays span { padding: 10px 8px; color: var(--soft); font-size: 11px; font-weight: 950; text-align: center; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-day { min-height: 132px; padding: 8px; overflow: hidden; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #ffffff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:nth-last-child(-n+7) { border-bottom: 0; }
.calendar-day.muted-day { background: #f7fafc; }
.calendar-day.today { background: linear-gradient(180deg, #f2fcff, #ffffff); box-shadow: inset 0 0 0 2px rgba(32,199,217,.22); }
.calendar-day-number { display: flex; justify-content: space-between; align-items: center; min-height: 20px; margin-bottom: 7px; color: var(--soft); font-size: 12px; font-weight: 950; }
.calendar-day.muted-day .calendar-day-number { color: #a2afbd; }
.calendar-day-number em { padding: 2px 6px; border-radius: 999px; background: rgba(32,199,217,.1); color: var(--brand); font-size: 10px; font-style: normal; }
.calendar-events { display: grid; gap: 5px; }
.calendar-event {
  display: grid;
  width: 100%;
  gap: 1px;
  min-height: 48px;
  max-height: 52px;
  padding: 6px 8px;
  border: 1px solid #f0d299;
  border-left: 3px solid var(--amber);
  border-radius: 7px;
  background: #fffaf0;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}
.calendar-event:hover { border-color: #e2b75c; box-shadow: 0 8px 20px rgba(217,138,0,.12); transform: none; }
.calendar-event.live { border-color: #aee2ed; border-left-color: var(--cyan); background: #f0fbfd; }
.calendar-event.ok { border-color: #bcebd2; border-left-color: var(--green); background: #f0fbf5; }
.calendar-event.closed { border-color: #dde6ee; border-left-color: #8fa0b2; background: #f8fafc; }
.calendar-event strong { overflow: hidden; font-size: 12px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span,
.calendar-event em { overflow: hidden; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 850; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.calendar-more { min-height: 26px; padding: 4px 7px; border: 1px dashed #b9c9d8; border-radius: 7px; background: #f8fbfd; color: var(--soft); font-size: 11px; font-weight: 900; box-shadow: none; }
.timeline-list { display: grid; gap: 14px; }
.timeline-block { display: grid; gap: 8px; }
.timeline-block > span { color: var(--brand); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.timeline-item { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, #ffffff, #fbfdff); cursor: pointer; }
.timeline-item:hover { border-color: #9ec8df; box-shadow: var(--shadow-soft); }
.timeline-item strong { display: block; font-size: 14px; }
.store-profile { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.table-wrap { max-width: 100%; overflow: auto; overflow-y: visible; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
table { width: 100%; min-width: 860px; border-collapse: collapse; }
#dashboardView table { min-width: 720px; }
#productsView table { min-width: 100%; table-layout: fixed; }
#dashboardView table { table-layout: fixed; }
#dashboardView td { overflow-wrap: anywhere; }
#dashboardView th { overflow-wrap: normal; }
#dashboardView th:nth-child(1) { width: 22%; }
#dashboardView th:nth-child(2) { width: 16%; }
#dashboardView th:nth-child(3) { width: 27%; }
#dashboardView th:nth-child(4) { width: 10%; }
#dashboardView th:nth-child(5) { width: 14%; }
#dashboardView th:nth-child(6) { width: 11%; }
#usersView table { min-width: 720px; }
#productsView th:nth-child(1) { width: 12%; }
#productsView th:nth-child(2) { width: 25%; }
#productsView th:nth-child(3) { width: 14%; }
#productsView th:nth-child(4) { width: 9%; }
#productsView th:nth-child(5) { width: 16%; }
#productsView th:nth-child(6),
#productsView th:nth-child(7) { width: 8%; text-align: center; }
#productsView th:nth-child(8) { width: 8%; text-align: right; }
#productsView td:nth-child(6),
#productsView td:nth-child(7) { text-align: center; }
#productsView td:nth-child(8) { text-align: right; }
#productsView th,
#productsView td { padding: 10px 9px; }
#productsView th { overflow-wrap: normal; word-break: normal; font-size: 10px; }
#productsView td { overflow-wrap: anywhere; }
#inventoriesView table { min-width: 1120px; }
#inventoriesView section:last-child table { min-width: 100%; table-layout: fixed; }
#inventoriesView section:last-child th,
#inventoriesView section:last-child td { padding: 10px 8px; font-size: 13px; overflow-wrap: anywhere; }
#inventoriesView section:last-child th { font-size: 10px; }
#inventoriesView section:last-child th:nth-child(1) { width: 12%; }
#inventoriesView section:last-child th:nth-child(2) { width: 18%; }
#inventoriesView section:last-child th:nth-child(3),
#inventoriesView section:last-child th:nth-child(4),
#inventoriesView section:last-child th:nth-child(5),
#inventoriesView section:last-child th:nth-child(6) { width: 7%; }
#inventoriesView section:last-child th:nth-child(7) { width: 9%; }
#inventoriesView section:last-child th:nth-child(8) { width: 10%; }
#inventoriesView section:last-child th:nth-child(9) { width: 23%; }
th, td { padding: 12px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #edf4f9; color: var(--soft); font-size: 11px; font-weight: 900; text-transform: uppercase; }
tbody tr:hover { background: #f8fbfd; }
tbody tr.clickable-row { cursor: pointer; }
tbody tr.clickable-row:hover { background: #eef8fc; }
tbody td small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 800; }
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13, 29, 45, .54); }
.modal-panel { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(940px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: 0 28px 80px rgba(0,0,0,.24); }
.modal-panel .panel-head { position: sticky; top: 0; z-index: 2; background: white; }
.history-body { min-height: 0; overflow: auto; padding: 16px 20px 20px; }
.diff-modal-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.diff-modal-summary div { border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; padding: 12px; }
.diff-modal-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.diff-modal-summary strong { display: block; margin-top: 5px; font-size: 19px; line-height: 1.15; }
.diff-inventory-list { display: grid; gap: 9px; }
.diff-inventory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}
.diff-inventory-item:hover { border-color: #e2b75c; box-shadow: 0 12px 28px rgba(217,138,0,.1); transform: none; }
.diff-inventory-item strong,
.diff-inventory-item em,
.diff-inventory-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.diff-inventory-item strong { font-size: 15px; line-height: 1.25; }
.diff-inventory-item em,
.diff-inventory-item small { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 850; line-height: 1.3; }
.diff-inventory-item small { margin-top: 4px; color: var(--soft); }
.diff-inventory-item b {
  display: inline-flex;
  justify-content: center;
  min-width: 78px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #fff8e8;
  color: #8a4f00;
  font-size: 12px;
}
.calendar-day-modal-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(32,199,217,.32);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  background: linear-gradient(135deg, #f0fbfd, #ffffff);
}
.calendar-day-modal-summary strong { font-size: 18px; }
.calendar-day-modal-summary span { color: var(--muted); font-size: 13px; font-weight: 850; }
.calendar-day-groups { display: grid; gap: 14px; }
.calendar-store-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}
.calendar-store-group h3 {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}
.calendar-day-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #f0d299;
  border-left: 4px solid var(--amber);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}
.calendar-day-item:hover { border-color: #e2b75c; box-shadow: 0 12px 28px rgba(217,138,0,.1); transform: none; }
.calendar-day-item.live { border-color: #aee2ed; border-left-color: var(--cyan); background: #f0fbfd; }
.calendar-day-item.ok { border-color: #bcebd2; border-left-color: var(--green); background: #f0fbf5; }
.calendar-day-item.closed { border-color: #dde6ee; border-left-color: #8fa0b2; background: #ffffff; }
.calendar-day-item strong,
.calendar-day-item em { display: block; overflow: hidden; text-overflow: ellipsis; }
.calendar-day-item strong { font-size: 15px; line-height: 1.25; }
.calendar-day-item em { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 850; line-height: 1.3; }
.calendar-day-item b {
  display: inline-flex;
  justify-content: center;
  min-width: 88px;
  padding: 7px 10px;
  border: 1px solid #f0cf8b;
  border-radius: 999px;
  background: #fff8e8;
  color: #8a4f00;
  font-size: 12px;
}
.calendar-day-item.live b { border-color: #a8e8f0; background: #eafcff; color: #0b6f7d; }
.calendar-day-item.ok b { border-color: #abe8c9; background: #eafaf1; color: #08784f; }
.calendar-day-item.closed b { border-color: #d6dde5; background: #eef2f6; color: #526171; }
.history-summary { display: grid; grid-template-columns: 1fr 1fr 1.35fr .75fr; gap: 10px; margin-bottom: 12px; }
.history-summary div { min-height: 62px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.history-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.history-summary strong { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.history-list { display: grid; gap: 8px; }
.history-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.history-item strong,
.history-item span,
.history-item small { display: block; }
.history-item span,
.history-item small { color: var(--muted); font-size: 12px; font-weight: 700; }
.history-main strong { font-size: 15px; }
.history-reason { grid-column: 1 / -1; margin: 0; padding-top: 8px; border-top: 1px solid #edf2f6; color: var(--ink); font-size: 14px; font-weight: 850; line-height: 1.25; }
.history-note { grid-column: 1 / -1; margin-top: -2px; }
.history-numbers { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; align-items: flex-start; }
.history-numbers span,
.history-numbers strong { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 12px; }
.form-grid label { position: relative; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, #ffffff, #fbfdff); }
.form-grid label.full { padding: 0; border: 0; background: transparent; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid.single > button { justify-self: start; min-width: 210px; }
.full { grid-column: 1 / -1; }
.store-create-panel { max-width: 980px; }
.store-create-note {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #b9d8ea;
  border-radius: 8px;
  background: linear-gradient(135deg, #effdff 0%, #f8fbfd 100%);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.store-create-note strong { color: var(--ink); font-size: 15px; }
.store-create-note span { color: var(--muted); font-size: 13px; font-weight: 750; line-height: 1.35; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.row-actions { display: inline-flex; flex-wrap: nowrap; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.mini-btn { min-height: 30px; padding: 6px 8px; font-size: 10px; line-height: 1; }
.product-edit-panel { width: min(760px, calc(100vw - 28px)); }
.product-edit-panel #productEditForm {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 20px;
}
.product-edit-panel .form-grid label.full {
  padding: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}
.product-edit-panel textarea { min-height: 96px; resize: vertical; }
.product-edit-panel .actions {
  justify-content: space-between;
  padding-top: 4px;
}
.product-edit-panel .actions button { min-width: 166px; }
.actions, .toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.actions { align-items: center; padding-top: 2px; }
.toolbar { margin-bottom: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.toolbar input { flex: 1; min-width: 220px; }
.pdf-reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #b9d8ea;
  border-radius: 8px;
  background: linear-gradient(135deg, #effdff 0%, #f8fbfd 100%);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.pdf-reader strong,
.pdf-reader span { display: block; }
.pdf-reader span { margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 700; }
.pdf-preview {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.pdf-preview-count {
  padding: 5px 2px 8px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}
.pdf-preview-scroll {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
.pdf-preview-head,
.pdf-preview-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 90px;
  gap: 10px;
  align-items: center;
}
.pdf-preview-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 8px;
  border: 1px solid #dfe8f0;
  border-radius: 7px;
  background: white;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.pdf-preview-row {
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid #edf2f6;
  border-radius: 7px;
  background: var(--surface);
  font-size: 13px;
}
.pdf-preview-row strong,
.pdf-preview-row span { overflow-wrap: anywhere; }
.pdf-preview-row em { color: var(--soft); font-style: normal; font-weight: 900; text-align: right; }
.pdf-preview small { color: var(--muted); font-weight: 800; }
.pdf-warnings { display: grid; gap: 5px; margin-bottom: 4px; }
.pdf-warnings span { padding: 8px 10px; border: 1px solid #efd083; border-radius: 7px; background: #fff8e5; color: #7a520f; font-size: 12px; font-weight: 800; }
.card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; cursor: pointer; background: white; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.card strong, .card span { display: block; }
.card small { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.card span, .muted { color: var(--muted); }
.card:hover { border-color: #b8cfdf; box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.card.active { outline: 2px solid rgba(31,111,159,.24); background: #f2f9fd; }
.cards-list .card { min-height: 68px; }
.catalog-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.catalog-summary div { min-height: 74px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.catalog-summary span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.catalog-summary strong { display: block; margin-top: 6px; font-size: 25px; line-height: 1; }
.employees-panel .panel-head { align-items: center; }
.employees-panel .panel-head span { display: block; margin-top: 5px; font-size: 13px; font-weight: 800; }
.employee-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.employee-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  overflow: hidden;
}
.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7fbfd;
}
.mini-head h3 { margin: 2px 0 0; font-size: 17px; line-height: 1.2; }
.mini-head span { display: block; margin-top: 3px; font-size: 12px; font-weight: 800; }
.employee-table {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#employeesView table { min-width: 820px; table-layout: fixed; }
#employeesView th:nth-child(1) { width: 58px; }
#employeesView th:nth-child(2) { width: 22%; }
#employeesView th:nth-child(3) { width: 28%; }
#employeesView th:nth-child(4) { width: 20%; }
#employeesView th:nth-child(5) { width: 18%; }
#employeesView th:nth-child(6) { width: 12%; text-align: right; }
#employeesView td:nth-child(6) { text-align: right; }
#employeesView td strong { font-size: 14px; }
.employee-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 25%, #30d5de, #0e7fa5);
  color: white;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 9px 18px rgba(14,127,165,.18);
}
.status-dot { width: 10px; height: 10px; display: inline-block; margin-right: 8px; border-radius: 999px; background: #cfd8e3; vertical-align: -1px; }
.status-dot.ok { background: #13b981; box-shadow: 0 0 0 4px rgba(19,185,129,.12), 0 0 18px rgba(19,185,129,.26); }
.employee-chart-shell { padding: 14px; }
.employee-chart-card { border: 1px solid var(--line); border-radius: 8px; background: white; overflow: hidden; }
.employee-detail-panel { width: min(1040px, calc(100vw - 34px)); }
.employee-detail-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.employee-detail-controls select { min-width: 260px; min-height: 42px; }
.segmented.compact { width: auto; min-width: 320px; }
.employee-detail-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.employee-detail-kpis div { border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(180deg, #ffffff, #f7fbfd); padding: 12px; }
.employee-detail-kpis span { display: block; color: var(--muted); font-size: 11px; font-weight: 950; text-transform: uppercase; }
.employee-detail-kpis strong { display: block; margin-top: 4px; font-size: 30px; line-height: 1; }
.employee-detail-kpis em { display: block; margin-top: 6px; color: var(--soft); font-style: normal; font-size: 12px; font-weight: 850; }
.employee-chart { width: 100%; height: auto; min-height: 220px; display: block; padding: 10px; overflow: visible; }
.chart-grid { fill: none; stroke: #dce7ef; stroke-width: 1; }
.chart-line { fill: none; stroke: url(#unused); stroke: #19bfcf; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 8px 10px rgba(25,191,207,.18)); }
.employee-chart circle { fill: white; stroke: #1598ad; stroke-width: 4; }
.employee-chart text { fill: var(--ink); font-size: 13px; font-weight: 900; text-anchor: middle; }
.employee-chart .chart-label { fill: var(--muted); font-size: 10px; font-weight: 850; }
.employee-admin-panel { width: min(1120px, calc(100vw - 34px)); }
.employee-admin-body {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  overflow: auto;
}
.employee-admin-form,
.employee-admin-list {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  overflow: hidden;
}
.employee-admin-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding-bottom: 14px;
}
.employee-admin-form .mini-head,
.employee-admin-list .mini-head { margin-bottom: 0; }
.employee-admin-form label {
  display: grid;
  gap: 6px;
  margin: 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}
.employee-admin-form button { margin: 0 14px; }
.employee-admin-result {
  margin: 0 14px;
  padding: 12px;
  border: 1px solid #a7e8c9;
  border-radius: 8px;
  background: #effdf6;
  color: #064e3b;
  font-size: 13px;
  font-weight: 850;
}
.employee-admin-result.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}
.employee-admin-result code {
  display: inline-block;
  margin-top: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-weight: 950;
}
.employee-admin-rows { display: grid; gap: 8px; padding: 12px; }
.employee-admin-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.employee-admin-row.inactive { opacity: .72; background: #f6f9fc; }
.employee-admin-main strong,
.employee-admin-main span { display: block; }
.employee-admin-main span { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 800; overflow-wrap: anywhere; }
.employee-admin-actions { display: flex; gap: 7px; justify-content: flex-end; }
.mini-btn { min-height: 34px; padding: 8px 10px; font-size: 12px; }
.barcode-input {
  min-width: 148px;
  min-height: 34px;
  padding: 7px 9px;
  border-color: #d8e4ee;
  background: #fbfdff;
  font-size: 13px;
  font-weight: 800;
}
.barcode-input::placeholder { color: #8a9aad; }
.inventory-menu .panel-head { align-items: center; }
.inventory-search-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 132px 136px 136px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}
.inventory-search-panel label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}
.inventory-search-panel input,
.inventory-search-panel select { min-height: 38px; padding: 8px 10px; }
.inventory-search-panel .search-main input { min-height: 42px; font-size: 14px; }
.inventory-search-panel button { min-width: 86px; min-height: 38px; padding: 8px 11px; }
.inventory-filter-summary {
  min-height: 34px;
  margin-bottom: 14px;
  padding: 8px 11px;
  border: 1px solid #cfe0eb;
  border-radius: 8px;
  background: #f2f9fd;
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
}
.date-groups { display: grid; gap: 14px; }
.date-group { border: 1px solid var(--line); border-radius: 8px; background: #fbfdff; overflow: hidden; }
.date-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #edf4f9; }
.date-group-head strong { font-size: 15px; }
.date-group-head span { color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.date-inventory-list { display: grid; gap: 8px; padding: 10px; }
.date-inventory-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: white; cursor: pointer; transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease; }
.date-inventory-card:hover { border-color: #9ec8df; box-shadow: var(--shadow-soft); transform: translateY(-1px); }
.date-inventory-card strong,
.date-inventory-card span { display: block; }
.date-inventory-card > div:first-child span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.date-inventory-card small { display: block; margin-top: 6px; color: var(--brand); font-size: 12px; font-weight: 900; }
.date-card-stats { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; align-items: center; }
.date-card-stats > span:not(.badge) { min-height: 28px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--soft); font-size: 12px; font-weight: 900; }
.inventory-detail { display: grid; gap: 20px; }
.detail-head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.detail-head-actions button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.coordinator-overview { border-color: #bfd2e0; }
.coordinator-overview .panel-head { margin-bottom: 14px; }
.inventory-date-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.inventory-date-strip span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}
.inventory-date-strip strong { color: var(--ink); }
.flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.flow-steps div { display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.flow-steps span { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 26px; border-radius: 999px; background: #e5edf4; color: var(--soft); font-size: 12px; font-weight: 900; }
.flow-steps strong { font-size: 13px; line-height: 1.15; }
.flow-steps .done { border-color: #b9d8ea; background: #eef8fc; color: var(--ink); }
.flow-steps .done span { background: var(--blue); color: white; }
.inventory-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.inventory-kpis > div { min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.inventory-kpis > div.empty { grid-column: 1 / -1; min-height: auto; background: var(--surface); }
.inventory-kpis span { display: block; color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.inventory-kpis strong { display: block; margin-top: 6px; font-size: 26px; line-height: 1; }
.inventory-kpis .attention { border-color: #efc0ba; background: #fff8f7; }
.inventory-kpis .attention strong { color: var(--red); }
.inventory-kpis .ok { border-color: #b8e1c9; background: #f3fbf7; }
.inventory-kpis .ok strong { color: var(--green); }
.next-action { display: grid; gap: 4px; margin-bottom: 12px; padding: 12px 14px; border: 1px solid #a8e8f0; border-left: 4px solid var(--cyan); border-radius: 8px; background: linear-gradient(180deg, #effdff, #ffffff); }
.next-action:empty { display: none; }
.next-action strong { font-size: 14px; }
.next-action span { color: var(--soft); font-size: 13px; font-weight: 750; line-height: 1.35; }
.selected-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.selected-actions button { min-width: 190px; }
.coordinator-grid { grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr); }
body[data-inventory-detail="create"] .coordinator-grid { grid-template-columns: minmax(0, 1fr); }
.inventory-card.active { border-color: #9ec8df; }
.review-panel .panel-head { align-items: center; }
.review-summary { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.review-summary span { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; background: var(--surface); color: var(--soft); font-size: 12px; font-weight: 900; }
.review-search-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}
.review-search-panel label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}
.review-search-panel input {
  min-height: 40px;
  font-size: 14px;
  text-transform: none;
}
.review-search-panel span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid #cfe0eb;
  border-radius: 8px;
  background: #f2f9fd;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.review-state {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid #b9d8ea;
  border-radius: 8px;
  background: #f2f9fd;
  color: var(--soft);
}
.review-state strong {
  color: var(--ink);
  font-size: 16px;
}
.review-state span {
  color: var(--muted);
  font-weight: 700;
}
.review-state.ok {
  border-color: #b8e1c9;
  background: #f3fbf7;
}
.review-panel tr.pending-line td { background: #fbfdff; }
.review-panel tr.pending-line td:nth-child(7) { color: var(--muted); font-weight: 900; }
.stock-task { display: grid; grid-template-columns: minmax(0, 1fr) 92px; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 12px; cursor: pointer; }
.stock-task strong, .stock-task span, .stock-task em { display: block; }
.stock-task strong { font-size: 15px; }
.stock-task span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.stock-task em { width: fit-content; margin-top: 7px; border-radius: 999px; background: #eaf5fb; border: 1px solid #b9d8ea; color: #155577; padding: 4px 8px; font-size: 12px; font-style: normal; font-weight: 900; }
.stock-task button { min-height: 38px; }
.diff-negative { color: var(--red); font-weight: 900; }
.diff-positive { color: var(--amber); font-weight: 900; }
.diff-zero { color: var(--green); font-weight: 900; }
.phone-stage { max-width: 520px; margin: 0 auto; padding: 16px; background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%); }
.mobile-header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin: -16px -16px 14px; padding: 16px; background: linear-gradient(135deg, #071521, #0e2a43); color: white; }
.mobile-header .eyebrow { color: #9de8f1; }
.mobile-actions { position: sticky; top: 0; z-index: 8; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin: -2px 0 12px; padding: 8px 0; background: rgba(248,251,253,.9); backdrop-filter: blur(10px); }
.mobile-workbench { margin-top: 18px; padding-top: 0; border-top: 0; }
.stock-progress { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto; gap: 10px; align-items: center; margin: 14px 0 10px; box-shadow: 0 8px 20px rgba(17,24,39,.05); }
.stock-progress strong { display: block; margin-top: 2px; }
.stock-progress em { color: var(--muted); font-size: 11px; font-style: normal; font-weight: 900; text-transform: uppercase; }
.stock-progress em.saving { color: var(--amber); }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #dfe8f0; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); transition: width .18s ease; box-shadow: 0 0 14px rgba(32,199,217,.28); }
.mobile-route-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 10px 0; }
.mobile-route-summary div { min-height: 58px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.mobile-route-summary span { display: block; color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.mobile-route-summary strong { display: block; margin-top: 4px; font-size: 18px; line-height: 1; }
.group-chips { display: flex; gap: 7px; margin: 10px -2px 8px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; }
.group-chips button { min-width: 106px; min-height: 46px; display: grid; gap: 2px; align-content: center; padding: 8px 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); text-align: left; box-shadow: none; scroll-snap-align: start; }
.group-chips button.active { border-color: var(--cyan); background: linear-gradient(180deg, #effdff, #ffffff); box-shadow: 0 0 0 2px rgba(32,199,217,.14), 0 10px 22px rgba(32,199,217,.1); }
.group-chips strong { overflow: hidden; font-size: 12px; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.group-chips span { color: var(--muted); font-size: 10px; font-weight: 900; }
.group-overview { display: grid; gap: 8px; }
.group-overview-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; min-height: 58px; padding: 11px 12px; border: 1px solid var(--line); border-left: 4px solid var(--cyan); border-radius: 8px; background: linear-gradient(180deg, #ffffff, #fbfdff); color: var(--ink); text-align: left; box-shadow: none; }
.group-overview-card span { overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.group-overview-card strong { font-size: 20px; }
.group-overview-card em { grid-column: 2; color: var(--muted); font-size: 10px; font-style: normal; font-weight: 950; text-transform: uppercase; }
.mobile-workbench.route-mode #mobileSort,
.mobile-workbench.route-mode #lineFilter { display: none; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 3px; margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: #eef4f8; }
.segmented button { min-height: 34px; padding: 7px 8px; background: transparent; color: var(--soft); font-size: 12px; }
.segmented button.active { background: white; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.mobile-count-list { display: grid; gap: 10px; margin-top: 12px; }
.count-line { border: 1px solid var(--line); border-radius: 8px; background: white; padding: 12px; }
.count-line.selected { background: #f2f9fd; outline: 2px solid rgba(31,111,159,.32); }
.count-line.compact { padding: 0; overflow: hidden; }
.count-line.compact.done { border-color: #c8ead9; box-shadow: inset 3px 0 0 rgba(22,163,106,.5); }
.count-line-summary {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: white;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}
.count-line-summary:hover { box-shadow: none; }
.line-position {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #eef4f8;
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}
.line-main { min-width: 0; }
.line-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-main small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.line-state {
  min-width: 48px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.line-state.ok { border-color: #abe8c9; background: #eafaf1; color: #08784f; box-shadow: 0 0 12px rgba(22,163,106,.16); }
.line-state.warn { border-color: #f0cf8b; background: #fff8e8; color: #8a4f00; box-shadow: 0 0 12px rgba(217,138,0,.14); }
.count-line-editor { padding: 0 10px 10px; border-top: 1px solid #edf2f6; }
.count-line-head { display: grid; gap: 3px; margin-bottom: 8px; color: var(--soft); font-size: 12px; font-weight: 900; overflow-wrap: anywhere; }
.count-line-head small { color: var(--muted); }
.count-line-product { display: block; margin-bottom: 10px; font-size: 15px; line-height: 1.3; }
.count-line-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.count-line-stats div { min-height: 62px; padding: 8px; }
.count-line-stats span, .count-line-inputs label { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.count-line-stats strong { display: block; margin-top: 4px; }
.count-line-inputs { display: grid; gap: 9px; }
.count-line-inputs input { margin-top: 5px; font-size: 18px; }
.count-line-inputs label:last-child input { font-size: 16px; }
.outbox-head { margin-top: 18px; }
@media (min-width: 1041px) {
  .content {
    max-width: none;
    padding: 16px 22px 18px;
  }
  .topbar {
    align-items: center;
    margin: -16px -22px 12px;
    padding: 10px 22px 9px;
  }
  .topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  h1 { font-size: 28px; }
  .store-context { margin-top: 3px; font-size: 12px; }
  .view.active { gap: 12px; }
  .panel > :not(.panel-head) {
    margin-left: 16px;
    margin-right: 16px;
  }
  .panel > :last-child { margin-bottom: 16px; }
  .panel-head {
    align-items: center;
    margin-bottom: 12px;
    padding: 12px 16px 10px;
  }
  .panel-head h2 { font-size: 18px; }
  .diff-summary-card {
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 9px 14px;
  }
  .diff-summary-card span { grid-row: 1 / span 2; align-self: center; }
  .diff-summary-card strong { font-size: 18px; }
  .diff-summary-card em { font-size: 12px; }
  .calendar-panel { margin-top: 0; }
  .calendar-legend {
    gap: 6px;
    margin-bottom: 8px;
  }
  .calendar-dot {
    padding: 4px 7px;
    font-size: 10px;
  }
  .inventory-calendar { overflow-x: hidden; }
  .calendar-weekdays,
  .calendar-grid { min-width: 0; }
  .calendar-weekdays span { padding: 7px 6px; }
  .calendar-grid {
    height: clamp(390px, calc(100vh - 378px), 620px);
    grid-template-rows: repeat(6, minmax(0, 1fr));
  }
  .calendar-day {
    min-height: 0;
    padding: 6px;
    overflow: hidden;
  }
  .calendar-day-number {
    min-height: 18px;
    margin-bottom: 5px;
    font-size: 11px;
  }
  .calendar-events { gap: 3px; }
  .calendar-event {
    min-height: 31px;
    padding: 4px 6px;
    border-left-width: 3px;
  }
  .calendar-event strong { font-size: 11px; }
  .calendar-event span,
  .calendar-event em { font-size: 9px; }
  .calendar-more {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 10px;
  }
  .inventory-search-panel {
    grid-template-columns: minmax(420px, 1fr) 132px 132px 132px 86px;
    gap: 8px;
    padding: 10px;
  }
  .inventory-search-panel .search-main input {
    min-height: 42px;
    font-size: 14px;
  }
  .inventory-filter-summary {
    min-height: 30px;
    margin-bottom: 10px;
    padding: 7px 10px;
  }
  .date-groups {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
    max-height: calc(100vh - 338px);
    overflow: auto;
    padding-right: 4px;
  }
  .date-group-head { padding: 9px 12px; }
  .date-inventory-list {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px;
  }
  .date-inventory-card {
    gap: 10px;
    min-height: 54px;
    padding: 9px 12px;
  }
  .date-inventory-card > div:first-child span {
    margin-top: 3px;
    font-size: 12px;
  }
  .date-card-stats > span:not(.badge),
  .date-card-stats .badge {
    min-height: 25px;
    padding: 4px 8px;
    font-size: 11px;
  }
  .catalog-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 10px;
  }
  .catalog-summary div {
    min-height: 56px;
    padding: 9px 10px;
  }
  .catalog-summary strong { font-size: 20px; }
  .toolbar {
    margin-bottom: 10px;
    padding: 8px;
  }
  .table-wrap table th,
  .table-wrap table td {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  .table-wrap {
    max-height: calc(100vh - 252px);
    overflow: auto;
  }
  #productsView .table-wrap { max-height: calc(100vh - 408px); }
  .review-panel .table-wrap { max-height: calc(100vh - 346px); }
  th {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .flow-steps div,
  .inventory-kpis > div {
    min-height: 58px;
    padding: 9px 10px;
  }
  .inventory-kpis strong { font-size: 22px; }
  .next-action {
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  body[data-inventory-detail="create"] #inventoryDetail { gap: 0; }
  body[data-inventory-detail="create"] #planningPanel { width: 100%; }
  body[data-inventory-detail="create"] #inventoryForm {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
  }
  body[data-inventory-detail="create"] #inventoryForm label:not(.full) {
    grid-column: span 4;
    padding: 10px;
  }
  body[data-inventory-detail="create"] #inventoryForm input,
  body[data-inventory-detail="create"] #inventoryForm select {
    min-height: 38px;
    padding: 8px 10px;
  }
  body[data-inventory-detail="create"] #inventoryForm .upload-field {
    grid-column: span 5;
    padding: 10px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
  }
  body[data-inventory-detail="create"] #inventoryForm .upload-status {
    grid-column: span 7;
    min-height: 70px;
    padding: 12px 14px;
  }
  body[data-inventory-detail="create"] #inventoryForm .pdf-preview,
  body[data-inventory-detail="create"] #inventoryForm .source-field {
    grid-column: 1 / -1;
  }
  body[data-inventory-detail="create"] #inventoryForm .source-field {
    padding: 0;
    border: 0;
    background: transparent;
  }
  body[data-inventory-detail="create"] #sourceText {
    min-height: 116px;
    resize: vertical;
  }
  body[data-inventory-detail="create"] #inventoryForm .actions {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  body[data-inventory-detail="create"] #inventoryForm .actions button {
    min-width: 170px;
  }
  body[data-inventory-detail="create"] .pdf-preview-scroll {
    max-height: calc(100vh - 430px);
  }
}
@media (max-width: 1040px) {
  .login-panel {
    width: min(720px, 100%);
    grid-template-columns: 1fr;
  }
  .login-hero {
    min-height: 300px;
    gap: 28px;
  }
  .login-hero h1 {
    max-width: 620px;
    font-size: 40px;
  }
  .login-copy {
    max-width: 560px;
  }
  .login-form-card {
    padding: 30px;
  }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar,
  .sidebar:hover,
  .sidebar:focus-within { position: static; width: 100%; height: auto; overflow: visible; padding: 14px; }
  .sidebar .brand-row { justify-content: flex-start; }
  .sidebar .brand-row > div,
  .sidebar .side-title span,
  .sidebar .store-item span,
  .sidebar .store-item small { opacity: 1; visibility: visible; }
  .sidebar:not(:hover):not(:focus-within) .nav button { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 8px 10px; color: white; font-size: 12px; }
  .sidebar:not(:hover):not(:focus-within) .nav button.active { color: var(--ink); }
  .sidebar:not(:hover):not(:focus-within) .nav-label { display: block; }
  .sidebar:not(:hover):not(:focus-within) .nav-icon { width: 24px; height: 24px; }
  .store-menu { display: none; }
  .nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav button { text-align: center; padding: 8px 6px; }
  .grid.two { grid-template-columns: 1fr; }
  .inventory-search-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .inventory-search-panel .search-main { grid-column: 1 / -1; }
  body[data-inventory-detail="create"] #inventoryForm,
  body[data-inventory-detail="create"] #inventoryForm label:not(.full),
  body[data-inventory-detail="create"] #inventoryForm .upload-field,
  body[data-inventory-detail="create"] #inventoryForm .upload-status {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  body { background: #f5f7fb; }
  .login-screen {
    min-height: 100dvh;
    display: block;
    padding: 14px;
    background:
      radial-gradient(circle at 24% 0%, rgba(32,199,217,.22), transparent 260px),
      linear-gradient(180deg, #071521 0%, #0b2032 46%, #f5f7fb 46%, #f5f7fb 100%);
  }
  .login-panel {
    min-height: calc(100dvh - 28px);
    width: 100%;
    border-radius: 22px;
    grid-template-columns: 1fr;
    box-shadow: 0 20px 50px rgba(7,21,33,.22);
  }
  .login-hero {
    min-height: 250px;
    padding: 22px;
    gap: 20px;
    border-radius: 0;
  }
  .login-brand .brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  .login-hero h1 {
    font-size: 34px;
    line-height: 1.03;
  }
  .login-copy {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.38;
  }
  .login-signal-grid {
    gap: 8px;
  }
  .login-signal-grid div {
    min-height: 78px;
    padding: 12px;
    border-radius: 13px;
  }
  .login-signal-grid strong {
    font-size: 24px;
  }
  .login-form-card {
    align-content: start;
    padding: 24px 18px 20px;
  }
  .login-form-head {
    margin-bottom: 18px;
  }
  .login-form-head h2 {
    font-size: 24px;
  }
  .login-form-card input,
  .login-form-card .primary {
    min-height: 52px;
    border-radius: 13px;
  }
  .employee-admin-body {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .employee-admin-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }
  .employee-admin-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .employee-admin-actions button { flex: 1; }
  .login-form-card .primary {
    font-size: 16px;
  }
  .demo-users {
    grid-template-columns: 1fr;
  }
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    height: auto;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 -12px 34px rgba(16, 31, 49, .18);
  }
  .sidebar .brand-row,
  .sidebar .logout {
    display: none;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .nav button {
    min-height: 38px;
    padding: 7px 5px;
    border-radius: 7px;
    text-align: center;
    font-size: 11px;
    line-height: 1.1;
  }
  body:not([data-view="stock"]) .sidebar {
    position: static;
    inset: auto;
    padding: 8px 10px;
    border-top: 0;
    box-shadow: none;
  }
  body[data-role="admin"]:not([data-view="stock"]) .sidebar .brand-row { display: flex; }
  body[data-role="admin"]:not([data-view="stock"]) .sidebar {
    display: grid;
    gap: 10px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #071521, #0d2238);
  }
  body[data-role="admin"]:not([data-view="stock"]) .sidebar .brand-row,
  body[data-role="admin"]:not([data-view="stock"]) .side-title {
    width: 100%;
    min-width: 0;
  }
  body[data-role="admin"]:not([data-view="stock"]) .store-menu {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }
  body[data-role="admin"]:not([data-view="stock"]) #storeList {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  body[data-role="admin"]:not([data-view="stock"]) .store-item {
    min-width: 148px;
    min-height: 54px;
    padding: 9px 10px;
  }
  body[data-role="admin"]:not([data-view="stock"]) .top-nav {
    justify-content: flex-start;
  }
  .content { padding: 12px 12px 76px; }
  body:not([data-view="stock"]) .content {
    padding: 12px;
  }
  .topbar, .panel-head { flex-direction: column; }
  .topbar { position: static; margin: 0 0 12px; padding: 0; background: transparent; border-bottom: 0; backdrop-filter: none; }
  body[data-view="stock"] .topbar { display: none; }
  body[data-view="stock"] .mobile-header,
  body[data-view="stock"] .mobile-actions { flex-direction: row; align-items: center; }
  h1 { font-size: 22px; line-height: 1.15; }
  h2 { font-size: 18px; line-height: 1.2; }
  button, input, select, textarea { min-height: 42px; }
  .panel, .phone-stage { padding: 14px; border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  body[data-view="stock"] .phone-stage { padding: 16px; border: 0; }
  .role-home,
  .metric-grid,
  .admin-control,
  .store-health-grid,
  .store-profile,
  .form-grid,
  .stock-progress,
  .history-summary,
  .catalog-summary,
  .modal { padding: 10px; align-items: end; }
  .admin-control,
  .store-health-grid,
  .timeline-item { grid-template-columns: 1fr; }
  .role-home { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention-card { grid-template-columns: 1fr; }
  .attention-card button { width: 100%; }
  .store-health-card { min-height: 92px; }
  .calendar-head { gap: 14px; }
  .calendar-controls { width: 100%; justify-content: space-between; }
  .calendar-controls strong { min-width: 0; font-size: 14px; }
  .calendar-legend { margin-left: 10px; margin-right: 10px; }
  .diff-summary-card {
    width: calc(100% - 20px);
    min-height: 104px;
    margin-left: 10px;
    margin-right: 10px;
  }
  .inventory-calendar { margin-left: 10px; margin-right: 10px; }
  .calendar-weekdays,
  .calendar-grid { min-width: 760px; }
  .calendar-day { min-height: 118px; padding: 6px; }
  .calendar-event { min-height: 42px; padding: 6px; }
  .modal-panel { max-height: calc(100vh - 20px); }
  .history-body { padding: 0 14px 14px; }
  .diff-modal-summary,
  .diff-inventory-item,
  .calendar-day-item { grid-template-columns: 1fr; }
  .diff-inventory-item b { justify-self: start; }
  .calendar-day-item b { justify-self: start; }
  .history-item { grid-template-columns: 1fr; }
  .history-numbers { justify-content: flex-start; }
  .home-action { align-items: flex-start; flex-direction: column; }
  .home-action button { width: 100%; }
  .flow-steps, .inventory-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-menu .panel-head { align-items: flex-start; }
  .inventory-menu .panel-head button { width: 100%; }
  .pdf-reader { grid-template-columns: 1fr; }
  .pdf-reader button { width: 100%; }
  .pdf-preview-scroll { max-height: 360px; }
  .pdf-preview-head { display: none; }
  .pdf-preview-row {
    grid-template-columns: 1fr auto;
    gap: 5px 10px;
  }
  .pdf-preview-row strong {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 11px;
  }
  .pdf-preview-row em { align-self: start; }
  .date-group-head { align-items: flex-start; flex-direction: column; }
  .inventory-search-panel {
    grid-template-columns: 1fr;
    margin-left: 10px;
    margin-right: 10px;
  }
  .inventory-filter-summary {
    margin-left: 10px;
    margin-right: 10px;
  }
  .date-inventory-card { grid-template-columns: 1fr; }
  .date-card-stats { justify-content: flex-start; }
  .detail-head-actions { justify-content: flex-start; }
  .detail-head-actions button { width: 100%; }
  .flow-steps div { align-items: flex-start; min-height: 66px; padding: 9px; }
  .flow-steps strong { font-size: 11px; overflow-wrap: anywhere; }
  .inventory-kpis > div { min-height: 70px; padding: 10px; }
  .inventory-kpis strong { font-size: 22px; }
  .selected-actions { display: grid; grid-template-columns: 1fr; }
  .selected-actions button { width: 100%; min-width: 0; }
  .coordinator-grid { grid-template-columns: 1fr; }
  .review-panel .panel-head { align-items: flex-start; }
  .review-summary { justify-content: flex-start; }
  #inventoriesView .review-panel .table-wrap { overflow: visible; border: 0; background: transparent; }
  #inventoriesView .review-panel table,
  #inventoriesView .review-panel tbody,
  #inventoriesView .review-panel tr,
  #inventoriesView .review-panel td { display: block; width: 100%; min-width: 0; }
  #inventoriesView .review-panel thead { display: none; }
  #inventoriesView .review-panel tr { margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
  #inventoriesView .review-panel td { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid #edf2f6; font-size: 13px; overflow-wrap: anywhere; }
  #inventoriesView .review-panel td:last-child { border-bottom: 0; }
  #inventoriesView .review-panel td::before { color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; }
  #inventoriesView .review-panel td:nth-child(1)::before { content: "Referencia"; }
  #inventoriesView .review-panel td:nth-child(2)::before { content: "Producto"; }
  #inventoriesView .review-panel td:nth-child(3)::before { content: "Strator"; }
  #inventoriesView .review-panel td:nth-child(4)::before { content: "Almacén"; }
  #inventoriesView .review-panel td:nth-child(5)::before { content: "Tienda"; }
  #inventoriesView .review-panel td:nth-child(6)::before { content: "Cantidad UV"; }
  #inventoriesView .review-panel td:nth-child(7)::before { content: "Diferencia"; }
  #inventoriesView .review-panel td:nth-child(8)::before { content: "Nota"; }
  #inventoriesView .review-panel td:nth-child(9)::before { content: "Motivo"; }
  .actions button, .mobile-actions button { width: 100%; }
  .card { grid-template-columns: 1fr; }
  .segmented { grid-template-columns: repeat(2, 1fr); }

  body[data-view="stock"] .content {
    padding: 0 0 78px;
  }

  body[data-view="stock"] .topbar {
    display: none;
  }

  .phone-stage {
    max-width: none;
    min-height: calc(100vh - 78px);
    margin: 0;
    padding: 0;
    border: 0;
    background: #f5f7fb;
  }

  .mobile-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    background: var(--nav);
    color: white;
  }

  .mobile-header .eyebrow {
    color: #76c6e5;
    font-size: 10px;
  }

  .mobile-header h2 {
    color: white;
    font-size: 19px;
  }

  .mobile-header button {
    width: fit-content;
    min-height: 32px;
    padding: 6px 9px;
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.2);
    color: white;
    font-size: 11px;
  }

  #stockAgenda {
    padding: 12px;
  }

  .stock-task {
    grid-template-columns: minmax(0, 1fr) 78px;
    padding: 11px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
  }

  .stock-task button {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 13px;
  }

  .mobile-workbench {
    margin: 0;
    padding: 10px 12px 104px;
    border-top: 1px solid var(--line);
  }

  .mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .mobile-actions button {
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  #mobileTitle {
    font-size: 17px;
  }

  #mobileMeta {
    margin: 3px 0 8px;
    font-size: 12px;
  }

  .stock-progress {
    grid-template-columns: auto minmax(70px, 1fr) auto;
    gap: 8px;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: white;
  }

  .stock-progress span,
  .stock-progress em {
    font-size: 10px;
  }

  #lineSearch,
  #mobileSort {
    min-height: 38px;
    margin-bottom: 7px;
    padding: 8px 10px;
    background: white;
    font-size: 14px;
  }
  #mobileGroupFilter { display: none; }

  .mobile-route-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 8px 0;
  }

  .mobile-route-summary div {
    min-height: 48px;
    padding: 7px;
  }

  .mobile-route-summary strong {
    font-size: 16px;
  }

  .segmented {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 7px;
    background: #e9f0f6;
  }

  .segmented button {
    min-height: 29px;
    padding: 6px 4px;
    font-size: 10px;
  }

  #nextLineBtn {
    width: 100%;
    min-height: 38px;
    margin-bottom: 9px;
    padding: 8px 10px;
    border-color: #a8d7e8;
    background: linear-gradient(180deg, #f2fbff, #ffffff);
    color: #0b5d7a;
    font-size: 13px;
    box-shadow: 0 6px 16px rgba(32,199,217,.08);
  }

  .mobile-count-list {
    gap: 6px;
    margin-top: 0;
  }

  .count-line {
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16,24,40,.04);
  }

  .count-line.compact {
    padding: 0;
  }

  .count-line-summary {
    min-height: 48px;
    padding: 7px 9px;
  }

  .line-position {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }

  .line-main strong {
    font-size: 12px;
  }

  .line-main small,
  .line-state {
    font-size: 10px;
  }

  .count-line-head {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .count-line-product {
    margin-bottom: 8px;
    font-size: 14px;
  }

  .count-line-stats {
    gap: 5px;
    margin-bottom: 9px;
  }

  .count-line-stats div {
    min-height: 50px;
    padding: 7px;
  }

  .count-line-stats span,
  .count-line-inputs label {
    font-size: 10px;
  }

  .count-line-inputs {
    gap: 6px;
  }

  .count-line-inputs input {
    min-height: 36px;
    margin-top: 4px;
    padding: 8px 9px;
    font-size: 15px;
  }

  .count-line-inputs label:last-child input {
    font-size: 14px;
  }
}

body[data-role="stock"] {
  background: #f5f7fb;
}

body[data-role="stock"] .app-shell {
  display: block;
  min-height: 100vh;
}

body[data-role="stock"] .sidebar,
body[data-role="stock"] .topbar {
  display: none;
}

body[data-role="stock"] .content {
  width: 100%;
  max-width: none;
  padding: 0;
}

body[data-role="stock"] .view.active {
  display: block;
}

body[data-role="stock"] .phone-stage {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f5f7fb;
  box-shadow: none;
}

body[data-role="stock"] .mobile-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  background: var(--nav);
  color: white;
}

body[data-role="stock"] .mobile-header .eyebrow {
  color: #76c6e5;
  font-size: 10px;
}

body[data-role="stock"] .mobile-header h2 {
  color: white;
  font-size: 19px;
}

body[data-role="stock"] .mobile-header button {
  width: fit-content;
  min-height: 32px;
  padding: 6px 9px;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: white;
  font-size: 11px;
}

body[data-role="stock"] #stockAgenda {
  padding: 12px;
}

body[data-role="stock"] .stock-task {
  grid-template-columns: minmax(0, 1fr) 78px;
  padding: 11px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
}

body[data-role="stock"] .stock-task button {
  min-height: 36px;
  padding: 7px 8px;
  font-size: 13px;
}

body[data-role="stock"] .mobile-workbench {
  margin: 0;
  padding: 10px 12px 104px;
  border-top: 1px solid var(--line);
}

body[data-role="stock"] .mobile-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0;
  background: transparent;
}

body[data-role="stock"] .mobile-actions button {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

body[data-role="stock"] #mobileTitle {
  font-size: 17px;
}

body[data-role="stock"] #mobileMeta {
  margin: 3px 0 8px;
  font-size: 12px;
}

body[data-role="stock"] .stock-progress {
  grid-template-columns: auto minmax(70px, 1fr) auto;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: white;
}

body[data-role="stock"] #lineSearch,
body[data-role="stock"] #mobileSort {
  min-height: 38px;
  margin-bottom: 7px;
  padding: 8px 10px;
  background: white;
  font-size: 14px;
}

body[data-role="stock"] #mobileGroupFilter {
  display: none;
}

body[data-role="stock"] .mobile-route-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

body[data-role="stock"] .mobile-route-summary div {
  min-height: 48px;
  padding: 7px;
}

body[data-role="stock"] .mobile-route-summary strong {
  font-size: 16px;
}

body[data-role="stock"] .segmented {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 7px;
  background: #e9f0f6;
}

body[data-role="stock"] .segmented button {
  min-height: 29px;
  padding: 6px 4px;
  font-size: 10px;
}

body[data-role="stock"] #nextLineBtn {
  width: 100%;
  min-height: 38px;
  margin-bottom: 9px;
  padding: 8px 10px;
  border-color: #a8d7e8;
  background: linear-gradient(180deg, #f2fbff, #ffffff);
  color: #0b5d7a;
  font-size: 13px;
  box-shadow: 0 6px 16px rgba(32,199,217,.08);
}

body[data-role="stock"] .mobile-count-list {
  gap: 6px;
  margin-top: 0;
}

body[data-role="stock"] .count-line.compact {
  padding: 0;
}

body[data-role="stock"] .count-line-summary {
  min-height: 48px;
  padding: 7px 9px;
}

body[data-role="stock"] {
  --app-pad: 16px;
  --app-radius: 8px;
  color: #101828;
  font-size: 16px;
}

body[data-role="stock"] .mobile-header {
  min-height: 76px;
  padding: 18px var(--app-pad) 16px;
  background: linear-gradient(180deg, #071521 0%, #0c263d 100%);
  box-shadow: 0 10px 28px rgba(7,21,33,.16);
}

body[data-role="stock"] .mobile-header .eyebrow {
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: .02em;
}

body[data-role="stock"] .mobile-header h2 {
  font-size: 24px;
  line-height: 1.08;
}

body[data-role="stock"] .mobile-header button {
  min-height: 44px;
  padding: 10px 13px;
  border-radius: var(--app-radius);
  font-size: 13px;
}

body[data-role="stock"] #stockAgenda {
  display: grid;
  gap: 14px;
  padding: var(--app-pad);
}

.stock-hero {
  display: grid;
  gap: 5px;
  padding: 18px 16px;
  border: 1px solid #d7e7f1;
  border-radius: var(--app-radius);
  background: linear-gradient(135deg, #ffffff 0%, #eefbff 100%);
  box-shadow: 0 12px 30px rgba(16,24,40,.06);
}

.stock-hero span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.stock-hero strong {
  font-size: 28px;
  line-height: 1;
}

.stock-hero small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.stock-task-list {
  display: grid;
  gap: 12px;
}

body[data-role="stock"] .stock-task {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-height: 138px;
  padding: 16px;
  border-radius: var(--app-radius);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16,24,40,.07);
}

.stock-task-main span,
.stock-task-main strong,
.stock-task-main small {
  display: block;
}

.stock-task-main span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-role="stock"] .stock-task-main strong {
  margin-top: 5px;
  font-size: 19px;
  line-height: 1.15;
}

body[data-role="stock"] .stock-task-main small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.mini-progress {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2eaf1;
}

.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.stock-task-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
  align-items: center;
}

body[data-role="stock"] .stock-task-action em {
  width: fit-content;
  margin: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf8fc;
  color: #0b5d7a;
  font-size: 13px;
}

body[data-role="stock"] .stock-task-action button {
  min-height: 48px;
  border-radius: var(--app-radius);
  font-size: 15px;
}

body[data-role="stock"] .stock-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
}

body[data-role="stock"] .mobile-workbench {
  display: grid;
  gap: 12px;
  padding: 14px var(--app-pad) 112px;
}

body[data-role="stock"] .mobile-actions {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: -14px calc(var(--app-pad) * -1) 0;
  padding: 10px var(--app-pad);
  background: rgba(245,247,251,.94);
  backdrop-filter: blur(14px);
}

body[data-role="stock"] .mobile-actions button {
  min-height: 48px;
  border-radius: var(--app-radius);
  font-size: 15px;
}

body[data-role="stock"] #mobileTitle {
  font-size: 23px;
  line-height: 1.08;
}

body[data-role="stock"] #mobileMeta {
  margin: -7px 0 0;
  font-size: 14px;
}

body[data-role="stock"] .stock-progress {
  min-height: 64px;
  padding: 13px;
  border-radius: var(--app-radius);
}

body[data-role="stock"] .stock-progress strong {
  font-size: 20px;
}

body[data-role="stock"] .progress-track {
  height: 10px;
}

body[data-role="stock"] #lineSearch,
body[data-role="stock"] #mobileSort {
  min-height: 50px;
  padding: 12px 14px;
  border-radius: var(--app-radius);
  font-size: 16px;
}

body[data-role="stock"] .mobile-route-summary {
  gap: 8px;
}

body[data-role="stock"] .mobile-route-summary div {
  min-height: 64px;
  padding: 10px;
  border-radius: var(--app-radius);
}

body[data-role="stock"] .mobile-route-summary strong {
  font-size: 20px;
}

body[data-role="stock"] .group-chips {
  gap: 9px;
  margin: 0 calc(var(--app-pad) * -1);
  padding: 2px var(--app-pad) 10px;
}

body[data-role="stock"] .group-chips button {
  min-width: 132px;
  min-height: 58px;
  padding: 11px;
  border-radius: var(--app-radius);
}

body[data-role="stock"] .group-chips strong {
  font-size: 14px;
}

body[data-role="stock"] .group-chips span {
  font-size: 12px;
}

body[data-role="stock"] .group-overview {
  gap: 10px;
}

body[data-role="stock"] .group-overview-card {
  min-height: 78px;
  padding: 16px;
  border-radius: var(--app-radius);
}

body[data-role="stock"] .group-overview-card span {
  font-size: 17px;
}

body[data-role="stock"] .group-overview-card strong {
  font-size: 26px;
}

body[data-role="stock"] .segmented {
  border-radius: var(--app-radius);
}

body[data-role="stock"] .segmented button {
  min-height: 40px;
  font-size: 12px;
}

/* Stock mobile final overrides - must stay at the end of the stylesheet. */
body[data-role="stock"] .mobile-header {
  min-height: 74px;
  padding: 14px 18px 12px;
}
body[data-role="stock"] .mobile-header h2 { font-size: 28px; }
body[data-role="stock"] .mobile-header button {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
}
body[data-role="stock"] #stockAgenda {
  gap: 14px;
  padding: 0 14px 88px;
}
body[data-role="stock"] .stock-week-title div {
  min-height: 48px;
  border-radius: 16px;
}
body[data-role="stock"] .stock-week-title strong { font-size: 22px; }
body[data-role="stock"] .stock-week-strip {
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid var(--app-line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(16,24,40,.04);
}
body[data-role="stock"] .stock-week-strip > button {
  width: 30px;
  min-height: 62px;
  border: 0;
  border-radius: 14px;
  background: #f3f7fb;
  font-size: 22px;
  box-shadow: none;
}
body[data-role="stock"] .stock-calendar-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
body[data-role="stock"] .stock-day-pill {
  min-height: 62px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 5px 1px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
body[data-role="stock"] .stock-day-pill strong {
  width: auto;
  height: auto;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  white-space: nowrap;
}
body[data-role="stock"] .stock-day-pill strong small,
body[data-role="stock"] .stock-day-pill strong b {
  display: block;
  line-height: 1;
}
body[data-role="stock"] .stock-day-pill strong small {
  color: var(--app-muted);
  font-size: 10px;
  font-weight: 950;
}
body[data-role="stock"] .stock-day-pill strong b {
  color: var(--app-text);
  font-size: 18px;
  font-weight: 950;
}
body[data-role="stock"] .stock-day-pill span {
  min-height: 13px;
  color: var(--app-muted);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}
body[data-role="stock"] .stock-day-pill em {
  min-height: 14px;
  padding: 2px 4px;
  font-size: 9px;
  line-height: 1;
  background: #eaf5fb;
}
body[data-role="stock"] .stock-day-pill.active strong {
  border: 0;
  background: transparent;
  box-shadow: none;
}
body[data-role="stock"] .stock-day-pill.active,
body[data-role="stock"] .stock-day-pill.today,
body[data-role="stock"] .stock-day-pill.active.today {
  background: #eefdff;
  border-color: rgba(32,199,217,.65);
  box-shadow: inset 0 0 0 1px rgba(32,199,217,.25);
}
body[data-role="stock"] .stock-day-head {
  align-items: end;
  margin-bottom: 8px;
}
body[data-role="stock"] .stock-day-head span { font-size: 10px; }
body[data-role="stock"] .stock-day-head h3 { font-size: 25px; }
body[data-role="stock"] .stock-day-head strong {
  max-width: 45%;
  font-size: 12px;
}
body[data-role="stock"] .stock-day-section .stock-task-list { gap: 10px; }
body[data-role="stock"] .stock-day-section .stock-task {
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 104px;
  gap: 11px;
  padding: 12px;
  border-radius: 18px;
}
body[data-role="stock"] .stock-day-section .stock-task-icon {
  width: 46px;
  height: 46px;
  font-size: 20px;
}
body[data-role="stock"] .stock-day-section .stock-task-main strong { font-size: 17px; }
body[data-role="stock"] .stock-day-section .stock-task-main small { font-size: 12px; }
body[data-role="stock"] .stock-task-meta { margin-top: 8px; }
body[data-role="stock"] .stock-day-section .stock-task-main em {
  padding: 5px 9px;
  font-size: 11px;
}
body[data-role="stock"] .stock-day-section .stock-task-meta b { font-size: 16px; }
body[data-role="stock"] .stock-bottom-nav {
  padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
}
body[data-role="stock"] .stock-bottom-nav button {
  min-height: 48px;
  font-size: 14px;
}
body[data-role="stock"] .mobile-workbench {
  gap: 10px;
  padding: 0 14px 92px;
}
body[data-role="stock"] .mobile-actions {
  margin: 0 -14px;
  padding: 8px 14px;
}
body[data-role="stock"] .mobile-actions button {
  min-height: 44px;
  font-size: 14px;
}

body[data-role="stock"] .mobile-actions button[hidden] {
  display: none !important;
}

body[data-role="stock"] .mobile-actions #backAgendaBtn {
  flex: 1 1 auto;
}
body[data-role="stock"] #lineSearch {
  min-height: 48px;
  margin: 8px 0;
  border-radius: 16px;
  font-size: 14px;
}
body[data-role="stock"] .group-chips button {
  min-width: 112px;
  min-height: 50px;
  border-radius: 14px;
}
body[data-role="stock"] .group-chips strong { font-size: 13px; }
body[data-role="stock"] .group-chips span { font-size: 10px; }
body[data-role="stock"] .mobile-sort-compact {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 48px;
  border-radius: 16px;
}
body[data-role="stock"] .mobile-sort-compact span { font-size: 10px; }
body[data-role="stock"] #mobileSort {
  min-height: 48px;
  border-radius: 0 16px 16px 0;
  font-size: 14px;
}
body[data-role="stock"] .segmented {
  min-height: 46px;
  border-radius: 18px;
}
body[data-role="stock"] .segmented button {
  min-height: 38px;
  font-size: 12px;
}
body[data-role="stock"] .count-line-summary {
  min-height: 70px;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 12px;
}
body[data-role="stock"] .line-position {
  width: 38px;
  height: 38px;
  font-size: 15px;
}
body[data-role="stock"] .line-main strong {
  font-size: 17px;
  line-height: 1.12;
}
body[data-role="stock"] .line-main small { font-size: 13px; }
body[data-role="stock"] .line-state {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
}
body[data-role="stock"] #nextLineBtn {
  left: 50%;
  right: auto;
  width: min(86vw, 420px);
  max-width: calc(100vw - 36px);
  bottom: calc(14px + env(safe-area-inset-bottom));
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.15;
  text-align: center;
  transform: translateX(-50%);
}

body[data-role="stock"] #nextLineBtn:active {
  transform: translateX(-50%);
}

/* Final stock mobile tuning: compact enough for daily use, still readable. */
body[data-role="stock"] .mobile-header {
  min-height: 86px;
  padding: 18px 20px 14px;
}

body[data-role="stock"] .mobile-header h2 {
  font-size: 32px;
}

body[data-role="stock"] .mobile-header button {
  width: 54px;
  min-width: 54px;
  min-height: 54px;
}

body[data-role="stock"] #stockAgenda {
  gap: 14px;
  padding: 0 14px 88px;
}

body[data-role="stock"] .stock-week-title div {
  min-height: 48px;
  border-radius: 16px;
}

body[data-role="stock"] .stock-week-title strong {
  font-size: 22px;
}

body[data-role="stock"] .stock-week-strip {
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 5px;
  margin-bottom: 14px;
}

body[data-role="stock"] .stock-week-strip > button {
  width: 30px;
  min-height: 74px;
  border-radius: 16px;
  font-size: 24px;
}

body[data-role="stock"] .stock-calendar-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

body[data-role="stock"] .stock-day-pill {
  min-height: 74px;
  gap: 2px;
  padding: 7px 2px;
  border-radius: 15px;
}

body[data-role="stock"] .stock-day-pill strong {
  font-size: 13px;
}

body[data-role="stock"] .stock-day-pill span {
  font-size: 10px;
}

body[data-role="stock"] .stock-day-pill em {
  padding: 3px 6px;
  font-size: 9px;
}

body[data-role="stock"] .stock-day-head {
  align-items: end;
  margin-bottom: 8px;
}

body[data-role="stock"] .stock-day-head span {
  font-size: 10px;
}

body[data-role="stock"] .stock-day-head h3 {
  font-size: 25px;
}

body[data-role="stock"] .stock-day-head strong {
  max-width: 45%;
  font-size: 12px;
}

body[data-role="stock"] .stock-day-section .stock-task-list {
  gap: 10px;
}

body[data-role="stock"] .stock-day-section .stock-task {
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 104px;
  gap: 11px;
  padding: 12px;
  border-radius: 18px;
}

body[data-role="stock"] .stock-day-section .stock-task-icon {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

body[data-role="stock"] .stock-day-section .stock-task-main strong {
  font-size: 17px;
}

body[data-role="stock"] .stock-day-section .stock-task-main small {
  font-size: 12px;
}

body[data-role="stock"] .stock-task-meta {
  margin-top: 8px;
}

body[data-role="stock"] .stock-day-section .stock-task-main em {
  padding: 5px 9px;
  font-size: 11px;
}

body[data-role="stock"] .stock-day-section .stock-task-meta b {
  font-size: 16px;
}

body[data-role="stock"] .stock-bottom-nav {
  padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
}

body[data-role="stock"] .stock-bottom-nav button {
  min-height: 48px;
  font-size: 14px;
}

body[data-role="stock"] .mobile-workbench {
  gap: 10px;
  padding: 0 14px 92px;
}

body[data-role="stock"] .mobile-actions {
  margin: 0 -14px;
  padding: 8px 14px;
}

body[data-role="stock"] .mobile-actions button {
  min-height: 44px;
  font-size: 14px;
}

body[data-role="stock"] #lineSearch {
  min-height: 48px;
  margin: 8px 0;
  border-radius: 16px;
  font-size: 14px;
}

body[data-role="stock"] .group-chips button {
  min-width: 112px;
  min-height: 50px;
  border-radius: 14px;
}

body[data-role="stock"] .group-chips strong {
  font-size: 13px;
}

body[data-role="stock"] .group-chips span {
  font-size: 10px;
}

body[data-role="stock"] .mobile-sort-compact {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 48px;
  border-radius: 16px;
}

body[data-role="stock"] .mobile-sort-compact span {
  font-size: 10px;
}

body[data-role="stock"] #mobileSort {
  min-height: 48px;
  border-radius: 0 16px 16px 0;
  font-size: 14px;
}

body[data-role="stock"] .segmented {
  min-height: 46px;
  border-radius: 18px;
}

body[data-role="stock"] .segmented button {
  min-height: 38px;
  font-size: 12px;
}

body[data-role="stock"] .count-line-summary {
  min-height: 70px;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 12px;
}

body[data-role="stock"] .line-position {
  width: 38px;
  height: 38px;
  font-size: 15px;
}

body[data-role="stock"] .line-main strong {
  font-size: 17px;
  line-height: 1.12;
}

body[data-role="stock"] .line-main small {
  font-size: 13px;
}

body[data-role="stock"] .line-state {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
}

body[data-role="stock"] #nextLineBtn {
  left: 50% !important;
  right: auto !important;
  width: min(86vw, 420px) !important;
  max-width: calc(100vw - 36px);
  bottom: calc(14px + env(safe-area-inset-bottom));
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.15;
  text-align: center;
  transform: translateX(-50%) !important;
}

body[data-role="stock"] #nextLineBtn:active {
  transform: translateX(-50%) !important;
}

body[data-role="stock"] .stock-week-strip {
  grid-template-columns: 38px minmax(0, 1fr) 38px !important;
  gap: 8px !important;
  align-items: stretch !important;
}

body[data-role="stock"] .stock-calendar-strip {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 6px !important;
  overflow: visible !important;
  min-width: 0 !important;
}

body[data-role="stock"] .stock-week-strip > button {
  min-width: 0 !important;
  width: 38px !important;
  min-height: 76px !important;
  border-radius: 18px !important;
}

body[data-role="stock"] .stock-day-pill {
  min-width: 0 !important;
  width: 100% !important;
  min-height: 76px !important;
  padding: 7px 2px !important;
  border-color: var(--app-line) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(16,24,40,.05) !important;
}

body[data-role="stock"] .stock-day-pill.today,
body[data-role="stock"] .stock-day-pill.overdue {
  border-color: var(--app-line) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(16,24,40,.05) !important;
}

body[data-role="stock"] .stock-day-pill.active,
body[data-role="stock"] .stock-day-pill.active.today,
body[data-role="stock"] .stock-day-pill.active.overdue {
  border-color: rgba(32,199,217,.9) !important;
  background: #eefdff !important;
  box-shadow: 0 0 0 2px rgba(32,199,217,.22), 0 10px 24px rgba(16,24,40,.08) !important;
}

body[data-role="stock"] .stock-day-pill strong {
  display: grid !important;
  gap: 1px !important;
  line-height: 1 !important;
}

body[data-role="stock"] .stock-day-pill strong small {
  font-size: 15px !important;
  line-height: 1 !important;
}

body[data-role="stock"] .stock-day-pill strong b {
  font-size: 24px !important;
  line-height: .95 !important;
}

body[data-role="stock"] .stock-day-pill span {
  display: block !important;
  min-width: 0 !important;
  margin-top: 2px !important;
  color: var(--app-muted) !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
}

body[data-role="stock"] .stock-day-pill.active span {
  color: #08769a !important;
}

body[data-role="stock"] .stock-day-pill em {
  display: none !important;
}

body[data-role="stock"] .mobile-line-panel {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  width: min(calc(100vw - 24px), 560px) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: calc(100svh - 80px) !important;
  border-radius: 30px !important;
  overflow: hidden !important;
}

body[data-role="stock"] .mobile-line-head {
  flex: 0 0 auto !important;
  padding: 14px 16px !important;
}

body[data-role="stock"] .mobile-line-head button {
  min-height: 46px !important;
  padding: 0 18px !important;
  font-size: 16px !important;
}

body[data-role="stock"] .mobile-line-head .line-state {
  max-width: 46%;
  overflow: hidden;
  font-size: 14px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-role="stock"] .mobile-line-title {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  padding: 16px 18px 10px !important;
}

body[data-role="stock"] .mobile-line-title h2 {
  display: -webkit-box !important;
  max-width: 100% !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: var(--app-text) !important;
  font-size: clamp(24px, 7.5vw, 34px) !important;
  line-height: 1.04 !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 3 !important;
}

body[data-role="stock"] .mobile-line-title p {
  display: -webkit-box !important;
  max-width: 100% !important;
  margin: 7px 0 0 !important;
  overflow: hidden !important;
  font-size: clamp(16px, 4.8vw, 20px) !important;
  line-height: 1.18 !important;
  overflow-wrap: anywhere !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}

body[data-role="stock"] .mobile-line-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 18px 120px !important;
}

body[data-role="stock"] .modal-count-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-bottom: 12px !important;
}

body[data-role="stock"] .modal-count-stats div {
  min-width: 0 !important;
  min-height: 70px !important;
  padding: 10px 9px !important;
  border-radius: 17px !important;
  overflow: hidden !important;
}

body[data-role="stock"] .modal-count-stats span {
  display: block !important;
  overflow: hidden !important;
  font-size: clamp(10px, 2.9vw, 12px) !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-role="stock"] .modal-count-stats strong {
  display: block !important;
  max-width: 100% !important;
  overflow: hidden !important;
  font-size: clamp(18px, 5.2vw, 25px) !important;
  line-height: 1.08 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-role="stock"] .modal-count-inputs {
  gap: 10px !important;
}

body[data-role="stock"] .modal-count-inputs label {
  min-width: 0 !important;
  overflow: hidden !important;
  font-size: clamp(12px, 3.4vw, 14px) !important;
  line-height: 1.1 !important;
}

body[data-role="stock"] #mobileLineModal .modal-count-inputs input,
body[data-role="stock"] .modal-count-inputs input {
  min-height: 58px !important;
  height: 58px !important;
  border-radius: 16px !important;
  font-size: clamp(22px, 7vw, 30px) !important;
}

body[data-role="stock"] .barcode-unit-row {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 30%) !important;
  gap: 10px !important;
}

body[data-role="stock"] .barcode-scan-card {
  min-width: 0 !important;
  padding: 10px !important;
  border-radius: 16px !important;
}

body[data-role="stock"] .barcode-scan-card strong {
  max-width: 100% !important;
  font-size: clamp(15px, 4.4vw, 18px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body[data-role="stock"] .barcode-unit-row .scan-btn {
  min-height: 44px !important;
  border-radius: 14px !important;
  font-size: 14px !important;
}

body[data-role="stock"] .mobile-line-footer {
  flex: 0 0 auto !important;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom)) !important;
}

body[data-role="stock"] .mobile-line-footer button {
  min-height: 60px !important;
  border-radius: 20px !important;
  font-size: clamp(18px, 5.2vw, 24px) !important;
  line-height: 1.1 !important;
  white-space: normal !important;
}

/* Stock week calendar final layout. */
body[data-role="stock"] .stock-week-strip {
  grid-template-columns: 30px minmax(0, 1fr) 30px !important;
  gap: 6px !important;
  align-items: center !important;
  margin: 0 0 16px !important;
  padding: 8px !important;
  border: 1px solid var(--app-line) !important;
  border-radius: 20px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(16,24,40,.04) !important;
}

body[data-role="stock"] .stock-week-strip > button {
  width: 30px !important;
  min-width: 30px !important;
  min-height: 62px !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: #f3f7fb !important;
  font-size: 22px !important;
  box-shadow: none !important;
}

body[data-role="stock"] .stock-calendar-strip {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 3px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

body[data-role="stock"] .stock-day-pill {
  min-width: 0 !important;
  min-height: 62px !important;
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 3px !important;
  padding: 5px 1px !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

body[data-role="stock"] .stock-day-pill strong {
  width: auto !important;
  height: auto !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-role="stock"] .stock-day-pill strong small,
body[data-role="stock"] .stock-day-pill strong b {
  display: block !important;
  line-height: 1 !important;
}

body[data-role="stock"] .stock-day-pill strong small {
  color: var(--app-muted) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
}

body[data-role="stock"] .stock-day-pill strong b {
  color: var(--app-text) !important;
  font-size: 18px !important;
  font-weight: 950 !important;
}

body[data-role="stock"] .stock-day-pill span {
  min-height: 13px !important;
  color: var(--app-muted) !important;
  font-size: 9px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body[data-role="stock"] .stock-day-pill em {
  min-height: 14px !important;
  padding: 2px 4px !important;
  border-radius: 999px !important;
  background: #eaf5fb !important;
  font-size: 9px !important;
  line-height: 1 !important;
}

body[data-role="stock"] .stock-day-pill.active,
body[data-role="stock"] .stock-day-pill.today,
body[data-role="stock"] .stock-day-pill.active.today {
  border-color: rgba(32,199,217,.65) !important;
  background: #eefdff !important;
  box-shadow: inset 0 0 0 1px rgba(32,199,217,.25) !important;
}

body[data-role="stock"] .mobile-workbench.route-mode .mobile-sort-compact {
  display: none;
}

body[data-role="stock"] .count-line.compact {
  border: 1px solid var(--app-line);
  border-left: 5px solid #cbd5e1;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16,24,40,.05);
}

body[data-role="stock"] .count-line.compact.done {
  border-color: #b8ead4;
  border-left-color: #16a36a;
}

body[data-role="stock"] .count-line.compact.has-diff {
  border-color: #ffd08a;
  border-left-color: #f59e0b;
}

body[data-role="stock"] .count-line.compact.selected {
  outline: 2px solid rgba(20,120,166,.28);
}

body[data-role="stock"] .line-state {
  min-width: 46px;
  border: 1px solid #d9e3ec;
  background: #f4f7fa;
  color: #667085;
  text-align: center;
}

body[data-role="stock"] .line-state.ok {
  border-color: #a7e4c6;
  background: #ecfdf3;
  color: #087443;
}

body[data-role="stock"] .line-state.warn {
  border-color: #ffd08a;
  background: #fff7e6;
  color: #9a5b00;
}

body[data-role="stock"] #mobileLineModal {
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(14px + env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom));
}

body[data-role="stock"] #mobileLineModal .modal-backdrop {
  background: rgba(15,23,42,.18);
  backdrop-filter: blur(2px);
}

body[data-role="stock"] .mobile-line-panel {
  width: min(calc(100vw - 20px), 680px);
  max-width: none;
  height: min(72svh, 820px);
  min-height: 620px;
  max-height: calc(100svh - 96px);
  border: 1px solid var(--app-line);
  border-radius: 32px;
  background: #f5f7fb;
  box-shadow: 0 26px 80px rgba(15,23,42,.28);
  overflow: hidden;
}

body[data-role="stock"] .mobile-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 15px;
  border-bottom: 1px solid var(--app-line);
  background: #ffffff;
}

body[data-role="stock"] .mobile-line-head button {
  min-height: 56px;
  padding: 0 24px;
  border-radius: 999px;
  background: #ffffff;
}

body[data-role="stock"] .mobile-line-title {
  padding: 20px 24px 14px;
}

body[data-role="stock"] .mobile-line-title h2 {
  margin: 0;
  color: var(--app-text);
  font-size: 36px;
  line-height: 1.05;
}

body[data-role="stock"] .mobile-line-title p {
  margin: 8px 0 0;
  color: var(--app-muted);
  font-size: 19px;
  font-weight: 800;
}

body[data-role="stock"] .mobile-line-body {
  flex: 1;
  overflow: auto;
  overflow-x: hidden;
  padding: 0 24px 124px;
}

body[data-role="stock"] .modal-count-stats {
  margin: 0 0 16px;
}

body[data-role="stock"] .modal-count-stats div {
  min-height: 92px;
  border-radius: 20px;
  background: #ffffff;
}

body[data-role="stock"] .modal-count-stats span {
  font-size: 13px;
}

body[data-role="stock"] .modal-count-stats strong {
  font-size: 28px;
}

body[data-role="stock"] .modal-count-inputs {
  gap: 14px;
}

body[data-role="stock"] .modal-count-inputs label {
  font-size: 15px;
}

body[data-role="stock"] .modal-count-inputs input {
  min-height: 82px;
  border-radius: 20px;
  font-size: 34px;
}

body[data-role="stock"] .mobile-line-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 18px 24px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--app-line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
}

body[data-role="stock"] .mobile-line-footer button {
  width: 100%;
  min-height: 78px;
  border-radius: 26px;
  background: #0b63ce;
  font-size: 24px;
}

body[data-role="stock"] #mobileLineModal .modal-count-inputs input {
  min-height: 82px;
  height: 82px;
  font-size: 34px;
}

body[data-role="stock"] .stock-profile-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin: 8px 0 14px;
  padding: 18px;
  border: 1px solid var(--app-line);
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(16,24,40,.07);
}

body[data-role="stock"] .stock-profile-avatar {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1fb8c8, #1478a6);
  color: #ffffff;
  font-size: 26px;
  font-weight: 950;
}

body[data-role="stock"] .stock-profile-card span,
body[data-role="stock"] .stock-profile-head span,
body[data-role="stock"] .stock-profile-grid span,
body[data-role="stock"] .stock-profile-data span {
  color: #08769a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

body[data-role="stock"] .stock-profile-card h3 {
  margin: 3px 0 0;
  color: var(--app-text);
  font-size: 25px;
  line-height: 1.05;
}

body[data-role="stock"] .stock-profile-card p,
body[data-role="stock"] .stock-profile-panel p {
  margin: 6px 0 0;
  color: var(--app-muted);
  font-size: 14px;
  font-weight: 750;
}

body[data-role="stock"] .stock-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

body[data-role="stock"] .stock-profile-grid div,
body[data-role="stock"] .stock-profile-panel {
  border: 1px solid var(--app-line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(16,24,40,.05);
}

body[data-role="stock"] .stock-profile-grid div {
  min-height: 88px;
  padding: 14px;
}

body[data-role="stock"] .stock-profile-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--app-text);
  font-size: 30px;
  line-height: 1;
}

body[data-role="stock"] .stock-profile-panel {
  margin-bottom: 14px;
  padding: 16px;
}

body[data-role="stock"] .stock-profile-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

body[data-role="stock"] .stock-profile-head h3 {
  margin: 3px 0 0;
  color: var(--app-text);
  font-size: 21px;
}

body[data-role="stock"] .stock-profile-head > strong {
  color: var(--app-text);
  font-size: 30px;
  line-height: 1;
}

body[data-role="stock"] .profile-progress {
  height: 11px;
  margin: 8px 0 4px;
}

body[data-role="stock"] .stock-history-list {
  display: grid;
  gap: 8px;
}

body[data-role="stock"] .stock-history-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid var(--app-line);
  border-radius: 17px;
  background: #f8fafc;
}

body[data-role="stock"] .stock-history-list strong,
body[data-role="stock"] .stock-profile-data strong {
  display: block;
  color: var(--app-text);
  font-size: 16px;
}

body[data-role="stock"] .stock-history-list span {
  display: block;
  margin-top: 3px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
}

body[data-role="stock"] .stock-history-list em {
  min-width: 48px;
  padding: 8px 9px;
  border-radius: 999px;
  background: #edf4fa;
  color: #155577;
  font-size: 13px;
  font-style: normal;
  font-weight: 950;
  text-align: center;
}

body[data-role="stock"] .stock-history-list em.ok {
  background: #ecfdf3;
  color: #087443;
}

body[data-role="stock"] .stock-history-list em.warn {
  background: #fff7e6;
  color: #9a5b00;
}

body[data-role="stock"] .stock-profile-data {
  display: grid;
  gap: 8px;
}

body[data-role="stock"] .stock-profile-data div {
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 16px;
  background: #f8fafc;
}

body[data-role="stock"] .barcode-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 12px;
}

body[data-role="stock"] .barcode-unit-row label {
  min-width: 0;
}

body[data-role="stock"] .barcode-scan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

body[data-role="stock"] .barcode-scan-card span {
  grid-column: 1;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-role="stock"] .barcode-scan-card strong {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--app-text);
  font-size: 16px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-role="stock"] .barcode-unit-row .scan-btn {
  grid-column: 1 / -1;
  min-height: 58px;
  padding: 0 12px;
  border: 2px solid #111827;
  border-radius: 18px;
  background: #111827;
  color: #ffffff;
  font-size: 19px;
  font-weight: 950;
}

body[data-role="stock"] .manual-barcode-btn {
  grid-column: 1;
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 900;
}

body[data-role="stock"] .manual-barcode-field {
  grid-column: 1 / -1;
}

body[data-role="stock"] #barcodeScannerModal {
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
}

body[data-role="stock"] #barcodeScannerModal .modal-backdrop {
  background: rgba(15,23,42,.42);
  backdrop-filter: blur(5px);
}

body[data-role="stock"] .scanner-panel {
  width: min(calc(100vw - 32px), 620px);
  max-height: min(82svh, 760px);
  border: 1px solid rgba(226,235,244,.95);
  border-radius: 34px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 28px 100px rgba(15,23,42,.34);
}

body[data-role="stock"] .scanner-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--app-line);
}

body[data-role="stock"] .scanner-head .ghost {
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
}

body[data-role="stock"] .scanner-head strong {
  color: var(--app-text);
  font-size: 24px;
  line-height: 1.05;
}

body[data-role="stock"] .scanner-torch {
  min-width: 62px;
  padding: 0 14px !important;
  font-size: 14px;
}

body[data-role="stock"] .scanner-view {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 16px;
  overflow: hidden;
  border: 2px solid #111827;
  border-radius: 26px;
  background: #111827;
}

body[data-role="stock"] #barcodeVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-role="stock"] .scan-frame {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 39%;
  height: 15%;
  border: 3px solid #20c7d9;
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.22), 0 0 24px rgba(32,199,217,.42);
}

body[data-role="stock"] .scan-frame::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  border-top: 2px dashed rgba(255,255,255,.82);
  transform: translateY(-50%);
}

body[data-role="stock"] #scannerStatus {
  margin: 0 22px 16px;
  color: var(--app-muted);
  font-size: 17px;
  font-weight: 850;
  text-align: center;
}

body[data-role="stock"] .scanner-panel > .primary {
  width: calc(100% - 44px);
  min-height: 68px;
  margin: 0 22px 22px;
  border-radius: 22px;
  font-size: 20px;
}

@media (max-width: 520px) {
  body[data-role="stock"] #barcodeScannerModal {
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(18px + env(safe-area-inset-bottom));
  }

  body[data-role="stock"] .scanner-panel {
    width: min(calc(100vw - 24px), 560px);
    border-radius: 30px;
  }

  body[data-role="stock"] .scanner-head {
    padding: 14px 16px;
    gap: 8px;
  }

  body[data-role="stock"] .scanner-head strong {
    font-size: 22px;
  }

  body[data-role="stock"] .scanner-head .ghost {
    min-height: 46px;
    padding: 0 16px;
  }

  body[data-role="stock"] .scanner-view {
    aspect-ratio: 1 / 1;
    margin: 14px;
  }

  body[data-role="stock"] #scannerStatus {
    margin: 0 18px 14px;
    font-size: 16px;
    line-height: 1.25;
  }

  body[data-role="stock"] .scanner-panel > .primary {
    width: calc(100% - 36px);
    min-height: 58px;
    margin: 0 18px 18px;
    font-size: 18px;
  }
}

body[data-role="stock"] #nextLineBtn {
  min-height: 48px;
  border-radius: var(--app-radius);
  font-size: 15px;
}

body[data-role="stock"] .mobile-count-list {
  gap: 10px;
}

body[data-role="stock"] .count-line {
  border-radius: var(--app-radius);
}

body[data-role="stock"] .count-line-summary {
  min-height: 64px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 11px;
}

body[data-role="stock"] .line-position {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

body[data-role="stock"] .line-main strong {
  font-size: 15px;
  line-height: 1.2;
}

body[data-role="stock"] .line-main small,
body[data-role="stock"] .line-state {
  font-size: 12px;
}

body[data-role="stock"] .count-line-editor {
  padding: 0 11px 12px;
}

body[data-role="stock"] .count-line-stats div {
  min-height: 64px;
  padding: 10px;
}

body[data-role="stock"] .count-line-inputs {
  gap: 10px;
}

body[data-role="stock"] .count-line-inputs input {
  min-height: 50px;
  padding: 12px;
  border-radius: var(--app-radius);
  font-size: 18px;
}

body[data-role="stock"] {
  --app-bg: #171b24;
  --app-panel: #10151d;
  --app-panel-soft: #202530;
  --app-line: rgba(255,255,255,.08);
  --app-text: #f3f6fb;
  --app-muted: #aab2c0;
  --app-accent: #28c7d8;
  --app-pill: #303542;
  background: var(--app-bg);
  color: var(--app-text);
}

body[data-role="stock"] .phone-stage {
  background: var(--app-bg);
}

body[data-role="stock"] .mobile-header {
  min-height: 88px;
  padding: 20px 20px 16px;
  background: var(--app-bg);
  border-bottom: 0;
  box-shadow: none;
}

body[data-role="stock"] .mobile-header .eyebrow {
  display: none;
}

body[data-role="stock"] .mobile-header h2 {
  color: var(--app-text);
  font-size: 34px;
  font-weight: 850;
  letter-spacing: 0;
}

body[data-role="stock"] .mobile-header button {
  min-width: 52px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: var(--app-panel-soft);
  color: var(--app-text);
  font-size: 0;
  box-shadow: none;
}

body[data-role="stock"] .mobile-header button::before {
  content: "↻";
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
}

body[data-role="stock"] #stockAgenda {
  gap: 22px;
  padding: 0 20px 112px;
}

.stock-app-search {
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 2px;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--app-pill);
  color: var(--app-text);
}

.stock-app-search span {
  color: #d2d7e0;
  font-size: 20px;
  font-weight: 650;
}

.stock-app-search b {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 800;
}

.stock-section-title {
  margin: 0;
  color: #dce2ed;
  font-size: 27px;
  font-weight: 800;
}

body[data-role="stock"] .stock-task-list {
  gap: 4px;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(255,255,255,.03);
}

body[data-role="stock"] .stock-task {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 128px;
  padding: 18px 18px;
  border: 0;
  border-radius: 0;
  background: var(--app-panel);
  color: var(--app-text);
  box-shadow: none;
}

body[data-role="stock"] .stock-task:active {
  background: #1b2230;
}

.stock-task-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c7d8, #166e95);
  color: white;
  font-size: 27px;
  font-weight: 900;
}

body[data-role="stock"] .stock-task-main strong {
  margin: 0;
  color: var(--app-text);
  font-size: 22px;
  font-weight: 780;
  line-height: 1.12;
}

body[data-role="stock"] .stock-task-main small {
  margin-top: 7px;
  color: var(--app-muted);
  font-size: 17px;
  line-height: 1.25;
}

body[data-role="stock"] .mini-progress {
  height: 7px;
  margin-top: 14px;
  background: #303845;
}

body[data-role="stock"] .stock-task-action {
  display: grid;
  justify-items: end;
}

body[data-role="stock"] .stock-task-action em {
  padding: 7px 11px;
  border: 0;
  background: rgba(40,199,216,.16);
  color: #82f2ff;
  font-size: 13px;
  white-space: nowrap;
}

.stock-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 28px calc(12px + env(safe-area-inset-bottom));
  background: #242933;
  box-shadow: 0 -14px 34px rgba(0,0,0,.25);
}

.stock-bottom-nav button {
  min-height: 58px;
  border-radius: 999px;
  background: transparent;
  color: var(--app-muted);
  box-shadow: none;
}

.stock-bottom-nav button.active {
  background: #3f4561;
  color: white;
}

body[data-role="stock"] .mobile-workbench {
  gap: 16px;
  padding: 0 20px 112px;
  border-top: 0;
  background: var(--app-bg);
}

body[data-role="stock"] .mobile-actions {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -20px;
  padding: 10px 20px 12px;
  background: rgba(23,27,36,.92);
  backdrop-filter: blur(14px);
}

body[data-role="stock"] .mobile-actions button {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--app-panel-soft);
  color: var(--app-text);
  font-size: 17px;
  box-shadow: none;
}

body[data-role="stock"] .mobile-actions .success,
body[data-role="stock"] .mobile-actions button.success:disabled {
  background: #303542;
  color: #cbd3df;
}

body[data-role="stock"] #mobileTitle {
  color: var(--app-text);
  font-size: 29px;
  font-weight: 850;
}

body[data-role="stock"] #mobileMeta {
  color: var(--app-muted);
  font-size: 17px;
}

body[data-role="stock"] .stock-progress,
body[data-role="stock"] .mobile-route-summary div,
body[data-role="stock"] .group-overview-card,
body[data-role="stock"] .count-line,
body[data-role="stock"] .count-line-summary {
  border-color: var(--app-line);
  background: var(--app-panel);
  color: var(--app-text);
}

body[data-role="stock"] .stock-progress {
  min-height: 78px;
  padding: 16px;
  box-shadow: none;
}

body[data-role="stock"] .stock-progress span,
body[data-role="stock"] .stock-progress em,
body[data-role="stock"] .mobile-route-summary span,
body[data-role="stock"] .group-overview-card em,
body[data-role="stock"] .count-line-stats span,
body[data-role="stock"] .count-line-inputs label {
  color: var(--app-muted);
}

body[data-role="stock"] .stock-progress strong {
  color: var(--app-text);
  font-size: 25px;
}

body[data-role="stock"] #lineSearch,
body[data-role="stock"] #mobileSort {
  min-height: 62px;
  border: 0;
  border-radius: 999px;
  background: var(--app-pill);
  color: var(--app-text);
  font-size: 18px;
}

body[data-role="stock"] #lineSearch::placeholder {
  color: #c5ccd7;
}

body[data-role="stock"] .mobile-route-summary div {
  min-height: 76px;
  border-radius: 18px;
}

body[data-role="stock"] .mobile-route-summary strong {
  color: var(--app-text);
  font-size: 24px;
}

body[data-role="stock"] .group-chips button {
  min-width: 150px;
  min-height: 70px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: var(--app-panel);
  color: var(--app-text);
}

body[data-role="stock"] .group-chips button.active {
  border-color: rgba(40,199,216,.55);
  background: rgba(40,199,216,.14);
  box-shadow: none;
}

body[data-role="stock"] .group-chips strong {
  font-size: 16px;
}

body[data-role="stock"] .group-chips span {
  color: var(--app-muted);
  font-size: 13px;
}

body[data-role="stock"] .group-overview {
  gap: 4px;
  overflow: hidden;
  border-radius: 22px;
}

body[data-role="stock"] .group-overview-card {
  min-height: 104px;
  border: 0;
  border-left: 0;
  border-radius: 0;
  padding: 20px;
}

body[data-role="stock"] .group-overview-card span {
  color: var(--app-text);
  font-size: 22px;
}

body[data-role="stock"] .group-overview-card strong {
  color: var(--app-text);
  font-size: 34px;
}

body[data-role="stock"] .segmented {
  min-height: 54px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--app-pill);
}

body[data-role="stock"] .segmented button {
  min-height: 46px;
  border-radius: 999px;
  color: var(--app-muted);
  font-size: 14px;
}

body[data-role="stock"] .segmented button.active {
  background: #ffffff;
  color: #111827;
}

body[data-role="stock"] #nextLineBtn {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 45;
  min-height: 64px;
  border: 0;
  border-radius: 24px;
  background: #0b63ce;
  color: white;
  font-size: 20px;
  box-shadow: 0 18px 36px rgba(11,99,206,.32);
}

body[data-role="stock"] #nextLineBtn:disabled {
  background: #e8eef4;
  color: #667085;
  box-shadow: none;
}

body[data-role="stock"] .count-line {
  border: 0;
  border-radius: 22px;
  overflow: hidden;
}

body[data-role="stock"] .count-line-summary {
  min-height: 86px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 17px;
}

body[data-role="stock"] .line-position {
  width: 44px;
  height: 44px;
  background: #303542;
  color: var(--app-text);
  font-size: 17px;
}

body[data-role="stock"] .line-main strong {
  color: var(--app-text);
  font-size: 19px;
}

body[data-role="stock"] .line-main small {
  color: var(--app-muted);
  font-size: 15px;
}

body[data-role="stock"] .line-state {
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  background: rgba(255,255,255,.08);
  color: var(--app-muted);
  font-size: 13px;
}

body[data-role="stock"] .count-line-editor {
  padding: 0 17px 18px;
}

body[data-role="stock"] .count-line-stats {
  gap: 8px;
}

body[data-role="stock"] .count-line-stats div {
  min-height: 78px;
  border: 1px solid var(--app-line);
  background: #171d28;
}

body[data-role="stock"] .count-line-stats strong {
  color: var(--app-text);
}

body[data-role="stock"] .count-line-inputs input {
  min-height: 64px;
  border: 0;
  background: #ffffff;
  color: #111827;
  font-size: 22px;
}

body[data-role="stock"] {
  --app-bg: #f5f7fb;
  --app-panel: #ffffff;
  --app-panel-soft: #eef4f8;
  --app-line: #d9e3ec;
  --app-text: #111827;
  --app-muted: #667085;
  --app-accent: #1478a6;
  --app-pill: #eef4f8;
  background: var(--app-bg);
  color: var(--app-text);
}

body[data-role="stock"] .phone-stage,
body[data-role="stock"] .mobile-workbench {
  background: var(--app-bg);
}

body[data-role="stock"] .mobile-header {
  background: #ffffff;
  border-bottom: 1px solid var(--app-line);
  box-shadow: 0 10px 28px rgba(16,24,40,.06);
}

body[data-role="stock"] .mobile-header h2 {
  color: var(--app-text);
}

body[data-role="stock"] .mobile-header button {
  border-color: var(--app-line);
  background: #ffffff;
  color: var(--app-text);
  box-shadow: 0 6px 16px rgba(16,24,40,.06);
}

body[data-role="stock"] .stock-app-search {
  background: #ffffff;
  color: var(--app-text);
  box-shadow: 0 8px 22px rgba(16,24,40,.06);
}

body[data-role="stock"] .stock-app-search span,
body[data-role="stock"] .stock-section-title,
body[data-role="stock"] .stock-task-main strong,
body[data-role="stock"] #mobileTitle,
body[data-role="stock"] .stock-progress strong,
body[data-role="stock"] .mobile-route-summary strong,
body[data-role="stock"] .group-overview-card span,
body[data-role="stock"] .group-overview-card strong,
body[data-role="stock"] .line-main strong,
body[data-role="stock"] .count-line-stats strong {
  color: var(--app-text);
}

body[data-role="stock"] .stock-app-search b,
body[data-role="stock"] .stock-task-main small,
body[data-role="stock"] #mobileMeta,
body[data-role="stock"] .stock-progress span,
body[data-role="stock"] .stock-progress em,
body[data-role="stock"] .mobile-route-summary span,
body[data-role="stock"] .group-overview-card em,
body[data-role="stock"] .line-main small,
body[data-role="stock"] .count-line-stats span,
body[data-role="stock"] .count-line-inputs label {
  color: var(--app-muted);
}

body[data-role="stock"] .stock-task-list,
body[data-role="stock"] .group-overview {
  background: transparent;
  gap: 12px;
  border-radius: 0;
}

body[data-role="stock"] .stock-task {
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 150px;
  border: 1px solid var(--app-line);
  border-radius: 22px;
  background: #ffffff;
  color: var(--app-text);
  box-shadow: 0 12px 30px rgba(16,24,40,.07);
}

body[data-role="stock"] .stock-task:active {
  background: #f8fbfd;
}

body[data-role="stock"] .stock-task-main em {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eaf5fb;
  color: #155577;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

body[data-role="stock"] .mini-progress {
  background: #dfe8f0;
}

body[data-role="stock"] .stock-bottom-nav {
  background: #ffffff;
  border-top: 1px solid var(--app-line);
  box-shadow: 0 -14px 34px rgba(16,24,40,.08);
}

body[data-role="stock"] .stock-bottom-nav button {
  color: var(--app-muted);
}

body[data-role="stock"] .stock-bottom-nav button.active {
  background: #e8ecff;
  color: #1f2a56;
}

body[data-role="stock"] .mobile-actions {
  background: rgba(245,247,251,.94);
}

body[data-role="stock"] .mobile-actions button,
body[data-role="stock"] .mobile-actions .success,
body[data-role="stock"] .mobile-actions button.success:disabled {
  background: #ffffff;
  color: var(--app-text);
  border: 1px solid var(--app-line);
}

body[data-role="stock"] .stock-progress,
body[data-role="stock"] .mobile-route-summary div,
body[data-role="stock"] .group-overview-card,
body[data-role="stock"] .count-line,
body[data-role="stock"] .count-line-summary,
body[data-role="stock"] .group-chips button {
  border-color: var(--app-line);
  background: #ffffff;
  color: var(--app-text);
}

body[data-role="stock"] #lineSearch,
body[data-role="stock"] #mobileSort {
  background: #ffffff;
  color: var(--app-text);
  border: 1px solid var(--app-line);
}

body[data-role="stock"] #lineSearch::placeholder {
  color: #7d8794;
}

body[data-role="stock"] .group-chips button.active {
  border-color: rgba(32,199,217,.6);
  background: #eefdff;
}

body[data-role="stock"] .group-chips span,
body[data-role="stock"] .line-state {
  color: var(--app-muted);
}

body[data-role="stock"] .group-overview-card {
  border: 1px solid var(--app-line);
  border-left: 5px solid var(--cyan);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(16,24,40,.05);
}

body[data-role="stock"] .segmented {
  background: #e9f0f6;
}

body[data-role="stock"] .segmented button {
  color: var(--app-muted);
}

body[data-role="stock"] .segmented button.active {
  background: #ffffff;
  color: var(--app-text);
}

body[data-role="stock"] .line-position {
  background: #eef4f8;
  color: var(--soft);
}

body[data-role="stock"] .count-line-stats div {
  border-color: var(--app-line);
  background: #f8fafc;
}

body[data-role="stock"] .count-line-editor {
  padding: 0 14px 14px;
}

body[data-role="stock"] .count-line-stats {
  gap: 6px;
  margin-bottom: 10px;
}

body[data-role="stock"] .count-line-stats div {
  min-height: 58px;
  padding: 8px;
}

body[data-role="stock"] .count-line-stats span {
  font-size: 10px;
}

body[data-role="stock"] .count-line-stats strong {
  margin-top: 2px;
  font-size: 17px;
}

body[data-role="stock"] .count-line-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body[data-role="stock"] .count-line-inputs label {
  min-width: 0;
  font-size: 11px;
}

body[data-role="stock"] .count-line-inputs label.wide-field {
  grid-column: 1 / -1;
}

body[data-role="stock"] .count-line-inputs .wide-field {
  grid-column: 1 / -1;
}

body[data-role="stock"] .count-line-inputs input {
  min-height: 54px;
  margin-top: 5px;
  border: 2px solid #111827;
  border-radius: 10px;
  background: #ffffff;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 2px 0 rgba(17,24,39,.08);
}

body[data-role="stock"] .count-line-inputs input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(32,199,217,.22), 0 2px 0 rgba(17,24,39,.12);
}

body[data-role="stock"] .count-line.compact.selected {
  outline-width: 1px;
}

body[data-role="stock"] .stock-calendar-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-content: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  scroll-snap-type: none;
}

body[data-role="stock"] .stock-calendar-strip::-webkit-scrollbar {
  display: none;
}

body[data-role="stock"] .stock-day-pill {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  gap: 3px;
  min-height: 76px;
  padding: 8px 3px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--app-text);
  text-align: center;
  text-decoration: none;
  scroll-snap-align: start;
  box-shadow: 0 8px 22px rgba(16,24,40,.06);
}

body[data-role="stock"] .stock-day-pill.active {
  border-color: rgba(32,199,217,.85);
  background: #eefdff;
  box-shadow: 0 0 0 2px rgba(32,199,217,.18), 0 10px 24px rgba(16,24,40,.08);
}

body[data-role="stock"] .stock-day-pill.today {
  border-color: var(--app-line);
  background: #ffffff;
}

body[data-role="stock"] .stock-day-pill.active.today {
  border-color: rgba(32,199,217,.85);
  background: #eefdff;
}

body[data-role="stock"] .stock-day-pill.overdue {
  border-color: rgba(255,178,36,.55);
  background: #fff8e8;
}

body[data-role="stock"] .stock-day-pill strong {
  font-size: 14px;
  line-height: 1.1;
  text-transform: capitalize;
  white-space: normal;
}

body[data-role="stock"] .stock-day-pill span {
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

body[data-role="stock"] .stock-day-pill em {
  width: fit-content;
  margin-top: 1px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf4fa;
  color: #155577;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

body[data-role="stock"] .stock-week-title {
  display: grid;
  margin: 2px 0 8px;
}

body[data-role="stock"] .stock-week-title div {
  min-height: 54px;
  padding: 8px 14px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: #ffffff;
  text-align: center;
  box-shadow: 0 8px 18px rgba(16,24,40,.04);
}

body[data-role="stock"] .stock-week-title span {
  display: block;
  color: #08769a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .02em;
  text-transform: uppercase;
}

body[data-role="stock"] .stock-week-title strong {
  display: block;
  margin-top: 3px;
  color: var(--app-text);
  font-size: 24px;
  line-height: 1.1;
}

body[data-role="stock"] .stock-week-strip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: stretch;
  margin: 0 0 18px;
}

body[data-role="stock"] .stock-week-strip > button {
  width: 34px;
  min-height: 76px;
  border-radius: 18px;
  background: #ffffff;
  font-size: 26px;
  line-height: 1;
}

body[data-role="stock"] .stock-day-pill.overdue em {
  background: #fff1cc;
  color: #8a5200;
}

body[data-role="stock"] .stock-day-section {
  margin: 0 0 18px;
}

body[data-role="stock"] .stock-day-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

body[data-role="stock"] .stock-day-head span {
  color: #08769a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

body[data-role="stock"] .stock-day-head h3 {
  margin: 2px 0 0;
  color: var(--app-text);
  font-size: 28px;
  line-height: 1.05;
}

body[data-role="stock"] .stock-day-head strong {
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.2;
  text-align: right;
}

body[data-role="stock"] .stock-task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

body[data-role="stock"] .stock-task-main .stock-task-meta em {
  margin-top: 0;
}

body[data-role="stock"] .stock-task-meta b {
  min-width: 48px;
  color: var(--app-text);
  font-size: 18px;
  font-weight: 950;
  text-align: right;
}

body[data-role="stock"] .stock-day-section .stock-task-list {
  gap: 12px;
}

body[data-role="stock"] .stock-day-section .stock-task {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  min-height: 112px;
  padding: 14px;
  border-radius: 20px;
}

body[data-role="stock"] .stock-day-section .stock-task-icon {
  width: 50px;
  height: 50px;
  font-size: 21px;
}

body[data-role="stock"] .stock-day-section .stock-task-main strong {
  font-size: 19px;
  line-height: 1.12;
}

body[data-role="stock"] .stock-day-section .stock-task-main small {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.2;
}

body[data-role="stock"] .stock-day-section .stock-task-main em {
  padding: 6px 10px;
  font-size: 12px;
}

body[data-role="stock"] .stock-day-section .stock-task-meta b {
  font-size: 18px;
}

body[data-role="stock"] .stock-day-section .mini-progress {
  height: 7px;
  margin-top: 9px;
}

body[data-role="stock"] .stock-empty {
  min-height: 104px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 14px;
}

body[data-role="stock"] #lineSearch {
  min-height: 58px;
  margin: 14px 0 12px;
  padding: 0 16px;
  border-radius: 22px;
  font-size: 17px;
  box-shadow: 0 8px 18px rgba(16,24,40,.04);
}

body[data-role="stock"] .mobile-route-summary,
body[data-role="stock"] #mobileGroupFilter {
  display: none !important;
}

body[data-role="stock"] .group-chips {
  display: flex;
  gap: 9px;
  margin: 0 0 10px;
  padding: 0 0 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body[data-role="stock"] .group-chips::-webkit-scrollbar {
  display: none;
}

body[data-role="stock"] .group-chips button {
  flex: 0 0 auto;
  min-width: 118px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 17px;
}

body[data-role="stock"] .group-chips strong {
  font-size: 14px;
  line-height: 1.05;
}

body[data-role="stock"] .group-chips span {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.05;
}

body[data-role="stock"] .mobile-sort-compact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0 0 10px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

body[data-role="stock"] .mobile-sort-compact select,
body[data-role="stock"] #mobileSort {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 0 32px 0 12px;
  border: 0;
  border-radius: 13px;
  background-color: #f3f7fb;
  color: var(--app-text);
  font-size: 15px;
  font-weight: 900;
}

body[data-role="stock"] .segmented {
  min-height: 48px;
  margin-bottom: 12px;
}

body[data-role="stock"] .segmented button {
  min-height: 40px;
  font-size: 12px;
}

/* Stock mobile final overrides - must stay at the end of the stylesheet. */
body[data-role="stock"] .mobile-header {
  min-height: 86px;
  padding: 18px 20px 14px;
}
body[data-role="stock"] .mobile-header h2 { font-size: 32px; }
body[data-role="stock"] .mobile-header button {
  width: 54px;
  min-width: 54px;
  min-height: 54px;
}
body[data-role="stock"] #stockAgenda {
  gap: 14px;
  padding: 0 14px 88px;
}
body[data-role="stock"] .stock-week-title div {
  min-height: 48px;
  border-radius: 16px;
}
body[data-role="stock"] .stock-week-title strong { font-size: 22px; }
body[data-role="stock"] .stock-week-strip {
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 5px;
  margin-bottom: 14px;
}
body[data-role="stock"] .stock-week-strip > button {
  width: 30px;
  min-height: 74px;
  border-radius: 16px;
  font-size: 24px;
}
body[data-role="stock"] .stock-calendar-strip {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
body[data-role="stock"] .stock-day-pill {
  min-height: 74px;
  gap: 2px;
  padding: 7px 2px;
  border-radius: 15px;
}
body[data-role="stock"] .stock-day-pill strong { font-size: 13px; }
body[data-role="stock"] .stock-day-pill span { font-size: 10px; }
body[data-role="stock"] .stock-day-pill em {
  padding: 3px 6px;
  font-size: 9px;
}
body[data-role="stock"] .stock-day-head {
  align-items: end;
  margin-bottom: 8px;
}
body[data-role="stock"] .stock-day-head span { font-size: 10px; }
body[data-role="stock"] .stock-day-head h3 { font-size: 25px; }
body[data-role="stock"] .stock-day-head strong {
  max-width: 45%;
  font-size: 12px;
}
body[data-role="stock"] .stock-day-section .stock-task-list { gap: 10px; }
body[data-role="stock"] .stock-day-section .stock-task {
  grid-template-columns: 52px minmax(0, 1fr);
  min-height: 104px;
  gap: 11px;
  padding: 12px;
  border-radius: 18px;
}
body[data-role="stock"] .stock-day-section .stock-task-icon {
  width: 46px;
  height: 46px;
  font-size: 20px;
}
body[data-role="stock"] .stock-day-section .stock-task-main strong { font-size: 17px; }
body[data-role="stock"] .stock-day-section .stock-task-main small { font-size: 12px; }
body[data-role="stock"] .stock-task-meta { margin-top: 8px; }
body[data-role="stock"] .stock-day-section .stock-task-main em {
  padding: 5px 9px;
  font-size: 11px;
}
body[data-role="stock"] .stock-day-section .stock-task-meta b { font-size: 16px; }
body[data-role="stock"] .stock-bottom-nav {
  padding: 8px 18px calc(8px + env(safe-area-inset-bottom));
}
body[data-role="stock"] .stock-bottom-nav button {
  min-height: 48px;
  font-size: 14px;
}
body[data-role="stock"] .mobile-workbench {
  gap: 10px;
  padding: 0 14px 92px;
}
body[data-role="stock"] .mobile-actions {
  margin: 0 -14px;
  padding: 8px 14px;
}
body[data-role="stock"] .mobile-actions button {
  min-height: 44px;
  font-size: 14px;
}
body[data-role="stock"] #lineSearch {
  min-height: 48px;
  margin: 8px 0;
  border-radius: 16px;
  font-size: 14px;
}
body[data-role="stock"] .group-chips button {
  min-width: 112px;
  min-height: 50px;
  border-radius: 14px;
}
body[data-role="stock"] .group-chips strong { font-size: 13px; }
body[data-role="stock"] .group-chips span { font-size: 10px; }
body[data-role="stock"] .mobile-sort-compact {
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 48px;
  border-radius: 16px;
}
body[data-role="stock"] .mobile-sort-compact span { font-size: 10px; }
body[data-role="stock"] #mobileSort {
  min-height: 48px;
  border-radius: 0 16px 16px 0;
  font-size: 14px;
}
body[data-role="stock"] .segmented {
  min-height: 46px;
  border-radius: 18px;
}
body[data-role="stock"] .segmented button {
  min-height: 38px;
  font-size: 12px;
}
body[data-role="stock"] .count-line-summary {
  min-height: 70px;
  grid-template-columns: 42px minmax(0, 1fr) 48px;
  gap: 10px;
  padding: 12px;
}
body[data-role="stock"] .line-position {
  width: 38px;
  height: 38px;
  font-size: 15px;
}
body[data-role="stock"] .line-main strong {
  font-size: 17px;
  line-height: 1.12;
}
body[data-role="stock"] .line-main small { font-size: 13px; }
body[data-role="stock"] .line-state {
  min-height: 28px;
  padding: 5px 7px;
  font-size: 11px;
}
body[data-role="stock"] #nextLineBtn {
  left: 50% !important;
  right: auto !important;
  width: min(86vw, 420px) !important;
  max-width: calc(100vw - 36px);
  bottom: calc(14px + env(safe-area-inset-bottom));
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 0 20px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.15;
  text-align: center;
  transform: translateX(-50%) !important;
}

body[data-role="stock"] #nextLineBtn:active {
  transform: translateX(-50%) !important;
}

