/* ============================================================
   ERP The Nice Playland — Modern Mobile-First UI
   ============================================================ */

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-50: rgba(99,102,241,0.08);
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --bottom-nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-size: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   Auth Screen
   ============================================================ */
.auth-wrapper {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  padding: 36px 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo { font-size: 48px; margin-bottom: 8px; }
.auth-card h1 { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.subtitle { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }
.input-group {
  position: relative;
  margin-bottom: 12px;
}
.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
}
.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
  background: var(--card);
}
.btn-auth {
  width: 100%;
  padding: 0 16px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.btn-auth:hover { background: var(--primary-hover); }
.btn-auth:active { transform: scale(0.98); }
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  margin-top: 16px;
  font-family: inherit;
}
.error { color: var(--danger); margin-top: 12px; font-size: 13px; }
.success { color: var(--success); margin-top: 12px; font-size: 13px; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.92);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-logo { font-weight: 700; font-size: 15px; white-space: nowrap; }
.topbar-title { display: none; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.user-name { display: none; }
.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-icon:hover { background: var(--bg); }

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100dvh;
  background: var(--card);
  z-index: 200;
  transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.sidebar.open { left: 0; }
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }
.sidebar-header {
  padding: 20px;
  font-weight: 700;
  font-size: 16px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: var(--primary-light); color: var(--primary); }
