/* Hair Salon Top-Up System - Custom Styles */

:root {
    /* =========================================
       Theme: Sage (Default - Light/Green)
       ========================================= */
    --bs-body-bg: #F1F8E9;
    --bs-body-color: #1f2937;
    /* Updated to match Admin */

    --bg-body: #F1F8E9;
    /* Very Light Green */
    --bg-nav: #43A047;
    /* Fresh Green */
    --bg-card: #FFFFFF;
    --bg-input: #FFFFFF;
    --bg-dropdown: #FFFFFF;

    --text-main: #1f2937;
    /* Updated to match Admin */
    --text-nav: #FFFFFF;
    --text-muted: #6b7280;
    /* Updated to match Admin */
    --text-inverse: #FFFFFF;

    --primary: #43A047;
    --primary-rgb: 67, 160, 71;
    --primary-hover: #2E7D32;
    --secondary: #FFFFFF;
    --accent: #F57C00;
    /* Vibrant Orange */

    --border-color: #C8E6C9;
    --input-border: #C8E6C9;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);

    /* Status Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    /* Bootstrap Overrides */
    --bs-primary: var(--primary);
    --bs-secondary: var(--secondary);
    --bs-success: var(--success);
    --bs-info: var(--info);
    --bs-warning: var(--warning);
    --bs-danger: var(--danger);
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-main);
}

[data-theme="dark"] {
    /* =========================================
       Theme: Dark (Dark Mode)
       ========================================= */
    --bs-body-bg: #0f172a;
    --bs-body-color: #f8fafc;

    --bg-body: #0f172a;
    /* Slate 900 */
    --bg-nav: rgba(15, 23, 42, 0.95);
    --bg-card: rgba(255, 255, 255, 0.05);
    /* Glass effect */
    --bg-input: rgba(255, 255, 255, 0.1);
    --bg-dropdown: #1e293b;

    --text-main: #f8fafc;
    --text-nav: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-inverse: #000000;

    --primary: #818cf8;
    --primary-rgb: 129, 140, 248;
    /* Indigo 400 */
    --primary-hover: #6366f1;
    --secondary: #1e293b;
    --accent: #f472b6;

    --border-color: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    /* Bootstrap Overrides */
    --bs-primary: var(--primary);
    --bs-secondary: var(--secondary);
    --bs-success: var(--success);
    --bs-info: var(--info);
    --bs-warning: var(--warning);
    --bs-danger: var(--danger);
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-main);
}

[data-theme="admin"] {
    /* =========================================
       Theme: Admin (Corporate Blue/Gray)
       ========================================= */
    --bs-body-bg: #f3f4f6;
    --bs-body-color: #1f2937;

    --bg-body: #f3f4f6;
    --bg-nav: #1e293b;
    /* Slate 800 */
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-dropdown: #ffffff;

    --text-main: #1f2937;
    --text-nav: #ffffff;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;

    --primary: #2563eb;
    --primary-rgb: 37, 99, 235;
    /* Blue 600 */
    --primary-hover: #1d4ed8;
    --secondary: #ffffff;
    --accent: #0f172a;

    --border-color: #e5e7eb;
    --input-border: #d1d5db;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    /* Corporate Slate */
    --gradient-success: linear-gradient(135deg, #059669 0%, #047857 100%);
    --gradient-warning: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --gradient-info: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* =========================================
   Global Resets & Typo
   ========================================= */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
}

/* =========================================
   Components
   ========================================= */

/* Navbar */
.navbar {
    background: var(--bg-nav) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0.75rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    color: var(--text-nav) !important;
    font-weight: 800;
}

.nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link i {
    font-size: 1.1rem;
    opacity: 0.8;
}

.nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
}

/* Dropdown Premium Look */
.dropdown-menu {
    margin-top: 0.5rem;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    background-color: var(--bg-dropdown);
    overflow: hidden;
    animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.dropdown-item i {
    font-size: 1.1rem;
    color: var(--primary);
    width: 20px;
}

.dropdown-item:hover {
    background-color: rgba(var(--primary-rgb), 0.08);
    color: var(--primary);
}

.dropdown-item.active {
    background-color: var(--primary);
    color: #fff;
}

.dropdown-item.active i {
    color: #fff;
}

.dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.75rem 1rem 0.25rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
    opacity: 0.05;
}

