/* ============================================================
   Modern Glassmorphic Design System — Fully Responsive
   ============================================================ */
:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  --surface-bg: rgba(30, 41, 59, 0.7);
  --surface-card: rgba(30, 41, 59, 0.85);
  --surface-hover: rgba(51, 65, 85, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(99, 102, 241, 0.3);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #10b981;
  --accent: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --sidebar-width: 280px;
  --header-height: 60px;
  --ticker-height: 38px;
  --budget-height: 70px;
  --transition-fast: 0.18s ease;
}

/* ── Custom Sleek Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #6366f1, #4f46e5); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #818cf8, #6366f1); }

* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-family); }

html, body {
  height: 100%;
  overflow: hidden; /* Prevent full-page scroll */
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
}

/* ── Auth Screen ── */
.auth-overlay {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.98));
  backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 20px;
}

.auth-card {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 420px;
  padding: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex; flex-direction: column; gap: 20px;
}

.auth-header { text-align: center; }
.auth-header h2 { font-size: 1.5rem; font-weight: 800; color: #ffffff; }

/* ── File Upload Progress List ── */
.file-upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

.file-upload-item {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 0.88rem;
}

.file-item-info { display: flex; align-items: center; gap: 8px; overflow: hidden; flex: 1; }
.file-item-name { font-weight: 600; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; max-width: 180px; color: #c7d2fe; }
.file-item-size { color: var(--text-dim); font-size: 0.8rem; white-space: nowrap; }
.file-progress-container { width: 80px; height: 10px; background: rgba(99,102,241,0.2); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.file-progress-fill { height: 100%; background: var(--primary); width: 0%; transition: width 0.2s ease; }
.file-item-remove { background: none; border: none; color: var(--text-dim); font-weight: 700; font-size: 1.1rem; cursor: pointer; padding: 2px 4px; flex-shrink: 0; }
.file-item-remove:hover { color: #ef4444; }

/* ── Ticker ── */
.ticker-wrap {
  width: 100%; height: var(--ticker-height);
  background: linear-gradient(90deg, #991b1b, #dc2626, #b91c1c);
  color: #fff; overflow: hidden; position: relative;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3); flex-shrink: 0;
}
.ticker {
  display: inline-block; white-space: nowrap;
  padding-left: 100%; animation: ticker 30s linear infinite;
  font-size: 0.85rem; font-weight: 600; letter-spacing: 0.5px; line-height: var(--ticker-height);
}
.ticker:hover { animation-play-state: paused; }
@keyframes ticker { 0%{transform:translate3d(0,0,0)} 100%{transform:translate3d(-100%,0,0)} }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 2rem; }

/* ── Full-viewport App Shell ── */
#appBody {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── App Header ── */
.app-header {
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; z-index: 90; gap: 12px;
}

.header-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.company-logo-img {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-md); object-fit: cover;
  background: var(--surface-bg); border: 1px solid #eab308;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.company-info { display: flex; flex-direction: column; min-width: 0; }

.company-name {
  font-size: 1rem; font-weight: 700; color: #fff200;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.gst-badge {
  background: rgba(99,102,241,0.2); color: #818cf8;
  border: 1px solid rgba(99,102,241,0.4);
  font-size: 0.7rem; padding: 2px 7px; border-radius: 12px; font-weight: 600; white-space: nowrap;
}

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

.super-admin-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white; border: none; padding: 7px 14px;
  border-radius: var(--radius-md); font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all var(--transition-fast); font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3); white-space: nowrap;
}
.super-admin-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99,102,241,0.4); }

/* Hamburger for mobile */
.sidebar-toggle {
  display: none; background: none; border: none; color: white;
  font-size: 1.4rem; cursor: pointer; padding: 4px 8px;
  border-radius: var(--radius-sm); transition: background var(--transition-fast);
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.1); }

/* ── Budget Bar ── */
.budget-bar {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-shrink: 0; flex-wrap: wrap;
}

