:root {
    --primary: #2ECC71;
    /* Fresh Green */
    --primary-dark: #27AE60;
    --secondary: #F39C12;
    /* Organic Orange */
    --bg-body: #F4F6F7;
    --bg-card: #FFFFFF;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --border: #E5E7E9;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-main);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
header {
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.logo span {
    color: var(--secondary);
}

/* Categories */
.category-nav {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 60px;
    z-index: 90;
    background: var(--bg-body);
    margin-bottom: 1rem;
}

.cat-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Grids & Cards */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding-bottom: 100px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 0;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: #eee;
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    /* Fill the area nicely */
    background: #fdfdfd;
}

.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 1rem;
    line-height: 1.3;
}

.product-price {
    font-weight: 700;
    color: var(--secondary);
    /* Orange price looks good for food */
    font-size: 1.2rem;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

/* Buttons */
.add-btn {
    width: 100%;
    margin-top: auto;
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

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

.qty-control {
    display: flex;
    align-items: stretch;
    margin-top: auto;
    border-radius: 8px;
    overflow: hidden;
    height: 36px;
    border: 1px solid #ddd;
}

.qty-btn {
    border: none;
    color: #fff;
    padding: 0 0.8rem;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.qty-btn:active {
    opacity: 0.8;
}

/* Minus Button - Red */
.qty-btn:first-child {
    background-color: #E74C3C;
}

/* Plus Button - Green */
.qty-btn:last-child {
    background-color: #2ECC71;
}

.qty-val {
    background-color: #fff;
    color: #2C3E50;
    font-weight: 700;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    flex: 1;
    font-size: 0.95rem;
}

/* Drawer & FAB */
.fab-cart {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--secondary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
    display: none;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    z-index: 200;
}

.drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 300;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.drawer.open {
    transform: translateY(0);
}

/* Inputs */
input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #BDC3C7;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: inherit;
    background: #FAFAFA;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    margin-top: 1rem;
    cursor: pointer;
}

/* Admin Specific */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: #2C3E50;
    color: #ECF0F1;
    padding: 2rem 1rem;
    overflow: hidden;
    /* Ensure box doesn't spill if rounded */
}

.admin-sidebar .logo {
    background: #fff;
    margin: -2rem -1rem 2rem -1rem;
    /* Pull directly to edges */
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-main {
    padding: 2rem;
    background: #ECF0F1;
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #BDC3C7;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #34495E;
    color: #fff;
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

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

.admin-table th {
    text-align: left;
    padding: 1rem;
    background: #F8F9F9;
    color: #7F8C8D;
    font-weight: 600;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #E5E7E9;
}



/* Header Cart Button */
/* Header Cart Button */
.header-cart-btn {
    background: linear-gradient(135deg, #2ECC71 0%, #27AE60 100%);
    color: #fff;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.header-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.5);
}

/* Drawer Header & Close Button */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

/* Image Container for positioning the button correctly */
.img-container {
    position: relative;
    width: 100%;
    /* Ensure it takes full width of card */
    display: block;
    z-index: 2;
    /* Ensure button sits on top of card content */
}

.btn-add-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: #2ECC71;
    color: white;
    border: none;
    border-radius: 8px 0 0 0;
    /* Rounded top-left corner for style */
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.1);
    /* Inner shadow feel */
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
    z-index: 10;
    opacity: 1 !important;
    /* Force visibility */
}

.btn-add-icon:hover {
    transform: scale(1.05);
    background: #27AE60;
    z-index: 11;
}

.card-content {
    position: relative;
    z-index: 1;
    padding-top: 0.5rem !important;
    /* Reset padding */
}

/* Date Selection Grid */
.date-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.date-option {
    background: #fff;
    border: 1px solid #BDC3C7;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.date-option:hover {
    border-color: var(--primary);
    background: #F4F6F7;
}

.date-option.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3);
    transform: translateY(-2px);
}

.date-option.selected .d-sub {
    color: rgba(255, 255, 255, 0.9);
}

.date-option.selected .d-subs {
    color: #fff !important;
}

