* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #fc8019;
    --primary-dark: #e56b0a;
    --primary-light: #fff4e6;
    --secondary: #60b246;
    --accent: #ff3d6e;
    --purple: #7b61ff;
    --blue: #5d8cff;
    --teal: #00c9a7;
    --pink: #ff6b9d;
    --bg: #f8f8f8;
    --card: #ffffff;
    --text: #3d4152;
    --text-light: #7e808c;
    --text-lighter: #93959f;
    --border: #e8e8e8;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 3px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Pages */
.page { display: none; } .page.active { display: flex; }

/* ===== LOGIN ===== */
.login-container {
    width: 100%; min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #fc8019 0%, #ff3d6e 50%, #7b61ff 100%);
    padding: 20px;
}
.login-box {
    background: white; border-radius: 24px; padding: 48px 40px; width: 100%; max-width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.2);
}
.login-box h1 { text-align: center; font-size: 2.2em; margin-bottom: 4px; color: var(--text); }
.login-box .subtitle { text-align: center; color: var(--text-light); margin-bottom: 32px; font-size: 0.95em; }
.quick-login { margin-top: 24px; text-align: center; }
.quick-login p { font-size: 0.8em; color: var(--text-lighter); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
.quick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== MAIN LAYOUT ===== */
#mainApp { width: 100%; min-height: 100vh; }
#sidebar {
    width: 260px; background: white; border-right: 1px solid var(--border);
    position: fixed; top: 0; left: 0; height: 100vh;
    display: flex; flex-direction: column; z-index: 100;
    box-shadow: 2px 0 20px rgba(0,0,0,0.05);
    transition: width 0.3s ease;
}
#sidebar.collapsed { width: 70px; }
#sidebar.collapsed .sidebar-header h2 { display: none; }
#sidebar.collapsed .nav-links li a { justify-content: center; padding: 14px 0; }
#sidebar.collapsed .nav-links li a span { display: none; }
#sidebar.collapsed .sidebar-footer .user-info span { display: none; }
#sidebar.collapsed .sidebar-footer .btn span { display: none; }
#sidebar.collapsed + #content { margin-left: 70px; width: calc(100% - 70px); }
.sidebar-header { padding: 24px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 1.5em; color: var(--primary); }
.nav-links { list-style: none; padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-links li { margin-bottom: 4px; }
.nav-links li a {
    display: block; padding: 14px 18px; border-radius: 12px;
    text-decoration: none; color: var(--text); font-weight: 500;
    transition: all 0.2s; font-size: 0.95em;
}
.nav-links li a:hover { background: var(--primary-light); color: var(--primary); }
.nav-links li a.active { background: var(--primary); color: white; box-shadow: 0 4px 12px rgba(252,128,25,0.3); }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#content { margin-left: 260px; padding: 0; min-height: 100vh; width: calc(100% - 260px); transition: margin-left 0.3s ease, width 0.3s ease; }
.content-page { display: none; padding: 0; } .content-page.active { display: block; width: 100%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85em; font-weight: 600; color: var(--text); margin-bottom: 8px; }
input, select, textarea {
    width: 100%; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px;
    font-size: 0.95em; outline: none; transition: all 0.2s; background: #fafafa;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px rgba(252,128,25,0.1); }

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 22px; border: none; border-radius: 12px; font-weight: 600;
    cursor: pointer; font-size: 0.9em; transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 8px; font-family: inherit;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--secondary); color: white; }
