/* =====================================================
   GJ-3 POS - Clean White Minimal Professional Theme
   Green Accent: #254F22 / #2E6B2A
   ===================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

:root {
    --primary: #2e6b2a;
    --primary-dark: #254f22;
    --primary-light: #f0f7ee;
    --primary-mid: #e0efd9;

    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #eeeeee;
    --gray-300: #e0e0e0;
    --gray-400: #bdbdbd;
    --gray-500: #9e9e9e;
    --gray-600: #757575;
    --gray-700: #616161;
    --gray-800: #424242;
    --gray-900: #212121;

    --surface: #ffffff;
    --bg: #f7f8fa;
    --border: #e8e8e8;

    --success: #2e6b2a;
    --danger: #d32f2f;
    --warning: #f57c00;
    --info: #0288d1;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);

    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font: "Inter", "Segoe UI", sans-serif;
    --transition: all 0.2s ease;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--gray-900);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* =====================================================
   TOP NAVBAR
   ===================================================== */
.pos-navbar {
    height: 58px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: var(--shadow-xs);
}

.pos-navbar .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    flex-shrink: 0;
}

.pos-navbar .brand img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
}

.pos-navbar .brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.pos-navbar .brand-name span {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--gray-500);
}

.pos-navbar .nav-spacer {
    flex: 1;
}

.pos-navbar .nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-navbar .nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.pos-navbar .nav-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

/* Notification badge on a header nav button (e.g. Orders pending count) */
.pos-navbar .nav-btn-badged {
    position: relative;
    overflow: visible;
}

.pos-navbar .nav-btn-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    border: 2px solid #e53935;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(229,57,53,0.5);
    animation: badgePop 0.25s ease;
}

@keyframes badgePop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

.pos-navbar .nav-btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pos-navbar .nav-btn.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.pos-navbar .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--primary-mid);
}

.pos-navbar .user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.pos-navbar .user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
}

.pos-navbar .user-info .role {
    font-size: 11px;
    color: var(--gray-500);
}

.nav-hamburger {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 15px;
    align-items: center;
}

@media (max-width: 767px) {
    .pos-navbar {
        padding: 0 14px;
        height: 54px;
    }
    .pos-navbar .nav-btn.hide-mobile {
        display: none;
    }
    .pos-navbar .user-info {
        display: none;
    }
    .nav-hamburger {
        display: flex;
    }
}

/* =====================================================
   POS LAYOUT
   ===================================================== */
.pos-layout {
    display: flex;
    height: calc(100vh - 58px);
    overflow: clip;
}

/* ---- Category Sidebar ---- */
.cat-sidebar {
    width: 196px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.cat-sidebar::-webkit-scrollbar {
    width: 3px;
}
.cat-sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-300);
}

.cat-sidebar-header {
    padding: 16px 14px 10px;
    border-bottom: 1px solid var(--border);
}

.cat-sidebar-header h6 {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.cat-list {
    padding: 8px;
}

/* "Developed by Satva Info Tech" credit — pinned to bottom of POS sidebar */
.sidebar-credit {
    margin-top: auto;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    font-size: 10px;
    line-height: 1.5;
    color: var(--gray-400);
    text-align: center;
    letter-spacing: .3px;
}
.sidebar-credit strong {
    display: block;
    color: var(--gray-600);
    font-weight: 700;
    font-size: 11px;
}

/* Credit line for admin pages (no left sidebar there) */
.app-credit {
    text-align: center;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: .3px;
}
.app-credit strong {
    color: var(--gray-600);
    font-weight: 700;
}
@media (max-width: 767px) {
    /* keep the credit clear of the fixed mobile bottom-nav */
    .app-credit { padding-bottom: 84px; }
}

.cat-btn {
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 2px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    text-align: left;
}

.cat-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.cat-btn.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.cat-btn .cat-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-xs);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 13px;
    color: var(--gray-500);
}

.cat-btn.active .cat-icon {
    background: var(--primary-mid);
    color: var(--primary-dark);
}

.cat-btn .cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-btn .cat-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1023px) {
    .cat-sidebar {
        display: none;
    }
}

/* ---- Products Section ---- */
.products-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

/* Search bar */
.products-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-height: 56px;
}

.search-wrap {
    flex: 1;
    position: relative;
    max-width: 380px;
}

.search-wrap .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px 0 36px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: var(--transition);
}

.search-wrap input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-wrap input::placeholder {
    color: var(--gray-400);
}

/* Category chips (tablet/mobile) */
.cat-chips-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 14px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex-shrink: 0;
}

.cat-chips-bar::-webkit-scrollbar {
    height: 0;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    flex-shrink: 0;
}

.cat-chip:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.cat-chip img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
}

@media (min-width: 1024px) {
    .cat-chips-bar {
        display: none;
    }
}

/* =====================================================
   PRODUCTS GRID & CARDS
   ===================================================== */
.products-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg);
}

.products-scroll::-webkit-scrollbar {
    width: 5px;
}
.products-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
}

@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    }
}
@media (max-width: 767px) {
    .products-scroll {
        padding: 10px;
    }
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    /* Mobile 3-column optimizations */
    .product-card {
        border-radius: 10px;
    }
    .product-img-wrap {
        padding-top: 85%;
    }
    .product-body {
        padding: 7px 8px 9px;
    }
    .product-name {
        font-size: 11px;
        line-height: 1.25;
        min-height: 28px;
    }
    .product-price {
        font-size: 13px;
    }
    .btn-add {
        display: none !important;
    }
    .veg-dot {
        width: 16px;
        height: 16px;
        top: 6px;
        left: 6px;
    }
    .veg-dot::after {
        width: 7px;
        height: 7px;
    }
    .product-img-placeholder i {
        font-size: 24px;
    }
}
@media (max-width: 380px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    /* Extra small screens */
    .product-img-wrap {
        padding-top: 90%;
    }
    .product-body {
        padding: 6px 7px 8px;
    }
    .product-name {
        font-size: 10px;
        min-height: 26px;
    }
    .product-price {
        font-size: 12px;
    }
    .btn-add {
        display: none !important;
    }
    .product-img-placeholder i {
        font-size: 22px;
    }
}

/* Product Card */
/* ===== Drill-down: category / sub-category tiles ===== */
.cat-tile,
.subcat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
}
.cat-tile:hover,
.subcat-tile:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}
.cat-tile-thumb {
    position: relative;
    width: 100%;
    padding-top: 62%;
    background: color-mix(in srgb, var(--tile-color, #FF6B35) 14%, #fff);
    overflow: hidden;
}
.cat-tile-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cat-tile-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--tile-color, #FF6B35);
}
.cat-tile-name {
    padding: 10px 10px 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    line-height: 1.25;
}
.cat-tile-name:last-child {
    padding-bottom: 12px;
}
.cat-tile-sub {
    padding: 0 10px 10px;
    font-size: 11px;
    color: var(--gray-500);
    text-align: center;
}
@media (max-width: 767px) {
    .cat-tile-name { font-size: 11px; }
    .cat-tile-icon { font-size: 24px; }
}

/* ===== Drill-down: breadcrumb bar ===== */
.pos-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.pos-breadcrumb:empty { display: none; }

/* Back arrow button — shown at start of breadcrumb when not at home */
.pos-bc-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--gray-700);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.pos-bc-back:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pos-bc-back:active {
    transform: scale(0.92);
}

/* Thin vertical divider between back btn and breadcrumb trail */
.pos-bc-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
    flex-shrink: 0;
}

