:root {
    --primary: #37b24d;
    --primary-dark: #2f9e44;
    --surface: #ffffff;
    --soft: #f3f5f7;
    --line: #e7ebef;
    --text: #1f2937;
    --muted: #6b7280;
    --danger: #ef4444;
    --warning: #f59f00;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: #eef1f4;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { text-decoration: none; }
body.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2f9e44 0%, #7cd992 100%);
}
.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.brand-box { display: flex; gap: 14px; align-items: center; }
.brand-mark {
    width: 52px; height: 52px; display: grid; place-items: center;
    background: rgba(55,178,77,0.12); color: var(--primary);
    border-radius: 16px; font-size: 22px;
}
.brand-box h1 { font-size: 19px; margin: 0; font-weight: 700; }
.brand-box small, .user-chip small, .shift-chip span { color: var(--muted); display:block; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: 12px; color: #334155;
    padding: 12px 14px; border-radius: 14px; font-weight: 600;
}
.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(55,178,77,0.12); color: var(--primary-dark);
}
.sidebar-footer { border-top: 1px solid var(--line); padding-top: 18px; }
.user-chip { display: flex; align-items: center; gap: 12px; }
.shift-chip {
    border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 3px;
    background: #fff;
}
.shift-chip.open { background: rgba(55,178,77,0.08); border-color: rgba(55,178,77,0.18); }
.avatar {
    width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff;
    display: grid; place-items: center; font-weight: 700;
}
.content-area { padding: 24px; }
.topbar {
    background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 18px 22px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 18px;
}
.topbar h2 { margin: 0 0 4px; font-size: 24px; }
.page-wrap { display: grid; gap: 20px; }
.card-soft {
    background: #fff; border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}
.summary-card { padding: 18px; height: 100%; }
.summary-card .label { color: var(--muted); font-size: 14px; }
.summary-card .value { font-size: 28px; font-weight: 800; margin-top: 6px; }
.summary-card .sub { margin-top: 8px; color: var(--muted); font-size: 13px; }
.kpi-inline {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px dashed #e7ebef;
}
.kpi-inline:last-child { border-bottom: 0; }
.table thead th {
    color: var(--muted); font-weight: 700; font-size: 13px; background: #f9fafb;
}
.table td, .table th { vertical-align: middle; }
.form-control, .form-select, .form-control-sm, .form-select-sm {
    border-radius: 12px; border-color: #d7dee6;
}
.form-control, .form-select { min-height: 46px; }
textarea.form-control { min-height: 120px; }
.btn { border-radius: 12px; font-weight: 600; }
.btn-success { background: var(--primary); border-color: var(--primary); }
.btn-success:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.login-card {
    width: min(94vw, 420px); background: rgba(255,255,255,0.95); border-radius: 22px;
    padding: 28px; box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}
.login-card .logo-pill {
    width: 74px; height: 74px; border-radius: 20px; background: rgba(55,178,77,0.12);
    display: grid; place-items:center; color: var(--primary); font-size: 30px; margin-bottom: 16px;
}
.pos-body { background: #e8edf0; }
.pos-shell { display: grid; grid-template-columns: 1.25fr 0.75fr; min-height: 100vh; }
.pos-left, .pos-right { padding: 18px; }
.pos-left { background: #f3f5f7; }
.pos-header {
    background: var(--primary); color: #fff; border-radius: 20px; padding: 18px 20px;
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 14px;
}
.pos-header h1 { font-size: 20px; margin: 0; }
.pos-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.product-card {
    background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: 0.2s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15,23,42,0.08); }
.product-thumb {
    height: 112px; background: linear-gradient(135deg, rgba(55,178,77,0.22), rgba(55,178,77,0.05));
    display: grid; place-items: center; color: var(--primary-dark); font-size: 30px;
}
.product-card .body { padding: 12px; }
.ticket-card {
    background: #fff; border-radius: 20px; border: 1px solid var(--line);
    min-height: calc(100vh - 36px); display: flex; flex-direction: column; overflow: hidden;
}
.ticket-head { background: #fff; padding: 18px; border-bottom: 1px solid var(--line); }
.ticket-list { padding: 12px 18px; flex: 1; overflow: auto; }
.ticket-item {
    display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 0; border-bottom: 1px dashed #e1e5ea;
}
.ticket-foot { padding: 18px; border-top: 1px solid var(--line); background: #fbfcfd; }
.category-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.category-pills a {
    padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
    color: #334155; font-weight: 600;
}
.category-pills a.active, .category-pills a:hover { background: rgba(55,178,77,0.12); color: var(--primary-dark); }
.receipt-box { width: 380px; max-width: 100%; margin: 20px auto; background: #fff; padding: 24px; border: 1px dashed #cfd6dd; }
.empty-state { text-align: center; color: var(--muted); padding: 42px 16px; }
.soft-label {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
    background: rgba(55,178,77,0.12); color: var(--primary-dark); font-weight: 700; font-size: 12px;
}
.hold-list { display: grid; gap: 10px; margin-top: 14px; }
.hold-item {
    border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.filter-card { padding: 14px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.barcode-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.barcode-label {
    background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px;
    display: grid; gap: 6px; align-content: start;
}
.barcode-label svg { width: 100%; height: 70px; }
.small-muted { color: var(--muted); font-size: 13px; }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.print-only { display: none; }
@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .barcode-sheet { grid-template-columns: repeat(3, 1fr); }
    .barcode-label { break-inside: avoid; }
    .print-only { display: block; }
}
@media (max-width: 1200px) {
    .report-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .pos-shell { grid-template-columns: 1fr; }
    .ticket-card { min-height: auto; }
    .topbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
    .report-grid { grid-template-columns: 1fr; }
    .content-area { padding: 16px; }
    .pos-left, .pos-right { padding: 12px; }
}

.content-area { min-width: 0; }
.topbar-actions .btn { white-space: nowrap; }
.mobile-header,
.mobile-bottom-nav { display: none; }
.mobile-drawer { width: min(88vw, 320px) !important; }
.mobile-drawer .offcanvas-body { padding: 18px; }
.mobile-nav-links .nav-link { font-size: 15px; }
.table-responsive { width: 100%; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #d6dee6; border-radius: 999px; }

@media (max-width: 991px) {
    body { padding-bottom: 78px; }
    .mobile-header {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 1030;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid var(--line);
        padding: 12px 14px;
    }
    .mobile-header-title {
        min-width: 0;
        flex: 1;
        display: grid;
        line-height: 1.1;
    }
    .mobile-header-title strong,
    .mobile-header-title small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-header-title strong { font-size: 14px; }
    .mobile-header-title small { font-size: 11px; color: var(--muted); }
    .mobile-menu-btn {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        border-color: var(--line);
        padding: 0;
    }
    .app-shell { grid-template-columns: 1fr; min-height: auto; }
    .sidebar { display: none !important; }
    .content-area {
        padding: 14px;
        padding-bottom: 92px;
    }
    .topbar {
        border-radius: 16px;
        padding: 16px;
        gap: 12px;
        margin-bottom: 16px;
    }
    .topbar h2 { font-size: 20px; }
    .topbar p { font-size: 13px; }
    .topbar-actions { width: 100%; }
    .topbar-actions .btn { flex: 1 1 0; }
    .page-wrap { gap: 16px; }
    .card-soft { border-radius: 16px; }
    .summary-card { padding: 16px; }
    .summary-card .value { font-size: 24px; }
    .filter-card { padding: 12px; border-radius: 14px; }
    .kpi-inline { gap: 8px; }
    .hold-item {
        align-items: flex-start;
        flex-direction: column;
    }
    .hold-item > div:last-child {
        width: 100%;
        display: flex;
    }
    .hold-item > div:last-child a {
        flex: 1 1 0;
    }
    .ticket-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .ticket-item .text-end { text-align: left !important; }
    .ticket-item .btn { width: 100%; }
    .ticket-head,
    .ticket-list,
    .ticket-foot { padding-left: 14px; padding-right: 14px; }
    .pos-shell {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: auto;
    }
    .pos-left,
    .pos-right { padding: 12px; }
    .pos-header {
        padding: 16px;
        border-radius: 18px;
        flex-direction: column;
        align-items: flex-start;
    }
    .pos-header .d-flex { width: 100%; }
    .filter-card form .btn { min-height: 44px; }
    .category-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }
    .category-pills a { white-space: nowrap; }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .product-thumb { height: 96px; }
    .product-card .body { padding: 10px; }
    .product-card .body .d-flex { gap: 8px; align-items: flex-start !important; flex-direction: column; }
    .ticket-card {
        min-height: auto;
        border-radius: 18px;
    }
    .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .barcode-sheet { grid-template-columns: 1fr; }
    .table-responsive .table { min-width: 640px; }
    .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1040;
        background: rgba(255,255,255,0.98);
        backdrop-filter: blur(10px);
        border-top: 1px solid var(--line);
        padding: 8px 8px max(8px, env(safe-area-inset-bottom));
        box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.08);
    }
    .mobile-bottom-nav a {
        display: grid;
        place-items: center;
        gap: 3px;
        color: #475569;
        padding: 6px 4px;
        border-radius: 14px;
        font-size: 11px;
        font-weight: 700;
        text-align: center;
    }
    .mobile-bottom-nav a i { font-size: 18px; line-height: 1; }
    .mobile-bottom-nav a.active,
    .mobile-bottom-nav a:hover {
        color: var(--primary-dark);
        background: rgba(55,178,77,0.12);
    }
}

@media (max-width: 767px) {
    .row > [class*="col-"] + [class*="col-"] { margin-top: 0; }
    .topbar-actions { flex-direction: row; }
    .report-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575px) {
    .content-area { padding: 12px; padding-bottom: 92px; }
    .topbar { padding: 14px; }
    .topbar-actions { flex-direction: column; align-items: stretch !important; }
    .topbar-actions .btn { width: 100%; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-thumb { height: 84px; }
    .summary-card .value { font-size: 22px; }
    .brand-box h1 { font-size: 17px; }
    .table-responsive .table { min-width: 560px; }
}

@media (max-width: 420px) {
    .product-grid { grid-template-columns: 1fr 1fr; }
    .product-card .body { padding: 9px; }
    .product-card .body .fw-bold.text-truncate {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .mobile-bottom-nav a span { font-size: 10px; }
}


/* ---- Responsive and motion enhancement patch ---- */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
img, svg, canvas, iframe, video, table, .table, .form-control, .form-select, .input-group, .btn-group {
    max-width: 100%;
}
.page-wrap, .page-wrap > *, .content-area, .content-area > *, .card-soft, .filter-card, .topbar,
.pos-panel, .ticket-card, .product-card, .hold-item, .receipt-box, .offcanvas, .offcanvas-body,
.row, .row > [class*="col-"], .d-flex, .table-responsive {
    min-width: 0;
}
.page-wrap .row,
.card-soft .row,
.filter-card .row,
.ticket-card .row,
form.row {
    --bs-gutter-x: 1rem;
}
.brand-box h1,
.topbar h2,
.topbar p,
.mobile-header-title strong,
.mobile-header-title small,
.summary-card .label,
.summary-card .sub,
.kpi-inline span,
.kpi-inline strong,
.table td,
.table th,
.btn,
.nav-link span,
.form-label,
.form-check-label {
    overflow-wrap: anywhere;
}
.btn,
.form-control,
.form-select,
.card-soft,
.filter-card,
.topbar,
.product-card,
.ticket-card,
.mobile-header,
.mobile-bottom-nav,
.sidebar .nav-link,
.brand-mark,
.category-pills a,
.hold-item,
.shift-chip {
    transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease, border-color .22s ease, color .22s ease, opacity .22s ease;
}
.btn:hover,
.category-pills a:hover,
.sidebar .nav-link:hover,
.mobile-bottom-nav a:hover,
.hold-item:hover,
.card-soft:hover,
.filter-card:hover,
.product-card:hover,
.ticket-card:hover {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}
.btn:active,
.mobile-bottom-nav a:active,
.sidebar .nav-link:active,
.category-pills a:active,
.product-card:active {
    transform: scale(.985);
}
.topbar,
.card-soft,
.filter-card,
.product-card,
.ticket-card,
.pos-panel,
.mobile-header,
.mobile-bottom-nav {
    position: relative;
    isolation: isolate;
}
.topbar::before,
.card-soft::before,
.filter-card::before,
.ticket-card::before,
.product-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));
    opacity: .55;
    z-index: -1;
}
.animate-in {
    opacity: 0;
    transform: translateY(12px) scale(.985);
}
.animate-in.in-view {
    opacity: 1;
    transform: none;
}
.mobile-quick-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    display: grid;
    place-items: center;
}
@media (max-width: 991px) {
    .mobile-header {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        align-items: center;
        gap: 10px;
    }
    .mobile-header-title {
        display: grid;
        gap: 2px;
        min-width: 0;
        line-height: 1.15;
    }
    .mobile-header-title strong {
        font-size: 16px;
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-header-title small {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--muted);
    }
    .content-area {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
        padding-inline: 12px;
        padding-bottom: 96px;
    }
    .topbar {
        width: 100%;
        max-width: 100%;
        margin-inline: 0;
        padding: 14px;
    }
    .topbar h2 {
        font-size: 1.95rem;
        line-height: 1.08;
        margin-bottom: 6px;
    }
    .topbar p {
        font-size: 13px;
        line-height: 1.45;
        margin-bottom: 0;
    }
    .topbar-actions {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .topbar-actions .btn {
        width: 100%;
        margin: 0;
    }
    .page-wrap .row,
    .card-soft .row,
    .filter-card .row,
    form.row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100%;
        max-width: 100%;
    }
    .page-wrap .row > [class*="col-"],
    .card-soft .row > [class*="col-"],
    .filter-card .row > [class*="col-"],
    form.row > [class*="col-"] {
        padding-left: .45rem !important;
        padding-right: .45rem !important;
    }
    .card-soft,
    .filter-card,
    .pos-panel,
    .ticket-card,
    .hold-item,
    .summary-card {
        border-radius: 18px;
    }
    .summary-card {
        padding: 18px 16px;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-responsive .table {
        min-width: 100%;
    }
    .mobile-bottom-nav {
        display: grid !important;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
    }
    .mobile-bottom-nav a {
        min-width: 0;
    }
    .mobile-drawer .offcanvas-body {
        overflow-x: hidden;
    }
}
@media (max-width: 767px) {
    .topbar {
        gap: 12px;
    }
    .topbar h2 {
        font-size: 1.65rem;
    }
    .report-grid {
        grid-template-columns: 1fr;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .product-card .body,
    .ticket-head,
    .ticket-list,
    .ticket-foot,
    .filter-card,
    .card-soft.p-4,
    .card-soft.p-3 {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}
@media (max-width: 575px) {
    body {
        padding-bottom: 78px;
    }
    .content-area {
        padding: 10px 10px 96px;
    }
    .topbar-actions {
        grid-template-columns: 1fr;
    }
    .topbar h2 {
        font-size: 1.4rem;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .product-thumb {
        height: 88px;
    }
    .mobile-bottom-nav {
        gap: 2px;
    }
    .mobile-bottom-nav a {
        padding-inline: 2px;
    }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* polished mobile drawer */
@media (max-width: 991px) {
    .mobile-header {
        border-radius: 0 0 18px 18px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    }
    .mobile-header-title {
        gap: 4px;
    }
    .mobile-header-title small {
        order: -1;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--primary-dark);
    }
    .mobile-header-title strong {
        font-size: 17px;
    }
    .mobile-menu-btn,
    .mobile-quick-btn {
        border-radius: 14px;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    }
    .mobile-drawer {
        width: min(84vw, 340px) !important;
        background: linear-gradient(180deg, rgba(247,250,248,0.98), rgba(255,255,255,0.96));
        border: 0 !important;
        border-radius: 0 26px 26px 0;
        box-shadow: 0 28px 80px rgba(15, 23, 42, 0.22);
        overflow: hidden;
    }
    .mobile-drawer::before {
        content: '';
        position: absolute;
        top: -72px;
        right: -56px;
        width: 180px;
        height: 180px;
        border-radius: 50%;
        background: radial-gradient(circle at center, rgba(55,178,77,0.20), rgba(55,178,77,0));
        pointer-events: none;
    }
    .mobile-drawer .offcanvas-header {
        align-items: flex-start;
    }
    .mobile-drawer-header {
        padding: 18px 18px 8px;
        border-bottom: 0 !important;
        gap: 12px;
    }
    .mobile-drawer-hero {
        min-width: 0;
        flex: 1;
        display: flex;
        gap: 12px;
        align-items: flex-start;
        padding: 16px;
        border-radius: 24px;
        border: 1px solid rgba(255,255,255,0.75);
        background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(237,247,239,0.92));
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 16px 34px rgba(55,178,77,0.08);
    }
    .drawer-brand-avatar {
        width: 52px;
        height: 52px;
        border-radius: 18px;
        display: grid;
        place-items: center;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: #fff;
        font-weight: 800;
        font-size: 18px;
        letter-spacing: 0.06em;
        flex: 0 0 52px;
        box-shadow: 0 12px 28px rgba(55,178,77,0.26);
    }
    .drawer-brand-copy {
        min-width: 0;
        flex: 1;
    }
    .drawer-brand-copy h5 {
        margin: 0;
        font-size: 18px;
        line-height: 1.2;
        font-weight: 800;
        letter-spacing: -0.02em;
        color: #122033;
    }
    .drawer-brand-copy p {
        margin: 5px 0 12px;
        font-size: 12px;
        line-height: 1.45;
        color: var(--muted);
    }
    .drawer-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .drawer-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 10px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
        color: #274036;
        background: rgba(55,178,77,0.10);
        border: 1px solid rgba(55,178,77,0.12);
    }
    .drawer-pill.is-open {
        background: rgba(55,178,77,0.16);
    }
    .drawer-pill.is-closed {
        background: rgba(107,114,128,0.10);
        border-color: rgba(107,114,128,0.12);
        color: #475569;
    }
    .drawer-pill .bi-dot {
        font-size: 14px;
        margin: -2px -4px -2px -6px;
    }
    .mobile-drawer-close {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 16px;
        display: grid;
        place-items: center;
        background: rgba(255,255,255,0.95);
        border: 1px solid rgba(226,232,240,0.95);
        color: #64748b;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
        transition: transform .25s ease, background .25s ease, color .25s ease;
    }
    .mobile-drawer-close:hover,
    .mobile-drawer-close:active {
        background: #fff;
        color: #0f172a;
        transform: rotate(90deg) scale(0.96);
    }
    .mobile-drawer .offcanvas-body {
        padding: 8px 18px 18px;
        overflow-x: hidden;
    }
    .mobile-nav-links {
        display: grid;
        gap: 10px;
        margin-top: 4px;
    }
    .mobile-nav-links .nav-link {
        position: relative;
        overflow: hidden;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        border-radius: 18px;
        background: rgba(255,255,255,0.82);
        border: 1px solid rgba(226,232,240,0.96);
        color: #22324a;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
        transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, border-color .28s ease, background .28s ease;
    }
    .mobile-nav-links .nav-link::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, rgba(55,178,77,0.08), rgba(55,178,77,0));
        opacity: 0;
        transition: opacity .25s ease;
    }
    .mobile-nav-links .nav-link::after {
        content: '\F285';
        font-family: 'bootstrap-icons';
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 14px;
        opacity: .28;
        transition: transform .25s ease, opacity .25s ease;
    }
    .mobile-nav-links .nav-link i {
        position: relative;
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border-radius: 14px;
        background: linear-gradient(135deg, rgba(55,178,77,0.14), rgba(55,178,77,0.03));
        color: var(--primary-dark);
        font-size: 18px;
        box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
    }
    .mobile-nav-links .nav-link span {
        position: relative;
        display: block;
        padding-right: 22px;
        font-size: 15px;
        font-weight: 700;
        letter-spacing: -0.01em;
    }
    .mobile-nav-links .nav-link:hover,
    .mobile-nav-links .nav-link:active,
    .mobile-nav-links .nav-link.active {
        transform: translateX(4px);
        border-color: rgba(55,178,77,0.20);
        background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(240,251,243,0.98));
        box-shadow: 0 16px 34px rgba(55,178,77,0.10);
        color: #173222;
    }
    .mobile-nav-links .nav-link:hover::before,
    .mobile-nav-links .nav-link:active::before,
    .mobile-nav-links .nav-link.active::before {
        opacity: 1;
    }
    .mobile-nav-links .nav-link:hover::after,
    .mobile-nav-links .nav-link:active::after,
    .mobile-nav-links .nav-link.active::after {
        opacity: .52;
        transform: translateY(-50%) translateX(3px);
    }
    .mobile-drawer .sidebar-footer {
        margin-top: 14px !important;
        padding: 14px;
        border-radius: 22px;
        background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,248,251,0.96));
        border: 1px solid rgba(226,232,240,0.92);
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    }
    .mobile-drawer .sidebar-footer .small {
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        font-size: 10px;
    }
    .mobile-drawer .shift-chip,
    .mobile-drawer .user-chip {
        background: #fff;
        border: 1px solid rgba(226,232,240,0.95);
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    }
    .mobile-drawer .btn.w-100.mt-3 {
        border-radius: 16px;
        font-weight: 700;
        min-height: 46px;
    }
    .mobile-drawer.show .mobile-nav-links .nav-link,
    .mobile-drawer.drawer-opening .mobile-nav-links .nav-link {
        animation: drawerNavIn .42s both;
        animation-delay: calc(var(--item-index, 0) * 45ms + 60ms);
    }
    .mobile-drawer.drawer-closing .mobile-nav-links .nav-link {
        animation: drawerNavOut .20s both;
    }
    body.drawer-open .mobile-bottom-nav {
        opacity: 0;
        transform: translateY(120%);
        pointer-events: none;
    }
    .offcanvas-backdrop.show {
        background: rgba(15,23,42,0.32);
        backdrop-filter: blur(7px);
        -webkit-backdrop-filter: blur(7px);
    }
}