.btn-danger { background: var(--accent); color: white; }
.btn-warning { background: #ffb800; color: #3d2e00; }
.btn-purple { background: var(--purple); color: white; }
.btn-green { background: var(--teal); color: white; }
.btn-blue { background: var(--blue); color: white; }
.btn-orange { background: var(--primary); color: white; }
.btn-outline { background: white; border: 2px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 8px 14px; font-size: 0.8em; border-radius: 8px; }
.btn-full { width: 100%; justify-content: center; }

/* ===== CARDS ===== */
.card { background: white; border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: white; border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow); border-left: 4px solid var(--primary);
    transition: all 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card:nth-child(2) { border-left-color: var(--blue); }
.stat-card:nth-child(3) { border-left-color: var(--accent); }
.stat-card:nth-child(4) { border-left-color: var(--purple); }
.stat-card .stat-value { font-size: 2em; font-weight: 700; color: var(--text); }
.stat-card .stat-label { font-size: 0.85em; color: var(--text-light); margin-top: 4px; }

/* ===== TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { text-align: left; padding: 14px 16px; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-lighter); background: #fafafa; border-bottom: 2px solid var(--border); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #f5f5f5; }
.data-table tr:hover { background: var(--primary-light); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge { padding: 5px 12px; border-radius: 20px; font-size: 0.75em; font-weight: 600; letter-spacing: 0.3px; }
.badge-green { background: #e6f7ef; color: #1b873f; }
.badge-red { background: #fde8ec; color: #c41e3a; }
.badge-yellow { background: #fff4e0; color: #b86e00; }
.badge-blue { background: #e8f2ff; color: #1a5dc7; }
.badge-purple { background: #f0ebff; color: #5b21b6; }
.badge-gray { background: #f3f3f3; color: var(--text-light); }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.page-header h1 { font-size: 1.6em; color: var(--text); }

/* ===== TOAST ===== */
.toast {
    position: fixed; top: 24px; right: 24px; padding: 16px 28px; border-radius: 14px;
    color: white; font-weight: 600; z-index: 9999; transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2); font-size: 0.9em;
}
.toast.show { transform: translateX(0); }
.toast.success { background: linear-gradient(135deg, #60b246, #00c9a7); }
.toast.error { background: linear-gradient(135deg, #ff3d6e, #ff6b9d); }
.toast.info { background: linear-gradient(135deg, #fc8019, #ffb800); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(4px); }
.modal-content { background: white; border-radius: 20px; padding: 28px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h2 { font-size: 1.3em; color: var(--text); }
.modal-close { background: none; border: none; font-size: 1.8em; cursor: pointer; color: var(--text-lighter); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #f5f5f5; }

/* ===== MENU GRID ===== */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.menu-card {
    background: white; border-radius: var(--radius-sm); padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); cursor: pointer;
    transition: all 0.2s; border: 2px solid transparent;
}
.menu-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 20px rgba(252,128,25,0.15); }
.menu-card .item-name { font-weight: 600; margin-bottom: 4px; font-size: 0.95em; }
.menu-card .item-price { color: var(--primary); font-weight: 700; font-size: 1.15em; }
.menu-card .item-cat { font-size: 0.7em; color: var(--text-lighter); text-transform: uppercase; letter-spacing: 0.5px; }
.veg-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; border: 2px solid; }
.veg-dot.veg { background: #60b246; border-color: #60b246; }
.veg-dot.nonveg { background: #e43b4f; border-color: #e43b4f; }

/* ===== TABLE GRID ===== */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.table-card {
    padding: 22px 16px; border-radius: var(--radius-sm); text-align: center;
    cursor: pointer; border: 2px solid var(--border); transition: all 0.2s;
    background: white;
}
.table-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.table-card.available { background: linear-gradient(135deg, #e6f7ef, #d1fae5); border-color: #6ee7b7; }
.table-card.occupied { background: linear-gradient(135deg, #fde8ec, #fee2e2); border-color: #fca5a5; }
.table-card.reserved { background: linear-gradient(135deg, #fff4e0, #fef3c7); border-color: #fcd34d; }
.table-card .table-num { font-size: 1.4em; font-weight: 700; color: var(--text); }
.table-card .table-seats { font-size: 0.8em; color: var(--text-light); margin-top: 4px; }

/* ===== KITCHEN GRID ===== */
.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ===== ORDER LAYOUT ===== */
.order-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; height: calc(100vh - 140px); }
.order-menu { overflow-y: auto; padding-right: 8px; }
.order-cart {
    background: white; border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
    border: 2px solid var(--border);
}
.cart-items { flex: 1; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f5f5f5; }
.cart-summary { border-top: 2px solid var(--border); padding-top: 14px; margin-top: 14px; }
.cart-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.9em; color: var(--text-light); }
.cart-row.total { font-size: 1.3em; font-weight: 700; color: var(--primary); border-top: 2px dashed var(--border); padding-top: 10px; margin-top: 8px; }

/* ===== FILTERS ===== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-btn {
    padding: 10px 18px; border-radius: 24px; border: 2px solid var(--border);
    background: white; cursor: pointer; font-size: 0.85em; font-weight: 600;
    transition: all 0.2s; color: var(--text-light); font-family: inherit;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 12px rgba(252,128,25,0.3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #sidebar { 
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    #sidebar.mobile-open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    .mobile-overlay.show { display: block; }
    #content { margin-left: 0 !important; width: 100% !important; padding: 0; }
    .content-page { padding: 16px; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start !important; }
    .page-header > div { flex-wrap: wrap; }
    .order-layout { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .menu-grid { grid-template-columns: 1fr 1fr !important; }
    .data-table { font-size: 0.8em; }
    .data-table th, .data-table td { padding: 8px 6px; }
    .filters { flex-wrap: wrap; }
    .modal-content { width: 95% !important; max-height: 90vh; margin: 5vh auto; }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr; }
    .menu-grid { grid-template-columns: 1fr !important; }
    .stat-grid { grid-template-columns: 1fr; }
}

/* ===== UTILITY ===== */
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-lighter); }
.flex { display: flex; } .flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.hidden { display: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #bbb; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.card, .stat-card, .menu-card, .table-card { animation: fadeIn 0.3s ease; }


/* Fix content area to fill full width */
.content-page.active { width: 100%; }
#content { overflow-x: hidden; }
