/* ─── Restaurante CrewCore — Design System ─── */

/* ── Tokens ── */
:root {
    /* Primary Palette — Warm amber/gold for hospitality */
    --primary: #f59e0b;
    --primary-hover: #d97706;
    --primary-light: rgba(245, 158, 11, 0.12);
    --primary-glow: rgba(245, 158, 11, 0.25);

    /* Semantic */
    --success: #22c55e;
    --success-light: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.12);

    /* Surfaces — Dark premium theme */
    --bg: #0f0f0f;
    --bg-elevated: #141414;
    --surface: #1a1a1a;
    --surface-hover: #222222;
    --surface-border: #2a2a2a;
    --card: #1e1e1e;

    /* Text — High contrast for readability */
    --text: #f5f5f5;
    --text-secondary: #b8b8b8;
    --text-muted: #888888;

    /* Order status colors */
    --status-libre: #22c55e;
    --status-ocupada: #ef4444;
    --status-reservada: #3b82f6;
    --status-bloqueada: #6b7280;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Gradients */
    --gradient-dark: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    --gradient-primary: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-card: linear-gradient(160deg, #1e1e1e 0%, #161616 100%);

    /* Transitions */
    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-elevated);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: width var(--transition-slow);
}

.sidebar-brand {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

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

.sidebar-brand-text small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-md);
    overflow-y: auto;
}

.nav-section {
    margin-bottom: var(--space-lg);
}

.nav-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: var(--space-sm) var(--space-md);
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 10px var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

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

.nav-item i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.sidebar-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--surface-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
}

.page-header {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.page-body {
    padding: var(--space-xl);
}

/* ── Cards ── */
.card {
    background: var(--card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
}

.card:hover {
    border-color: rgba(255,255,255,0.08);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--surface-border);
}

/* ── Stat Cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    transition: all var(--transition);
}

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

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

.stat-icon.blue   { background: var(--info-light); color: var(--info); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.amber  { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-trend {
    font-size: 0.75rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn i { width: 18px; height: 18px; }

.btn-primary {
    background: var(--gradient-primary);
    color: #000;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-glow); color: #000; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--surface-border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.1); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--surface-border);
}
.btn-outline:hover { background: var(--surface-hover); border-color: rgba(255,255,255,0.15); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Forms ── */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

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

.form-textarea { min-height: 100px; resize: vertical; }

.form-select {
    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='%23666' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-icon-wrapper .form-input {
    padding-left: 40px;
}

/* ── Tables ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--surface-border);
}

.data-table td {
    padding: 14px var(--space-md);
    border-bottom: 1px solid var(--surface-border);
    font-size: 0.9rem;
    color: var(--text);
}

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

.data-table tbody tr:hover {
    background: var(--surface-hover);
}

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light); color: var(--danger); }
.badge-info    { background: var(--info-light); color: var(--info); }
.badge-neutral { background: rgba(255,255,255,0.06); color: var(--text-muted); }

/* ── Modal ── */
/* Override Bootstrap's .modal defaults to prevent conflicts */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

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

.modal-overlay .modal {
    /* Reset ALL Bootstrap .modal defaults */
    display: block !important;
    position: relative !important;
    inset: auto !important;
    padding: 0 !important;
    overflow-y: auto;
    /* Our custom styles */
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition);
}

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

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

.modal-title { font-size: 1.1rem; font-weight: 700; }

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

.modal-close:hover { background: var(--surface-hover); color: var(--text); }

.modal-body { padding: var(--space-lg); }
.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--surface-border);
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* ── Toast ── */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--info); }

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

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state i {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.9rem;
    margin-top: var(--space-sm);
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 60;
    }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .page-body { padding: var(--space-md); }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .stat-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: var(--space-md); }
}

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.font-mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Product Grid (for POS & Products page) ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
}