/* Fix for active tabs on white background */
.nav-tabs .nav-link.active {
    color: var(--text-main) !important;
    background-color: var(--bg-card);
    border-color: var(--border-color) var(--border-color) var(--bg-card);
}

.nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

.nav-tabs .nav-link:hover {
    color: white !important;
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-tabs .nav-link.active:hover {
    color: var(--text-main) !important;
}

/* Cards */
.card,
.section-card,
.stat-card,
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-main);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border-bottom: 1px solid var(--border-color);
    border-radius: 16px 16px 0 0 !important;
}

/* Page Header */
.page-header,
.welcome-section {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    color: white;
    box-shadow: var(--shadow-lg);
}

.welcome-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-subtitle {
    opacity: 0.9;
    margin: 0;
}

/* Inputs */
.form-control,
.form-select {
    background-color: var(--bg-input);
    border-color: var(--input-border);
    color: var(--text-main);
    border-radius: 10px;
}

/* =========================================
   Member Cart (moved from member/cart.php)
   ========================================= */
.cart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cart-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    align-items: center;
    column-gap: 16px;
}

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

.item-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-body);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
}

.item-name {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 2px;
}

.item-type {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.item-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.item-info {
    min-width: 0;
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid var(--border-color);
    min-width: 112px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.qty-btn.disabled {
    opacity: 0.5;
    cursor: default;
}

.qty-value {
    width: 40px;
    text-align: center;
    color: var(--text-main);
    font-weight: 600;
}

.btn-remove {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    color: var(--danger);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    justify-self: end;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

@media (max-width: 576px) {
    .cart-item {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .item-info {
        flex: 1;
    }

    .btn-remove {
        margin-left: auto;
    }
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.summary-row.total .value {
    color: var(--primary);
}

.balance-info {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.balance-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.balance-value {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-cart i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.warning-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    color: var(--danger-color);
    font-size: 0.9rem;
}

.info-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    color: #1d4ed8;
    font-size: 0.9rem;
}

[data-theme="dark"] .info-box {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}


.package-contents {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    display: none;
}

.package-contents.active {
    display: block;
}

.package-contents-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: block;
}

.package-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #4b5563;
}

.package-item:last-child {
    margin-bottom: 0;
}

.package-item i {
    font-size: 0.8rem;
    color: var(--primary);
    margin-right: 0.5rem;
}

/* =========================================
   Packages (moved from packages.php)
   ========================================= */
.package-card {
    transition: all 0.3s ease;
    height: 100%;
}

.package-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.package-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.food-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    background: var(--light-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-color);
}

.food-selector-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    max-height: 250px;
    overflow: hidden;
}

.food-checkboxes {
    max-height: 180px;
    overflow-y: auto;
}

.food-checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.food-checkbox-item:hover {
    background-color: var(--table-hover);
}

.food-checkbox-item input[type="checkbox"] {
    margin-right: 0.75rem;
}

.food-checkbox-item .food-price {
    font-size: 0.875rem;
    color: var(--primary-color);
    margin-left: auto;
}

.selected-food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.badge-inactive {
    background-color: #dc3545;
}

.badge-active {
    background-color: #28a745;
}

.package-foods-list {
    min-height: 60px;
}

@media (max-width: 768px) {
    .package-card .card-body {
        padding: 1rem;
    }
}

/* =========================================
   Foods (moved from foods.php)
   ========================================= */
.food-card {
    transition: all 0.3s ease;
    height: 100%;
}

.food-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.food-image {
    height: 180px;
    object-fit: cover;
    background: var(--light-color);
}

.food-image-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
    color: var(--text-color);
    opacity: 0.5;
}

.food-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.image-upload-container .image-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--light-color);
}

.image-upload-container .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .food-card .card-body {
        padding: 1rem;
    }

    .food-image,
    .food-image-placeholder {
        height: 150px;
    }
}

/* =========================================
   Member Order Details (moved from member/order_details.php)
   ========================================= */
:root {
    --green-900: #1f6b3a;
    --green-800: #247a41;
    --green-700: #2f8f3a;
    --green-100: #eaf6ee;
    --green-050: #f4fbf6;
    --warn: #f59e0b;
    --info: #3b82f6;
    --danger: #ef4444;
    --ok: #16a34a;
    --radius-xl: 18px;
    --radius-lg: 14px;
    --gap: 16px;
}

