@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap');
@import url('variables.css');

/* ==========================================================================
   1. Reset & Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-secondary, #FAFAF8);
    font-family: var(--font-body, 'Inter', -apple-system, sans-serif);
    color: var(--text-primary, #1A1A1A);
    display: flex;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ==========================================================================
   2. Sidebar
   ========================================================================== */
.sidebar {
    width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    background-color: var(--bg-primary, #FFFFFF);
    border-right: 1px solid var(--border-light, #E8E8E4);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-light, #E8E8E4);
    display: flex;
    align-items: center;
}

.sidebar-logo {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    color: var(--accent-primary, #1B3C1B);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary, #555555);
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: var(--bg-secondary, #FAFAF8);
    color: var(--text-primary, #1A1A1A);
}

.nav-item.active {
    background-color: var(--accent-primary-light, rgba(27, 60, 27, 0.08));
    color: var(--accent-primary, #1B3C1B);
    font-weight: 600;
    border-left: 3px solid var(--accent-primary, #1B3C1B);
}

.sidebar-footer {
    border-top: 1px solid var(--border-light, #E8E8E4);
    padding: 16px 24px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 90;
    backdrop-filter: blur(2px);
}

/* ==========================================================================
   3. Main Content
   ========================================================================== */
.main-content {
    margin-left: 260px;
    padding: 32px;
    background-color: var(--bg-secondary, #FAFAF8);
    min-height: 100vh;
    flex: 1;
    width: calc(100% - 260px);
}

/* ==========================================================================
   4. Page Header
   ========================================================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.8rem;
    color: var(--text-primary, #1A1A1A);
    margin: 0 0 4px 0;
    font-weight: 600;
}

.page-subtitle {
    color: var(--text-muted, #999999);
    font-size: 0.9rem;
    margin: 0;
}

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

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary, #1A1A1A);
    padding: 8px;
}

/* ==========================================================================
   5. Stats Cards
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-light, #E8E8E4);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 0, 0, 0.06));
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.blue { background-color: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.1); color: #10B981; }
.stat-icon.orange { background-color: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.stat-icon.purple { background-color: rgba(139, 92, 246, 0.1); color: #8B5CF6; }
.stat-icon.dark-green { background-color: var(--accent-primary-light, rgba(27,60,27,0.08)); color: var(--accent-primary, #1B3C1B); }

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted, #999999);
    margin-top: 4px;
}

/* ==========================================================================
   6. Kanban Board
   ========================================================================== */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: calc(100vh - 200px);
    align-items: flex-start;
}

.kanban-column {
    min-width: 280px;
    flex: 1;
    background-color: var(--bg-secondary, #FAFAF8);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-light, #E8E8E4);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light, #E8E8E4);
    margin-bottom: 8px;
}

.kanban-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #1A1A1A);
    margin: 0;
}

.kanban-count {
    background-color: var(--border-light, #E8E8E4);
    color: var(--text-secondary, #555555);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.order-card {
    background-color: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-light, #E8E8E4);
    border-radius: 10px;
    padding: 16px;
    box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 0, 0, 0.06));
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.order-table-badge {
    background-color: var(--accent-primary, #1B3C1B);
    color: white;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.order-number {
    color: var(--text-muted, #999999);
    font-size: 0.85rem;
}

.order-items {
    font-size: 0.9rem;
    color: var(--text-secondary, #555555);
    line-height: 1.5;
    margin: 0;
    padding-left: 16px;
}

.order-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary, #1A1A1A);
    border-top: 1px solid var(--border-light, #E8E8E4);
    padding-top: 12px;
    margin: 0;
}

.order-time {
    color: var(--text-muted, #999999);
    font-style: italic;
    font-size: 0.8rem;
    margin: 0;
}

.order-notes {
    background-color: #FFF8E1;
    color: #856404;
    padding: 8px 12px;
    border-radius: 6px;
    font-style: italic;
    font-size: 0.85rem;
    margin: 0;
}

.order-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.order-actions-links {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.link-danger {
    color: var(--accent-danger, #DC3545);
    font-size: 0.85rem;
    cursor: pointer;
}

.link-danger:hover { text-decoration: underline; }

.link-primary {
    color: #3B82F6;
    font-size: 0.85rem;
    cursor: pointer;
}

.link-primary:hover { text-decoration: underline; }

/* Kanban Action Buttons Colors */
.btn-action-prepare { background-color: #F97316; color: white; border: none; }
.btn-action-ready { background-color: #10B981; color: white; border: none; }
.btn-action-serve { background-color: #3B82F6; color: white; border: none; }
.btn-action-pay { background-color: #8B5CF6; color: white; border: none; }

/* ==========================================================================
   7. Data Tables
   ========================================================================== */
.table-wrapper {
    background-color: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-light, #E8E8E4);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 0, 0, 0.06));
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-secondary, #FAFAF8);
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary, #555555);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-light, #E8E8E4);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-tertiary, #F3F3EF);
    color: var(--text-primary, #1A1A1A);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.2s;
}

.data-table tbody tr:hover {
    background-color: var(--bg-secondary, #FAFAF8);
}

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

.table-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   8. Status Badges
   ========================================================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}

.status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #B45309;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-preparing {
    background-color: rgba(249, 115, 22, 0.1);
    color: #C2410C;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.status-ready {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-served {
    background-color: rgba(59, 130, 246, 0.1);
    color: #1D4ED8;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-paid {
    background-color: rgba(139, 92, 246, 0.1);
    color: #6D28D9;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.status-cancelled {
    background-color: rgba(239, 68, 68, 0.1);
    color: #B91C1C;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   9. Forms
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--text-secondary, #555555);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 8px;
    background-color: var(--bg-secondary, #FAFAF8);
    color: var(--text-primary, #1A1A1A);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--accent-primary, #1B3C1B);
    box-shadow: 0 0 0 3px var(--accent-primary-light, rgba(27,60,27,0.1));
    outline: none;
}

.form-control::placeholder {
    color: #BBBBBB;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.file-upload-zone {
    border: 2px dashed var(--border-light, #E8E8E4);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    background-color: var(--bg-secondary, #FAFAF8);
}

.file-upload-zone:hover {
    border-color: var(--accent-primary, #1B3C1B);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #CCCCCC;
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent-success, #28A745);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* ==========================================================================
   10. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.95rem;
    text-align: center;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background-color: var(--accent-primary, #1B3C1B);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover, #143014);
}

.btn-secondary {
    background-color: var(--bg-card, #FFFFFF);
    color: var(--text-primary, #1A1A1A);
    border-color: var(--border-light, #E8E8E4);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover, #FAFAF8);
}

.btn-danger {
    background-color: var(--accent-danger, #DC3545);
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: #C82333;
}

.btn-success {
    background-color: var(--accent-success, #28A745);
    color: #FFFFFF;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background-color: transparent;
    border-color: currentColor;
}

/* ==========================================================================
   11. Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.modal-card {
    background-color: var(--bg-card, #FFFFFF);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

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

.modal-title {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary, #1A1A1A);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #999999);
    padding: 4px;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-primary, #1A1A1A);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light, #E8E8E4);
}

/* ==========================================================================
   12. Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: var(--bg-card, #FFFFFF);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
    min-width: 300px;
    border-left: 4px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left-color: var(--accent-success, #28A745); }
.toast.error { border-left-color: var(--accent-danger, #DC3545); }
.toast.info { border-left-color: #3B82F6; }

.toast-message {
    color: var(--text-primary, #1A1A1A);
    font-weight: 500;
    font-size: 0.95rem;
}

/* ==========================================================================
   13. Auth Pages (Login/Register)
   ========================================================================== */
.auth-page {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f1f5f9;
    background-image: radial-gradient(circle at 15% 50%, rgba(216, 243, 49, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(27, 60, 27, 0.1), transparent 25%);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 40px 20px;
    margin: 0;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -10%; left: -10%; width: 50%; height: 50%;
    background: radial-gradient(circle, rgba(216,243,49,0.2) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}
.auth-page::after {
    content: '';
    position: absolute;
    bottom: -10%; right: -10%; width: 50%; height: 50%;
    background: radial-gradient(circle, rgba(27,60,27,0.15) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.4);
    width: 100%;
    max-width: 440px;
    padding: 50px 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.05em;
    margin-bottom: 5px;
    font-family: var(--font-body, 'Inter', sans-serif); /* Override any default */
}

.auth-header p {
    color: #666;
    font-size: 1.05rem;
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 24px;
}

.auth-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    font-size: 1rem;
    color: #111;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.auth-form input:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 4px rgba(17,17,17,0.1);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 16px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.auth-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    background: #000;
}

.auth-links {
    text-align: center;
    margin-top: 24px;
    font-size: 0.95rem;
}

.auth-links a {
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-links a:hover {
    color: #111;
    text-decoration: underline;
}

.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.lang-switcher select {
    appearance: none;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.1);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.shake {
    animation: shake 0.4s ease-in-out;
}
.error-msg {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid #fca5a5;
}

/* ==========================================================================
   14. Menu Management
   ========================================================================== */
.menu-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.menu-tab {
    padding: 8px 20px;
    background-color: var(--bg-tertiary, #F3F3EF);
    border-radius: 9999px;
    color: var(--text-secondary, #555555);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.menu-tab:hover {
    background-color: #E8E8E4;
}

.menu-tab.active {
    background-color: var(--accent-primary, #1B3C1B);
    color: white;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.menu-item-card {
    background-color: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-light, #E8E8E4);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 0, 0, 0.06));
    display: flex;
    flex-direction: column;
}

.menu-item-image {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    background-color: var(--bg-tertiary, #F3F3EF);
}

.menu-item-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.menu-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-primary, #1A1A1A);
}

.menu-item-price {
    color: var(--accent-primary, #1B3C1B);
    font-weight: 700;
    font-size: 1.1rem;
}

.menu-item-desc {
    color: var(--text-secondary, #555555);
    font-size: 0.9rem;
    margin: 0 0 16px 0;
    line-height: 1.4;
    flex: 1;
}

.menu-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-light, #E8E8E4);
}

.menu-item-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   15. Tables Page
   ========================================================================== */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.table-manager-card {
    background-color: var(--bg-card, #FFFFFF);
    border: 1px solid var(--border-light, #E8E8E4);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-card, 0 2px 12px rgba(0, 0, 0, 0.06));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.table-number-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1A1A1A);
    margin: 0;
}

.qr-code-container {
    width: 150px;
    height: 150px;
    background-color: white;
    padding: 10px;
    border: 1px solid var(--border-light, #E8E8E4);
    border-radius: 8px;
}

.qr-code-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ==========================================================================
   16. Receipt (Print)
   ========================================================================== */
.receipt-wrapper {
    max-width: 400px;
    margin: 0 auto;
    padding: 24px;
    background: white;
}

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

.receipt-logo {
    font-family: var(--font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.receipt-address {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
    line-height: 1.4;
}

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

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.receipt-table th, .receipt-table td {
    padding: 8px 0;
    border: none;
}

.receipt-table th {
    text-align: left;
    color: #555;
    font-weight: normal;
}

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

.receipt-total-row {
    font-weight: 700;
    font-size: 1.2rem;
    border-top: 2px solid #000 !important;
}

.receipt-total-row td {
    padding-top: 16px;
}

.receipt-footer {
    text-align: center;
    margin-top: 32px;
    font-size: 0.9rem;
    color: #555;
}

@media print {
    body * {
        visibility: hidden;
    }
    .receipt-wrapper, .receipt-wrapper * {
        visibility: visible;
    }
    .receipt-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    body {
        background-color: white;
    }
    .btn { display: none !important; }
}

/* ==========================================================================
   17. Notification Badge
   ========================================================================== */
.nav-item-icon-wrapper {
    position: relative;
    display: inline-flex;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background-color: var(--accent-danger, #DC3545);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.notification-badge.pulse {
    animation: pulse 2s infinite;
}

/* ==========================================================================
   18. Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    
    .hamburger-btn {
        display: block;
    }
    
    .kanban-board {
        flex-direction: column;
        overflow-x: visible;
    }
    
    .kanban-column {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-page {
        padding: 16px;
    }
    
    .auth-container {
        padding: 24px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ====== DASHBOARD & DARK THEME EXTRAS ====== */
.dark-theme {
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at top right, rgba(216,243,49,0.05), transparent 400px), radial-gradient(circle at bottom left, rgba(216,243,49,0.05), transparent 400px);
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.sidebar.glass-panel {
  background: var(--bg-card);
  border-right: 1px solid var(--border-light);
  border-radius: 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  margin-bottom: 40px;
  border-radius: 20px;
}

.top-bar h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notification-bell {
  position: relative;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.notification-bell .badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--accent-primary);
  color: var(--bg-primary);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
}

.admin-profile {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  border: 1px solid var(--border-light);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stats-row .stat-card {
  display: flex;
  align-items: center;
  padding: 24px;
  gap: 20px;
  transition: transform 0.3s ease;
}

.stats-row .stat-card:hover {
  transform: translateY(-5px);
  background: var(--bg-card-hover);
}

.stat-card .icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(216,243,49,0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.stat-info h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0 0 4px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-info .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.kanban-board {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.kanban-column {
  min-width: 300px;
  background: rgba(0,0,0,0.2);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-light);
}

.kanban-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.kanban-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.kanban-cards .order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* Stat Icon Boxes */
.stat-icon-box {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-box.blue { background: rgba(59,130,246,0.15); color: #3B82F6; }
.stat-icon-box.green { background: rgba(16,185,129,0.15); color: #10B981; }
.stat-icon-box.orange { background: rgba(245,158,11,0.15); color: #F59E0B; }
.stat-icon-box.purple { background: rgba(139,92,246,0.15); color: #8B5CF6; }

/* Status Dots */
.status-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 8px;
}
.status-dot.pending { background: #F59E0B; }
.status-dot.preparing { background: #F97316; }
.status-dot.ready { background: #10B981; }
.status-dot.served { background: #3B82F6; }

/* Kanban extras */
.kanban-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.kanban-count {
  background: rgba(255,255,255,0.1); color: var(--text-secondary);
  font-size: 0.8rem; font-weight: 700; padding: 2px 10px;
  border-radius: 12px;
}
.order-server-name {
  font-size: 0.8rem; color: var(--text-muted); margin: 0;
}

/* Sidebar extras */
.sidebar-close {
  display: none; background: none; border: none;
  color: var(--text-secondary); cursor: pointer; padding: 4px;
}
.sidebar-logo {
  font-weight: 800; font-size: 1.5rem; color: var(--text-primary);
  letter-spacing: -0.04em; margin: 0;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
}
.admin-profile {
  display: flex; align-items: center; gap: 8px;
}

/* Menu tabs for dark theme */
.dark-theme .menu-tab {
  background: rgba(255,255,255,0.05); color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.dark-theme .menu-tab:hover { background: rgba(255,255,255,0.1); }
.dark-theme .menu-tab.active {
  background: var(--accent-primary); color: var(--text-inverse);
  border-color: var(--accent-primary);
}

/* Forms in dark theme */
.dark-theme .form-control {
  background: rgba(255,255,255,0.05);
  border-color: var(--border-light);
  color: var(--text-primary);
}
.dark-theme .form-control:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}
.dark-theme .form-label { color: var(--text-secondary); }

/* Menu grid for dark theme */
.dark-theme .menu-item-card { border-color: var(--border-light); }
.dark-theme .menu-item-card .menu-item-image {
  background: rgba(255,255,255,0.03);
}

/* Tables page */
.dark-theme .table-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 16px; padding: 24px; text-align: center;
}
.dark-theme .table-card h2 { color: var(--text-primary); margin: 0 0 16px 0; }
.dark-theme .table-url {
  font-size: 0.75rem; color: var(--text-muted); margin: 12px 0;
  word-break: break-all;
}
.dark-theme .card-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.dark-theme .table-card.inactive { opacity: 0.5; }

/* Data table dark */
.dark-theme .data-table th {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  border-bottom-color: var(--border-light);
}
.dark-theme .data-table td {
  border-bottom-color: var(--border-light);
  color: var(--text-primary);
}
.dark-theme .data-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

/* Grid layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.tables-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Responsive mobile sidebar */
@media (max-width: 768px) {
  .sidebar-close { display: block; }
  .hamburger-btn {
    display: block; position: fixed; top: 16px; left: 16px;
    z-index: 80; background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: 10px; padding: 8px; cursor: pointer; color: var(--text-primary);
  }
  .main-content { padding-top: 60px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: auto; width: 100%; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
}


/* ==========================================================================
   19. Comprehensive Mobile Responsive
   ========================================================================== */

/* --- Tablet (max 992px) --- */
@media (max-width: 992px) {
  .top-bar {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 14px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .top-bar h1 {
    font-size: 1.25rem;
  }

  .top-bar-right {
    gap: 12px;
  }

  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .tables-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
}

/* --- Mobile (max 768px) --- */
@media (max-width: 768px) {
  /* Main content */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 16px;
    padding-top: 64px;
  }

  /* Top bar */
  .top-bar {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .top-bar h1 {
    font-size: 1.15rem;
  }

  .top-bar-right {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }

  .top-bar-right .btn {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  /* Hamburger */
  .hamburger-btn {
    display: block;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 80;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  /* Sidebar */
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: 150;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: block;
  }

  .sidebar-overlay.active {
    display: block;
    z-index: 140;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 14px;
    gap: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .stat-icon-box {
    width: 40px;
    height: 40px;
  }

  .stat-value, .stat-info .number {
    font-size: 1.5rem;
  }

  .stat-label, .stat-info h3 {
    font-size: 0.75rem;
  }

  /* Kanban */
  .kanban-board {
    flex-direction: column;
    overflow-x: visible;
    gap: 16px;
  }

  .kanban-column {
    width: 100%;
    min-width: auto;
  }

  /* Menu management */
  .menu-tabs {
    gap: 8px;
    margin-bottom: 16px;
  }

  .menu-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .menu-item-card {
    border-radius: 10px;
  }

  .menu-item-content {
    padding: 12px;
  }

  .menu-item-header {
    flex-wrap: wrap;
    gap: 4px;
  }

  .menu-item-title {
    font-size: 1rem;
  }

  .menu-item-footer {
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
  }

  .menu-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Search filters bar */
  .search-filters {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 10px !important;
    margin-bottom: 16px !important;
  }

  .search-filters > div {
    min-width: 100% !important;
  }

  .search-filters select {
    width: 100% !important;
    min-width: 100% !important;
  }

  /* Category filter in items tab */
  #itemsTab > div:first-child {
    flex-direction: column;
    align-items: stretch !important;
  }

  #itemsTab > div:first-child select {
    width: 100%;
  }

  /* Tables grid */
  .tables-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .table-manager-card {
    padding: 16px;
    gap: 12px;
  }

  .table-number-large {
    font-size: 1.5rem;
  }

  .qr-code-container {
    width: 120px;
    height: 120px;
  }

  /* Modals */
  .modal-card {
    width: 95%;
    max-width: none;
    padding: 20px 16px;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal-title {
    font-size: 1.2rem;
  }

  .modal-footer {
    flex-direction: column;
    gap: 8px;
  }

  .modal-footer .btn {
    width: 100%;
  }

  /* Forms */
  .form-group {
    margin-bottom: 14px;
  }

  .form-control {
    padding: 10px 12px;
    font-size: 16px;
  }

  /* Glass panels / settings sections */
  .glass-panel {
    border-radius: 12px;
  }

  .main-content > .glass-panel {
    max-width: 100% !important;
    padding: 20px 16px !important;
    border-radius: 12px !important;
  }

  /* Buttons */
  .btn {
    font-size: 0.9rem;
    padding: 10px 16px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  /* Data tables */
  .table-wrapper {
    border-radius: 10px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  /* Toast notifications */
  .toast-container {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .toast {
    min-width: auto;
    width: 100%;
  }

  /* Auth pages */
  .auth-card {
    padding: 32px 24px;
    border-radius: 24px;
  }

  .auth-header .logo {
    font-size: 1.8rem;
  }

  /* Icon picker (menu management) */
  .icon-picker {
    gap: 6px !important;
  }

  .icon-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 1.3rem !important;
    border-radius: 6px !important;
  }

  /* Order cards */
  .order-card {
    padding: 12px;
    gap: 10px;
  }

  .order-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .order-actions {
    gap: 6px;
  }

  .order-actions .btn {
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}

/* --- Small phones (max 380px) --- */
@media (max-width: 380px) {
  .main-content {
    padding: 10px;
    padding-top: 58px;
  }

  .stats-grid,
  .stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .top-bar h1 {
    font-size: 1.05rem;
  }

  .stat-value, .stat-info .number {
    font-size: 1.3rem;
  }

  .auth-card {
    padding: 24px 16px;
    border-radius: 20px;
  }

  .auth-header .logo {
    font-size: 1.5rem;
  }

  .modal-card {
    padding: 16px 12px;
  }

  .menu-tab {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .btn {
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  .order-table-badge {
    font-size: 0.8rem;
    padding: 3px 8px;
  }
}
