:root {
    --primary-color: #1b4d3e;
    --primary-light: #2d5a27;
    --accent-color: #c4a484;
    --bg-color: #f1f3f2;
    --card-bg: rgba(255, 255, 255, 0.85);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #141b18;
    --text-muted: #5e6d66;
    --sidebar-bg: #0d1a15;
    --danger: #ff4d4d;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --border-radius: 20px;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Global Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(27, 77, 62, 0.4);
    border-radius: 10px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(27, 77, 62, 0.5);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(27, 77, 62, 0.3) transparent;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(rgba(13, 26, 21, 0.7), rgba(13, 26, 21, 0.7)),
        url('https://images.unsplash.com/photo-1501339847302-ac426a4a7cbb?auto=format&fit=crop&q=80&w=2000');
    background-size: cover;
    background-position: center;
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Loader */
.loader-wrapper {
    position: fixed;
    inset: 0;
    background: var(--sidebar-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-bottom-color: var(--accent-color);
    border-radius: 50%;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
.btn-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: rotation 0.8s linear infinite;
    z-index: 2;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 240px 1fr 400px;
    height: 100vh;
    backdrop-filter: blur(10px);
}

/* Sidebar */
.sidebar {
    background: rgba(13, 26, 21, 0.95);
    color: white;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    height: 100vh;
    overflow: hidden;
}

/* Scrollable nav inside sidebar */
.sidebar nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(196, 164, 132, 0.4) transparent;
}

.sidebar nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar nav::-webkit-scrollbar-thumb {
    background: rgba(196, 164, 132, 0.4);
    border-radius: 4px;
}

.sidebar nav::-webkit-scrollbar-thumb:hover {
    background: rgba(196, 164, 132, 0.7);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
}

.logo i {
    color: var(--accent-color);
}

nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sidebar logo stays fixed at top */
.sidebar .logo {
    flex-shrink: 0;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #a0a0a0;
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    text-align: left;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-btn.active {
    background: var(--primary-light);
}

.sidebar-footer {
    flex-shrink: 0;
    padding-top: 1rem;
    font-size: 0.85rem;
    color: #a0a0a0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.5rem;
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.top-header {
    margin-bottom: 1rem;
}

.promo-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--border-radius);
    padding: 3rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
    min-height: 280px;
}

.promo-content {
    max-width: 60%;
    z-index: 2;
}

.promo-content h1 {
    font-size: 3rem;
    font-family: 'Playfair Display', serif;
    margin: 0.5rem 0 1.5rem 0;
    line-height: 1.1;
}

.promo-content h1 span {
    color: var(--accent-color);
}

.promo-content p {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.secondary-btn {
    background: var(--accent-color);
    color: var(--sidebar-bg);
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.promo-img {
    width: 320px;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    transform: rotate(3deg);
    box-shadow: 25px 25px 50px rgba(0, 0, 0, 0.4);
    z-index: 2;
    transition: var(--transition);
}

.promo-img:hover {
    transform: rotate(0deg) scale(1.05);
}

.promo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-tabs {
    margin-bottom: 1.5rem;
}

.search-bar {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border-radius: 12px;
    border: 1px solid #ddd;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(45, 90, 39, 0.1);
}

.category-filters {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    /* Space for scrollbar if visible */
    white-space: nowrap;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 10px 24px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-muted);
}

.filter-btn:hover {
    background: #f0f0f0;
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px rgba(27, 77, 62, 0.2);
}

/* Menu Grid */
.tab-view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-view.active {
    display: block;
}

.view-header {
    margin-bottom: 1.5rem;
}

.view-header h2 {
    font-size: 1.8rem;
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
}

.view-header p {
    color: var(--text-muted);
}

/* History Styles */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.history-card:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.history-info h4 {
    margin-bottom: 4px;
}

.history-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-amount {
    text-align: right;
}

.history-amount .total {
    font-weight: 700;
    color: var(--primary-color);
    display: block;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 700;
}

/* Settings Styles */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.settings-card h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.empty-state {
    text-align: center;
    padding: 4rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: var(--border-radius);
    color: #ccc;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Menu Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.menu-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
}

.menu-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--glass-shadow);
    border-color: var(--primary-light);
}

.item-img {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f0f4f2;
    transition: var(--transition);
}

.menu-item:hover .item-img {
    transform: scale(1.1);
}

.item-details {
    padding: 1.25rem;
    position: relative;
    background: white;
}

