/* ═══════════════════════════════════════════════════════
   Butler — Restaurant SaaS Platform by Canonix Labs
   Design System v3 — Sidebar Layout
   ═══════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────── */
:root {
    /* Brand — Indigo/Purple */
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --primary-50: #E0E7FF;
    --primary-gradient: linear-gradient(135deg, #4F46E5, #7C3AED);

    --accent: #06B6D4;
    --accent-hover: #0891B2;
    --accent-light: #CFFAFE;

    --success: #059669;
    --success-light: #D1FAE5;

    --danger: #DC2626;
    --danger-hover: #B91C1C;
    --danger-light: #FEE2E2;

    --warning: #D97706;
    --warning-light: #FEF3C7;

    --info: #8B5CF6;
    --info-light: #EDE9FE;

    /* Surfaces */
    --bg: #F8FAFC;
    --bg-subtle: #F1F5F9;
    --card: #FFFFFF;
    --text: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;

    /* Kitchen Dark */
    --kitchen-bg: #0F172A;
    --kitchen-card: #1E293B;
    --kitchen-text: #F1F5F9;
    --kitchen-border: #334155;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15,23,42,.04);
    --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
    --shadow-md: 0 4px 12px rgba(15,23,42,.07), 0 2px 4px rgba(15,23,42,.04);
    --shadow-lg: 0 12px 28px rgba(15,23,42,.1), 0 4px 8px rgba(15,23,42,.04);
    --shadow-xl: 0 24px 48px rgba(15,23,42,.12), 0 8px 16px rgba(15,23,42,.05);
    --shadow-glow: 0 0 0 3px rgba(79,70,229,.15);
    --shadow-glow-accent: 0 0 0 3px rgba(6,182,212,.15);

    /* Sidebar */
    --sidebar-width: 250px;
    --sidebar-collapsed: 64px;
    --sidebar-bg: #0F172A;
    --sidebar-text: #94A3B8;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active: rgba(79,70,229,.2);
    --sidebar-active-text: #A5B4FC;
    --topbar-height: 60px;

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Type */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Transitions */
    --transition-fast: 120ms cubic-bezier(.4,0,.2,1);
    --transition: 200ms cubic-bezier(.4,0,.2,1);
    --transition-slow: 300ms cubic-bezier(.4,0,.2,1);
    --transition-spring: 400ms cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset & Base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--primary-hover); }

img { max-width: 100%; display: block; }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ── Typography ─────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.025em; color: var(--text); }
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
h3 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-weight: 600; }

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .875rem;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    letter-spacing: .01em;
    position: relative;
    overflow: hidden;
}
.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
}
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79,70,229,.3);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338CA, #6D28D9);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,.4);
}
.btn-accent {
    background: linear-gradient(135deg, var(--accent), #0891B2);
    color: #fff;
    box-shadow: 0 2px 8px rgba(6,182,212,.3);
}
.btn-accent:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-hover), #0E7490);
    transform: translateY(-1px);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 1px 3px rgba(220,38,38,.25);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover:not(:disabled) {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}
