:root {
  --theme-navy: #11273c;
  --theme-ink: #142c41;
  --theme-slate: #576b7d;
  --theme-line: #d6e1e6;
  --theme-teal: #00776e;
  --theme-mint: #c2f2df;
  --theme-paper: #f3f6f6;
  --bs-primary: #00776e;
  --bs-primary-rgb: 0, 119, 110;
  --bs-body-color: #142c41;
  --bs-body-bg: #f3f6f6;
  color-scheme: light;
}
html { font-size: 15px; min-height: 100%; }
body { margin: 0; color: var(--theme-ink); font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.5; background: var(--theme-paper); }
a { color: var(--theme-teal); }
a:hover { color: #005c55; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #de9c34; outline-offset: 2px; }
h1 { font-weight: 730; letter-spacing: -.045em; line-height: 1.13; }
h2, h3 { letter-spacing: -.025em; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1035; width: 248px; display: flex; flex-direction: column; color: #f6fcff; background: var(--theme-navy); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px; border-bottom: 1px solid #31475a; color: #fff; text-decoration: none; font-size: 21px; font-weight: 730; letter-spacing: -.045em; white-space: nowrap; }
.sidebar-brand:hover { color: #fff; }
.brand-mark { width: 35px; height: 35px; flex: none; color: #87dec1; }
.sidebar-nav { overflow: auto; flex: 1; padding: 17px 12px; }
.nav-group { margin-bottom: 8px; }
.nav-group summary { display: flex; justify-content: space-between; padding: 8px 10px; list-style: none; color: #abbfcf; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '⌄'; font-size: 15px; line-height: 1; }
.nav-group:not([open]) summary::after { content: '›'; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: 6px; color: #d9e5ed; text-decoration: none; font-size: 14px; font-weight: 500; }
.side-link:hover { color: #fff; background: #223d50; }
.side-link.current { color: #fff; background: #22544f; box-shadow: inset 3px 0 #83dabb; }
.side-link > span { min-width: 18px; text-align: center; color: #a8c1c9; font-size: 17px; line-height: 1; }
.sidebar-account { display: flex; align-items: center; gap: 10px; padding: 15px 20px 8px; border-top: 1px solid #31475a; }
.account-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #29465a; font-weight: 700; }
.account-info { min-width: 0; }
.account-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-info small { display: block; color: #bdcdd7; }
.sidebar-logout { padding: 5px 20px 18px; }
.app-shell { margin-left: 248px; min-height: 100vh; min-width: 0; }
.app-topbar { min-height: 61px; display: flex; align-items: center; gap: 12px; padding: 10px clamp(18px, 4vw, 60px); border-bottom: 1px solid var(--theme-line); background: #fff; }
.app-crumb { color: var(--theme-slate); font-size: 13px; }
.app-crumb span { padding: 0 8px; color: #96a7b3; }
.app-crumb strong { color: var(--theme-ink); font-weight: 650; }
.menu-toggle { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--theme-line); border-radius: 7px; background: #fff; color: var(--theme-ink); font-size: 21px; }
.sidebar-backdrop[hidden] { display: none !important; }
.content-wrap { max-width: 1450px; margin: 0 auto; padding: clamp(24px, 4vw, 56px); }
.content-wrap > h1 { margin: 0 0 23px; font-size: clamp(30px, 3.4vw, 44px); }
.content-wrap > p.lead { color: var(--theme-slate); font-size: 17px; }
.content-wrap > p.text-muted { font-size: 13px; }
.content-wrap > form[method="get"], .content-wrap > form[method="post"], .content-wrap > .table-responsive, .content-wrap > .card, .content-wrap > section.card { border: 1px solid var(--theme-line); border-radius: 12px; background: #fff; box-shadow: 0 4px 24px #11273c08; }
.content-wrap > form[method="get"], .content-wrap > form[method="post"] { padding: 18px; }
.content-wrap > .table-responsive { overflow: auto; }
.content-wrap .card, .content-wrap .alert { border-radius: 12px; }
.table { margin-bottom: 0; --bs-table-striped-bg: #f9fbfb; }
.table th { color: #506375; background: #f3f7f7; font-size: 12px; font-weight: 700; white-space: nowrap; }
.table th, .table td { padding: 12px 16px; border-color: #e7edef; vertical-align: middle; }
.table th a { color: inherit; text-decoration: none; }
.table th a:hover { color: var(--theme-teal); }
.table td { font-size: 14px; }
.table td code { word-break: break-all; font-size: 12px; }
.table td .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 31px; padding: .25rem .5rem; margin: 2px 6px 2px 0; vertical-align: middle; white-space: normal; text-align: center; }
.table td form.d-inline, .table td form.d-inline-block { vertical-align: middle; }
.table td:has(> .btn), .table td:has(> form), .table td.action-cell { white-space: normal; }
.form-control, .form-select { border-color: #afbec8; border-radius: 7px; min-height: 40px; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--theme-teal); box-shadow: 0 0 0 .2rem #00776e22; }
.form-label { color: #3a5367; font-size: 13px; font-weight: 650; }
.btn { border-radius: 7px; font-weight: 650; }
.btn-primary, .btn-success { --bs-btn-bg: #00776e; --bs-btn-border-color: #00776e; --bs-btn-hover-bg: #006158; --bs-btn-hover-border-color: #006158; --bs-btn-active-bg: #005c55; --bs-btn-active-border-color: #005c55; }
.btn-outline-primary, .btn-outline-info { --bs-btn-color: #00776e; --bs-btn-border-color: #9bcac3; --bs-btn-hover-bg: #00776e; --bs-btn-hover-border-color: #00776e; --bs-btn-hover-color: #fff; }
.text-success { color: #0b6b59 !important; }
.text-danger { color: #a73535 !important; }
.badge.text-bg-warning { color: #794800 !important; background: #fff0cf !important; }
.content-wrap > p:has(> .btn) { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-stack-table .quantity-cell { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 650; }
.theme-stack-table .action-cell { min-width: 170px; }
.theme-stack-table .action-cell > a + a { margin-left: 0; }
.date-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border: 1px solid #9bcac3; border-radius: 999px; background: #e1f3ec; color: #116250; font-size: 13px; font-weight: 650; }
.date-chip .remove-day { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; line-height: 1; }
.date-chip .remove-day:hover { background: #c2f2df; }
.count-workspace .card { height: 100%; }
.count-form-panel { max-width: 1050px; }
.count-product-history { min-width: 0; }
.count-status-card { border-color: var(--theme-line); }
.reversal-quantity { min-width: 90px; max-width: 140px; }
.auth-page { background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-cover { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 50px; padding: clamp(28px, 5vw, 84px); color: #fff; background: var(--theme-navy); }
.login-cover::after { content: ''; position: absolute; inset: -20% -50% -20% 0; z-index: -1; transform: rotate(-23deg); background: repeating-linear-gradient(0deg, transparent 0 56px, #2a4458 57px 58px), repeating-linear-gradient(90deg, transparent 0 116px, #2a4458 117px 118px); mask-image: linear-gradient(115deg, transparent 6%, black 110%); }
.login-brand, .login-mobile-brand { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 730; letter-spacing: -.045em; }
.login-rack { align-self: center; display: grid; grid-template-columns: repeat(4, 1fr); width: min(96%, 420px); gap: 7px; padding: 15px; border: 2px solid #6c8995; transform: skewY(-9deg); border-radius: 4px; background: #173349; }
.login-rack i { aspect-ratio: 1.65; background: linear-gradient(140deg, #77999c, #466872); border-top: 5px solid #b4ccc3; border-bottom: 5px solid #304f60; border-radius: 2px; }
.login-rack i:nth-child(3n) { background: linear-gradient(140deg, #72c8a8, #3a827b); border-top-color: var(--theme-mint); }
.login-rack i:nth-child(7n) { background: transparent; border: 1px dashed #5e7989; }
.login-cover h2 { margin: 0; font-size: clamp(32px, 4vw, 58px); font-weight: 730; letter-spacing: -.055em; line-height: 1.1; }
.login-kicker { margin-bottom: 12px; color: #b9d9d5; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.login-side { display: grid; align-content: center; justify-items: center; padding: 32px; }
.login-form-wrap { width: min(100%, 365px); }
.login-eyebrow { color: var(--theme-teal); font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.login-form-wrap h1 { margin: 8px 0; font-size: clamp(36px, 4vw, 48px); }
.login-intro { margin-bottom: 26px; color: var(--theme-slate); }
.login-form .btn { min-height: 44px; margin-top: 8px; }
.login-mobile-brand { display: none; margin-bottom: 46px; }
@media (max-width: 850px) {
  .app-sidebar { display: none; max-width: 86vw; }
  .app-sidebar.is-open { display: flex; }
  .app-shell { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .sidebar-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1030; border: 0; border-radius: 0; background: #11273c80; }
  .content-wrap { padding: 24px 16px; }
  .app-topbar { padding: 10px 14px; }
}
@media (max-width: 670px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-cover { display: none; }
  .login-side { align-content: start; padding: 32px 22px; }
  .login-mobile-brand { display: flex; }
  .content-wrap > h1 { font-size: 32px; }
  .content-wrap > form[method="get"], .content-wrap > form[method="post"] { padding: 15px; }
  .theme-stack-table { overflow: visible !important; }
  .theme-stack-table table, .theme-stack-table tbody, .theme-stack-table tr, .theme-stack-table td { display: block; width: 100%; }
  .theme-stack-table thead { display: none; }
  .theme-stack-table tbody { padding: 8px; }
  .theme-stack-table tr { padding: 14px 12px; margin-bottom: 10px; border: 1px solid var(--theme-line); border-radius: 10px; background: #fff; box-shadow: 0 2px 12px #11273c0a; }
  .theme-stack-table tr:last-child { margin-bottom: 0; }
  .theme-stack-table td { display: grid; grid-template-columns: minmax(92px, 38%) minmax(0, 1fr); gap: 10px; padding: 5px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .theme-stack-table td.quantity-cell { white-space: normal; }
  .theme-stack-table td::before { content: attr(data-label); color: var(--theme-slate); font-size: 12px; font-weight: 700; }
  .theme-stack-table td.action-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--theme-line); }
  .theme-stack-table td.action-cell > a + a { margin-left: 0; }
  .theme-stack-table td.action-cell::before { display: none; }
  .table-responsive:not(.theme-stack-table) { max-width: 100%; overflow-x: auto; }
  .table td .btn { margin-bottom: 6px; }
  .count-workspace .card { height: auto; }
  .count-workspace form .col-md-4, .count-workspace form .col-lg-6 { min-width: 0; width: 100%; }
  #missing-filter .d-flex > .form-control { min-width: 0; }
  #missing-filter .date-chip { max-width: 100%; }
  .theme-stack-table td.action-cell.user-actions { display: flex; flex-direction: column; align-items: stretch; }
  .theme-stack-table .user-actions form { display: flex !important; flex-wrap: wrap; width: 100%; min-width: 0; gap: 6px; margin-bottom: 8px !important; }
  .theme-stack-table .user-actions input, .theme-stack-table .user-actions select { min-width: 0; max-width: 100%; flex: 1 1 100%; }
  .theme-stack-table .user-actions button { max-width: 100%; }
  .count-status-card .theme-stack-table tbody { padding: 0; }
  .count-status-card .theme-stack-table tr { box-shadow: none; }
  .theme-stack-table .reversal-quantity { max-width: 100%; min-width: 0; }
  .app-crumb { font-size: 12px; }
}

.product-picker-wrap { position: relative; }
.product-picker-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.product-picker-list { position: absolute; z-index: 20; inset: 100% 0 auto; max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--theme-line); box-shadow: 0 8px 24px #11273c24; border-radius: 8px; }
.product-picker-option { display: block; width: 100%; padding: 9px 12px; border: 0; background: #fff; text-align: left; color: var(--theme-ink); }
.product-picker-option:hover, .product-picker-option.active { background: #e1f3ec; }
.product-picker-empty { padding: 10px 12px; color: #576b7d; }
.entry-dialog { width: min(520px, 94vw); border: 1px solid var(--theme-line); border-radius: 12px; padding: 24px; color: var(--theme-ink); }
.entry-dialog::backdrop { background: #11273ca6; }
