@layer reset, app;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { min-width: 280px; min-height: 100%; }
  body { margin: 0; min-height: 100vh; }
  button, input, select, textarea { font: inherit; }
  button { color: inherit; }
  [hidden] { display: none !important; }
  a { color: inherit; }
  h1, h2, h3, p { margin: 0; }
  :focus-visible { outline: 3px solid #5e9dff; outline-offset: 3px; }
}

@layer app {
  :root {
    color-scheme: light;
    --bg: #f3f6fb;
    --surface: #fff;
    --ink: #14223a;
    --muted: #506481;
    --line: #e0e8f3;
    --primary: #235bdc;
    --primary-dark: #1848bb;
    --control-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23506481' stroke-width='1.6'/%3E%3C/svg%3E");
    --nav-bg: #101c31;
    --nav-ink: #bdcbe1;
    --radius: 17px;
    --shadow: 0 4px 18px #1f447309;
    font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
  }
  :root:lang(ar) { font-family: Tahoma, "Segoe UI", Arial, sans-serif; }
  body { overflow-wrap: anywhere; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  button:disabled { cursor: default; opacity: .61; }
  svg { flex: none; vertical-align: middle; }
  .skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 12px; z-index: 9; background: #fff; padding: 8px 14px; transform: translateY(-200%); }
  .skip-link:focus { transform: none; }
  .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .app-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; align-items: start; }
  .sidebar { background: var(--nav-bg); color: var(--nav-ink); position: sticky; top: 0; min-height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: auto; padding: 28px 14px 16px; z-index: 5; scrollbar-width: thin; }
  .brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: #fff; font: 740 1.12rem/1.2 "Segoe UI", system-ui, sans-serif; }
  .brand-mark { flex: none; width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#4483ff,#2152d3); border: 1px solid #75a0ff; border-radius: 12px; box-shadow: 0 3px 12px #133c9988; }
  .brand-mark:has(.instance-logo) { background: #fff; }
  .instance-logo { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
  .sidebar > .brand { margin: 0 9px 33px; }
  .sidebar .nav-section + .nav-section { margin-block-start: 24px; }
  .nav-label { margin: 0 10px 7px; font-size: .72rem; font-weight: 700; color: #9aaccc; letter-spacing: .075em; }
  :root:lang(ar) .nav-label { letter-spacing: 0; }
  .nav-link, .side-install { display: flex; align-items: center; text-decoration: none; gap: 11px; width: 100%; color: inherit; font-size: .9rem; min-height: 41px; padding: 8px 11px; border: 1px solid transparent; border-radius: 8px; text-align: start; transition: background .16s, color .16s; }
  .nav-link svg { color: #9db5d9; }
  .nav-link:hover, .side-install:hover { background: #1c2a43; color: #fff; }
  .nav-link[aria-current="page"] { color: #f4f8ff; font-weight: 650; background: #244478; border-color: #3b5990; }
  .nav-link[aria-current="page"] svg { color: #b9d6ff; }
  .sidebar-foot { margin-block-start: auto; padding-block-start: 24px; }
  .developer-credit { display: inline-flex; align-items: center; gap: .65rem; max-width: 100%; min-height: 44px; margin-block-start: 1rem; padding-block: .3rem; color: var(--muted); text-decoration: none; font-size: .78rem; line-height: 1.4; }
  .developer-credit img { flex: none; width: 32px; height: 32px; background: #171b22; border-radius: 7px; padding: 4px; }
  .developer-credit span { min-width: 0; }
  .developer-credit bdi { white-space: nowrap; }
  .developer-credit b { color: var(--ink); }
  .developer-credit .developer-phone { display: block; width: fit-content; }
  .developer-credit:hover .developer-phone, .developer-credit:focus-visible .developer-phone { text-decoration: underline; }
  .sidebar .developer-credit { color: var(--nav-ink); }
  .sidebar .developer-credit b { color: #fff; }
  .side-install { background: transparent; border-color: #405472; color: #d9e6fa; }
  .shell-column { min-width: 0; }
  .topbar { height: 70px; background: var(--surface); border-block-end: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-inline: clamp(19px, 3vw, 42px); position: sticky; top: 0; z-index: 3; }
  .topbar-start, .topbar-actions { display: flex; align-items: center; gap: 11px; min-width: 0; }
  .topbar-actions { flex: none; }
  .topbar-crumb { display: flex; align-items: center; flex: none; gap: 6px; color: var(--muted); font-weight: 600; font-size: .9rem; }
  .topbar-logo { display: grid; place-items: center; color: #3663a4; }
  .topbar-logo:has(.instance-logo) { width: 26px; height: 26px; border-radius: 6px; }
  .scope-label { border-inline-start: 1px solid var(--line); margin-inline-start: 3px; padding-inline-start: 12px; overflow: hidden; min-width: 0; }
  .scope-label select { border: 0; color: var(--ink); background-color: transparent; font-weight: 650; font-size: .86rem; width: 100%; min-height: 36px; }
  .topbar-button { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 5px 9px; color: var(--ink); font-size: .83rem; font-weight: 680; }
  .topbar-button:hover { border-color: #aec5e9; background: #f6f9ff; }
  .topbar-inbox { position: relative; text-decoration: none; min-width: 36px; }
  .topbar-inbox[aria-current="page"] { background: #edf4ff; border-color: #aec5e9; }
  .inbox-badge { position: absolute; inset-block-start: -5px; inset-inline-end: -5px; min-width: 16px; height: 16px; padding-inline: 3px; display: grid; place-items: center; border-radius: 12px; border: 1px solid #fff; color: white; background: #2157ca; font-size: .65rem; line-height: 1; }
  .language-select { flex: none; }
  .language-select select { min-height: 36px; padding: 4px 24px 4px 7px; max-width: 102px; font-size: .8rem; background: var(--surface) var(--control-chevron) no-repeat right 6px center; }
  [dir="rtl"] .language-select select { padding: 4px 7px 4px 24px; background-position: left 6px center; }
  .connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #168658; box-shadow: 0 0 0 3px #d8f5e8; }
  [data-online="false"] .connection-dot { background: #b56b12; box-shadow: 0 0 0 3px #f5e8d4; }
  .queue-badge { color: #1647b8; background: #e8efff; border-radius: 12px; min-width: 20px; padding-inline: 4px; }
  .avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid #c7d8f4; background: #eaf1fe; color: #214983; border-radius: 50%; font-weight: 750; text-transform: uppercase; }
  .account-menu { position: relative; }
  .account-menu summary { list-style: none; cursor: pointer; border-radius: 50%; }
  .account-menu summary::-webkit-details-marker { display: none; }
  .account-content { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 10px); width: max-content; min-width: 175px; max-width: calc(100vw - 35px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px; box-shadow: 0 12px 35px #0f244225; z-index: 7; }
  .account-content p { color: var(--muted); font-size: .84rem; margin-block-end: 10px; }
  .nav-toggle { display: none; }
  .workspace-main { max-width: 1480px; margin-inline: auto; min-width: 0; padding: clamp(22px, 3.2vw, 42px); }
  .page-header { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-block-end: 21px; }
  .page-title { font-size: clamp(1.64rem, 3.4vw, 2.55rem); line-height: 1.2; letter-spacing: -.045em; font-weight: 740; }
  :root:lang(ar) .page-title, :root:lang(ar) .hero-title { letter-spacing: 0; }
  .page-header p, .muted { color: var(--muted); }
  .page-header p { margin-block-start: 6px; }
  .date-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; font-size: .84rem; white-space: nowrap; }
  .scan-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(275px, 1fr); gap: 17px; align-items: stretch; }
  .scan-primary { min-width: 0; display: flex; flex-direction: column; }
  .workspace-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
  .workspace-card h2, .section-title { font-size: 1.18rem; line-height: 1.35; font-weight: 730; }
  .card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-block-end: 13px; }
  .card-link { color: #174ebc; font-weight: 670; font-size: .87rem; text-decoration: none; }
  .card-link:hover { text-decoration: underline; }
  .scan-card { padding: 0; overflow: hidden; flex: 1; }
  .scan-hero { isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; min-height: 203px; padding: clamp(18px, 3vw, 31px); color: #fff; background: linear-gradient(114deg, #17367f 5%, #2059d4 69%, #205cc9 100%); overflow: hidden; }
  .scan-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .26; background-image: radial-gradient(#b3ccff 1px, transparent 1px); background-size: 17px 17px; mask-image: linear-gradient(90deg, transparent, #000); }
  [dir="rtl"] .scan-hero::after { mask-image: linear-gradient(270deg, transparent, #000); }
  .hero-content { min-width: 0; }
  .scan-hero .hero-title { font-size: clamp(1.32rem, 2.8vw, 2.05rem); letter-spacing: -.04em; font-weight: 720; line-height: 1.15; }
  .hero-content p { margin-block: 7px 17px; color: #e0eaff; font-size: .94rem; }
  .scan-hero .button { color: #174092; border-color: #fff; background: #fff; }
  .scan-hero .button:hover { background: #e9f2ff; }
  .barcode-graphic { width: clamp(108px, 21%, 178px); min-width: 108px; height: 98px; margin-inline-end: 3%; display: grid; place-items: center; flex: none; position: relative; color: #b8d6ff; background: linear-gradient(currentColor,currentColor) left top / 22px 2px, linear-gradient(currentColor,currentColor) left top / 2px 22px, linear-gradient(currentColor,currentColor) right top / 22px 2px, linear-gradient(currentColor,currentColor) right top / 2px 22px, linear-gradient(currentColor,currentColor) left bottom / 22px 2px, linear-gradient(currentColor,currentColor) left bottom / 2px 22px, linear-gradient(currentColor,currentColor) right bottom / 22px 2px, linear-gradient(currentColor,currentColor) right bottom / 2px 22px; background-repeat: no-repeat; border-radius: 3px; }
  .barcode-graphic::before { content: ""; width: 72%; height: 49%; background: repeating-linear-gradient(90deg,#e5f0ff 0 3px,transparent 3px 7px,#c8e2ff 7px 8px,transparent 8px 11px,#eef5ff 11px 16px,transparent 16px 19px,#bddaff 19px 21px,transparent 21px 26px); opacity: .88; }
  .barcode-graphic::after { content: ""; position: absolute; inset-inline: -5px; inset-block-start: 50%; height: 1.5px; background: #7af3e6; box-shadow: 0 0 12px 3px #72fff991; animation: scanline 4s ease-in-out infinite; }
  @keyframes scanline { 0%, 100% { transform: translateY(-18px); } 50% { transform: translateY(18px); } }
  .scan-entry { padding: 19px clamp(15px, 2.5vw, 26px); }
  .scan-entry label { display: block; font-size: .89rem; font-weight: 680; margin-block-end: 6px; }
  .scan-field { display: flex; gap: 8px; }
  .scan-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
  .scan-input-wrap svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: #557297; pointer-events: none; }
  .scan-input-wrap input { width: 100%; min-width: 0; padding-inline-start: 39px; }
  .scan-input-wrap input:not(:placeholder-shown) { direction: ltr; text-align: end; }
  [dir=ltr] .scan-input-wrap input:not(:placeholder-shown) { text-align: start; }
  .scan-hint { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: .8rem; margin-block-start: 9px; }
  .scan-hint kbd { direction: ltr; font: inherit; border: 1px solid var(--line); border-radius: 5px; padding-inline: 5px; white-space: nowrap; }
  .scan-section { margin-block-start: 18px; }
  .scan-section .section-title { margin-block-end: 10px; }
  .scanned-actions { margin-block-end: 11px; }
  .action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
  .quick-action { text-align: start; display: flex; gap: 10px; align-items: center; font-size: .95rem; font-weight: 680; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 13px 11px; min-height: 65px; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, background .15s; }
  .quick-action:hover { transform: translateY(-2px); background: #f8fbff; border-color: #a6bfe9; }
  .action-icon { width: 34px; height: 34px; border-radius: 9px; background: #e9f0ff; color: #2358b5; display: grid; place-items: center; flex: none; }
  .action-icon.receipt { background: #e3f5ed; color: #067249; }
  .action-icon.dispatch { background: #fff0df; color: #8d3c02; }
  .action-icon.transfer { background: #e8efff; color: #2857c6; }
  .action-icon.reservation { background: #f0e9ff; color: #60419d; }
  .action-icon.damage { background: #ffe9e5; color: #a33b30; }
  .activity-card { display: flex; flex-direction: column; min-height: 275px; }
  .scan-grid:has(#scan-result:not(:empty)) .activity-card { align-self: start; }
  .activity-list, .warehouse-list { list-style: none; padding: 0; margin: 0; }
  .activity-list li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; border-block-end: 1px solid var(--line); padding-block: 10px; }
  .activity-list li:last-child { border-block-end: 0; }
  .activity-list strong, .warehouse-list strong { display: block; font-size: .9rem; font-weight: 690; line-height: 1.3; }
  .activity-list small, .warehouse-list small { color: var(--muted); font-size: .78rem; }
  .activity-value { text-align: end; font-variant-numeric: tabular-nums; }
  .warehouse-list { display: grid; gap: 10px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .warehouse-list li > a { padding: 10px; border-radius: 9px; border: 1px solid var(--line); display: flex; gap: 10px; align-items: center; text-decoration: none; }
  .warehouse-list a:hover { border-color: #a7c0ee; }
  .empty-state { color: var(--muted); padding: 16px 0; }
  .activity-card .empty-state { margin: auto; padding-inline: 12px; text-align: center; }
  .scanned-header { display: flex; gap: 11px; align-items: center; margin-block-end: 14px; }
  .scanned-header .action-icon { width: 43px; height: 43px; }
  .scanned-header h2 { font-size: 1.3rem; }
  .scanned-header > .button { margin-inline-start: auto; }
  .balance-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-block: 10px 15px; }
  .balance-strip div { background: #f2f6ff; border: 1px solid #e2eaf8; padding: 11px; border-radius: 10px; }
  .balance-strip span { display: block; font-size: .8rem; color: var(--muted); }
  .balance-strip strong { display: block; font-size: 1.3rem; font-weight: 740; font-variant-numeric: tabular-nums; }
  .balance-strip dd { margin: 0; }
  .scan-state { margin-block-start: 10px; }
  .scan-state:empty { display: none; }
  .scan-context { display: flex; gap: 7px; align-items: center; margin-block-end: 11px; font-size: .88rem; flex-wrap: wrap; }
  .queue-list { display: grid; gap: 8px; margin-block: 12px; }
  .queue-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px; flex-wrap: wrap; }
  .queue-row .muted { font-size: .84rem; }

  .button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 42px; padding: 8px 13px; border-radius: 9px; border: 1px solid #d7e3f3; background: var(--surface); color: #214473; font-weight: 660; font-size: .9rem; line-height: 1.35; text-align: center; text-decoration: none; transition: border-color .14s, background .14s; }
  .button:hover { background: #f0f6ff; border-color: #b8cbea; }
  .button-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
  .button-primary:hover { color: #fff; background: var(--primary-dark); border-color: var(--primary-dark); }
  .button-quiet { color: #174ebc; background: #f1f6ff; border-color: transparent; }
  .button-danger { color: #9b2d23; background: #fff4f1; border-color: #f3cfc7; }
  .icon-button { width: 38px; min-width: 38px; padding: 0; }
  .button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  input:not([type="checkbox"],[type="radio"]), select, textarea { color: var(--ink); background-color: #fff; border: 1px solid #bdcce2; border-radius: 8px; min-height: 43px; min-width: 0; padding: 7px 11px; }
  input::placeholder, textarea::placeholder { color: #526784; }
  input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; }
  select { appearance: none; padding-inline-end: 35px; background-image: var(--control-chevron); background-repeat: no-repeat; background-position: right 11px center; }
  [dir="rtl"] select { background-position: left 11px center; }
  .scan-input-wrap input#scan-code { padding-inline-start: 39px; }
  [dir="rtl"] .scan-input-wrap input#scan-code { padding-right: 39px; padding-left: 11px; }
  .scope-label select { background-position: right 3px center; padding-inline: 1px 19px; }
  [dir="rtl"] .scope-label select { background-position: left 3px center; }
  .form-grid, .split-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .form-grid { margin-block: 13px; }
  .field { display: grid; gap: 4px; align-content: start; min-width: 0; font-size: .9rem; font-weight: 640; }
  .field small { font-weight: 400; color: var(--muted); }
  .field-wide { grid-column: 1 / -1; }
  .checkbox-line { display: flex; gap: 6px; align-items: center; }
  .field-error { color: #942c24; font-size: .88rem; }
  .filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-block-end: 14px; }
  .filters .field { flex: 1 1 140px; }
  .table-wrap { overflow-x: auto; scrollbar-width: thin; max-width: 100%; }
  .data-table { border-collapse: collapse; width: 100%; text-align: start; font-size: .9rem; }
  .data-table th, .data-table td { text-align: start; padding: 10px 8px; border-block-end: 1px solid var(--line); }
  .data-table th { color: var(--muted); font-weight: 650; background: #f5f8fd; }
  .chip { display: inline-flex; align-items: center; gap: 5px; background: #edf3ff; color: #214b85; border: 1px solid #e1eafe; font-size: .79rem; font-weight: 680; border-radius: 30px; padding: 3px 8px; }
  .chip-warning { background: #fff4df; border-color: #f8e6bd; color: #805002; }
  .chip-success { background: #e2f6ec; border-color: #d1eddc; color: #086743; }
  .notice { border: 1px solid #d7e4fe; color: #244d84; background: #eef5ff; padding: 10px 13px; border-radius: 9px; font-size: .9rem; }
  .notice.error { border-color: #f2c6bf; color: #922820; background: #fff2ef; }
  .notice.warning { border-color: #f7e0a9; color: #7c4d00; background: #fff6e2; }
  .notice.success { border-color: #c6ebd8; color: #0d643f; background: #eefaf3; }
  .dialog-panel { border: 1px solid var(--line); border-radius: 17px; width: min(560px, calc(100% - 26px)); max-height: calc(100dvh - 26px); margin: auto; max-width: none; padding: clamp(14px,3vw,24px); color: var(--ink); background: var(--surface); box-shadow: 0 18px 80px #07193640; }
  .dialog-panel::backdrop { background: #0d1929aa; }
  .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block-end: 12px; }
  .dialog-head h2 { font-size: 1.25rem; line-height: 1.4; }
  .camera-window { background: #0e1929; border-radius: 12px; overflow: hidden; position: relative; min-height: 145px; margin-block: 12px; }
  .camera-window video { width: 100%; aspect-ratio: 4 / 3; max-height: 54dvh; display: block; object-fit: contain; }
  .camera-window::after { content: ""; position: absolute; inset: 24% 16%; border: 2px solid #78fddd; border-radius: 11px; pointer-events: none; box-shadow: 0 0 0 120px #101c3129; }
  .announcements { position: fixed; inset-inline-end: 16px; inset-block-end: 16px; width: min(390px,calc(100% - 32px)); display: grid; gap: 6px; z-index: 8; pointer-events: none; }
  .announcements p { box-shadow: 0 12px 28px #0a23372a; }
  .auth-layout { display: grid; min-height: 100vh; min-height: 100dvh; grid-template-columns: minmax(280px, 2fr) minmax(360px, 3fr); }
  .auth-aside { background: radial-gradient(ellipse at 90% 90%, #244d9c, #101c31 68%); color: white; display: flex; flex-direction: column; align-items: flex-start; gap: 32px; padding: clamp(24px,6vw,100px); }
  .auth-aside .brand { font-size: 1.8rem; }
  .auth-aside .barcode-graphic { margin: auto; width: min(55%,215px); height: 142px; }
  .auth-content { display: grid; align-content: center; padding: clamp(23px,5vw,68px); justify-items: center; position: relative; }
  .auth-language { position: absolute; inset-block-start: 20px; inset-inline-end: 20px; }
  .auth-card { width: min(100%,410px); }
  .auth-card form { display: grid; gap: 12px; margin-block-start: 19px; }
  .auth-card .button-primary { width: 100%; }
  .auth-card > p { margin-block-start: 9px; color: var(--muted); }
  .auth-secret { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
  .admin-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
  .admin-grid .quick-action { min-height: 72px; }
  .admin-detail { margin-block-start: 14px; }
  .detail-list { display: grid; grid-template-columns: minmax(96px,1fr) 2fr; gap: 7px 14px; margin: 13px 0; }
  .detail-list dt { color: var(--muted); }
  .detail-list dd { margin: 0; font-weight: 640; }
  @media (max-width: 1150px) {
    .scan-grid { grid-template-columns: minmax(0,1.5fr) minmax(245px,1fr); }
    .app-shell { grid-template-columns: 198px minmax(0,1fr); }
    .scope-label { max-width: 160px; }
  }
  @media (max-width: 935px) {
    .app-shell { grid-template-columns: minmax(0,1fr); }
    .sidebar { display: none; }
    .sidebar.sidebar-open { display: flex; position: fixed; inset-block: 0; inset-inline-start: 0; width: min(260px,80vw); box-shadow: 0 0 0 100vmax #101c3180; }
    .nav-toggle { display: inline-flex; }
  }
  @media (max-width: 690px) {
    .scan-grid, .split-grid { grid-template-columns: minmax(0,1fr); }
    .activity-card { min-height: 180px; }
    .page-header { align-items: start; }
    .date-pill { display: none; }
    .topbar { height: 62px; padding-inline: 13px; }
    .topbar-crumb { display: none; }
    .topbar-crumb-label { display: none; }
    .scope-label { border: 0; margin: 0; padding: 0; }
    .topbar:has(.instance-logo) {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 5px 8px;
      height: auto;
      padding-block: 9px 5px;
    }
    .topbar:has(.instance-logo) .topbar-start { display: contents; }
    .topbar:has(.instance-logo) .nav-toggle { grid-area: 1 / 1; }
    .topbar:has(.instance-logo) .topbar-crumb { display: flex; grid-area: 1 / 2; }
    .topbar:has(.instance-logo) .topbar-actions { grid-area: 1 / 3; }
    .topbar:has(.instance-logo) .scope-label {
      grid-area: 2 / 1 / 3 / -1;
      max-width: none;
      border-block-start: 1px solid var(--line);
    }
    .topbar:has(.instance-logo) .scope-label select { min-height: 29px; }
    .workspace-main { padding: 18px 13px 24px; }
    .scan-hero { min-height: 178px; }
    .warehouse-list, .admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .auth-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-aside { padding: 18px 24px; }
    .auth-aside .barcode-graphic { display: none; }
    .auth-content { padding-block-start: 72px; }
  }
  @media (max-width: 390px) {
    .topbar, .topbar-start, .topbar-actions { gap: 5px; }
    .topbar-button { padding-inline: 6px; }
    .connection-label { display: none; }
    .topbar-inbox { min-width: 32px; }
    .scan-hero { padding: 16px; }
    .barcode-graphic { min-width: 81px; height: 72px; }
    .scan-hint kbd { display: none; }
    .balance-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .warehouse-list { grid-template-columns: minmax(0,1fr); }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  }
}

