:root {
  --ink: #102331;
  --muted: #647482;
  --line: #dce5e9;
  --paper: #ffffff;
  --canvas: #f3f6f7;
  --nav: #102b3f;
  --nav-soft: #173b54;
  --accent: #0a8f72;
  --accent-dark: #08725c;
  --danger: #b83838;
  --warning: #a76b00;
  --success-bg: #e9f8f2;
  --danger-bg: #fff0f0;
  --warning-bg: #fff7df;
  --radius: 16px;
  --shadow: 0 12px 35px rgba(16, 43, 63, .08);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.inventory-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.inventory-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 18px; color: #fff; background: linear-gradient(180deg, var(--nav), #0b2232); }
.inventory-brand { display: flex; align-items: center; gap: 12px; padding: 8px 8px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.inventory-brand strong { display: block; font-size: 14px; line-height: 1.25; }
.inventory-brand small, .inventory-user small { display: block; margin-top: 4px; color: rgba(255,255,255,.64); }
.inventory-brand-mark { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; border-radius: 13px; background: var(--accent); font-size: 23px; font-weight: 800; }
.inventory-user { margin: 18px 0; padding: 14px; border-radius: 13px; background: rgba(255,255,255,.07); }
.inventory-user span { display: block; color: rgba(255,255,255,.55); font-size: 12px; }
.inventory-user strong { display: block; margin-top: 4px; font-size: 14px; }
.inventory-nav { display: grid; gap: 5px; }
.inventory-nav a { padding: 12px 14px; border-radius: 11px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 650; }
.inventory-nav a:hover, .inventory-nav a.active { color: #fff; background: var(--nav-soft); }
.inventory-nav a.scan-link { margin-bottom: 7px; color: #fff; background: var(--accent); }
.inventory-nav a.scan-link:hover, .inventory-nav a.scan-link.active { background: var(--accent-dark); }
.inventory-nav-label { margin: 18px 13px 4px; color: rgba(255,255,255,.45); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.inventory-main { min-width: 0; padding: 32px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.page-head h1 { margin: 0 0 7px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; padding: 22px; border: 1px solid rgba(16,43,63,.08); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.metric span { color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; font-size: 31px; line-height: 1; }
.section-title { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.section-note { color: var(--muted); font-size: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; letter-spacing: .055em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.qty { white-space: nowrap; font-size: 17px; font-weight: 800; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #eef3f5; color: #3f535f; font-size: 12px; font-weight: 750; }
.badge.ok { color: #08725c; background: #e4f6ef; }
.badge.warn { color: #855800; background: #fff2c9; }
.badge.bad { color: #9c2f2f; background: #ffe6e6; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbd8de; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,143,114,.13); }
textarea { min-height: 92px; resize: vertical; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); text-decoration: none; font-weight: 800; cursor: pointer; }
.button:hover { background: var(--accent-dark); }
.button.secondary { color: var(--ink); background: #e8eef1; }
.button.danger { background: var(--danger); }
.button.small { min-height: 36px; padding: 7px 11px; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.alert { margin: 0 0 18px; padding: 13px 15px; border-radius: 11px; background: #eaf2f6; }
.alert.success { color: #075f4d; background: var(--success-bg); }
.alert.danger { color: #8f2929; background: var(--danger-bg); }
.alert.warning { color: #805400; background: var(--warning-bg); }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.scan-panel { max-width: 860px; margin-inline: auto; }
.mode-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; }
.mode-grid input { position: absolute; opacity: 0; pointer-events: none; }
.mode-grid label { display: grid; place-items: center; min-height: 64px; margin: 0; padding: 8px; border: 2px solid var(--line); border-radius: 12px; text-align: center; cursor: pointer; }
.mode-grid input:checked + label { border-color: var(--accent); color: var(--accent-dark); background: #eaf8f4; }
.scan-input { min-height: 70px; font-size: 23px; font-weight: 800; letter-spacing: .03em; text-align: center; }
.scan-submit { width: 100%; min-height: 58px; font-size: 18px; }
.scan-status { margin-bottom: 18px; padding: 20px; border-radius: 14px; text-align: center; }
.scan-status.success { color: #075f4d; background: var(--success-bg); }
.scan-status.warning { color: #805400; background: var(--warning-bg); }
.token-box { padding: 15px; border: 2px dashed var(--accent); border-radius: 12px; background: #edfaf6; word-break: break-all; font: 700 14px ui-monospace, SFMono-Regular, Consolas, monospace; }
.barcode-list { display: grid; gap: 6px; min-width: 170px; }
.barcode-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; background: #f2f6f7; }
.barcode-item code { overflow-wrap: anywhere; }
.link-danger { width: 28px; height: 28px; flex: 0 0 auto; border: 0; border-radius: 7px; color: #9c2f2f; background: #ffe6e6; font-size: 20px; line-height: 1; cursor: pointer; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #1a506b, #0b2232 55%); }
.login-card { width: min(460px, 100%); padding: 32px; border-radius: 20px; background: #fff; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.login-card h1 { margin: 0 0 7px; }
.login-card .button { width: 100%; margin-top: 8px; }
.mobile-head { display: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
@media (max-width: 1050px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mode-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .mobile-head { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: #fff; background: var(--nav); }
  .mobile-head small { display: block; color: rgba(255,255,255,.65); }
  .menu-button { width: 43px; height: 43px; border: 0; border-radius: 10px; color: #fff; background: rgba(255,255,255,.1); font-size: 23px; }
  .inventory-shell { display: block; min-height: calc(100vh - 65px); }
  .inventory-sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(310px, 88vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.28); }
  .inventory-sidebar.open { transform: translateX(0); }
  .inventory-main { padding: 20px 14px 40px; }
  .page-head { display: block; }
  .page-head .actions { margin-top: 15px; }
  .grid.cards, .grid.two, .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .card { padding: 17px; border-radius: 13px; }
  th, td { padding: 10px 8px; }
}

