/* -------------------------------------------------------------
   GS Mini Mart — Mobile WebApp Stylesheet
   Designed based on official company banner:
   • Primary Forest/Emerald Green (#047857, #064e3b)
   • Golden Yellow Accents (#f59e0b, #fbbf24)
   • Category Accents: Dairy (Blue), Beverages (Red), Snacks (Amber), Daily Needs (Purple)
------------------------------------------------------------- */

:root {
    --primary-green: #047857;
    --primary-dark: #064e3b;
    --primary-light: #ecfdf5;
    
    --accent-gold: #f59e0b;
    --accent-gold-light: #fef3c7;
    --accent-gold-dark: #b45309;

    --cat-dairy: #2563eb;
    --cat-beverages: #dc2626;
    --cat-snacks: #d97706;
    --cat-daily: #7c3aed;

    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #092e20;
    
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-white: #ffffff;

    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(4, 120, 87, 0.12);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.18);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --font-main: 'Outfit', 'Noto Sans Gurmukhi', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.4;
    padding-bottom: 95px; /* space for mobile floating bottom bar */
}

/* -------------------------------------------------------------
   Header Navigation Bar
------------------------------------------------------------- */
.app-header {
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #0f766e 100%);
    color: var(--text-white);
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 3px 12px rgba(4, 120, 87, 0.3);
    border-bottom: 3px solid var(--accent-gold);
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo-circle {
    width: 38px;
    height: 38px;
    background: radial-gradient(circle, #ffffff 30%, #fef08a 100%);
    border: 2px solid var(--accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.g-letter { color: #047857; }
.s-letter { color: #d97706; }

.brand-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff, #fef08a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-slogan {
    font-size: 11px;
    color: #fde68a;
    display: block;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-toggle-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(253, 230, 138, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-label.current {
    color: var(--accent-gold);
    text-decoration: underline;
}

.admin-icon-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* -------------------------------------------------------------
   Main Layout & Company Banner
------------------------------------------------------------- */
.main-content {
    max-width: 900px;
    margin: 12px auto;
    padding: 0 12px;
}

/* Company Official Banner Image */
.banner-image-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--accent-gold);
    margin-bottom: 14px;
    background: #000;
}

.company-banner-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.banner-overlay-bar {
    background: linear-gradient(90deg, #064e3b 0%, #047857 100%);
    color: #fef08a;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-top: 1px solid var(--accent-gold);
}

/* Trust Badges Bar */
.trust-badges-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 16px;
    background: white;
    padding: 10px 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.trust-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.trust-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.trust-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.1;
}

/* -------------------------------------------------------------
   Category Pills (Color-Coded to Banner)
------------------------------------------------------------- */
.category-section {
    margin-bottom: 16px;
}

.category-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    background: white;
    border: 1px solid var(--border);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

/* Category Accent Styles */
.category-chip[data-cat="Milk"].active {
    background: #e0f2fe;
    color: #1d4ed8;
    border-color: #2563eb;
}

.category-chip[data-cat="Beverages"].active {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #dc2626;
}

.category-chip[data-cat="Snacks"].active {
    background: #fef3c7;
    color: #b45309;
    border-color: #d97706;
}

.category-chip[data-cat="Daily"].active {
    background: #f3e8ff;
    color: #6b21a8;
    border-color: #7c3aed;
}

.category-chip.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary-green);
}

/* -------------------------------------------------------------
   Product Catalog Grid
------------------------------------------------------------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

.items-count-badge {
    font-size: 11px;
    background: var(--accent-gold-light);
    color: var(--accent-gold-dark);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (min-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.product-img-box {
    background: radial-gradient(circle, #f8fafc 0%, #e2e8f0 100%);
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    position: relative;
}

.stock-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.stock-tag.in-stock { background: #dcfce7; color: #15803d; }
.stock-tag.out-stock { background: #fee2e2; color: #b91c1c; }

.product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title-en {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.product-title-pa {
    font-size: 12px;
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 4px;
}

.product-unit {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.product-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Stepper Quantity Control */
.stepper-control {
    display: flex;
    align-items: center;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-green);
    overflow: hidden;
}

.stepper-btn {
    background: transparent;
    border: none;
    color: var(--primary-dark);
    width: 26px;
    height: 26px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.stepper-val {
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-dark);
    padding: 0 4px;
}

/* Loose (per-litre) items: wider value for "750 ml" / "1.25 L" */
.stepper-val-wide {
    min-width: 46px;
    text-align: center;
    white-space: nowrap;
}

.per-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.litre-extra-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.line-cost {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-dark);
}

.quick-litre-btn {
    background: white;
    color: var(--primary-green);
    border: 1px solid var(--primary-green);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

/* Admin: villages & delivery charges tab */
.village-add-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.village-add-form input {
    flex: 1 1 160px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.villages-table input {
    width: 100%;
    min-width: 90px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.villages-table tr.village-off td {
    opacity: 0.6;
}

/* Paid / Not paid tag (admin orders table + delivery page) */
.pay-tag {
    display: inline-block;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}

.pay-tag.paid {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.pay-tag.unpaid {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

span.pay-tag {
    cursor: default;
}

/* Admin: assign order to a delivery person */
.rider-select {
    max-width: 150px;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
}

/* ---------- Delivery staff page ---------- */
.delivery-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.delivery-summary .ds-box {
    background: white;
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.delivery-summary .ds-box strong {
    display: block;
    font-size: 18px;
    color: var(--primary-dark);
}

.delivery-summary .ds-box span {
    font-size: 11px;
    color: var(--text-muted);
}

.delivery-section-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 16px 0 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--accent-gold);
}

.delivery-card.out { border-left-color: #2563eb; }
.delivery-card.done { border-left-color: var(--primary-green); opacity: 0.85; }

.delivery-card .dc-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.delivery-card .dc-customer {
    font-size: 15px;
    font-weight: 800;
}

.delivery-card .dc-row {
    font-size: 13px;
    margin: 3px 0;
    word-break: break-word;
}

.delivery-card .dc-items {
    font-size: 12px;
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    margin: 6px 0;
}

.delivery-card .dc-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.delivery-card .dc-amount {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-dark);
}

.delivery-card .pay-tag {
    font-size: 13px;
    padding: 6px 12px;
}

.dc-action-btn {
    flex: 1 1 100%;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 15px;
    font-weight: 800;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

.dc-action-btn.pickup { background: #2563eb; }
.dc-action-btn.deliver { background: var(--primary-green); }
.dc-action-btn:disabled { opacity: 0.5; }

.dc-call-btn {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary-green);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.delivery-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-md);
}

/* Admin-set per-order limit hint on product cards */
.limit-hint {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #b45309;
    background: #fffbeb;
    border-radius: 4px;
    padding: 1px 5px;
    margin-bottom: 4px;
}

/* Packaged items with several sizes */
.variant-select {
    width: 100%;
    font-size: 11px;
    padding: 4px 6px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
}

/* Customer note on order cards */
.order-note-box {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 12px;
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    word-break: break-word;
}

/* Admin: size rows in product modal & inventory card */
.size-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr auto;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
}

.size-row input {
    width: 100%;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.size-row-head {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.inv-variant-block {
    border-top: 1px dashed var(--border);
    padding-top: 6px;
    margin-top: 6px;
}

.inv-variant-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.add-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* -------------------------------------------------------------
   Bottom Floating Action Bar for Mobile
------------------------------------------------------------- */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid var(--accent-gold);
    padding: 8px 12px;
    z-index: 90;
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
}

.orders-history-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: var(--shadow-sm);
}

.cart-floating-btn {
    flex-grow: 1;
    max-width: 400px;
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    color: white;
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.4);
}

.cart-icon-wrapper {
    position: relative;
    font-size: 18px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: var(--accent-gold);
    color: var(--bg-dark);
    font-size: 10px;
    font-weight: 900;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-total-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cart-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #fef08a;
}

.cart-price {
    font-size: 15px;
    font-weight: 800;
}

/* -------------------------------------------------------------
   Drawer & Modals
------------------------------------------------------------- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 46, 32, 0.65);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}

.drawer-overlay.active .drawer-container {
    transform: translateX(0);
}

.drawer-header {
    padding: 14px 16px;
    background: var(--bg-dark);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--accent-gold);
}

.drawer-title-group h2 { font-size: 16px; font-weight: 800; }
.drawer-subtitle { font-size: 11px; color: #fde68a; }

.close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.drawer-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex-grow: 1;
}

.info-alert {
    background: var(--accent-gold-light);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.alert-text strong { font-size: 12px; color: var(--accent-gold-dark); }
.alert-text p { font-size: 11px; color: #78350f; }

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
}

.cart-item-info strong { font-size: 13px; display: block; }
.cart-item-info span { font-size: 11px; color: var(--text-muted); }

/* Forms */
.form-section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 14px 0 8px 0;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--primary-light);
}

.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 3px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    background: var(--bg-main);
}