.budget-widgets { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.budget-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  padding: 7px 14px; border-radius: var(--radius-md);
  display: flex; flex-direction: column; min-width: 130px;
}
.budget-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.budget-value { font-size: 1.1rem; font-weight: 700; margin-top: 1px; }
.budget-value.spent { color: #f87171; }
.budget-value.remaining { color: #34d399; }
.budget-value.set { color: #818cf8; }

.set-budget-form { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.budget-input {
  background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-highlight);
  color: white; padding: 7px 11px; border-radius: var(--radius-md);
  font-size: 0.9rem; width: 130px; outline: none;
}

/* ── Main App Container (takes remaining height, no overflow) ── */
.app-container {
  display: flex;
  flex: 1;
  overflow: hidden; /* Critical: children handle their own scroll */
  position: relative;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(12, 20, 40, 0.9);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-color);
  padding: 14px 10px;
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0;
  overflow-y: auto;  /* Sidebar scrolls independently */
  overflow-x: hidden;
  transition: transform var(--transition-fast);
  z-index: 80;
  /* Custom sidebar scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #6366f1 rgba(15, 23, 42, 0.5);
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #818cf8;
}

/* ── Sidebar Company Branding Header ── */
.sidebar-company-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 12px;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(79,70,229,0.08));
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  flex-shrink: 0;
  cursor: default;
  transition: background var(--transition-fast);
}
.sidebar-company-header:hover {
  background: linear-gradient(135deg, rgba(99,102,241,0.22), rgba(79,70,229,0.12));
}

.sidebar-logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid rgba(99,102,241,0.35);
  background: rgba(15,23,42,0.6);
  flex-shrink: 0;
}

.sidebar-company-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.sidebar-company-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff200;
  line-height: 1.25;
  word-break: break-word;
}

.sidebar-company-gst {
  font-size: 0.68rem;
  color: #818cf8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thin divider between company header and nav items */
.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,0.3), transparent);
  margin: 6px 4px;
  flex-shrink: 0;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-md);
  color: var(--text-muted); font-weight: 500; cursor: pointer;
  transition: all var(--transition-fast); text-decoration: none;
  font-size: 0.875rem;
  /* Allow text to wrap — never cut off menu names */
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  flex-shrink: 0;
}
.nav-item:hover { background: var(--surface-hover); color: white; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.28), rgba(99,102,241,0.05));
  border-left: 3px solid var(--primary); color: #fff; font-weight: 600;
}
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── Main Content ── */
.main-content {
  flex: 1;
  padding: 20px 24px calc(120px + env(safe-area-inset-bottom, 24px)) 24px;
  overflow-y: auto; /* Main content scrolls independently */
  overflow-x: hidden;
  min-width: 0; /* Prevent flex blowout */
  box-sizing: border-box;
}

/* ── Module Header ── */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.view-title { font-size: 1.3rem; font-weight: 700; color: white; flex: 1; min-width: 200px; }
.view-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.filter-select {
  background: rgba(30, 41, 59, 0.9); border: 1px solid var(--border-color);
  color: white; padding: 7px 12px; border-radius: var(--radius-md);
  font-size: 0.88rem; outline: none; cursor: pointer;
}

/* ── Action Buttons ── */
.action-btn {
  background: var(--primary); color: white; border: none;
  padding: 8px 16px; border-radius: var(--radius-md); font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: all var(--transition-fast); font-size: 0.875rem; white-space: nowrap;
}
.action-btn:hover { background: var(--primary-hover); transform: translateY(-1px); }
.action-btn.secondary { background: rgba(51, 65, 85, 0.8); }
.action-btn.secondary:hover { background: rgba(71, 85, 105, 1); }

