/* ============================================================
   ALTECH DINE - Global Stylesheet
   Altech Sphere Solutions Ltd.
   Primary: Navy Blue | Accent: Green
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
    --navy:          #0f1f3d;
    --navy-dark:     #080f1e;
    --navy-mid:      #162447;
    --navy-light:    #1e3a5f;
    --navy-soft:     #243b6e;

    --green:         #16a34a;
    --green-light:   #22c55e;
    --green-dark:    #15803d;
    --green-soft:    #dcfce7;
    --green-glow:    rgba(22,163,74,0.15);

    --white:         #ffffff;
    --gray-50:       #f8fafc;
    --gray-100:      #f1f5f9;
    --gray-200:      #e2e8f0;
    --gray-300:      #cbd5e1;
    --gray-400:      #94a3b8;
    --gray-500:      #64748b;
    --gray-600:      #475569;
    --gray-700:      #334155;
    --gray-800:      #1e293b;
    --gray-900:      #0f172a;

    --red:           #dc2626;
    --orange:        #ea580c;
    --yellow:        #ca8a04;
    --blue:          #2563eb;
    --purple:        #7c3aed;

    --sidebar-w:     260px;
    --sidebar-w-col: 72px;
    --topbar-h:      64px;

    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     16px;
    --radius-xl:     24px;

    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:        0 4px 12px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.08);
    --shadow-lg:     0 10px 30px rgba(0,0,0,.15), 0 4px 10px rgba(0,0,0,.10);
    --shadow-navy:   0 4px 20px rgba(15,31,61,.35);

    --font:          'Plus Jakarta Sans', sans-serif;
    --font-mono:     'JetBrains Mono', monospace;

    --transition:    all .18s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-soft); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
    position: relative;
    overflow: hidden;
}
.auth-body::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(22,163,74,.1) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 20%, rgba(37,99,235,.08) 0%, transparent 50%);
    pointer-events: none;
}
.auth-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 460px;
    padding: 48px 40px;
    position: relative;
    z-index: 1;
}
.auth-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}
.auth-logo-icon {
    width: 44px; height: 44px;
    background: var(--navy);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.auth-logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
}
.auth-logo span { color: var(--green); }
.auth-title { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.auth-subtitle { color: var(--gray-500); font-size: 0.9rem; margin-bottom: 28px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--navy-soft);
    box-shadow: 0 0 0 3px rgba(15,31,61,.08);
}
.form-control.is-invalid { border-color: var(--red); }
.form-control::placeholder { color: var(--gray-400); }
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.input-group { position: relative; }
.input-icon {
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 16px;
}
.input-group .form-control { padding-left: 40px; }
.input-group-end { right: 12px; left: auto; cursor: pointer; }
.form-text { font-size: 0.78rem; color: var(--gray-500); margin-top: 4px; }
.invalid-feedback { font-size: 0.78rem; color: var(--red); margin-top: 4px; display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
    background: var(--green);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(22,163,74,.3);
}
.btn-primary:hover:not(:disabled) {
    background: var(--green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22,163,74,.4);
    color: var(--white);
}
.btn-navy {
    background: var(--navy);
    color: var(--white);
    box-shadow: var(--shadow-navy);
}
.btn-navy:hover:not(:disabled) {
    background: var(--navy-mid);
    transform: translateY(-1px);
    color: var(--white);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-700);
}
.btn-outline:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.btn-outline-green {
    background: transparent;
    border: 1.5px solid var(--green);
    color: var(--green);
}
.btn-outline-green:hover:not(:disabled) { background: var(--green); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; color: var(--white); transform: translateY(-1px); }
.btn-warning { background: var(--yellow); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ============================================================
   ALERTS & BADGES
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}
.alert-success { background: var(--green-soft); color: var(--green-dark); border-left: 3px solid var(--green); }
.alert-danger  { background: #fee2e2; color: var(--red); border-left: 3px solid var(--red); }
.alert-warning { background: #fef9c3; color: var(--yellow); border-left: 3px solid var(--yellow); }
.alert-info    { background: #dbeafe; color: var(--blue); border-left: 3px solid var(--blue); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success { background: var(--green-soft); color: var(--green-dark); }
.badge-danger  { background: #fee2e2; color: var(--red); }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-navy    { background: var(--navy); color: var(--white); }
.badge-dot::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ============================================================
   SIDEBAR LAYOUT
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--navy-dark);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    transition: width .25s ease;
    overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-w-col); }

.sidebar-header {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    gap: 12px;
    flex-shrink: 0;
}
.sidebar-logo-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    background: var(--green);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
}
.sidebar-logo-text {
    font-weight: 800;
    font-size: 1rem;
    color: white;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.sidebar-logo-text span { color: var(--green-light); }
.sidebar.collapsed .sidebar-logo-text { display: none; }

.sidebar-toggle {
    margin-left: auto;
    background: none; border: none;
    color: var(--gray-400);
    cursor: pointer; padding: 4px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.sidebar-toggle:hover { color: white; background: rgba(255,255,255,.08); }

/* Sidebar tenant info */
.sidebar-tenant {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    overflow: hidden;
}
.sidebar-tenant-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-tenant-plan {
    font-size: 0.7rem;
    color: var(--green-light);
    font-weight: 500;
}
.sidebar.collapsed .sidebar-tenant { display: none; }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section-label {
    padding: 6px 16px 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gray-500);
    text-transform: uppercase;
    white-space: nowrap;
}
.sidebar.collapsed .nav-section-label { opacity: 0; height: 0; overflow: hidden; padding: 0; }