.pickup-alert {
    background: linear-gradient(135deg, #eaf6ee 0%, #f4fbf6 100%);
    border: 2px solid #2f8f3a;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: var(--gap);
    box-shadow: var(--shadow-soft);
    animation: slideDown 0.3s ease-out;
}

.pickup-alert .alert-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.pickup-alert .alert-title {
    color: var(--green-900);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.pickup-alert .alert-message {
    color: var(--text);
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
}

.pickup-alert .alert-helper {
    font-size: 13px;
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .pickup-alert {
        padding: 16px 18px;
    }

    .pickup-alert .alert-icon {
        font-size: 28px;
    }

    .pickup-alert .alert-title {
        font-size: 16px;
    }

    .pickup-alert .alert-message {
        font-size: 14px;
    }
}

body.member-order {
    color: var(--text);
    background: radial-gradient(1200px 600px at 30% -10%, rgba(47, 143, 58, .12), transparent 60%), linear-gradient(180deg, var(--green-050), #f7faf8 40%, #f7faf8);
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.crumbs a {
    color: var(--green-800);
    text-decoration: none;
    font-weight: 400;
}

.crumbs a:hover {
    text-decoration: underline;
}

.order-hero {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid rgba(47, 143, 58, .22);
    background: linear-gradient(180deg, rgba(47, 143, 58, .98), rgba(33, 125, 78, .98));
    color: #fff;
    margin-bottom: 1.5rem;
}

.order-hero-inner {
    padding: 18px 18px 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: start;
}

.hero-title {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.order-id {
    font-size: 20px;
    font-weight: 400;
    letter-spacing: .4px;
}

.hero-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    opacity: .92;
    margin-top: 6px;
    align-items: center;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: 12px;
}

.hero-right {
    text-align: right;
    display: grid;
    gap: 8px;
    justify-items: end;
}

.total-label {
    font-size: 12px;
    opacity: .92;
}

.total-amount {
    font-size: 26px;
    font-weight: 400;
    letter-spacing: .3px;
    line-height: 1.05;
}

@media (max-width: 768px) {
    .order-hero-inner {
        grid-template-columns: 1fr;
    }

    .hero-right {
        justify-items: start;
        text-align: left;
        margin-top: 8px;
    }
}

.card-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    margin-bottom: var(--gap);
}

.card-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(180deg, #ffffff, #fbfdfc);
    border-bottom: 1px solid var(--border);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    letter-spacing: .2px;
}

.card-title .badge-count {
    font-size: 11px;
    font-weight: 400;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--green-100);
    color: var(--green-900);
    border: 1px solid rgba(47, 143, 58, .18);
}

.icon-green-soft {
    background: rgba(47, 143, 58, .10);
    border-color: rgba(47, 143, 58, .18);
    color: var(--green-900);
}

.icon-green-hard {
    background: #fff;
    border-color: rgba(47, 143, 58, .18);
    color: var(--green-900);
}

.icon-blue-soft {
    background: rgba(59, 130, 246, .10);
    border-color: rgba(59, 130, 246, .18);
    color: #1d4ed8;
}

.tiny {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.items-body {
    padding: 12px 14px 16px;
}

.group {
    border: 1px solid rgba(47, 143, 58, .16);
    background: linear-gradient(180deg, rgba(234, 246, 238, .65), rgba(234, 246, 238, .35));
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
}

.group-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid rgba(47, 143, 58, .14);
}

.group-hd-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
}

.group-count {
    font-size: 11px;
    font-weight: 400;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(47, 143, 58, .16);
    color: var(--green-900);
}

/* =========================================
   Receipt Print (moved from seller_order_details.php)
   ========================================= */
.receipt {
    width: 720px;
    margin: 0 auto;
}

.receipt .header {
    text-align: center;
    margin-bottom: 16px;
}

.receipt .logo {
    width: 280px;
    max-height: 120px;
    object-fit: contain;
    margin: 0 auto 8px;
    display: block;
}

.receipt .company-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.receipt .company-info {
    font-size: 12px;
    color: #444;
}

.receipt .divider {
    border-top: 1px dashed #333;
    margin: 16px 0;
}

.receipt .subtitle {
    font-size: 13px;
    color: #555;
    margin-top: 6px;
}

.receipt .order-info {
    margin-bottom: 6px;
}

.receipt .order-info p {
    margin: 4px 0;
}

.receipt .meta-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.receipt .meta-left,
.receipt .meta-right {
    font-size: 13px;
}

.receipt .meta-right {
    text-align: right;
}

.receipt .badge {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #ddd;
}

.receipt .card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
}