/* ── Cards & Grid ── */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.data-card {
  background: var(--surface-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 18px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow-lg);
  transition: all var(--transition-fast); display: flex; flex-direction: column; gap: 12px;
}
.data-card:hover { border-color: var(--border-highlight); transform: translateY(-2px); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-color); padding-bottom: 10px; gap: 8px;
}
.card-title { font-size: 1rem; font-weight: 700; color: white; flex: 1; min-width: 0; }
.card-badge { font-size: 0.72rem; padding: 3px 9px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.badge-info    { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-success { background: rgba(16,185,129,0.2); color: #34d399; }
.badge-warning { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-danger  { background: rgba(239,68,68,0.2);  color: #f87171; }
.card-amount { font-size: 1.3rem; font-weight: 800; color: #34d399; }

/* ── Eye Icon Mask ── */
.masked-amount-wrapper { display: inline-flex; align-items: center; gap: 6px; }
.eye-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.05rem; padding: 2px 4px; }
.eye-btn:hover { color: white; }

/* ── Table View ── */
.table-container {
  background: var(--surface-card); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); margin-top: 16px;
  /* Horizontal scroll for wide tables on mobile */
  overflow-x: auto;
}

.custom-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 600px; }

.custom-table th {
  background: rgba(15, 23, 42, 0.85); color: var(--text-muted);
  font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-color); white-space: nowrap;
}
.custom-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
  color: var(--text-main); font-size: 0.88rem; vertical-align: middle;
}
.custom-table tr:hover { background: var(--surface-hover); }
.custom-table tr:last-child td { border-bottom: none; }

/* ── Document Pills ── */
.doc-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-color);
  padding: 3px 9px; border-radius: var(--radius-sm);
  font-size: 0.78rem; color: var(--text-muted); cursor: pointer;
  margin: 2px; transition: all var(--transition-fast);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-pill:hover { border-color: var(--primary); color: white; }
.doc-pill.active { background: #6366f1; color: white; border-color: #818cf8; }

/* ── Modals ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  padding: 16px 16px calc(80px + env(safe-area-inset-bottom, 24px)) 16px;
  box-sizing: border-box;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
#sessionOverrideModal { z-index: 2500 !important; }
#sessionTerminatedModal { z-index: 3000 !important; }
#customAlertModal, #customConfirmModal { z-index: 999999 !important; }
#customAlertModal .modal-card, #customConfirmModal .modal-card { z-index: 1000000 !important; }

.modal-card {
  background: rgba(22, 35, 58, 0.97);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 640px;
  max-height: calc(88dvh - env(safe-area-inset-bottom, 0px));
  overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
  padding: 24px 24px calc(36px + env(safe-area-inset-bottom, 16px)) 24px;
  display: flex; flex-direction: column; gap: 18px;
  box-sizing: border-box;
}

.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--border-color); padding-bottom: 12px; gap: 10px;
  position: relative;
  padding-right: 48px !important; /* Reserve right space so title never overlaps close cross button */
  min-height: 38px;
}

.modal-title {
  font-size: 1.15rem; font-weight: 700; color: white; flex: 1; min-width: 0;
  word-break: break-word; overflow-wrap: anywhere; line-height: 1.35;
}

.modal-close {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 1.3rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  z-index: 20;
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.05);
}

/* ── Responsive Modal Forms & Cards ── */
.modal-tabs-header {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.form-responsive-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: rgba(15, 23, 42, 0.6);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  width: 100%;
}

.company-card-item, .user-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-bg);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  width: 100%;
}

.company-card-info, .user-card-info {
  min-width: 0;
  flex: 1;
}

.card-action-group {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.form-input, .form-select, .form-textarea {
  background: rgba(10, 18, 35, 0.85); border: 1px solid var(--border-color);
  color: white; padding: 9px 13px; border-radius: var(--radius-md);
  font-size: 0.92rem; outline: none; width: 100%;
  transition: border-color var(--transition-fast);
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--primary); }
.form-select option { background: #1e293b; color: white; }
.date-hint { font-size: 0.73rem; color: #fbbf24; }

/* ── Toasts ── */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px; z-index: 3000;
  max-width: calc(100vw - 40px);
}
.toast {
  background: rgba(10, 18, 35, 0.97);
  border-left: 4px solid var(--secondary);
  color: white; padding: 12px 18px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); display: flex; align-items: center;
  gap: 10px; font-weight: 500; font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ── Doc Viewer Modal (Expanded Viewport & Reader Mode) ── */
.doc-viewer-modal {
  width: 94vw !important;
  max-width: 1120px !important;
  height: 88vh !important;
  max-height: 88vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 20px 24px !important;
  gap: 10px !important;
}

.doc-file-tabs-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  margin-bottom: 4px;
  width: 100%;
}

.doc-viewer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
  width: 100%;
}

.doc-preview-area {
  background: rgba(10, 18, 35, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex: 1 !important;
  width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  padding: 0 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  position: relative !important;
}

.doc-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.doc-text-editor {
  width: 100%;
  height: 100%;
  flex: 1;
  background: rgba(10, 18, 35, 0.95);
  color: #34d399;
  font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
  line-height: 1.6;
  resize: none;
  outline: none;
}

/* ── Sleek Page Loader & Skeleton Animation ── */
.page-loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  width: 100%;
  padding: 40px 20px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(8px);
  animation: pageFadeIn 0.25s ease-in-out;
}