.menu-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.menu-item .price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.add-btn {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.menu-item:hover .add-btn {
    transform: rotate(90deg);
    background: var(--primary-light);
}

/* Billing Panel */
.billing-panel {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Force full height to contain children */
    overflow: hidden;
    /* Prevent the panel itself from scrolling */
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.text-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-weight: 600;
}

.order-id {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    /* Enable vertical scrolling */
    margin-bottom: 1rem;
    /* Reduced margin */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    /* Critical for nested flex scrolling */
    padding-right: 5px;
    /* Prevent content jumping when scrollbar appears */
}

.empty-cart {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
    gap: 1rem;
}

.empty-cart i {
    font-size: 3rem;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.cart-item:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cart-item-info {
    flex: 1;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 2px;
}

.cart-item-info .price {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.1rem;
    color: var(--text-muted);
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.billing-summary {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.75rem;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-row.total {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 800;
    border-top: 2px dashed rgba(0, 0, 0, 0.1);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

.payment-modes {
    margin: 0.5rem 0;
}

.payment-modes label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

.mode-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mode-btn {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
}

.mode-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* UPI Section */
/* UPI Section */
.upi-section {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    /* controlled by JS */
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.upi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border-bottom: 1px dashed #e0e0e0;
    padding-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.secure-badge {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.qr-content-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qr-container {
    width: 100px;
    height: 100px;
    background: white;
    padding: 6px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    flex-shrink: 0;
}

.qr-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.upi-details {
    flex: 1;
}

.upi-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.upi-details strong {
    color: var(--text-main);
    font-size: 1.4rem;
    display: block;
    margin: 4px 0;
}

.upi-id {
    display: inline-block;
    font-size: 0.7rem;
    color: #555;
    font-family: monospace;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid #ddd;
    word-break: break-all;
    line-height: 1.4;
}

.upi-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    display: none;
}

.upi-apps-row {
    display: flex;
    gap: 12px;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    justify-content: center;
    flex-wrap: wrap;
}

.upi-apps-row img {
    height: 24px;
    object-fit: contain;
    opacity: 0.8;
    filter: grayscale(20%);
    transition: var(--transition);
}

.upi-apps-row img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

.primary-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    /* Increased to stay above billing panel on mobile */
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 90%;
}

.receipt-paper {
    background: #fff;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    color: #333;
    border: 1px solid #eee;
}

.receipt-header {
    text-align: center;
    margin-bottom: 1rem;
}

.receipt-table table {
    width: 100%;
    font-size: 0.9rem;
    margin: 1rem 0;
}

.receipt-table th {
    text-align: left;
}

.receipt-footer {
    text-align: right;
}

.footer-row {
    margin-bottom: 4px;
}

.grand-total {
    font-weight: bold;
    font-size: 1.1rem;
}

.thanks {
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

.btn-primary {
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
}

.btn-success {
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #2e7d32;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-success:hover {
    background: #1b5e20;
    transform: translateY(-2px);
}

.small {
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.report-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Payment Modal Styles */
.small-modal {
    max-width: 400px;
    padding: 2rem;
    text-align: center;
}

.payment-verify-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.verify-icon {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.verify-icon i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.payment-status {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #ffd700;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.confirm-btn {
    background: #2e7d32;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.confirm-btn:hover {
    background: #1b5e20;
    transform: translateY(-2px);
}

.menu-item {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 80px 1fr 340px;
    }

    .sidebar span {
        display: none;
    }

    .logo span {
        display: none;
    }
}

/* History View */
.history-view {
    display: none;
    padding: 1rem;
    overflow-y: auto;
    height: 100%;
}

.history-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.history-card {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.history-info h4 {
    font-size: 1rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.history-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-amount {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.history-amount .total {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.status-badge {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #c8e6c9;
}

.status-badge::before {
    content: '✓';
    font-weight: bold;
}

/* Print Styles */
@media print {

    /* Hide the main app container and other UI elements completely to free up space */
    .app-container,
    .mobile-top-bar,
    .mobile-bottom-nav,
    #loader,
    .toast-container {
        display: none !important;
    }

    body,
    html {
        background: white;
        height: auto;
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    /* Only show the active modal */
    .modal.active {
        display: block !important;
        position: relative !important;
        /* Changed from absolute to relative/static flow */
        width: 100%;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white;
        overflow: visible !important;
        visibility: visible;
    }

    .modal.active * {
        visibility: visible;
    }

    /* Reset modal content positioning */
    .modal.active .modal-content {
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        /* Adjust if content touches edges too much */
        margin: 0 !important;
        visibility: visible;
        transform: none !important;
    }

    /* Hide non-printable elements inside the modal */
    .modal-actions,
    .close-btn,
    .close-modal-btn,
    .expense-controls,
    .modal-footer {
        display: none !important;
    }
}

/* Toast Notifications */
/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 20000;
    /* Higher than modal (10000) */
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.toast-notification {
    position: relative;
    padding: 16px 28px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    max-width: 400px;
    pointer-events: auto;
    /* Enable interaction */
    flex-shrink: 0;
}

.toast-notification i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border-left: 5px solid #064e3b;
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-left: 5px solid #7f1d1d;
}

.toast-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-left: 5px solid #78350f;
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-left: 5px solid #1e3a8a;
}

/* Expense Form Styles */
.expense-controls {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.inline-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form .form-input,
.inline-form .form-select {
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
    color: var(--text-main);
    flex: 1;
}

#expense-title {
    flex: 2;
    min-width: 200px;
}

#expense-amount {
    flex: 1;
    min-width: 100px;
}

#expense-category {
    flex: 1;
    min-width: 140px;
}

.inline-form .form-input:focus,
.inline-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(27, 77, 62, 0.1);
}

.inline-form button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.inline-form button:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(27, 77, 62, 0.3);
}

.category-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e0f2f1;
    color: #00695c;
    display: inline-block;
}

@media (max-width: 768px) {
    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form .form-input,
    .inline-form .form-select,
    .inline-form button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Specific scrollbar for cart items to be more subtle */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    /* Made thumb darker for better visibility */
    border-radius: 4px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Staff Details Modal - Professional Style */
.staff-profile-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
}

.staff-profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    padding: 2rem;
    color: white;
    text-align: center;
    position: relative;
}

.staff-avatar-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.4);
}

.staff-profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.staff-profile-role {
    font-size: 0.9rem;
    opacity: 0.9;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
}

.staff-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.staff-stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.staff-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.staff-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.staff-stat-value.credit {
    color: #d32f2f;
}

.staff-stat-value.balance {
    color: var(--primary-color);
}

.staff-details-body {
    padding: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px dashed #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    color: var(--text-main);
}

/* Modal Close Button Enhancements */
.close-modal-btn,
.close-btn {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    /* Balanced size */
    font-weight: 700;
    cursor: pointer;
    width: 40px;
    /* Larger hit area */
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    z-index: 10;
    outline: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.close-modal-btn:hover,
.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--danger);
    transform: scale(1.1) rotate(90deg);
}

/* Close button inside dark headers or floating */
.staff-profile-header .close-btn,
.staff-profile-header .close-modal-btn,
.modal-header[style*="background"] .close-modal-btn {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.staff-profile-header .close-btn:hover,
.staff-profile-header .close-modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Button Loading State */
.btn-loading {
    position: relative !important;
    color: transparent !important;
    pointer-events: none !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.secondary-btn.btn-loading::after,
.filter-btn.btn-loading::after,
.btn-secondary.btn-loading::after {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
}
/* Login Page Styles */
.auth-body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(rgba(13, 26, 21, 0.85), rgba(13, 26, 21, 0.85)),
        url('https://images.unsplash.com/photo-1554118811-1e0d58224f24?auto=format&fit=crop&q=80&w=2047');
    background-size: cover;
    background-position: center;
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    padding: 3.5rem;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    z-index: 10;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    display: block;
}

.login-header h1 {
    color: #ffffff !important;
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
}

.auth-form .form-group {
    margin-bottom: 1.8rem;
}

.auth-form label {
    color: rgba(255, 255, 255, 0.95);
    display: block;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 16px 18px;
    color: white;
    outline: none;
    transition: var(--transition);
    font-size: 1rem;
}

.auth-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-color);
}

