* { box-sizing: border-box; }
    body { background: #0A0A0F; color: #E2E8F0; font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif; direction: inherit; }

    /* ── Dark / Light theme ─────────────────────────────────────────────── */
    :root {
      --db-bg:       #0A0A0F;
      --db-card:     #111118;
      --db-border:   #1E1E2E;
      --db-muted:    #2A2A3E;
      --db-text:     #E2E8F0;
      --db-text2:    #94A3B8;
      --db-sidebar:  #0D0D16;
      --db-input:    #0D0D16;
    }
    body.dash-light {
      --db-bg:       #F1F5F9;
      --db-card:     #FFFFFF;
      --db-border:   #E2E8F0;
      --db-muted:    #F8FAFC;
      --db-text:     #0F172A;
      --db-text2:    #64748B;
      --db-sidebar:  #FFFFFF;
      --db-input:    #F8FAFC;
      color: var(--db-text);
      background: var(--db-bg);
    }
    body.dash-light { background: var(--db-bg); color: var(--db-text); }
    body.dash-light .sidebar { background: var(--db-sidebar); border-color: var(--db-border); }
    body.dash-light .card { background: var(--db-card); border-color: var(--db-border); }
    body.dash-light .nav-link { color: var(--db-text2); }
    body.dash-light .nav-link:hover { background: var(--db-border); color: var(--db-text); }
    body.dash-light .nav-link .icon { background: var(--db-border); }
    body.dash-light .input-field { background: var(--db-input); border-color: var(--db-border); color: var(--db-text); }
    body.dash-light .data-table tbody tr { background: var(--db-card); }
    body.dash-light .data-table tbody tr:hover { background: var(--db-muted); }
    body.dash-light .data-table tbody td { border-color: var(--db-border); }
    body.dash-light .data-table thead th { color: var(--db-text2); }
    body.dash-light .text-slate-400,
    body.dash-light .text-slate-500,
    body.dash-light .text-slate-600 { color: var(--db-text2) !important; }
    body.dash-light .text-white { color: var(--db-text) !important; }
    body.dash-light .bg-dash-muted\/30,
    body.dash-light .bg-dash-muted\/60 { background: var(--db-muted) !important; }
    body.dash-light .border-dash-border { border-color: var(--db-border) !important; }
    body.dash-light .kitchen-card { background: var(--db-card); border-color: var(--db-border); }
    body.dash-light .btn-ghost { background: transparent; border-color: var(--db-border); color: var(--db-text2); }
    body.dash-light .activity-item:hover { background: var(--db-muted); }

    /* Theme toggle button */
    .theme-toggle-btn {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 7px 12px; border-radius: 10px;
      border: 1px solid #1E1E2E;
      background: transparent; color: #94A3B8;
      font-size: 0.82rem; font-weight: 600; cursor: pointer;
      transition: all 0.15s; font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
    }
    .theme-toggle-btn:hover { border-color: #F59E0B44; color: #E2E8F0; }
    body.dash-light .theme-toggle-btn { border-color: #E2E8F0; color: #64748B; }
    body.dash-light .theme-toggle-btn:hover { border-color: #F59E0B; color: #0F172A; }

    .sidebar {
      width: 250px; min-height: 100vh;
      background: #0D0D16;
      border-inline-end: 1px solid #1E1E2E;
    }
    .nav-link {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 16px; border-radius: 10px;
      color: #94A3B8; font-size: 0.95rem; font-weight: 500;
      transition: all 0.15s; cursor: pointer; margin-bottom: 2px;
      text-decoration: none;
    }
    .nav-link:hover { background: #1E1E2E; color: #E2E8F0; }
    .nav-link.active { background: #F59E0B22; color: #F59E0B; }
    .nav-link .icon {
      width: 36px; height: 36px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem; background: #1E1E2E; flex-shrink: 0;
    }
    .nav-link.active .icon { background: #F59E0B22; }
    .nav-link-disabled {
      display: flex; align-items: center; gap: 10px;
      padding: 10px 16px; border-radius: 10px;
      color: #94A3B8; font-size: 0.95rem; font-weight: 500;
      margin-bottom: 2px; cursor: not-allowed; opacity: 0.6;
    }
    .nav-link-disabled .icon {
      width: 36px; height: 36px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-size: 1.1rem; background: #1E1E2E; flex-shrink: 0;
    }

    .card { background: #111118; border: 1px solid #1E1E2E; border-radius: 16px; }

    .btn-primary {
      background: #F59E0B; color: #0A0A0F; font-weight: 700;
      padding: 8px 18px; border-radius: 10px; font-size: 0.9rem;
      transition: all 0.15s; cursor: pointer; border: none;
      display: inline-flex; align-items: center; gap: 6px;
      font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
    }
    .btn-primary:hover { background: #FCD34D; }

    .btn-ghost {
      background: transparent; border: 1px solid #1E1E2E;
      color: #94A3B8; padding: 8px 14px; border-radius: 10px;
      font-size: 0.9rem; cursor: pointer; transition: all 0.15s;
      display: inline-flex; align-items: center; gap: 6px;
      font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
    }
    .btn-ghost:hover { border-color: #F59E0B44; color: #E2E8F0; }

    .btn-danger {
      background: #7F1D1D22; border: 1px solid #EF444422;
      color: #F87171; padding: 6px 12px; border-radius: 8px;
      font-size: 0.85rem; cursor: pointer; transition: all 0.15s;
      font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
    }
    .btn-danger:hover { background: #EF444422; }

    .input-field {
      background: #0D0D16; border: 1px solid #1E1E2E;
      color: #E2E8F0; padding: 10px 14px; border-radius: 10px;
      font-size: 0.95rem; width: 100%; outline: none;
      transition: border-color 0.15s; font-family: 'Tajawal', 'Plus Jakarta Sans', sans-serif;
    }
    .input-field:focus { border-color: #F59E0B55; }

    .label {
      font-size: 0.78rem; font-weight: 700; color: #64748B;
      letter-spacing: 0.03em; margin-bottom: 6px; display: block;
    }

    .badge {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 3px 10px; border-radius: 999px;
      font-size: 0.75rem; font-weight: 700;
    }
    .badge-green { background: #14532D22; color: #4ADE80; border: 1px solid #14532D; }
    .badge-red   { background: #7F1D1D22; color: #F87171; border: 1px solid #7F1D1D; }
    .badge-amber { background: #78350F22; color: #FCD34D; border: 1px solid #78350F; }

    /* Toggle switch — RTL aware */
    .toggle { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
    .toggle input { opacity: 0; width: 0; height: 0; }
    .slider { position: absolute; inset: 0; background: #2A2A3E; border-radius: 999px; transition: 0.3s; }
    .slider:before {
      content: ''; position: absolute;
      height: 18px; width: 18px;
      right: 3px; bottom: 3px;
      background: white; border-radius: 50%; transition: 0.3s;
    }
    input:checked + .slider { background: #F59E0B; }
    input:checked + .slider:before { transform: translateX(-18px); }

    /* Stats */
    .stat-card { transition: transform 0.2s, box-shadow 0.2s; }
    .stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(245,158,11,0.08); }

    /* Table */
    .data-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
    .data-table thead th {
      font-size: 0.75rem; font-weight: 700; color: #64748B;
      letter-spacing: 0.03em; padding: 8px 12px; background: transparent;
      text-align: right;
    }
    .data-table tbody tr { background: #111118; }
    .data-table tbody tr:hover { background: #151520; }
    .data-table tbody td {
      padding: 10px 12px;
      border-top: 1px solid #1E1E2E;
      border-bottom: 1px solid #1E1E2E;
    }
    .data-table tbody td:last-child  { border-inline-end: 1px solid #1E1E2E; border-radius: 10px 0 0 10px; }
    .data-table tbody td:first-child { border-inline-start: 1px solid #1E1E2E; border-radius: 0 10px 10px 0; }

    /* Mobile sidebar (slides from right in RTL) */
    #mobile-overlay { display: none; }
    #logout-mobile{
      display: none;
    }
    #logout-desktop{
      display: block;
    }
    @media (max-width: 768px) {
      #logout-desktop{
        display: none;
      }
      #logout-mobile{
        display: block;
      }
  /* Sidebar: fixed, full-height, scrollable internally */
  .sidebar {
    position: fixed;
    top: 0; 
    bottom: 0; 
    right: 0;
    z-index: 50;
    width: 270px;
    max-width: 85vw;
    height: 100dvh;               /* Safe mobile height */
    height: -webkit-fill-available; /* iOS Safari fallback */
    
    /* Force layout constraints on mobile */
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;  /* Prevents the outer sidebar from extending */
    
    overscroll-behavior: contain; 
    
    transform: translateX(calc(100% + 40px)); 
    
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    box-shadow: -8px 0 40px rgba(0,0,0,.6);
  }
  }
  
  /* Force the nav list to contain its scroll area strictly */
  .sidebar nav {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch; /* Smooth iOS scrolling */
  }

  /* Ensure the footer doesn't shrink to 0 height */
  .sidebar > div:last-child {
    flex-shrink: 0 !important;
  }

  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Overlay: covers full screen, freezes the page behind it */
  #mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(3px);
    z-index: 40;
    cursor: pointer;
  }
  #mobile-overlay.visible { display: block; }

  /* When sidebar is open, prevent the body from scrolling */
  body.sidebar-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    top: var(--scroll-y, 0);
  }

  .main-content { margin-right: 0 !important; }
}

    /* Drag handle */
    .drag-handle { cursor: grab; color: #2A2A3E; }
    .drag-handle:hover { color: #F59E0B; }

    /* Tabs */
    .tab {
      padding: 8px 18px; font-size: 0.9rem; font-weight: 600;
      border-radius: 8px; cursor: pointer; transition: all 0.15s; color: #64748B;
    }
    .tab.active { background: #F59E0B22; color: #F59E0B; }
    .tab-panel { display: none; }
    .tab-panel.active { display: block; }

    /* Toast RTL */
    .toast-box { position: fixed; bottom: 24px; left: 24px; z-index: 999; }

    /* Section divider label */
    .nav-section {
      font-size: 0.7rem; font-weight: 800; color: #374151;
      letter-spacing: 0.08em; padding: 0 16px;
      margin-bottom: 4px; margin-top: 16px;
      text-transform: uppercase;
    }