/* ============================================
   Restaurant Billing System - Premium UI
   Modern, Clean, Fast & Intuitive
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #FF6B35;
    --primary-dark: #E5551F;
    --primary-light: #FF8F65;
    --primary-bg: rgba(255,107,53,0.08);
    --secondary: #1B2A4A;
    --secondary-light: #2D4373;
    --accent: #00C48C;
    --accent-bg: rgba(0,196,140,0.08);
    --danger: #FF4757;
    --danger-bg: rgba(255,71,87,0.08);
    --warning: #FFA502;
    --warning-bg: rgba(255,165,2,0.08);
    --info: #3B82F6;
    --info-bg: rgba(59,130,246,0.08);
    --purple: #8B5CF6;
    --purple-bg: rgba(139,92,246,0.08);
    --sidebar-bg: #0F172A;
    --sidebar-hover: #1E293B;
    --sidebar-active: rgba(255,107,53,0.12);
    --body-bg: #F1F5F9;
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --card-shadow-hover: 0 10px 25px rgba(0,0,0,0.08);
    --border-color: #E2E8F0;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============ WRAPPER ============ */
.wrapper { display: flex; min-height: 100vh; }

/* ============ SIDEBAR ============ */
#sidebar {
    width: 270px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1040;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.sidebar-brand .logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.sidebar-brand .icon {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.sidebar-menu { padding: 12px 0; flex: 1; }
.sidebar-menu ul { list-style: none; padding: 0; margin: 0; }

.sidebar-label {
    padding: 20px 24px 8px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.25);
    border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: 4px;
}
.sidebar-label:first-child { border-top: none; margin-top: 0; }

.sidebar-menu > ul > li > a {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.9rem; font-weight: 600;
    transition: var(--transition);
    border-left: 3px solid transparent;
    margin: 2px 0;
    border-radius: 0 8px 8px 0;
    margin-right: 10px;
}

.sidebar-menu > ul > li > a:hover {
    color: #fff;
    background: var(--sidebar-hover);
    border-left-color: rgba(255,255,255,0.2);
}

.sidebar-menu > ul > li.active > a {
    color: #fff;
    background: var(--sidebar-active);
    border-left-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-menu > ul > li.active > a i { color: var(--primary); }

.sidebar-menu > ul > li > a i {
    width: 22px; text-align: center;
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    transition: color 0.2s;
    flex-shrink: 0;
}

.sidebar-menu > ul > li > a:hover i {
    color: rgba(255,255,255,0.9);
}

.sidebar-menu > ul > li > a .badge-sidebar {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 50px;
    font-weight: 700;
}

.sidebar-submenu { display: none; background: rgba(0,0,0,0.15); border-radius: 0 0 8px 0; margin-right: 10px; }
.sidebar-dropdown.active .sidebar-submenu { display: block; }

.sidebar-submenu ul li a {
    display: block;
    padding: 10px 24px 10px 58px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.85rem; font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.sidebar-submenu ul li a::before {
    content: '';
    position: absolute; left: 38px; top: 50%;
    transform: translateY(-50%);
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transition: var(--transition);
}

.sidebar-submenu ul li a:hover { color: #fff; }
.sidebar-submenu ul li a:hover::before { background: var(--primary); }

.sidebar-dropdown > a::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    margin-left: auto;
    transition: transform 0.3s ease;
    opacity: 0.4;
}

.sidebar-dropdown > a:hover::after { opacity: 0.8; }
.sidebar-dropdown.active > a::after { transform: rotate(180deg); opacity: 0.8; }

.sidebar-collapsed #sidebar { margin-left: -270px; }
.sidebar-collapsed .main-content { margin-left: 0 !important; }

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    margin-left: 270px;
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============ TOP NAVBAR ============ */
.top-navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; height: 64px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 1020;
    flex-shrink: 0;
}

.navbar-left { display: flex; align-items: center; gap: 16px; }

.sidebar-toggle {
    background: none; border: none;
    font-size: 1.15rem; color: var(--text-secondary);
    cursor: pointer; padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}

.sidebar-toggle:hover { background: var(--body-bg); color: var(--text-primary); }

.page-title {
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-primary); letter-spacing: -0.3px;
}