.product-card-mini {
    background: var(--card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}

.product-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.product-card-mini .product-img {
    height: 120px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-mini .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-card-mini .product-info {
    padding: var(--space-md);
}

.product-card-mini .product-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-card-mini .product-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

/* ── Category Tabs ── */
.category-tabs {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-tab {
    padding: 8px 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--surface-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    font-family: var(--font-body);
}

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

/* ── Kitchen Cards ── */
.kitchen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}

.kitchen-card {
    background: var(--card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeIn 0.3s ease-out;
}

.kitchen-card.urgent {
    border-color: var(--danger);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.kitchen-card-header {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--surface-border);
}

.kitchen-card-items {
    padding: var(--space-md) var(--space-lg);
}

.kitchen-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

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

.kitchen-item-qty {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.kitchen-card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--surface-border);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── POS Layout ── */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: calc(100vh - var(--header-height));
    gap: 0;
}

.pos-products {
    padding: var(--space-lg);
    overflow-y: auto;
}

.pos-sidebar {
    background: var(--bg-elevated);
    border-left: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
}

.pos-order-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-md);
}

.pos-order-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--surface-border);
}

.pos-order-item-info { flex: 1; }

.pos-order-item-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.pos-order-item-price {
    font-weight: 700;
    color: var(--primary);
}

.pos-order-item-mods {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.pos-total-bar {
    padding: var(--space-lg);
    border-top: 1px solid var(--surface-border);
    background: var(--surface);
}

.pos-total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
}

.pos-total-line.grand {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--surface-border);
}

/* ── Table Map ── */
.table-map {
    position: relative;
    min-height: 500px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-item {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-weight: 700;
    border: 2px solid transparent;
}

.table-item.round { border-radius: 50%; }

.table-item.libre { background: rgba(34, 197, 94, 0.15); border-color: var(--status-libre); color: var(--status-libre); }
.table-item.ocupada { background: rgba(239, 68, 68, 0.15); border-color: var(--status-ocupada); color: var(--status-ocupada); }
.table-item.reservada { background: rgba(59, 130, 246, 0.15); border-color: var(--status-reservada); color: var(--status-reservada); }
.table-item.bloqueada { background: rgba(107, 114, 128, 0.15); border-color: var(--status-bloqueada); color: var(--status-bloqueada); }

.table-item:hover { transform: scale(1.1); box-shadow: var(--shadow-md); }

.table-number { font-size: 1.2rem; }
.table-people { font-size: 0.65rem; font-weight: 500; opacity: 0.7; }

/* ── Loading ── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--surface-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ── Mobile sidebar toggle ── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-sm);
}

@media (max-width: 991px) {
    .mobile-menu-btn { display: block; }
    .pos-layout { grid-template-columns: 1fr; }
    .pos-sidebar {
        position: fixed;
        right: -100%;
        top: 0;
        bottom: 0;
        width: 380px;
        z-index: 55;
        transition: right var(--transition-slow);
    }
    .pos-sidebar.open { right: 0; }
}

/* ── Theme Toggle Button ── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--surface-border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--primary);
}

/* ── Light Mode ── */
[data-theme="light"] {
    --primary: #d97706;
    --primary-hover: #b45309;
    --primary-light: rgba(217, 119, 6, 0.1);
    --primary-glow: rgba(217, 119, 6, 0.2);

    --bg: #f5f5f7;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-hover: #f0f0f2;
    --surface-border: #e2e2e8;
    --card: #ffffff;

    --text: #1a1a2e;
    --text-secondary: #4a4a5e;
    --text-muted: #8888a0;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-glow: 0 0 20px rgba(217,119,6,0.15);

    --gradient-dark: linear-gradient(135deg, #f5f5f7 0%, #e8e8ee 100%);
    --gradient-card: linear-gradient(160deg, #ffffff 0%, #fafafa 100%);
}

[data-theme="light"] .sidebar {
    background: #ffffff;
}

[data-theme="light"] .btn-primary {
    color: #fff;
}

[data-theme="light"] .data-table th {
    color: var(--text-muted);
}

[data-theme="light"] .data-table td {
    color: var(--text);
}

[data-theme="light"] .badge-neutral {
    background: rgba(0,0,0,0.05);
    color: var(--text-muted);
}

[data-theme="light"] ::placeholder {
    color: #aaa !important;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
    background: #f8f8fa;
    border-color: #e2e2e8;
    color: var(--text);
}

[data-theme="light"] .modal-overlay .modal {
    background: #ffffff;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #d0d0d8;
}