.pos-bc-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}
button.pos-bc-item:hover {
    background: var(--gray-100);
    color: var(--primary-dark);
}
.pos-bc-item.active {
    color: var(--primary-dark);
    background: var(--primary-light);
    cursor: default;
}
.pos-bc-sep {
    font-size: 9px;
    color: var(--gray-300);
}
@media (max-width: 767px) {
    .pos-breadcrumb { padding: 8px 10px; }
    .pos-bc-item { font-size: 12px; padding: 3px 6px; }
    .pos-bc-back { width: 30px; height: 30px; font-size: 12px; }
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.product-card:active {
    opacity: 0.85;
}

.product-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 72%;
    overflow: hidden;
    background: var(--gray-100);
    pointer-events: none;
}

.product-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    pointer-events: none;
}

.product-card:hover .product-img-wrap img {
    transform: scale(1.04);
}

.product-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    pointer-events: none;
}

.product-img-placeholder i {
    font-size: 28px;
    color: var(--gray-300);
}

/* Veg indicator dot */
.veg-dot {
    position: absolute;
    top: 7px;
    left: 7px;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1.5px solid var(--success);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.veg-dot::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
}

.product-body {
    padding: 8px 9px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    pointer-events: none; /* let clicks fall through to the card */
}

/* Re-enable pointer events only on the interactive button */
.product-body .btn-add {
    pointer-events: auto;
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 31px;
}

.product-subcat {
    font-size: 9px;
    color: #6c757d;
    margin-bottom: 2px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.product-desc {
    font-size: 10px;
    color: var(--gray-500);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 4px;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

.btn-add {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.25);
    flex-shrink: 0;
}

.btn-add:hover {
    background: var(--primary-dark);
    transform: scale(1.12);
}

/* Empty state */
.no-products {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.no-products i {
    font-size: 42px;
    margin-bottom: 12px;
    display: block;
}
.no-products p {
    font-size: 14px;
}

/* =====================================================
   BILL PANEL
   ===================================================== */
.bill-panel {
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Desktop: smoothly slide the sidebar in/out based on cart contents.
   margin-right collapses the layout space (products grid expands to fill),
   opacity fades — both animatable, unlike display:none. */
@media (min-width: 1024px) {
    .bill-panel {
        transition: margin-right 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.28s ease;
        will-change: margin-right, opacity;
    }
    .bill-panel.is-empty {
        margin-right: -320px;
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 1023px) {
    .bill-panel {
        position: fixed;
        top: 0;
        right: -340px;
        height: 100vh;
        width: 320px;
        z-index: 1060;
        box-shadow: var(--shadow-lg);
        transition: right 0.3s ease;
    }
    .bill-panel.show {
        right: 0;
    }
    .bill-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1055;
    }
    .bill-overlay.show {
        display: block;
    }
}

@media (max-width: 479px) {
    .bill-panel {
        width: 100%;
        right: -100%;
    }
}

/* Bill header */
.bill-head {
    background: var(--gray-900);
    color: #fff;
    padding: 0 16px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.bill-head h5 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bill-head h5 i {
    color: var(--primary);
    font-size: 14px;
}

.bill-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: var(--transition);
}

.bill-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Editing banner */
.editing-banner {
    display: none;
    background: #fff8e1;
    border-bottom: 2px solid #ffc107;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #795548;
}

/* Customer input */
.bill-customer {
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--gray-50);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Field group = label + input + inline error */
.bill-customer .field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bill-customer .field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: 0.02em;
    user-select: none;
}

.bill-customer .req-star {
    color: var(--danger);
    font-weight: 700;
    margin-left: 1px;
}

.bill-customer .input-wrap {
    position: relative;
}

.bill-customer .input-wrap > i:first-child {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 12px;
    transition: color 0.2s ease;
}

/* Green check that appears when the field is valid */
.bill-customer .valid-tick {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) scale(0.6);
    color: var(--success);
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.bill-customer input {
    width: 100%;
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 30px 0 30px;
    font-size: 12px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
}

.bill-customer input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.bill-customer input:focus + .valid-tick {
    /* keep the icon area clear while typing */
}

.bill-customer input::placeholder {
    color: var(--gray-400);
}

/* ---- VALID state ---- */
.bill-customer .field-group.is-valid input {
    border-color: var(--success);
}
.bill-customer .field-group.is-valid .input-wrap > i:first-child {
    color: var(--success);
}
.bill-customer .field-group.is-valid .valid-tick {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ---- ERROR state ---- */
.bill-customer .field-group.is-invalid input {
    border-color: var(--danger);
    background: #fff5f5;
}
.bill-customer .field-group.is-invalid input:focus {
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.14);
}
.bill-customer .field-group.is-invalid .input-wrap > i:first-child {
    color: var(--danger);
}

.bill-customer .field-error {
    display: none;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--danger);
    line-height: 1.3;
    padding-left: 2px;
}
.bill-customer .field-group.is-invalid .field-error {
    display: flex;
    align-items: center;
    gap: 4px;
    animation: errFadeIn 0.18s ease;
}

@keyframes errFadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Shake the whole field when the user submits an invalid form */
.bill-customer .field-group.shake {
    animation: fieldShake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes fieldShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Cart items */
.cart-items-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: var(--gray-50);
}

.cart-items-wrap::-webkit-scrollbar {
    width: 4px;
}
.cart-items-wrap::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 2px;
}

.empty-cart-state {
    text-align: center;
    padding: 50px 16px;
    color: var(--gray-400);
}

.empty-cart-state .empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 22px;
    color: var(--gray-300);
}

.empty-cart-state p {
    font-size: 13px;
    color: var(--gray-400);
}

/* Cart item */
.cart-item {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 7px;
    transition: var(--transition);
}

.cart-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
}

.cart-item-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.cart-item-img-ph {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-xs);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-300);
    font-size: 15px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    margin-bottom: 3px;
}

.cart-item-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--gray-700);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.qty-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    min-width: 20px;
    text-align: center;
}

.btn-del {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: var(--danger);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 2px;
}

.btn-del:hover {
    background: var(--danger);
    color: #fff;
}

/* Bill summary */
.bill-summary {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.bill-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.bill-row.total {
    font-size: 17px;
    font-weight: 700;
    color: var(--gray-900);
    border-top: 1px solid var(--border);
    padding-top: 7px;
    margin-bottom: 0;
    margin-top: 4px;
}

.bill-row.total .amount {
    color: var(--primary-dark);
}

/* Bill actions */
.bill-actions {
    padding: 10px 12px 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.bill-action-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 7px;
}

.bill-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

.bill-action-btn.full {
    grid-column: 1/-1;
    height: 44px;
    font-size: 13px;
}
.bill-action-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
.bill-action-btn:active {
    transform: scale(0.97);
}

.bill-action-btn.btn-pending {
    background: var(--gray-900);
    color: #fff;
}

.bill-action-btn.btn-clear {
    background: #fee2e2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.bill-action-btn.btn-clear:hover {
    background: var(--danger);
    color: #fff;
}

.bill-action-btn.btn-save {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.25);
}

.bill-action-btn.btn-save:hover {
    background: var(--primary-dark);
    opacity: 1;
}

.bill-action-btn.btn-complete {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 10px rgba(46, 107, 42, 0.25);
}

.bill-action-btn.btn-complete:hover {
    background: var(--primary-dark);
}

.action-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* =====================================================
   MOBILE BOTTOM NAV
   ===================================================== */

/* Base: always hidden on desktop, shown via media query on mobile */
.bottom-nav {
    display: none;
}

