/* ============================================
   BLOOM & FLOURISH - FLOWER SHOP INVENTORY
   Premium Glass-Style Floral UI Design
   ============================================ */

/* CSS Variables */
:root {
    /* Primary Colors */
    --white: #ffffff;
    --blush-tint: #f8e8e9;
    --dusty-rose: #d8a7b1;
    --dusty-rose-dark: #c48b95;
    --eucalyptus: #b5c7b2;
    --eucalyptus-dark: #9ab396;
    
    /* Neutral Colors */
    --cream: #fdf9f7;
    --soft-beige: #f5efe8;
    --warm-gray: #9a8f8a;
    --charcoal: #4a4543;
    --deep-charcoal: #2d2a28;
    
    /* Status Colors */
    --success: #7cb899;
    --warning: #e8c77b;
    --danger: #d88a8a;
    --info: #8fb8c9;
    
    /* Shadows & Effects */
    --shadow-soft: 0 4px 20px rgba(74, 69, 67, 0.08);
    --shadow-medium: 0 8px 32px rgba(74, 69, 67, 0.12);
    --shadow-glow: 0 0 40px rgba(216, 167, 177, 0.2);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(216, 167, 177, 0.3);
    --glass-blur: 12px;
    
    /* Typography */
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Floral Background */
.floral-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(216, 167, 177, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(181, 199, 178, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 30%, rgba(248, 232, 233, 0.4) 0%, transparent 40%),
        linear-gradient(180deg, var(--cream) 0%, var(--soft-beige) 100%);
}

.floral-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23d8a7b1'%3E%3Cpath d='M40 10c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z'/%3E%3Cpath d='M40 52c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z'/%3E%3Cpath d='M19 31c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z'/%3E%3Cpath d='M61 31c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 14c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--deep-charcoal);
    line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    color: var(--warm-gray);
}

/* Utility Classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--warm-gray); }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }
.flex-grow { flex-grow: 1; }

/* ============================================
   GLASS CARD COMPONENT
   ============================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.glass-card:hover {
    box-shadow: var(--shadow-medium);
}

.card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.card-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-header-inline h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.card-header-inline h3 i {
    color: var(--dusty-rose);
}

.card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dusty-rose), transparent);
    margin: 1rem 0;
    opacity: 0.5;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--dusty-rose), var(--dusty-rose-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(216, 167, 177, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(216, 167, 177, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--dusty-rose);
    color: var(--dusty-rose-dark);
}

.btn-outline:hover {
    background: var(--blush-tint);
}

.btn-success {
    background: linear-gradient(135deg, var(--eucalyptus), var(--eucalyptus-dark));
    color: var(--white);
}

.btn-success:not(:disabled) {
    box-shadow: 0 4px 15px rgba(181, 199, 178, 0.6);
    animation: pulse-glow-green 2s ease-in-out infinite;
}

@keyframes pulse-glow-green {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(181, 199, 178, 0.6);
    }
    50% {
        box-shadow: 0 6px 25px rgba(181, 199, 178, 0.8);
    }
}

.btn-success:not(:disabled):hover {
    box-shadow: 0 8px 30px rgba(181, 199, 178, 0.9);
    animation: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #c67777);
    color: var(--white);
}

.btn-full { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(50%);
}

.btn-primary:not(:disabled) {
    background: linear-gradient(135deg, #d8a7b1, #c48b95);
    box-shadow: 0 4px 15px rgba(216, 167, 177, 0.6);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(216, 167, 177, 0.6);
    }
    50% {
        box-shadow: 0 6px 25px rgba(216, 167, 177, 0.8);
    }
}

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(216, 167, 177, 0.9);
    animation: none;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.form-group label i {
    color: var(--dusty-rose);
    font-size: 0.85rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    background: var(--white);
    color: var(--charcoal);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(216, 167, 177, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--warm-gray);
    opacity: 0.7;
}

/* Searchable Select */
.searchable-select-wrapper {
    position: relative;
}

.searchable-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1.5px solid var(--dusty-rose);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    margin-top: 0.25rem;
}

.searchable-dropdown.hidden {
    display: none;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(216, 167, 177, 0.1);
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: rgba(216, 167, 177, 0.1);
}

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

.dropdown-item-name {
    display: block;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

.dropdown-item-price {
    display: block;
    font-size: 0.85rem;
    color: var(--warm-gray);
}

.selected-product-display {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(181, 199, 178, 0.1);
    border: 1px solid rgba(181, 199, 178, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--charcoal);
    display: none;
}

.selected-product-display.active {
    display: block;
}

/* Multi-Product Receipt Section */
.receipt-product-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.product-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.product-item-number {
    font-weight: 600;
    color: var(--dusty-rose);
    font-size: 0.9rem;
}

.remove-product-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-product-btn:hover {
    opacity: 1;
}

.add-product-section {
    margin-bottom: 1rem;
    text-align: center;
}

.receipt-total-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(124, 184, 153, 0.1);
    border: 1px solid var(--success);
}

.receipt-total-display .total-label {
    font-weight: 600;
    color: var(--charcoal);
}

.receipt-total-display .total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
}

/* Custom Order Items Section */
.custom-order-section,
.custom-order-inline-section {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(168, 98, 106, 0.05);
    border: 1px dashed var(--dusty-rose);
    border-radius: var(--radius-md);
}

.custom-order-section .section-header,
.custom-order-inline-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.custom-order-section .section-header label,
.custom-order-inline-section .section-header label {
    font-weight: 600;
    color: var(--dusty-rose);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-items-list,
.custom-items-inline-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.custom-item-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
}

