/* =====================================================================
   Restaurant SaaS - Light Theme with Teal & Coral
   100% Responsive Design
   ===================================================================== */

:root {
    --primary: #0d9488;
    --primary-light: #14b8a6;
    --primary-dark: #0f766e;
    --accent: #ff6b6b;
    --accent-light: #ff8787;
    --accent-dark: #ee5a52;
    --bg-light: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f1f3;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --sidebar-width: 260px;
    --topbar-height: 64px;
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
        --topbar-height: 56px;
    }
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-secondary);
    color: var(--text-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-dark); }

/* ---------------- Layout ---------------- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--bg-light) 0%, #ffffff 100%);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar .brand {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar .brand img { height: 36px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.sidebar .brand span { font-weight: 700; color: var(--primary-dark); font-size: 1.1rem; }

.sidebar .nav-link {
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    margin: 0.25rem 0.5rem;
    border-radius: 0 8px 8px 0;
}

.sidebar .nav-link i { width: 20px; text-align: center; }

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: var(--primary);
    background: rgba(13, 148, 136, 0.08);
    border-left-color: var(--primary);
}

.sidebar .nav-section-title {
    color: var(--text-light);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 1.25rem 0.4rem;
    font-weight: 600;
}

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.topbar .page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-dark); }

.content-area { padding: 1.5rem; flex: 1; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-dark);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }

.card-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-dark);
    border-radius: 12px 12px 0 0;
}

.stat-card {
    border-radius: 12px;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
    transition: transform 0.2s ease;
}

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

.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: white; }
.stat-card .stat-label { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); }
.stat-card .stat-icon {
    width: 48px; height: 48px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.2); color: white; font-size: 1.4rem;
}

/* ---------------- Tables ---------------- */
.table { color: var(--text-dark); }
.table thead th {
    background: var(--bg-secondary);
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.table td, .table th { border-color: var(--border-color); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--bg-secondary); color: var(--text-dark); }

/* ---------------- Forms ---------------- */
.form-control, .form-select {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus, .form-select:focus {
    background: var(--bg-light);
    border-color: var(--primary);
    color: var(--text-dark);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.1);
}
.form-control::placeholder { color: var(--text-light); }
label { color: var(--text-muted); font-size: 0.88rem; font-weight: 500; }

/* ---------------- Buttons ---------------- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-primary:hover { 
    background: var(--primary-dark); 
    border-color: var(--primary-dark); 
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    transition: all 0.2s ease;
}
.btn-outline-primary:hover { 
    background: var(--primary); 
    color: white;
    border-color: var(--primary);
}

.btn-gold {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-gold:hover { 
    background: var(--primary-dark); 
    border-color: var(--primary-dark); 
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-outline-gold {
    border-color: var(--primary);
    color: var(--primary);
    transition: all 0.2s ease;
}
.btn-outline-gold:hover { 
    background: var(--primary); 
    color: white;
    border-color: var(--primary);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}
.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: white;
}

/* ---------------- Badges ---------------- */
.badge { font-weight: 500; }