@media (max-width: 767px) {
    .bottom-nav {
        display: block; /* override Bootstrap d-md-none if needed */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        background: var(--surface);
        border-top: 1px solid var(--border);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.07);
    }

    .bottom-nav-items {
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        height: 58px;
        /* Extra space for iPhone home indicator */
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 2px;
        border: none;
        background: none;
        font-family: var(--font);
        color: var(--gray-400);
        cursor: pointer;
        text-decoration: none;
        transition: var(--transition);
        position: relative;
        min-width: 0;
    }

    .bottom-nav-item i {
        font-size: 21px;
        line-height: 1;
        transition: var(--transition);
    }

    .bottom-nav-item span:not(.bnav-badge) {
        font-size: 10px;
        font-weight: 500;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .bottom-nav-item:hover {
        color: var(--primary);
    }

    /* Active state */
    .bottom-nav-item.active {
        color: var(--primary);
        font-weight: 600;
    }

    .bottom-nav-item.active i {
        transform: translateY(-2px);
    }

    /* Active top-bar indicator */
    .bottom-nav-item.active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: var(--primary);
        border-radius: 0 0 3px 3px;
    }

    /* <a> tag support */
    a.bottom-nav-item {
        color: var(--gray-400);
        text-decoration: none;
    }

    a.bottom-nav-item:hover {
        color: var(--primary);
    }
    a.bottom-nav-item.active {
        color: var(--primary);
        font-weight: 600;
    }

    /* Badge */
    .bnav-badge {
        position: absolute;
        top: 5px;
        right: 50%;
        transform: translateX(58%);
        background: var(--danger);
        color: #fff;
        font-size: 9px;
        font-weight: 700;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        line-height: 1;
        pointer-events: none;
    }

    /* Push POS layout up so content isn't behind nav */
    .pos-layout {
        height: calc(100vh - 54px - 58px);
    }

    /* Push admin page content above the nav */
    .admin-wrap {
        padding-bottom: 74px !important;
    }
} /* end @media (max-width: 767px) */

/* Ensure desktop never shows bottom nav */
@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
    .admin-wrap {
        padding-bottom: 24px !important;
    }
}

/* =====================================================
   MODALS
   ===================================================== */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: var(--gray-900);
    border: none;
    padding: 16px 20px;
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i {
    color: var(--primary);
}
.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.6;
}
.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    background: var(--gray-50);
}

.modal .form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.modal .form-control,
.modal .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--gray-900);
    background: var(--surface);
    transition: var(--transition);
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* =====================================================
   PAYMENT BOTTOM SHEET — White Theme
   ===================================================== */

/* Backdrop */
.pay-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1080;
}
.pay-sheet-backdrop.show {
    display: block;
    animation: esBackdropIn 0.22s ease;
}

/* Sheet */
.pay-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1085;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.16);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 1, 0.22, 1);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}
.pay-sheet.show {
    transform: translateY(0);
    pointer-events: auto;
}

/* Handle */
.pay-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* Header */
.pay-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.pay-sheet-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pay-sheet-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    border: 1.5px solid var(--primary-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: var(--primary-dark);
    flex-shrink: 0;
}
.pay-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}
.pay-sheet-order-num {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 1px;
}
.pay-sheet-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.pay-sheet-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

/* Summary strip — white with colored values */
.pay-sheet-summary {
    display: flex;
    align-items: stretch;
    background: var(--gray-50);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.pay-sum-col {
    flex: 1;
    padding: 12px 10px;
    text-align: center;
}
.pay-sum-sep {
    width: 1px;
    background: var(--border);
    margin: 10px 0;
}
.pay-sum-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.pay-sum-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--gray-900);
}
.pay-sum-val.green {
    color: var(--primary-dark);
}
.pay-sum-val.orange {
    color: var(--warning);
}

/* Scrollable body */
.pay-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overscroll-behavior: contain;
}
.pay-sheet-body::-webkit-scrollbar {
    width: 3px;
}
.pay-sheet-body::-webkit-scrollbar-thumb {
    background: var(--gray-300);
}

/* Field */
.pay-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pay-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.pay-req {
    color: var(--danger);
}
.pay-opt {
    color: var(--gray-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

/* Amount input row */
.pay-amount-row {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--surface);
    transition: var(--transition);
}
.pay-amount-row:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.pay-rupee {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark);
    background: var(--primary-light);
    border-right: 2px solid var(--primary-mid);
    flex-shrink: 0;
    height: 56px;
}
.pay-amount-inp {
    flex: 1;
    height: 56px;
    border: none;
    background: transparent;
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    font-family: var(--font);
    padding: 0 16px;
    outline: none;
    min-width: 0;
}
.pay-amount-inp::placeholder {
    color: var(--gray-300);
    font-size: 22px;
    font-weight: 400;
}

/* Quick-fill buttons */
.pay-quick-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.pay-qbtn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 13px;
    border: 1.5px solid var(--primary-mid);
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.pay-qbtn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Payment method cards */
.pay-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.pay-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 6px 10px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}
.pay-method:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}
.pay-method.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(46, 107, 42, 0.12);
}
.pm-icon {
    font-size: 24px;
    line-height: 1;
}
.pm-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-700);
}
.pay-method.active .pm-name {
    color: var(--primary-dark);
}

/* Note */
.pay-note {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    resize: none;
    min-height: 58px;
    transition: var(--transition);
}
.pay-note:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.pay-note::placeholder {
    color: var(--gray-400);
}

/* Footer */
.pay-sheet-footer {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    padding: 12px 16px;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.pay-btn-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}
.pay-btn-cancel:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.pay-btn-confirm {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 14px rgba(46, 107, 42, 0.3);
}
.pay-btn-confirm:hover {
    background: var(--primary-dark);
}
.pay-btn-confirm:active {
    transform: scale(0.97);
}
.pay-btn-confirm:disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* Desktop: centered card */
@media (min-width: 576px) {
    .pay-sheet {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -40%) scale(0.96);
        width: 460px;
        max-height: 85vh;
        border-radius: var(--radius-lg);
        opacity: 0;
        pointer-events: none;
        transition:
            transform 0.28s cubic-bezier(0.32, 1, 0.22, 1),
            opacity 0.22s ease;
    }
    .pay-sheet.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }
}

/* Keep old pay-info-box for any legacy usage */
.pay-info-box {
    background: var(--gray-900);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    color: #fff;
    margin-bottom: 16px;
}
.pay-info-box .order-num {
    font-size: 11px;
    color: var(--gray-400);
    margin-bottom: 3px;
}
.pay-info-box .order-total {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
}
.pay-info-box .order-total-label {
    font-size: 11px;
    color: var(--gray-400);
}

/* Pending order card */
.pnd-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.pnd-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.pnd-card .order-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
}
.pnd-card .order-meta {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}

.pnd-items {
    margin: 8px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.pnd-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 11px;
    border-bottom: 1px solid #e9ecef;
}

.pnd-item:last-child {
    border-bottom: none;
}

.pnd-item-qty {
    min-width: 24px;
    font-weight: 700;
    color: #495057;
    text-align: center;
}

.pnd-item-name {
    flex: 1;
    color: #212529;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pnd-item-price {
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.pnd-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin: 8px 0;
    border: 1px solid var(--border);
}

.pnd-amt-item {
    text-align: center;
}
.pnd-amt-item .label {
    font-size: 9px;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.pnd-amt-item .value {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 2px;
}
.pnd-amt-item .value.pending {
    color: var(--danger);
}
.pnd-amt-item .value.paid {
    color: var(--success);
}
.pnd-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-top: 4px;
}

.pnd-actions .tbl-btn {
    height: 38px;
    font-size: 13px;
    justify-content: center;
    border-radius: var(--radius-sm);
    gap: 6px;
}