.custom-item-row .item-select-wrapper {
    flex: 2;
    position: relative;
}

.custom-item-row .item-search {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--champagne);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.custom-item-row .item-search:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(168, 98, 106, 0.1);
}

.custom-item-row .item-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--champagne);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-medium);
    z-index: 100;
}

.custom-item-row .item-dropdown-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-item-row .item-dropdown-item:hover {
    background: var(--blush-tint);
}

.custom-item-row .item-dropdown-item .item-stock {
    font-size: 0.75rem;
    color: var(--warm-gray);
}

.custom-item-row .quantity-input-wrapper {
    flex: 1;
    max-width: 100px;
}

.custom-item-row .quantity-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 2px solid var(--champagne);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    background: white;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.custom-item-row .quantity-input:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(168, 98, 106, 0.1);
}

.custom-item-row .remove-item-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #f87171;
    color: #f87171;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.custom-item-row .remove-item-btn:hover {
    background: #f87171;
    color: white;
}

.custom-item-row .selected-item-display {
    font-size: 0.8rem;
    color: var(--sage-green);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Mobile responsive custom items */
@media (max-width: 480px) {
    .custom-item-row {
        flex-wrap: wrap;
    }
    
    .custom-item-row .item-select-wrapper {
        flex: 1 1 100%;
    }
    
    .custom-item-row .quantity-input-wrapper {
        flex: 1;
        max-width: none;
    }
    
    .custom-order-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-section {
    background: var(--blush-tint);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.form-section h4 {
    margin-bottom: 1rem;
    color: var(--dusty-rose-dark);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(216, 167, 177, 0.2);
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    padding: 0.75rem;
}

.file-upload-preview {
    margin-top: 0.75rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 150px;
}

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

.camera-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.camera-upload span {
    color: var(--warm-gray);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
#login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#login-page.page.active {
    display: flex;
}

.login-container {
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-card {
    padding: 1rem;
}

.login-card .card-divider {
    margin: 0.5rem 0;
}

.login-card .logo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    overflow: hidden;
}

.login-card .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--deep-charcoal);
    margin-bottom: 0.25rem;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--warm-gray);
}

.login-footer {
    display: none;
    margin-top: 0;
    text-align: center;
}

.clerk-login-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

#clerk-sign-in {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 320px;
}

.auth-loading,
.auth-error {
    width: min(100%, 360px);
    min-height: 320px;
    border: 1px solid rgba(216, 167, 177, 0.28);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--warm-gray);
    text-align: center;
    box-shadow: 0 12px 34px rgba(74, 69, 67, 0.08);
}

.auth-loading-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(216, 167, 177, 0.25);
    border-top-color: var(--dusty-rose-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-error {
    gap: 0.5rem;
    color: var(--deep-charcoal);
}

.auth-error span {
    color: var(--warm-gray);
    font-size: 0.9rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: var(--warm-gray);
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(216, 167, 177, 0.35);
}

.design-philosophy {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--warm-gray);
}

/* ============================================
   MOBILE-FIRST BOTTOM NAVIGATION
   ============================================ */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; /* Space for bottom nav */
}

.glass-sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    left: 0;
    bottom: 0;
    top: auto;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    border-right: none;
    display: flex;
    flex-direction: row;
    padding: 0.5rem 0.25rem;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(74, 69, 67, 0.1);
}

.sidebar-header {
    display: none;
}

.logo-small {
    display: none;
}

.logo-small img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-brand {
    display: none;
}

.sidebar-user {
    display: none;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--blush-tint);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    font-size: 1.5rem;
    color: var(--dusty-rose);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--charcoal);
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--warm-gray);
    text-transform: capitalize;
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    margin: 0;
    flex: 1;
    min-width: 60px;
    max-width: 80px;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--warm-gray);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: transparent;
    color: var(--dusty-rose-dark);
}

.nav-link.active {
    background: transparent;
    color: var(--dusty-rose-dark);
    box-shadow: none;
}

.nav-link.active i {
    background: linear-gradient(135deg, var(--dusty-rose), var(--dusty-rose-dark));
    color: var(--white);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(216, 167, 177, 0.3);
}

.nav-link i {
    width: auto;
    text-align: center;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link span {
    font-size: 0.65rem;
    text-align: center;
    line-height: 1.2;
}

.sidebar-footer {
    display: none;
}

/* ============================================
   MOBILE HEADER
   ============================================ */
.mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    margin: 0.5rem;
    margin-bottom: 0;
    border-radius: var(--radius-lg);
}

.mobile-header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-header-logo img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.mobile-header-logo span {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deep-charcoal);
}

.branch-switcher {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    max-width: 220px;
    padding: 0.35rem 0.45rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(216, 167, 177, 0.35);
    border-radius: var(--radius-md);
}

.branch-switcher i {
    color: var(--dusty-rose);
    font-size: 0.85rem;
    flex: 0 0 auto;
}

.branch-select {
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--charcoal);
    font-family: var(--font-sans);
    font-size: 0.82rem !important;
    font-weight: 600;
    outline: none;
}

.mobile-header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-header-user span {
    font-size: 0.8rem;
    color: var(--warm-gray);
    text-transform: capitalize;
}

#mobile-logout-btn {
    padding: 0.5rem;
    min-height: auto;
}

