/* ═══════════════════════════════════════════════════════════════════════════
   Patacón y Pescado — Design System (Flat Design)
   Colores Corporativos: Verde Esmeralda (#0cba55) + Fondos neutros limpios
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables: Light Theme (default) ── */
:root {
    /* Brand */
    --primary:        #0cba55;
    --primary-dark:   #089e47;
    --primary-light:  #d1fae5;
    --primary-text:   #ffffff;

    /* Status Colors */
    --status-pending:     #f59e0b;
    --status-pending-bg:  #fef3c7;
    --status-cooking:     #3b82f6;
    --status-cooking-bg:  #dbeafe;
    --status-ready:       #10b981;
    --status-ready-bg:    #d1fae5;
    --status-urgent:      #ef4444;
    --status-urgent-bg:   #fee2e2;
    --status-served:      #8b5cf6;
    --status-served-bg:   #ede9fe;

    /* Table Status */
    --table-libre:        #10b981;
    --table-ocupada:      #ef4444;
    --table-cuenta:       #f59e0b;
    --table-reservada:    #3b82f6;
    --table-limpieza:     #8b5cf6;

    /* Light Theme Surfaces */
    --bg:             #f4f6f8;
    --bg-surface:     #ffffff;
    --bg-elevated:    #f9fafb;
    --border:         #e2e8f0;
    --border-strong:  #cbd5e1;

    /* Typography */
    --text-primary:   #1b262c;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --text-inverse:   #ffffff;

    /* Shadows (flat design: subtle, no blur) */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:   0 2px 8px rgba(0,0,0,0.10);
    --shadow-lg:   0 4px 16px rgba(0,0,0,0.12);

    /* Radii */
    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;

    /* Transitions */
    --transition: 0.18s ease;

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sidebar */
    --sidebar-width: 256px;
    --sidebar-collapsed: 72px;
    --mobile-nav-height: 60px;
}