/* Delete button — icon only to save space */
.pnd-delete-btn {
    width: 38px;
    padding: 0;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .pnd-actions {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    /* On small screens: delete goes full width on second row */
    .pnd-delete-btn {
        grid-column: 1 / -1;
        width: 100%;
        height: 38px;
    }

    .pnd-actions .tbl-btn {
        height: 42px;
        font-size: 13px;
        font-weight: 700;
    }
}

/* Pending orders modal — full screen on mobile */
@media (max-width: 576px) {
    #pendingOrdersModal .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100%;
    }

    #pendingOrdersModal .modal-content {
        border-radius: 0;
        height: 100%;
    }

    #pendingOrdersModal .modal-body {
        padding: 12px;
    }
}

/* Pending card improvements */
.pnd-card {
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.pnd-card .order-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.pnd-card .order-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
}

.pnd-card .order-meta {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* List group (management modal) */
.list-group-item {
    border-color: var(--border);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
    transition: var(--transition);
    padding: 11px 14px;
}

.list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 6px;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--gray-800);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}
.dropdown-divider {
    border-color: var(--border);
    margin: 4px 0;
}

/* =====================================================
   ADMIN NAVBAR (same pos-navbar class reused)
   ===================================================== */
.admin-page-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary-mid);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
}

/* =====================================================
   ADMIN WRAP & CARDS
   ===================================================== */
.admin-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 20px;
}

@media (max-width: 767px) {
    .admin-wrap {
        padding: 14px 12px;
    }
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    margin-bottom: 18px;
}

.admin-card-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--gray-50);
}

.admin-card-head h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card-head h5 i {
    color: var(--primary);
}
.admin-card-body {
    padding: 18px;
}
@media (max-width: 767px) {
    .admin-card-body {
        padding: 14px;
    }
}

/* ---- Tables ---- */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table thead tr {
    background: var(--gray-50);
    border-bottom: 2px solid var(--border);
}

.admin-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--gray-800);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: var(--transition);
}
.admin-table tbody tr:hover {
    background: var(--gray-50);
}
.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Form Controls ---- */
.admin-form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.admin-form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
}

.admin-form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.admin-form-control::placeholder {
    color: var(--gray-400);
}

.admin-card-body .form-control,
.admin-card-body .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--gray-900);
    transition: var(--transition);
}

.admin-card-body .form-control:focus,
.admin-card-body .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Submit button */
.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 20px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.2);
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 107, 42, 0.28);
}

/* =====================================================
   BADGES & ACTION BUTTONS
   ===================================================== */
.badge-pos {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid;
}

.badge-success {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.badge-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.badge-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-mid);
}
.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
    border-color: var(--gray-200);
}

.tbl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    height: 30px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.tbl-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}
.tbl-btn:active {
    transform: scale(0.97);
}

.tbl-btn-edit {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.tbl-btn-edit:hover {
    background: #fef3c7;
}
.tbl-btn-delete {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.tbl-btn-delete:hover {
    background: #fee2e2;
}
.tbl-btn-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.tbl-btn-info:hover {
    background: #dbeafe;
}
.tbl-btn-wa {
    background: #f0fdf4;
    color: #15803d;
    border-color: #4ade80;
}
.tbl-btn-wa:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.order-mc-btn.wa {
    background: #f0fdf4;
    color: #15803d;
    border-color: #4ade80;
}
.order-mc-btn.wa:hover {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}
.tbl-btn-success {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.tbl-btn-success:hover {
    background: #dcfce7;
}
.tbl-btn-pay {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-mid);
}
.tbl-btn-pay:hover {
    background: var(--primary-mid);
}

/* Image cells */
.tbl-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

.tbl-img-ph {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    color: var(--gray-400);
    font-size: 16px;
}

/* Alerts */
.pos-alert {
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    border: 1px solid;
}

.pos-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.pos-alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.pos-alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.pos-alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* Filter tabs — no scrolling, always wrap */
.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.2);
}

/* Notification badge on a filter tab (Pending / Unpaid counts) */
.filter-tab.tab-badged {
    position: relative;
    overflow: visible;
}

.filter-tab .tab-badge {
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: var(--shadow-xs);
    animation: badgePop 0.25s ease;
}

/* On the active tab, keep badge red for visibility */
.filter-tab.active .tab-badge {
    background: #e53935;
    color: #fff;
    box-shadow: 0 1px 4px rgba(229,57,53,0.5);
}

/* Responsive: on small screens each tab grows equally to fill the row */
@media (max-width: 600px) {
    .filter-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
    }

    .filter-tab {
        justify-content: center;
        width: 100%;
        flex-shrink: unset;
    }
}

@media (max-width: 360px) {
    .filter-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .filter-tab {
        font-size: 11px;
        padding: 0 8px;
        height: 30px;
    }
}

/* Bootstrap button overrides */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.btn-success {
    background: var(--success) !important;
    border-color: var(--success) !important;
}
.btn-secondary {
    background: var(--gray-600) !important;
    border-color: var(--gray-600) !important;
    color: #fff !important;
}
.btn-secondary:hover {
    background: var(--gray-700) !important;
    border-color: var(--gray-700) !important;
}

/* =====================================================
   REPORTS — STAT CARDS
   ===================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 1023px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .stat-grid {
        gap: 10px;
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.blue::after {
    background: #2563eb;
}
.stat-card.green::after {
    background: var(--primary);
}
.stat-card.orange::after {
    background: #ea580c;
}
.stat-card.red::after {
    background: #dc2626;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.stat-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}
.stat-icon.green {
    background: var(--primary-light);
    color: var(--primary-dark);
}
.stat-icon.orange {
    background: #fff7ed;
    color: #ea580c;
}
.stat-icon.red {
    background: #fef2f2;
    color: #dc2626;
}

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 3px;
}
.stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
}

@media (max-width: 480px) {
    .stat-card {
        padding: 14px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 15px;
        margin-bottom: 8px;
    }
    .stat-value {
        font-size: 18px;
    }
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.reports-page {
    --reports-ink: #172017;
    --reports-muted: #65705f;
    --reports-line: #e4eadf;
    --reports-panel: #ffffff;
    --reports-soft: #f4f8f1;
    --reports-blue: #2563eb;
    --reports-amber: #d97706;
    --reports-red: #dc2626;
    --reports-purple: #7c3aed;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.reports-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    padding: 22px 24px;
    border: 1px solid var(--reports-line);
    border-radius: var(--radius-md);
    background:
        linear-gradient(135deg, rgba(46, 107, 42, 0.08), rgba(37, 99, 235, 0.05)),
        var(--reports-panel);
    box-shadow: var(--shadow-xs);
}

.reports-eyebrow {
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.9px;
    margin-bottom: 7px;
    text-transform: uppercase;
}

.reports-hero h1 {
    color: var(--reports-ink);
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 850;
    line-height: 1.1;
    margin: 0 0 8px;
}

.reports-hero p {
    color: var(--reports-muted);
    font-size: 13px;
    margin: 0;
}

.reports-hero p strong {
    color: var(--reports-ink);
    font-weight: 750;
}

.reports-hero p span {
    display: inline-flex;
    margin-left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.reports-print,
.reports-primary-btn,
.reports-range-buttons button {
    min-height: 44px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.reports-print,
.reports-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    padding: 0 18px;
    box-shadow: 0 6px 16px rgba(46, 107, 42, 0.18);
}

.reports-print:hover,
.reports-primary-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-1px);
}

.reports-filter {
    padding: 14px;
    border: 1px solid var(--reports-line);
    border-radius: var(--radius-md);
    background: var(--reports-panel);
    box-shadow: var(--shadow-xs);
}

.reports-filter-form {
    display: grid;
    grid-template-columns: minmax(150px, 210px) minmax(150px, 210px) auto 1fr;
    gap: 12px;
    align-items: end;
}

.reports-filter label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reports-filter label span {
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.reports-filter input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--reports-line);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    color: var(--gray-900);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.reports-filter input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.reports-range-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.reports-range-buttons button {
    padding: 0 14px;
    border: 1px solid #d7e2d2;
    background: var(--reports-soft);
    color: var(--primary-dark);
}

.reports-range-buttons button:hover {
    background: var(--primary-light);
    border-color: var(--primary-mid);
}

/* Active quick-range preset (matches the selected dates) */
.reports-range-buttons button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46, 107, 42, 0.2);
}