.navbar-right { display: flex; align-items: center; gap: 12px; }

.navbar-action {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm); border: none;
    background: var(--body-bg); color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition);
    position: relative; font-size: 0.95rem;
}

.navbar-action:hover { background: var(--primary-bg); color: var(--primary); }

.navbar-action .badge-dot {
    position: absolute; top: 8px; right: 8px;
    width: 8px; height: 8px;
    background: var(--danger); border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.user-dropdown .btn {
    display: flex; align-items: center; gap: 10px;
    border: none; background: var(--body-bg);
    border-radius: 50px; padding: 5px 16px 5px 6px;
    transition: var(--transition);
}

.user-dropdown .btn:hover { background: #E2E8F0; }

.user-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.8rem;
}

.user-avatar i { font-size: 1.8rem; color: var(--primary); }

.user-name {
    font-weight: 600; color: var(--text-primary); font-size: 0.88rem;
}

/* ============ PAGE CONTENT ============ */
.page-content { padding: 24px 28px; flex: 1; }

/* ============ CARDS ============ */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    background: var(--card-bg);
    transition: var(--transition);
}

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px; font-weight: 600;
}

.card-body { padding: 24px; }

/* ============ STAT CARDS ============ */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    position: relative; overflow: hidden;
    transition: var(--transition);
}

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

.stat-card .stat-icon-wrap {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 1.75rem; font-weight: 800;
    color: var(--text-primary); margin-bottom: 4px;
    letter-spacing: -0.5px; line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.82rem; color: var(--text-secondary); font-weight: 500;
}

.stat-orange .stat-icon-wrap { background: var(--primary-bg); color: var(--primary); }
.stat-green .stat-icon-wrap { background: var(--accent-bg); color: var(--accent); }
.stat-blue .stat-icon-wrap { background: var(--info-bg); color: var(--info); }
.stat-purple .stat-icon-wrap { background: var(--purple-bg); color: var(--purple); }
.stat-red .stat-icon-wrap { background: var(--danger-bg); color: var(--danger); }

