:root {
    --avm-primary: #2155cd;
    --avm-primary-dark: #153a91;
    --avm-primary-soft: #eef3ff;
    --avm-surface: #f4f6f9;
    --avm-surface-subtle: #f8f9fc;
    --avm-panel: #fff;
    --avm-text: #1d2738;
    --avm-text-muted: #68758a;
    --avm-border: #dfe4ec;
    --avm-border-subtle: #e9edf3;
    --avm-success: #14845b;
    --avm-warning: #a66305;
    --avm-danger: #d9364f;
    --avm-info: #1769aa;
    --avm-radius-sm: 5px;
    --avm-radius: 8px;
    --avm-radius-lg: 10px;
    --avm-shadow: 0 2px 8px rgba(24, 45, 85, .055);
    --avm-shadow-lg: 0 12px 32px rgba(20, 35, 65, .16);
    --avm-control-height: 36px;
    --avm-page-max: 1920px;
    --avm-page-x: 1.25rem;
    --avm-space-1: .25rem;
    --avm-space-2: .5rem;
    --avm-space-3: .75rem;
    --avm-space-4: 1rem;
    --avm-space-5: 1.25rem;
    color-scheme: light;
}

html[data-theme="dark"] {
    --avm-primary: #7da4ff;
    --avm-primary-dark: #9bb9ff;
    --avm-primary-soft: rgba(125, 164, 255, .14);
    --avm-surface: #111827;
    --avm-surface-subtle: #1c2533;
    --avm-panel: #17202d;
    --avm-text: #edf2f7;
    --avm-text-muted: #a8b3c5;
    --avm-border: #334155;
    --avm-border-subtle: #273244;
    --avm-success: #45c58b;
    --avm-warning: #f3b94e;
    --avm-danger: #ff6b83;
    --avm-info: #67b7f7;
    --avm-shadow: 0 2px 10px rgba(0, 0, 0, .28);
    --avm-shadow-lg: 0 18px 38px rgba(0, 0, 0, .42);
    color-scheme: dark;
}

html { scroll-behavior: smooth; }
body {
    min-width: 320px;
    background: var(--avm-surface);
    color: var(--avm-text);
    font-size: .925rem;
    line-height: 1.45;
}

a { color: var(--avm-primary); }
.app-page { width:100%; max-width:var(--avm-page-max); margin-inline:auto; padding:1rem var(--avm-page-x); }
.app-page-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.75rem 1rem; margin-bottom:.875rem; }
.app-page-header > div:first-child { min-width:0; }
.app-page-header h1 { margin:.15rem 0 0; font-size:clamp(1.3rem,1.7vw,1.65rem); font-weight:750; line-height:1.2; }
.app-page-header p { max-width:780px; line-height:1.45; }
.app-page-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.4rem; }
.app-page-actions .btn { white-space:nowrap; }
.ui-card { overflow:hidden; border:1px solid var(--avm-border); border-radius:var(--avm-radius); background:var(--avm-panel); box-shadow:var(--avm-shadow); }
.ui-card-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.5rem 1rem; padding:.75rem .9rem; border-bottom:1px solid var(--avm-border-subtle); }
.ui-card-body { padding:.875rem; }
.ui-empty { padding:2rem 1rem; text-align:center; color:var(--avm-text-muted); }
.ui-empty-icon { display:grid; width:2.25rem; height:2.25rem; margin:0 auto .5rem; place-items:center; border-radius:50%; background:var(--avm-primary-soft); color:var(--avm-primary); font-size:1rem; font-weight:800; }
.ui-autocomplete { position:absolute; z-index:1080; right:0; left:0; max-height:280px; overflow:auto; border:1px solid var(--avm-border); border-radius:var(--avm-radius); background:#fff; box-shadow:var(--avm-shadow-lg); }
.ui-autocomplete:empty { display:none; }
.ui-autocomplete .list-group-item { padding:.55rem .7rem; border-right:0; border-left:0; }
.ui-autocomplete .list-group-item:first-child { border-top:0; }
.status-dot { display:inline-block; width:.45rem; height:.45rem; margin-right:.3rem; border-radius:50%; background:currentColor; }

.btn-primary {
    --bs-btn-bg: var(--avm-primary);
    --bs-btn-border-color: var(--avm-primary);
    --bs-btn-hover-bg: var(--avm-primary-dark);
    --bs-btn-hover-border-color: var(--avm-primary-dark);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 0.9fr) minmax(520px, 1.1fr);
}

.auth-brand-panel {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(3rem, 8vw, 8rem);
    color: #fff;
    background:
        radial-gradient(circle at 15% 20%, rgba(88, 145, 255, .55), transparent 38%),
        linear-gradient(145deg, #173a86, #0b1d45);
}

.brand-mark {
    display: inline-flex;
    padding: .65rem 1rem;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: .8rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.service-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
}

.service-brand-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 .6rem 1.2rem rgba(0, 0, 0, .2));
}

.service-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.auth-brand-panel h1 {
    font-size: clamp(1.9rem, 3.2vw, 2.85rem);
    line-height: 1.12;
}