.reports-print-title {
    display: none;
    text-align: center;
}

.reports-command-center {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr) minmax(260px, 0.85fr);
    gap: 14px;
}

.reports-revenue-panel,
.reports-ledger-panel,
.reports-mix-panel {
    border: 1px solid var(--reports-line);
    border-radius: var(--radius-md);
    background: var(--reports-panel);
    box-shadow: var(--shadow-xs);
}

.reports-revenue-panel {
    min-height: 248px;
    padding: 24px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(23, 32, 23, 0.94), rgba(46, 107, 42, 0.9)),
        var(--primary-dark);
    overflow: hidden;
    position: relative;
}

.reports-revenue-panel::after {
    content: "";
    position: absolute;
    right: -64px;
    top: -82px;
    width: 220px;
    height: 220px;
    border: 34px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
}

.reports-panel-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.reports-panel-kicker {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.9px;
    text-transform: uppercase;
}

.reports-revenue-panel h2 {
    margin: 0;
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 900;
    line-height: 1;
    overflow-wrap: anywhere;
}

.reports-revenue-panel p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
}

.reports-order-pill {
    min-width: 116px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(10px);
    text-align: center;
}

.reports-order-pill i {
    display: block;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, 0.78);
}

.reports-order-pill strong {
    display: block;
    font-size: 25px;
    line-height: 1;
}

.reports-order-pill span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.reports-flow-track {
    position: relative;
    z-index: 1;
    display: flex;
    height: 14px;
    margin: 42px 0 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
}

.reports-flow-track span {
    display: block;
    min-width: 2px;
    height: 100%;
}

.reports-flow-track .collected {
    background: #86efac;
}

.reports-flow-track .pending {
    background: #fbbf24;
}

.reports-flow-legend {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.reports-flow-legend div {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
}

.reports-flow-legend i {
    width: 8px;
    height: 8px;
    display: inline-block;
    margin-right: 7px;
    border-radius: 50%;
}

.reports-flow-legend i.collected { background: #86efac; }
.reports-flow-legend i.pending { background: #fbbf24; }
.reports-flow-legend i.average { background: #93c5fd; }

.reports-flow-legend span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 750;
}

.reports-flow-legend strong {
    display: block;
    margin-top: 6px;
    font-size: 18px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.reports-ledger-panel,
.reports-mix-panel {
    padding: 18px;
}

.reports-panel-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
}

.reports-panel-heading > span {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary-dark);
    flex-shrink: 0;
}

.reports-panel-heading h2 {
    margin: 0;
    color: var(--reports-ink);
    font-size: 15px;
    font-weight: 850;
}

.reports-panel-heading p {
    margin: 3px 0 0;
    color: var(--reports-muted);
    font-size: 12px;
}

.reports-ledger-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reports-ledger-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 9px 0;
    border-bottom: 1px solid var(--reports-line);
}

.reports-ledger-list div:last-child {
    border-bottom: 0;
}

.reports-ledger-list span {
    color: var(--reports-muted);
    font-size: 12px;
    font-weight: 700;
}

.reports-ledger-list strong {
    color: var(--reports-ink);
    font-size: 15px;
    font-weight: 850;
    text-align: right;
    overflow-wrap: anywhere;
}

.reports-ledger-list .net {
    min-height: 56px;
    margin-top: 6px;
    padding: 12px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
}

.reports-ledger-list .net.negative {
    background: #fef2f2;
}

.reports-ledger-list .net span {
    color: var(--gray-800);
}

.reports-ledger-list .net strong {
    color: var(--primary-dark);
    font-size: 22px;
}

.reports-ledger-list .net.negative strong {
    color: var(--reports-red);
}

.reports-mix-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.reports-mix-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--reports-line);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: #fbfcfa;
}

.reports-mix-row.paid {
    border-left-color: var(--primary);
}

.reports-mix-row.partial {
    border-left-color: var(--reports-amber);
}

.reports-mix-row.pending {
    border-left-color: var(--reports-red);
}

.reports-mix-row div {
    display: flex;
    align-items: baseline;
    gap: 9px;
}

.reports-mix-row strong {
    color: var(--reports-ink);
    font-size: 26px;
    line-height: 1;
}

.reports-mix-row span {
    color: var(--reports-muted);
    font-size: 13px;
    font-weight: 750;
}

.reports-mix-row small {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 850;
}

.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.reports-kpi,
.reports-profit-card,
.reports-mini-card,
.reports-status-card {
    border: 1px solid var(--reports-line);
    border-radius: var(--radius-md);
    background: var(--reports-panel);
    box-shadow: var(--shadow-xs);
}

.reports-kpi {
    position: relative;
    overflow: hidden;
    padding: 18px;
}

.reports-kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--primary);
}