.login-btn {
    width: 100%;
    background: var(--accent-color);
    color: var(--sidebar-bg);
    border: none;
    padding: 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.auth-footer {
    margin-top: 2.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.auth-error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ff8a80;
    padding: 15px;
    border-radius: 14px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    text-align: center;
}

/* Sidebar Logout Button */
.logout-btn-container {
    margin-top: auto;
    padding-top: 1.5rem;
}

.nav-btn.logout-btn {
    color: #ff4d4d !important;
    background: rgba(255, 77, 77, 0.05);
    border: 1px solid rgba(255, 77, 77, 0.1);
}

.nav-btn.logout-btn:hover {
    background: rgba(255, 77, 77, 0.1) !important;
    border-color: #ff4d4d !important;
    color: white !important;
}

/* Auth Pages */
.auth-body {
    background: linear-gradient(135deg, rgba(27, 77, 62, 0.8), rgba(13, 26, 21, 0.9)),
                url('https://images.unsplash.com/photo-1501339847302-ac426a4a7cbb?auto=format^&fit=crop^&q=80^&w=2000');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

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

.login-header {
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px rgba(196, 164, 132, 0.3));
}

.login-header h1 {
    font-family: 'Playfair Display', serif;
    color: white;
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
}

.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(196, 164, 132, 0.2);
}

.login-btn {
    width: 100%;
    background: var(--accent-color);
    color: #1b4d3e;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.login-btn:hover {
    background: #d4b494;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.auth-error {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.2);
    color: #ffcccc;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-align: left;
}

.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-footer p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}