.btn-sm { padding: 6px 14px; font-size: .8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

/* ── Inputs ─────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: .85rem;
    color: var(--text-secondary);
    letter-spacing: .01em;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--text);
    transition: all var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 24px;
    transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.card-header h3 { margin: 0; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.badge-pending   { background: var(--warning-light); color: #92400E; }
.badge-preparing { background: var(--info-light); color: #0369A1; }
.badge-ready     { background: var(--accent-light); color: #065F46; }
.badge-served    { background: #E0E7FF; color: #3730A3; }
.badge-paid      { background: var(--accent-light); color: #065F46; }
.badge-unpaid    { background: var(--danger-light); color: #991B1B; }
.badge-available { background: var(--accent-light); color: #065F46; }
.badge-occupied  { background: var(--warning-light); color: #92400E; }
.badge-billing   { background: var(--info-light); color: #0369A1; }
.badge-cleaning  { background: var(--border-light); color: var(--text-secondary); }
.badge-owner     { background: #EDE9FE; color: #6D28D9; }
.badge-manager   { background: var(--info-light); color: #0369A1; }
.badge-waiter    { background: var(--accent-light); color: #065F46; }
.badge-kitchen   { background: var(--warning-light); color: #92400E; }
.badge-category  { background: var(--border-light); color: var(--text-secondary); font-size: .7rem; }

/* Status dot for badges */
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.badge-pending::before   { background: var(--warning); }
.badge-preparing::before { background: var(--info); }
.badge-ready::before     { background: var(--accent); }
.badge-served::before    { background: #6366F1; }
.badge-paid::before      { background: var(--accent); }
.badge-unpaid::before    { background: var(--danger); }
.badge-available::before { background: var(--accent); }
.badge-occupied::before  { background: var(--warning); }
.badge-billing::before   { background: var(--info); }
.badge-cleaning::before  { background: var(--text-muted); }
.badge-owner::before     { background: #7C3AED; }
.badge-manager::before   { background: var(--info); }
.badge-waiter::before    { background: var(--accent); }
.badge-kitchen::before   { background: var(--warning); }
.badge-category::before  { display: none; }

/* ── Navbar (Legacy) ────────────────────────────────── */
#main-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    height: 64px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}
.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}
.nav-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    letter-spacing: -0.02em;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
}
.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .85rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    letter-spacing: .01em;
}
.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.nav-links a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.nav-user-name {
    font-weight: 500;
    font-size: .875rem;
    color: var(--text-secondary);
}
.nav-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.nav-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ── Sidebar Layout (SaaS) ──────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 120;
    transition: transform var(--transition-slow), width var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
}
.app-sidebar.collapsed {
    width: var(--sidebar-collapsed);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.sidebar-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #F1F5F9;
    letter-spacing: -0.02em;
    transition: opacity var(--transition-fast);
}
.app-sidebar.collapsed .sidebar-title {
    opacity: 0;
    pointer-events: none;
    width: 0;
}
.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: .875rem;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.sidebar-link:hover {
    color: #E2E8F0;
    background: var(--sidebar-hover);
}
.sidebar-link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active);
    font-weight: 600;
}
.sidebar-link svg {
    flex-shrink: 0;
    opacity: .7;
}
.sidebar-link.active svg,
.sidebar-link:hover svg { opacity: 1; }
.sidebar-bottom {
    padding: 12px 10px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    transition: margin-left var(--transition-slow);
}
.app-layout:has(.app-sidebar.collapsed) .app-main {
    margin-left: var(--sidebar-collapsed);
}
.app-main-flush .page-container {
    padding: 0;
    max-width: none;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: var(--shadow-xs);
}
.topbar-toggle {
    display: flex;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-right: 16px;
}
.topbar-toggle:hover { border-color: var(--primary); color: var(--primary); }
.topbar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.topbar-restaurant {
    font-weight: 600;
    font-size: .875rem;
    color: var(--text);
}
.topbar-user {
    font-size: .82rem;
    color: var(--text-muted);
}
.topbar-title {
    font-weight: 600;
    font-size: .95rem;
    color: var(--text);
}

/* ── Page Layout ────────────────────────────────────── */
.page-container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 { margin: 0; }

/* ── Data Table ─────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}
.data-table th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    background: var(--bg-subtle);
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover td { background: var(--bg-subtle); }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Auth Pages ─────────────────────────────────────── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(37,99,235,.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(5,150,105,.05) 0%, transparent 50%);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 44px 40px;
    border: 1px solid var(--border-light);
}
.auth-card .nav-logo {
    width: 52px; height: 52px;
    font-size: 1.6rem;
    margin: 0 auto 20px;
}
.auth-card h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.5rem;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: .9rem;
}
.auth-card .btn { margin-top: 8px; }
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: .875rem;
    color: var(--text-muted);
}

/* ═══ DASHBOARD ═══════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 22px 24px;
    border: 1px solid var(--border-light);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .06em;
    margin-bottom: 10px;
}
.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.stat-card.blue::before { background: var(--primary-gradient); }
.stat-card.blue .stat-value { color: var(--primary); }
.stat-card.green::before { background: linear-gradient(90deg, #059669, #34D399); }
.stat-card.green .stat-value { color: #059669; }
.stat-card.purple::before { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.stat-card.purple .stat-value { color: #8B5CF6; }
.stat-card.yellow::before { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.stat-card.yellow .stat-value { color: var(--warning); }
.stat-card.cyan::before { background: linear-gradient(90deg, var(--accent), #22D3EE); }
.stat-card.cyan .stat-value { color: var(--accent); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.top-item:last-child { border: none; }
.top-item-rank {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius);
    font-size: .72rem;
    font-weight: 700;
}
.top-item-name { flex: 1; font-weight: 500; font-size: .9rem; }
.top-item-qty {
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 500;
}

/* ═══ POS ═════════════════════════════════════════════ */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
}
.pos-menu-panel {
    padding: 20px 24px;
    overflow-y: auto;
    background: var(--bg);
}
.pos-cart-panel {
    background: var(--card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
}
.pos-cart-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pos-cart-header h3 { margin: 0; }

/* Category tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.cat-tab {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--card);
    color: var(--text-muted);
    font-weight: 500;
    font-size: .82rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.cat-tab:hover { border-color: var(--primary); color: var(--primary); }
.cat-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(37,99,235,.25);
}

/* Menu grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
}
.menu-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.menu-item-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.menu-item-img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius);
}
.menu-item-img-placeholder {
    width: 100%;
    height: 90px;
    background: linear-gradient(135deg, var(--border-light), var(--border));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-item-name { font-weight: 600; font-size: .85rem; color: var(--text); line-height: 1.3; }
.menu-item-price { font-size: .8rem; color: var(--accent); font-weight: 700; }

/* Cart */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 22px;
}
.cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 500; font-size: .875rem; display: block; color: var(--text); }
.cart-item-price { font-size: .78rem; color: var(--text-muted); margin-top: 2px; display: block; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; }
.cart-item-qty { font-weight: 600; min-width: 24px; text-align: center; font-size: .9rem; }
.btn-qty {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.btn-qty:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-remove { border-color: var(--danger-light); color: var(--danger); }
.btn-remove:hover { background: var(--danger-light); border-color: var(--danger); }

.cart-footer {
    padding: 18px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.cart-total-label { font-weight: 600; font-size: 1rem; color: var(--text-secondary); }
#cart-total { font-weight: 700; font-size: 1.3rem; color: var(--primary); }
#cart-badge {
    background: var(--danger);
    color: #fff;
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-size: .7rem;
    font-weight: 700;
    margin-left: 6px;
}
#order-info { font-size: .82rem; color: var(--accent); font-weight: 500; margin-bottom: 8px; }
.cart-empty { text-align: center; padding: 48px 0; color: var(--text-muted); }

.pos-table-select {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-subtle);
}