.reports-kpi.kpi-orders::before { background: var(--reports-blue); }
.reports-kpi.kpi-sales::before { background: var(--primary); }
.reports-kpi.kpi-collected::before { background: #16a34a; }
.reports-kpi.kpi-pending::before { background: var(--reports-red); }

.reports-kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.reports-kpi-top span,
.reports-card-icon,
.reports-mini-card span {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 17px;
}

.kpi-orders .reports-kpi-top span { background: #eff6ff; color: var(--reports-blue); }
.kpi-pending .reports-kpi-top span { background: #fef2f2; color: var(--reports-red); }
.kpi-collected .reports-kpi-top span { background: #f0fdf4; color: #15803d; }

.reports-kpi-top small {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 700;
}

.reports-kpi-label {
    color: var(--reports-muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.reports-kpi-value {
    color: var(--reports-ink);
    font-size: clamp(21px, 2.2vw, 28px);
    font-weight: 850;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.reports-insight-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.75fr 0.75fr 1.6fr;
    gap: 14px;
}

.reports-profit-card {
    padding: 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), #386f33);
}

.reports-profit-card.negative {
    background: linear-gradient(135deg, #991b1b, #dc2626);
}

.reports-profit-card .reports-card-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    margin-bottom: 16px;
}

.reports-profit-card p,
.reports-mini-card p {
    margin: 0 0 5px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.reports-profit-card h2 {
    margin: 0 0 6px;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 850;
}

.reports-profit-card small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.reports-mini-card {
    padding: 18px;
}

.reports-mini-card span {
    margin-bottom: 16px;
}

.reports-mini-card:first-of-type span {
    background: #f3e8ff;
    color: var(--reports-purple);
}

.reports-mini-card p {
    color: var(--reports-muted);
}

.reports-mini-card strong {
    display: block;
    color: var(--reports-ink);
    font-size: clamp(19px, 2vw, 25px);
    font-weight: 850;
    overflow-wrap: anywhere;
}

.reports-status-card {
    padding: 18px;
}

.reports-section-head {
    align-items: flex-start;
}

.reports-section-head h2,
.reports-section-head h5 {
    margin: 0;
    color: var(--reports-ink);
}

.reports-section-head h2 {
    font-size: 15px;
    font-weight: 850;
}

.reports-section-head p {
    margin: 4px 0 0;
    color: var(--reports-muted);
    font-size: 12px;
    font-weight: 500;
}

.reports-section-head.compact {
    padding: 0;
    border: 0;
    background: transparent;
    margin-bottom: 14px;
}

.reports-status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reports-status-row {
    display: grid;
    grid-template-columns: 120px 1fr 42px;
    align-items: center;
    gap: 10px;
}

.reports-status-row div:first-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.reports-status-row strong {
    color: var(--reports-ink);
    font-size: 18px;
    line-height: 1.1;
}

.reports-status-row span {
    color: var(--reports-muted);
    font-size: 11px;
}

.reports-status-row small {
    color: var(--reports-muted);
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.reports-status-meter {
    height: 9px;
    border-radius: 999px;
    background: var(--gray-100);
    overflow: hidden;
}

.reports-status-meter span {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
}

.reports-status-meter .paid { background: var(--primary); }
.reports-status-meter .partial { background: var(--reports-amber); }
.reports-status-meter .pending { background: var(--reports-red); }

.reports-table-card {
    border-color: var(--reports-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}

.reports-table-card .admin-card-head {
    background: #fbfcfa;
}

.reports-table-card .admin-table th {
    background: #fbfcfa;
}

.reports-table-card .admin-table td {
    height: 52px;
}

.reports-category-cell {
    min-width: 150px;
}

.reports-category-cell strong {
    display: block;
    margin-bottom: 7px;
    color: var(--gray-900);
}

.reports-category-cell span {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: var(--gray-100);
    overflow: hidden;
}

.reports-category-cell i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #70a568);
}

.reports-rank {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 850;
}

.reports-positive {
    color: var(--primary-dark) !important;
}

.reports-negative {
    color: var(--reports-red) !important;
}

.reports-purple {
    color: var(--reports-purple) !important;
}

@media (max-width: 1100px) {
    .reports-command-center {
        grid-template-columns: 1fr 1fr;
    }
    .reports-revenue-panel {
        grid-column: 1 / -1;
    }
    .reports-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .reports-insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .reports-status-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 900px) {
    .reports-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .reports-primary-btn {
        width: 100%;
    }
    .reports-range-buttons {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .reports-page {
        gap: 14px;
    }
    .reports-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 18px;
    }
    .reports-print {
        width: 100%;
    }
    .reports-filter-form,
    .reports-command-center,
    .reports-kpi-grid,
    .reports-insight-grid {
        grid-template-columns: 1fr;
    }
    .reports-revenue-panel {
        min-height: auto;
        padding: 20px;
    }
    .reports-panel-top {
        flex-direction: column;
    }
    .reports-order-pill {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        text-align: left;
    }
    .reports-order-pill i,
    .reports-order-pill strong,
    .reports-order-pill span {
        margin: 0;
    }
    .reports-flow-track {
        margin-top: 28px;
    }
    .reports-flow-legend {
        grid-template-columns: 1fr;
    }
    .reports-range-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .reports-status-row {
        grid-template-columns: 96px 1fr 36px;
    }
    .reports-table-card .admin-card-head {
        padding: 14px;
    }
}

@media (max-width: 420px) {
    .reports-range-buttons {
        grid-template-columns: 1fr;
    }
    .reports-status-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .reports-status-row small {
        text-align: left;
    }
    .reports-mix-row div {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
}

@media print {
    .reports-page {
        gap: 12px;
    }
    .reports-hero {
        display: none !important;
    }
    .reports-print-title {
        display: block;
        margin-bottom: 12px;
    }
    .reports-kpi,
    .reports-revenue-panel,
    .reports-ledger-panel,
    .reports-mix-panel,
    .reports-profit-card,
    .reports-mini-card,
    .reports-status-card,
    .reports-table-card {
        box-shadow: none !important;
        break-inside: avoid;
    }
    .reports-profit-card {
        color: #111 !important;
        background: #fff !important;
    }
    .reports-profit-card small {
        color: #555 !important;
    }
    .reports-revenue-panel {
        color: #111 !important;
        background: #fff !important;
    }
    .reports-revenue-panel p,
    .reports-panel-kicker,
    .reports-flow-legend span {
        color: #555 !important;
    }
}

.login-page {
    min-height: 100vh;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    border: 1px solid var(--border);
}

.login-logo h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 13px;
    color: var(--gray-500);
}

.login-box .form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.login-box .form-control {
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--gray-900);
    background: var(--gray-50);
    transition: var(--transition);
}

.login-box .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--surface);
}

.login-box .input-group-text {
    background: var(--gray-50);
    border-color: var(--border);
    color: var(--gray-400);
}

.btn-login {
    width: 100%;
    height: 42px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(46, 107, 42, 0.2);
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(46, 107, 42, 0.28);
}

@media (max-width: 480px) {
    .login-box {
        padding: 28px 20px;
    }
    .login-logo img {
        width: 58px;
        height: 58px;
    }
    .login-logo h1 {
        font-size: 17px;
    }
}

/* =====================================================
   MOBILE CARD LISTS (Categories / Sub-cats / Products)
   ===================================================== */
.cat-mobile-list,
.prod-mobile-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-mobile-card,
.prod-mobile-card {
    display: flex;
    align-items: center;
    gap: 11px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 11px 12px;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}

.cat-mobile-card:hover,
.prod-mobile-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Image */
.cat-mc-img,
.prod-mc-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--gray-100);
    position: relative;
}

.cat-mc-img img,
.prod-mc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-mc-img-ph,
.prod-mc-img-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-300);
    font-size: 18px;
}

/* Info */
.cat-mc-info,
.prod-mc-info {
    flex: 1;
    min-width: 0;
}

.cat-mc-name,
.prod-mc-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.cat-mc-desc,
.prod-mc-desc {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-mc-meta,
.prod-mc-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.cat-mc-sort {
    font-size: 10px;
    color: var(--gray-500);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 2px 7px;
}

.prod-mc-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

/* Veg dot on product image */
.prod-mc-veg {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 13px;
    border-radius: 2px;
    border: 1.5px solid var(--success);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prod-mc-veg::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

/* Action buttons */
.cat-mc-actions,
.prod-mc-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-shrink: 0;
}

.cat-mc-btn {
    width: 34px;
    height: 34px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.cat-mc-btn:active {
    transform: scale(0.93);
}

.cat-mc-btn.edit {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.cat-mc-btn.edit:hover {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}
.cat-mc-btn.delete {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.cat-mc-btn.delete:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

/* =====================================================
   EDIT ORDER BOTTOM SHEET — Inline Editor
   ===================================================== */

/* Backdrop */
.edit-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1070;
}
.edit-sheet-backdrop.show {
    display: block;
    animation: esBackdropIn 0.22s ease;
}
@keyframes esBackdropIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Sheet container */
.edit-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1075;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.22);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 1, 0.22, 1);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}
.edit-sheet.show {
    transform: translateY(0);
    pointer-events: auto;
}

/* Drag handle */
.edit-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* Header */
.edit-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.edit-sheet-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}
.edit-sheet-title i {
    color: var(--primary);
    font-size: 14px;
}
.edit-sheet-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.edit-sheet-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid;
}
.edit-sheet-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.edit-sheet-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

/* Customer field */
.edit-sheet-customer {
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--border);
    background: var(--gray-50);
    flex-shrink: 0;
}
.es-field-wrap {
    position: relative;
}
.es-field-wrap i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 12px;
    pointer-events: none;
}
.es-field-wrap input {
    width: 100%;
    height: 38px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 12px 0 32px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
}
.es-field-wrap input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.es-field-wrap input::placeholder {
    color: var(--gray-400);
}