.clerk-user-button {
    min-width: 32px;
    min-height: 32px;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
#main-content {
    flex: 1;
    margin-left: 0;
    padding: 1rem;
    padding-top: 0.5rem;
    min-height: 100vh;
    width: 100%;
}

.page-content {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.page-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--warm-gray);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--warm-gray);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-lg);
    background: var(--white);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(216, 167, 177, 0.15);
}

/* ============================================
   DASHBOARD
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
}

.stat-icon {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
}

.stat-icon i {
    font-size: 1.1rem;
    color: var(--white);
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--deep-charcoal);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--warm-gray);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.alert-card {
    max-height: 350px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.alert-card.full-width {
    grid-column: 1 / -1;
}

.alert-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.alert-item-name {
    font-weight: 500;
    color: var(--charcoal);
}

.alert-item-info {
    font-size: 0.85rem;
    color: var(--warm-gray);
}

.alert-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-danger {
    background: rgba(216, 138, 138, 0.2);
    color: var(--danger);
}

.badge-warning {
    background: rgba(232, 199, 123, 0.2);
    color: #c9a54d;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--warm-gray);
    font-style: italic;
}

/* Date Range Selector */
.date-range-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.date-range-btn {
    padding: 0.5rem 1rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--charcoal);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.date-range-btn:hover {
    border-color: var(--dusty-rose);
    background: rgba(216, 167, 177, 0.05);
}

.date-range-btn.active {
    background: var(--dusty-rose);
    color: white;
    border-color: var(--dusty-rose);
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(216, 167, 177, 0.05);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.custom-date-range.hidden {
    display: none;
}

.custom-date-range .date-input {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--charcoal);
    background: var(--white);
}

.custom-date-range .date-input:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(216, 167, 177, 0.15);
}

.custom-date-range span {
    color: var(--warm-gray);
    font-size: 0.875rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.sales-source-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.source-bar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.source-label {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--charcoal);
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.source-bar-container {
    flex: 1;
    height: 30px;
    background: rgba(200, 200, 200, 0.15);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.source-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--dusty-rose), var(--dusty-rose-dark));
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
}

.source-amount {
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    min-width: 80px;
    text-align: right;
}

/* ============================================
   BRANCH MANAGEMENT
   ============================================ */
.branches-list {
    display: grid;
    gap: 0.75rem;
}

.branch-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(216, 167, 177, 0.25);
    border-radius: var(--radius-md);
}

.branch-card-main {
    min-width: 0;
}

.branch-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-weight: 700;
    color: var(--deep-charcoal);
}

.branch-card-title i {
    color: var(--dusty-rose);
}

.branch-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    color: var(--warm-gray);
    font-size: 0.85rem;
}

.branch-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 520px) {
    .branch-card {
        grid-template-columns: 1fr;
    }

    .branch-card-actions {
        justify-content: stretch;
    }

    .branch-card-actions .btn {
        width: 100%;
    }
}

/* ============================================
   WASTAGE PIE CHART
   ============================================ */
.wastage-chart-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 1rem 0;
}

.pie-chart-wrapper {
    flex: 0 0 auto;
    width: 200px;
    height: 200px;
    position: relative;
}

.pie-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.pie-chart-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
}

.legend-item:hover {
    background-color: var(--blush-tint);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--charcoal);
    font-weight: 500;
}

.legend-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dusty-rose);
}

.wastage-date-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--champagne);
    background: white;
    color: var(--charcoal);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.wastage-date-btn:hover {
    background: var(--blush-tint);
    border-color: var(--dusty-rose);
}

.wastage-date-btn.active {
    background: var(--dusty-rose);
    color: white;
    border-color: var(--dusty-rose);
}

/* Mobile responsive pie chart */
@media (max-width: 600px) {
    .wastage-chart-container {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .pie-chart-wrapper {
        width: 180px;
        height: 180px;
    }
    
    .pie-chart-legend {
        width: 100%;
        max-height: 200px;
    }
    
    .legend-item {
        padding: 0.5rem;
    }
    
    .wastage-date-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   PRODUCTS GRID
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.product-card {
    position: relative;
    transition: all var(--transition-normal);
    padding: 1rem;
}

.product-card:hover {
    transform: none;
    box-shadow: var(--shadow-medium);
}

.product-card-content {
    cursor: pointer;
    display: flex;
    gap: 1rem;
}

.product-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
    opacity: 1;
}

.product-card:hover .product-actions {
    opacity: 1;
}

.product-image {
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--blush-tint), var(--soft-beige));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.product-image i {
    font-size: 2rem;
    color: var(--dusty-rose);
    opacity: 0.6;
}

.product-card-details {
    flex: 1;
    min-width: 0;
}

.product-info {
    margin-bottom: 0.5rem;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-category {
    font-size: 0.75rem;
    color: var(--eucalyptus-dark);
    text-transform: capitalize;
    margin-bottom: 0.25rem;
}

.product-price {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dusty-rose-dark);
}

.product-items-summary {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
    max-height: 100px;
    overflow-y: auto;
}

.item-requirement {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.35rem;
    border-radius: 6px;
    font-size: 0.8rem;
}

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

.item-requirement.sufficient {
    background: rgba(124, 184, 153, 0.15);
    border-left: 3px solid var(--success);
}

.item-requirement.insufficient {
    background: rgba(216, 138, 138, 0.15);
    border-left: 3px solid var(--danger);
}

.item-requirement .item-name {
    color: var(--charcoal);
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 0.75rem;
}

.item-requirement .item-stock-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.15rem;
}

.item-requirement .stock-available {
    font-weight: 600;
    font-size: 0.75rem;
}