/* ═══ KITCHEN ═════════════════════════════════════════ */
.kitchen-page {
    background: var(--kitchen-bg);
    color: var(--kitchen-text);
    min-height: calc(100vh - var(--topbar-height));
}
.kitchen-page #main-nav {
    background: var(--kitchen-card);
    border-color: var(--kitchen-border);
}
.kitchen-page .nav-title,
.kitchen-page .nav-user-name { color: var(--kitchen-text); }
.kitchen-page .nav-links a { color: #94A3B8; }
.kitchen-page .nav-links a:hover { color: #E2E8F0; background: rgba(255,255,255,.05); }
.kitchen-page .nav-links a.active { background: rgba(37,99,235,.15); color: #93C5FD; }
.kitchen-page .nav-toggle { border-color: var(--kitchen-border); color: #94A3B8; }

.kitchen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--kitchen-border);
}
.kitchen-header h2 { color: var(--kitchen-text); font-size: 1.25rem; }
#kitchen-clock {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: #A5B4FC;
    font-weight: 600;
    letter-spacing: .04em;
}

.kitchen-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px 28px;
    height: calc(100vh - var(--topbar-height) - 80px);
}
.kitchen-column {
    background: var(--kitchen-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--kitchen-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.kitchen-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--kitchen-border);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: .02em;
}
/* CSS status indicators replacing emojis */
.kitchen-column-header span:first-child { display: flex; align-items: center; gap: 8px; }
.kitchen-column-header span:first-child::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.col-pending .kitchen-column-header span:first-child::before { background: var(--danger); box-shadow: 0 0 6px rgba(220,38,38,.4); }
.col-preparing .kitchen-column-header span:first-child::before { background: var(--warning); box-shadow: 0 0 6px rgba(217,119,6,.4); }
.col-ready .kitchen-column-header span:first-child::before { background: var(--accent); box-shadow: 0 0 6px rgba(5,150,105,.4); }

.kitchen-count {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 700;
}
.col-pending .kitchen-count { background: rgba(220,38,38,.15); color: #FCA5A5; }
.col-preparing .kitchen-count { background: rgba(217,119,6,.15); color: #FCD34D; }
.col-ready .kitchen-count { background: rgba(5,150,105,.15); color: #6EE7B7; }

.kitchen-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kitchen-card {
    background: rgba(255,255,255,.04);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--kitchen-border);
    transition: all var(--transition);
}
.kitchen-card:hover { background: rgba(255,255,255,.06); }
.kitchen-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.kitchen-table { font-weight: 700; font-size: 1rem; }
.kitchen-order-id { color: var(--text-muted); font-size: .78rem; }
.kitchen-card-time {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.kitchen-elapsed { font-weight: 600; color: var(--warning); }
.kitchen-items {
    list-style: none;
    margin-bottom: 14px;
}
.kitchen-items li {
    padding: 5px 0;
    font-size: .875rem;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.kitchen-items li:last-child { border: none; }
.kitchen-qty {
    display: inline-block;
    width: 30px;
    font-weight: 700;
    color: #A5B4FC;
    font-size: .85rem;
}
.kitchen-empty { text-align: center; color: #475569; padding: 48px 0; }

.btn-kitchen-action {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: .01em;
}
.col-pending .btn-kitchen-action { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.col-preparing .btn-kitchen-action { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.3); }
.col-ready .btn-kitchen-action { background: #7C3AED; color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,.3); }
.btn-kitchen-action:hover { opacity: .9; transform: translateY(-1px); }

/* Urgency */
.urgency-warning { border-color: var(--warning) !important; }
.urgency-warning .kitchen-elapsed { color: var(--warning); }
.urgency-critical {
    border-color: var(--danger) !important;
    animation: pulse-danger 1.5s infinite;
}
.urgency-critical .kitchen-elapsed { color: var(--danger); }
@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.3); }
    50% { box-shadow: 0 0 0 6px rgba(220,38,38,0); }
}

/* ═══ TABLES ══════════════════════════════════════════ */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.table-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.table-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.table-number { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.table-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.table-available { border-color: var(--accent); }
.table-occupied { border-color: var(--warning); }
.table-billing { border-color: var(--primary); }
.table-cleaning { border-color: var(--text-muted); }

.add-table-form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.add-table-form .form-control { max-width: 140px; }

/* ═══ MENU MANAGEMENT ════════════════════════════════ */
.menu-manage-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    transition: all var(--transition);
}
.menu-manage-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
.menu-manage-info { display: flex; align-items: center; gap: 14px; }
.menu-manage-info > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.menu-manage-info h4 { margin: 0; font-size: .95rem; }
.menu-manage-price { font-weight: 700; color: var(--accent); font-size: .9rem; }
.menu-manage-actions { display: flex; align-items: center; gap: 10px; }

/* Menu item thumbnails */
.menu-manage-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}
.menu-manage-thumb-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--border-light), var(--border));
    flex-shrink: 0;
}