.receipt .card-title {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.receipt .card-line {
    font-size: 14px;
}

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

.receipt .items-table thead th {
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid #333;
    padding: 6px 0;
}

.receipt .items-table tr td {
    border-bottom: 1px dashed #ddd;
    padding: 6px 0;
    vertical-align: top;
    font-size: 14px;
}

.receipt .col-item {
    width: 60%;
}

.receipt .col-qty {
    width: 10%;
    text-align: center;
}

.receipt .col-amt {
    width: 30%;
    text-align: right;
}

.receipt .total-section {
    margin-top: 10px;
}

.receipt .total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.receipt .total-row.grand-total {
    font-size: 16px;
    font-weight: 700;
    border-top: 1px solid #333;
    margin-top: 12px;
    padding-top: 8px;
}

.receipt .footer {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    color: #444;
}

.receipt .status-badge {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 8px;
}

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

@media screen and (min-width: 480px) {
    .receipt {
        width: 720px;
    }
}

/* =========================================
   Member Catalog (moved from member/catalog.php)
   ========================================= */
.page-header {
    background: var(--gradient-primary);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    color: white;
    box-shadow: var(--shadow-sm);
}

.section-title {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

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

.product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-image i {
    font-size: 48px;
    color: var(--text-muted);
    opacity: 0.5;
}

.product-body {
    padding: 16px;
}

.product-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
    height: 40px;
    overflow: hidden;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
}

.btn-add-cart {
    width: 100%;
    background: var(--gradient-success);
    border: none;
    border-radius: 10px;
    padding: 10px;
    color: white;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-add-cart:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-add-cart.added {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.package-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--warning);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.package-foods {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.cart-floating {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--gradient-success);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    text-decoration: none;
    transition: all 0.3s;
    z-index: 1000;
}

.cart-floating:hover {
    transform: scale(1.1);
    color: white;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-container {
    position: fixed;
    bottom: 100px;
    right: 24px;
    z-index: 1050;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.4;
    display: block;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

.modal-package-content {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    border: none;
}

.modal-package-header {
    background: var(--gradient-primary);
    color: white;
    padding: 24px 32px;
    border-bottom: none;
    position: relative;
}

.modal-package-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-package-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.modal-package-body {
    padding: 32px;
}

.modal-food-item {
    display: flex;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-food-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-food-img {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-body);
}

.modal-food-info h5 {
    margin: 0 0 8px 0;
    color: var(--text-main);
}

.modal-food-info p {
    color: var(--text-muted);
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-dialog-package {
    width: 90vw;
    max-width: 980px;
    margin: 24px auto;
}

.modal-package-content {
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

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

@media (min-width: 1400px) {
    .modal-dialog-package {
        max-width: 1100px;
    }
}

@media (max-width: 1200px) {
    .modal-dialog-package {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .modal-dialog-package {
        max-width: 880px;
    }
}

@media (max-width: 768px) {
    .modal-dialog-package {
        width: 95vw;
        max-width: 95vw;
        margin: 16px auto;
    }

    .modal-package-header {
        padding: 18px 20px;
    }

    .modal-package-body {
        padding: 20px;
    }

    .modal-food-item {
        flex-direction: column;
        gap: 16px;
    }

    .modal-food-img {
        width: 100%;
        height: 200px;
    }
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="dark"] .modal-package-content {
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.catalog-body {
    background: var(--bg-card);
    border-radius: 0 0 16px 16px;
}

[data-bs-theme="dark"] .catalog-body {
    background: #1e293b !important;
    color: var(--text-main);
}

[data-bs-theme="dark"] #catalogTabs .nav-link.active {
    background-color: #1e293b !important;
    border-color: rgba(255, 255, 255, 0.1) rgba(255, 255, 255, 0.1) #1e293b !important;
    color: var(--text-main) !important;
}

.catalog-card {
    border: 1px solid var(--border-color);
    overflow: hidden;
    border-radius: 16px;
}

.catalog-card-header {
    background: var(--gradient-primary);
    padding-bottom: 0;
    border-bottom: none;
}

.catalog-tabs {
    border-bottom: none;
}

/* Mobile: catalog tabs fill full width as pill toggles */
@media (max-width: 575.98px) {
    .catalog-card-header {
        padding: 12px 12px 0;
    }

    .catalog-tabs {
        display: flex;
        width: 100%;
        background: rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        padding: 4px;
        gap: 4px;
        margin-bottom: 4px;
    }

    .catalog-tabs .nav-item {
        flex: 1;
    }

    .catalog-tabs .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        padding: 9px 6px;
        border-radius: 9px;
        border: none;
        font-size: 0.82rem;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.75);
        background: transparent;
        transition: all 0.2s ease;
        white-space: nowrap;
        text-align: center;
    }

    .catalog-tabs .nav-link .bi {
        font-size: 0.95rem;
    }

    .catalog-tabs .nav-link .badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .catalog-tabs .nav-link.active {
        background: white;
        color: #2e7d32;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }

    .catalog-tabs .nav-link.active .badge.bg-primary {
        background-color: #1565c0 !important;
        color: white !important;
    }

    .catalog-tabs .nav-link.active .badge.bg-success {
        background-color: #2e7d32 !important;
        color: white !important;
    }

    /* Make the card body padding tighter on mobile */
    .catalog-body {
        padding: 12px !important;
    }
}

/* Mobile: nav cart link — show as a full-width row in collapse */
@media (max-width: 991.98px) {
    .mobile-cart-nav-item {
        display: block !important;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        margin-top: 8px;
        padding-top: 8px;
    }

    .mobile-cart-nav-item .nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
    }

    /* Hide desktop cart that's inside user-menu on mobile */
    .user-menu .desktop-cart-link {
        display: none !important;
    }
}

/* Desktop: hide the mobile-only cart nav item */
@media (min-width: 992px) {
    .mobile-cart-nav-item {
        display: none !important;
    }
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    color: var(--text-main);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--primary), 0.25);
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 20px;
    transition: 0.3s;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-save,
[data-theme="dark"] .btn-success {
    color: var(--bg-body);
    font-weight: 700;
}

.btn-save {
    background: var(--gradient-success);
    color: white;
    border: none;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

/* Dropdowns */
.dropdown-menu {
    background-color: var(--bg-dropdown);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 12px;
}

.dropdown-item {
    color: var(--text-main);
}

.dropdown-item:hover {
    background-color: var(--bs-body-bg);
    color: var(--primary);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* Stats */
.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
}

.stat-icon.balance {
    background: var(--gradient-success);
}

.stat-icon.orders {
    background: var(--gradient-info);
}

.stat-icon.level {
    background: var(--gradient-warning);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.action-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    color: var(--text-main);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.action-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--primary);
}

.action-btn i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}

.action-btn span {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Lists/Orders */
.order-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.order-ref {
    font-weight: 600;
    color: var(--text-main);
}

.order-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.order-amount {
    font-weight: 700;
    color: var(--success);
}

/* Theme Selector in Profile */
.theme-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
}

.theme-option {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    transition: 0.2s;
}

.theme-option.active {
    border-color: var(--primary);
    background-color: rgba(var(--primary), 0.1);
}

.theme-preview {
    height: 60px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.theme-preview.sage {
    background: #F1F8E9;
    border: 1px solid #C8E6C9;
}

.theme-preview.sage::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #43A047;
}

.theme-preview.dark {
    background: #0f172a;
    border: 1px solid #1e293b;
}

.theme-preview.dark::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #0f172a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-preview.admin {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.theme-preview.admin::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #1e293b;
}

.theme-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
}

/* =========================================
   Member Autocomplete (mac-)
   ========================================= */
.mac-search-input {
    border: 1px solid #a4c2f4 !important; /* light blue border like screenshot */
    border-radius: 6px !important;
    padding: 10px 14px !important;
    font-size: 15px !important;
    box-shadow: 0 0 0 3px rgba(164,194,244,0.2) !important;
    transition: all 0.2s ease;
}
.mac-search-input:focus {
    border-color: #6d9eeb !important;
    box-shadow: 0 0 0 3px rgba(109,158,235,0.3) !important;
    outline: none !important;
}

.mac-hint {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    margin-bottom: 4px;
}

.mac-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
}

.mac-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    background: #fff;
    transition: background 0.15s;
}

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

.mac-item:hover {
    background: #f8fafc;
}

.mac-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
    margin-right: 14px;
    flex-shrink: 0;
}

.mac-info {
    flex: 1;
}

.mac-name {
    color: #334155;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 2px;
}

.mac-phone {
    color: #64748b;
    font-size: 13px;
}

.mac-no-result {
    color: #94a3b8;
    justify-content: center;
    padding: 24px 14px;
}