.nav-item { margin: 1px 8px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px;
    border-radius: var(--radius);
    color: var(--gray-400);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}
.nav-link:hover { color: white; background: rgba(255,255,255,.07); }
.nav-link.active { color: white; background: var(--green); box-shadow: 0 2px 8px rgba(22,163,74,.35); }
.nav-link .nav-icon { font-size: 18px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-link .nav-label { flex: 1; }
.sidebar.collapsed .nav-label { display: none; }
.nav-link .nav-badge {
    background: var(--green);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 99px;
    min-width: 18px;
    text-align: center;
}
.sidebar.collapsed .nav-badge { position: absolute; top: 4px; right: 4px; padding: 2px 4px; font-size: 0.6rem; }

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 12px 8px;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}
.sidebar-user:hover { background: rgba(255,255,255,.07); }
.sidebar-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--navy-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: var(--green-light);
    flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-size: 0.82rem; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.7rem; color: var(--gray-500); }
.sidebar.collapsed .sidebar-user-info { display: none; }

/* ── Main Content ── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .25s ease;
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-w-col); }

/* Topbar */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky; top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
    background: none; border: none;
    width: 38px; height: 38px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-size: 18px;
}
.topbar-btn:hover { background: var(--gray-100); color: var(--navy); }
.topbar-notif-count {
    position: absolute; top: 4px; right: 4px;
    background: var(--red); color: white;
    font-size: 0.6rem; font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 99px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 3px;
}

/* Page Content */
.page-content { flex: 1; padding: 28px 24px; }
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header-left {}
.page-header h2 { font-size: 1.35rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; }
.page-header p  { color: var(--gray-500); font-size: 0.88rem; margin-top: 2px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--gray-400); margin-bottom: 4px; }
.breadcrumb a { color: var(--gray-400); }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb-sep { color: var(--gray-300); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}
.card-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
    width: 46px; height: 46px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.navy  { background: rgba(15,31,61,.08); color: var(--navy); }
.stat-icon.orange{ background: #fff7ed; color: var(--orange); }
.stat-icon.blue  { background: #dbeafe; color: var(--blue); }
.stat-icon.purple{ background: #ede9fe; color: var(--purple); }
.stat-icon.red   { background: #fee2e2; color: var(--red); }
.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); letter-spacing: -0.03em; line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--gray-500); margin-top: 2px; font-weight: 500; }
.stat-change { font-size: 0.75rem; font-weight: 600; margin-top: 6px; display: flex; align-items: center; gap: 3px; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray-500);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}
tbody td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
    vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
