:root {
    --ink: #17211b;
    --muted: #66736b;
    --line: #dfe5e1;
    --canvas: #f4f6f3;
    --surface: #ffffff;
    --green: #146c43;
    --green-dark: #0d4f31;
    --green-soft: #e8f3ed;
    --orange: #e87922;
    --orange-soft: #fff0e3;
    --red: #bb2d3b;
    --red-soft: #fdecef;
    --blue: #2463a6;
    --blue-soft: #eaf2fb;
    --shadow: 0 12px 35px rgba(20, 50, 33, .08);
    --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { margin: 0; min-height: 100%; background: var(--canvas); color: var(--ink); font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; background: #10251a; color: #eef7f1; padding: 22px 16px; display: flex; flex-direction: column; z-index: 30; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-brand strong { display: block; font-size: 16px; letter-spacing: .03em; }
.sidebar-brand small { color: #9bb5a6; font-size: 9px; letter-spacing: .18em; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; flex: 0 0 auto; background: var(--orange); color: #fff; font-weight: 800; letter-spacing: -.04em; box-shadow: 0 7px 18px rgba(232,121,34,.25); }
.brand-mark-large { width: 58px; height: 58px; border-radius: 16px; font-size: 20px; }
.sidebar-brand, .sidebar-footer { flex-shrink: 0; }
.sidebar-nav { display: grid; align-content: start; gap: 4px; min-height: 0; overflow-y: auto; padding: 20px 0; }
.nav-link { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 9px 11px; border-radius: 10px; color: #bdd0c4; font-weight: 600; transition: .18s ease; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: rgba(232,121,34,.18); box-shadow: inset 3px 0 var(--orange); }
.nav-icon { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 8px; color: #a9c0b2; transition: color .18s ease, background-color .18s ease, transform .18s ease; }
.nav-icon svg { width: 15px; height: 15px; stroke-width: 1.8; }
.nav-link:hover .nav-icon { color: #fff; transform: translateY(-1px); }
.nav-link.active .nav-icon { background: var(--orange); }
.nav-link.active .nav-icon { color: #fff; box-shadow: 0 5px 12px rgba(232,121,34,.25); }
.sidebar-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.09); }
.user-chip { display: flex; align-items: center; gap: 9px; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #28533c; color: #fff; font-weight: 700; }
.user-chip div { min-width: 0; }
.user-chip strong, .user-chip small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { color: #91a99b; font-size: 11px; }
.logout-link { display: block; margin-top: 12px; color: #e7a97a; font-size: 12px; }
.sidebar-close, .mobile-menu, .sidebar-overlay { display: none; }

.main-content { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 92px; padding: 19px 30px; display: flex; align-items: center; gap: 15px; justify-content: space-between; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 1px 0 0; font-size: 25px; line-height: 1.2; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.today { color: var(--muted); font-size: 12px; }
.content-area { width: 100%; max-width: 1580px; margin: 0 auto; flex: 1; padding: 28px 30px 42px; }
.app-footer { padding: 17px 30px; color: #7a867e; text-align: center; border-top: 1px solid var(--line); font-size: 11px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-header h2, .card-header h3 { margin: 0; font-size: 15px; }
.card-body { padding: 19px; }
.stat-card { position: relative; overflow: hidden; padding: 19px; min-height: 132px; }
.stat-card::after { content: ''; position: absolute; width: 76px; height: 76px; border-radius: 50%; right: -24px; top: -28px; background: var(--green-soft); }
.stat-card.orange::after { background: var(--orange-soft); }
.stat-card.blue::after { background: var(--blue-soft); }
.stat-card.red::after { background: var(--red-soft); }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-value { margin: 13px 0 4px; font-size: 25px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }
.stat-note { color: var(--muted); font-size: 11px; }
.stat-note strong { color: var(--green); }
.profit-overview { margin-bottom: 18px; overflow: hidden; }
.profit-overview .card-header small { display: block; margin-top: 4px; color: var(--muted); }
.profit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profit-metric { padding: 18px 20px; border-right: 1px solid var(--line); background: #fff; }
.profit-metric:last-child { border-right: 0; }
.profit-metric.featured { background: var(--green-soft); }
.profit-metric span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.profit-metric strong { display: block; margin-top: 7px; color: var(--green); font-size: 22px; letter-spacing: -.03em; }
.profit-metric strong.text-danger { color: var(--red); }

.btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; font-weight: 700; font-size: 12px; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 7px 15px rgba(20,108,67,.16); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger { color: var(--red); background: var(--red-soft); border-color: #f4cbd0; }
.btn-warning { color: #91450d; background: var(--orange-soft); border-color: #f7d5bb; }
.btn-sm { min-height: 34px; padding: 7px 11px; }
.btn-block { width: 100%; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); background: #fff; border-radius: 9px; }
.text-link { color: var(--green); font-weight: 700; }
.text-danger { color: var(--red); }
.text-muted { color: var(--muted); }
.mt-18 { margin-top: 18px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 11px 13px; color: #718078; background: #f7f9f7; border-bottom: 1px solid var(--line); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 12px 13px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
.data-table tbody tr:hover { background: #fbfcfb; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.aging-table { min-width: 1120px; }
.aging-number { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.aging-overdue { color: var(--red); font-weight: 700; }
.aging-total { color: var(--ink); font-weight: 800; }
.cell-title { display: block; font-weight: 700; color: var(--ink); }
.cell-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.actions form { display: inline; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 8px; border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-warning { background: var(--orange-soft); color: #a45313; }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-neutral { background: #edf0ee; color: #59655d; }

.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.search-form { display: flex; gap: 8px; flex: 1; max-width: 540px; }
.search-form input, .search-form select { min-height: 40px; }
.filter-strip { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.filter-strip .field { min-width: 145px; }
.field { display: grid; gap: 6px; color: #3e4b43; font-size: 12px; font-weight: 700; }
.field small { color: var(--muted); font-size: 10px; font-weight: 400; }
.field input, .field select, .field textarea, .search-form input, .search-form select { width: 100%; min-height: 42px; border: 1px solid #cfd7d1; border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 11px; outline: none; transition: .15s ease; }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20,108,67,.09); }
.field input[readonly] { background: #f1f4f2; color: var(--muted); }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.category-manage-link { padding: 0; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 800; }
.category-manage-link:hover { color: var(--green-dark); text-decoration: underline; }
.form-stack { display: grid; gap: 15px; }
.form-grid { display: grid; gap: 15px; }
.form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.section-label { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: 17px; height: 17px; }

body.modal-open { overflow: hidden; }
.category-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.category-modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(7, 25, 15, .62); cursor: default; }
.category-modal-panel { position: relative; width: min(100%, 640px); max-height: min(760px, calc(100vh - 48px)); overflow: hidden; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 28px 80px rgba(4, 25, 14, .3); }
.category-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.category-modal-header h2 { margin: 2px 0 0; font-size: 20px; }
.category-modal-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 23px; line-height: 1; }
.category-modal-close:hover { color: var(--ink); background: #f7f9f7; }
.category-modal-body { min-height: 0; overflow-y: auto; padding: 20px 21px 22px; }
.category-status { margin-bottom: 14px; padding: 10px 12px; border: 1px solid #c6e1d1; border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; }
.category-status[data-type="error"] { border-color: #f2c3ca; background: var(--red-soft); color: #8c1f2a; }
.category-editor { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #f8faf8; }
.category-editor-actions { display: flex; gap: 7px; padding-bottom: 1px; }
.category-list-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 20px 0 9px; }
.category-list-heading strong { font-size: 13px; }
.category-list-heading span { color: var(--muted); font-size: 10px; }
.category-list { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.category-list-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.category-list-row:last-child { border-bottom: 0; }
.category-list-row:hover { background: #fbfcfb; }
.category-list-details { min-width: 0; }
.category-list-details strong, .category-list-details small { display: block; }
.category-list-details strong { overflow: hidden; text-overflow: ellipsis; }
.category-list-details small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.category-list-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.category-loading, .category-empty { padding: 28px 14px; color: var(--muted); text-align: center; font-size: 12px; }

.alert { position: relative; margin-bottom: 15px; padding: 12px 42px 12px 14px; border: 1px solid; border-radius: 9px; font-size: 12px; }
.alert button { position: absolute; right: 10px; top: 7px; border: 0; background: none; font-size: 20px; color: inherit; }
.alert-success { color: var(--green-dark); background: var(--green-soft); border-color: #c6e1d1; }
.alert-danger { color: #8c1f2a; background: var(--red-soft); border-color: #f2c3ca; }
.alert-warning { color: #88430f; background: var(--orange-soft); border-color: #f2d0b5; }
.alert-info { color: #1e5187; background: var(--blue-soft); border-color: #cbddef; }

.empty-state { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 5px; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.detail-item { background: #fff; padding: 14px; }
.detail-item span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.detail-item strong { display: block; margin-top: 5px; }
.stock-value-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stock-value-pair small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.stock-value-pair strong { margin-top: 2px; }
.summary-panel { margin-left: auto; width: min(100%, 390px); display: grid; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); }
.summary-row.total { margin-top: 4px; padding-top: 10px; border-top: 2px solid var(--ink); color: var(--ink); font-size: 17px; font-weight: 800; }
.balance-positive { color: var(--red); font-weight: 800; }
.balance-clear { color: var(--green); font-weight: 800; }

.line-items { display: grid; gap: 12px; }
.line-item { display: grid; grid-template-columns: minmax(240px, 2fr) 90px 130px 130px 42px; gap: 9px; align-items: end; padding: 12px; background: #f8faf8; border: 1px solid var(--line); border-radius: 10px; }
.line-item.serialized { grid-template-columns: minmax(220px, 1.6fr) 80px 120px 120px 42px; }
.serial-box { grid-column: 1 / -1; }
.line-total { min-height: 42px; display: flex; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 700; }
.remove-line { width: 42px; height: 42px; border: 1px solid #f2c6ca; border-radius: 8px; color: var(--red); background: var(--red-soft); }
.quick-list { display: grid; gap: 0; }
.quick-item { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.quick-item:first-child { padding-top: 0; }
.quick-item:last-child { padding-bottom: 0; border: 0; }
.quick-item strong, .quick-item small { display: block; }
.quick-item small { color: var(--muted); }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }
.activity-row { display: flex; gap: 10px; align-items: flex-start; }

.auth-body { background: #10251a; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.auth-visual { position: relative; display: flex; align-items: flex-end; min-height: 100vh; overflow: hidden; padding: 72px; color: #fff; background: radial-gradient(circle at 78% 22%, rgba(232,121,34,.32), transparent 23%), linear-gradient(135deg, #0d3e28 0%, #10251a 60%, #08160f 100%); }
.auth-visual::before { content: ''; position: absolute; inset: 8% 8% auto auto; width: 350px; height: 350px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018); }
.auth-visual-content { position: relative; z-index: 1; max-width: 580px; }
.auth-visual .eyebrow { color: #f1a66d; margin-top: 24px; }
.auth-visual h1 { margin: 12px 0 16px; font-size: clamp(40px, 5vw, 70px); line-height: 1.02; letter-spacing: -.055em; }
.auth-visual p { max-width: 510px; color: #b9cabf; font-size: 16px; }
.auth-stats { display: flex; gap: 30px; margin-top: 42px; color: #aec2b5; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.auth-stats strong { display: block; color: var(--orange); font-size: 18px; }
.auth-panel { display: grid; place-items: center; padding: 30px; background: #f4f6f3; }
.auth-card { width: min(100%, 440px); padding: 35px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 25px 70px rgba(4, 25, 14, .2); }
.auth-heading { margin-bottom: 24px; }
.auth-heading h2 { margin: 7px 0 5px; font-size: 28px; letter-spacing: -.035em; }
.auth-heading p:last-child { margin: 0; color: var(--muted); }
.auth-note { margin: 19px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 60px; }
.password-wrap button { position: absolute; right: 5px; top: 5px; height: 32px; padding: 0 9px; border: 0; background: var(--green-soft); color: var(--green); border-radius: 6px; font-size: 10px; font-weight: 800; }
.setup-shell { min-height: 100vh; display: grid; grid-template-columns: .75fr 1.25fr; gap: 45px; align-items: center; max-width: 1180px; margin: auto; padding: 55px 30px; }
.setup-intro { color: #fff; }
.setup-intro .eyebrow { color: #f1a66d; margin-top: 22px; }
.setup-intro h1 { font-size: 45px; line-height: 1.05; margin: 10px 0 17px; letter-spacing: -.045em; }
.setup-intro > p:not(.eyebrow) { color: #b8cabf; font-size: 15px; }
.setup-points { display: grid; gap: 10px; margin-top: 28px; color: #d6e3da; }
.setup-card { width: 100%; max-width: none; }

.pagination { display: flex; justify-content: flex-end; gap: 6px; padding: 15px 0 0; }
.pagination a, .pagination span { min-width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.pagination .active { color: #fff; background: var(--green); border-color: var(--green); }
.audit-filters .field { flex: 1 1 145px; min-width: 0; }
.audit-table { min-width: 850px; }
.audit-table td { overflow-wrap: anywhere; }
.audit-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.audit-pagination .pagination { padding-top: 0; flex-wrap: wrap; }
.stock-list-filters .field { flex: 1 1 145px; min-width: 0; }
.stock-list-filters .stock-search { flex: 2 1 240px; }
.stock-list-table { min-width: 1000px; }
.stock-list-table td { overflow-wrap: anywhere; }
.stock-specifications { min-width: 200px; max-width: 350px; font-size: 12px; }
.stock-specifications summary { margin-top: 6px; color: var(--green); font-weight: 700; cursor: pointer; }
.stock-specifications details div { margin-top: 8px; }
.stock-quantity { white-space: nowrap; font-variant-numeric: tabular-nums; }
.stock-quantity strong { font-size: 18px; }
.stock-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stock-pagination .pagination { padding-top: 0; flex-wrap: wrap; }

.user-summary-grid { grid-template-columns: repeat(2, minmax(220px, 330px)); margin-bottom: 18px; }
.permission-wrap { border: 1px solid var(--line); border-radius: 10px; }
.permission-table { min-width: 760px; }
.permission-table th:not(:first-child), .permission-table td:not(:first-child) { width: 145px; text-align: center; }
.permission-check { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--ink); font-size: 11px; font-weight: 700; cursor: pointer; }
.permission-check input { width: 18px; height: 18px; accent-color: var(--green); }
.permission-na { color: #aeb8b1; }
.permission-note { margin: -3px 0 0; font-size: 11px; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setup-shell { grid-template-columns: 1fr; max-width: 740px; }
    .setup-intro { display: none; }
}

@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: -260px; width: 244px; transition: left .2s ease; }
    body.sidebar-open .sidebar { left: 0; }
    .sidebar-overlay { position: fixed; display: block; inset: 0; z-index: 20; background: rgba(4, 20, 11, .55); opacity: 0; pointer-events: none; transition: .2s; }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .sidebar-close { display: grid; place-items: center; margin-left: auto; background: transparent; color: #fff; border-color: rgba(255,255,255,.12); }
    .mobile-menu { display: grid; place-items: center; }
    .topbar { padding: 16px 18px; }
    .today { display: none; }
    .content-area { padding: 20px 17px 35px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .form-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .line-item, .line-item.serialized { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .line-item > .field:first-child { grid-column: 1 / -1; }
    .serial-box { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
    .stats-grid, .profit-grid, .form-grid-2, .form-grid-3, .form-grid-4, .detail-grid, .user-summary-grid { grid-template-columns: 1fr; }
    .profit-metric { border-right: 0; border-bottom: 1px solid var(--line); }
    .profit-metric:last-child { border-bottom: 0; }
    .page-head, .toolbar { align-items: stretch; flex-direction: column; }
    .topbar h1 { font-size: 20px; }
    .topbar-actions .btn { display: none; }
    .auth-panel { padding: 16px; }
    .auth-card { padding: 24px 20px; }
    .setup-shell { padding: 16px; }
    .filter-strip { display: grid; grid-template-columns: 1fr 1fr; }
    .line-item, .line-item.serialized { grid-template-columns: 1fr; }
    .line-item > *, .serial-box { grid-column: 1 !important; }
    .remove-line { width: 100%; }
    .category-modal { padding: 12px; }
    .category-modal-panel { max-height: calc(100vh - 24px); }
    .category-modal-header, .category-modal-body { padding-left: 15px; padding-right: 15px; }
    .category-editor { grid-template-columns: 1fr; }
    .category-editor-actions { justify-content: flex-end; }
    .category-list-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
    .category-list-row { align-items: flex-start; flex-direction: column; }
    .category-list-actions { width: 100%; }
    .category-list-actions .btn { flex: 1; }
}