/* ── Dark Theme ── */
body.dark-theme {
    --bg:             #0a0e17;
    --bg-surface:     #121929;
    --bg-elevated:    #1a243b;
    --border:         #24324d;
    --border-strong:  #34466b;

    --text-primary:   #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --shadow-sm:   0 2px 6px rgba(0,0,0,0.4);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.5);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.65);

    --status-pending-bg:  rgba(251, 191, 36, 0.16);
    --status-cooking-bg:  rgba(96, 165, 250, 0.16);
    --status-ready-bg:    rgba(52, 211, 153, 0.16);
    --status-urgent-bg:   rgba(248, 113, 113, 0.16);
    --status-served-bg:   rgba(167, 139, 250, 0.16);
    --primary-light:      rgba(12, 186, 85, 0.16);

    --table-libre:        #34d399;
    --table-ocupada:      #f87171;
    --table-cuenta:       #fbbf24;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

::-webkit-scrollbar          { width: 6px; height: 6px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

html { font-size: 16px; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }
ul { list-style: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════════════════════ */
.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width var(--transition);
    z-index: 50;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 49;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 64px;
    position: relative;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    color: #fff;
}

.sidebar-logo i { width: 20px; height: 20px; }

.sidebar-brand {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
}

.sidebar-brand span {
    color: var(--primary);
}

.sidebar-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover { background: var(--bg); color: var(--text-primary); }
.sidebar-toggle i { width: 15px; height: 15px; }

/* User Section */
.sidebar-user {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info { overflow: hidden; flex: 1; }

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

.user-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.badge-super {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Superuser Role Switcher */
.su-switcher {
    margin-top: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px;
}

.su-switcher-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.su-roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.su-role-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 4px;
    text-align: center;
    transition: all var(--transition);
}

.su-role-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.su-role-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Nav */
.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 10px;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px 8px;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item { margin-bottom: 2px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.nav-link i { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link-text { overflow: hidden; text-overflow: ellipsis; }

.nav-link:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

body.dark-theme .nav-link.active {
    background: rgba(12,186,85,0.12);
    color: var(--primary);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg-surface);
    z-index: 10;
}

.sidebar-footer-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-footer-btn i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-footer-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.sidebar-footer-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.sidebar-footer-btn.danger {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.sidebar-footer-btn.danger:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #dc2626;
}

/* ─── Collapsed State ─── */
.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .user-info,
.sidebar.collapsed .su-switcher,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-link-text,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-footer-btn span {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    padding: 16px 10px;
    justify-content: center;
}
.sidebar.collapsed .sidebar-logo {
    margin: 0 auto;
    cursor: pointer;
}
.sidebar.collapsed .sidebar-toggle {
    display: none !important;
}
.sidebar.collapsed .sidebar-user   { padding: 12px 10px; }
.sidebar.collapsed .user-chip      { justify-content: center; }
.sidebar.collapsed .nav-link       { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer { 
    flex-direction: column; 
    gap: 8px; 
    align-items: center; 
    padding: 12px 8px;
}
.sidebar.collapsed .sidebar-footer-btn { 
    width: 38px; 
    height: 38px; 
    padding: 0; 
    border-radius: var(--radius-md); 
    justify-content: center; 
    align-items: center; 
    flex: none;
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.page-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ─── Mobile Topbar ─── */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: var(--mobile-nav-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 40;
}

.mobile-menu-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-title span { color: var(--primary); }

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

.page-header-left h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-header-left p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    outline: none;
}

.btn i { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text-primary); }

.btn-danger {
    background: #ef4444;
    color: #fff;
    border: 1px solid #ef4444;
}
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

.btn-warning {
    background: #f59e0b;
    color: #fff;
    border: 1px solid #f59e0b;
}
.btn-warning:hover { background: #d97706; }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-sm   { padding: 5px 10px; font-size: 0.8rem; }
.btn-lg   { padding: 11px 22px; font-size: 1rem; }
.btn-icon { padding: 8px; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i { color: var(--primary); width: 18px; height: 18px; }

.card-body { padding: 20px; }

/* ═══════════════════════════════════════════════════════════════════════════
   KPI Cards (Dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow var(--transition);
}

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

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

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon i { width: 20px; height: 20px; }

.kpi-icon.green  { background: var(--status-ready-bg);   color: var(--status-ready); }
.kpi-icon.blue   { background: var(--status-cooking-bg); color: var(--status-cooking); }
.kpi-icon.amber  { background: var(--status-pending-bg); color: var(--status-pending); }
.kpi-icon.red    { background: var(--status-urgent-bg);  color: var(--status-urgent); }
.kpi-icon.purple { background: var(--status-served-bg);  color: var(--status-served); }

.kpi-trend {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 99px;
}

.kpi-trend.up   { background: var(--status-ready-bg); color: var(--status-ready); }
.kpi-trend.down { background: var(--status-urgent-bg); color: var(--status-urgent); }

.kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1;
}

.kpi-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Charts Grid
   ═══════════════════════════════════════════════════════════════════════════ */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.charts-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-wrapper {
    position: relative;
    height: 260px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Table Map (Cajero / Mesero)
   ═══════════════════════════════════════════════════════════════════════════ */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.table-card {
    background: var(--bg-surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    user-select: none;
    position: relative;
}

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

.table-card.libre     { border-color: var(--table-libre); }
.table-card.ocupada   { border-color: var(--table-ocupada); }
.table-card.cuenta_solicitada { border-color: var(--table-cuenta); }
.table-card.reservada { border-color: var(--table-reservada); }
.table-card.limpieza  { border-color: var(--table-limpieza); }

.table-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
}

.table-icon.libre     { background: var(--table-libre); }
.table-icon.ocupada   { background: var(--table-ocupada); }
.table-icon.cuenta_solicitada { background: var(--table-cuenta); }
.table-icon.reservada { background: var(--table-reservada); }
.table-icon.limpieza  { background: var(--table-limpieza); }

.table-number {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-section {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.table-total {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.table-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-status-badge.libre   { background: var(--status-ready-bg); color: var(--status-ready); }
.table-status-badge.ocupada { background: var(--status-urgent-bg); color: var(--status-urgent); }
.table-status-badge.cuenta_solicitada { background: var(--status-pending-bg); color: var(--status-pending); }

/* ═══════════════════════════════════════════════════════════════════════════
   Kitchen Display (KDS)
   ═══════════════════════════════════════════════════════════════════════════ */
.kds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    align-items: start;
}

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

.kds-card.urgente     { border-color: var(--status-urgent); }
.kds-card.en_cocina   { border-color: var(--status-cooking); }
.kds-card.pendiente   { border-color: var(--status-pending); }
.kds-card.listo       { border-color: var(--status-ready); }

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

.kds-header.urgente     { background: var(--status-urgent-bg); }
.kds-header.en_cocina   { background: var(--status-cooking-bg); }
.kds-header.pendiente   { background: var(--status-pending-bg); }
.kds-header.listo       { background: var(--status-ready-bg); }

.kds-table-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kds-timer {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    font-variant-numeric: tabular-nums;
}

.kds-timer.ok     { background: var(--status-ready-bg);   color: var(--status-ready); }
.kds-timer.warn   { background: var(--status-pending-bg); color: var(--status-pending); }
.kds-timer.danger { background: var(--status-urgent-bg);  color: var(--status-urgent); }

.kds-items { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }

.kds-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.kds-item.preparando { border-color: var(--status-cooking); background: var(--status-cooking-bg); }
.kds-item.listo      { border-color: var(--status-ready);   background: var(--status-ready-bg); opacity: 0.8; }

.kds-item-qty {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kds-item-name {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kds-item-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kds-item-status-btn {
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 3px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all var(--transition);
}

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

.kds-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
}

.kds-waiter {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Order Panel / Ticket (Mesero)
   ═══════════════════════════════════════════════════════════════════════════ */
.order-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    overflow: hidden;
}

.order-items-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }

.order-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: slideIn 0.2s ease;
}

.order-item-name { flex: 1; font-size: 0.875rem; font-weight: 500; color: var(--text-primary); }
.order-item-price { font-size: 0.85rem; color: var(--primary); font-weight: 600; }

.qty-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.qty-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    transition: all var(--transition);
}

.qty-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.qty-display { font-size: 0.85rem; font-weight: 700; min-width: 18px; text-align: center; }

.order-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.order-total-amount { color: var(--primary); font-size: 1.4rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   Menu Catalog (Mesero)
   ═══════════════════════════════════════════════════════════════════════════ */
.menu-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    scrollbar-width: none;
}

.menu-tabs::-webkit-scrollbar { display: none; }

.menu-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition);
    flex-shrink: 0;
}

.menu-tab-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }

.menu-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

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

.menu-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); transform: translateY(-1px); }
.menu-item-card:active { transform: translateY(0); }

.menu-item-card.unavailable { opacity: 0.45; cursor: not-allowed; }
.menu-item-card.unavailable:hover { transform: none; box-shadow: none; border-color: var(--border); }

.menu-item-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
.menu-item-desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.menu-item-price { font-size: 1rem; font-weight: 700; color: var(--primary); margin-top: 2px; }

.menu-item-add-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    align-self: flex-end;
    transition: all var(--transition);
}

.menu-item-add-btn:hover { background: var(--primary-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   Payment Modal (Cajero)
   ═══════════════════════════════════════════════════════════════════════════ */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.payment-method-btn i { width: 22px; height: 22px; }
.payment-method-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.payment-method-btn.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.875rem;
}

.bill-row:last-child { border-bottom: none; }
.bill-label { color: var(--text-secondary); }
.bill-value { font-weight: 600; color: var(--text-primary); }
.bill-row.total .bill-label { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.bill-row.total .bill-value { font-size: 1.25rem; font-weight: 800; color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   Forms & Inputs
   ═══════════════════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(12,186,85,0.15);
}

.form-control::placeholder { color: var(--text-muted); }

body.dark-theme .form-control {
    background: var(--bg-elevated);
}

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 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

body.dark-theme select.form-control { color-scheme: dark; }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 7px 12px;
    transition: border-color var(--transition);
}

.search-box:focus-within { border-color: var(--primary); }
.search-box i { color: var(--text-muted); width: 16px; height: 16px; flex-shrink: 0; }
.search-box input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tables (Data & Responsive)
   ═══════════════════════════════════════════════════════════════════════════ */
.data-table-wrapper,
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.data-table,
.table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

.data-table th,
.table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table td,
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

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

.data-table tbody tr,
.table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background: var(--bg-elevated);
}

.table.table-compact th,
.table.table-compact td {
    padding: 8px 12px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Badges & Status
   ═══════════════════════════════════════════════════════════════════════════ */
.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    line-height: 1.2;
    white-space: nowrap;
}

.badge-pending,
.status-badge.pending,
.status-badge.warning {
    background: var(--status-pending-bg);
    color: var(--status-pending);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-cooking,
.status-badge.cooking,
.status-badge.info {
    background: var(--status-cooking-bg);
    color: var(--status-cooking);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-ready,
.badge-success,
.status-badge.ready,
.status-badge.success {
    background: var(--status-ready-bg);
    color: var(--status-ready);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-urgent,
.badge-danger,
.status-badge.urgent,
.status-badge.danger {
    background: var(--status-urgent-bg);
    color: var(--status-urgent);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-served {
    background: var(--status-served-bg);
    color: var(--status-served);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-neutral {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tabs Component
   ═══════════════════════════════════════════════════════════════════════════ */
.tabs-container {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn,
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.tab-btn:hover,
.tab-link:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.tab-btn.active,
.tab-link.active {
    background: var(--primary);
    color: #ffffff !important;
    border-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(12, 186, 85, 0.25);
}

.tab-badge {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
    padding: 2px 6px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Modals
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    padding: 16px;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title i { color: var(--primary); width: 20px; height: 20px; }

.modal-close {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover { background: var(--status-urgent-bg); color: var(--status-urgent); border-color: var(--status-urgent); }
.modal-close i { width: 15px; height: 15px; }

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.modal-lg { max-width: 740px; }
.modal-sm { max-width: 380px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Toasts
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 9999;
    max-width: 340px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease forwards;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    border-left: 4px solid var(--border);
}

.toast.success { border-left-color: var(--status-ready); }
.toast.error   { border-left-color: var(--status-urgent); }
.toast.warning { border-left-color: var(--status-pending); }
.toast.info    { border-left-color: var(--status-cooking); }

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.success .toast-icon { color: var(--status-ready); }
.toast.error   .toast-icon { color: var(--status-urgent); }
.toast.warning .toast-icon { color: var(--status-pending); }
.toast.info    .toast-icon { color: var(--status-cooking); }

.toast.hide { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Empty State
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-icon i { width: 28px; height: 28px; color: var(--text-muted); }
.empty-state h3     { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p      { font-size: 0.875rem; max-width: 300px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Toggle Switch
   ═══════════════════════════════════════════════════════════════════════════ */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

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

.switch-slider {
    position: absolute;
    inset: 0;
    background: var(--border-strong);
    border-radius: 99px;
    cursor: pointer;
    transition: all var(--transition);
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all var(--transition);
}

.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ═══════════════════════════════════════════════════════════════════════════
   Loading Spinner
   ═══════════════════════════════════════════════════════════════════════════ */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.loading-overlay.active { opacity: 1; pointer-events: all; }

.loading-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
}

.loading-box p { font-size: 0.9rem; color: var(--text-secondary); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

.animate-fade   { animation: fadeIn 0.3s ease; }
.animate-slide  { animation: slideIn 0.25s ease; }
.animate-pulse  { animation: pulse 1.8s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════════════════════ */
.d-flex          { display: flex; }
.flex-col        { flex-direction: column; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.flex-1          { flex: 1; }
.flex-wrap       { flex-wrap: wrap; }
.gap-1           { gap: 4px; }
.gap-2           { gap: 8px; }
.gap-3           { gap: 12px; }
.gap-4           { gap: 16px; }
.gap-6           { gap: 24px; }
.w-full          { width: 100%; }
.h-full          { height: 100%; }
.overflow-auto   { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.text-muted      { color: var(--text-muted); }
.text-primary    { color: var(--primary); }
.text-danger     { color: var(--status-urgent); }
.text-success    { color: var(--status-ready); }
.text-warning    { color: var(--status-pending); }
.fw-500          { font-weight: 500; }
.fw-600          { font-weight: 600; }
.fw-700          { font-weight: 700; }
.fs-sm           { font-size: 0.8rem; }
.fs-xs           { font-size: 0.72rem; }
.mt-1            { margin-top: 4px; }
.mt-2            { margin-top: 8px; }
.mt-3            { margin-top: 12px; }
.mt-4            { margin-top: 16px; }
.mb-2            { margin-bottom: 8px; }
.mb-3            { margin-bottom: 12px; }
.mb-4            { margin-bottom: 16px; }
.p-0             { padding: 0; }
.hidden          { display: none !important; }
.divider         { height: 1px; background: var(--border); margin: 12px 0; }

/* Scrollable containers */
.scroll-y { overflow-y: auto; }
.scroll-x { overflow-x: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   Login Page
   ═══════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.login-logo-icon i { width: 26px; height: 26px; }

.login-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.login-title span { color: var(--primary); }

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.login-error {
    background: var(--status-urgent-bg);
    border: 1px solid var(--status-urgent);
    color: var(--status-urgent);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 14px;
    display: none;
}

.login-error.show { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive: Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .charts-grid     { grid-template-columns: 1fr; }
    .charts-grid-3   { grid-template-columns: 1fr 1fr; }
    .kpi-grid        { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive: Mobile (≤ 768px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Show mobile topbar, hide sidebar */
    .mobile-topbar { display: flex; }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 50;
        width: var(--sidebar-width) !important;
    }

    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }

    .main-content { padding-top: 0; }
    .page-body { padding: 16px; }

    .kpi-grid        { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .charts-grid     { grid-template-columns: 1fr; }
    .charts-grid-3   { grid-template-columns: 1fr; }
    .tables-grid     { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
    .kds-grid        { grid-template-columns: 1fr; }
    .menu-items-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

    .page-header     { flex-direction: column; align-items: flex-start; }
    .payment-methods { grid-template-columns: repeat(3, 1fr); }

    .modal        { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
    .modal-overlay { align-items: flex-end; padding: 0; }

    /* Hide some sidebar text in collapsed states */
    .sidebar.collapsed { width: var(--sidebar-collapsed) !important; }
}

@media (max-width: 480px) {
    .kpi-grid      { grid-template-columns: 1fr 1fr; }
    .kpi-value     { font-size: 1.4rem; }
    .page-body     { padding: 12px; }
    .btn-sm-hide   { display: none; }
}