.payment-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.payment-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.payment-card.selected { border-color: var(--primary-green); background: var(--primary-light); }
.payment-card-content { display: flex; align-items: center; gap: 8px; }
.pm-icon { font-size: 18px; }
.pm-desc { font-size: 10px; color: var(--text-muted); display: block; }

.summary-box { background: var(--bg-main); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 12px; }
.summary-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.summary-row.total { font-size: 15px; font-weight: 800; border-top: 1px solid var(--border); padding-top: 6px; color: var(--primary-dark); }
.free-text { color: #16a34a; font-weight: 800; }

.place-order-btn {
    width: 100%;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

/* Modals */
.modal-card {
    background: var(--bg-card);
    width: 92%;
    max-width: 550px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-body { padding: 16px; overflow-y: auto; }

.order-history-card {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
}

.oh-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 8px; }

.status-badge { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.5px; }
.status-badge.Pending { background: #fef3c7; color: #b45309; }
.status-badge.Confirmed { background: #e0f2fe; color: #0369a1; }
.status-badge.Dispatched { background: #fae8ff; color: #86198f; }
.status-badge.Delivered { background: #dcfce7; color: #15803d; }
.status-badge.Cancelled { background: #fee2e2; color: #b91c1c; }

/* -------------------------------------------------------------
   Search Bar Component
------------------------------------------------------------- */
.search-section {
    padding: 6px 14px 10px;
    max-width: 900px;
    margin: 0 auto;
}

.search-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--radius-full);
    padding: 6px 14px;
    border: 1.5px solid #cbd5e1;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.search-box-wrapper:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.search-icon {
    font-size: 16px;
    margin-right: 8px;
    color: var(--text-muted);
}

#product-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-main);
    font-size: 14px;
    background: transparent;
    color: var(--text-primary);
}

.clear-search-btn {
    background: #e2e8f0;
    border: none;
    color: #475569;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-search-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}

.reset-filter-btn {
    margin-top: 14px;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* -------------------------------------------------------------
   Order Timeline & Tracking Component
------------------------------------------------------------- */
.orders-tracking-modal {
    max-width: 650px;
}

.orders-lookup-bar {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

.orders-lookup-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 13px;
}

.lookup-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

.refresh-orders-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 14px;
}

.order-timeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 0 16px;
    padding: 10px 8px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    position: relative;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #cbd5e1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.timeline-step.completed .step-dot {
    background: #16a34a;
}

.timeline-step.current .step-dot {
    background: var(--accent-gold);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25);
    transform: scale(1.1);
}

.step-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

.timeline-step.completed .step-label,
.timeline-step.current .step-label {
    color: var(--text-primary);
}

.timeline-line {
    flex: 1;
    height: 3px;
    background: #cbd5e1;
    margin: 0 -8px 18px;
    z-index: 1;
}

.timeline-line.filled {
    background: #16a34a;
}

.cancelled-notice {
    background: #fee2e2;
    color: #b91c1c;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    margin: 10px 0;
}

.oh-details {
    font-size: 12px;
    margin-bottom: 10px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

.oh-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.oh-items-box {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    color: var(--text-secondary);
    font-size: 12px;
}

.oh-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.oh-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.card-action-btn {
    border: none;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.reorder-btn {
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary-green);
}

.receipt-btn {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.cancel-btn {
    background: #fee2e2;
    color: #b91c1c;
}

/* -------------------------------------------------------------
   Remember Details Checkbox
------------------------------------------------------------- */
.remember-box {
    margin: 10px 0 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    gap: 8px;
}

.checkbox-container input {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--primary-green);
}

/* -------------------------------------------------------------
   Receipt Modal & Print Styles
------------------------------------------------------------- */
.receipt-card {
    background: white;
    width: 92%;
    max-width: 480px;
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.receipt-brand {
    text-align: center;
    margin-bottom: 12px;
}

.receipt-brand h3 {
    color: var(--primary-dark);
    font-size: 20px;
    font-weight: 800;
}

.receipt-brand p {
    font-size: 12px;
    color: var(--text-muted);
}

.receipt-slip {
    background: #fafafa;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 12px;
}

.slip-meta, .slip-customer {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.receipt-divider {
    border: none;
    border-top: 1px dashed var(--border);
    margin: 10px 0;
}

.receipt-items-table {
    width: 100%;
    border-collapse: collapse;
}

.receipt-items-table th, .receipt-items-table td {
    padding: 4px 0;
}

.slip-total-row {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.total-highlight {
    font-size: 15px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.slip-thankyou {
    text-align: center;
    margin-top: 14px;
    font-size: 11px;
    color: var(--text-muted);
}

.receipt-footer {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
}

.receipt-print-btn {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
}

/* -------------------------------------------------------------
   Toast Notification System
------------------------------------------------------------- */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 16px;
    left: 16px;
    max-width: 400px;
    margin: 0 auto;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    background: #1e293b;
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.toast-item.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-left: 4px solid #16a34a; }
.toast-warning { border-left: 4px solid #f59e0b; }
.toast-info { border-left: 4px solid #2563eb; }

/* -------------------------------------------------------------
   Admin Console Enhanced Styles
------------------------------------------------------------- */
.admin-page-bg { background: #f1f5f9; }
.admin-header { background: linear-gradient(135deg, #092e20 0%, #064e3b 100%); }

.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric-card { background: white; border-radius: var(--radius-md); padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); }
.metric-icon { font-size: 20px; width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; }
.metric-icon.green { background: #dcfce7; }
.metric-icon.blue { background: #e0f2fe; }
.metric-icon.orange { background: #fef3c7; }
.metric-icon.purple { background: #fae8ff; }
.metric-label { font-size: 11px; color: var(--text-muted); }
.metric-value { font-size: 18px; font-weight: 800; }

.admin-tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--border); margin-bottom: 12px; }
.tab-btn { background: transparent; border: none; padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--text-secondary); cursor: pointer; border-bottom: 3px solid transparent; }
.tab-btn.active { color: var(--primary-green); border-bottom-color: var(--primary-green); }

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

.tab-filter-bar { background: white; padding: 10px 12px; border-radius: var(--radius-sm); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.filter-group { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; }
.filter-group select { padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.dispatch-sheet-btn { background: #0369a1; color: white; border: none; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 700; cursor: pointer; }
.refresh-btn { background: white; border: 1px solid var(--border); padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; }

.orders-table-wrapper { background: white; border-radius: var(--radius-md); overflow-x: auto; border: 1px solid var(--border); }
.orders-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.orders-table th { background: #f8fafc; text-align: left; padding: 10px 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.orders-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }

.action-btn-sm { padding: 4px 8px; border-radius: var(--radius-sm); border: none; font-weight: 700; font-size: 10px; cursor: pointer; margin-right: 2px; }
.btn-confirm { background: #e0f2fe; color: #0369a1; }
.btn-dispatch { background: #fae8ff; color: #86198f; }
.btn-deliver { background: #dcfce7; color: #15803d; }
.btn-cancel { background: #fee2e2; color: #b91c1c; }
.btn-print { background: #f1f5f9; color: #334155; }

/* Inventory Grid & Steppers in Admin */
.inventory-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.add-product-btn { background: var(--primary-green); color: white; border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.inv-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.inv-top { display: flex; align-items: center; gap: 10px; }
.inv-emoji { font-size: 32px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border-radius: var(--radius-sm); }
.inv-title-group strong { font-size: 14px; }
.inv-pa-title { font-size: 12px; color: var(--primary-dark); font-weight: 600; }
.inv-unit-tag { font-size: 11px; color: var(--text-muted); }

.inv-controls-row { display: flex; justify-content: space-between; background: #f8fafc; padding: 6px 10px; border-radius: var(--radius-sm); }
.inv-control-item { display: flex; align-items: center; gap: 6px; }
.inv-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.inv-stepper { display: flex; align-items: center; gap: 4px; background: white; border: 1px solid var(--border); border-radius: 4px; padding: 1px; }
.inv-step-btn { background: transparent; border: none; width: 20px; height: 20px; font-weight: 700; cursor: pointer; color: var(--primary-green); }
.inv-val { font-size: 11px; font-weight: 700; min-width: 24px; text-align: center; }

.inv-actions-row { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 8px; }

/* Daily Dispatch Sheet Styles */
.dispatch-sheet-card { max-width: 750px; }
.dispatch-sheet-paper { font-size: 12px; }
.sheet-title-box { text-align: center; margin-bottom: 16px; border-bottom: 2px solid var(--border); padding-bottom: 10px; }
.village-dispatch-block { margin-bottom: 16px; background: white; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.vdb-header { background: #f1f5f9; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.vdb-header h4 { font-size: 13px; color: var(--primary-dark); }
.vdb-total { font-weight: 800; color: var(--accent-gold-dark); font-size: 12px; }
.vdb-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.vdb-table th { background: #f8fafc; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.vdb-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }

.db-config-card { background: white; padding: 20px; border-radius: var(--radius-md); max-width: 550px; }
.db-actions { display: flex; gap: 8px; margin-top: 14px; }
.save-cfg-btn { background: var(--primary-green); color: white; border: none; padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }
.seed-btn { background: var(--bg-main); border: 1px solid var(--border); padding: 8px 16px; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }
.sql-hint-box { margin-top: 16px; background: var(--primary-light); border: 1px solid var(--primary-green); border-radius: var(--radius-sm); padding: 10px; font-size: 11px; color: var(--primary-dark); }


/* -------------------------------------------------------------
   Printing a single modal (receipt / dispatch sheet) — see printModal()
   Fixed, scrollable overlays print as blank pages, so flatten the target
   and hide everything else.
------------------------------------------------------------- */
@media print {
    body.printing > *:not(.print-target) {
        display: none !important;
    }

    body.printing > .print-target {
        position: static !important;
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: none !important;
        backdrop-filter: none !important;
    }

    .print-target .modal-card,
    .print-target .receipt-card {
        width: 100% !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 !important;
        overflow: visible !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .print-target .modal-body,
    .print-target .receipt-body {
        overflow: visible !important;
        max-height: none !important;
    }

    .print-target .close-btn,
    .print-target .receipt-footer {
        display: none !important;
    }

    .print-target .drawer-header {
        background: none !important;
        color: #000 !important;
        border-bottom: 2px solid #000 !important;
    }

    .print-target .drawer-subtitle {
        color: #333 !important;
    }

    /* Keep each village's table together where possible */
    .print-target .village-dispatch-block {
        break-inside: avoid;
    }

    body.printing {
        background: white !important;
    }

    /* Order slips use their own page so the dispatch sheet keeps normal A4 margins */
    .order-slip-print {
        page: order-slip;
    }
}

/* -------------------------------------------------------------
   80mm thermal order slip — see printOrderSlip() in admin.js
   80mm paper prints about 72mm wide; black only, no backgrounds.
------------------------------------------------------------- */
@page order-slip {
    margin: 0;
}

.order-slip-print {
    display: none;
}

.order-slip {
    width: 72mm;
    margin: 0 auto;
    padding: 3mm 0 8mm;
    font-family: "Noto Sans Gurmukhi", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 12.5px;
    line-height: 1.35;
    color: #000;
}

.order-slip hr {
    border: none;
    border-top: 1px dashed #000;
    margin: 6px 0;
}

.order-slip .slip-shop {
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1px;
}

.order-slip .slip-center {
    text-align: center;
}

.order-slip .slip-order-no {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    margin: 2px 0;
}

.order-slip .slip-village {
    font-size: 14px;
    font-weight: 800;
}

.order-slip .slip-note {
    border: 1px solid #000;
    padding: 3px 5px;
    margin-top: 4px;
    font-weight: 700;
}

.order-slip .slip-item {
    margin-bottom: 4px;
    break-inside: avoid;
}

.order-slip .slip-item-name {
    font-weight: 700;
}

.order-slip .slip-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.order-slip .slip-total {
    font-size: 16px;
    font-weight: 800;
    margin-top: 2px;
}

.order-slip .slip-payment {
    text-align: center;
    font-size: 15px;
    font-weight: 800;
    border: 2px solid #000;
    padding: 4px;
    margin-top: 6px;
}