.table-actions { display: flex; gap: 6px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(8,15,30,.55);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(.98);
    transition: transform .2s ease;
}
.modal-overlay.open .modal { transform: none; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.modal-close {
    background: none; border: none;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); cursor: pointer; font-size: 18px;
    transition: var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   GRIDS
   ============================================================ */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ============================================================
   TABLES STATUS / ORDER COLORS
   ============================================================ */
.status-available { color: var(--green); }
.status-occupied  { color: var(--red); }
.status-reserved  { color: var(--yellow); }
.status-cleaning  { color: var(--orange); }
.status-pending   { color: var(--yellow); }
.status-preparing { color: var(--blue); }
.status-ready     { color: var(--green); }
.status-served    { color: var(--gray-600); }
.status-completed { color: var(--gray-500); }
.status-cancelled { color: var(--red); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--gray-500); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ============================================================
   KITCHEN DISPLAY
   ============================================================ */
.kds-body { background: var(--gray-900); min-height: 100vh; }
.kds-topbar {
    background: var(--navy-dark);
    padding: 0 20px;
    height: 56px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px solid var(--navy-soft);
}
.kds-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    padding: 16px;
}
.kds-card {
    background: var(--gray-800);
    border-radius: var(--radius-lg);
    border: 2px solid var(--gray-700);
    overflow: hidden;
    transition: var(--transition);
}
.kds-card.priority-high { border-color: var(--red); }
.kds-card.priority-normal { border-color: var(--navy-soft); }
.kds-card-header {
    padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.78rem; font-weight: 700;
}
.kds-timer { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; }
.kds-timer.warning { color: var(--yellow); }
.kds-timer.danger  { color: var(--red); animation: pulse 1s infinite; }
.kds-item { padding: 8px 14px; border-top: 1px solid var(--gray-700); display: flex; align-items: center; gap: 10px; }
.kds-item-name { flex: 1; color: var(--white); font-size: 0.88rem; font-weight: 500; }
.kds-item-qty { color: var(--green-light); font-weight: 700; font-size: 0.88rem; }
.kds-actions { padding: 12px 14px; border-top: 2px solid var(--gray-700); display: flex; gap: 8px; }

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

/* ============================================================
   TABLE LAYOUT MAP
   ============================================================ */
.table-map {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    min-height: 400px;
    position: relative;
    overflow: hidden;
}
.table-item {
    position: absolute;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
    color: white;
    border-radius: var(--radius);
    user-select: none;
}
.table-item:hover { transform: scale(1.05); z-index: 10; }
.table-item.available { background: var(--green); border-color: var(--green-dark); }
.table-item.occupied  { background: var(--red); border-color: #b91c1c; }
.table-item.reserved  { background: var(--yellow); border-color: #a16207; }
.table-item.cleaning  { background: var(--orange); border-color: #c2410c; }
.table-item.round { border-radius: 50%; }
.table-item.rectangle { border-radius: var(--radius-sm); width: 120px !important; height: 54px !important; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: none; }
    .main-content { margin-left: 0 !important; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .auth-card { padding: 32px 20px; }
    .modal { border-radius: var(--radius-lg); }
    .stat-value { font-size: 1.3rem; }
}
@media (max-width: 480px) {
    .page-header { flex-direction: column; }
    .topbar-title { font-size: 0.9rem; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.d-flex   { display: flex; }
.d-none   { display: none; }
.d-block  { display: block; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-400); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-navy   { color: var(--navy); }
.text-sm     { font-size: 0.82rem; }
.text-xs     { font-size: 0.72rem; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.shadow { box-shadow: var(--shadow); }
.pointer { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Page loader */
.page-loader {
    position: fixed; inset: 0;
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity .3s ease;
}
.page-loader.done { opacity: 0; pointer-events: none; }

/* Divider */
.divider { height: 1px; background: var(--gray-100); margin: 20px 0; }
.divider-text { text-align: center; position: relative; margin: 20px 0; }
.divider-text::before, .divider-text::after {
    content: ''; position: absolute; top: 50%;
    width: calc(50% - 30px); height: 1px; background: var(--gray-200);
}
.divider-text::before { left: 0; }
.divider-text::after  { right: 0; }
.divider-text span { font-size: 0.78rem; color: var(--gray-400); background: var(--white); padding: 0 8px; }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: var(--gray-800); color: white;
    font-size: 0.72rem; white-space: nowrap; padding: 4px 8px;
    border-radius: var(--radius-sm); pointer-events: none;
    opacity: 0; transition: opacity .15s ease;
    z-index: 500;
}
[data-tooltip]:hover::after { opacity: 1; }

/* Search box */
.search-box { position: relative; }
.search-box input { padding-left: 38px; }
.search-box .search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); font-size: 16px; pointer-events: none;
}