/* Scrollable items body */
.edit-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    overscroll-behavior: contain;
    background: var(--bg);
}
.edit-sheet-body::-webkit-scrollbar {
    width: 3px;
}
.edit-sheet-body::-webkit-scrollbar-thumb {
    background: var(--gray-300);
}

/* Each editable item row */
.es-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 9px 10px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-xs);
    transition: border-color 0.15s;
}
.es-item:last-child {
    margin-bottom: 0;
}
.es-item:hover {
    border-color: var(--primary);
}

/* Image */
.es-item-img {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.es-item-img-ph {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-300);
    font-size: 17px;
}

/* Info */
.es-item-info {
    flex: 1;
    min-width: 0;
}
.es-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    margin-bottom: 2px;
}
.es-item-unit-price {
    font-size: 11px;
    color: var(--gray-400);
}

/* Right side: qty controls + subtotal + delete */
.es-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}
.es-item-subtotal {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-dark);
    min-width: 60px;
    text-align: right;
}

/* Qty row inside right */
.es-qty-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.es-qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}
.es-qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.es-qty-btn:active {
    transform: scale(0.9);
}
.es-qty-btn.minus:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.es-qty-num {
    min-width: 24px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

.es-del-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: var(--danger);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.es-del-btn:hover {
    background: var(--danger);
    color: #fff;
}

/* Empty state */
.es-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}
.es-empty i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}
.es-empty p {
    font-size: 13px;
}

/* Total bar */
.edit-sheet-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 2px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.es-total-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.es-total-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-dark);
}

/* Footer */
.edit-sheet-footer {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    padding: 10px 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.es-btn-discard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}
.es-btn-discard:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.es-btn-save {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 14px rgba(46, 107, 42, 0.3);
}
.es-btn-save:hover {
    background: var(--primary-dark);
}
.es-btn-save:active {
    transform: scale(0.97);
}
.es-btn-save:disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* ---- Tab bar ---- */
.es-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.es-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    color: var(--gray-500);
    cursor: pointer;
    position: relative;
    transition: color 0.18s;
    padding: 0 10px;
}

.es-tab::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.es-tab.active {
    color: var(--primary);
}
.es-tab.active::after {
    transform: scaleX(1);
}

.es-tab-badge {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ---- Tab panes ---- */
.es-tab-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ---- Add Products pane ---- */

/* Search bar */
.es-search-wrap {
    position: relative;
    padding: 10px 12px 6px;
    background: var(--surface);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}

.es-search-wrap i.fa-search {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 13px;
    pointer-events: none;
}

.es-search-wrap input {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 38px 0 38px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: var(--transition);
}

.es-search-wrap input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.es-search-wrap input::placeholder {
    color: var(--gray-400);
}

.es-search-clear {
    position: absolute;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--gray-300);
    color: var(--gray-600);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.es-search-clear:hover {
    background: var(--gray-400);
}

/* Category chips row */
.es-cat-chips {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    flex-shrink: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.es-cat-chips::-webkit-scrollbar {
    height: 0;
}

.es-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    height: 28px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: var(--transition);
}
.es-cat-chip:hover {
    background: var(--gray-100);
}
.es-cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Product list */
.es-product-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
    background: var(--bg);
    overscroll-behavior: contain;
}
.es-product-list::-webkit-scrollbar {
    width: 3px;
}
.es-product-list::-webkit-scrollbar-thumb {
    background: var(--gray-300);
}

/* Product row */
.es-product-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin-bottom: 7px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.es-product-row:last-child {
    margin-bottom: 0;
}
.es-product-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.es-product-row:active {
    transform: scale(0.98);
}

/* Badge showing qty already in order */
.es-product-row.in-order {
    border-color: var(--primary);
}
.es-in-order-badge {
    position: absolute;
    top: 6px;
    right: 44px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

.es-prod-img {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}
.es-prod-img-ph {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-300);
    font-size: 18px;
}

.es-prod-info {
    flex: 1;
    min-width: 0;
}
.es-prod-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.es-prod-sub {
    font-size: 11px;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.es-prod-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-dark);
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 4px;
}

/* Add button on row */
.es-prod-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.25);
}
.es-prod-add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}
.es-prod-add-btn:active {
    transform: scale(0.92);
}

/* No results */
.es-no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--gray-400);
}
.es-no-results i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}
.es-no-results p {
    font-size: 13px;
}

/* Done footer */
.es-add-footer {
    padding: 10px 14px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    border-top: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.es-btn-done {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gray-900);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}
.es-btn-done:hover {
    background: var(--gray-800);
}

/* Desktop: centered card */
@media (min-width: 768px) {
    .edit-sheet {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -40%) scale(0.96);
        width: 500px;
        max-height: 82vh;
        border-radius: var(--radius-lg);
        opacity: 0;
        pointer-events: none;
        transition:
            transform 0.28s cubic-bezier(0.32, 1, 0.22, 1),
            opacity 0.22s ease;
    }
    .edit-sheet.show {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        pointer-events: auto;
    }
}

/* =====================================================
   PRINT & MISC
   ===================================================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.slide-up {
    animation: slideUp 0.25s ease;
}

/* Toast */
.pos-toast {
    position: fixed;
    bottom: 76px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    padding: 9px 18px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-md);
    animation: slideUp 0.25s ease;
    white-space: nowrap;
}

@media print {
    .pos-navbar,
    .cat-sidebar,
    .cat-chips-bar,
    .products-topbar,
    .bill-panel,
    .bottom-nav,
    .bill-actions,
    .modal,
    .no-print,
    .admin-navbar {
        display: none !important;
    }
    body {
        background: #fff !important;
    }
    .admin-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* Actions cell flex fix */
td[data-label="Actions"] {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
@media (min-width: 601px) {
    td[data-label="Actions"] {
        display: table-cell;
    }
    td[data-label="Actions"] .tbl-btn {
        display: inline-flex;
    }
}

/* fw util */
.fw-600 {
    font-weight: 600 !important;
}

/* Admin bottom nav reuses .bottom-nav styles */
.admin-bottom-nav {
    display: none;
}

/* =====================================================
   AFORM — Clean Admin Form System
   Fully responsive, works on all screen sizes
   ===================================================== */

.aform {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Row: horizontal on desktop, stacked on mobile */
.aform-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

@media (max-width: 600px) {
    .aform-row {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .aform-w120 {
        width: 100% !important;
    }
}

/* Individual field group */
.aform-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.aform-grow {
    flex: 1;
    min-width: 0;
}
.aform-w120 {
    width: 120px;
    flex-shrink: 0;
}
.aform-w160 {
    width: 160px;
    flex-shrink: 0;
}
.aform-half {
    flex: 1;
    min-width: 0;
}

/* Label */
.aform-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.aform-req {
    color: var(--danger);
}
.aform-hint {
    color: var(--gray-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

/* Input / Textarea / Select */
.aform-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
    appearance: none;
}

.aform-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.aform-control::placeholder {
    color: var(--gray-400);
}

textarea.aform-control {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 72px;
}

/* File upload */
.aform-file-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aform-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1.5px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.aform-file-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.aform-file-label i {
    font-size: 18px;
    color: var(--gray-400);
}
.aform-file-label:hover i {
    color: var(--primary);
}

/* File input — visually hidden but still clickable via label[for] */
/* Do NOT use pointer-events:none — that breaks label[for] click trigger */
.aform-file-wrap input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.aform-file-hint {
    font-size: 11px;
    color: var(--gray-400);
    padding-left: 2px;
}

/* Image preview */
.aform-preview-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.aform-preview-wrap img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    border: 1px solid var(--border);
}

.aform-preview-remove {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border: 1px solid #fecaca;
    border-radius: 50%;
    background: #fef2f2;
    color: var(--danger);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.aform-preview-remove:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* Form footer */
.aform-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}

.aform-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 20px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.2);
}

.aform-btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 107, 42, 0.28);
}