/* Image upload area */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    background: var(--bg-subtle);
}
.image-upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: .85rem;
}
.upload-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-light);
    border-radius: var(--radius);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.image-preview {
    position: relative;
    display: inline-block;
}
.image-preview img {
    max-height: 120px;
    border-radius: var(--radius);
    object-fit: cover;
}
.btn-remove-image {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    border: 2px solid var(--card);
    border-radius: 50%;
    font-size: .8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
}
.btn-remove-image:hover { background: var(--danger-hover); transform: scale(1.1); }

/* 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; inset: 0;
    background: var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
}
.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px; bottom: 3px;
    width: 18px; height: 18px;
    background: var(--card);
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: var(--shadow-xs);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ═══ BILLING ═════════════════════════════════════════ */
.billing-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.billing-order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}
.billing-order-card:hover { background: var(--primary-light); }
#bill-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 20px 0;
    letter-spacing: -0.01em;
}
#payment-buttons {
    display: none;
    gap: 10px;
    flex-wrap: wrap;
}
.payment-btn {
    flex: 1;
    min-width: 100px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    color: var(--text);
}
.payment-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    background: var(--primary-light);
}

/* ═══ STAFF ═══════════════════════════════════════════ */
.staff-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}
.staff-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    transition: all var(--transition);
}
.staff-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border); }
.staff-info h4 { margin: 0 0 3px; font-size: .95rem; }
.staff-info p { color: var(--text-muted); font-size: .82rem; margin: 0 0 6px; }
.staff-actions { display: flex; align-items: center; gap: 10px; }
.role-select {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .82rem;
    background: var(--card);
    color: var(--text);
}

/* ═══ MODAL ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15,23,42,.5);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 36px;
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--border-light);
    animation: modal-in .25s ease-out;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-card h2 { margin-bottom: 24px; font-size: 1.25rem; }

/* ═══ TOAST ═══════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .875rem;
    color: #fff;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateX(20px);
    transition: all var(--transition-slow);
    pointer-events: auto;
}
.toast-visible { opacity: 1; transform: translateX(0); }
.toast-info { background: var(--primary); }
.toast-success { background: var(--accent); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); color: #111; }

/* ═══ LOADING ═════════════════════════════════════════ */
#loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
}
#loading-overlay.active { display: flex; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ ANALYTICS ═══════════════════════════════════════ */
.analytics-range {
    display: flex;
    gap: 6px;
}
.range-btn {
    background: var(--card);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}
.range-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.analytics-card-wide {
    grid-column: 1 / -1;
}
.chart-container {
    position: relative;
    height: 280px;
    padding: 8px;
}