.item-requirement .stock-needed {
    font-size: 0.7rem;
    color: var(--warm-gray);
}

.item-requirement.sufficient .stock-available {
    color: var(--success);
}

.item-requirement.insufficient .stock-available {
    color: var(--danger);
}

.product-status {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(124, 184, 153, 0.15);
    color: var(--success);
}

.product-status.needs-more {
    background: rgba(216, 138, 138, 0.2);
    color: var(--danger);
    font-weight: 600;
}

.product-status.needs-more i {
    font-size: 0.9rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-available {
    background: var(--success);
}

.status-unavailable {
    background: var(--danger);
}

.product-status span {
    font-size: 0.85rem;
    color: var(--warm-gray);
}

/* ============================================
   DATA TABLES - Mobile Optimized
   ============================================ */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(216, 167, 177, 0.15);
}

.data-table th {
    font-family: var(--font-serif);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dusty-rose-dark);
    background: var(--blush-tint);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(248, 232, 233, 0.5);
}

.data-table .item-image {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--blush-tint);
}

.data-table .item-image-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--blush-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dusty-rose);
}

/* Mobile-friendly item cards */
.items-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-mobile-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
}

.item-mobile-image {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: var(--radius-sm);
    background: var(--blush-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.item-mobile-image i {
    font-size: 1.25rem;
    color: var(--dusty-rose);
}

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

.item-mobile-name {
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

.item-mobile-details {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--warm-gray);
}

.item-badges-stack {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
    align-items: center;
}

.item-alternative-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(143, 184, 201, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    color: var(--info);
    font-weight: 500;
}

.item-alternative-badge i {
    font-size: 0.6rem;
    flex-shrink: 0;
}

.item-alternative-badge span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Item Alternatives Container */
.alternatives-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.alternative-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.alternative-row select {
    flex: 1;
    min-width: 120px;
}

.ratio-input-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.item-alternative-ratio {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: center;
}

.ratio-label {
    font-size: 0.75rem;
    color: var(--warm-gray);
    font-weight: 500;
}

.btn-remove-alt {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-remove-alt:hover {
    opacity: 1;
}

/* Mobile optimization for item cards */
@media (max-width: 480px) {
    .item-mobile-card {
        flex-wrap: wrap;
    }
    
    .item-mobile-info {
        flex: 1 1 calc(100% - 70px);
    }
    
    .item-mobile-actions {
        flex: 0 0 auto;
        margin-left: auto;
    }
    
    .item-badges-stack {
        gap: 0.25rem;
    }
    
    .item-alternative-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

.item-mobile-actions {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.status-in-stock {
    background: rgba(124, 184, 153, 0.15);
    color: var(--success);
}

.status-low-stock {
    background: rgba(232, 199, 123, 0.15);
    color: #c9a54d;
}

.status-out-of-stock {
    background: rgba(216, 138, 138, 0.15);
    color: var(--danger);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-btn-edit {
    background: rgba(143, 184, 201, 0.15);
    color: var(--info);
}

.action-btn-delete {
    background: rgba(216, 138, 138, 0.15);
    color: var(--danger);
}

.action-btn-quantity {
    background: rgba(181, 199, 178, 0.15);
    color: var(--eucalyptus-dark);
}

.action-btn:hover {
    transform: scale(1.1);
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */
.checkout-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.8rem;
}

.checkout-status.pending {
    background: rgba(232, 199, 123, 0.2);
    color: #c9a54d;
}

.checkout-status.completed {
    background: rgba(124, 184, 153, 0.2);
    color: var(--success);
}

.date-badge {
    padding: 0.3rem 0.6rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--dusty-rose-dark);
    font-weight: 500;
}

.checkout-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--blush-tint);
    border-radius: var(--radius-md);
    border: 1px solid rgba(216, 167, 177, 0.2);
}

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

.checkout-item-name {
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.15rem;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.checkout-item-current {
    font-size: 0.75rem;
    color: var(--warm-gray);
}

.checkout-item input {
    width: 70px;
    padding: 0.5rem;
    text-align: center;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
}

/* Wastage Section */
.wastage-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wastage-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wastage-section h4 i {
    color: var(--accent-red);
}

#wastage-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wastage-row {
    padding: 0.75rem;
    background: var(--blush-tint);
    border-radius: var(--radius-md);
    border: 1px solid rgba(216, 167, 177, 0.2);
}

.wastage-row-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wastage-item-select-wrapper {
    flex: 1;
    min-width: 0;
}

.wastage-item-search {
    width: 100%;
    padding: 0.5rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--charcoal);
    font-size: 0.9rem;
}

.wastage-item-search:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(216, 167, 177, 0.1);
}

.wastage-item-display {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(181, 199, 178, 0.1);
    border: 1px solid rgba(181, 199, 178, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--charcoal);
    display: none;
}

.wastage-item-display.active {
    display: block;
}

.wastage-quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wastage-quantity-input {
    flex: 1;
    max-width: 120px;
    padding: 0.5rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--charcoal);
    font-size: 0.9rem;
    text-align: center;
}

.wastage-quantity-input::placeholder {
    color: var(--warm-gray);
    opacity: 0.7;
}

.wastage-quantity-input:focus::placeholder {
    opacity: 0;
    color: transparent;
}

.wastage-quantity-input:focus {
    outline: none;
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(216, 167, 177, 0.1);
}