.d-main {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.d-sub {
    font-size: 0.85rem;
    color: #7F8C8D;
}

/* Grids & Cards - Mobile Override */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.5rem !important;
    }

    .product-card {
        border-radius: 8px;
    }

    .product-image {
        height: 100px !important;
    }

    .card-content {
        padding: 0.5rem !important;
    }

    .product-title {
        font-size: 0.8rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .product-price {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    .add-btn {
        padding: 0.25rem !important;
        font-size: 0.7rem !important;
    }

    .qty-control {
        height: 25px;
    }

    .qty-btn {
        padding: 0 0.5rem !important;
        font-size: 1rem !important;
    }

    .qty-val {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 0.5rem 1rem;
        background: #2C3E50;
        position: sticky;
        top: 0;
        z-index: 999;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .admin-sidebar nav {
        display: flex;
        gap: 0.5rem;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .admin-sidebar .logo {
        margin-bottom: 0.5rem;
        width: 100%;
        text-align: center;
    }

    .sidebar-link {
        padding: 0.5rem 0.75rem;
        margin: 0;
        white-space: nowrap;
        font-size: 0.9rem;
    }

    .admin-main {
        padding: 1rem;
    }

    /* Adjust modal sizing for mobile */
    .modal-content {
        width: 95% !important;
        padding: 1.5rem !important;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Admin Simplified */
.stat-grid {
    grid-template-columns: 1fr 1fr;
}

/* Universal Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75px;
    /* Comfortable height */
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    /* Soft classy shadow */
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 250;
    padding-bottom: 5px;
    /* Adjust for safe area if helpful */
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.drawer-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.close-btn {
    background: #FFEBEE;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    color: #D32F2F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #D32F2F;
    color: white;
}

/* Center Action Button Wrapper - Adjusted for Rectangular */
.nav-center-wrapper {
    position: relative;
    top: -15px;
    /* Float slightly less */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-main-btn {
    width: auto;
    min-width: 140px;
    /* Wide enough for text */
    height: 54px;
    /* Standard button height */
    border-radius: 27px;
    /* Pill shape (half of height) */
    background: linear-gradient(135deg, #F39C12 0%, #E67E22 100%);
    border: 4px solid #fdfdfd;
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
    display: flex;
    flex-direction: row;
    /* Icon left, text right */
    gap: 10px;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0 1.5rem;
}

.nav-main-btn:active {
    transform: scale(0.96);
}

.nav-total-badge {
    font-size: 0.9rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 0;
    color: #fff;
}

.nav-label-main {
    font-size: 0.8rem;
    font-weight: 700;
    color: #2C3E50;
    margin-top: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    display: none;
    /* Hide text label since button is now wide and descriptive */
}

/* Search Overlay */
.search-overlay {
    position: fixed;
    bottom: 80px;
    /* Above nav */
    left: 10px;
    right: 10px;
    background: #fff;
    padding: 0.8rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 0.5rem;
    z-index: 245;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

#overlay-search-input {
    flex: 1;
    background: #F4F6F7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 1rem;
    outline: none;
}

#overlay-search-input:focus {
    border-color: var(--primary);
    background: #fff;
}

/* Active Order Bar */
.ao-bar {
    position: fixed;
    bottom: 80px;
    /* Above nav */
    left: 0;
    right: 0;
    background: #2C3E50;
    color: #fff;
    padding: 0.4rem 1rem;
    /* Reduced height */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    z-index: 200;
    /* LOWER than bottom-nav (250) to prevent covering the floating button */
    cursor: pointer;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease;
}

/* Hide desktop cart details */
@media (min-width: 769px) {

    .bottom-nav,
    .ao-bar,
    .search-overlay,
    #active-order-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .header-cart-btn {
        display: none !important;
    }
}

/* Hide header cart on mobile */
@media (max-width: 768px) {
    .header-cart-btn {}
}

@media print {
    .no-print {
        display: none !important;
    }

    .admin-main {
        padding: 0;
        background: #fff;
    }

    .admin-card {
        box-shadow: none;
        padding: 0;
    }
}

/* Active Order Panel - Missing Styles */
.ao-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.15);
    z-index: 260;
    /* Higher than nav (250) */
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh;
    overflow-y: auto;
    padding-bottom: 20px;
}

.ao-panel.visible {
    transform: translateY(0);
}

/* Make sure ao-bar pushes up or stays visible */
.ao-bar {
    z-index: 255;
    /* Below panel, above nav */
}

/* Admin Toolbar V3 (Bulletproof Alignment) */
.admin-toolbar {
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Common Base for ALL Toolbar Items */
.at-search-box,
.at-date-input,
.at-btn,
.at-link {
    height: 48px !important;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    margin: 0 !important;
    border-radius: 8px;
    transition: all 0.2s;
}

.brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
}

/* SEARCH & DATE CONTAINERS */
.at-search-box {
    flex: 1;
    min-width: 200px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    padding: 0 14px;
    gap: 10px;
    /* Flex gap handles icon spacing */
    position: relative;
}

.at-date-input {
    width: auto;
    max-width: 220px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    padding: 0 14px;
    gap: 10px;
    flex-shrink: 0;
}

/* INPUT RESET (Inside Containers) */
.at-search-box input,
.at-date-input input,
.at-date-input select {
    border: none;
    background: transparent;
    width: 100%;
    height: 100%;
    outline: none;
    font-size: 0.95rem;
    color: #334155;
    padding: 0;
    margin: 0;
    font-family: inherit;
}

/* ICONS */
.at-search-icon,
.at-date-icon {
    font-size: 1rem;
    color: #94A3B8;
    flex-shrink: 0;
    position: static !important;
    /* Force static positioning */
    transform: none !important;
}

/* BUTTONS */
.at-btn {
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    justify-content: center;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    gap: 8px;
}

.at-btn-primary {
    background: #3B82F6;
    color: white;
}

.at-btn-primary:hover {
    background: #2563EB;
}

.at-btn-secondary {
    background: #334155;
    color: white;
}

.at-btn-secondary:hover {
    background: #1F2937;
}

/* CLEAR LINK */
.at-link {
    text-decoration: none;
    color: #64748B;
    font-weight: 500;
    padding: 0 1rem;
    cursor: pointer;
}

.at-link:hover {
    color: #EF4444;
    background: #FEF2F2;
}

@media (max-width: 900px) {
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .at-search-box {
        width: 100%;
    }

    .admin-toolbar>* {
        width: 100%;
    }

    .at-btn {
        width: 100%;
    }
}

@media screen {
    .print-container {
        display: none !important;
    }
}

/* Print Layout Redesign */
@media print {
    @page {
        margin: 1cm;
        size: A4;
    }

    body {
        background: #fff;
        font-family: 'Inter', sans-serif;
        font-size: 11px;
        /* Smaller font as requested */
        color: #000;
    }

    /* Hide UI Elements */
    .no-print,
    .admin-sidebar,
    .admin-toolbar,
    .admin-card:not(.print-visible),
    .stat-grid {
        display: none !important;
    }

    .admin-card.print-visible {
        display: block !important;
        box-shadow: none;
        border: 1px solid #000;
        padding: 0;
    }

    .admin-card.print-visible table th,
    .admin-card.print-visible table td {
        border: 1px solid #ccc;
        padding: 8px;
    }

    .admin-main {
        padding: 0;
        margin: 0;
        width: 100%;
        background: #fff;
    }

    .print-container {
        display: block !important;
        width: 100%;
    }

    .print-header {
        text-align: center;
        margin-bottom: 1rem;
        border-bottom: 2px solid #000;
        padding-bottom: 0.5rem;
    }

    .print-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2 Cards per row for compactness */
        gap: 15px;
    }

    .print-card {
        border: 1px solid #000;
        /* Distinct border */
        border-radius: 4px;
        padding: 10px;
        break-inside: avoid;
        /* Prevent splitting across pages */
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Header: Code (Left), Date (Right) */
    .pc-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px dotted #ccc;
        padding-bottom: 4px;
        margin-bottom: 2px;
    }

    .pc-code {
        font-weight: 700;
        font-size: 0.9rem;
        /* Slightly larger order code */
    }

    /* Body: Customer & Meta */
    .pc-body {
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }

    .pc-customer {
        flex: 2;
        font-size: 1.1em;
    }

    .pc-address {
        font-size: 0.9em;
        margin-top: 2px;
        color: #333;
    }

    .pc-meta {
        flex: 1;
        text-align: right;
        font-size: 1em;
        background: #f0f0f0;
        padding: 4px;
        border-radius: 4px;
    }

    /* Footer: Items */
    .pc-items {
        margin-top: 4px;
        padding-top: 4px;
        border-top: 1px dashed #ddd;
        font-size: 0.95em;
        line-height: 1.4;
    }

    .pc-item-row {
        margin-bottom: 2px;
        padding-left: 4px;
    }

    /* PRODUCT PRINT LAYOUT */
    .print-product-list {
        display: block !important;
        padding: 20px;
        font-family: 'Inter', sans-serif;
    }

    .pp-header {
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        align-items: baseline;
    }

    .pp-header h1 {
        font-size: 24px;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .pp-category-section {
        margin-bottom: 30px;
        page-break-inside: avoid;
    }

    .pp-cat-title {
        font-size: 16px;
        background: #eee;
        padding: 8px 12px;
        margin: 0 0 10px 0;
        border-left: 4px solid #333;
        font-weight: 700;
        color: #000;
        text-transform: uppercase;
    }

    .pp-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .pp-card {
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 10px;
        display: flex;
        align-items: center;
        gap: 15px;
        background: #fff;
        page-break-inside: avoid;
    }

    .pp-img {
        width: 60px;
        height: 60px;
        border-radius: 4px;
        overflow: hidden;
        background: #f8f8f8;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #eee;
        flex-shrink: 0;
    }

    .pp-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .pp-img i {
        font-size: 24px;
        color: #ccc;
    }

    .pp-info {
        flex: 1;
    }

    .pp-name {
        font-weight: 700;
        font-size: 14px;
        margin-bottom: 4px;
        color: #000;
    }

    .pp-meta {
        font-size: 13px;
        color: #555;
        display: flex;
        align-items: baseline;
        gap: 4px;
    }

    .pp-price {
        font-weight: 700;
        color: #000;
        font-size: 15px;
    }
}

/* Screen Visibility */
.print-product-list {
    display: none;
}

/* --- FIXED: Mobile Search Close Button --- */
.search-overlay button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 2rem;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 1001;
    /* Ensure on top */
}

.search-overlay button:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #c0392b;
}

/* --- FIXED: Desktop Search & Drawer --- */
.desktop-search {
    display: none;
    /* Hidden on mobile */
}

@media (min-width: 768px) {

    /* Show Search on Desktop */
    .desktop-search {
        display: block;
        flex: 1;
        max-width: 500px;
        margin: 0 2rem;
        position: relative;
    }

    .desktop-search input {
        width: 100%;
        margin-bottom: 0;
        padding: 0.75rem 1rem 0.75rem 2.8rem;
        /* Space for icon */
        border-radius: 50px;
        border: 1px solid #E5E7E9;
        background: #F8F9F9;
        transition: all 0.2s;
    }

    .desktop-search input:focus {
        background: #fff;
        border-color: var(--primary);
        box-shadow: 0 2px 10px rgba(46, 204, 113, 0.1);
    }

    .desktop-search-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #95a5a6;
        pointer-events: none;
    }

    /* Fix Drawer: Side Panel on Desktop */
    .drawer {
        top: 0;
        bottom: 0;
        left: auto !important;
        /* Reset left */
        right: 0;
        width: 400px;
        /* Fixed width */
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        transform: translateX(100%);
        /* Slide from right */
        max-height: none;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    }

    .drawer.open {
        transform: translateX(0);
        /* Slide in */
    }

    /* Header adjustments */
    .header-inner {
        padding: 0.5rem 0;
    }
}