/* ═══ CUSTOMERS CRM ══════════════════════════════════ */
.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.stat-card.purple::before { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }
.stat-card.purple .stat-value { color: #7C3AED; }

/* ═══ QR ORDERING ════════════════════════════════════ */
.qr-page {
    background: var(--bg);
}
.qr-layout {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.qr-header {
    background: var(--card);
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.qr-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qr-brand h1 { font-size: 1.25rem; margin: 0; }
.qr-brand p { margin: 0; font-size: .82rem; }

.qr-categories {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    overflow-x: auto;
    background: var(--card);
    border-bottom: 1px solid var(--border-light);
    -webkit-overflow-scrolling: touch;
}
.qr-cat-btn {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--card);
    color: var(--text-muted);
    font-weight: 500;
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
.qr-cat-btn:hover { border-color: var(--primary); color: var(--primary); }
.qr-cat-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.qr-menu {
    flex: 1;
    padding: 16px 20px 120px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.qr-item-card {
    display: flex;
    gap: 12px;
    background: var(--card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all var(--transition-fast);
}
.qr-item-card:hover { box-shadow: var(--shadow-sm); }
.qr-item-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    flex-shrink: 0;
}
.qr-item-placeholder {
    background: linear-gradient(135deg, var(--border-light), var(--border));
}
.qr-item-info {
    flex: 1;
    padding: 12px 12px 12px 0;
    display: flex;
    flex-direction: column;
}
.qr-item-info h3 { font-size: .9rem; font-weight: 600; margin: 0 0 4px; }
.qr-item-info p { font-size: .78rem; margin: 0; line-height: 1.3; }
.qr-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
}
.qr-item-price { font-weight: 700; color: var(--primary); font-size: .9rem; }
.qr-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qr-qty-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    transition: all var(--transition-fast);
}
.qr-qty-btn:hover { background: var(--primary-light); border-color: var(--primary); }

.qr-cart-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 520px;
    background: var(--primary);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 12px rgba(0,0,0,.15);
    z-index: 50;
}
.qr-cart-info { display: flex; flex-direction: column; font-size: .85rem; }
.qr-cart-info span:first-child { font-weight: 500; }
.qr-cart-info span:last-child { font-weight: 700; font-size: 1rem; }
.qr-cart-bar .btn { background: #fff; color: var(--primary); font-weight: 600; }

.qr-cart-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}
.qr-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid var(--border);
}

.modal-card-lg { max-width: 540px; }

/* ── Badges (additional) ────────────────────────────── */
.badge-qr {
    background: var(--primary-light);
    color: var(--primary);
    font-size: .65rem;
    padding: 2px 6px;
    margin-left: 6px;
    vertical-align: middle;
}
.badge-qr::before { background: var(--primary); }
.badge-pos {
    background: var(--accent-light);
    color: #065F46;
    font-size: .65rem;
    padding: 2px 6px;
}
.badge-pos::before { background: var(--accent); }
.badge-cancelled { background: var(--danger-light); color: #991B1B; }
.badge-cancelled::before { background: var(--danger); }

/* Kitchen notes */
.kitchen-notes {
    font-size: .78rem;
    color: #FDE68A;
    background: rgba(245,158,11,.1);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border-left: 2px solid var(--warning);
}

/* ═══ RESPONSIVE ══════════════════════════════════════ */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .pos-layout { grid-template-columns: 1fr; height: auto; }
    .pos-cart-panel { height: auto; border-left: none; border-top: 1px solid var(--border); }
    .billing-layout { grid-template-columns: 1fr; }
    .staff-layout { grid-template-columns: 1fr; }
    .kitchen-board { grid-template-columns: 1fr; height: auto; }
}

@media (max-width: 768px) {
    /* Sidebar collapse on mobile */
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,.3);
    }
    .app-main {
        margin-left: 0;
    }
    .topbar-toggle {
        display: flex;
    }
    /* Overlay when sidebar open on mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 110;
    }
    .sidebar-overlay.active {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 8px;
        box-shadow: var(--shadow-md);
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .nav-user-name { display: none; }

    .page-container { padding: 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-value { font-size: 1.3rem; }

    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
    .menu-item-card { padding: 10px 8px; }
    .menu-item-img, .menu-item-img-placeholder { height: 70px; }

    .tables-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .menu-manage-card { flex-direction: column; align-items: stretch; gap: 12px; }
    .menu-manage-actions { justify-content: flex-end; }

    .staff-card { flex-direction: column; align-items: stretch; gap: 12px; }

    .kitchen-page .nav-links a { color: var(--kitchen-text); }
    .kitchen-page .nav-links { background: var(--kitchen-card); border-color: var(--kitchen-border); }
    .pos-cart-panel { height: auto; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stats-grid-3 { grid-template-columns: 1fr; }
    .auth-card { padding: 32px 24px; }
    .add-table-form { flex-direction: column; align-items: stretch; }
    .add-table-form .form-control { max-width: none; }
    .chart-container { height: 220px; }
}

/* ═══ SETTINGS ═════════════════════════════════════════ */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.settings-form small {
    margin-top: 4px;
    font-size: .78rem;
}
.settings-plan-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.plan-badge-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}
.badge-plan {
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    color: #fff;
    padding: 4px 14px;
    font-size: .78rem;
}
.badge-plan::before { display: none; }
.badge-qr {
    background: #FEF3C7;
    color: #92400E;
    font-size: .65rem;
    padding: 2px 6px;
    margin-left: 4px;
}
.badge-qr::before { display: none; }
.badge-pos { background: var(--primary-light); color: var(--primary); }
.badge-pos::before { display: none; }