.spinner-ring {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(99, 102, 241, 0.15);
  border-left-color: #6366f1;
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: spinnerRotate 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
  margin-bottom: 18px;
}

@keyframes spinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

.loader-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.loader-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}


/* ── Password Visibility Toggle ── */
.password-input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.password-input-wrapper input { padding-right: 44px !important; width: 100%; }
.password-toggle-btn {
  position: absolute; right: 10px; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 1.1rem; padding: 4px;
  display: flex; align-items: center; border-radius: 4px;
  transition: all var(--transition-fast);
}
.password-toggle-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ── Sidebar Overlay (mobile backdrop) ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 199; /* just below sidebar at 200 */
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */


/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ── Tablet: 1024px — keep sidebar full-width, just slightly smaller ── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 260px; }

  .gst-badge { display: none; }
  .company-name { font-size: 0.9rem; }

  .budget-card { min-width: 105px; padding: 6px 10px; }
  .budget-value { font-size: 0.9rem; }
  .budget-label { font-size: 0.6rem; }
  .budget-input { width: 110px; }
  .super-admin-btn { font-size: 0.8rem; padding: 6px 11px; }
  .main-content { padding: 16px 18px; }
}

/* ── Mobile & small tablet ≤ 768px — off-canvas drawer ── */
@media (max-width: 768px) {

  /* Show hamburger button */
  .sidebar-toggle { display: flex; }

  /* Sidebar becomes a full-height off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;          /* Use dynamic viewport height */
    /* Width auto-fits the longest menu item — min 260px, max 80vw */
    width: clamp(260px, 80vw, 320px) !important;
    transform: translateX(-100%);
    z-index: 200;
    padding-top: 14px;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.6);
    /* Allow full-text nav items — no truncation */
    overflow-y: auto;
    overflow-x: hidden;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Nav items must show full text on mobile */
  .nav-item {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow: visible !important;
    text-overflow: unset !important;
    font-size: 0.92rem;
    padding: 11px 16px;
  }

  /* Main content takes full width */
  .app-container { flex-direction: column; }
  .main-content { padding: 12px 14px; width: 100%; }

  /* Header layout on mobile */
  .app-header {
    padding: 0 12px;
    gap: 8px;
    height: auto;
    min-height: var(--header-height);
    flex-wrap: nowrap;
  }
  .header-brand { flex: 1; min-width: 0; overflow: hidden; }
  .company-name { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gst-badge { display: none; }
  .company-logo-img { width: 32px; height: 32px; }

  /* Header actions — compact on mobile */
  .header-actions { gap: 6px; flex-shrink: 0; }
  .super-admin-btn { padding: 6px 10px; font-size: 1rem; gap: 4px; }
  .super-admin-btn span { display: none; } /* Hide text label, keep icon only */

  /* Budget bar: 2×2 grid then form */
  .budget-bar {
    padding: 8px 12px;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }
  .budget-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .budget-card { min-width: unset; width: 100%; }
  .set-budget-form { width: 100%; gap: 8px; }
  .budget-input { flex: 1; width: auto; min-width: 0; }

  /* View header stacks */
  .view-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .view-title { font-size: 1.1rem; }
  .view-actions { width: 100%; flex-wrap: wrap; }

  /* Grid: 1 column */
  .grid-cards { grid-template-columns: 1fr; gap: 12px; }

  /* Tables scroll horizontally, tighter padding */
  .custom-table th { padding: 9px 11px; font-size: 0.72rem; }
  .custom-table td { padding: 9px 11px; font-size: 0.8rem; }

  /* Modal fills screen with safe bottom clearance for Samsung Internet & Mobile Browsers */
  .modal-overlay {
    padding: calc(20px + env(safe-area-inset-top, 10px)) 10px calc(75px + env(safe-area-inset-bottom, 20px)) 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .modal-card {
    margin: auto !important;
    padding: 18px 16px calc(30px + env(safe-area-inset-bottom, 16px)) 16px !important;
    border-radius: var(--radius-xl) !important;
    max-height: calc(80dvh - env(safe-area-inset-bottom, 0px)) !important;
    max-width: 100% !important;
    width: 100% !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    box-sizing: border-box !important;
  }
  .doc-viewer-modal {
    width: 100% !important;
    height: auto !important;
    max-height: calc(82dvh - env(safe-area-inset-bottom, 0px)) !important;
    padding: 16px 14px calc(30px + env(safe-area-inset-bottom, 16px)) 14px !important;
  }
  .doc-preview-area {
    min-height: 280px !important;
  }
  .doc-viewer-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .doc-viewer-footer .footer-btn-group,
  .doc-viewer-footer .action-btn,
  .doc-viewer-footer a {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .modal-tabs-header {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .modal-tabs-header .action-btn {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .form-responsive-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .form-responsive-row .form-group {
    margin-bottom: 0 !important;
    width: 100% !important;
  }
  .form-responsive-row .action-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px !important;
  }
  .company-card-item, .user-card-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .card-action-group {
    width: 100% !important;
    justify-content: flex-end !important;
    border-top: 1px solid rgba(255,255,255,0.08) !important;
    padding-top: 8px !important;
  }
  .modal-title { font-size: 1.05rem; }
}

/* ── Phone ≤ 480px — extra-tight ── */
@media (max-width: 480px) {
  .app-header { padding: 0 10px; }
  .company-logo-img { width: 28px; height: 28px; }
  .company-name { font-size: 0.78rem; }

  .budget-bar { padding: 6px 10px; }
  .budget-card { padding: 5px 8px; }
  .budget-value { font-size: 0.82rem; }
  .budget-label { font-size: 0.58rem; }

  .main-content { padding: 10px 10px calc(120px + env(safe-area-inset-bottom, 24px)) 10px !important; }
  .action-btn { padding: 6px 10px; font-size: 0.78rem; gap: 4px; }

  .modal-card { padding: 16px 14px calc(45px + env(safe-area-inset-bottom, 20px)) 14px !important; gap: 12px; }

  .toast-container { bottom: calc(20px + env(safe-area-inset-bottom, 20px)); right: 8px; left: 8px; }
  .toast { font-size: 0.8rem; padding: 9px 12px; }

  /* Single-col grids */
  .grid-cards { grid-template-columns: 1fr; }

  /* Force inline multi-col form grids to stack */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* ── Red Blinking Alert for Service Needed (>= 10,000 KM) ── */
@keyframes redBlinkAlert {
  0% { opacity: 1; background: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.9); }
  50% { opacity: 0.35; background: #7f1d1d; box-shadow: none; }
  100% { opacity: 1; background: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.9); }
}

.red-blinking-alert {
  animation: redBlinkAlert 1.2s infinite ease-in-out !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-radius: var(--radius-md) !important;
  padding: 6px 12px !important;
  display: inline-block !important;
  font-size: 0.85rem !important;
  border: 1px solid #f87171 !important;
}

.green-service-badge {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 6px 12px !important;
  display: inline-block !important;
  border-radius: var(--radius-md) !important;
}

/* ============================================================
   Light Mode Theme Overrides [data-theme="light"]
   ============================================================ */
[data-theme="light"] {
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
  --surface-bg: rgba(255, 255, 255, 0.9);
  --surface-card: #ffffff;
  --surface-hover: #f1f5f9;
  --border-color: rgba(0, 0, 0, 0.12);
  --border-highlight: rgba(99, 102, 241, 0.4);

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --secondary: #059669;
  --accent: #d97706;
  --danger: #dc2626;
  --info: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.8);
}

[data-theme="light"] .auth-overlay {
  background: radial-gradient(circle at center, rgba(248, 250, 252, 0.98), rgba(226, 232, 240, 0.98));
}

[data-theme="light"] .auth-card {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .auth-header h2 {
  color: #0f172a;
}

[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .company-name {
  color: #1e1b4b;
}

[data-theme="light"] .company-logo-img,
[data-theme="light"] .sidebar-logo-img {
  background: #ffffff;
  border-color: #cbd5e1;
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-right-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .sidebar-company-name {
  color: #0f172a;
}

[data-theme="light"] .sidebar-company-gst {
  color: #64748b;
}

[data-theme="light"] .nav-item {
  color: #334155;
}

[data-theme="light"] .nav-item:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
}

[data-theme="light"] .nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.05));
  color: #4f46e5;
}

[data-theme="light"] .budget-bar {
  background: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .budget-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .filter-select,
[data-theme="light"] .budget-input {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .budget-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .data-card,
[data-theme="light"] .modal-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .custom-table th {
  background: #f1f5f9;
  color: #0f172a;
  border-bottom-color: #cbd5e1;
}

[data-theme="light"] .custom-table td {
  border-bottom-color: #e2e8f0;
  color: #334155;
}

[data-theme="light"] .custom-table tr:nth-child(even) {
  background: #f8fafc;
}

[data-theme="light"] .custom-table tr:hover td {
  background: #f1f5f9;
}

[data-theme="light"] .company-card-item,
[data-theme="light"] .user-card-item {
  background: #f8fafc;
  border-color: #e2e8f0;
}

[data-theme="light"] .company-card-item div[style*="color:white"],
[data-theme="light"] .user-card-item div[style*="color:white"] {
  color: #0f172a !important;
}

[data-theme="light"] .view-title {
  color: #0f172a;
}

[data-theme="light"] h3[style*="color:white"],
[data-theme="light"] h4[style*="color:white"] {
  color: #0f172a !important;
}

[data-theme="light"] .modal-tabs-header {
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .modal-close {
  color: #64748b;
}

[data-theme="light"] .modal-close:hover {
  color: #0f172a;
}

/* ============================================================
   Component Themes & Light Mode Dynamic Overrides
   ============================================================ */
.daily-report-card {
  background: linear-gradient(135deg, rgba(30,41,59,0.9), rgba(15,23,42,0.95));
}

.daily-report-stat-box {
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.daily-report-pending-banner {
  background: rgba(234, 179, 8, 0.12);
  border: 1px dashed rgba(234, 179, 8, 0.5);
  color: #fef08a;
  font-weight: 600;
}

.security-notice-box {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fef08a;
}

.widget-receipt-upload-btn {
  cursor: pointer;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid #eab308;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: #fef08a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.logout-header-btn {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

/* ── Light Mode Component Overrides ── */
[data-theme="light"] .daily-report-card {
  background: #ffffff !important;
  border-color: #f59e0b !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .daily-report-stat-box {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .daily-report-pending-banner {
  background: #fef3c7 !important;
  border: 1px dashed #f59e0b !important;
  color: #92400e !important;
  font-weight: 700 !important;
}

[data-theme="light"] .security-notice-box {
  background: #fef3c7 !important;
  border: 1px solid #f59e0b !important;
  color: #92400e !important;
  font-weight: 600 !important;
}

[data-theme="light"] .security-notice-box strong {
  color: #78350f !important;
}

[data-theme="light"] .widget-receipt-upload-btn {
  background: #fef3c7 !important;
  border: 1px solid #f59e0b !important;
  color: #92400e !important;
  font-weight: 700 !important;
}

[data-theme="light"] .widget-receipt-upload-btn:hover {
  background: #fde68a !important;
}

[data-theme="light"] .logout-header-btn {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fca5a5 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .logout-header-btn:hover {
  background: #fecaca !important;
}

[data-theme="light"] .super-admin-btn {
  background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25) !important;
}

[data-theme="light"] .budget-value-carried {
  color: #2563eb !important;
}

[data-theme="light"] .budget-kpi-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04) !important;
}

/* ── Theme Toggle Button Styles ── */
.theme-toggle-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.15rem !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  border: 1px solid var(--border-color) !important;
  background: rgba(30, 41, 59, 0.8) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.theme-toggle-btn:hover {
  transform: scale(1.08) !important;
  background: rgba(51, 65, 85, 0.9) !important;
}

[data-theme="light"] .theme-toggle-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .theme-toggle-btn:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
  transform: scale(1.08) !important;
}

/* ============================================================
   Complete Light Theme Compatibility System
   ============================================================ */

/* ── Light Mode Scrollbar System ── */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
  border-radius: 4px !important;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8 !important;
}
[data-theme="light"] .sidebar {
  scrollbar-color: #cbd5e1 #f1f5f9 !important;
}
[data-theme="light"] .sidebar::-webkit-scrollbar-track {
  background: #f1f5f9 !important;
}
[data-theme="light"] .sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1 !important;
}

/* ── Light Mode Modals & Tabs ── */
[data-theme="light"] .modal-card {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .modal-header {
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="light"] .modal-title {
  color: #0f172a !important;
}

[data-theme="light"] .modal-tab-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .modal-tab-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .modal-tab-btn.active {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  color: #ffffff !important;
  border-color: #4338ca !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

/* Inner dark form cards inside modals or pages */
[data-theme="light"] div[style*="background:rgba(30,41,59"],
[data-theme="light"] div[style*="background: rgba(30, 41, 59"],
[data-theme="light"] div[style*="background:rgba(15,23,42"],
[data-theme="light"] div[style*="background: rgba(15, 23, 42"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

/* Dark grey card inner containers */
[data-theme="light"] .form-group label,
[data-theme="light"] .modal-card label,
[data-theme="light"] .data-card label {
  color: #334155 !important;
}

/* ── Light Mode Document Pills & File Links ── */
[data-theme="light"] .doc-pill {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 600 !important;
}

[data-theme="light"] .doc-pill:hover {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* ── Light Mode Action Buttons (Secondary, View, Edit) ── */
[data-theme="light"] .action-btn.secondary {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .action-btn.secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

/* ── Light Mode Status Badges ── */
[data-theme="light"] .badge-success,
[data-theme="light"] span[style*="background:rgba(16, 185, 129"],
[data-theme="light"] span[style*="background:rgba(16,185,129"] {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}

[data-theme="light"] .badge-warning,
[data-theme="light"] span[style*="background:rgba(245, 158, 11"],
[data-theme="light"] span[style*="background:rgba(245,158,11"] {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde047 !important;
}

[data-theme="light"] .badge-danger,
[data-theme="light"] span[style*="background:rgba(239, 68, 68"],
[data-theme="light"] span[style*="background:rgba(239,68,68"] {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}

[data-theme="light"] .badge-info,
[data-theme="light"] span[style*="background:rgba(59, 130, 246"],
[data-theme="light"] span[style*="background:rgba(59,130,246"] {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border: 1px solid #93c5fd !important;
}

/* ── Module Container Sub-Card Overrides (Vehicles, Employees, Documents) ── */
[data-theme="light"] .vehicle-card,
[data-theme="light"] .employee-card,
[data-theme="light"] .doc-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4 {
  color: #0f172a !important;
}

/* ── Light Mode Textarea & Form Inputs ── */
[data-theme="light"] textarea,
[data-theme="light"] .form-textarea,
[data-theme="light"] .doc-text-editor {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] input[readonly],
[data-theme="light"] select[disabled] {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border-color: #cbd5e1 !important;
}

/* ── Light Mode Document Viewer & Vehicle Module Cards ── */
[data-theme="light"] .doc-viewer-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .vehicle-main-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .vehicle-empty-log-box {
  background: #f8fafc !important;
  border: 1px dashed #cbd5e1 !important;
  color: #64748b !important;
}

/* ── Light Mode Super Admin & Modal Form Cards ── */
[data-theme="light"] #companyEditForm,
[data-theme="light"] #saSectionLogins form,
[data-theme="light"] #saSectionCompanies form {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* ── Light Mode Mobile Hamburger Toggle & Navigation ── */
[data-theme="light"] .sidebar-toggle {
  color: #0f172a !important;
}

[data-theme="light"] .sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .gst-badge {
  background: #dbeafe !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}

/* ── Global App Footer ── */
.app-footer {
  margin-top: 36px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 100%;
  box-sizing: border-box;
}

.app-footer .footer-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.app-footer .footer-dot {
  color: var(--primary);
  font-weight: bold;
}

.app-footer a.footer-link {
  color: #818cf8;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.app-footer a.footer-link:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Light Theme Overrides for Footer */
[data-theme="light"] .app-footer {
  background: rgba(241, 245, 249, 0.85);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: #64748b;
}

[data-theme="light"] .app-footer .footer-dot {
  color: #4f46e5;
}

[data-theme="light"] .app-footer a.footer-link {
  color: #4f46e5;
}

[data-theme="light"] .app-footer a.footer-link:hover {
  color: #3730a3;
}