/* ---------------- Login Pages ---------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.auth-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.auth-card .logo-circle {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; margin: 0 auto 1rem;
}

/* ---------------- Customer Menu (QR) ---------------- */
.menu-page { 
    background: var(--bg-secondary); 
    min-height: 100vh; 
    padding-bottom: 90px; 
}
.menu-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 2rem 1rem 1.5rem;
    border-radius: 0 0 24px 24px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.2);
}
.menu-header img.logo { 
    width: 64px; 
    height: 64px; 
    border-radius: 50%; 
    border: 4px solid white; 
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.menu-header h1, .menu-header h2 { color: white; margin-top: 0.5rem; }

.category-pill {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 24px;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    white-space: nowrap;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    background: var(--bg-light);
    transition: all 0.2s ease;
    font-weight: 500;
}
.category-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.category-pill.active { 
    background: var(--primary); 
    color: white; 
    border-color: var(--primary); 
    font-weight: 600; 
}

.menu-item-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem;
    display: flex;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
}
.menu-item-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}
.menu-item-card img { 
    width: 78px; 
    height: 78px; 
    object-fit: cover; 
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.veg-dot, .nonveg-dot {
    width: 14px; height: 14px; border: 2px solid; display: inline-block; border-radius: 3px; position: relative;
}
.veg-dot { border-color: #2e7d32; }
.veg-dot::after { content: ''; position: absolute; inset: 2px; background: #2e7d32; border-radius: 50%; }
.nonveg-dot { border-color: #c62828; }
.nonveg-dot::after { content: ''; position: absolute; inset: 2px; background: #c62828; border-radius: 50%; }

.cart-bar {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 0.9rem 1.25rem;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-weight: 700;
    box-shadow: 0 -6px 20px rgba(13, 148, 136, 0.25);
    z-index: 1100;
}

.qty-btn {
    width: 28px; 
    height: 28px; 
    border-radius: 50%;
    border: 2px solid white; 
    color: white;
    background: transparent; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qty-btn:hover { background: rgba(255, 255, 255, 0.2); }

.action-fab {
    position: fixed; 
    right: 1rem; 
    bottom: 110px;
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem; 
    z-index: 1050;
}
.action-fab button {
    border-radius: 24px; 
    border: 2px solid var(--primary); 
    background: white;
    color: var(--primary); 
    padding: 0.5rem 1rem; 
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
}

.action-fab button:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ---------------- Misc ---------------- */
.scroll-x { overflow-x: auto; white-space: nowrap; padding-bottom: 0.5rem; }
.kds-card { 
    border-left: 4px solid var(--primary);
    background: var(--bg-light);
    border: 1px solid var(--border-color);
}
.kds-card.urgent { border-left-color: var(--danger); }

/* Status Badges */
.badge-success { background: var(--success); color: white; }
.badge-danger { background: var(--danger); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-info { background: var(--info); color: white; }

/* =====================================================================
   RESPONSIVE DESIGN - 100% RESPONSIVE
   ===================================================================== */

/* Tablets & Small Desktops (768px - 991px) */
@media (max-width: 991px) {
    .sidebar { 
        left: -260px; 
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    }
    .sidebar.show { left: 0; }
    .main-content { margin-left: 0; width: 100%; }
    
    .content-area { padding: 1rem; }
    
    .stat-card { padding: 1rem; }
    .stat-card .stat-value { font-size: 1.5rem; }
    
    .action-fab { right: 0.75rem; bottom: 100px; }
    .action-fab button { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
}

/* Phones & Small Tablets (480px - 767px) */
@media (max-width: 767px) {
    :root {
        --sidebar-width: 0;
        --topbar-height: 56px;
    }
    
    * { margin: 0; padding: 0; }
    
    .sidebar { width: 80%; max-width: 260px; }
    
    .topbar { 
        height: 56px; 
        padding: 0 1rem;
    }
    
    .main-content { margin-left: 0; width: 100%; }
    
    .content-area { 
        padding: 1rem;
        margin-bottom: 90px;
    }
    
    .app-wrapper { flex-direction: column; }
    
    .card { border-radius: 8px; }
    .card-header { padding: 0.75rem 1rem; font-size: 0.95rem; }
    
    .stat-card { 
        padding: 1rem; 
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }
    .stat-card .stat-value { font-size: 1.4rem; }
    .stat-card .stat-label { font-size: 0.8rem; }
    .stat-card .stat-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    
    .table { font-size: 0.85rem; }
    .table td, .table th { padding: 0.5rem 0.25rem; }
    .table thead th { font-size: 0.7rem; }
    
    .form-control, .form-select, .btn { 
        font-size: 16px;
        padding: 0.6rem;
    }
    
    .btn { 
        padding: 0.6rem 1rem;
        border-radius: 8px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    .menu-header { padding: 1.5rem 0.75rem 1rem; }
    .menu-header img.logo { width: 56px; height: 56px; }
    
    .menu-item-card { 
        padding: 0.75rem;
        gap: 0.6rem;
        border-radius: 10px;
    }
    .menu-item-card img { width: 70px; height: 70px; }
    .menu-item-card .item-info { flex: 1; }
    
    .category-pill {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
        margin-right: 0.3rem;
    }
    
    .cart-bar { 
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }
    
    .action-fab { 
        right: 0.5rem; 
        bottom: 85px;
        gap: 0.4rem;
    }
    .action-fab button { 
        padding: 0.35rem 0.7rem; 
        font-size: 0.7rem;
        border-radius: 20px;
    }
}

/* Extra Small Phones (below 480px) */
@media (max-width: 479px) {
    .content-area { padding: 0.75rem; }
    
    .topbar { 
        padding: 0 0.75rem;
        height: 52px;
    }
    
    .topbar .page-title { font-size: 0.95rem; }
    
    .card { border-radius: 8px; margin-bottom: 0.75rem; }
    .card-header { padding: 0.6rem 0.75rem; }
    .card-body { padding: 0.75rem; }
    
    .stat-card { 
        padding: 0.85rem;
        margin-bottom: 0.6rem;
    }
    .stat-card .stat-value { font-size: 1.2rem; }
    .stat-card .stat-label { font-size: 0.75rem; }
    
    .table { font-size: 0.8rem; }
    .table td, .table th { padding: 0.35rem 0.15rem; }
    
    .btn { 
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .menu-item-card { 
        padding: 0.6rem;
        border-radius: 8px;
    }
    .menu-item-card img { width: 65px; height: 65px; }
    
    .cart-bar { 
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
        gap: 0.5rem;
    }
    
    .action-fab { 
        right: 0.4rem; 
        bottom: 80px;
    }
    .action-fab button { 
        padding: 0.3rem 0.6rem; 
        font-size: 0.65rem;
    }
}

/* Landscape Mode */
@media (max-height: 500px) {
    .sidebar { height: 100vh; }
    .content-area { padding: 0.75rem; }
    .stat-card { padding: 0.75rem; }
}

/* Print Styles */
@media print {
    .sidebar, .topbar, .action-fab, .cart-bar { display: none; }
    .main-content { margin-left: 0; width: 100%; }
    .content-area { padding: 0; }
    .card { page-break-inside: avoid; }
}