.wastage-quantity-input:disabled {
    background: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

.wastage-unit {
    min-width: 50px;
    color: var(--warm-gray);
    font-size: 0.85rem;
}

.wastage-remove-btn {
    padding: 0.5rem;
    min-width: auto;
}

/* Mobile Responsive for Wastage */
@media (max-width: 768px) {
    .wastage-row-content {
        gap: 0.5rem;
    }
    
    .wastage-quantity-wrapper {
        flex-wrap: wrap;
    }
    
    .wastage-quantity-input {
        max-width: 100%;
        flex: 1;
    }
    
    .wastage-remove-btn {
        width: 100%;
        margin-top: 0.25rem;
    }
    
    .wastage-section h4 {
        font-size: 1rem;
    }
}

/* Calendar View */
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.month-year-label {
    font-weight: 600;
    color: var(--charcoal);
    min-width: 150px;
    text-align: center;
}

.checkout-calendar {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    max-width: 100%;
    overflow: hidden;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--dusty-rose-dark);
    padding: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.calendar-day.empty {
    cursor: default;
    opacity: 0;
}

.calendar-day.future {
    background: rgba(200, 200, 200, 0.1);
    cursor: default;
    opacity: 0.4;
}

.calendar-day.pending {
    background: rgba(232, 199, 123, 0.15);
    border-color: rgba(232, 199, 123, 0.3);
}

.calendar-day.pending:hover {
    background: rgba(232, 199, 123, 0.25);
    border-color: rgba(232, 199, 123, 0.5);
    transform: scale(1.05);
}

.calendar-day.completed {
    background: rgba(124, 184, 153, 0.15);
    border-color: rgba(124, 184, 153, 0.3);
}

.calendar-day.completed:hover {
    background: rgba(124, 184, 153, 0.25);
    border-color: rgba(124, 184, 153, 0.5);
    transform: scale(1.05);
}

.calendar-day.today {
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 2px rgba(216, 167, 177, 0.2);
}

.day-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

.day-status {
    font-size: 1rem;
}

.calendar-day.pending .day-status {
    color: #c9a54d;
}

.calendar-day.completed .day-status {
    color: var(--success);
}

/* Checkout Details Modal */
.checkout-details-header {
    margin-bottom: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-badge.completed {
    background: rgba(124, 184, 153, 0.2);
    color: var(--success);
}

.status-badge.pending {
    background: rgba(232, 199, 123, 0.2);
    color: #c9a54d;
}

.checkout-logs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.checkout-log-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
}

.log-item-name {
    font-weight: 600;
    color: var(--charcoal);
}

.log-item-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.log-previous {
    color: var(--warm-gray);
}

.log-new {
    font-weight: 600;
    color: var(--charcoal);
}

.log-change {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.log-change.positive {
    color: var(--success);
    background: rgba(124, 184, 153, 0.1);
}

.log-change.negative {
    color: var(--danger);
    background: rgba(216, 138, 138, 0.1);
}

.log-change.neutral {
    color: var(--warm-gray);
}

.checkout-notes {
    padding: 1rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
    color: var(--charcoal);
    line-height: 1.6;
}

/* Mobile Searchable Select */
@media (max-width: 768px) {
    .searchable-dropdown {
        max-height: 250px;
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 0.875rem;
    }
    
    .dropdown-item-name {
        font-size: 0.95rem;
    }
    
    .dropdown-item-price {
        font-size: 0.8rem;
    }
}

/* Mobile Calendar */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 0.15rem;
        margin-top: 0.5rem;
    }
    
    .calendar-day {
        padding: 0.15rem;
        min-width: 0;
    }
    
    .day-number {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }
    
    .day-status {
        font-size: 0.65rem;
    }
    
    .calendar-day-header {
        padding: 0.25rem;
        font-size: 0.65rem;
    }
    
    .checkout-calendar {
        padding: 0;
        margin: 0;
    }
    
    .glass-card {
        padding: 0.75rem;
        margin: 0 -0.5rem;
        border-radius: var(--radius-sm);
    }
    
    #checkout-calendar-view .glass-card {
        padding: 0.5rem;
    }
    
    .month-year-label {
        font-size: 0.9rem;
        min-width: 120px;
    }
}

/* ============================================
   RECEIPTS
   ============================================ */
.receipts-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 120px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--warm-gray);
}

.filter-group input {
    flex: 1;
    padding: 0.5rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    min-width: 0;
}

/* Tabs */
.tabs-container {
    margin-bottom: 1rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--warm-gray);
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    background: rgba(216, 167, 177, 0.1);
}

.tab-btn.active {
    background: var(--dusty-rose);
    color: white;
    box-shadow: 0 2px 8px rgba(216, 167, 177, 0.3);
}

.tab-content {
    display: none;
}

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

.tab-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.receipts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.receipt-card {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    padding: 0.75rem;
}

.receipt-image {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: var(--radius-md);
    background: var(--blush-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.receipt-image i {
    font-size: 1.5rem;
    color: var(--dusty-rose);
    opacity: 0.5;
}

.receipt-details {
    flex: 1;
    min-width: 0;
}

.receipt-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.receipt-product {
    font-weight: 600;
    color: var(--charcoal);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receipt-amount {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dusty-rose-dark);
    white-space: nowrap;
}

.receipt-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--warm-gray);
}

/* Grouped Order Styles */
.receipt-card.grouped-order {
    border-left: 3px solid var(--dusty-rose);
    background: linear-gradient(135deg, rgba(216, 167, 177, 0.08) 0%, rgba(255, 255, 255, 0.95) 100%);
    overflow: visible;
}