/* --- DASHBOARD WIDGETS --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-title {
    font-size: 1rem;
    color: #7F8C8D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* Simple Table */
.simple-table {
    width: 100%;
    border-collapse: collapse;
}

.simple-table th {
    text-align: left;
    font-size: 0.8rem;
    color: #999;
    padding-bottom: 0.5rem;
}

.simple-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

.simple-table tr:last-child td {
    border-bottom: none;
}

/* Logs */
.log-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.log-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f9f9f9;
}

.log-icon {
    width: 32px;
    height: 32px;
    background: #E8F8F5;
    color: #1ABC9C;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.log-content {
    flex: 1;
}

.log-desc {
    font-size: 0.9rem;
    color: #34495E;
    margin-bottom: 2px;
}

.log-time {
    font-size: 0.75rem;
    color: #95A5A6;
}

/* Histogram (Top Products) */
.histogram-container {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    height: 250px;
}

.hist-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    width: 60px;
    flex-shrink: 0;
}

.hist-val {
    font-size: 0.75rem;
    font-weight: bold;
    color: #2C3E50;
    margin-bottom: 5px;
}

.hist-bar {
    width: 100%;
    background: #3498DB;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
    min-height: 4px;
}

.hist-label {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #7F8C8D;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.scroll-card {
    overflow: hidden;
    /* Container handles overflow */
}