.aform-btn-submit:active {
    transform: scale(0.97);
}

/* Full width on very small screens */
@media (max-width: 480px) {
    .aform-btn-submit {
        width: 100%;
        justify-content: center;
    }
    .aform-footer {
        flex-direction: column;
    }
}

/* =====================================================
   CATEGORY FORM — cat-form
   Two-column on desktop, single-column on mobile
   ===================================================== */

/* Two-column grid */
.cat-form-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-bottom: 18px;
}

@media (max-width: 900px) {
    .cat-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Left column */
.cat-form-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Right column */
.cat-form-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Field group */
.cf-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cf-group-inline {
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
}

/* Label */
.cf-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0;
}

.cf-req {
    color: var(--danger);
}
.cf-opt {
    color: var(--gray-400);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 11px;
}

/* Input / Textarea */
.cf-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--surface);
    outline: none;
    transition: var(--transition);
}

.cf-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.cf-input::placeholder {
    color: var(--gray-400);
}

.cf-textarea {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
    min-height: 80px;
}

/* Upload zone */
.cf-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 16px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-height: 140px;
}

.cf-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.cf-upload-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--gray-500);
    transition: var(--transition);
}

.cf-upload-zone:hover .cf-upload-icon {
    background: var(--primary-mid);
    color: var(--primary-dark);
}

.cf-upload-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.cf-upload-hint {
    font-size: 11px;
    color: var(--gray-400);
}

/* Hide real input — clickable via label[for] */
#catImageInput {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Preview box */
.cf-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1.5px solid var(--primary-mid);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xs);
}

.cf-preview img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.cf-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-preview-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cf-preview-rm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    width: fit-content;
}

.cf-preview-rm:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* Form footer */
.cf-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.cf-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 22px;
    height: 40px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(46, 107, 42, 0.2);
}

.cf-btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 107, 42, 0.28);
}

.cf-btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    height: 40px;
    background: var(--surface);
    color: var(--gray-600);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
}

.cf-btn-reset:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

@media (max-width: 480px) {
    .cf-footer {
        flex-direction: column;
    }
    .cf-btn-submit,
    .cf-btn-reset {
        width: 100%;
        justify-content: center;
    }
}

/* =====================================================
   ORDERS PAGE
   ===================================================== */

/* Filter bar */
.orders-filter-bar {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.orders-search-wrap {
    position: relative;
    margin-left: auto;
}

.orders-search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 12px;
    pointer-events: none;
}

.orders-search-wrap input {
    height: 34px;
    width: 200px;
    padding: 0 12px 0 30px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: var(--font);
    color: var(--gray-900);
    background: var(--gray-50);
    outline: none;
    transition: var(--transition);
}

.orders-search-wrap input:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Mobile: stack tabs (2×2 grid) above search */
@media (max-width: 600px) {
    .orders-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .orders-search-wrap {
        margin-left: 0;
        width: 100%;
    }
    .orders-search-wrap input {
        width: 100%;
    }
}

/* ---- Order Mobile Cards ---- */
.orders-mobile-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-mc {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 13px 14px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.order-mc:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Top row: order number + total */
.order-mc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 7px;
}

.order-mc-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
}

.order-mc-total {
    font-size: 17px;
    font-weight: 800;
    color: var(--primary-dark);
}

/* Info row */
.order-mc-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.order-mc-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-500);
}

.order-mc-meta i {
    font-size: 11px;
    color: var(--gray-400);
}

/* Badges row */
.order-mc-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

/* Action buttons row */
.order-mc-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.order-mc-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 11px;
    height: 32px;
    border: 1.5px solid;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.order-mc-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}
.order-mc-btn:active {
    transform: scale(0.97);
}

.order-mc-btn.view {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}
.order-mc-btn.edit {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.order-mc-btn.pay {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-mid);
}
.order-mc-btn.complete {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}
.order-mc-btn.print {
    background: var(--gray-100);
    color: var(--gray-600);
    border-color: var(--gray-300);
}

/* ---- Order Detail (view modal) ---- */
.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.order-detail-num {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.order-detail-date {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.order-detail-customer {
    font-size: 12px;
    color: var(--gray-600);
}

.order-detail-amounts {
    text-align: right;
}

.order-detail-total {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
}

@media (max-width: 480px) {
    .order-detail-header {
        flex-direction: column;
        gap: 10px;
    }
    .order-detail-amounts {
        text-align: left;
    }
}

/* =====================================================
   VARIANT PRICING — chooser sheet + labels
   ===================================================== */

/* Small "N options" flag on product card image */
.variant-flag {
    position: absolute;
    top: 6px;
    left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* Variant label chip shown after item name in cart / receipts lists */
.cart-item-variant {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    border: 1px solid var(--primary-dark);
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    letter-spacing: .2px;
}

/* Backdrop + sheet (mirror of .pay-sheet) */
.variant-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1090;
}
.variant-sheet-backdrop.show {
    display: block;
    animation: esBackdropIn 0.22s ease;
}
.variant-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1095;
    background: var(--surface);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.16);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 1, 0.22, 1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none;
}
.variant-sheet.show {
    transform: translateY(0);
    pointer-events: auto;
}
.variant-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}
.variant-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 18px 10px;
    border-bottom: 1px solid var(--border);
}
.variant-sheet-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.variant-sheet-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
}
.variant-sheet-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text, #111);
}
.variant-sheet-close {
    background: var(--gray-100);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--gray-500);
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
.variant-list {
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}
.variant-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.variant-opt:hover,
.variant-opt:active {
    border-color: var(--primary);
    background: var(--primary-light);
}
.variant-opt-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text, #111);
}
.variant-opt-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-dark);
}

/* Discount row in bill summary */
.bill-discount-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}
.bill-discount-row .disc-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}
.disc-type-toggle {
    display: inline-flex;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.disc-type-toggle button {
    border: none;
    background: var(--surface);
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-500);
    cursor: pointer;
}
.disc-type-toggle button.active {
    background: var(--primary);
    color: #fff;
}
.disc-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}
.disc-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.bill-row.discount span:last-child {
    color: var(--danger, #dc3545);
    font-weight: 700;
}

/* =====================================================
   FLOATING BACK BUTTON — PWA only (standalone mode)
   Shown bottom-left, never overlaps content
   ===================================================== */
.pwa-back-btn {
    display: none; /* hidden by default — JS shows it in PWA mode */
    position: fixed;
    bottom: 80px; /* above bottom nav on mobile */
    left: 14px;
    z-index: 999;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--gray-700);
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: background 0.15s, color 0.15s, opacity 0.2s, transform 0.2s;
    opacity: 0.92;
}

.pwa-back-btn:hover {
    background: var(--gray-100);
    color: var(--gray-900);
    opacity: 1;
    transform: scale(1.06);
}

.pwa-back-btn:active {
    transform: scale(0.94);
}

/* On desktop PWA (no bottom nav) move it lower */
@media (min-width: 768px) {
    .pwa-back-btn {
        bottom: 20px;
    }
}

/* Hide on print */
@media print {
    .pwa-back-btn { display: none !important; }
}