.receipt-image.grouped-icon {
    overflow: visible !important;
}

.receipt-image.grouped-icon i {
    color: var(--dusty-rose);
    opacity: 0.7;
}

.receipt-image.grouped-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--dusty-rose);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.grouped-products-list {
    display: block;
    font-size: 0.75rem;
    color: var(--warm-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 42, 40, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
}

/* Nested overlay for popups on top of modals */
.nested-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 42, 40, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.bottom-slide {
    align-items: flex-end;
    padding: 0;
    overflow-y: hidden;
}

.modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUpMobile 0.3s ease;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding-bottom: 100px; /* Space for bottom nav */
    margin: auto;
}

.modal.popup {
    border-radius: var(--radius-lg);
    padding-bottom: 1.5rem;
    animation: popupFadeIn 0.3s ease;
    max-width: 90%;
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    margin: 1rem auto;
    position: relative;
    box-sizing: border-box;
}

.modal-overlay.bottom-slide .modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

@keyframes slideUpMobile {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-lg {
    max-width: 100%;
}

.modal-sm {
    max-width: 100%;
}

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

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

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--blush-tint);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--charcoal);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--dusty-rose);
    color: var(--white);
}

/* Product Items in Modal */
.product-items-list {
    margin-bottom: 1rem;
}

.product-item-row-wrapper {
    margin-bottom: 1rem;
}

.product-item-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(216, 167, 177, 0.2);
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.product-item-row select {
    flex: 1;
    min-width: 0;
    padding: 0.5rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-item-row input {
    width: 60px;
    min-width: 60px;
    flex-shrink: 0;
    padding: 0.5rem;
    text-align: center;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    box-sizing: border-box;
}

.product-item-row .btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
    border: none;
    background: rgba(216, 138, 138, 0.15);
    color: var(--danger);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.product-item-row .btn-icon:hover {
    background: rgba(216, 138, 138, 0.25);
}

.product-item-row .btn-alt {
    background: rgba(181, 199, 178, 0.15);
    color: var(--eucalyptus-dark);
}

.product-item-row .btn-alternatives {
    background: rgba(181, 199, 178, 0.15);
    color: var(--eucalyptus-dark);
}

/* Alternatives container in product edit form */
.product-alternatives-container {
    margin-left: 1rem;
    margin-top: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(181, 199, 178, 0.3);
}

.product-alternatives-container .alternative-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: rgba(181, 199, 178, 0.1);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border: 1px solid rgba(181, 199, 178, 0.2);
}

.alternative-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.alternative-item-info i {
    color: var(--eucalyptus-dark);
    font-size: 0.85rem;
}

.alternative-item-name {
    font-weight: 500;
    color: var(--charcoal);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alternative-item-qty {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-small {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 0.7rem;
    padding: 0;
}

/* Mobile adjustments for product item row */
@media (max-width: 480px) {
    .product-item-row {
        gap: 0.4rem;
        padding: 0.6rem;
    }
    
    .product-item-row input {
        width: 50px;
        min-width: 50px;
        padding: 0.4rem;
        font-size: 0.85rem;
    }
    
    .product-item-row .btn-icon {
        width: 28px;
        height: 28px;
        min-width: 28px;
        font-size: 0.75rem;
    }
    
    .product-item-row select {
        font-size: 0.85rem;
        padding: 0.4rem;
    }
    
    .product-alternatives-container {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }
    
    .alternative-item-info {
        font-size: 0.85rem;
    }
    
    .alternative-item-qty {
        font-size: 0.8rem;
    }
    
    .btn-small {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }
}

/* Alternatives List */
.alternatives-list {
    max-height: 200px;
    overflow-y: auto;
}

.alternative-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.alternative-info {
    display: flex;
    flex-direction: column;
}

.alternative-name {
    font-weight: 500;
}

.alternative-qty {
    font-size: 0.85rem;
    color: var(--warm-gray);
}

/* Alternatives button in product form */
.btn-alternatives {
    background: rgba(181, 199, 178, 0.2);
    color: var(--eucalyptus-dark);
}

.btn-alternatives:hover {
    background: rgba(181, 199, 178, 0.4);
}

/* Alternatives section in product details */
.alternatives-section {
    margin-left: 0.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--eucalyptus);
}

.alternatives-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--eucalyptus-dark);
    font-size: 0.85rem;
    font-weight: 600;
}

.alternatives-header i {
    font-size: 0.9rem;
}

.alternative-item-row {
    background: rgba(181, 199, 178, 0.1);
    margin-bottom: 0.5rem;
    position: relative;
}

.alternative-item-row.sufficient {
    background: rgba(124, 184, 153, 0.15);
    border-left: 3px solid var(--success);
}

.alternative-item-row.best-alternative {
    background: linear-gradient(135deg, rgba(124, 184, 153, 0.25), rgba(181, 199, 178, 0.2));
    border-left: 4px solid var(--success);
    box-shadow: 0 2px 8px rgba(124, 184, 153, 0.3);
    animation: pulse-best 2s ease-in-out infinite;
}

@keyframes pulse-best {
    0%, 100% { box-shadow: 0 2px 8px rgba(124, 184, 153, 0.3); }
    50% { box-shadow: 0 2px 16px rgba(124, 184, 153, 0.5); }
}

.best-alt-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    background: linear-gradient(135deg, var(--success), var(--eucalyptus));
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.best-alt-badge i {
    font-size: 0.55rem;
}