.auth-brand-panel .lead {
    max-width: 34rem;
    margin-inline: auto;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card { width: min(100%, 560px); }

.eyebrow {
    color: var(--avm-primary);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.form-label { margin-bottom:.25rem; font-size:.82rem; font-weight:650; }
.form-control,
.form-select {
    min-height:var(--avm-control-height);
    padding:.38rem .65rem;
    border-color:#d5dce7;
    border-radius:var(--avm-radius-sm);
    background-color:#fff;
    font-size:.9rem;
}
textarea.form-control { min-height:auto; }
.form-control:focus,
.form-select:focus {
    border-color: #7aa2ff;
    box-shadow:0 0 0 .18rem rgba(33,85,205,.11);
}
.form-control-lg,.form-select-lg { min-height:42px; padding:.5rem .75rem; font-size:1rem; }
.form-control-sm,.form-select-sm { min-height:30px; padding:.25rem .5rem; font-size:.8rem; }
.form-text,.text-secondary { color:var(--avm-text-muted)!important; }
.btn { min-height:34px; padding:.38rem .72rem; border-radius:var(--avm-radius-sm); font-size:.875rem; font-weight:600; }
.btn-sm { min-height:30px; padding:.25rem .55rem; font-size:.8rem; }
.btn-lg { min-height:42px; padding:.5rem .85rem; font-size:.95rem; }
.badge { padding:.36em .58em; border-radius:var(--avm-radius-sm); font-size:.75em; font-weight:700; }
.alert { padding:.65rem .8rem; border-radius:var(--avm-radius); }
.card { border-color:var(--avm-border); border-radius:var(--avm-radius); }
.card-header,.card-footer { padding:.7rem .875rem; border-color:var(--avm-border-subtle); background:var(--avm-surface-subtle); }
.card-body { padding:.875rem; }
.table { margin-bottom:0; font-size:.875rem; }
.table > :not(caption) > * > * { padding:.58rem .75rem; border-color:var(--avm-border-subtle); vertical-align:middle; }
.table > thead th { color:#5e6b80; background:var(--avm-surface-subtle); font-size:.72rem; letter-spacing:.02em; white-space:nowrap; }
.input-group > .btn { min-height:var(--avm-control-height); }
.form-check-input:focus { border-color:#7aa2ff; box-shadow:0 0 0 .18rem rgba(33,85,205,.11); }
.navbar { --bs-navbar-padding-y:.35rem; }
.navbar .nav-link { padding-top:.45rem; padding-bottom:.45rem; font-size:.875rem; font-weight:550; }
.navbar .dropdown-menu { padding:.3rem; border:1px solid var(--avm-border-subtle)!important; border-radius:var(--avm-radius); box-shadow:var(--avm-shadow-lg)!important; }
.navbar .dropdown-item { padding:.45rem .65rem; border-radius:var(--avm-radius-sm); font-size:.875rem; }

.dashboard-card { transition: transform .2s ease, box-shadow .2s ease; }
.dashboard-card:hover { transform: translateY(-3px); }

.module-icon {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border-radius: .85rem;
    background: #e8efff;
    color: var(--avm-primary);
    font-weight: 800;
}

.smaller { font-size: .75rem; }

.service-navbar { background: linear-gradient(90deg, #0b1d45, #173a86); }
.service-login-bg { background: radial-gradient(circle at 20% 20%, #dce8ff, transparent 35%), #f5f7fb; }

.service-company-hero { display:flex; justify-content:space-between; align-items:end; gap:1.5rem; padding:1.5rem; border:1px solid #e4e9f2; border-radius:1.25rem; background:linear-gradient(135deg,#fff,#f2f6ff); box-shadow:0 .5rem 1.5rem rgba(30,55,100,.06); }
.service-back-link { font-size:.85rem; text-decoration:none; font-weight:600; }
.service-section-nav { position:sticky; top:68px; z-index:20; display:flex; gap:.35rem; overflow:auto; padding:.5rem; border:1px solid #e4e9f2; border-radius:1rem; background:rgba(255,255,255,.94); box-shadow:0 .35rem 1rem rgba(30,55,100,.07); backdrop-filter:blur(10px); }
.service-section-nav a { flex:0 0 auto; padding:.6rem 1rem; border-radius:.7rem; color:#526078; text-decoration:none; font-size:.88rem; font-weight:650; }
.service-section-nav a:hover { color:var(--avm-primary); background:#edf3ff; }
.service-section { padding-top:1rem; margin-bottom:3.5rem; scroll-margin-top:135px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; margin-bottom:1rem; }
.section-heading h2 { margin:.25rem 0 0; font-size:1.55rem; font-weight:750; }
.service-card { overflow:hidden; border:1px solid var(--avm-border); border-radius:var(--avm-radius); background:#fff; box-shadow:var(--avm-shadow); }
.service-card-header { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.5rem 1rem; padding:.75rem .9rem; border-bottom:1px solid var(--avm-border-subtle); }
.service-card-header h2 { margin:0; font-size:1rem; font-weight:750; }
.service-card-body { padding:.875rem; }
.service-stat-card { display:flex; align-items:center; gap:.9rem; height:100%; padding:1.1rem; border:1px solid #e4e9f2; border-radius:1rem; background:#fff; box-shadow:0 .35rem 1.1rem rgba(30,55,100,.05); }
.service-stat-icon { display:grid; width:2.65rem; height:2.65rem; flex:0 0 auto; place-items:center; border-radius:.8rem; font-weight:800; }
.detail-label { display:block; margin-bottom:.25rem; color:#7a869b; font-size:.75rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.fee-summary { display:flex; flex-direction:column; height:100%; padding:1rem; border:1px solid #dfe6f1; border-radius:.9rem; background:#f8faff; }
.fee-summary span { color:#6c7890; font-size:.78rem; }
.fee-summary strong { margin-top:.25rem; color:#25324a; font-size:clamp(1rem,2vw,1.45rem); }
.fee-summary.fee-paid { background:#effaf5; border-color:#ccebdc; }
.fee-summary.fee-paid strong { color:#14845b; }
.fee-summary.fee-balance { background:#fff3f4; border-color:#f2d2d6; }
.fee-summary.fee-balance strong { color:#d9364f; }
.service-table > :not(caption) > * > * { padding:.58rem .75rem; border-color:var(--avm-border-subtle); vertical-align:middle; }
.service-table thead th { color:#5e6b80; background:var(--avm-surface-subtle); font-size:.7rem; letter-spacing:.025em; text-transform:uppercase; white-space:nowrap; }
.service-table tbody tr { transition:background-color .15s ease; }
.service-table tbody tr:hover { background:#f8faff; }
.service-table td { color:#25324a; }
.service-table .btn { white-space:nowrap; }
.service-sticky-card { position:sticky; top:140px; }
.activity-list { max-height:480px; overflow:auto; }
.activity-item { padding:1rem 1.25rem; border-bottom:1px solid #edf0f5; }
.activity-item span { float:right; color:#7d8797; font-size:.78rem; }
.activity-item p { margin:.25rem 0 0; color:#667188; font-size:.88rem; }

@media (max-width: 991.98px) {
    .service-company-hero { align-items:start; flex-direction:column; }
    .service-section-nav { top:60px; }
    .service-sticky-card { position:static; }
}

.permission-option {
    display: flex;
    gap: .65rem;
    align-items: center;
    padding: .8rem 1rem;
    border: 1px solid #e1e6ef;
    border-radius: .65rem;
    cursor: pointer;
}

.permission-option:hover { background: #f7f9fd; }
.role-grid{--bs-gutter-x:.75rem;--bs-gutter-y:.75rem;align-items:start}
.role-card{overflow:hidden;border:1px solid var(--avm-border);border-radius:var(--avm-radius);background:#fff;box-shadow:var(--avm-shadow);transition:border-color .15s ease,box-shadow .15s ease}
.role-card:hover{border-color:#cfd7e6;box-shadow:0 3px 10px rgba(23,36,61,.06)}
.role-card-header{display:flex;justify-content:space-between;align-items:flex-start;gap:.5rem;padding:.7rem .8rem;border-bottom:1px solid var(--avm-border-subtle);background:var(--avm-surface-subtle)}
.role-card-title{margin:0;font-size:.95rem;font-weight:750;line-height:1.3}
.role-card-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem;margin-top:.2rem}
.role-card-body{padding:.65rem .8rem}
.role-card-permissions{display:flex;flex-wrap:wrap;align-content:flex-start;gap:.3rem;max-height:92px;overflow:auto;scrollbar-width:thin}
.role-permission-chip{display:inline-flex;align-items:center;max-width:100%;padding:.22rem .45rem;border:1px solid #e2e7ef;border-radius:999px;background:#f5f7fa;color:#4e5b70;font-size:.7rem;font-weight:600;line-height:1.25}
.role-permission-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}
.role-permission-group{overflow:hidden;border:1px solid var(--avm-border);border-radius:var(--avm-radius);background:#fff}
.role-permission-heading{display:flex;justify-content:space-between;align-items:center;padding:.5rem .65rem;background:var(--avm-surface-subtle);border-bottom:1px solid var(--avm-border-subtle);font-size:.76rem;font-weight:750}
.role-permission-heading small{color:#8993a5;font-size:.65rem;font-weight:600}
.role-permission-list{display:flex;flex-direction:column}
.role-permission-row{display:flex;justify-content:space-between;align-items:center;gap:.75rem;min-height:36px;padding:.35rem .65rem;border-bottom:1px solid #eef1f5;cursor:pointer;font-size:.8rem}
.role-permission-row:last-child{border-bottom:0}
.role-permission-row:hover{background:#f9fbff}
.role-permission-row.is-saving{color:var(--avm-text-muted);background:#fafbfc;pointer-events:none}
.role-permission-switch{width:2.25rem!important;height:1.2rem;margin:0!important;cursor:pointer;background-color:#c8cfdb;border:0;box-shadow:inset 0 0 0 1px rgba(20,30,50,.08);transition:background-position .18s ease,background-color .18s ease}
.role-permission-switch:checked{background-color:#2f67dc}
.role-permission-switch:focus{box-shadow:0 0 0 .16rem rgba(47,103,220,.17)}
.role-permission-save-state{min-height:1.25rem;font-size:.75rem;font-weight:650}
.role-permission-save-state.is-saving{color:var(--avm-text-muted)}
.role-permission-save-state.is-saved{color:var(--avm-success)}
.role-permission-save-state.is-error{color:var(--avm-danger)}
.ui-content-lg{width:100%;max-width:960px;margin-inline:auto}
.staff-branch-list{display:flex;flex-wrap:wrap;gap:.25rem;max-width:28rem}
.staff-access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem}
.staff-access-grid .permission-option{min-height:38px;padding:.45rem .65rem;border-radius:var(--avm-radius-sm);font-size:.82rem}
@media(max-width:767.98px){.role-permission-groups{grid-template-columns:1fr}.role-permission-row{min-height:36px}.role-card-permissions{max-height:110px}}
@media(max-width:575.98px){.staff-access-grid{grid-template-columns:1fr}}

.password-toggle {
    min-width: 3rem;
    border-color: #d8deea;
    background: #fff;
}

.password-toggle:hover,
.password-toggle:focus {
    color: var(--avm-primary);
    background: #eef3ff;
    border-color: #7aa2ff;
}

@media (max-width: 991.98px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-form-panel { padding: 3rem 1.25rem; }
}
/* Product catalog */
.product-add-button{min-height:34px;padding:.42rem .8rem;border-radius:6px;font-size:.82rem;box-shadow:0 4px 10px rgba(33,85,205,.16)}
.product-summary-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin-bottom:.75rem}
.product-summary-card{display:flex;align-items:center;gap:.65rem;min-height:70px;padding:.72rem .85rem;border:1px solid #e5eaf3;border-radius:8px;background:#fff;box-shadow:0 2px 8px rgba(20,35,65,.045)}
.product-summary-card small{display:block;color:#778399;font-size:.68rem;font-weight:650}
.product-summary-card strong{display:block;margin-top:.05rem;color:#1d2a44;font-size:1.05rem;font-weight:800;line-height:1.1}
.product-summary-icon{display:grid;width:32px;height:32px;place-items:center;border-radius:8px;color:#2459d6;background:#edf3ff}
.product-summary-icon.success{color:#0f7a54;background:#e5f7ef}.product-summary-icon.info{color:#6b4a00;background:#fff2cf}
.product-catalog-card{border-color:#e2e8f2;border-radius:9px;box-shadow:0 2px 10px rgba(20,35,65,.05)}
.product-catalog-card .ui-card-header{min-height:46px;padding:.62rem .75rem;background:#fff}
.product-table-toolbar{gap:.65rem .9rem;padding:.68rem .75rem;background:#fbfcff}
.product-toolbar-main{flex:1 1 560px}.product-toolbar-actions{margin-left:auto}
.product-search-field{flex:1 1 360px;max-width:560px}.product-search-field .form-control{width:100%;min-height:34px;border-radius:7px;background:#fff}
.product-filter-pill{display:flex;align-items:center;gap:.45rem;margin:0;color:var(--avm-text-muted);font-size:.76rem;font-weight:650}.product-filter-pill .form-select{width:76px;border-radius:7px}
.product-catalog-card .service-table > :not(caption) > * > *{padding:.52rem .72rem}
.product-catalog-card .service-table thead th{height:38px;color:#64718a;background:#f7f9fd;font-size:.68rem;letter-spacing:.025em}
.product-catalog-card .service-table tbody tr{height:52px}
.product-list-main{min-width:13rem}.product-name-cell{font-size:.86rem;font-weight:750;line-height:1.22;word-break:break-word}.product-sku-cell{margin-top:.18rem;color:var(--avm-text-muted);font-size:.68rem}
.product-category-cell{font-size:.78rem;font-weight:700}
.product-money-cell{font-size:.82rem;font-weight:750;color:#26344e}
.product-barcode-list{display:flex;max-width:34rem;flex-direction:column;gap:.14rem}
.product-barcode-row{display:flex;flex-wrap:wrap;gap:.3rem .45rem;align-items:baseline;font-size:.72rem;line-height:1.3}.product-barcode-row span{color:var(--avm-text-muted)}
.product-action-btn{display:inline-grid;width:28px;min-width:28px;height:28px;min-height:28px;place-items:center;padding:0;border-radius:7px;font-size:.78rem;line-height:1}
.product-create-dialog{max-width:760px}.product-modal-content{border-radius:10px}.product-modal-content .modal-header{align-items:center;gap:.62rem;min-height:58px;padding:.72rem .86rem;background:#fff}.product-modal-mark{display:grid;width:28px;height:28px;place-items:center;border-radius:8px;color:var(--avm-primary);background:#edf3ff}.product-modal-content .modal-title{font-size:1rem}.product-create-body{padding:.72rem .86rem;background:#f8fafc}.product-modal-content .modal-footer{position:sticky;bottom:0;z-index:2;padding:.68rem .86rem;background:#fff}
.product-form-steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.25rem;margin-bottom:.68rem;padding:.2rem .1rem;background:transparent}
.product-form-steps span{position:relative;display:flex;align-items:center;justify-content:center;gap:.32rem;min-height:26px;color:#738098;font-size:.66rem;font-weight:700;white-space:nowrap}
.product-form-steps span:not(:last-child)::after{content:"";position:absolute;right:-.25rem;left:calc(50% + 42px);top:50%;height:1px;background:#dbe2ee}
.product-form-steps b{z-index:1;display:grid;width:18px;height:18px;place-items:center;border-radius:50%;background:#e7ecf5;color:#66748b;font-size:.6rem}.product-form-steps .active{color:#17479f}.product-form-steps .active b{color:#fff;background:var(--avm-primary)}
.product-form-section{overflow:hidden;margin-bottom:.72rem;border:1px solid #e2e8f2;border-radius:8px;background:#fff}
.product-form-guide{display:flex;gap:.55rem;align-items:flex-start;padding:.6rem .72rem;background:#f6f8fc;border:0;border-bottom:1px solid #e6ebf3;border-radius:0}
.product-form-guide-number{display:grid;place-items:center;flex:0 0 24px;height:24px;border-radius:7px;background:#edf3ff;color:var(--avm-primary);font-size:.72rem;font-weight:800}.product-form-guide strong{font-size:.84rem}.product-form-guide p{margin:.05rem 0 0;color:#738098;font-size:.68rem;line-height:1.35}
.product-form-section > .row,.product-form-section > .product-type-choice,.product-form-section > [data-package-manager],.product-form-section > .variant-option-box,.product-form-section > .alert,.product-form-section > [data-variant-rows]{margin:.72rem}
.product-create-body .form-control,.product-create-body .form-select{min-height:33px;border-radius:6px;font-size:.78rem}.product-create-body .form-control-lg{min-height:34px;padding:.38rem .55rem;font-size:.8rem}.product-create-body .form-label{font-size:.69rem}.product-create-body .form-text{font-size:.64rem}
.product-package-switch{padding:.6rem .75rem .6rem 2.45rem;border:1px solid #dfe5f2;border-radius:8px;background:#f8fbff}.product-package-switch .form-check-input{width:2rem;height:1.05rem;margin-left:-2.2rem}
.product-package-row{padding:.65rem;margin-bottom:.5rem;border:1px solid #dfe5f2;border-radius:8px;background:#fbfcff}
.product-inline-panel{padding:.7rem;border:1px solid #dfe5f2;border-radius:8px;background:#fbfcff}
.product-type-choice{display:flex;justify-content:space-between;align-items:center;gap:.75rem;padding:.65rem .75rem!important;border:1px solid #dce4f3;border-radius:8px;background:#f8fbff}.product-type-choice .form-check-input{width:2.15rem;height:1.1rem}
.variant-option-box{padding:.7rem;border:1px solid #dfe5f2;border-radius:8px;background:#fbfcff}.variant-row{padding:.62rem;margin:.5rem .72rem;border:1px solid #dfe5f2;border-radius:8px;background:#fff}
@media(max-width:991.98px){.product-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.product-form-steps{grid-template-columns:repeat(2,minmax(0,1fr))}.product-form-steps span::after{display:none}.product-toolbar-actions{margin-left:0}.product-create-dialog{max-width:calc(100vw - 1rem)}}
@media(max-width:767.98px){.product-summary-strip{grid-template-columns:1fr}.product-create-dialog{margin:.5rem}.product-create-body{padding:.7rem}.product-package-row{padding:.65rem}.product-table-toolbar{align-items:stretch}.product-toolbar-main,.product-toolbar-actions{width:100%}.product-search-field{max-width:none}.product-form-steps{grid-template-columns:1fr}.product-form-steps span{justify-content:flex-start;padding-inline:.45rem}.product-type-choice{align-items:flex-start;flex-direction:column}.variant-row{padding:.75rem}}
@media(max-width:767.98px){.product-type-choice{align-items:flex-start;flex-direction:column}.variant-row{padding:.75rem}}
.inventory-table-toolbar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:1rem;margin-bottom:.75rem;padding:.8rem 1rem;border:1px solid #e4e9f2;border-radius:.8rem;background:#fff}
.inventory-toolbar-length,.inventory-toolbar-search{display:flex;align-items:center;gap:.5rem}.inventory-toolbar-length select{width:auto;min-width:74px}.inventory-toolbar-buttons{display:flex;justify-content:center;gap:.5rem}.inventory-toolbar-search{justify-content:flex-end}.inventory-toolbar-search input{width:230px}
@media(max-width:767.98px){.inventory-table-toolbar{grid-template-columns:1fr}.inventory-toolbar-length,.inventory-toolbar-buttons,.inventory-toolbar-search{justify-content:space-between}.inventory-toolbar-search input{width:100%}}
.transaction-table-toolbar{display:grid;grid-template-columns:auto auto 1fr auto;align-items:end;gap:1rem;margin-bottom:.75rem;padding:1rem;border:1px solid #e4e9f2;border-radius:.8rem;background:#fff}.transaction-date-filters{display:flex;align-items:end;gap:.5rem}.transaction-date-filters label{font-size:.78rem;font-weight:650}.transaction-date-filters .form-control{min-width:145px;margin-top:.25rem}.transaction-table-toolbar .inventory-toolbar-buttons{align-self:end}
.transaction-date-card{display:flex;flex-wrap:wrap;align-items:end;gap:.75rem}.transaction-date-card label{font-size:.78rem;font-weight:650}.transaction-date-card .form-control,.transaction-date-card .form-select{min-width:170px;margin-top:.25rem}
@media(max-width:1199.98px){.transaction-table-toolbar{grid-template-columns:1fr 1fr}.transaction-table-toolbar .inventory-toolbar-search{justify-content:flex-start}}@media(max-width:767.98px){.transaction-table-toolbar{grid-template-columns:1fr}.transaction-date-filters{flex-wrap:wrap}.transaction-table-toolbar .inventory-toolbar-length,.transaction-table-toolbar .inventory-toolbar-buttons,.transaction-table-toolbar .inventory-toolbar-search{justify-content:space-between}.transaction-table-toolbar .inventory-toolbar-search input{width:100%}}

/* Reusable UI primitives */
.table-responsive { scrollbar-width:thin; }
.service-table { --bs-table-bg:transparent; }
.table-page-footer {
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
    gap:.5rem;
    margin-top:.75rem;
}
.table-page-footer .pagination { margin-bottom:0; }
.ui-table-card .table-responsive { margin:0; }
.ui-table-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.5rem .75rem; padding:.65rem .75rem; border-bottom:1px solid var(--avm-border-subtle); background:#fff; }
.ui-table-toolbar-group { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; }
.ui-table-toolbar-search { width:min(100%,240px); }
.ui-filter { border:1px solid var(--avm-border); border-radius:var(--avm-radius); background:#fff; box-shadow:var(--avm-shadow); }
.ui-filter-body { display:flex; flex-wrap:wrap; align-items:end; gap:.6rem; padding:.75rem; }
.ui-filter-field { flex:1 1 150px; min-width:0; }
.ui-filter-actions,.filter-actions { display:flex; align-items:end; gap:.4rem; }
.filter-card .ui-card-body,.filter-card .service-card-body { padding:.75rem; }
.ui-form-card { overflow:hidden; border:1px solid var(--avm-border); border-radius:var(--avm-radius); background:#fff; box-shadow:var(--avm-shadow); }
.ui-form-section { padding:.875rem; }
.ui-form-section + .ui-form-section { border-top:1px solid var(--avm-border-subtle); }
.ui-form-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:center; gap:.4rem; padding:.7rem .875rem; border-top:1px solid var(--avm-border-subtle); background:var(--avm-surface-subtle); }
.ui-detail-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.75rem; }
.ui-detail-item { min-width:0; }
.ui-detail-label { display:block; margin-bottom:.15rem; color:var(--avm-text-muted); font-size:.7rem; font-weight:700; letter-spacing:.035em; text-transform:uppercase; }
.ui-detail-value { color:var(--avm-text); font-weight:650; }
.ui-stat-card { height:100%; padding:.75rem .875rem; border:1px solid var(--avm-border); border-radius:var(--avm-radius); background:#fff; box-shadow:var(--avm-shadow); }
.ui-stat-label { color:var(--avm-text-muted); font-size:.75rem; font-weight:650; }
.ui-stat-value { margin-top:.15rem; font-size:1.2rem; font-weight:750; line-height:1.25; }
.ui-back-link { display:inline-flex; align-items:center; gap:.3rem; margin-bottom:.5rem; font-size:.82rem; font-weight:650; text-decoration:none; }
.ui-content-sm { width:100%; max-width:680px; margin-inline:auto; }
.ui-badge { display:inline-flex; align-items:center; gap:.3rem; }
.ui-badge-neutral { color:#4d596c; background:#e9edf2; }
.ui-badge-primary { color:#17479f; background:#e8f0ff; }
.ui-badge-success { color:#0f6847; background:#dff4e9; }
.ui-badge-warning { color:#815009; background:#fff0cc; }
.ui-badge-danger { color:#a6263a; background:#fde4e8; }
.ui-badge-info { color:#145782; background:#e0f1fa; }
.ui-pagination { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.5rem; }
.ui-pagination .pagination { margin:0; }
.ui-pagination-summary { color:var(--avm-text-muted); font-size:.78rem; }
.workflow-links { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; }
.workflow-links-label { margin-right:.2rem; color:#3d4b62; font-weight:700; }

.modal-content { overflow:hidden; border:1px solid var(--avm-border-subtle); border-radius:var(--avm-radius-lg); box-shadow:var(--avm-shadow-lg); }
.modal-header,.modal-footer { padding:.75rem .9rem; border-color:var(--avm-border-subtle); }
.modal-header .modal-title { font-size:1rem; font-weight:750; }
.modal-body { padding:.875rem; }
.modal-footer { gap:.4rem; background:var(--avm-surface-subtle); }
.modal-footer > * { margin:0; }

@media (max-width: 767.98px) {
    :root { --avm-page-x: .75rem; }
    .app-page-header { align-items: stretch; }
    .app-page-actions { justify-content: stretch; }
    .app-page-actions .btn { flex: 1 1 auto; }
    .ui-card-body,.service-card-body,.modal-body { padding:.75rem; }
    .service-table > :not(caption) > * > * { padding:.55rem .65rem; }
    .table-responsive .service-table { min-width: 760px; }
    .table-page-footer { justify-content: center; text-align: center; }
    .workflow-links .btn { flex: 1 1 auto; }
    .ui-table-toolbar > * { flex:1 1 100%; }
    .ui-table-toolbar-search { width:100%; }
    .ui-filter-field { flex-basis:100%; }
    .ui-filter-actions { width:100%; }
    .ui-filter-actions .btn { flex:1 1 0; }
    .ui-pagination { justify-content:center; text-align:center; }
    .modal-footer { flex-wrap: nowrap; }
    .modal-footer .btn { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* Application navigation shell */
:root {
    --app-sidebar-width: 232px;
    --app-sidebar-collapsed-width: 68px;
    --app-topbar-height: 54px;
    --app-sidebar-bg: #152238;
    --app-sidebar-border: rgba(255, 255, 255, .075);
    --app-sidebar-text: #cbd5e5;
    --app-sidebar-muted: #91a0b7;
    --app-sidebar-active: #fff;
    --app-sidebar-active-bg: rgba(78, 130, 247, .22);
}

.ui-icon { display:block; flex:0 0 auto; }
.app-sidebar {
    position:fixed;
    inset:0 auto 0 0;
    z-index:1040;
    display:flex;
    width:var(--app-sidebar-width);
    flex-direction:column;
    overflow:hidden;
    color:var(--app-sidebar-text);
    background:var(--app-sidebar-bg);
    border-right:1px solid rgba(12, 22, 38, .28);
    transition:width .2s ease, transform .2s ease;
}
.app-sidebar-brand {
    display:flex;
    min-height:var(--app-topbar-height);
    align-items:center;
    padding:0 .75rem;
    border-bottom:1px solid var(--app-sidebar-border);
}
.app-sidebar-logo { display:flex; min-width:0; align-items:center; gap:.65rem; color:#fff; text-decoration:none; }
.app-sidebar-logo:hover { color:#fff; }
.app-sidebar-logo-mark { display:grid; width:38px; height:38px; flex:0 0 auto; place-items:center; overflow:visible; border:0; border-radius:0; background:transparent; }
.app-sidebar-logo-mark img { display:block; width:36px; height:36px; object-fit:contain; }
.app-sidebar-brand-text { overflow:hidden; font-size:.92rem; font-weight:750; letter-spacing:.025em; white-space:nowrap; }
.app-sidebar-nav { flex:1 1 auto; overflow-x:hidden; overflow-y:auto; padding:.55rem .5rem .8rem; scrollbar-width:thin; scrollbar-color:rgba(255,255,255,.18) transparent; }
.app-sidebar-link {
    display:flex;
    width:100%;
    min-height:38px;
    align-items:center;
    gap:.7rem;
    padding:.45rem .65rem;
    color:var(--app-sidebar-text);
    background:transparent;
    border:0;
    border-radius:var(--avm-radius-sm);
    font-size:.82rem;
    font-weight:600;
    line-height:1.25;
    text-align:left;
    text-decoration:none;
    white-space:nowrap;
    transition:color .15s ease, background-color .15s ease;
}
.app-sidebar-link:hover { color:#fff; background:rgba(255,255,255,.065); }
.app-sidebar-link.active { color:var(--app-sidebar-active); background:var(--app-sidebar-active-bg); }
.app-sidebar-link:focus-visible { outline:2px solid #7ba4ff; outline-offset:-2px; }
.app-sidebar-label { min-width:0; overflow:hidden; text-overflow:ellipsis; }
.app-sidebar-group { margin:.1rem 0; }
.app-sidebar-group-toggle { cursor:pointer; }
.app-sidebar-chevron { margin-left:auto; transition:transform .18s ease; }
.app-sidebar-group.is-open .app-sidebar-chevron { transform:rotate(90deg); }
.app-sidebar-submenu { display:none; margin:.12rem 0 .28rem 2.35rem; padding-left:.45rem; border-left:1px solid rgba(255,255,255,.11); }
.app-sidebar-group.is-open .app-sidebar-submenu { display:block; }
.app-sidebar-sublink { display:block; overflow:hidden; padding:.36rem .55rem; color:var(--app-sidebar-muted); border-radius:var(--avm-radius-sm); font-size:.77rem; font-weight:550; line-height:1.3; text-decoration:none; text-overflow:ellipsis; white-space:nowrap; }
.app-sidebar-sublink:hover { color:#fff; background:rgba(255,255,255,.055); }
.app-sidebar-sublink.active { color:#fff; background:rgba(78,130,247,.17); font-weight:650; }
.app-topbar {
    position:fixed;
    inset:0 0 auto var(--app-sidebar-width);
    z-index:1035;
    display:flex;
    height:var(--app-topbar-height);
    align-items:center;
    justify-content:space-between;
    gap:1rem;
    padding:0 1rem;
    background:rgba(255,255,255,.97);
    border-bottom:1px solid var(--avm-border);
    box-shadow:0 1px 3px rgba(20,35,65,.035);
    transition:left .2s ease;
    backdrop-filter:blur(8px);
}
.app-topbar-left { display:flex; min-width:0; align-items:center; gap:.6rem; }
.app-topbar-toggle { display:grid; width:34px; height:34px; flex:0 0 auto; place-items:center; padding:0; color:#536176; background:transparent; border:1px solid transparent; border-radius:var(--avm-radius-sm); }
.app-topbar-toggle:hover { color:var(--avm-primary); background:var(--avm-primary-soft); border-color:#dbe5fb; }
.app-topbar-toggle:focus-visible { outline:2px solid rgba(33,85,205,.35); outline-offset:1px; }
.app-topbar-company { min-width:0; overflow:hidden; color:var(--avm-text); font-size:.88rem; font-weight:700; text-decoration:none; text-overflow:ellipsis; white-space:nowrap; }
.app-topbar-company:hover { color:var(--avm-primary); }
.app-global-search{position:relative;width:min(440px,42vw);min-width:220px;margin-inline:auto}
.app-global-search-icon{position:absolute;z-index:2;top:50%;left:.68rem;display:grid;place-items:center;color:var(--avm-text-muted);transform:translateY(-50%);pointer-events:none}
.app-global-search input{width:100%;height:36px;padding:.4rem 2.2rem .4rem 2.15rem;color:var(--avm-text);background:var(--avm-surface-subtle);border:1px solid var(--avm-border);border-radius:7px;font-size:.82rem;outline:0}
.app-global-search input:focus{background:var(--avm-panel);border-color:#7aa2ff;box-shadow:0 0 0 .18rem rgba(33,85,205,.11)}
.app-global-search-results{position:absolute;z-index:1060;top:calc(100% + .42rem);right:0;left:0;max-height:min(420px,70vh);overflow-y:auto;padding:.3rem;background:var(--avm-panel);border:1px solid var(--avm-border);border-radius:8px;box-shadow:var(--avm-shadow-lg)}
.app-global-search-result{display:flex;width:100%;align-items:center;justify-content:space-between;gap:.75rem;padding:.55rem .62rem;color:var(--avm-text);background:transparent;border:0;border-radius:6px;text-align:left}
.app-global-search-result:hover,.app-global-search-result:focus{background:var(--avm-primary-soft);outline:0}
.app-global-search-result-main{display:flex;min-width:0;flex-direction:column}.app-global-search-result-main strong{overflow:hidden;font-size:.82rem;text-overflow:ellipsis;white-space:nowrap}.app-global-search-result-main small{overflow:hidden;color:var(--avm-text-muted);font-size:.7rem;text-overflow:ellipsis;white-space:nowrap}
.app-global-search-result-stock{flex:0 0 auto;color:var(--avm-success);font-size:.72rem;font-weight:750;white-space:nowrap}.app-global-search-result-stock.is-empty{color:var(--avm-danger)}
.app-global-search-message{padding:.8rem;color:var(--avm-text-muted);font-size:.78rem;text-align:center}
.global-product-modal{border-radius:8px}.global-product-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.55rem}.global-product-summary>div{min-width:0;padding:.65rem .72rem;background:var(--avm-surface-subtle);border:1px solid var(--avm-border-subtle);border-radius:7px}.global-product-summary span,.global-product-summary strong{display:block;overflow-wrap:anywhere}.global-product-summary span{color:var(--avm-text-muted);font-size:.68rem;font-weight:650}.global-product-summary strong{margin-top:.15rem;font-size:.88rem}.global-product-section-title{margin:0 0 .4rem;font-size:.78rem;font-weight:750;text-transform:uppercase}.global-product-table{border:1px solid var(--avm-border-subtle)}.global-product-table td,.global-product-table th{padding:.48rem .55rem}.global-product-location{display:flex;min-width:0;flex-direction:column}.global-product-location small{color:var(--avm-text-muted);font-size:.68rem}
.app-user-trigger { display:flex; min-width:0; align-items:center; gap:.55rem; padding:.25rem .35rem; color:var(--avm-text); background:transparent; border:1px solid transparent; border-radius:var(--avm-radius-sm); text-align:left; }
.app-user-trigger:hover,.app-user-trigger[aria-expanded="true"] { background:var(--avm-surface-subtle); border-color:var(--avm-border-subtle); }
.app-user-avatar { display:grid; width:30px; height:30px; flex:0 0 auto; place-items:center; border-radius:50%; color:#17479f; background:#e8f0ff; font-size:.76rem; font-weight:800; }
.app-user-copy { display:flex; max-width:190px; min-width:0; flex-direction:column; line-height:1.15; }
.app-user-copy strong,.app-user-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.app-user-copy strong { font-size:.78rem; font-weight:700; }
.app-user-copy small { margin-top:.12rem; color:var(--avm-text-muted); font-size:.68rem; }
.app-user-chevron { margin-left:.15rem; transform:rotate(90deg); color:var(--avm-text-muted); }
.app-user-dropdown { min-width:210px; padding:.35rem; border:1px solid var(--avm-border)!important; border-radius:var(--avm-radius); box-shadow:var(--avm-shadow-lg); }
.app-user-dropdown-summary { display:flex; min-width:0; flex-direction:column; padding:.45rem .55rem; }
.app-user-dropdown-summary strong { overflow:hidden; font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }
.app-user-dropdown-summary small { color:var(--avm-text-muted); font-size:.72rem; }
.app-user-dropdown .dropdown-divider { margin:.25rem 0; border-color:var(--avm-border-subtle); }
.app-user-dropdown .dropdown-item { padding:.45rem .55rem; border-radius:var(--avm-radius-sm); font-size:.8rem; }
.app-theme-toggle { display:flex; align-items:center; gap:.5rem; color:var(--avm-text); }
.app-theme-toggle-icon { display:grid; width:17px; height:17px; flex:0 0 17px; place-items:center; color:var(--avm-primary); font-size:.95rem; line-height:1; }
.app-logout-action { display:flex; align-items:center; gap:.5rem; color:var(--avm-danger); }
.app-sidebar-backdrop { display:none; position:fixed; inset:0; z-index:1038; padding:0; background:rgba(11,20,35,.45); border:0; }

html[data-theme="dark"] body { background:var(--avm-surface); color:var(--avm-text); }
html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .ui-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .app-user-dropdown,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .role-card,
html[data-theme="dark"] .role-permission-group,
html[data-theme="dark"] .product-summary-card,
html[data-theme="dark"] .inventory-summary-card,
html[data-theme="dark"] .quick-v03-card,
html[data-theme="dark"] .purchase-sheet,
html[data-theme="dark"] .purchase-entry-row {
    color:var(--avm-text);
    background:var(--avm-panel);
    border-color:var(--avm-border);
}
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .ui-card-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .service-card-header,
html[data-theme="dark"] .role-card-header,
html[data-theme="dark"] .role-permission-heading,
html[data-theme="dark"] .product-table-toolbar,
html[data-theme="dark"] .inventory-stock-card .inventory-table-toolbar,
html[data-theme="dark"] .quick-empty,
html[data-theme="dark"] .quick-v03-card-header {
    color:var(--avm-text);
    background:var(--avm-surface-subtle);
    border-color:var(--avm-border-subtle);
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea.form-control {
    color:var(--avm-text);
    background-color:#101724;
    border-color:var(--avm-border);
}
html[data-theme="dark"] .form-control::placeholder { color:#76849a; }
html[data-theme="dark"] .btn-light { color:var(--avm-text); background:#263244; border-color:var(--avm-border); }
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-primary { color:var(--avm-primary); border-color:#4b638f; }
html[data-theme="dark"] .table,
html[data-theme="dark"] .service-table,
html[data-theme="dark"] .avm-table { --bs-table-color:var(--avm-text); --bs-table-bg:transparent; --bs-table-border-color:var(--avm-border-subtle); color:var(--avm-text); }
html[data-theme="dark"] .table > thead th,
html[data-theme="dark"] .service-table thead th,
html[data-theme="dark"] .avm-table thead th,
html[data-theme="dark"] .product-catalog-card .service-table thead th,
html[data-theme="dark"] .inventory-stock-card .service-table thead th,
html[data-theme="dark"] .quick-v03-table thead th {
    color:#c3cce0;
    background:var(--avm-surface-subtle);
    border-color:var(--avm-border-subtle);
}
html[data-theme="dark"] .table tbody tr,
html[data-theme="dark"] .service-table tbody tr,
html[data-theme="dark"] .avm-table tbody tr,
html[data-theme="dark"] .quick-v03-table tbody tr { background:transparent; }
html[data-theme="dark"] .table tbody tr:hover,
html[data-theme="dark"] .service-table tbody tr:hover,
html[data-theme="dark"] .avm-table tbody tr:hover,
html[data-theme="dark"] .quick-v03-table tbody tr:hover { background:#1f2a3a; }
html[data-theme="dark"] .dropdown-item { color:var(--avm-text); }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .app-user-trigger:hover,
html[data-theme="dark"] .app-user-trigger[aria-expanded="true"] {
    color:var(--avm-text);
    background:var(--avm-surface-subtle);
}
html[data-theme="dark"] .app-user-avatar { color:#d8e5ff; background:#263b66; }
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .form-text,
html[data-theme="dark"] .small.text-secondary,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-body-secondary { color:var(--avm-text-muted)!important; }
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .border.bg-light { background:var(--avm-surface-subtle)!important; border-color:var(--avm-border)!important; }
html[data-theme="dark"] .alert-info { color:#d7ecff; background:#12314a; border-color:#245879; }
html[data-theme="dark"] .alert-success { color:#dff9ec; background:#123526; border-color:#246848; }
html[data-theme="dark"] .alert-danger { color:#ffe2e7; background:#3c1720; border-color:#713241; }
html[data-theme="dark"] .product-summary-icon,
html[data-theme="dark"] .inventory-summary-icon,
html[data-theme="dark"] .product-modal-mark,
html[data-theme="dark"] .ui-empty-icon { color:var(--avm-primary); background:var(--avm-primary-soft); }
html[data-theme="dark"] .ui-autocomplete,
html[data-theme="dark"] .product-modal-content .modal-header,
html[data-theme="dark"] .product-modal-content .modal-footer,
html[data-theme="dark"] .product-form-section,
html[data-theme="dark"] .product-form-guide,
html[data-theme="dark"] .purchase-total-strip,
html[data-theme="dark"] .quick-v03-total-box {
    color:var(--avm-text);
    background:var(--avm-panel);
    border-color:var(--avm-border);
}
html[data-theme="dark"] code { color:#ff8fb3; background:rgba(255,143,179,.08); }
html[data-theme="dark"] .pos-page { background:var(--avm-surface)!important; }
html[data-theme="dark"] .pos-cart-card,
html[data-theme="dark"] .pos-checkout-card {
    color:var(--avm-text)!important;
    background:var(--avm-panel)!important;
    border-color:var(--avm-border)!important;
}
html[data-theme="dark"] .pos-cart-search-bar { background:var(--avm-surface-subtle)!important; border-color:var(--avm-border-subtle)!important; }
html[data-theme="dark"] .pos-search-input,
html[data-theme="dark"] .pos-customer-field .form-control,
html[data-theme="dark"] .pos-cart-table .form-control,
html[data-theme="dark"] .pos-cart-table .form-select {
    color:var(--avm-text)!important;
    background:#101724!important;
    border-color:#58708f!important;
}
html[data-theme="dark"] .pos-search-input::placeholder { color:#8ea0b8!important; }
html[data-theme="dark"] .pos-cart-table { color:var(--avm-text)!important; }
html[data-theme="dark"] .pos-cart-table thead th { color:#dce6f5!important; background:#202b3a!important; border-color:var(--avm-border)!important; }
html[data-theme="dark"] .pos-cart-table tbody tr { border-color:var(--avm-border-subtle)!important; }
html[data-theme="dark"] .pos-cart-table tbody tr:hover { background:#1f2a3a!important; }
html[data-theme="dark"] .pos-cart-table tbody td,
html[data-theme="dark"] .pos-cart-table .pos-product,
html[data-theme="dark"] .pos-cart-table .pos-product b,
html[data-theme="dark"] .pos-cart-table .fw-semibold { color:var(--avm-text)!important; }
html[data-theme="dark"] .pos-cart-table .pos-stock,
html[data-theme="dark"] .pos-cart-table .small,
html[data-theme="dark"] .pos-cart-table small { color:var(--avm-text-muted)!important; }
html[data-theme="dark"] .pos-cart-table .amount { color:#dce6f5!important; }
html[data-theme="dark"] .pos-mini-total,
html[data-theme="dark"] .pos-previous-box {
    color:var(--avm-text)!important;
    background:#182233!important;
    border-color:var(--avm-border)!important;
}
html[data-theme="dark"] .pos-grand-total { background:rgba(125,164,255,.14)!important; border-color:#4b638f!important; }
html[data-theme="dark"] .pos-results,
html[data-theme="dark"] .list-group-item {
    color:var(--avm-text);
    background:var(--avm-panel);
    border-color:var(--avm-border-subtle);
}
html[data-theme="dark"] .list-group-item:hover { color:var(--avm-text); background:#1f2a3a; }
html[data-theme="dark"] .service-table td,
html[data-theme="dark"] .avm-table tbody td,
html[data-theme="dark"] .product-name-cell,
html[data-theme="dark"] .product-category-cell,
html[data-theme="dark"] .product-money-cell,
html[data-theme="dark"] .inventory-money,
html[data-theme="dark"] .inventory-qty,
html[data-theme="dark"] .inventory-category,
html[data-theme="dark"] .inventory-product-name,
html[data-theme="dark"] .avm-cell,
html[data-theme="dark"] .avm-cell-top,
html[data-theme="dark"] .dashboard-list-main strong,
html[data-theme="dark"] .dashboard-list-meta strong { color:var(--avm-text)!important; }
html[data-theme="dark"] .product-summary-card strong,
html[data-theme="dark"] .inventory-summary-card strong,
html[data-theme="dark"] .product-catalog-card .ui-card-header,
html[data-theme="dark"] .inventory-stock-card .ui-card-header { color:var(--avm-text)!important; }
html[data-theme="dark"] .product-summary-card small,
html[data-theme="dark"] .inventory-summary-card small,
html[data-theme="dark"] .product-sku-cell,
html[data-theme="dark"] .product-barcode-row span,
html[data-theme="dark"] .inventory-product-meta,
html[data-theme="dark"] .inventory-location-meta,
html[data-theme="dark"] .avm-cell-sub,
html[data-theme="dark"] .avm-cell-muted,
html[data-theme="dark"] .dashboard-list-main small,
html[data-theme="dark"] .dashboard-list-meta small { color:var(--avm-text-muted)!important; }
html[data-theme="dark"] .ui-table-toolbar,
html[data-theme="dark"] .ui-filter,
html[data-theme="dark"] .ui-form-card,
html[data-theme="dark"] .ui-stat-card,
html[data-theme="dark"] .inventory-table-toolbar,
html[data-theme="dark"] .transaction-table-toolbar,
html[data-theme="dark"] .product-modal-content .modal-header,
html[data-theme="dark"] .product-modal-content .modal-footer,
html[data-theme="dark"] .product-form-section,
html[data-theme="dark"] .product-package-row,
html[data-theme="dark"] .product-inline-panel,
html[data-theme="dark"] .product-type-choice,
html[data-theme="dark"] .variant-option-box,
html[data-theme="dark"] .variant-row,
html[data-theme="dark"] .purchase-total-strip {
    color:var(--avm-text)!important;
    background:var(--avm-panel)!important;
    border-color:var(--avm-border)!important;
}
html[data-theme="dark"] .product-create-body,
html[data-theme="dark"] .product-form-guide {
    color:var(--avm-text)!important;
    background:var(--avm-surface-subtle)!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .product-form-guide p,
html[data-theme="dark"] .product-form-steps span { color:var(--avm-text-muted)!important; }
html[data-theme="dark"] .product-form-steps .active { color:#dce8ff!important; }
html[data-theme="dark"] .badge.text-bg-light { color:#111827!important; background:#eef3ff!important; border-color:#cbd8ff!important; }
html[data-theme="dark"] .ui-badge-neutral { color:#d8e0ee; background:#2b3648; }
html[data-theme="dark"] .ui-badge-primary { color:#dce8ff; background:#28406d; }
html[data-theme="dark"] .ui-badge-success { color:#dff9ec; background:#1f5a3d; }
html[data-theme="dark"] .ui-badge-warning { color:#fff1c2; background:#6b4a16; }
html[data-theme="dark"] .ui-badge-danger { color:#ffe2e7; background:#6b2432; }
html[data-theme="dark"] .ui-badge-info { color:#d9f0ff; background:#1e4d68; }
html[data-theme="dark"] .sales-list-page { --sales-ink:var(--avm-text); --sales-muted:var(--avm-text-muted); }
html[data-theme="dark"] .sales-list-page .filter-toolbar,
html[data-theme="dark"] .sales-list-page .summary-item {
    color:var(--avm-text)!important;
    background:var(--avm-panel)!important;
    border-color:var(--avm-border)!important;
}
html[data-theme="dark"] .sales-list-page .filter-toolbar .ft-control {
    color:var(--avm-text)!important;
    background:#101724!important;
    border-color:#58708f!important;
}
html[data-theme="dark"] .sales-list-page .filter-toolbar .ft-control.is-active {
    color:#dce8ff!important;
    background:#28406d!important;
    border-color:#7da4ff!important;
}
html[data-theme="dark"] .sales-list-page .num,
html[data-theme="dark"] .sales-list-page .num-cell,
html[data-theme="dark"] .sales-list-page .num-total,
html[data-theme="dark"] .sales-list-page .s-count { color:var(--avm-text)!important; }
html[data-theme="dark"] .sales-list-page .s-total { color:#7da4ff!important; }
html[data-theme="dark"] .sales-list-page .s-paid,
html[data-theme="dark"] .sales-list-page .num-paid { color:#45c58b!important; }
html[data-theme="dark"] .sales-list-page .s-balance,
html[data-theme="dark"] .sales-list-page .num-balance { color:#ff6b83!important; }
html[data-theme="dark"] .sales-list-page .rec-cell .rec-no,
html[data-theme="dark"] .sales-list-page .status-stack small { color:var(--avm-text-muted)!important; }

/* Navbar partial and page main are siblings; this preserves all existing page markup. */
.app-topbar ~ main,
.app-topbar ~ .app-page,
.app-topbar ~ .pos-page,
.app-topbar ~ .adjust-page {
    margin-left:var(--app-sidebar-width);
    padding-top:calc(var(--app-topbar-height) + 1rem)!important;
    transition:margin-left .2s ease;
}
.app-impersonation-banner {
    position:fixed;
    top:var(--app-topbar-height);
    right:0;
    left:var(--app-sidebar-width);
    z-index:1039;
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    align-items:center;
    gap:.5rem;
    min-height:38px;
    padding:.45rem .9rem;
    color:#6b4100;
    background:#fff3cd;
    border-bottom:1px solid #f1d98f;
    box-shadow:0 .2rem .8rem rgba(80,60,20,.08);
}
body.app-service-impersonating .app-topbar ~ main,
body.app-service-impersonating .app-topbar ~ .app-page,
body.app-service-impersonating .app-topbar ~ .pos-page,
body.app-service-impersonating .app-topbar ~ .adjust-page {
    padding-top:calc(var(--app-topbar-height) + 48px + 1rem)!important;
}
.app-topbar ~ main.container,
.app-topbar ~ main.container-fluid { width:auto; }
body.app-sidebar-collapsed .app-sidebar { width:var(--app-sidebar-collapsed-width); }
body.app-sidebar-collapsed .app-topbar { left:var(--app-sidebar-collapsed-width); }
body.app-sidebar-collapsed .app-impersonation-banner { left:var(--app-sidebar-collapsed-width); }
body.app-sidebar-collapsed .app-topbar ~ main,
body.app-sidebar-collapsed .app-topbar ~ .app-page,
body.app-sidebar-collapsed .app-topbar ~ .pos-page,
body.app-sidebar-collapsed .app-topbar ~ .adjust-page { margin-left:var(--app-sidebar-collapsed-width); }
body.app-sidebar-collapsed .app-sidebar-brand { padding-inline:.9rem; }
body.app-sidebar-collapsed .app-sidebar-brand-text,
body.app-sidebar-collapsed .app-sidebar-label,
body.app-sidebar-collapsed .app-sidebar-chevron { display:none; }
body.app-sidebar-collapsed .app-sidebar-link { justify-content:center; padding-inline:.5rem; }
body.app-sidebar-collapsed .app-sidebar-group.is-open .app-sidebar-submenu { display:none; }

@media (max-width: 991.98px) {
    .app-sidebar { width:var(--app-sidebar-width); visibility:hidden; transform:translateX(-100%); box-shadow:var(--avm-shadow-lg); transition:transform .2s ease, visibility 0s linear .2s; }
    .app-topbar { left:0; padding-inline:.75rem; }
    .app-impersonation-banner { left:0; }
    .app-topbar ~ main,
    .app-topbar ~ .app-page,
    .app-topbar ~ .pos-page,
    .app-topbar ~ .adjust-page,
    body.app-sidebar-collapsed .app-topbar ~ main,
    body.app-sidebar-collapsed .app-topbar ~ .app-page,
    body.app-sidebar-collapsed .app-topbar ~ .pos-page,
    body.app-sidebar-collapsed .app-topbar ~ .adjust-page { margin-left:0; }
    body.app-sidebar-mobile-open { overflow:hidden; }
    body.app-sidebar-mobile-open .app-sidebar { visibility:visible; transform:translateX(0); transition-delay:0s; }
    body.app-sidebar-mobile-open .app-sidebar-backdrop { display:block; }
    body.app-sidebar-collapsed .app-sidebar { width:var(--app-sidebar-width); }
    body.app-sidebar-collapsed .app-sidebar-brand { padding:0 .75rem; }
    body.app-sidebar-collapsed .app-sidebar-brand-text,
    body.app-sidebar-collapsed .app-sidebar-label,
    body.app-sidebar-collapsed .app-sidebar-chevron { display:block; }
    body.app-sidebar-collapsed .app-sidebar-link { justify-content:flex-start; padding:.45rem .65rem; }
    body.app-sidebar-collapsed .app-sidebar-group.is-open .app-sidebar-submenu { display:block; }
}

@media (max-width: 575.98px) {
    .app-topbar { gap:.5rem; }
    .app-user-copy,.app-user-chevron { display:none; }
    .app-topbar-company { display:none; }
    .app-topbar-left{flex:0 0 auto}
    .app-global-search{width:auto;min-width:0;flex:1 1 auto;margin:0}
    .app-global-search input{font-size:.78rem}
    .global-product-summary{grid-template-columns:1fr}
}

/* Summary dashboard */
.dashboard-page { display:flex; flex-direction:column; gap:.72rem; }
.dashboard-page > .app-page-header { margin-bottom:0; }
.dashboard-page > .app-page-header h1 { margin-top:.08rem; font-size:1.42rem; }
.dashboard-page > .app-page-header p { margin-top:.12rem; font-size:.76rem; }
.dashboard-kpi-grid { display:flex; flex-wrap:wrap; gap:.6rem; }
.dashboard-kpi-grid > * { min-width:178px; flex:1 1 178px; }
.dashboard-kpi { display:flex; min-width:0; min-height:86px; align-items:flex-start; gap:.6rem; padding:.68rem .72rem; border:1px solid var(--avm-border-subtle); border-top:3px solid #d7dfeb; border-radius:var(--avm-radius); background:#fff; box-shadow:0 1px 2px rgba(20,45,90,.04); }
.dashboard-kpi-primary { border-top-color:var(--avm-primary); }
.dashboard-kpi-danger { border-top-color:var(--avm-danger); }
.dashboard-kpi-warning,.dashboard-kpi-expense { border-top-color:#d59124; }
.dashboard-kpi-purchase { border-top-color:#3d8f6f; }
.dashboard-kpi-supplier { border-top-color:#64748b; }
.dashboard-kpi-icon { display:grid; width:32px; height:32px; flex:0 0 32px; place-items:center; border-radius:7px; color:#fff; background:var(--avm-primary); }
.dashboard-kpi-danger .dashboard-kpi-icon { background:var(--avm-danger); }
.dashboard-kpi-expense .dashboard-kpi-icon { background:#d59124; }
.dashboard-kpi-purchase .dashboard-kpi-icon { background:#3d8f6f; }
.dashboard-kpi-supplier .dashboard-kpi-icon { background:#64748b; }
.dashboard-kpi small { display:block; color:var(--avm-text-muted); font-size:.66rem; font-weight:800; line-height:1.15; text-transform:uppercase; }
.dashboard-kpi strong { display:block; overflow:hidden; margin-top:.22rem; font-size:clamp(.98rem,1.16vw,1.18rem); line-height:1.14; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-kpi span:not(.dashboard-kpi-icon) { display:block; overflow:hidden; margin-top:.25rem; color:var(--avm-text-muted); font-size:.66rem; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-sales-card { overflow:visible; }
.dashboard-period-switch { display:inline-flex; gap:.15rem; padding:.18rem; border:1px solid var(--avm-border); border-radius:var(--avm-radius-sm); background:var(--avm-surface-subtle); }
.dashboard-period-switch button { min-height:28px; padding:.25rem .55rem; color:var(--avm-text-muted); background:transparent; border:0; border-radius:4px; font-size:.73rem; font-weight:650; }
.dashboard-period-switch button:hover { color:var(--avm-text); background:#fff; }
.dashboard-period-switch button.active { color:#fff; background:var(--avm-primary); box-shadow:0 1px 2px rgba(20,45,90,.12); }
.dashboard-period-switch button:focus-visible { outline:2px solid rgba(33,85,205,.35); outline-offset:1px; }
.dashboard-sales-layout { display:grid; grid-template-columns:minmax(0,1fr) 270px; min-height:215px; }
.dashboard-chart-panel { min-width:0; padding:.62rem .8rem .4rem; border-right:1px solid var(--avm-border-subtle); }
.dashboard-chart-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; min-height:24px; color:var(--avm-text-muted); font-size:.72rem; }
.dashboard-chart-legend { display:inline-flex; align-items:center; gap:.35rem; }
.dashboard-chart-legend i { width:16px; height:2px; background:var(--avm-primary); }
.dashboard-chart { width:100%; min-height:175px; overflow:hidden; }
.dashboard-chart svg { display:block; width:100%; height:175px; overflow:visible; }
.dashboard-chart-grid { stroke:#e7ebf2; stroke-width:1; }
.dashboard-chart-axis-label { fill:#7b8799; font-size:10px; }
.dashboard-chart-area { fill:rgba(33,85,205,.08); }
.dashboard-chart-line { fill:none; stroke:var(--avm-primary); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; }
.dashboard-chart-point { fill:#fff; stroke:var(--avm-primary); stroke-width:2; }
.dashboard-chart-single-bar { fill:rgba(33,85,205,.16); stroke:var(--avm-primary); stroke-width:1.5; }
.dashboard-period-summary { display:flex; flex-direction:column; justify-content:center; padding:.55rem .8rem; }
.dashboard-period-summary > div { display:flex; flex-direction:column; gap:.12rem; padding:.58rem 0; border-bottom:1px solid var(--avm-border-subtle); }
.dashboard-period-summary > div:last-child { border-bottom:0; }
.dashboard-period-summary span { color:var(--avm-text-muted); font-size:.72rem; }
.dashboard-period-summary strong { overflow-wrap:anywhere; font-size:.94rem; font-weight:750; }
.dashboard-operation-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; align-items:start; }
.dashboard-alert-grid,.dashboard-analytics-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; align-items:start; }
.dashboard-alert-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.dashboard-alert-grid .ui-table-card,.dashboard-analytics-grid .ui-table-card { min-width:0; box-shadow:none; }
.dashboard-operation-grid .ui-table-card { min-width:0; box-shadow:none; }
.dashboard-operation-grid .ui-card-header { min-height:50px; padding:.52rem .7rem; }
.dashboard-operation-grid .ui-card-header h2 { font-size:.88rem!important; }
.dashboard-operation-grid .ui-card-header .small { font-size:.68rem; }
.dashboard-view-all { font-size:.72rem; font-weight:700; text-decoration:none; white-space:nowrap; }
.dashboard-list-row { display:flex; min-width:0; min-height:50px; align-items:center; gap:.6rem; padding:.46rem .7rem; color:var(--avm-text); border-bottom:1px solid var(--avm-border-subtle); text-decoration:none; }
.dashboard-list-row:last-child { border-bottom:0; }
a.dashboard-list-row:hover { color:var(--avm-text); background:#f8faff; }
a.dashboard-list-row:focus-visible { outline:2px solid rgba(33,85,205,.3); outline-offset:-2px; }
.dashboard-list-main { display:flex; min-width:0; flex:1 1 auto; flex-direction:column; gap:.08rem; }
.dashboard-list-main strong,.dashboard-list-main small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-list-main strong { font-size:.77rem; font-weight:700; }
.dashboard-list-main small { color:var(--avm-text-muted); font-size:.68rem; }
.dashboard-list-meta { display:flex; min-width:85px; flex:0 0 auto; flex-direction:column; align-items:flex-end; gap:.08rem; text-align:right; }
.dashboard-list-meta strong { font-size:.76rem; font-weight:750; white-space:nowrap; }
.dashboard-list-meta small { color:var(--avm-text-muted); font-size:.65rem; white-space:nowrap; }
.dashboard-rank { display:grid; width:23px; height:23px; flex:0 0 auto; place-items:center; border-radius:50%; color:#345da8; background:#edf3ff; font-size:.66rem; font-weight:750; }
.dashboard-alert-dot { width:9px; height:9px; flex:0 0 9px; border-radius:50%; }
.dashboard-alert-dot-low { background:#d59124; }
.dashboard-alert-dot-out { background:var(--avm-danger); }
.dashboard-stock-empty strong,.dashboard-amount-due strong { color:var(--avm-danger); }
.dashboard-stock-low strong { color:#b7791f; }
.dashboard-bars { display:flex; flex-direction:column; gap:.5rem; padding:.68rem .72rem .75rem; }
.dashboard-bar-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(105px,34%); gap:.65rem; align-items:center; }
.dashboard-bar-label { min-width:0; }
.dashboard-bar-label strong,.dashboard-bar-label small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-bar-label strong { font-size:.74rem; }
.dashboard-bar-label small { color:var(--avm-text-muted); font-size:.64rem; }
.dashboard-bar-track { position:relative; height:22px; overflow:hidden; border-radius:5px; background:#eef3f8; }
.dashboard-bar-fill { height:100%; min-width:3px; border-radius:inherit; background:var(--avm-primary); }
.dashboard-bars-customers .dashboard-bar-fill { background:#3d8f6f; }
.dashboard-bar-value { position:absolute; inset:0 .42rem 0 auto; display:flex; align-items:center; justify-content:flex-end; color:#1d2736; font-size:.66rem; font-weight:750; }
.dashboard-staff-chart { min-height:305px; padding:.55rem .85rem .8rem; }
.dashboard-staff-chart svg { display:block; width:100%; height:300px; overflow:visible; }
.dashboard-staff-grid { stroke:#e1e6ef; stroke-width:1; }
.dashboard-staff-axis-label { fill:#6d7480; font-size:12px; }
.dashboard-staff-bar { fill:#2f4f9b; opacity:.96; }
.dashboard-operation-grid .ui-empty { padding:.85rem .7rem; }
.dashboard-quick-card { box-shadow:none; }
.dashboard-quick-card .ui-card-header { padding:.6rem .75rem; }
.dashboard-quick-actions { display:flex; flex-wrap:wrap; gap:.45rem; padding:.7rem .75rem; }
.dashboard-quick-actions .btn { display:inline-flex; align-items:center; gap:.4rem; }

@media (max-width: 991.98px) {
    .dashboard-kpi-grid > * { min-width:calc(50% - .3rem); }
    .dashboard-sales-layout { grid-template-columns:1fr; }
    .dashboard-chart-panel { border-right:0; border-bottom:1px solid var(--avm-border-subtle); }
    .dashboard-period-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; }
    .dashboard-period-summary > div { padding:.55rem 0; border-right:1px solid var(--avm-border-subtle); border-bottom:0; }
    .dashboard-period-summary > div:last-child { border-right:0; }
}
@media (max-width: 767.98px) {
    .dashboard-operation-grid { grid-template-columns:1fr; }
    .dashboard-alert-grid,.dashboard-analytics-grid { grid-template-columns:1fr; }
    .dashboard-period-switch { width:100%; }
    .dashboard-period-switch button { flex:1 1 0; }
}
@media (max-width: 575.98px) {
    .dashboard-kpi-grid > * { min-width:100%; }
    .dashboard-period-summary { grid-template-columns:1fr; gap:0; }
    .dashboard-period-summary > div { border-right:0; border-bottom:1px solid var(--avm-border-subtle); }
    .dashboard-list-row { gap:.45rem; padding-inline:.65rem; }
    .dashboard-list-row > .ui-badge { display:none; }
    .dashboard-list-meta { min-width:72px; }
    .dashboard-quick-actions .btn { flex:1 1 calc(50% - .45rem); justify-content:center; }
}

/* Inventory stock */
.inventory-summary-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;margin-bottom:.75rem}
.inventory-summary-card{display:flex;min-width:0;min-height:70px;align-items:center;gap:.65rem;padding:.72rem .85rem;border:1px solid #e5eaf3;border-radius:8px;background:#fff;box-shadow:0 2px 8px rgba(20,35,65,.045)}
.inventory-summary-card small{display:block;color:#778399;font-size:.68rem;font-weight:650}
.inventory-summary-card strong{display:block;overflow:hidden;margin-top:.05rem;color:#1d2a44;font-size:1.05rem;font-weight:800;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}
.inventory-summary-card span:not(.inventory-summary-icon){display:block;margin-top:.16rem;color:#7b8798;font-size:.65rem;line-height:1.25}
.inventory-summary-icon{display:grid;width:32px;height:32px;flex:0 0 auto;place-items:center;border-radius:8px;color:#2459d6;background:#edf3ff}
.inventory-summary-icon.success{color:#0f7a54;background:#e5f7ef}
.inventory-summary-icon.info{color:#6b4a00;background:#fff2cf}
.inventory-stock-card{border-color:#e2e8f2;border-radius:9px;box-shadow:0 2px 10px rgba(20,35,65,.05)}
.inventory-stock-card .ui-card-header{min-height:46px;padding:.62rem .75rem;background:#fff}
.inventory-stock-card .inventory-table-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.65rem .9rem;margin:0;padding:.68rem .75rem;border:0;border-top:1px solid var(--avm-border-subtle);border-radius:0;background:#fbfcff}
.inventory-toolbar-main{display:flex;flex:1 1 720px;flex-wrap:wrap;align-items:center;gap:.5rem}
.inventory-toolbar-actions{display:flex;flex:0 0 auto;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.4rem;margin-left:auto}
.inventory-search-field{flex:1 1 330px;max-width:520px}
.inventory-search-field .form-control{width:100%;min-height:34px;border-radius:7px;background:#fff}
.inventory-filter-pill{display:flex;align-items:center;gap:.42rem;margin:0;color:var(--avm-text-muted);font-size:.74rem;font-weight:650}
.inventory-filter-pill .form-select{min-height:34px;border-radius:7px;font-size:.78rem}
.inventory-location-filter .form-select{width:min(100vw - 2rem,260px)}
.inventory-filter-pill:not(.inventory-location-filter) .form-select{width:76px}
.inventory-stock-card .service-table > :not(caption) > * > *{padding:.52rem .72rem}
.inventory-stock-card .service-table thead th{height:38px;color:#64718a;background:#f7f9fd;font-size:.68rem;letter-spacing:.025em}
.inventory-stock-card .service-table tbody tr{height:52px}
.inventory-product-cell{min-width:0}
.inventory-product-name{font-size:.86rem;font-weight:750;line-height:1.22;word-break:break-word}
.inventory-product-meta{margin-top:.18rem;color:var(--avm-text-muted);font-size:.68rem;line-height:1.25}
.inventory-category{font-size:.78rem;font-weight:700}
.inventory-location-name{max-width:260px;overflow:hidden;font-size:.82rem;font-weight:750;line-height:1.25;text-overflow:ellipsis;white-space:nowrap}
.inventory-location-meta{margin-top:.16rem;color:var(--avm-text-muted);font-size:.68rem;line-height:1.25}
.inventory-qty{font-size:.9rem;font-weight:800;color:#1e2b44}
.inventory-money{font-size:.82rem;font-weight:700;color:#26344e;white-space:nowrap}
.inventory-value{font-weight:800}
@media(max-width:991.98px){.inventory-summary-strip{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-toolbar-actions{margin-left:0}.inventory-stock-card .service-table{min-width:900px}}
@media(max-width:575.98px){.inventory-summary-strip{grid-template-columns:1fr}.inventory-toolbar-main,.inventory-toolbar-actions,.inventory-search-field,.inventory-location-filter,.inventory-location-filter .form-select{width:100%;max-width:none}.inventory-toolbar-actions .btn{flex:1 1 0}.inventory-filter-pill{flex:1 1 auto}.inventory-filter-pill:not(.inventory-location-filter) .form-select{width:100%}}

/* Purchasing */
.purchase-sheet{border-color:#e2e8f2;border-radius:9px;box-shadow:0 2px 10px rgba(20,35,65,.05)}
.purchase-sheet .ui-card-header{min-height:46px;padding:.62rem .75rem;background:#fff}
.purchase-sheet .ui-card-body{padding:.7rem .8rem}
.purchase-sheet .ui-form-actions{padding:.65rem .8rem}
.purchase-entry-row{margin-bottom:.55rem;padding:.62rem .72rem;border:1px solid var(--avm-border);border-radius:8px;background:#fff}
.purchase-entry-row:last-child{margin-bottom:0}
.purchase-total-strip{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:.45rem .75rem;min-height:34px;padding:.42rem .55rem;border:1px solid #dbe5f4;border-radius:8px;background:#f8fbff}
.purchase-total-strip span{color:var(--avm-text-muted);font-size:.72rem}
.purchase-total-strip b{margin-left:.25rem;color:var(--avm-text);font-size:.85rem}
.quick-empty{padding:1.35rem .9rem;text-align:center;color:var(--avm-text-muted);border-top:1px solid var(--avm-border-subtle);background:#fbfcff}
.quick-empty-icon{display:grid;width:30px;height:30px;margin:0 auto .35rem;place-items:center;border-radius:8px;color:var(--avm-primary);background:#edf3ff;font-weight:800}
.quick-table input.form-control-sm{min-height:31px}
.quick-v03-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.75rem}
.quick-v03-title{margin:.12rem 0 .08rem;color:#14213b;font-size:1.08rem;font-weight:800;line-height:1.2}
.quick-v03-subtitle{color:var(--avm-text-muted);font-size:.78rem}
.quick-v03-card{margin-bottom:.75rem;border:1px solid #dfe7f3;border-radius:10px;background:#fff;box-shadow:0 2px 12px rgba(20,35,65,.045)}
.quick-v03-master{padding:.85rem .95rem}
.quick-v03-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.72rem}
.quick-v03-card .form-label{margin-bottom:.25rem;color:#48566f;font-size:.73rem;font-weight:750}
.quick-v03-card .form-control,.quick-v03-card .form-select{min-height:35px;border-radius:7px;font-size:.86rem}
.quick-v03-card-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.72rem .9rem;border-bottom:1px solid #e7edf6}
.quick-v03-card-header h2{margin:0;color:#14213b;font-size:.9rem;font-weight:800}
.quick-v03-card-header span{display:block;margin-top:.1rem;color:var(--avm-text-muted);font-size:.72rem}
.quick-v03-table-wrap{min-height:250px}
.quick-v03-table{min-width:780px}
.quick-v03-table thead th{height:38px;padding:.48rem .65rem;color:#64718a;background:#f6f8fc;border-bottom:1px solid #e3eaf5;font-size:.69rem;font-weight:800;letter-spacing:.02em;text-transform:uppercase}
.quick-v03-table tbody td{padding:.48rem .65rem;border-bottom:1px solid #edf2f8;font-size:.82rem}
.quick-v03-table tbody td strong{font-size:.83rem}
.quick-v03-footer{padding:.85rem .95rem}
.quick-v03-footer-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:.85rem;align-items:end}
.quick-v03-adjustments{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.62rem}
.quick-v03-total-box{display:grid;gap:.4rem;padding:.62rem .72rem;border:1px dashed #cbd8ea;border-radius:9px;background:#f8fbff}
.quick-v03-total-box div{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.quick-v03-total-box span{color:var(--avm-text-muted);font-size:.72rem;font-weight:700}
.quick-v03-total-box strong{color:#1d4ed8;font-size:.93rem;font-weight:850;white-space:nowrap}
.quick-v03-note-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.85rem;align-items:end;margin-top:.72rem;padding-top:.72rem;border-top:1px solid #e7edf6}
.quick-v03-actions{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}
.quick-v03-modal{border:0;border-radius:12px;box-shadow:0 18px 50px rgba(15,23,42,.18)}
.quick-v03-modal .modal-header,.quick-v03-modal .modal-footer{padding:.82rem .95rem}
.quick-v03-modal .modal-body{padding:.75rem .95rem}
@media(max-width:575.98px){.purchase-entry-row{padding:.6rem}.purchase-total-strip{justify-content:flex-start}}
@media(max-width:1199.98px){.quick-v03-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-v03-footer-grid{grid-template-columns:1fr}.quick-v03-adjustments{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:767.98px){.quick-v03-heading{flex-direction:column}.quick-v03-grid,.quick-v03-adjustments,.quick-v03-note-row{grid-template-columns:1fr}.quick-v03-actions{justify-content:stretch}.quick-v03-actions .btn{flex:1 1 auto}}
/*============================================================================
  AVM POS TABLE VISUAL CORE  (.avm-table)
  ============================================================================
  Centralize the AVM POS table visual standard (derived from the Sales List
  table) into REUSABLE classes. Visual-only; NO DataTables/search/export/
  pagination/footer-total functionality (those stay opt-in separately).

  Sales List reference values used below:
    thead: bg #f8f9fa (table-light), text #495057, uppercase, .8rem, 700, ls .03em
    th/td padding: .55rem .7rem
    rec-sub: .74rem/700/#6c757d/tabular-nums
    num: 600/tabular-nums/nowrap
    num-total:700 #212529  num-paid:700 #198754  num-balance:700 #dc3545
    badge:600/.72rem/.35em .55em/.4rem
    action: nowrap ; truncate: 170px ellipsis ; hover:#f8faff

  ADDITIVE / APPEND-ONLY. Existing .service-table/.ui-table/DataTables/
  component styles are NOT touched.
============================================================================*/
.avm-table-wrap{position:relative;width:100%;overflow-x:auto;scrollbar-width:thin}
.avm-table{margin-bottom:0;border-collapse:collapse;font-variant-numeric:tabular-nums}
.avm-table thead th{background:#f8f9fa;color:#495057;font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap;padding:.55rem .7rem;border-bottom:1px solid #e3eaf5;vertical-align:middle}
.avm-table tbody td{padding:.55rem .7rem;vertical-align:middle;border-color:#edf2f8;font-size:.85rem;color:#25324a}
.avm-table tbody tr{background:#fff;transition:background-color .15s ease}
.avm-table tbody tr:hover{background:#f8faff}
.avm-cell{display:block;line-height:1.3}
.avm-cell-top{font-size:.85rem}
.avm-cell-sub{display:block;font-size:.74rem;font-weight:700;color:#6c757d;font-variant-numeric:tabular-nums}
.avm-cell-muted{display:block;font-size:.74rem;color:#6c757d}
.avm-num{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.avm-num-total{font-weight:700;color:#212529}
.avm-num-paid{font-weight:700;color:#198754}
.avm-num-balance{font-weight:700;color:#dc3545}
.avm-badge{font-weight:600;letter-spacing:.02em;font-size:.72rem;padding:.35em .55em;border-radius:.4rem;display:inline-block;line-height:1}
.avm-actions{white-space:nowrap;text-align:right}
.avm-actions .btn{line-height:1}
.avm-actions .btn + .btn,
.avm-actions .btn + form,
.avm-actions form + .btn,
.avm-actions form + form{margin-left:.35rem}
.avm-truncate{max-width:170px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.avm-empty{text-align:center;color:#6c757d;padding:2rem .75rem}
.avm-table-footer{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:.5rem;padding:.7rem 1rem;border-top:1px solid #edf2f8;background:#f8f9fa;font-size:.82rem}
.avm-table-footer .pagination{margin:0}

/* Dark mode final overrides: keep these after page-specific styles. */
html[data-theme="dark"] body,
html[data-theme="dark"] .app-page,
html[data-theme="dark"] main {
    color:var(--avm-text)!important;
    background:var(--avm-surface)!important;
}
html[data-theme="dark"] .app-topbar {
    color:var(--avm-text)!important;
    background:rgba(23,32,45,.98)!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .app-topbar-toggle,
html[data-theme="dark"] .app-topbar-company,
html[data-theme="dark"] .app-user-trigger,
html[data-theme="dark"] .app-page-header h1,
html[data-theme="dark"] .dashboard-kpi strong,
html[data-theme="dark"] .dashboard-period-summary strong,
html[data-theme="dark"] .quick-v03-title,
html[data-theme="dark"] .quick-v03-card-header h2 {
    color:var(--avm-text)!important;
}
html[data-theme="dark"] .app-page-header p,
html[data-theme="dark"] .dashboard-kpi small,
html[data-theme="dark"] .dashboard-kpi span:not(.dashboard-kpi-icon),
html[data-theme="dark"] .dashboard-chart-heading,
html[data-theme="dark"] .dashboard-period-summary span,
html[data-theme="dark"] .dashboard-bar-label small,
html[data-theme="dark"] .quick-v03-subtitle,
html[data-theme="dark"] .quick-v03-card-header span,
html[data-theme="dark"] .quick-v03-card .form-label {
    color:var(--avm-text-muted)!important;
}
html[data-theme="dark"] .dashboard-kpi,
html[data-theme="dark"] .ui-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .service-card,
html[data-theme="dark"] .service-stat-card,
html[data-theme="dark"] .fee-summary,
html[data-theme="dark"] .quick-v03-card,
html[data-theme="dark"] .purchase-sheet,
html[data-theme="dark"] .product-summary-card,
html[data-theme="dark"] .inventory-summary-card,
html[data-theme="dark"] .role-card,
html[data-theme="dark"] .role-permission-group,
html[data-theme="dark"] .ui-form-card,
html[data-theme="dark"] .ui-stat-card,
html[data-theme="dark"] .ui-filter,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .list-group-item {
    color:var(--avm-text)!important;
    background:var(--avm-panel)!important;
    border-color:var(--avm-border)!important;
    box-shadow:var(--avm-shadow)!important;
}
html[data-theme="dark"] .dashboard-period-switch,
html[data-theme="dark"] .dashboard-bar-track,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer,
html[data-theme="dark"] .ui-card-header,
html[data-theme="dark"] .service-card-header,
html[data-theme="dark"] .ui-table-toolbar,
html[data-theme="dark"] .quick-empty,
html[data-theme="dark"] .quick-v03-card-header,
html[data-theme="dark"] .quick-v03-total-box,
html[data-theme="dark"] .avm-table-footer {
    color:var(--avm-text)!important;
    background:var(--avm-surface-subtle)!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .dashboard-period-switch button:hover {
    color:var(--avm-text)!important;
    background:#263244!important;
}
html[data-theme="dark"] .dashboard-chart-grid,
html[data-theme="dark"] .dashboard-staff-grid {
    stroke:#334155!important;
}
html[data-theme="dark"] .dashboard-chart-axis-label,
html[data-theme="dark"] .dashboard-staff-axis-label {
    fill:var(--avm-text-muted)!important;
}
html[data-theme="dark"] .dashboard-chart-area {
    fill:rgba(125,164,255,.12)!important;
}
html[data-theme="dark"] .dashboard-chart-point {
    fill:var(--avm-panel)!important;
}
html[data-theme="dark"] a.dashboard-list-row:hover,
html[data-theme="dark"] .avm-table tbody tr:hover {
    background:#1f2a3a!important;
}
html[data-theme="dark"] .avm-table,
html[data-theme="dark"] .avm-table thead th,
html[data-theme="dark"] .avm-table tbody td,
html[data-theme="dark"] .avm-table tbody tr {
    color:var(--avm-text)!important;
    background:transparent!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .avm-table thead th {
    color:#c3cce0!important;
    background:var(--avm-surface-subtle)!important;
}
html[data-theme="dark"] .avm-num-total,
html[data-theme="dark"] .avm-cell-top {
    color:var(--avm-text)!important;
}
html[data-theme="dark"] .avm-empty,
html[data-theme="dark"] .avm-cell-sub,
html[data-theme="dark"] .avm-cell-muted {
    color:var(--avm-text-muted)!important;
}
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .table-light,
html[data-theme="dark"] .border.bg-white,
html[data-theme="dark"] .border.bg-light {
    color:var(--avm-text)!important;
    background-color:var(--avm-surface-subtle)!important;
    border-color:var(--avm-border)!important;
}
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text,
html[data-theme="dark"] textarea.form-control,
html[data-theme="dark"] .quick-v03-card .form-control,
html[data-theme="dark"] .quick-v03-card .form-select {
    color:var(--avm-text)!important;
    background-color:#101724!important;
    border-color:#58708f!important;
}
html[data-theme="dark"] .form-control::placeholder {
    color:#8ea0b8!important;
}
html[data-theme="dark"] .dashboard-sales-layout,
html[data-theme="dark"] .dashboard-chart-panel,
html[data-theme="dark"] .dashboard-period-summary > div,
html[data-theme="dark"] .dashboard-list-row,
html[data-theme="dark"] .quick-v03-note-row,
html[data-theme="dark"] .quick-v03-card-header {
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .dashboard-rank,
html[data-theme="dark"] .quick-empty-icon,
html[data-theme="dark"] .product-summary-icon,
html[data-theme="dark"] .inventory-summary-icon {
    color:var(--avm-primary)!important;
    background:var(--avm-primary-soft)!important;
}

/* Broad dark fallbacks for pages with inline/page-local styles. */
html[data-theme="dark"] .pos-page,
html[data-theme="dark"] .adjust-page,
html[data-theme="dark"] .transfer-page,
html[data-theme="dark"] .sales-list-page {
    color:var(--avm-text)!important;
    background:var(--avm-surface)!important;
}
html[data-theme="dark"] .pos-cart-card,
html[data-theme="dark"] .pos-checkout-card,
html[data-theme="dark"] .pos-cart-table-wrap,
html[data-theme="dark"] .table-responsive,
html[data-theme="dark"] .transaction-date-card,
html[data-theme="dark"] .transfer-master,
html[data-theme="dark"] .transfer-panel,
html[data-theme="dark"] .adjust-card,
html[data-theme="dark"] .filter-toolbar,
html[data-theme="dark"] .summary-item {
    color:var(--avm-text)!important;
    background:var(--avm-panel)!important;
    border-color:var(--avm-border)!important;
}
html[data-theme="dark"] .pos-cart-search-bar,
html[data-theme="dark"] .pos-cart-table thead th,
html[data-theme="dark"] .transfer-panel-head,
html[data-theme="dark"] .adjust-head,
html[data-theme="dark"] .transfer-table thead th,
html[data-theme="dark"] .adjust-table thead th {
    color:#dce6f5!important;
    background:var(--avm-surface-subtle)!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .table,
html[data-theme="dark"] .table > :not(caption) > * > *,
html[data-theme="dark"] .service-table > :not(caption) > * > *,
html[data-theme="dark"] .pos-cart-table > :not(caption) > * > *,
html[data-theme="dark"] .transfer-table > :not(caption) > * > *,
html[data-theme="dark"] .adjust-table > :not(caption) > * > * {
    color:var(--avm-text)!important;
    background-color:transparent!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .table > thead th,
html[data-theme="dark"] .table-light th,
html[data-theme="dark"] thead.table-light th {
    color:#dce6f5!important;
    background-color:var(--avm-surface-subtle)!important;
    border-color:var(--avm-border-subtle)!important;
}
html[data-theme="dark"] .pos-empty,
html[data-theme="dark"] .transfer-empty,
html[data-theme="dark"] .adjust-empty,
html[data-theme="dark"] .ui-empty {
    color:var(--avm-text-muted)!important;
    background:var(--avm-panel)!important;
}
html[data-theme="dark"] .pos-product,
html[data-theme="dark"] .pos-product b,
html[data-theme="dark"] .service-table td,
html[data-theme="dark"] .table td,
html[data-theme="dark"] .fw-bold,
html[data-theme="dark"] .fw-semibold {
    color:var(--avm-text)!important;
}
html[data-theme="dark"] .pos-stock,
html[data-theme="dark"] small,
html[data-theme="dark"] .small,
html[data-theme="dark"] label,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .text-secondary,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-body-secondary {
    color:var(--avm-text-muted)!important;
}
html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .btn-outline-success,
html[data-theme="dark"] .btn-outline-danger,
html[data-theme="dark"] .btn-outline-info {
    background-color:transparent!important;
    border-color:#58708f!important;
}
html[data-theme="dark"] .btn-outline-primary { color:#9bb9ff!important; }
html[data-theme="dark"] .btn-outline-secondary { color:#c3cce0!important; }
html[data-theme="dark"] .btn-outline-success { color:#45c58b!important; border-color:#2f7b5a!important; }
html[data-theme="dark"] .btn-outline-danger { color:#ff8fa1!important; border-color:#8a3a4b!important; }
html[data-theme="dark"] .btn-outline-info { color:#67b7f7!important; border-color:#34698d!important; }
html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-success:hover,
html[data-theme="dark"] .btn-outline-danger:hover,
html[data-theme="dark"] .btn-outline-info:hover {
    color:var(--avm-text)!important;
    background-color:#263244!important;
}
html[data-theme="dark"] .nav-tabs,
html[data-theme="dark"] .nav-pills,
html[data-theme="dark"] .app-datatables,
html[data-theme="dark"] .dataTables_wrapper {
    color:var(--avm-text)!important;
}
html[data-theme="dark"] .nav-tabs .nav-link,
html[data-theme="dark"] .nav-pills .nav-link {
    color:var(--avm-primary)!important;
    background:transparent!important;
    border-color:#58708f!important;
}
html[data-theme="dark"] .nav-tabs .nav-link.active,
html[data-theme="dark"] .nav-pills .nav-link.active {
    color:#fff!important;
    background:var(--avm-primary)!important;
    border-color:var(--avm-primary)!important;
}