@keyframes drawerNavIn {
    from {
        opacity: 0;
        transform: translateX(-18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes drawerNavOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-12px) scale(0.98);
    }
}


/* ---- mobile bottom nav and POS responsive fix ---- */
.mobile-bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100vw !important;
    max-width: 100vw !important;
    z-index: 1085 !important;
    margin: 0 !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    isolation: auto;
}
.mobile-bottom-nav::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.99));
    z-index: -1;
}
.mobile-bottom-nav a {
    min-width: 0;
}

.pos-mobile-switcher {
    display: none;
}

@media (max-width: 991px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }
    body {
        padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    }
    body.pos-body {
        padding-bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    }
    .app-shell,
    .content-area,
    .page-wrap,
    .pos-shell,
    .pos-left,
    .pos-right {
        min-width: 0;
        max-width: 100%;
    }
    .mobile-bottom-nav {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        gap: 6px;
        min-height: calc(64px + env(safe-area-inset-bottom));
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid rgba(226, 232, 240, 0.95);
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.12);
    }
    .mobile-bottom-nav a {
        min-height: 48px;
        align-content: center;
        justify-items: center;
        border-radius: 16px;
    }
    .mobile-bottom-nav a span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pos-shell {
        display: block;
        min-height: auto;
    }
    .pos-left,
    .pos-right {
        padding: 0;
    }
    .pos-header {
        border-radius: 18px;
        padding: 16px;
        gap: 12px;
        margin-bottom: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    .pos-header > div {
        width: 100%;
        min-width: 0;
    }
    .pos-header .d-flex {
        width: 100%;
        justify-content: stretch !important;
    }
    .pos-header .btn,
    .pos-header .soft-label {
        flex: 1 1 0;
        text-align: center;
        justify-content: center;
    }
    .pos-mobile-switcher {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        position: sticky;
        top: 76px;
        z-index: 1020;
        margin: 0 0 12px;
        padding: 10px;
        border-radius: 18px;
        background: rgba(255,255,255,0.88);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(226, 232, 240, 0.9);
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
    }
    .pos-mobile-switcher .switch-btn {
        border: 1px solid rgba(203, 213, 225, 0.95);
        background: #fff;
        color: #334155;
        min-height: 46px;
        border-radius: 14px;
        font-weight: 800;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all .24s ease;
    }
    .pos-mobile-switcher .switch-btn .badge {
        min-width: 24px;
    }
    .pos-mobile-switcher .switch-btn.active {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        border-color: transparent;
        color: #fff;
        box-shadow: 0 14px 30px rgba(55, 178, 77, 0.26);
        transform: translateY(-1px);
    }

    .pos-left,
    .pos-right {
        display: block;
    }
    .pos-shell.mobile-products .pos-right {
        display: none;
    }
    .pos-shell.mobile-ticket .pos-left {
        display: none;
    }
    .filter-card,
    .ticket-card {
        border-radius: 18px;
    }
    .category-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .category-pills::-webkit-scrollbar {
        display: none;
    }
    .category-pills a {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .product-card {
        border-radius: 18px;
    }
    .product-card .body {
        padding: 12px;
    }
    .product-card .body .d-flex {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 4px;
        align-items: start !important;
    }
    .product-thumb {
        height: 96px;
    }
    .ticket-card {
        min-height: auto;
        overflow: visible;
    }
    .ticket-head,
    .ticket-list,
    .ticket-foot {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    .ticket-list {
        max-height: none;
        overflow: visible;
    }
    .ticket-item {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .ticket-item .text-end {
        text-align: left !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }
    .ticket-item input.form-control-sm {
        max-width: 100% !important;
    }
    .ticket-foot .row {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }
    .ticket-foot .d-grid .btn {
        min-height: 48px;
    }
    .hold-item {
        flex-direction: column;
        align-items: stretch;
    }
    .hold-item > .d-flex {
        width: 100%;
        justify-content: stretch;
    }
    .hold-item > .d-flex .btn {
        flex: 1 1 0;
    }
}

@media (max-width: 575px) {
    .pos-mobile-switcher {
        top: 72px;
    }
    .mobile-bottom-nav {
        gap: 4px;
        padding-inline: 6px !important;
    }
    .mobile-bottom-nav a {
        padding: 6px 2px;
    }
    .mobile-bottom-nav a i {
        font-size: 18px;
    }
    .mobile-bottom-nav a span {
        font-size: 10px;
    }
    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- Sales page responsive polish ---- */
.sales-page-grid {
    display: grid;
    gap: 18px;
}
.sales-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
}
.sales-summary-item {
    padding: 18px 20px;
    border-right: 1px solid var(--line);
    display: grid;
    gap: 4px;
    min-width: 0;
}
.sales-summary-item:last-child { border-right: 0; }
.sales-summary-item .label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sales-summary-item .value {
    font-size: 24px;
    line-height: 1.15;
    font-weight: 800;
}
.sales-summary-item .sub {
    color: var(--muted);
    font-size: 13px;
}
.sales-filter-card {
    display: grid;
    gap: 8px;
}
.sales-filter-form .btn,
.sales-filter-form .form-control,
.sales-filter-form .form-select {
    min-height: 48px;
}
.sales-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sales-filter-pills a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid var(--line);
    color: #334155;
    font-weight: 700;
}
.sales-filter-pills a.active,
.sales-filter-pills a:hover {
    color: var(--primary-dark);
    background: rgba(55,178,77,0.12);
    border-color: rgba(55,178,77,0.18);
}
.sales-table-wrap .table { min-width: 980px; }
.sales-table thead th,
.sales-table tbody td { padding: 14px 16px; }
.sales-mobile-list {
    display: grid;
    gap: 12px;
}
.sales-mobile-card {
    padding: 14px;
    display: grid;
    gap: 12px;
    border-radius: 18px;
}
.sales-mobile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.sales-mobile-ticket {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}
.sales-mobile-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.sales-mobile-amounts > div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    gap: 4px;
    min-width: 0;
}
.sales-mobile-amounts span {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.sales-mobile-amounts strong {
    font-size: 14px;
    line-height: 1.3;
}
.sales-mobile-meta {
    display: grid;
    gap: 8px;
}
.sales-meta-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
}
.sales-meta-pill i {
    color: var(--primary-dark);
    font-size: 15px;
}
.sales-meta-pill span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #334155;
}
.sales-mobile-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 1199px) {
    .sales-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sales-summary-item:nth-child(2) { border-right: 0; }
    .sales-summary-item:nth-child(n+3) {
        border-top: 1px solid var(--line);
    }
}

@media (max-width: 991px) {
    .sales-page-grid { gap: 14px; }
    .sales-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        border-radius: 16px;
    }
    .sales-summary-item {
        padding: 16px;
    }
    .sales-summary-item .value {
        font-size: 20px;
    }
    .sales-filter-card {
        border-radius: 16px;
    }
}

@media (max-width: 575px) {
    .sales-summary-strip {
        grid-template-columns: 1fr;
    }
    .sales-summary-item {
        border-right: 0;
        border-top: 1px solid var(--line);
    }
    .sales-summary-item:first-child { border-top: 0; }
    .sales-mobile-card {
        padding: 12px;
        border-radius: 16px;
    }
    .sales-mobile-head {
        flex-direction: column;
        align-items: stretch;
    }
    .sales-mobile-head .text-end {
        text-align: left !important;
    }
    .sales-mobile-amounts {
        grid-template-columns: 1fr;
    }
    .sales-filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .sales-filter-pills a {
        white-space: nowrap;
    }
}