/* Product Details Modal */
#product-details-content {
    padding: 0.5rem 0;
}

.needs-more-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(216, 138, 138, 0.2), rgba(216, 138, 138, 0.1));
    border: 1px solid rgba(216, 138, 138, 0.4);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.needs-more-banner i {
    font-size: 1.5rem;
    color: var(--danger);
}

.needs-more-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.needs-more-content strong {
    color: var(--danger);
    font-size: 1rem;
}

.needs-more-content span {
    color: var(--charcoal);
    font-size: 0.85rem;
}

.required-item.insufficient {
    background: rgba(216, 138, 138, 0.15);
    border-left: 3px solid var(--danger);
}

.required-item.sufficient {
    background: rgba(124, 184, 153, 0.15);
    border-left: 3px solid var(--success);
}

.product-details-header {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.product-details-image {
    width: 280px;
    height: 280px;
    border-radius: var(--radius-lg);
    background: var(--blush-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-medium);
}

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

.product-details-image i {
    font-size: 5rem;
    color: var(--dusty-rose);
    opacity: 0.4;
}

.product-details-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.product-details-info .category {
    color: var(--eucalyptus-dark);
    margin-bottom: 1rem;
    text-transform: capitalize;
}

.product-details-info .price {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--dusty-rose-dark);
    margin-bottom: 1rem;
}

.product-details-info .description {
    color: var(--warm-gray);
    line-height: 1.6;
}

.items-required-list {
    margin-top: 1rem;
}

.items-required-list h4 {
    margin-bottom: 1rem;
    color: var(--charcoal);
}

.required-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--blush-tint);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.required-item-info {
    display: flex;
    flex-direction: column;
}

.required-item-name {
    font-weight: 500;
    color: var(--charcoal);
}

.required-item-qty {
    font-size: 0.8rem;
    color: white;
    background: var(--dusty-rose);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-block;
    margin-top: 0.25rem;
}

.required-item-qty.qty-sufficient {
    background: var(--success);
}

.required-item-stock {
    text-align: right;
}

.required-item-available {
    font-weight: 600;
}

.stock-ok {
    color: var(--success);
}

.stock-low {
    color: var(--danger);
}

.stock-out {
    color: var(--danger);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-medium);
    border-left: 4px solid var(--success);
}

.toast.error .toast-content {
    border-left-color: var(--danger);
}

.toast-icon {
    font-size: 1.25rem;
    color: var(--success);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast-message {
    font-weight: 500;
    color: var(--charcoal);
}

/* ============================================
   MOBILE TOUCH-FRIENDLY ENHANCEMENTS
   ============================================ */
.btn {
    min-height: 44px;
    touch-action: manipulation;
}

.action-btn {
    min-width: 40px;
    min-height: 40px;
}

input, select, textarea {
    font-size: 16px !important; /* Prevent zoom on iOS */
}

/* Form rows stack on mobile */
.form-row {
    grid-template-columns: 1fr;
}

/* Product details modal */
.product-details-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.product-details-image {
    width: 100%;
    max-width: 320px;
    height: 320px;
}

.product-details-info .price {
    font-size: 1.5rem;
}

/* Login card adjustments */
@media (max-width: 480px) {
    .login-card {
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin-top: auto;
    }

    #login-page {
        align-items: flex-end;
        padding: 0;
    }

    .login-container {
        width: 100%;
        max-width: 100%;
    }
}

/* Admin Only Elements */
.admin-only {
    display: none;
}

body.role-admin .admin-only {
    display: inline-flex;
}

/* Florist restrictions */
body.role-florist [data-role="admin"] {
    display: none;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--blush-tint);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--dusty-rose);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dusty-rose-dark);
}

/* Active page indicator */
.page.active {
    display: block;
}



/* ============================================
   PROCESSING LOADER OVERLAY
   ============================================ */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.processing-content {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-medium);
    padding: 2.5rem 3rem;
    text-align: center;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.processing-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.processing-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(216, 167, 177, 0.2);
    border-radius: 50%;
}

.processing-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--dusty-rose);
    border-right-color: var(--dusty-rose);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-text {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--deep-charcoal);
    margin-bottom: 0.5rem;
}

.processing-subtext {
    font-size: 0.9rem;
    color: var(--warm-gray);
}


/* ============================================
   EXPENSES SECTION
   ============================================ */
.expense-total-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(216, 138, 138, 0.15), rgba(216, 138, 138, 0.25));
    border: 2px solid var(--danger);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(216, 138, 138, 0.3);
}

.expense-total-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--charcoal);
}

.expense-total-amount {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--danger);
}

.expenses-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.expense-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    padding: 1.25rem;
    transition: all var(--transition-normal);
    position: relative;
}

.expense-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.expense-card.inactive {
    opacity: 0.6;
    background: rgba(200, 200, 200, 0.1);
}

.expense-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.expense-card-info {
    flex: 1;
}

.expense-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deep-charcoal);
    margin-bottom: 0.25rem;
}

.expense-card-amount {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dusty-rose-dark);
}

.expense-card-amount.inactive {
    color: var(--warm-gray);
    text-decoration: line-through;
}

.expense-card-actions {
    display: flex;
    gap: 0.5rem;
}