/* ═══ SKELETON LOADING ═════════════════════════════════ */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 80%;
}
.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
    width: 60%;
}
.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
}

/* ═══ RECEIPT PRINT STYLES ═════════════════════════════ */
@media print {
    /* Hide everything except the bill */
    body * { visibility: hidden; }
    .print-receipt, .print-receipt * { visibility: visible; }
    .print-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
        padding: 8mm;
        font-family: 'Courier New', monospace;
        font-size: 12px;
        color: #000;
        background: #fff;
    }

    .print-receipt h2 {
        text-align: center;
        font-size: 16px;
        margin-bottom: 4px;
    }
    .print-receipt .receipt-subtitle {
        text-align: center;
        font-size: 10px;
        color: #666;
        margin-bottom: 10px;
    }
    .print-receipt hr {
        border: none;
        border-top: 1px dashed #000;
        margin: 6px 0;
    }
    .print-receipt table {
        width: 100%;
        border-collapse: collapse;
        margin: 4px 0;
    }
    .print-receipt th, .print-receipt td {
        text-align: left;
        padding: 2px 0;
        font-size: 11px;
    }
    .print-receipt th:last-child,
    .print-receipt td:last-child {
        text-align: right;
    }
    .print-receipt .receipt-totals {
        margin-top: 8px;
    }
    .print-receipt .receipt-totals div {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        padding: 2px 0;
    }
    .print-receipt .receipt-grand-total {
        font-weight: bold;
        font-size: 14px;
        border-top: 1px dashed #000;
        padding-top: 4px;
        margin-top: 4px;
    }
    .print-receipt .receipt-footer {
        text-align: center;
        font-size: 10px;
        color: #666;
        margin-top: 12px;
    }

    /* Remove nav, sidebar, buttons from print */
    .app-sidebar, .app-topbar, .no-print,
    button, select, .sidebar-overlay { display: none !important; }
}

/* ═══ NOTIFICATION BELL ════════════════════════════════ */
.notification-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    margin-right: 8px;
}
.notification-bell:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.notification-bell svg { display: block; }
.notification-count {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    padding: 0 4px;
    animation: notif-pulse 2s infinite;
}
@keyframes notif-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: none;
    z-index: 200;
}
.notification-dropdown.open { display: block; }
.notification-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: .85rem;
    color: var(--text);
}
.notification-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.notification-item:hover { background: var(--bg-subtle); }
.notification-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.notification-dot.pending { background: var(--warning); }
.notification-dot.new { background: var(--primary); }
.notification-text { flex: 1; font-size: .82rem; line-height: 1.4; }
.notification-time { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

/* ═══ EMPTY STATE ══════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}
.empty-state-icon {
    width: 72px; height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
    color: var(--primary);
}
.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.empty-state p {
    color: var(--text-muted);
    font-size: .875rem;
    max-width: 320px;
    line-height: 1.5;
}

/* ═══ SUBSCRIPTION PRICING ═════════════════════════════ */
.pricing-grid-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.price-card-inline {
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition);
}
.price-card-inline:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.price-card-inline.featured {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(79,70,229,.15);
    position: relative;
}
.price-card-inline.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: #fff;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.price-card-inline.current { border-color: var(--accent); }
.price-card-inline h3 { font-size: 1.15rem; margin-bottom: 8px; }
.price-amount-inline {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}
.price-amount-inline span {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.price-card-inline ul {
    list-style: none;
    margin-bottom: 20px;
    text-align: left;
}
.price-card-inline li {
    padding: 6px 0;
    font-size: .85rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 22px;
}
.price-card-inline li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* ═══ ENHANCED AUTH PAGES ══════════════════════════════ */
.auth-page {
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79,70,229,.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,.1) 0%, transparent 50%),
        linear-gradient(135deg, #0F172A 0%, #1E1B4B 50%, #0F172A 100%);
}
.auth-card {
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.2);
}
.auth-card .nav-logo {
    background: var(--primary-gradient);
    box-shadow: 0 4px 16px rgba(79,70,229,.3);
}

/* ═══ STAT ICON BACKGROUNDS ════════════════════════════ */
.stat-icon {
    width: 44px; height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
}
.stat-card.blue .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.green .stat-icon { background: var(--success-light); color: #059669; }
.stat-card.purple .stat-icon { background: var(--info-light); color: var(--info); }
.stat-card.yellow .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.cyan .stat-icon { background: var(--accent-light); color: var(--accent); }

/* ═══ PHASE 6: UI/UX POLISH ═══════════════════════════ */

/* ── Page Transition (fadeInUp) ────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page-container {
    animation: fadeInUp .4s cubic-bezier(.22,1,.36,1) both;
}

/* ── Button Press Micro-Interaction ─────────────────── */
.btn:active:not(:disabled),
.payment-btn:active,
.btn-kitchen-action:active,
.cat-tab:active,
.menu-item-card:active {
    transform: scale(0.97) !important;
    transition-duration: 60ms;
}

/* Ripple effect for primary buttons */
.btn-primary::after,
.btn-accent::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,.2) 10%, transparent 70%);
    opacity: 0;
    transition: opacity .3s;
}
.btn-primary:active::after,
.btn-accent:active::after {
    opacity: 1;
}

