:root {
  --navy: #123b5d;
  --teal: #1f6f8b;
  --sky: #e8f5f8;
  --ink: #172033;
  --muted: #667085;
  --line: #dbe3ea;
  --bg: #f4f7f9;
  --white: #ffffff;
  --green: #16865b;
  --red: #c33b3b;
  --amber: #a25c00;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; min-height: 42px; padding: 0 16px; font-weight: 700; }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { background: var(--navy); color: white; }
.secondary { background: var(--sky); color: var(--navy); border: 1px solid #b9dbe3; }
.success { background: var(--green); color: white; }
.ghost { background: transparent; color: white; border: 1px solid rgba(255,255,255,.35); }
label { display: grid; gap: 7px; color: #344054; font-size: 14px; font-weight: 650; }
input, select { width: 100%; min-height: 44px; border: 1px solid #cbd5df; border-radius: 9px; padding: 9px 11px; color: var(--ink); background: white; }
input:focus, select:focus { outline: 3px solid rgba(31,111,139,.18); border-color: var(--teal); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #0b2b45, #1f6f8b); }
.login-card { width: min(420px, 100%); display: grid; gap: 17px; background: white; border-radius: 20px; padding: 30px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.login-card h1 { font-size: 25px; margin: 0; }
.login-card p, .login-card small { color: var(--muted); margin: 0; }
.password-visibility { display: flex; align-items: center; gap: 9px; width: fit-content; cursor: pointer; user-select: none; }
.password-visibility input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.password-visibility span { color: #475467; font-weight: 650; }
.login-back { justify-self: start; min-height: 32px; padding: 0; background: transparent; color: var(--teal); font-size: 13px; }
.login-error { margin: 0; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; background: #fef2f2; color: #991b1b; font-size: 14px; font-weight: 700; line-height: 1.4; }
.login-blocked { border: 2px solid #f0a4a4; }
.landing-shell { min-height: 100vh; background: linear-gradient(150deg, #f7fbfc 0%, #e7f5f7 52%, #d4edf0 100%); color: var(--ink); }
.landing-header { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0; display: flex; align-items: center; justify-content: space-between; }
.landing-brand { color: var(--navy); font-size: 20px; font-weight: 900; text-decoration: none; letter-spacing: -.03em; }
.landing-login-button { min-width: 112px; }
.landing-hero { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 74px 0 70px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 70px; align-items: center; }
.landing-copy h1 { max-width: 700px; margin: 12px 0 20px; color: var(--navy); font-size: clamp(38px, 5vw, 68px); line-height: 1.02; letter-spacing: -.055em; }
.landing-copy p { max-width: 650px; margin: 0; color: #38546a; font-size: 18px; line-height: 1.6; }
.landing-hero-button { margin-top: 30px; min-height: 50px; padding-inline: 24px; }
.landing-visual { min-height: 360px; position: relative; border-radius: 24px; background: #eef5f7; box-shadow: 0 24px 70px rgba(18,59,93,.18); overflow: hidden; }
.landing-visual img { display: block; width: 100%; height: 100%; min-height: 360px; object-fit: cover; object-position: center; }
.landing-benefits { width: min(1180px, calc(100% - 36px)); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.landing-benefits article { display: grid; gap: 8px; min-height: 150px; padding: 22px; border: 1px solid rgba(31,111,139,.16); border-radius: 16px; background: rgba(255,255,255,.72); box-shadow: 0 5px 20px rgba(18,59,93,.05); }
.landing-benefits strong { color: var(--navy); font-size: 18px; }
.landing-benefits span { color: #516273; line-height: 1.5; }
.landing-footer { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 38px 0 26px; color: #667085; font-size: 13px; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--navy); font-weight: 900; font-size: 20px; }
.topbar { height: 62px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; position: sticky; top: 0; z-index: 20; }
.topbar div { display: flex; gap: 12px; align-items: baseline; }
.topbar span { color: #b9dbe3; font-size: 13px; }
.topbar .topbar-actions { align-items: center; gap: 8px; }
.modal { width: min(480px, calc(100% - 28px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(9, 30, 48, .68); backdrop-filter: blur(3px); }
.modal-card { display: grid; gap: 16px; padding: 24px; }
.modal-card small { color: var(--muted); line-height: 1.45; }
.form-error { margin: 0; padding: 11px 13px; border: 1px solid #fecaca; border-radius: 9px; background: #fef2f2; color: #991b1b; font-size: 14px; font-weight: 700; line-height: 1.4; }
.modal-title { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.modal-title h2 { margin: 4px 0 0; color: var(--navy); }
.icon-button { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: #eef2f6; color: #475467; font-size: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 9px max(14px, calc((100vw - 1180px)/2)); background: white; border-bottom: 1px solid var(--line); position: sticky; top: 62px; z-index: 19; }
.tabs button { background: transparent; color: #475467; white-space: nowrap; }
.tabs button.active { color: var(--navy); background: var(--sky); }
.content { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 26px 0 70px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 18px; }
.section-title h2 { margin: 4px 0 0; font-size: 27px; }
.eyebrow { color: var(--teal); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 13px; }
.kpi-grid.compact { margin: 2px 0 8px; }
.kpi-grid.compact .kpi { padding: 14px; }
.kpi-grid.compact .kpi strong { font-size: 24px; }
.kpi { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 3px 12px rgba(18,59,93,.05); }
.kpi span { display: block; color: var(--muted); font-size: 13px; min-height: 35px; }
.kpi strong { display: block; color: var(--navy); font-size: 29px; margin-top: 5px; }
.notice { border-left: 5px solid var(--teal); background: #edf8fa; padding: 18px 20px; margin-top: 18px; border-radius: 10px; }
.notice p { margin: 6px 0 0; color: #38546a; }
.cards { display: grid; gap: 16px; }
.cards.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: 0 3px 12px rgba(18,59,93,.05); display: grid; gap: 14px; align-content: start; }
.card h3 { margin: 0; color: var(--navy); }
.card p { margin: -4px 0 2px; color: var(--muted); line-height: 1.5; }
.card > small { color: var(--muted); line-height: 1.45; }
.table-card { margin-top: 17px; overflow: hidden; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 780px; font-size: 13px; }
th { text-align: left; color: #475467; background: #f7f9fb; position: sticky; top: 0; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e7edf2; vertical-align: top; }
td code { font-size: 11px; word-break: break-all; }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 99px; background: #eef2f6; color: #475467; font-weight: 800; font-size: 11px; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.bad { background: #fee2e2; color: #991b1b; }
.scan-layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; }
.scanner-card { border: 2px solid #b9dbe3; }
.scan-head { display: flex; justify-content: space-between; align-items: center; }
.scan-head h3 { margin-top: 4px; font-size: 18px; }
.counter { text-align: right; }
.counter strong { display: block; font-size: 30px; color: var(--teal); }
.counter span { color: var(--muted); font-size: 12px; }
.scanner-input input { min-height: 58px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; border: 2px solid var(--teal); }
.scan-result { min-height: 70px; display: grid; place-items: center; text-align: center; border-radius: 10px; padding: 14px; font-weight: 850; }
.scan-result.neutral { background: #f1f5f9; color: #475467; }
.scan-result.ok { background: #dcfce7; color: #166534; }
.scan-result.warn { background: #fef3c7; color: #92400e; }
.scan-result.bad { background: #fee2e2; color: #991b1b; }
.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid h3 { grid-column: 1 / -1; }
.form-grid .form-wide { grid-column: 1 / -1; }
.form-grid button { align-self: end; }
.panel-title { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.panel-title h3 { margin-top: 4px; }
.decision-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.decision-summary .pill { font-size: 12px; padding: 6px 10px; }
.decision-write-off { background: #dcfce7; color: #166534; }
.decision-do-not { background: #e0f2fe; color: #075985; }
.decision-review { background: #fef3c7; color: #92400e; }
.decision-retired { background: #e5e7eb; color: #374151; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 14px; }
.filter-bar > * { max-width: 280px; }
.location-form { grid-template-columns: 1fr minmax(260px, .8fr) auto; align-items: end; margin-bottom: 16px; }
.location-form h3 { margin: 4px 0 8px; }
.location-form p { margin: 0; }
.warehouse-locations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.warehouse-location-card { display: grid; gap: 13px; align-content: start; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 3px 12px rgba(18,59,93,.05); }
.warehouse-location-card h3 { margin: 0; color: var(--navy); font-size: 18px; }
.warehouse-location-card .actions { margin-top: auto; }
.warehouse-products { border: 1px solid #d7e6ec; border-radius: 10px; background: #f7fbfc; overflow: hidden; }
.warehouse-products summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 12px; color: var(--navy); cursor: pointer; font-size: 13px; font-weight: 800; list-style: none; user-select: none; }
.warehouse-products summary::-webkit-details-marker { display: none; }
.warehouse-products summary::after { content: "⌄"; margin-left: auto; color: var(--teal); font-size: 18px; line-height: 1; transition: transform .18s ease; }
.warehouse-products[open] summary::after { transform: rotate(180deg); }
.warehouse-products summary strong { min-width: 25px; padding: 3px 7px; border-radius: 999px; background: #dff1f5; color: #28647a; text-align: center; font-size: 11px; }
.warehouse-products-body { display: grid; gap: 11px; padding: 12px; border-top: 1px solid #d7e6ec; background: white; }
.product-group-list { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.product-group-chip { display: inline-flex; padding: 6px 9px; border-radius: 999px; background: #edf8fa; color: #285b6e; font-size: 11px; font-weight: 750; line-height: 1.25; }
.empty-groups { color: var(--muted); font-size: 12px; }
.add-product-button { justify-self: start; min-height: 34px; padding: 6px 10px; border: 1px dashed #7fb8c6; background: #f1fafb; color: var(--navy); font-size: 12px; }
.warehouse-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.warehouse-kpi { min-height: 82px; display: grid; align-content: center; justify-items: start; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); background: white; box-shadow: 0 3px 12px rgba(18,59,93,.05); }
.warehouse-kpi:hover { border-color: #9bc8d4; background: #f8fcfd; }
.warehouse-kpi span { color: var(--muted); font-size: 12px; }
.warehouse-kpi strong { color: var(--navy); font-size: 25px; }
.warehouse-filter { display: grid; grid-template-columns: 1.35fr 1.35fr .8fr .95fr auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f7fafc; }
.warehouse-filter-actions { display: flex; gap: 8px; }
.warehouse-note { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 13px 16px; margin: 12px 0; border-left: 4px solid #b9dbe3; border-radius: 8px; background: #f8fbfc; color: #516273; font-size: 12px; }
.warehouse-note strong { color: var(--navy); }
.warehouse-table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 3px 12px rgba(18,59,93,.05); }
.warehouse-table-card table { min-width: 1050px; }
.warehouse-table-card th { padding-block: 14px; background: #f7fafc; }
.warehouse-row td { padding-block: 15px; vertical-align: middle; }
.warehouse-code { display: grid; grid-template-columns: 28px minmax(260px, 1fr); gap: 10px; align-items: start; }
.warehouse-code .mark-icon { width: 25px; height: 25px; display: grid; place-items: center; color: #7d8c99; border: 1px solid #c9d3dc; border-radius: 6px; font-size: 12px; }
.warehouse-code code { display: block; color: #28739a; font-size: 12px; }
.warehouse-code strong { display: block; margin-top: 5px; color: #283547; font-size: 12px; line-height: 1.35; }
.gtin-code { color: #28739a; font-size: 12px; }
.warehouse-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.warehouse-in-turnover { background: #dcfce7; color: #167447; }
.warehouse-exited { background: #e8edf2; color: #536171; }
.warehouse-pending { background: #fff4ce; color: #8a5900; }
.warehouse-written-off { background: #e7e8eb; color: #3f4752; }
.trash-filter { display: grid; grid-template-columns: .9fr 1.35fr 1fr 1fr auto; gap: 12px; align-items: end; padding: 16px; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.credential-card { display: grid; grid-template-columns: 1fr minmax(220px, auto) auto auto; gap: 12px; align-items: center; margin: 16px 0; padding: 16px; border: 1px solid #9bc8d4; border-radius: 12px; background: #f1fafb; }
.credential-card h3 { margin: 4px 0 0; color: var(--navy); }
.credential-card code { padding: 10px 12px; border-radius: 8px; background: white; color: var(--navy); font-size: 15px; font-weight: 800; word-break: break-all; }
.user-form { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.user-form .panel-title, .user-form .user-locations, .user-form .modal-actions { grid-column: 1 / -1; }
.user-initial-passwords { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfc; }
.user-initial-passwords[hidden] { display: none; }
.user-initial-passwords .password-visibility, .user-initial-passwords > small { grid-column: 1 / -1; }
.user-active { display: flex; flex-direction: row; align-items: center; align-self: end; gap: 9px; min-height: 45px; }
.user-active input, .user-location-option input { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.user-locations { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.user-locations legend { padding: 0 5px; color: var(--navy); font-weight: 800; }
.user-locations > div { display: flex; flex-wrap: wrap; gap: 9px 16px; margin-bottom: 8px; }
.user-location-option { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; font-weight: 700; }
.user-status { display: grid; gap: 5px; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 100; max-width: min(460px, calc(100% - 36px)); padding: 14px 17px; border-radius: 12px; background: var(--navy); color: white; box-shadow: 0 15px 40px rgba(0,0,0,.25); white-space: pre-line; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button, .actions a { min-height: 32px; padding: 7px 9px; border-radius: 7px; background: var(--sky); color: var(--navy); font-weight: 750; text-decoration: none; }
.actions .danger, button.danger { background: #fff0f0; color: #9f1d2d; border: 1px solid #efb5bd; }
@media (max-width: 820px) {
  .landing-hero { grid-template-columns: 1fr; gap: 30px; padding: 38px 0 44px; }
  .landing-copy h1 { font-size: clamp(38px, 11vw, 56px); }
  .landing-copy p { font-size: 16px; }
  .landing-visual, .landing-visual img { min-height: 270px; }
  .landing-benefits { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cards.two, .scan-layout, .form-grid { grid-template-columns: 1fr; }
  .form-grid h3 { grid-column: auto; }
  .content { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .section-title h2 { font-size: 23px; }
  .tabs { padding-inline: 10px; }
  .topbar { height: auto; min-height: 62px; padding-block: 9px; gap: 10px; }
  .topbar .topbar-actions { gap: 5px; }
  .topbar .topbar-actions button { min-height: 38px; padding-inline: 10px; font-size: 12px; }
  .modal-actions { display: grid; grid-template-columns: 1fr; }
  .scan-actions { grid-template-columns: 1fr; }
  .location-form, .warehouse-filter, .trash-filter, .user-form, .credential-card { grid-template-columns: 1fr; }
  .user-form .panel-title, .user-form .user-locations, .user-form .modal-actions { grid-column: auto; }
  .user-initial-passwords { grid-column: auto; grid-template-columns: 1fr; }
  .user-initial-passwords .password-visibility, .user-initial-passwords > small { grid-column: auto; }
  .warehouse-locations { grid-template-columns: 1fr; }
  .warehouse-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .warehouse-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