/* Old gradient stat cards compat */
.bg-gradient-orange { background: linear-gradient(135deg, #FF6B35, #FF8F65) !important; color: #fff !important; }
.bg-gradient-green { background: linear-gradient(135deg, #00C48C, #00E4A0) !important; color: #fff !important; }
.bg-gradient-blue { background: linear-gradient(135deg, #3B82F6, #60A5FA) !important; color: #fff !important; }
.bg-gradient-purple { background: linear-gradient(135deg, #8B5CF6, #A78BFA) !important; color: #fff !important; }
.bg-gradient-red { background: linear-gradient(135deg, #FF4757, #FF6B81) !important; color: #fff !important; }
.bg-gradient-teal { background: linear-gradient(135deg, #14B8A6, #2DD4BF) !important; color: #fff !important; }

.stat-card.bg-gradient-orange, .stat-card.bg-gradient-green,
.stat-card.bg-gradient-blue, .stat-card.bg-gradient-purple,
.stat-card.bg-gradient-red, .stat-card.bg-gradient-teal { border: none; }

.stat-card.bg-gradient-orange .stat-value, .stat-card.bg-gradient-green .stat-value,
.stat-card.bg-gradient-blue .stat-value, .stat-card.bg-gradient-purple .stat-value,
.stat-card.bg-gradient-red .stat-value, .stat-card.bg-gradient-teal .stat-value { color: #fff; }

.stat-card .stat-icon {
    position: absolute; right: 20px; top: 50%;
    transform: translateY(-50%); font-size: 3rem; opacity: 0.15;
}

/* ============ BUTTONS ============ */
.btn {
    font-weight: 600; font-size: 0.88rem;
    border-radius: var(--radius-sm);
    padding: 8px 20px; transition: var(--transition);
    display: inline-flex; align-items: center; gap: 8px;
}

.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}

.btn-primary:hover {
    background: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 4px 14px rgba(255,107,53,0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 2px 8px rgba(0,196,140,0.25);
}

.btn-outline-primary {
    color: var(--primary); border-color: var(--primary); background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary); border-color: var(--primary); color: #fff;
}

.btn-light {
    background: var(--body-bg); border-color: var(--border-color); color: var(--text-secondary);
}

.btn-light:hover { background: #E2E8F0; color: var(--text-primary); }

/* ============ TABLES ============ */
.table { margin-bottom: 0; }

.table thead th {
    background: var(--body-bg);
    font-weight: 600; font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px; white-space: nowrap;
}

.table tbody td {
    padding: 14px 16px; vertical-align: middle;
    font-size: 0.9rem; border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #F8FAFC; }

/* ============ BADGES ============ */
.badge-veg {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
}

.badge-veg.veg { background: #ECFDF5; color: #059669; }
.badge-veg.non-veg { background: #FEF2F2; color: #DC2626; }

.badge-status {
    padding: 5px 14px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.2px; display: inline-block;
}

.badge-available { background: #ECFDF5; color: #059669; }
.badge-occupied { background: #FFF7ED; color: #EA580C; }
.badge-reserved { background: #EFF6FF; color: #2563EB; }
.badge-maintenance { background: #FEF2F2; color: #DC2626; }

.badge-paid { background: #ECFDF5; color: #059669; }
.badge-unpaid { background: #FEF2F2; color: #DC2626; }
.badge-partial { background: #FFF7ED; color: #EA580C; }

.badge-completed { background: #ECFDF5; color: #059669; }
.badge-pending { background: #FFF7ED; color: #EA580C; }
.badge-accepted { background: #EFF6FF; color: #2563EB; }
.badge-preparing { background: #FEF3C7; color: #D97706; }
.badge-ready { background: #F0FDF4; color: #16A34A; }
.badge-served { background: #F5F3FF; color: #7C3AED; }
.badge-cancelled { background: #FEF2F2; color: #DC2626; }
.badge-sent { background: #EFF6FF; color: #2563EB; }

/* ============ FORMS ============ */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    font-size: 0.9rem;
    transition: var(--transition);
    color: var(--text-primary);
    background: var(--card-bg);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.form-label {
    font-weight: 600; font-size: 0.84rem;
    color: var(--text-secondary); margin-bottom: 6px;
}

.form-control-sm, .form-select-sm { padding: 7px 12px; font-size: 0.85rem; }

/* ============ POS SYSTEM ============ */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
    height: calc(100vh - 112px);
}

.menu-section { overflow-y: auto; padding-right: 4px; }

.cart-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
    overflow: hidden; box-shadow: var(--card-shadow);
}

.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    background: var(--body-bg); flex-shrink: 0;
}

.cart-header h5 {
    margin: 0; font-weight: 700; font-size: 0.95rem; color: var(--text-primary);
}

.cart-items { flex: 1; overflow-y: auto; padding: 12px 16px; }

.cart-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
    font-weight: 600; font-size: 0.88rem; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cart-item-price { font-size: 0.78rem; color: var(--text-muted); }

.cart-item-qty {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

.cart-item-qty button {
    width: 30px; height: 30px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.85rem; font-weight: 600;
    transition: var(--transition); color: var(--text-primary);
}

.cart-item-qty button:hover {
    background: var(--primary); border-color: var(--primary); color: #fff;
}

.cart-item-qty span {
    min-width: 28px; text-align: center; font-weight: 700; font-size: 0.9rem;
}

.cart-item-total {
    font-weight: 700; color: var(--primary);
    min-width: 65px; text-align: right; font-size: 0.9rem; flex-shrink: 0;
}

.cart-footer {
    padding: 16px 20px;
    border-top: 2px solid var(--border-color);
    background: #FAFBFC; flex-shrink: 0;
}

.cart-summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 0; font-size: 0.88rem; color: var(--text-secondary);
}

.cart-summary-row.total {
    font-size: 1.15rem; font-weight: 800; color: var(--primary);
    border-top: 2px solid var(--border-color);
    padding-top: 12px; margin-top: 8px;
}

.cart-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 20px; color: var(--text-muted);
}

.cart-empty i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.cart-empty p { font-weight: 600; margin-bottom: 4px; }

/* Category Tabs */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.category-tab {
    padding: 7px 18px; border-radius: 50px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    font-weight: 600; font-size: 0.82rem;
    cursor: pointer; transition: var(--transition);
    color: var(--text-secondary); white-space: nowrap;
}

.category-tab:hover {
    border-color: var(--primary); color: var(--primary);
    background: var(--primary-bg);
}

.category-tab.active {
    background: var(--primary); border-color: var(--primary); color: #fff;
    box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.menu-item-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px; cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid var(--border-color);
    position: relative; user-select: none;
}

.menu-item-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,107,53,0.12);
}

.menu-item-card:active { transform: translateY(0); }

.menu-item-card .item-name {
    font-weight: 600; font-size: 0.88rem;
    color: var(--text-primary); margin-bottom: 2px; line-height: 1.3;
}

.menu-item-card .item-category {
    font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px;
}

.menu-item-card .item-price { font-size: 1.05rem; font-weight: 800; color: var(--primary); }

.menu-item-card .veg-indicator {
    position: absolute; top: 12px; right: 12px;
    width: 16px; height: 16px;
    border: 2px solid; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
}

.menu-item-card .veg-indicator.veg { border-color: #059669; }
.menu-item-card .veg-indicator.veg::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #059669; }
.menu-item-card .veg-indicator.non-veg { border-color: #DC2626; }
.menu-item-card .veg-indicator.non-veg::after { content: ''; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #DC2626; }

/* ============ TABLE GRID ============ */
.table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.table-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px 16px; text-align: center;
    border: 2px solid var(--border-color);
    transition: var(--transition); cursor: pointer;
}

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

.table-card.available { border-color: #86EFAC; background: #F0FDF4; }
.table-card.occupied { border-color: #FED7AA; background: #FFF7ED; }
.table-card.reserved { border-color: #93C5FD; background: #EFF6FF; }
.table-card.maintenance { border-color: #FCA5A5; background: #FEF2F2; }

.table-card .table-num { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.table-card .table-cap { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

.table-action-icon {
    width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 12px; background: rgba(0,0,0,0.04); transition: all 0.2s; text-decoration: none;
}
.table-action-icon:hover { background: rgba(0,0,0,0.1); transform: scale(1.15); }

.floor-tabs { display: flex; gap: 8px; margin-bottom: 16px; }

.floor-tab {
    padding: 8px 20px; border-radius: 50px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    font-weight: 600; font-size: 0.84rem;
    cursor: pointer; transition: var(--transition);
    color: var(--text-secondary);
}

.floor-tab.active { background: var(--secondary); border-color: var(--secondary); color: #fff; }

/* ============ KOT STYLES ============ */
.kot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.kot-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden; transition: var(--transition);
}

.kot-card.pending { border-color: #FED7AA; }
.kot-card.preparing { border-color: #FDE68A; }
.kot-card.ready { border-color: #86EFAC; }

.kot-card-header {
    padding: 14px 18px;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.kot-card.pending .kot-card-header { background: #FFF7ED; }
.kot-card.preparing .kot-card-header { background: #FFFBEB; }
.kot-card.ready .kot-card-header { background: #F0FDF4; }

.kot-number { font-weight: 800; font-size: 0.95rem; }
.kot-time { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

.kot-card-body { padding: 12px 18px; }

.kot-item {
    display: flex; align-items: center;
    padding: 8px 0; border-bottom: 1px dashed var(--border-color);
}

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

.kot-item-qty {
    background: var(--primary); color: #fff;
    min-width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; font-weight: 700; font-size: 0.82rem;
    margin-right: 10px; flex-shrink: 0;
}

.kot-item-name { flex: 1; font-weight: 500; font-size: 0.88rem; }
.kot-item-notes { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

.kot-card-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    display: flex; gap: 8px;
}

.kot-card-footer .btn { flex: 1; padding: 8px; font-size: 0.82rem; justify-content: center; }

.kot-timer {
    font-family: 'Inter', monospace;
    font-weight: 700; font-size: 0.82rem;
    padding: 3px 10px; border-radius: 50px;
}

.kot-timer.urgent { background: var(--danger-bg); color: var(--danger); }
.kot-timer.warning { background: var(--warning-bg); color: var(--warning); }
.kot-timer.normal { background: var(--accent-bg); color: var(--accent); }

/* ============ INVENTORY ============ */
.stock-level { display: flex; align-items: center; gap: 10px; }

.stock-bar { flex: 1; height: 6px; background: #E2E8F0; border-radius: 3px; overflow: hidden; }

.stock-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.stock-bar-fill.good { background: var(--accent); }
.stock-bar-fill.low { background: var(--warning); }
.stock-bar-fill.critical { background: var(--danger); }

.stock-value { font-size: 0.82rem; font-weight: 600; min-width: 40px; text-align: right; }

/* ============ INVOICE ============ */
.invoice-box {
    max-width: 800px; margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 40px;
    border: 1px solid var(--border-color);
}

.invoice-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 32px; padding-bottom: 24px;
    border-bottom: 3px solid var(--primary);
}

.invoice-logo h2 { color: var(--primary); margin: 0; font-weight: 800; font-size: 1.5rem; }
.invoice-details { text-align: right; }

.invoice-table { width: 100%; margin-bottom: 24px; border-collapse: collapse; }

.invoice-table thead th {
    background: var(--secondary); color: #fff;
    padding: 12px 16px; font-weight: 600; font-size: 0.85rem;
}

.invoice-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.invoice-table thead th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

.invoice-table tbody td {
    padding: 11px 16px; border-bottom: 1px solid var(--border-color); font-size: 0.9rem;
}

.invoice-totals { width: 300px; margin-left: auto; }

/* ============ LOGIN PAGE ============ */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #334155 100%);
    padding: 20px; position: relative; overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,107,53,0.15) 0%, transparent 70%);
    top: -100px; right: -100px; border-radius: 50%;
}

.login-card {
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    overflow: hidden; width: 100%; max-width: 440px;
    position: relative; z-index: 1;
}

.login-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    padding: 44px 32px 32px; text-align: center; color: #fff;
}

.login-header .login-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px; font-size: 1.8rem;
}

.login-header h3 { margin: 0; font-weight: 800; font-size: 1.5rem; }
.login-header p { margin: 8px 0 0; opacity: 0.85; font-size: 0.9rem; }

.login-body { padding: 36px 32px; }
.login-body .form-control { padding: 12px 16px; border-radius: var(--radius); }

.login-body .btn-login {
    width: 100%; padding: 13px;
    border-radius: var(--radius);
    font-weight: 700; font-size: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none; color: #fff;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(255,107,53,0.3);
}

.login-body .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255,107,53,0.4);
}

/* ============ ACTION BUTTONS ============ */
.btn-action {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    border: none; transition: var(--transition);
    font-size: 0.82rem; cursor: pointer;
}

.btn-action.edit { background: #EFF6FF; color: #2563EB; }
.btn-action.edit:hover { background: #2563EB; color: #fff; }
.btn-action.delete { background: #FEF2F2; color: #DC2626; }
.btn-action.delete:hover { background: #DC2626; color: #fff; }
.btn-action.view { background: #ECFDF5; color: #059669; }
.btn-action.view:hover { background: #059669; color: #fff; }
.btn-action.print { background: #F5F3FF; color: #7C3AED; }
.btn-action.print:hover { background: #7C3AED; color: #fff; }
.btn-action.kot { background: #FFF7ED; color: #EA580C; }
.btn-action.kot:hover { background: #EA580C; color: #fff; }

/* ============ SECTION HEADER ============ */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}

.section-header h5 { letter-spacing: -0.3px; }

/* ============ ALERTS ============ */
.alert {
    border-radius: var(--radius); border: none;
    font-weight: 500; font-size: 0.9rem; padding: 14px 20px;
}

.alert-success { background: #ECFDF5; color: #065F46; border-left: 4px solid #059669; }
.alert-danger { background: #FEF2F2; color: #991B1B; border-left: 4px solid #DC2626; }
.alert-warning { background: #FFFBEB; color: #92400E; border-left: 4px solid #D97706; }
.alert-info { background: #EFF6FF; color: #1E40AF; border-left: 4px solid #3B82F6; }

/* ============ MODALS ============ */
.modal-content {
    border: none; border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0,0,0,0.15);
}

.modal-header { border-bottom: 1px solid var(--border-color); padding: 20px 24px; }
.modal-header .modal-title { font-weight: 700; font-size: 1.05rem; }
.modal-body { padding: 24px; }
.modal-footer { border-top: 1px solid var(--border-color); padding: 16px 24px; }

/* ============ SETTINGS ============ */
.settings-card .setting-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 0; border-bottom: 1px solid var(--border-color);
}

.settings-card .setting-item:last-child { border-bottom: none; }
.setting-label { font-weight: 600; font-size: 0.9rem; }
.setting-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

/* ============ EMPTY STATE ============ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.3; }

/* ============ QUICK ACTIONS ============ */
.quick-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.quick-action-btn {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    padding: 20px 12px; border-radius: var(--radius);
    border: 1.5px solid var(--border-color);
    background: var(--card-bg); cursor: pointer;
    transition: var(--transition);
    text-decoration: none; color: var(--text-primary);
    font-weight: 600; font-size: 0.82rem;
}

.quick-action-btn:hover {
    border-color: var(--primary); color: var(--primary);
    transform: translateY(-2px); box-shadow: var(--card-shadow-hover);
}

.quick-action-btn i { font-size: 1.5rem; }

/* ============ DATATABLE OVERRIDES ============ */
.dataTables_wrapper .dataTables_filter input {
    border-radius: var(--radius-sm);
    padding: 7px 14px;
    border: 1.5px solid var(--border-color);
    font-size: 0.88rem;
    transition: var(--transition);
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary); outline: none;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    border: 1.5px solid var(--border-color);
}

/* ============ SELECT2 OVERRIDES ============ */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: var(--radius-sm) !important;
    border: 1.5px solid var(--border-color) !important;
    padding: 6px 10px !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1400px) { .pos-container { grid-template-columns: 1fr 380px; } }

@media (max-width: 1200px) {
    .pos-container { grid-template-columns: 1fr 360px; }
    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 991px) {
    #sidebar { margin-left: -270px; transition: margin-left 0.3s ease; }
    .main-content { margin-left: 0; }
    .sidebar-open #sidebar { margin-left: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.3); }
    .sidebar-open::before {
        content: '';
        position: fixed; top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5); z-index: 1030;
        animation: fadeIn 0.2s ease;
    }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    /* Larger touch targets on mobile */
    .sidebar-menu > ul > li > a { padding: 13px 24px; font-size: 0.92rem; }
    .sidebar-submenu ul li a { padding: 11px 24px 11px 58px; font-size: 0.88rem; }
    .sidebar-label { padding: 18px 24px 8px; }
    .sidebar-close-btn:hover { color: #fff !important; background: rgba(255,255,255,0.1) !important; }
    .pos-container { grid-template-columns: 1fr; height: auto; }
    .cart-section { max-height: 50vh; }
    .page-content { padding: 16px; }
    .kot-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 767px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .top-navbar { padding: 0 16px; height: 56px; }
    .invoice-box { padding: 24px; }
    .invoice-header { flex-direction: column; gap: 16px; }
    .invoice-details { text-align: left; }
    .invoice-totals { width: 100%; }
    .table-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}

@media (max-width: 576px) {
    .menu-grid { grid-template-columns: repeat(2, 1fr); }
    .category-tabs { gap: 6px; }
    .category-tab { padding: 6px 14px; font-size: 0.78rem; }
    .page-content { padding: 12px; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card, .menu-item-card, .kot-card { animation: fadeInUp 0.3s ease; }

/* ============ DASHBOARD UTILITIES ============ */
.icon-wrap {
    width: 44px; height: 44px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}

.bg-orange-light { background: var(--primary-bg); }
.bg-red-light { background: var(--danger-bg); }
.bg-green-light { background: var(--accent-bg); }
.bg-blue-light { background: var(--info-bg); }
.bg-purple-light { background: var(--purple-bg); }

.text-orange { color: var(--primary) !important; }
.text-purple { color: var(--purple) !important; }

.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    display: inline-block; flex-shrink: 0;
}

.stock-critical { color: var(--danger); font-weight: 700; font-size: 0.82rem; }
.stock-low { color: var(--warning); font-weight: 600; font-size: 0.82rem; }

.stat-footer { border-top: 1px solid var(--border-color); padding-top: 8px; }

/* ============ MISC ============ */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }

@media print {
    .top-navbar, #sidebar, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { box-shadow: none !important; border: none !important; }
    body { background: #fff; }
}
