/* Dweniva Ops midnight workspace.
   Loaded after styles.css, experience.css and guidance.css.
   Real routes, permissions, forms and transaction states retain their behaviour. */
:root {
  color-scheme: dark;
  --workspace-bg: #101d20;
  --nav-bg: #0b171a;
  --navy: #e0ede4;
  --navy-2: #bfd7cc;
  --teal: #92e4bd;
  --teal-dark: #b8f1d2;
  --teal-soft: #24463b;
  --amber: #dfbd89;
  --red: #ffb3a5;
  --red-soft: #422e2d;
  --green: #a3e2ba;
  --green-soft: #254538;
  --blue-soft: #253f4b;
  --ink: #e6f0e9;
  --muted: #a6bcb4;
  --line: #36504d;
  --border: #36504d;
  --surface: #192c2e;
  --surface-2: #203638;
  --radius: 20px;
  --control-border: #789584;
  --shadow: 0 8px 30px #04121512;
  background: var(--workspace-bg);
  color: var(--ink);
}
html, body { background: var(--workspace-bg); color: var(--ink); }
body { line-height: 1.6; }
h1, h2, h3 { color: var(--ink); }
h1 { font-weight: 500; letter-spacing: -.045em; }
h2, h3 { font-weight: 550; }
button, a, input, select, textarea { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
}
label { color: #cadcd2; }
input, select, textarea {
  color: var(--ink);
  background: #102628;
  border: 1px solid var(--control-border);
  border-radius: 12px;
  min-height: 46px;
  accent-color: var(--teal);
}
input::placeholder, textarea::placeholder { color: #99b3a7; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px #92e4bd20; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
select option { background: #172d2e; color: var(--ink); }
input[type=checkbox], input[type=radio] { min-height: 18px; }
fieldset { min-inline-size: 0; }
button { transition: background 160ms, border-color 160ms, transform 160ms cubic-bezier(.2,.8,.2,1); }
.btn { min-height: 44px; border-radius: 12px; font-weight: 550; }
.btn-small { min-height: 44px; font-size: .8125rem; }
.btn-primary { color: #113529; background: #a4ecc7; border-color: #a4ecc7; box-shadow: inset 0 1px #effff33d, 0 5px 20px #0002; }
.btn-primary:hover { color: #113529; background: #b7f2d1; border-color: #b7f2d1; }
.btn-secondary { color: #d9eade; background: #263f3c; border-color: #6b8b79; }
.btn-secondary:hover { background: #315247; border-color: #91b89d; }
.btn-ghost { color: #b8dfc9; }
.btn-ghost:hover { background: #294a3e; }
.btn-danger { color: #ffbfaf; background: #442c29; border-color: #a07365; }
.btn-danger:hover { background: #593b33; }
.icon-btn, .profile-chip button, .mobile-close { width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: 12px; }
.icon-btn { background: #29453f; color: #c8e3d3; }
.icon-btn:hover { background: #345a4b; }
.icon-btn.danger { color: var(--red); background: var(--red-soft); }

/* Original brand artwork, including its original proportions and brass mark. */
.dweniva-logo.lockup { display: inline-flex; width: 224px; max-width: 100%; gap: 0; }
.dweniva-logo.lockup img.brand-asset { display: block; width: 100%; height: auto; object-fit: contain; }
.dweniva-logo.compact img.brand-asset { width: 42px; height: 42px; object-fit: contain; }
.brand-home { display: inline-flex; align-items: center; min-height: 44px; min-width: 0; width: 100%; border-radius: 8px; }
.sidebar-brand .dweniva-logo.lockup { width: 220px; }
.login-art-inner > .dweniva-logo.lockup { width: 310px; max-width: 100%; margin: 0 0 66px; }
.login-art-inner > .dweniva-logo.lockup img { width: 100%; height: auto; }
.password-card > .dweniva-logo.lockup { width: 232px; }
.onboarding-copy > .dweniva-logo.lockup { width: 290px; }
.dweniva-logo.mobile-brand-logo { display: none; }

/* The complete navigation stays available; mobile adds frequent destinations. */
.sidebar { width: 266px; background: var(--nav-bg); color: var(--ink); border-right: 1px solid #2e4543; box-shadow: none; }
.sidebar-brand { min-height: 103px; padding: 24px 20px 21px; border-color: #293e3c; }
.sidebar-brand span { margin-top: 0; }
.tenant-card { margin: 14px 16px 5px; padding: 14px; background: #192f2f; border-color: #3b5950; border-radius: 15px; }
.tenant-card > span { color: #adc5b8; font-size: .625rem; letter-spacing: .12em; }
.tenant-card > strong { color: #e0eee4; font-size: .875rem; white-space: normal; overflow-wrap: anywhere; }
.tenant-card > small { color: #a9c2b6; font-size: .75rem; }
.tenant-select select { min-height: 44px; background: #12282a; border-color: #789584; font-size: .8125rem; }
.tenant-select svg { top: 14px; }
.sidebar nav { padding: 10px 14px 20px; display: block; min-height: 0; scrollbar-color: #55786a transparent; }
.nav-section + .nav-section { margin-top: 10px; }
.nav-group-label, .nav-group-label:first-child { padding: 15px 12px 7px; font-size: .625rem; letter-spacing: .15em; color: #8daf9f; }
.sidebar nav a { min-height: 44px; padding: 11px 12px; font-size: .8125rem; margin-bottom: 3px; border-radius: 12px; color: #b7cfc2; }
.sidebar nav a.active { background: #22483e; color: #e2f5e8; box-shadow: inset 2px 0 var(--teal); }
.sidebar nav a.active svg { color: var(--teal); }
.sidebar nav a:hover { background: #1b3430; color: #edf9ef; }
.sidebar nav a.active:hover { background: #2b5748; }
.sidebar nav a.platform-nav { color: var(--amber); }
.sidebar-foot { padding: 15px; border-color: #2a4440; }
.profile-chip { background: #1b3530; padding: 10px; border-radius: 15px; }
.profile-chip .avatar { color: #dcf3e3; background: #37614d; border-radius: 50%; }
.profile-chip strong { color: #e6f2e9; font-size: .8125rem; }
.profile-chip span { color: #a7c2b2; }
.profile-chip button { color: #c0dacb; }
.connection { color: #b4cdbf; line-height: 1.6; }
.connection span { background: var(--teal); box-shadow: none; flex-shrink: 0; }
.connection.offline span { background: var(--amber); }
.content { margin-left: 266px; padding: 0 36px 70px; max-width: 1920px; min-width: 0; }
.content:focus-visible { outline: 2px solid var(--teal); outline-offset: -3px; }
.workspace-bar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 82px;
  margin: 0 -36px 32px;
  padding: 16px 36px;
  border-bottom: 1px solid #36504d;
  background: #112628ed;
  backdrop-filter: blur(18px);
}
.workspace-location { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }
.workspace-location strong { color: #d3e7da; font-weight: 550; font-size: .8125rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-location > span { color: #adc7b8; font-size: .75rem; white-space: nowrap; }
.workspace-location > span::before { content: "/"; margin-right: 16px; color: #6c8e7d; }
.workspace-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.workspace-actions .guide-help-button { margin-left: 0; min-height: 44px; border-radius: 13px; }
.workspace-actions .notif-root { position: relative; top: auto; right: auto; z-index: 35; }
.workspace-offline { margin: 0 0 24px; padding: 14px 18px; border: 1px solid #8b7956; border-radius: 14px; color: #ead3a6; background: #3a3d2d; font-size: .875rem; }
.mobile-quick-nav { display: none; }
.app-skip-link { background: #163f35; border-color: var(--teal); color: #e7f6e9; }
.page-header h1 { font-size: clamp(1.85rem, 3vw, 2.65rem); }
.page-header p { color: var(--muted); font-size: .875rem; }
.page-actions { gap: 9px; }
.panel, .card, .stat-card, .entity-card, .document-card { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); border-radius: 20px; }
.panel, .card { padding: 24px; }
.table-panel { padding: 0; }
.panel-title { gap: 14px; }
.panel-title h2 { font-size: 1.125rem; font-weight: 500; }
.panel-title > span { color: var(--teal); background: #274c3d; }
.stat-card { padding: 22px; min-height: 142px; }
.stat-card strong { color: #e8f5e9; font-weight: 500; font-size: clamp(1.4rem, 1.9vw, 2rem); letter-spacing: -.045em; }
.stat-card p { color: #b1c7ba; }
.stat-card .stat-icon { background: #29483b; color: #9fdfb9; border-radius: 13px; }
.stat-card.stat-warn .stat-icon { background: #494731; color: var(--amber); }
.stat-grid:not(.operational) > .stat-card:first-child { background: linear-gradient(125deg, #24513f, #173435); border-color: #4e775d; }
.stat-grid:not(.operational) > .stat-card:first-child p, .stat-grid:not(.operational) > .stat-card:first-child small { color: #b8d7c4; }
.stat-grid:not(.operational) > .stat-card:first-child .stat-icon { color: #b4efca; background: #2b5a44; }
.alert-row { background: #203a34; border-left-color: #668c74; }
.alert-row.priority-1 { background: #3d3e2b; border-left-color: var(--amber); }
.alert-action:hover { background: #2c4c3b; }
.alert-action-label { color: #b1e1c2; }
.quick-action { color: #d6e9db; background: #1b3432; border-color: #4b695a; border-radius: 17px; font-weight: 550; }
.quick-action svg { color: var(--teal); }
.quick-action:hover { background: #2c5140; border-color: #86a98d; }
th { color: #b3c9bb; background: #142829; border-bottom-color: #3d584f; font-size: .6875rem; }
td { border-bottom-color: #324b44; color: var(--ink); }
td small { color: var(--muted); }
tbody tr:hover { background: #233d35; }
.table-wrap { scrollbar-color: #648872 #13282a; }
.status { background: #304b41; color: #cedfd0; font-weight: 550; }
.status-active, .status-completed, .status-approved, .status-received, .status-healthy, .status-posted, .status-paid, .status-ready, .status-resolved, .status-closed { color: #b6e8c5; background: #284e3c; }
.status-reported, .status-requested, .status-submitted, .status-partially-received, .status-partial, .status-low, .status-credit, .status-worker, .status-trial, .status-action-required { color: #ecd098; background: #4a422c; }
.status-verified, .status-ordered, .status-dispatched, .status-manager, .status-supervisor { color: #b2d5e3; background: #2c4650; }
.status-rejected, .status-reversed, .status-cancelled, .status-inactive, .status-out, .status-disputed { color: var(--red); background: var(--red-soft); }
.status-reversal, .status-reopened { color: #d9c0ee; background: #42374e; }
.empty-state, .empty-state p { color: var(--muted); }
.empty-state strong { color: #d1e6d7; }
.empty-state svg { color: #8fb79d; }
.error-panel, .form-error { color: #ffbfae; background: #412d2a; border: 1px solid #926656; border-radius: 13px; }
.info-callout { color: #bfe0d5; background: #223e3a; border-color: #5c8270; }
.warning-callout { color: #eed1a0; background: #403c2b; border-color: #897756; }
.config-error code, .hash-code { background: #294639; color: #c2e4cc; }
.modal { background: var(--surface); color: var(--ink); border-color: #678773; }
.modal-backdrop { background: #061719bd; }
.modal > header { background: #203b34; border-color: #496655; }

/* Commercial and stock workflows use the same material, while keeping every field. */
.product-card { background: #172f30; border-color: #3c5b4d; border-radius: 17px; }
.product-card:not(:disabled):hover { background: #234339; border-color: #82b594; box-shadow: none; }
.product-card:disabled { background: #1d2c2a; }
.product-card strong { font-size: .875rem; line-height: 1.5; }
.product-card small { font-size: .75rem; }
.product-card b { color: #b7edc8; }
.category-tag { background: #294b3c; color: #b9ddc6!important; font-size: .625rem!important; }
.cart-panel { top: 100px; max-height: calc(100dvh - 122px); }
.cart-line { background: #172e30; border-color: #3c5b4e; border-radius: 14px; }
.cart-controls input, .cart-controls select, .cart-line > label select, .payment-line > *, .filters input, .filters select { min-height: 44px; }
.cart-controls label, .cart-line > label { font-size: .75rem; }
.stepper button { min-width: 36px; min-height: 44px; background: #29483c; color: #d8eadb; border-color: #789584; }
.checkout-total { background: #294b3d; border-block: 1px solid #5e806b; }
.checkout-total strong { color: #c3f0d4; font-weight: 550; }
.sale-draft-bar { background: #223d34; border-color: #53765e; border-radius: 16px; }
.sale-draft-state svg { color: #b1e4c3; }
.draft-notice { color: #bfdfca; background: #264b3b; border-color: #618f70; }
.entity-card dl { border-block-color: #3b5449; }
.document-total strong, .line-total { color: #d7eddd; }
.line-editor-row, .receive-line, .closing-summary > div, .closing-list > button, .journal-contents > div { background: #182f30; border-color: #415e4f; }
.receive-confirm, .credential-box { background: #244536; border-color: #5b846a; }
.credential-box strong { color: #deefdf; }
.file-input { background: #1d3b34; color: #bedfcb; border-color: #779b84; }
.evidence-photo { background: #102628; }
.photo-placeholder { border-color: #789584; }
.import-guidance, .note-preview { background: #3b3e2c; color: #dfceaa; border-color: #8f7f58; }
.month-close-hero { background: linear-gradient(135deg, #23483a, #1b3433 60%, #363d2e); border-color: #5f7963; }
.month-close-icon { color: #c6edcf; background: #315542; box-shadow: none; }
.month-journal-stat .stat-icon, .confirmation-emblem { color: #b6e2c4; background: #315541; }
.readiness-row.ready { border-color: #507e5e; background: #244335; }
.readiness-row.blocked { border-color: #85784f; background: #3d3d2a; }
.readiness-row.blocked > span { color: #f0d197; background: #5c4e2f; }
.export-card, .settings-summary > div { background: #203a33; border-color: #496652; }
.tabs button { min-height: 44px; }
.tabs button.active { background: #315440; color: #d4eddb; }
.subscription-banner { color: #cae3d2; background: #244339; border-color: #648573; }
.subscription-banner.state-past_due { color: #eed1a0; background: #433e2a; border-color: #8a7751; }
.subscription-banner.state-read_only, .subscription-banner.state-suspended, .subscription-banner.state-cancelled { color: #ffc0ad; background: #422e2b; border-color: #936757; }

/* Real authentication keeps email/password and verification-link semantics. */
.login-screen { background: var(--workspace-bg); }
.login-art { background: radial-gradient(ellipse at 40% 65%, #295640 0, #183b34 45%, #102629 83%); border-right: 1px solid #3b554a; }
.login-art h1 { font-weight: 500; letter-spacing: -.055em; color: #e6f2e7; }
.login-art h1 em { color: #a8e2bb; }
.login-art p { color: #b5d0bd; }
.login-art .eyebrow { color: #afcbb8; }
.login-proof { border-top-color: #5b796438; }
.login-proof svg { color: var(--amber); }
.login-proof strong { color: #d7eada; }
.login-proof small { color: #acc9b7; }
.login-panel { background: #14282b; }
.login-form { gap: 20px; }
.login-form h2 { color: #edf5ec; font-weight: 500; }
.login-form > div > p, .login-form .eyebrow { color: #afc7b8; }
.login-form label { color: #cadfd0; }
.login-form input { min-height: 52px; }
.auth-tabs { padding: 5px; background: #102426; border-color: #5a7767; border-radius: 13px; }
.auth-tabs button { color: #afc9b7; min-height: 44px; border-radius: 9px; }
.auth-tabs button.active { background: #2d5140; color: #d8f2df; box-shadow: none; }
.password-field > svg { color: #a6c6b4; top: 16px; }
.password-field button { top: 4px; color: #b7d4c3; }
.password-field input { padding-right: 57px; }
.password-hint, .auth-legal, .auth-back-link { color: #b3c9bc; }
.password-hint.valid, .password-rules li.met { color: #a4deb9; }
.auth-back-link:hover, .linklike { color: #b6e6c7; }
.linklike { min-height: 44px; }
.verification-card { background: #234337; color: #cbe2d1; border-color: #70977e; border-radius: 18px; }
.verification-card > svg { color: var(--teal); }
.onboarding-screen, .onboarding-panel { background: #14282b; }
.onboarding-copy { background: radial-gradient(ellipse at 10% 70%, #315c43, #173c35 55%, #102729); }
.onboarding-copy h1 { color: #e5f2e5; }
.plan-picker button { background: #192f30; border-color: #5e7f6b; }
.plan-picker button.selected { background: #2c503d; border-color: #b5ddb8; box-shadow: 0 0 0 2px #8bddab26; }
.plan-picker span { color: #c6e8d0; }
.password-card { border-color: #4f715d; }
.brand-mark { color: var(--teal); background: #2a4e3c; box-shadow: none; }

/* Help remains an optional, accessible guide backed by real progress. */
.guide-help-button { color: #c9e2d1; border-color: #678573; background: #263f39; font-weight: 550; min-width: 44px; min-height: 44px; }
.guide-help-button:hover { color: #ebf8ee; background: #335841; border-color: #96ba9d; }
.guide-home { background: linear-gradient(110deg, #274b3a, #1a3431); border-color: #5d7e65; border-radius: 20px; }
.guide-home-icon { background: #335e44; color: #b4e1bd; }
.guide-home strong { color: #e0ecdc; font-weight: 550; }
.guide-home p { color: #b4cbbc; }
.guide-dialog { color: var(--ink); }
.guide-card { background: #192f30; color: var(--ink); border-color: #678773; box-shadow: 0 28px 85px #001b2066; }
.guide-dialog-header, .guide-dialog-footer { background: #203c33; border-color: #496552; }
.guide-dialog-header .icon-btn { color: #c8e4d1; }
.guide-dialog h3, .guide-dialog h4 { color: #e3f1e5; }
.guide-eyebrow { color: #c0d9ae; }
.guide-facts span, .guide-count, .guide-topic summary small { color: #c1ddc7; background: #30533f; }
.guide-caption, .guide-tour-summary p:not(.guide-eyebrow), .guide-task p { color: #b4c8ba; }
.guide-tour-summary { background: #213f33; border: 1px solid #526e54; }
.guide-progress, .guide-progress::-webkit-progress-bar { background: #3d5d4c; }
.guide-progress::-webkit-progress-value, .guide-progress::-moz-progress-bar { background: #a4dfb7; }
.guide-task, .guide-topic { border-color: #3e594c; }
.guide-task strong { color: #d6e7d9; }
.guide-task-check { border-color: #779681; }
.guide-task.is-done .guide-task-check { background: #b1e4be; color: #173c2c; border-color: #b1e4be; }
.guide-optional { color: #b3c5b7; }
.guide-search { background: #102628; border-color: #789584; color: #c6ddcf; }
.guide-search input { color: var(--ink); background: transparent; }
.guide-tip { background: #284636; color: #c8ddcb; border-left-color: #9ebb91; }
.guide-tip p, .guide-tip svg { color: #c1d9c2; }
.guide-instructions li::marker { color: var(--teal); }
.guide-dialog-tour .guide-dialog-header { background: #24513b; }
.guide-step-meta { color: #bbd9be; }
.guide-sync { color: #efd09e; background: #463f29; }
.guide-dialog button { min-height: 44px; }

/* Notifications share the header, with phone alerts and actions kept intact. */
.notif-fab { color: #cee5d5; border-color: #5d7c6c; background: #233d38; box-shadow: none; }
.notif-fab:hover { background: #315541; box-shadow: none; transform: none; }
.notif-badge { background: #9c4f40; color: #fff9f0; border: 2px solid #14282a; }
.notif-panel { background: #1a3031; border-color: #5d7d69; box-shadow: 0 24px 65px #04161477; }
.notif-panel > header { background: #203d33; }
.notif-markall { color: #cae6d4; background: #305740; min-width: 44px; min-height: 44px; }
.notif-item.unread { background: #244437; box-shadow: inset 3px 0 var(--teal); }
.notif-kind.low_stock { color: #e7c58f; background: #4b442e; }
.notif-kind.morning_briefing { color: #b2d5de; background: #304955; }
.notif-wa { color: #c7e7cf!important; background: #355f43; min-height: 44px; }
.notif-wa:hover { background: #42734f; }
.notif-push { background: #1e3a32; color: #c6e5d2; min-height: 48px; }
.notif-push.active { color: #c6e9cf; background: #2a503b; }
.toast { background: #284b3c; border: 1px solid #698d75; color: #e7f6e7; border-radius: 15px; }
.toast button { min-width: 44px; min-height: 44px; }
.update-banner { border-color: #68836d; background: #223f34; }

/* The receipt stays paper coloured both on screen and when printed. */
.receipt {
  color-scheme: light;
  --ink: #18252b;
  --muted: #52646a;
  --navy: #123f45;
  --line: #bdccc5;
  --teal: #0f5d5e;
  --teal-dark: #0b494a;
  --red: #b52e40;
  background: white;
  color: #18252b;
}
.receipt h1, .receipt h2, .receipt h3, .receipt strong, .receipt td { color: #18252b; }
.receipt th { color: #33464e; background: transparent; }
.receipt dt, .receipt small, .receipt .muted { color: #52646a; }
.receipt tbody tr:hover { background: #f5f8f6; }
.receipt .receipt-warning { color: #a52838; border-color: #a52838; }

@media (max-width: 1200px) {
  .content { padding-inline: 26px; }
  .workspace-bar { padding-inline: 26px; margin-inline: -26px; gap: 14px; }
  .workspace-location { flex-direction: column; align-items: flex-start; gap: 2px; }
  .workspace-location > span::before { content: none; }
}
@media (max-width: 980px) {
  .sidebar { width: min(320px, calc(100vw - 38px)); z-index: 80; }
  .sidebar-scrim { z-index: 75; background: #04181bca; }
  .content { margin-left: 0; padding: 0 24px 126px; }
  .workspace-bar { margin-inline: -24px; padding: 14px 20px; min-height: 76px; gap: 12px; }
  .workspace-bar .mobile-menu { position: static; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; background: #25463a; border: 1px solid #72927d; color: #d0e7d8; border-radius: 13px; }
  .mobile-close { display: grid; }
  .sidebar-brand { gap: 7px; }
  .sidebar-brand .brand-home { min-width: 0; }
  .sidebar-brand .dweniva-logo.lockup { width: 220px; max-width: 100%; }
  .workspace-actions { gap: 7px; }
  .workspace-actions .guide-help-button { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .workspace-actions .guide-help-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .mobile-quick-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    z-index: 50;
    left: 14px;
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: 650px;
    margin-inline: auto;
    padding: 6px;
    border: 1px solid #6e8b71;
    border-radius: 25px;
    background: #234337f2;
    backdrop-filter: blur(20px);
    box-shadow: 0 12px 36px #0006, inset 0 1px #d0e8c811;
  }
  .mobile-quick-nav a, .mobile-quick-nav button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-width: 0; min-height: 56px; padding: 8px 1px; border: 0; border-radius: 19px; background: transparent; color: #bad2bc; text-decoration: none; }
  .mobile-quick-nav span { max-width: 100%; font-size: .6875rem; line-height: 1.25; font-weight: 500; letter-spacing: -.02em; }
  .mobile-quick-nav svg { width: 19px; height: 19px; }
  .mobile-quick-nav .active { background: #b2e8c1; color: #173b2a; box-shadow: 0 3px 12px #051e2226; }
  .mobile-quick-nav a:focus-visible, .mobile-quick-nav button:focus-visible { outline-offset: -3px; }
  .toast-stack { bottom: calc(98px + env(safe-area-inset-bottom)); }
  .update-banner { bottom: calc(94px + env(safe-area-inset-bottom)); }
  .cart-panel { top: 92px; max-height: calc(100dvh - 195px); }
  .guide-dialog-tour { bottom: max(100px, calc(98px + env(safe-area-inset-bottom))); }
}
@media (max-width: 760px) {
  .content { padding-inline: 18px; }
  .workspace-bar { margin: 0 -18px 27px; padding: 12px 13px; gap: 9px; min-height: 72px; }
  .workspace-location { overflow: hidden; }
  .workspace-location strong { display: block; width: 100%; max-width: none; font-size: .75rem; }
  .workspace-location > span { font-size: .6875rem; }
  .workspace-actions { gap: 5px; }
  .workspace-actions .command-trigger { width: 44px; min-width: 44px; min-height: 44px; padding: 0; flex-shrink: 0; justify-content: center; }
  .workspace-actions .command-trigger > span, .workspace-actions .command-trigger > kbd { display: none; }
  .workspace-actions .notif-panel { position: fixed; right: 12px; top: 78px; max-height: calc(100dvh - 178px); width: calc(100vw - 24px); }
  .panel, .card { padding: 19px; }
  .table-panel { padding: 0; }
  .stat-card { padding: 17px; border-radius: 17px; }
  .stat-card strong { font-size: 1.55rem; }
  .page-header { gap: 16px; }
  .page-header h1 { font-size: 2rem; }
  .page-header p { font-size: .8125rem; }
  .page-actions .dashboard-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; width: 100%; gap: 10px; }
  .dashboard-filters > select { grid-column: 1 / -1; width: 100%; }
  .dashboard-filters > label { min-width: 0; width: 100%; }
  .dashboard-filters input { width: 100%; min-width: 0; }
  .two-column { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.compact { min-width: 0; }
  input, select, textarea { font-size: 16px; }
  .filters input, .filters select, .cart-controls input, .cart-controls select { font-size: 16px; }
  .btn { white-space: normal; }
  .row-actions { min-width: 0; }
  .checkout { grid-template-columns: minmax(0, 1fr); }
  .cart-panel { position: static; max-height: none; }
  .stepper button { min-width: 44px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card { min-height: 166px; }
  .product-picker { min-height: 0; }
  .payment-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .payment-line > :first-child { grid-column: 1/-1; }
  .line-editor-row, .line-editor-row.transfer-edit { grid-template-columns: minmax(0, 1fr); }
  .receive-check { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .receive-check > :first-child { grid-column: 1/-1; }
  .modal, .modal-body, .modal-body > * { min-width: 0; }
  .modal { margin: 0; width: 100%; max-height: calc(100dvh - 24px); border-radius: 22px; background: var(--surface); }
  dialog.modal-backdrop { padding: 12px; }
  .modal > header, .modal-body { padding: 20px; }
  .modal > header h2 { font-size: 1.15rem; overflow-wrap: anywhere; }
  .detail-list { grid-template-columns: minmax(0, 1fr); }
  .login-panel { padding: 30px 23px; background: radial-gradient(ellipse at 90% 0, #36574224, transparent 60%), #14282b; }
  .login-form .mobile-brand-logo { display: inline-flex; width: 232px; margin-bottom: 13px; }
  .login-form > small { text-align: left; }
  .guide-dialog, .guide-card { max-width: calc(100vw - 20px); min-width: 0; }
  .guide-dialog-body { min-width: 0; overflow-wrap: anywhere; }
  .guide-home { padding: 17px; }
  .guide-task > div { min-width: 0; }
  .guide-dialog-tour { max-height: calc(100dvh - 140px); }
  .guide-dialog-tour .guide-card { max-height: calc(100dvh - 140px); }
  .onboarding-panel { padding: 28px 20px; }
}
@media (max-width: 380px) {
  .workspace-location { max-width: 86px; }
  .workspace-bar { gap: 7px; }
  .workspace-actions { gap: 4px; }
  .mobile-quick-nav { left: 10px; right: 10px; padding: 5px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 1.3rem; }
  .product-card { padding: 12px; }
  .cart-controls { grid-template-columns: minmax(0, 1fr); }
  .modal-body { padding: 18px; }
}
@media (prefers-reduced-transparency: reduce) {
  .workspace-bar { backdrop-filter: none; background: #13292b; }
  .mobile-quick-nav { backdrop-filter: none; background: #234337; }
  .sidebar-scrim, .modal-backdrop, .guide-dialog::backdrop { backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
}
@media print {
  :root {
    color-scheme: light;
    --workspace-bg: white; --ink: #18252b; --muted: #52646a; --navy: #123f45;
    --surface: white; --surface-2: #f4f7f5; --line: #bec9c3; --teal: #0f5d5e;
    --teal-dark: #0b494a; --red: #b52e40; --green: #216943;
  }
  html, body { background: white!important; color: #18252b!important; }
  .sidebar, .sidebar-scrim, .workspace-bar, .mobile-quick-nav, .mobile-menu, .toast-stack, .update-banner { display: none!important; }
  .content { margin: 0!important; padding: 0!important; }
  .receipt, .receipt h1, .receipt h2, .receipt h3, .receipt td, .receipt strong { color: #18252b!important; background: white!important; }
  .receipt th, .receipt dt, .receipt small, .receipt .muted { color: #52646a!important; background: white!important; }
  .modal, .modal-body, dialog.modal-backdrop { background: white!important; color: #18252b!important; }
}