.sidebar-nav a.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-nav a .nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}
.sidebar-logout-btn {
  width: 100%;
  padding: 10px;
  background: var(--danger-light);
  color: var(--danger);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ============================================================
   Bottom Nav (mobile)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  min-width: 56px;
}
.bottom-nav a .nav-icon { font-size: 20px; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active .nav-icon { transform: scale(1.1); }

/* ============================================================
   Main Content
   ============================================================ */
main {
  margin-top: var(--topbar-h);
  margin-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  padding: 16px;
  max-width: 1200px;
  min-height: calc(100dvh - var(--topbar-h) - var(--bottom-nav-h));
}

/* ============================================================
   Cards & Stats
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}
.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--success); }
.stat-card.red::before { background: var(--danger); }
.stat-card.orange::before { background: var(--warning); }
.stat-card .label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
}
.stat-card .value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.stat-card .value.green { color: var(--success); }
.stat-card .value.red { color: var(--danger); }
.stat-card .value.blue { color: var(--primary); }
.stat-card .value.orange { color: var(--warning); }

/* ============================================================
   Tables (desktop) & Mobile Cards
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: -4px; padding: 4px; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg);
  position: sticky;
  top: 0;
  white-space: nowrap;
}
tr:last-child td { border-bottom: none; }
tr:hover { background: var(--primary-50); }
th.clickable { cursor: pointer; color: var(--primary); }
th.clickable:hover { background: var(--primary-light); }

/* Mobile card list (replaces tables on small screens) */
.mobile-cards { display: none; }
.mobile-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
}
.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.mobile-card-title { font-weight: 600; font-size: 14px; }
.mobile-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mobile-card-field { font-size: 12px; }
.mobile-card-field .field-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.mobile-card-field .field-value { font-weight: 600; color: var(--text); }
.mobile-card-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { box-shadow: 0 2px 8px rgba(16,185,129,0.3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
.btn-outline {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; height: 32px; }
.btn-block { width: 100%; justify-content: center; height: 44px; font-size: 15px; font-weight: 600; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}
.form-group input:disabled,
.form-group select:disabled {
  background: var(--bg);
  color: var(--text-muted);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.toolbar h2 { margin-bottom: 0; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search-input {
  padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 300px;
  font-size: 13px;
  font-family: inherit;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  width: 100%;
  max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}
.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.modal h3 { margin-bottom: 16px; font-size: 17px; font-weight: 600; }
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.modal-actions .btn { flex: 1; justify-content: center; padding: 12px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-pending { background: var(--warning-light); color: #b45309; }
.badge-approved { background: var(--success-light); color: #059669; }
.badge-rejected { background: var(--danger-light); color: #dc2626; }
.badge-locked { background: #f1f5f9; color: #475569; }
.badge-open { background: var(--info-light); color: #2563eb; }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  z-index: 400;
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes toastIn {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Inline input */
.inline-input {
  width: 70px;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
  font-family: inherit;
}
.inline-input:focus { border-color: var(--primary); outline: none; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ============================================================
   Desktop (≥768px)
   ============================================================ */
@media (min-width: 768px) {
  .topbar-title { display: inline; }
  .user-name { display: inline; }
  .hamburger { display: none; }
  .bottom-nav { display: none; }

  .sidebar {
    left: 0;
    top: var(--topbar-h);
    height: calc(100dvh - var(--topbar-h));
    width: var(--sidebar-w);
    border-right: 1px solid var(--border);
    box-shadow: none;
  }
  .sidebar-header { display: none; }
  .sidebar-overlay { display: none; }

  main {
    margin-left: var(--sidebar-w);
    margin-bottom: 24px;
    padding: 24px;
    max-width: calc(1200px + var(--sidebar-w));
  }

  .stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

  .modal-overlay { align-items: center; }
  .modal {
    border-radius: var(--radius-lg);
    padding: 28px;
    animation: modalPop 0.25s cubic-bezier(0.4,0,0.2,1);
  }
  .modal-handle { display: none; }
  @keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }
}

/* ============================================================
   Mobile-specific (< 768px)
   ============================================================ */
@media (max-width: 767px) {
  .sidebar { display: flex; }
  .desktop-table { display: none; }
  .mobile-cards { display: block; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar h2 { font-size: 16px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1; justify-content: center; }
  .search-input { max-width: 100%; }

  .form-row { grid-template-columns: 1fr; }

  .stat-card .value { font-size: 20px; }
}

/* ============================================================
   Large desktop (≥1200px)
   ============================================================ */
@media (min-width: 1200px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
}

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

/* ============================================================
   Utility
   ============================================================ */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Division chips */
.div-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}

/* Button loading spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.btn-outline .spinner, .btn-warning .spinner {
  border-color: rgba(0,0,0,0.2);
  border-top-color: currentColor;
}
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   Dark Mode
   ============================================================ */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-light: rgba(99,102,241,0.15);
  --primary-50: rgba(99,102,241,0.12);
  --success: #34d399;
  --success-light: rgba(16,185,129,0.15);
  --danger: #f87171;
  --danger-light: rgba(239,68,68,0.15);
  --warning: #fbbf24;
  --warning-light: rgba(245,158,11,0.15);
  --info: #60a5fa;
  --info-light: rgba(59,130,246,0.15);
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.2);
  color-scheme: dark;
}
[data-theme="dark"] .topbar {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .sidebar {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .sidebar-overlay {
  background: rgba(0,0,0,0.6);
}
[data-theme="dark"] .bottom-nav {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .auth-card {
  background: #1e293b;
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}
[data-theme="dark"] input::placeholder {
  color: #64748b;
}
[data-theme="dark"] table thead {
  background: #0f172a;
}
[data-theme="dark"] table tbody tr:hover {
  background: rgba(99,102,241,0.08);
}
[data-theme="dark"] table td, [data-theme="dark"] table th {
  border-color: #334155;
}
[data-theme="dark"] .stat-card {
  background: #1e293b;
}
[data-theme="dark"] .badge-pending {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
}
[data-theme="dark"] .badge-approved {
  background: rgba(16,185,129,0.15);
  color: #34d399;
}
[data-theme="dark"] .div-chip {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
}
[data-theme="dark"] .btn-outline {
  border-color: #475569;
  color: #e2e8f0;
}
[data-theme="dark"] .btn-outline:hover {
  background: #334155;
}
[data-theme="dark"] .mobile-card {
  background: #1e293b;
  border-color: #334155;
}
[data-theme="dark"] .modal {
  background: #1e293b;
}
[data-theme="dark"] .toast {
  background: #334155;
  color: #e2e8f0;
}
[data-theme="dark"] .search-input {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #334155;
}
/* Theme toggle switch */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
  vertical-align: middle;
}
.theme-switch input { display: none; }
.theme-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 28px;
  transition: background 0.3s;
}
.theme-slider::before {
  content: '☀️';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.theme-switch input:checked + .theme-slider {
  background: #475569;
}
.theme-switch input:checked + .theme-slider::before {
  content: '🌙';
  transform: translateX(24px);
}
.theme-icon-sun, .theme-icon-moon { display: none; }

/* Mobile tab toggle for gudang dashboard */
.tab-toggle {
  display: flex;
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.tab-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.mobile-only { display: none; }
@media (max-width: 768px) {
  .mobile-only { display: block; }
  .hidden-mobile { display: none !important; }
}