.expense-card-description {
    color: var(--warm-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.expense-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(216, 167, 177, 0.2);
    font-size: 0.8rem;
    color: var(--warm-gray);
}

.expense-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.expense-status-badge.active {
    background: rgba(124, 184, 153, 0.15);
    color: var(--success);
}

.expense-status-badge.inactive {
    background: rgba(154, 143, 138, 0.15);
    color: var(--warm-gray);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
    color: var(--charcoal);
}

/* Skip Inventory Checkbox */
.checkbox-group {
    background: rgba(232, 199, 123, 0.15);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

.checkbox-group .checkbox-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group .checkbox-text i {
    color: var(--warning);
}

.checkbox-group .form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--warm-gray);
    margin-left: 26px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .expense-total-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .expense-card-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .expense-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (min-width: 768px) {
    .expenses-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .expenses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ============================================
   PROFIT & LOSS SECTION (Mobile-First)
   ============================================ */
.pnl-section {
    margin-top: 1.5rem;
}

/* Date Selector - Mobile First */
.pnl-date-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.pnl-period-btn {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border: 2px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--charcoal);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.pnl-period-btn i {
    font-size: 1.1rem;
    color: var(--dusty-rose);
}

.pnl-period-btn.active {
    background: linear-gradient(135deg, var(--dusty-rose), var(--dusty-rose-dark));
    color: white;
    border-color: var(--dusty-rose);
    box-shadow: 0 4px 12px rgba(216, 167, 177, 0.4);
}

.pnl-period-btn.active i {
    color: white;
}

.pnl-custom-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(216, 167, 177, 0.05);
    border-radius: var(--radius-md);
}

.pnl-custom-dates.hidden {
    display: none;
}

.pnl-date-input {
    flex: 1;
    min-width: 120px;
    padding: 0.6rem;
    border: 1.5px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.pnl-custom-dates span {
    color: var(--warm-gray);
    font-size: 0.85rem;
}

/* Main P&L Card */
.pnl-main-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 232, 233, 0.6));
    border: 2px solid rgba(216, 167, 177, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(216, 167, 177, 0.15);
}

.pnl-main-card.profit {
    background: linear-gradient(135deg, rgba(124, 184, 153, 0.15), rgba(181, 199, 178, 0.1));
    border-color: var(--success);
}

.pnl-main-card.loss {
    background: linear-gradient(135deg, rgba(216, 138, 138, 0.15), rgba(216, 138, 138, 0.1));
    border-color: var(--danger);
}

.pnl-main-value {
    margin-bottom: 0.75rem;
}

.pnl-amount {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--deep-charcoal);
    line-height: 1.2;
}

.pnl-amount.profit {
    color: var(--success);
}

.pnl-amount.loss {
    color: var(--danger);
}

.pnl-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--warm-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.pnl-change-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(154, 143, 138, 0.1);
    color: var(--warm-gray);
}

.pnl-change-badge.positive {
    background: rgba(124, 184, 153, 0.15);
    color: var(--success);
}

.pnl-change-badge.negative {
    background: rgba(216, 138, 138, 0.15);
    color: var(--danger);
}

.pnl-change-badge i {
    font-size: 0.85rem;
}

/* Breakdown Cards */
.pnl-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.pnl-breakdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1.5px solid rgba(216, 167, 177, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.pnl-breakdown-item:active {
    transform: scale(0.98);
}

.pnl-breakdown-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
}

.pnl-breakdown-item.positive .pnl-breakdown-icon {
    background: linear-gradient(135deg, rgba(124, 184, 153, 0.2), rgba(124, 184, 153, 0.3));
    color: var(--success);
}

.pnl-breakdown-item.negative .pnl-breakdown-icon {
    background: linear-gradient(135deg, rgba(216, 138, 138, 0.2), rgba(216, 138, 138, 0.3));
    color: var(--danger);
}

.pnl-breakdown-info {
    flex: 1;
}

.pnl-breakdown-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--warm-gray);
    margin-bottom: 0.25rem;
}

.pnl-breakdown-value {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--deep-charcoal);
}

/* Comparison Section */
.pnl-comparison-section {
    margin-bottom: 1.5rem;
}

.pnl-comparison-section h4 {
    font-size: 1rem;
    color: var(--deep-charcoal);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pnl-comparison-section h4 i {
    color: var(--dusty-rose);
}

.pnl-comparison-labels {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.comparison-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.comparison-label::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.comparison-label.current::before {
    background: linear-gradient(135deg, var(--dusty-rose), var(--dusty-rose-dark));
}

.comparison-label.previous::before {
    background: rgba(154, 143, 138, 0.4);
}

.pnl-comparison-chart {
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pnl-comparison-chart canvas {
    max-width: 100%;
    height: auto !important;
}

/* Monthly Trend */
.pnl-monthly-trend {
    margin-top: 1.5rem;
}

.pnl-monthly-trend h4 {
    font-size: 1rem;
    color: var(--deep-charcoal);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pnl-monthly-trend h4 i {
    color: var(--dusty-rose);
}

.pnl-monthly-chart {
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.pnl-monthly-chart canvas {
    max-width: 100%;
    height: auto !important;
}

/* Tablet and Desktop */
@media (min-width: 768px) {
    .pnl-date-selector {
        justify-content: flex-start;
    }
    
    .pnl-period-btn {
        flex: 0 0 auto;
        min-width: 140px;
    }
    
    .pnl-breakdown {
        flex-direction: row;
    }
    
    .pnl-breakdown-item {
        flex: 1;
        flex-direction: column;
        text-align: center;
    }
    
    .pnl-breakdown-icon {
        width: 55px;
        height: 55px;
        font-size: 1.5rem;
    }
    
    .pnl-amount {
        font-size: 2.75rem;
    }
}