/* ── Enhanced Card Hover ────────────────────────────── */
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ── Shimmer Skeleton (Improved) ───────────────────── */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, #e2e8f0 37%, var(--border-light) 63%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
.skeleton-circle {
    width: 44px; height: 44px;
    border-radius: 50%;
}
.skeleton-stat {
    height: 80px;
    border-radius: var(--radius-lg);
}
.skeleton-chart {
    height: 200px;
    border-radius: var(--radius-lg);
}

/* ── Enhanced Toast (with icons) ───────────────────── */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    min-width: 280px;
    max-width: 420px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: .875rem;
    color: #fff;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(8px);
}
.toast-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
}

/* ── Kitchen Card Animations ────────────────────────── */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes newOrderGlow {
    0%   { box-shadow: 0 0 0 0 rgba(79,70,229,.4); }
    70%  { box-shadow: 0 0 0 10px rgba(79,70,229,0); }
    100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); }
}
.kitchen-card.new-order {
    animation: slideInLeft .4s cubic-bezier(.22,1,.36,1) both, newOrderGlow 1.5s ease-out;
}

/* ── Table Status Pulse ─────────────────────────────── */
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}
.badge-occupied::before {
    animation: statusPulse 2s ease-in-out infinite;
}

/* ── Form Focus Glow (Enhanced) ─────────────────────── */
.form-control:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow), 0 0 0 1px rgba(79,70,229,.1);
    outline: none;
}
.form-control {
    transition: border-color .2s ease, box-shadow .2s ease;
}

/* ── Stat Trend Indicators ──────────────────────────── */
.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .75rem;
    font-weight: 600;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.stat-trend.up {
    color: #059669;
    background: var(--success-light);
}
.stat-trend.down {
    color: var(--danger);
    background: var(--danger-light);
}
.stat-trend.neutral {
    color: var(--text-muted);
    background: var(--border-light);
}
.stat-trend-arrow {
    font-size: .85rem;
    line-height: 1;
}

/* ── Retry / Error State ────────────────────────────── */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}
.error-state-icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--danger-light);
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    color: var(--danger);
}
.error-state p {
    color: var(--text-muted);
    font-size: .875rem;
    margin-bottom: 16px;
    max-width: 300px;
}
.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .85rem;
    cursor: pointer;
    color: var(--primary);
    transition: all var(--transition);
}
.btn-retry:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}
.btn-retry svg {
    width: 16px; height: 16px;
}

/* ── Dashboard Chart Container ──────────────────────── */
.dashboard-chart-card {
    grid-column: 1 / -1;
}
.dashboard-chart-container {
    position: relative;
    height: 220px;
    padding: 8px;
}

/* ── Inventory (Used later in Phase 3) ─────────────── */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
}
.stock-ok      { background: var(--success-light); color: #059669; }
.stock-low     { background: var(--warning-light); color: #92400E; }
.stock-out     { background: var(--danger-light); color: #991B1B; }

/* ── GST Receipt (Used later in Phase 2) ───────────── */
.receipt-gst-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
    color: #555;
}
.receipt-gstin {
    text-align: center;
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
}

/* ── Low stock alert banner ────────────────────────── */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .875rem;
    font-weight: 500;
}
.alert-banner.warning {
    background: var(--warning-light);
    color: #92400E;
    border: 1px solid rgba(217,119,6,.2);
}
.alert-banner.danger {
    background: var(--danger-light);
    color: #991B1B;
    border: 1px solid rgba(220,38,38,.2);
}
.alert-banner svg {
    flex-shrink: 0;
    width: 20px; height: 20px;
}

/* ── Smooth number counter animation ───────────────── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-value.animate {
    animation: countUp .3s ease-out;
}

/* ── Notification bell animation on new ─────────────── */
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}
.notification-bell.has-new svg {
    animation: bellShake .6s ease-in-out;
}

/* ── Empty States & Onboarding ─────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--border);
    animation: float 3s ease-in-out infinite;
}
.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: .9rem;
    max-width: 400px;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Onboarding Tooltip */
.onboarding-tooltip {
    position: absolute;
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .85rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    max-width: 250px;
    animation: countUp .3s ease-out;
}
.onboarding-tooltip::after {
    content: '';
    position: absolute;
    border: 6px solid transparent;
}
.onboarding-tooltip.bottom::after {
    bottom: 100%;
    left: 20px;
    border-bottom-color: var(--primary);
}
.onboarding-tooltip .btn-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: .85rem;
    line-height: 1;
}