/* Districts */
.districts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.district-row {
    width: 100%;
}

.d-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.d-name {
    font-weight: 600;
    color: #34495E;
}

.d-count {
    color: #7F8C8D;
}

.progress-bg {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #F39C12;
    border-radius: 4px;
}

/* --- ADMIN MOBILE RESPONSIVE --- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2C3E50;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

@media (max-width: 992px) {
    .admin-layout {
        display: block;
        /* Stack sidebar and main */
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Show Mobile Menu Button */
    .mobile-menu-btn {
        display: inline-block;
    }

    .admin-header-mobile {
        display: flex;
        align-items: center;
        margin-bottom: 1.5rem;
    }

    /* Adjust Toolbar on Mobile */
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .at-search-box,
    .at-date-input,
    .at-btn {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .at-btn {
        justify-content: center;
    }
}

/* Force vertical stacking in sidebar on mobile */
@media (max-width: 992px) {
    .admin-sidebar nav {
        display: flex;
        flex-direction: column;
    }

    .admin-sidebar {
        overflow-y: auto;
    }
}

/* --- ENHANCED MOBILE SIZING (User Request: ~50% Bigger) - SCOPED TO ADMIN --- */
@media (max-width: 992px) {

    /* Admin headers */
    .admin-main h1 {
        font-size: 2.2rem !important;
        margin-bottom: 1.5rem !important;
    }

    .card-title {
        font-size: 1.3rem !important;
        padding-bottom: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Stats */
    .stat-card {
        padding: 1.5rem !important;
    }

    .stat-card>div:first-child {
        /* Label */
        font-size: 1.1rem !important;
    }

    .stat-card>div:nth-child(2) {
        /* Value */
        font-size: 2.5rem !important;
        padding: 0.5rem 0;
    }

    /* Tables */
    .simple-table th,
    .admin-table th {
        font-size: 1.1rem !important;
        padding-bottom: 1rem !important;
    }

    .simple-table td,
    .admin-table td {
        font-size: 1.2rem !important;
        padding: 1rem 0 !important;
    }

    .badge {
        font-size: 1rem !important;
        padding: 6px 12px !important;
    }

    /* Text */
    .log-desc {
        font-size: 1.2rem !important;
    }

    .log-time {
        font-size: 1rem !important;
    }

    /* Inputs & Buttons (LOCALLY SCOPED) */
    .admin-layout .at-btn,
    .admin-layout button,
    .admin-layout input[type="date"],
    .admin-layout input[type="text"],
    .admin-layout select {
        font-size: 1.2rem !important;
        padding: 1rem !important;
        height: auto !important;
    }

    /* List items */
    .d-info span {
        font-size: 1.1rem !important;
    }

    /* Histogram */
    .hist-val {
        font-size: 1rem !important;
    }

    .hist-label {
        font-size: 0.9rem !important;
    }
}/* Active Orders List */
.active-orders-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.active-order-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.ao-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ao-code {
    font-weight: 700;
    color: #2C3E50;
}

.ao-status {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.ao-date {
    font-size: 0.85rem;
    color: #7F8C8D;
    margin-bottom: 0.75rem;
}

.ao-items {
    font-size: 0.9rem;
    color: #34495E;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.ao-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    font-size: 1rem;
}

/* Success Overlay */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-card {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #2ECC71;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 20px rgba(46, 204, 113, 0.4);
}

.countdown-circle {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 1.5rem auto;
}

.countdown-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.countdown-circle circle {
    fill: none;
    stroke: #eee;
    stroke-width: 5;
}

.countdown-circle path {
    fill: none;
    stroke: #2ECC71;
    stroke-width: 5;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    animation: countdown 4s linear forwards;
}

#countdown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 1.2rem;
    color: #2C3E50;
}

@keyframes countdown {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: 283;
    }
}

.manual-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25D366;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: transform 0.2s, background 0.2s;
    animation: fadeIn 0.5s ease;
}

.manual-btn:hover {
    background: #1ebc57;
    transform: scale(1.05);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}/* Checkout Form Styling */
#checkout-form {
    padding: 1rem 0;
}

#checkout-form input[type="text"],
#checkout-form input[type="tel"],
#checkout-form input[type="number"],
#checkout-form select,
#checkout-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
    color: #333;
    appearance: none;
    /* Remove default styling */
    -webkit-appearance: none;
}

/* Custom Arrow for Select */
#checkout-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

#checkout-form textarea {
    resize: vertical;
}

#checkout-form input:focus,
#checkout-form select:focus,
#checkout-form textarea:focus {
    border-color: #2ECC71;
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

#checkout-form h3 {
    margin-bottom: 0.5rem;
    color: #2C3E50;
    font-size: 1.1rem;
}