/* ── Retry / Error State ────────────────────────────── */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}
.error-state-icon {
    width: 56px; height: 56px;
    display: flex; align-items: center; justify-content: center;
    background: var(--danger-light);
    border-radius: var(--radius-xl);
    margin-bottom: 16px;
    color: var(--danger);
}
.error-state p {
    color: var(--text-muted);
    font-size: .875rem;
    margin-bottom: 16px;
    max-width: 300px;
}
.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .85rem;
    cursor: pointer;
    color: var(--primary);
    transition: all var(--transition);
}
.btn-retry:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}
.btn-retry svg {
    width: 16px; height: 16px;
}

/* ── Dashboard Chart Container ──────────────────────── */
.dashboard-chart-card {
    grid-column: 1 / -1;
}
.dashboard-chart-container {
    position: relative;
    height: 220px;
    padding: 8px;
}

/* ── Inventory (Used later in Phase 3) ─────────────── */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: .72rem;
    font-weight: 600;
}
.stock-ok      { background: var(--success-light); color: #059669; }
.stock-low     { background: var(--warning-light); color: #92400E; }
.stock-out     { background: var(--danger-light); color: #991B1B; }

/* ── GST Receipt (Used later in Phase 2) ───────────── */
.receipt-gst-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 2px 0;
    color: #555;
}
.receipt-gstin {
    text-align: center;
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
}

/* ── Low stock alert banner ────────────────────────── */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .875rem;
    font-weight: 500;
}
.alert-banner.warning {
    background: var(--warning-light);
    color: #92400E;
    border: 1px solid rgba(217,119,6,.2);
}
.alert-banner.danger {
    background: var(--danger-light);
    color: #991B1B;
    border: 1px solid rgba(220,38,38,.2);
}
.alert-banner svg {
    flex-shrink: 0;
    width: 20px; height: 20px;
}

/* ── Smooth number counter animation ───────────────── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-value.animate {
    animation: countUp .3s ease-out;
}

/* ── Notification bell animation on new ─────────────── */
@keyframes bellShake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}
.notification-bell.has-new svg {
    animation: bellShake .6s ease-in-out;
}

/* ── Empty States & Onboarding ─────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: var(--border);
    animation: float 3s ease-in-out infinite;
}
.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: .9rem;
    max-width: 400px;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Onboarding Tooltip */
.onboarding-tooltip {
    position: absolute;
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .85rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    max-width: 250px;
    animation: countUp .3s ease-out;
}
.onboarding-tooltip::after {
    content: '';
    position: absolute;
    border: 6px solid transparent;
}
.onboarding-tooltip.bottom::after {
    bottom: 100%;
    left: 20px;
    border-bottom-color: var(--primary);
}
.onboarding-tooltip .btn-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    float: right;
    cursor: pointer;
    margin-left: 10px;
}
.onboarding-tooltip .btn-close:hover { color: #fff; }
.onboarding-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,.6);
    z-index: 999;
    backdrop-filter: blur(2px);
    display: none;
}

/* ── Mobile Responsiveness ─────────────────────────── */
@media (max-width: 900px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .topbar-toggle {
        display: block;
    }
    .hide-mobile {
        display: none !important;
    }

    /* POS Mobile Sticky Cart */
    .pos-layout {
        grid-template-columns: 1fr;
        height: auto;
        padding-bottom: 80px; /* Space for sticky bar */
        overflow: visible;
    }
    .pos-menu-panel {
        height: auto;
        overflow: visible;
        padding: 16px 12px;
    }
    .pos-cart-panel {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 85vh;
        z-index: 1000;
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    }
    .pos-cart-panel.open {
        transform: translateY(0);
    }
    .mobile-cart-summary {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 70px;
        background: var(--card);
        border-top: 1px solid var(--border);
        z-index: 999;
        padding: 0 16px;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
        cursor: pointer;
    }
    .mobile-cart-summary.hidden {
        display: none;
    }
    .mobile-cart-details {
        display: flex;
        flex-direction: column;
    }
    .mobile-cart-btn {
        padding: 10px 24px;
        font-size: 1rem;
        border-radius: var(--radius-lg);
    }
}

/* ── Modals ─────────────────────────────────────────── */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}
.modal.active { opacity: 1; visibility: visible; }
.modal-content {
    background: var(--card);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal.active .modal-content { transform: translateY(0); }
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}


/* ── Tabs (Inventory/Global) ─────────────────── */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 12px;
}
.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .875rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.tab-btn:hover {
    color: var(--primary);
    background: var(--primary-light);
}
.tab-btn.active {
    color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(37,99,235,.1);
}
