/* ═══════════════════════════════════════════════════════════════════
   DESIGN SYSTEM — Premium Red & Black
   CarWash Pro · Enterprise-Grade UI
   ═══════════════════════════════════════════════════════════════════ */

/* ── COLOR TOKENS ─────────────────────────────────────────────────── */
:root {
  /* Brand */
  --brand-50:  #fef2f2;
  --brand-100: #fee2e2;
  --brand-200: #fecaca;
  --brand-300: #fca5a5;
  --brand-400: #f87171;
  --brand-500: #dc2626;
  --brand-600: #b91c1c;
  --brand-700: #991b1b;
  --brand-800: #7f1d1d;
  --brand-900: #450a0a;

  /* Neutrals */
  --neutral-0:   #ffffff;
  --neutral-50:  #fafafa;
  --neutral-100: #f4f4f5;
  --neutral-200: #e4e4e7;
  --neutral-300: #d4d4d8;
  --neutral-400: #a1a1aa;
  --neutral-500: #71717a;
  --neutral-600: #52525b;
  --neutral-700: #3f3f46;
  --neutral-800: #27272a;
  --neutral-900: #18181b;
  --neutral-950: #09090b;

  /* Semantic */
  --success:     #16a34a;
  --success-bg:  #dcfce7;
  --success-border: #86efac;
  --warning:     #d97706;
  --warning-bg:  #fef3c7;
  --warning-border: #fcd34d;
  --danger:      #dc2626;
  --danger-bg:   #fee2e2;
  --danger-border: #fca5a5;
  --info:        #0891b2;
  --info-bg:     #cffafe;
  --info-border: #67e8f9;

  /* ── LIGHT THEME (default) ── */
  --bg:           #f4f4f5;
  --bg-elevated:  #ffffff;
  --surface:      #ffffff;
  --surface-2:    #fafafa;
  --surface-3:    #f4f4f5;
  --border:       #e4e4e7;
  --border-strong: #d4d4d8;
  --text:         #18181b;
  --text-secondary: #52525b;
  --text-muted:   #71717a;
  --text-on-brand: #ffffff;
  --primary:      #dc2626;
  --primary-hover: #b91c1c;
  --primary-soft:  rgba(220, 38, 38, 0.08);
  --primary-soft-border: rgba(220, 38, 38, 0.2);

  /* Sidebar */
  --sidebar-bg:    #0f0f0f;
  --sidebar-text:  #d4d4d8;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.06);
  --sidebar-active-bg: rgba(220, 38, 38, 0.15);
  --sidebar-active-border: #dc2626;
  --sidebar-section: #71717a;
  --sidebar-w: 260px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.08), 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);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 20px rgba(220, 38, 38, 0.15);

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

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* ── DARK THEME ───────────────────────────────────────────────────── */
html.theme-dark {
  --bg:           #09090b;
  --bg-elevated:  #18181b;
  --surface:      #18181b;
  --surface-2:    #1c1c1f;
  --surface-3:    #27272a;
  --border:       rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text:         #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted:   #71717a;
  --text-on-brand: #ffffff;
  --primary:      #ef4444;
  --primary-hover: #dc2626;
  --primary-soft:  rgba(239, 68, 68, 0.12);
  --primary-soft-border: rgba(239, 68, 68, 0.25);

  --sidebar-bg:    #0a0a0a;
  --sidebar-hover: rgba(255,255,255,0.04);

  --shadow-xs:  0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.3);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 25px rgba(239, 68, 68, 0.2);

  --success:     #22c55e;
  --success-bg:  rgba(34,197,94,0.12);
  --success-border: rgba(34,197,94,0.3);
  --warning:     #f59e0b;
  --warning-bg:  rgba(245,158,11,0.12);
  --warning-border: rgba(245,158,11,0.3);
  --danger:      #ef4444;
  --danger-bg:   rgba(239,68,68,0.12);
  --danger-border: rgba(239,68,68,0.3);
  --info:        #06b6d4;
  --info-bg:     rgba(6,182,212,0.12);
  --info-border: rgba(6,182,212,0.3);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-base), color var(--transition-base);
}

/* RTL/LTR support */
html[dir="rtl"] body { direction: rtl; }
html[dir="ltr"] body { direction: ltr; }

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

::selection { background: var(--primary); color: #fff; }

/* ── TYPOGRAPHY ───────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.92rem; }
h6 { font-size: 0.85rem; }

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary, .btn-primary-s, .btn-main {
  background: var(--primary) !important;
  color: var(--text-on-brand) !important;
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover, .btn-primary-s:hover, .btn-main:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  box-shadow: var(--shadow-glow);
}

.btn-secondary, .btn-ghost {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-strong) !important;
}
.btn-secondary:hover, .btn-ghost:hover {
  background: var(--surface-3) !important;
  color: var(--text) !important;
  border-color: var(--text-muted) !important;
}

.btn-outline-primary {
  background: transparent !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: var(--text-on-brand) !important;
}

.btn-danger {
  background: var(--danger) !important;
  color: #fff !important;
  border-color: var(--danger) !important;
}
.btn-danger:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

.btn-success {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}

.btn-dark {
  background: var(--neutral-900) !important;
  color: var(--neutral-0) !important;
  border-color: var(--neutral-900) !important;
}
html.theme-dark .btn-dark {
  background: var(--neutral-700) !important;
  border-color: var(--neutral-600) !important;
}

.btn-light {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.btn-light:hover {
  background: var(--surface-3) !important;
}

.btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.8rem !important;
  border-radius: var(--radius-sm) !important;
}
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-soft-border);
}

/* ── INPUTS / FORMS ───────────────────────────────────────────────── */
input, select, textarea, .f-input, .f-select, .form-control {
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}
input:focus, select:focus, textarea:focus,
.f-input:focus, .f-select:focus, .form-control:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }

html.theme-dark input,
html.theme-dark select,
html.theme-dark textarea,
html.theme-dark .f-input,
html.theme-dark .f-select,
html.theme-dark .form-control {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

label, .f-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.form-check-input {
  width: 1rem; height: 1rem;
  accent-color: var(--primary);
}
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

/* ── CARDS ─────────────────────────────────────────────────────────── */
.card, .card-s {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-s { padding: 1.5rem; }
.c-head {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.c-body { padding: 1.5rem; }

/* ── TABLES ───────────────────────────────────────────────────────── */
.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.ds-table thead th {
  padding: 0.7rem 1rem;
  text-align: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ds-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.ds-table tbody tr:last-child { border-bottom: none; }
.ds-table tbody tr:hover { background: var(--primary-soft); }
.ds-table tbody td {
  padding: 0.7rem 1rem;
  vertical-align: middle;
}

/* ── BADGES ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-full, .badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge-full::before, .badge-success::before { background: var(--success); }
.badge-partial, .badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge-partial::before, .badge-warning::before { background: var(--warning); }
.badge-zero, .badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge-zero::before, .badge-danger::before { background: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge-info::before { background: var(--info); }
.badge-neutral { background: var(--surface-3); color: var(--text-secondary); border-color: var(--border); }
.badge-neutral::before { background: var(--text-muted); }

/* ── ALERTS ───────────────────────────────────────────────────────── */
.alert-s {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  animation: ds-slideDown 0.3s ease;
}
.alert-s.success, .alert-s.ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.alert-s.danger, .alert-s.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.alert-s.warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.alert-s.info { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }

.alert-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--danger);
  animation: ds-slideDown 0.4s ease;
}
.alert-banner .al-icon { font-size: 1.1rem; flex-shrink: 0; }
.alert-banner a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  margin-inline-start: auto;
}

/* ── MODALS ───────────────────────────────────────────────────────── */
.modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2000 !important;
  display: none !important;
  overflow-y: auto !important;
  padding: 1rem !important;
  background: rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal.show { display: flex !important; align-items: flex-start; justify-content: center; }
.modal-dialog {
  position: relative !important;
  width: auto !important;
  max-width: 640px !important;
  margin: 2rem auto !important;
  z-index: 2010 !important;
  pointer-events: auto !important;
}
.modal-content {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
}
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1990 !important;
  background: rgba(0,0,0,0.5) !important;
}
body.modal-open { overflow: hidden !important; }

/* ── DROPDOWN ─────────────────────────────────────────────────────── */
.dropdown-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  min-width: 160px;
}
.dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--primary-soft); color: var(--primary); }
.dropdown-divider { border-color: var(--border); margin: 0.3rem 0; }

/* ── STAT CARDS ───────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.scard, .stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  animation: ds-riseIn 0.4s ease both;
}
.scard:hover, .stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-soft-border);
  box-shadow: var(--shadow-md);
}
.scard::before, .stat-card::before {
  content: '';
  position: absolute;
  top: 0; inset-inline-start: 0;
  width: 100%; height: 3px;
  background: var(--accent-clr, var(--primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.scard-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
  background: var(--primary-soft);
}
.scard-label, .s-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scard-value, .s-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.scard-sub, .s-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.scard-glow {
  position: absolute;
  bottom: -30px; inset-inline-start: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--accent-clr, var(--primary));
  opacity: 0.04;
  filter: blur(25px);
  pointer-events: none;
}
.s-icon { font-size: 1.3rem; margin-bottom: 0.5rem; display: block; }

/* ── PANELS ───────────────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.panel-head {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.panel-head h5 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  display: flex; align-items: center; gap: 0.4rem;
}
.panel-head a {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}
.panel-head a:hover { opacity: 1; }
.panel-body { padding: 1rem 1.2rem; }

/* ── INVOICE TABLE ────────────────────────────────────────────────── */
.inv-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.inv-table thead tr th {
  padding: 0.6rem 0.9rem;
  text-align: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.inv-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.inv-table tbody tr:last-child { border-bottom: none; }
.inv-table tbody tr:hover { background: var(--primary-soft); }
.inv-table tbody td {
  padding: 0.7rem 0.9rem;
  vertical-align: middle;
  white-space: nowrap;
}
.inv-id { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inv-name { font-weight: 600; color: var(--text); }
.inv-car {
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface-3);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
}
.inv-amt {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.inv-cashier { font-size: 0.75rem; color: var(--text-muted); }
.inv-time { font-size: 0.72rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inv-view {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-soft-border);
  background: var(--primary-soft);
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.inv-view:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── FILTER BAR ───────────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.2rem;
}
.filter-bar label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 0.22rem;
}
.filter-bar input, .filter-bar select {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  transition: border-color var(--transition-fast);
}
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--primary);
  outline: none;
}

/* ── SEARCH ───────────────────────────────────────────────────────── */
.search-wrapper {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 5px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.search-wrapper input {
  border: none !important;
  outline: none;
  flex: 1;
  padding: 0.5rem 0.9rem;
  background: transparent !important;
  box-shadow: none !important;
}

/* ── BOOKING REQUESTS ─────────────────────────────────────────────── */
.req-list { display: grid; gap: 0.65rem; }
.req-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.8rem;
  background: var(--surface-2);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  transition: border-color var(--transition-fast);
}
.req-item:hover { border-color: var(--primary-soft-border); }
.req-main strong { font-size: 0.86rem; color: var(--text); display: block; margin-bottom: 0.18rem; }
.req-meta { font-size: 0.75rem; color: var(--text-muted); }
.req-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.req-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.req-new { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.req-contacted { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.req-done { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.req-cancelled { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }

/* ── EMPTY STATES ─────────────────────────────────────────────────── */
.empty-row td {
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.empty-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.4; }
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state-text { font-size: 0.95rem; margin: 0; }

/* ── DASHBOARD WRAPPER ────────────────────────────────────────────── */
.dash-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.dash-header-left h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.dash-header-left p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.live-dot::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: ds-pulse 1.8s infinite;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* ── SCROLLABLE TABLE ─────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; }

/* ── PAGE SPECIFIC: Invoice View ──────────────────────────────────── */
.inv-status { border-radius: var(--radius-md); padding: 0.82rem 1.1rem; display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 0.95rem; margin-bottom: 1rem; }
.inv-status.paid   { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.inv-status.partial { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.inv-status.unpaid  { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

.inv-doc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; max-width: 820px; margin: 0 auto 1.2rem; box-shadow: var(--shadow-sm); }
.inv-head { background: var(--surface); padding: 1.15rem 1.4rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; border-bottom: 2px solid var(--text); }
.shop-side { display: flex; align-items: flex-start; gap: 0.75rem; }
.shop-logo-img { width: 52px; height: 52px; object-fit: contain; border-radius: var(--radius-md); background: #050505; padding: 4px; flex-shrink: 0; border: 1px solid var(--border); display: block; }
.shop-logo-fallback { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.shop-name { font-size: 1.08rem; font-weight: 800; color: var(--text); }
.shop-sub, .shop-contact { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.16rem; }
.inv-side { text-align: start; color: var(--text-secondary); }
.inv-num { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.inv-meta { font-size: 0.78rem; margin-top: 0.2rem; }
.inv-body { padding: 1.25rem 1.4rem; }
.cust-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.8rem 0.9rem; margin-bottom: 1rem; }
.cust-item .ci-lbl { font-size: 0.66rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.45px; margin-bottom: 0.18rem; }
.cust-item .ci-val { font-size: 0.92rem; font-weight: 700; }
.sec-hd { font-size: 0.75rem; font-weight: 800; color: var(--text); text-transform: uppercase; letter-spacing: 0.45px; display: flex; align-items: center; gap: 0.45rem; margin: 1rem 0 0.45rem; }
.sec-hd::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.lt { width: 100%; border-collapse: separate; border-spacing: 0; }
.lt thead th { background: var(--surface-2); padding: 0.55rem 0.72rem; font-size: 0.69rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.45px; border-bottom: 1px solid var(--border); }
.lt tbody td { padding: 0.62rem 0.72rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.lt tbody tr:last-child td { border-bottom: none; }
.totals-qr { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1rem; gap: 1rem; flex-wrap: wrap; }
.qr-box { text-align: center; }
.qr-box img { width: 88px; height: 88px; border: 1px solid var(--border); border-radius: var(--radius-md); display: block; }
.qr-box .ql { font-size: 0.66rem; color: var(--text-muted); margin-top: 0.3rem; }
.totals-box-s { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.9rem 1rem; min-width: 250px; }
.tr-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 0.34rem; }
.tr-row.big { font-size: 1rem; font-weight: 800; padding-top: 0.42rem; border-top: 1.5px solid var(--border); margin-top: 0.25rem; }
.red { color: var(--danger); } .grn { color: var(--success); }
.thank-bar { background: var(--surface-2); padding: 0.75rem 1.4rem; text-align: center; font-size: 0.82rem; color: var(--text-secondary); border-top: 1px solid var(--border); }
.thank-bar strong { color: var(--text); }
.pay-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.2rem; max-width: 760px; margin: 0 auto 1rem; }
.pay-card h6 { font-size: 0.98rem; font-weight: 800; margin-bottom: 0.7rem; display: flex; align-items: center; gap: 0.4rem; }
.pi { border: 1px solid var(--border-strong); border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem; padding: 0.5rem 0.8rem; transition: border-color var(--transition-fast); background: var(--surface); color: var(--text); }
.pi:focus { border-color: var(--primary); outline: none; }

/* ── PAGE SPECIFIC: Invoice New ───────────────────────────────────── */
.inv-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1rem; }
.inv-section .sec-hd { padding: 0.85rem 1.2rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; margin: 0; }
.inv-section .sec-hd::after { display: none; }
.inv-section .sec-hd h6 { margin: 0; font-size: 0.92rem; font-weight: 700; display: flex; align-items: center; gap: 0.4rem; }
.inv-section .sec-bd { padding: 1rem 1.2rem; }
.lines-tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.lines-tbl thead th { background: var(--surface-2); padding: 0.55rem 0.7rem; font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.lines-tbl tbody td { padding: 0.45rem 0.5rem; vertical-align: middle; }
.lines-tbl tbody tr { border-bottom: 1px solid var(--border); }
.line-num { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.88rem; padding: 0.4rem 0.6rem; width: 100%; transition: border-color var(--transition-fast); text-align: start; }
.line-num:focus { border-color: var(--primary); outline: none; }
.line-sel { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.85rem; padding: 0.4rem 0.6rem; width: 100%; transition: border-color var(--transition-fast); color: var(--text); }
.line-sel:focus { border-color: var(--primary); outline: none; }
.line-total { font-weight: 700; font-size: 0.9rem; color: var(--text); text-align: start; white-space: nowrap; }
.del-btn { background: transparent; border: 1px solid var(--danger-border); border-radius: var(--radius-sm); color: var(--danger); cursor: pointer; padding: 0.3rem 0.5rem; font-size: 0.85rem; transition: background var(--transition-fast); line-height: 1; }
.del-btn:hover { background: var(--danger-bg); }
.totals-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.total-item .tl { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.2rem; }
.total-item .tv { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
#custDropdown { transition: opacity var(--transition-fast); }
.car-opt-btn { background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 0.8rem; cursor: pointer; transition: all var(--transition-fast); text-align: start; color: var(--text); font-family: inherit; }
.car-opt-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.car-opt-btn strong { display: block; margin-bottom: 0.3rem; }

/* ── PAGE SPECIFIC: Customer Details ──────────────────────────────── */
.cust-header { background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%); color: #fff; padding: 2rem; border-radius: var(--radius-lg); margin-bottom: 2rem; position: relative; overflow: hidden; }
.cust-header::before { content: ''; position: absolute; top: -50%; right: -20%; width: 300px; height: 300px; background: var(--primary); opacity: 0.08; border-radius: 50%; filter: blur(60px); }
.cust-photo { width: 140px; height: 140px; border-radius: var(--radius-lg); object-fit: cover; border: 3px solid rgba(255,255,255,0.2); box-shadow: var(--shadow-lg); }
.cust-info { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2rem; }
.info-card { background: var(--surface); border-inline-start: 4px solid var(--primary); padding: 1.2rem; border-radius: var(--radius-md); }
.info-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; }
.info-value { font-size: 1.4rem; font-weight: 700; margin-top: 0.4rem; color: var(--text); }
.bill-row { padding: 1rem; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 80px 1fr 120px 120px 120px 100px; gap: 1rem; align-items: center; }
.bill-row:hover { background: var(--primary-soft); }
.status-paid { background: var(--success-bg); color: var(--success); padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700; display: inline-block; }
.status-partial { background: var(--warning-bg); color: var(--warning); padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700; display: inline-block; }
.status-unpaid { background: var(--danger-bg); color: var(--danger); padding: 0.3rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 700; display: inline-block; }
.cars-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.car-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; transition: all var(--transition-fast); cursor: pointer; }
.car-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-soft-border); }
.car-card-img { width: 100%; height: 120px; object-fit: cover; background: var(--surface-3); }
.car-card-body { padding: 0.8rem; }
.car-card-title { font-weight: 700; font-size: 0.9rem; margin: 0; }
.car-card-text { font-size: 0.75rem; color: var(--text-muted); margin: 0.3rem 0 0; }

/* ── PAGE SPECIFIC: Accounting ────────────────────────────────────── */
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-xs); }
.summary-card .label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.summary-card .value { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.2rem; }
.summary-card .sub { font-size: 0.82rem; color: var(--text-muted); }
.income { color: var(--success); }
.expense { color: var(--danger); }
.category-badge { display: inline-block; padding: 0.3rem 0.7rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; }
.cat-loan { background: var(--warning-bg); color: var(--warning); }
.cat-salary { background: var(--info-bg); color: var(--info); }
.cat-rent { background: rgba(236,72,153,0.1); color: #ec4899; }
.cat-utilities { background: rgba(99,102,241,0.1); color: #6366f1; }
.cat-sales { background: var(--success-bg); color: var(--success); }
.cat-other { background: var(--surface-3); color: var(--text-secondary); }
.type-income { color: var(--success); font-weight: 700; }
.type-expense { color: var(--danger); font-weight: 700; }
.value-positive { color: var(--success); }
.value-negative { color: var(--danger); }
.source-row-invoice { background-color: var(--success-bg); }
.source-row-purchase { background-color: var(--danger-bg); }
.source-note-invoice { font-size: 0.7rem; color: var(--success); }
.source-note-purchase { font-size: 0.7rem; color: var(--danger); }
.source-linked { font-size: 0.8rem; color: var(--text-muted); }

/* Accounting Customers */
.search-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.cust-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; cursor: pointer; transition: all var(--transition-fast); }
.cust-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-soft-border); }
.cust-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.cust-detail { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
.stat-mini { background: var(--surface-2); padding: 0.8rem; border-radius: var(--radius-md); text-align: center; }
.stat-mini .label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 0.3rem; }
.stat-mini .value { font-size: 1.2rem; font-weight: 700; }
.cust-wrap { display: flex; justify-content: space-between; align-items: flex-start; }
.cust-main { flex: 1; }
.cust-phone { color: var(--primary); text-decoration: none; }
.value-accent { color: var(--primary); }
.value-discount { color: var(--warning); }
.value-paid { color: var(--success); }
.value-due-danger { color: var(--danger); }
.value-due-ok { color: var(--text-muted); }
.value-last-visit { font-size: 0.9rem; }
.empty-search { text-align: center; padding: 3rem; }
.empty-search-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-search-text { color: var(--text-muted); font-size: 1.1rem; margin: 0; }

/* Accounting Reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.report-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem; box-shadow: var(--shadow-xs); }
.report-item .label { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.report-item .amount { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.3rem; }
.report-item .percent { font-size: 0.82rem; color: var(--text-muted); }
.report-item.income { border-inline-start: 4px solid var(--success); }
.report-item.expense { border-inline-start: 4px solid var(--danger); }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th { background: var(--surface-2); padding: 1rem; text-align: inherit; font-size: 0.85rem; font-weight: 700; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.summary-table td { padding: 1rem; border-bottom: 1px solid var(--border); }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table .label-col { font-weight: 600; color: var(--text); }
.summary-table .amount-col { text-align: start; font-weight: 700; font-family: monospace; }

/* ── PAGE SPECIFIC: Booking Requests ──────────────────────────────── */
.bookdash {
  --b-bg: var(--surface-2);
  --b-surface: var(--surface);
  --b-surface2: var(--surface-2);
  --b-border: var(--border);
  --b-text: var(--text);
  --b-muted: var(--text-muted);
  background: var(--b-bg);
  border: 1px solid var(--b-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.bookdash .card-s { background: var(--b-surface); border-color: var(--b-border); box-shadow: none; }
.bookdash .c-head { border-bottom-color: var(--b-border); }
.bookdash .c-head h5 { color: var(--b-text); }
.bookdash .tbl thead th { background: var(--b-surface2); color: var(--b-muted); border-bottom-color: var(--b-border); }
.bookdash .tbl tbody td { color: var(--text); border-bottom-color: var(--b-border); }
.bookdash .tbl tbody tr:hover { background: var(--primary-soft); }
.bookdash .f-input, .bookdash .f-select {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.bookdash .f-input:focus, .bookdash .f-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.bookdash .btn-ghost { color: var(--text-secondary); border-color: var(--border); }
.bookdash .btn-ghost:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* ── PAGE SPECIFIC: Customers Table ───────────────────────────────── */
.table-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 1rem;
}
.custom-table { width: 100%; border-collapse: collapse; margin: 0; }
.custom-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 0.85rem 1.2rem;
  text-align: inherit;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.04em;
}
.custom-table td {
  padding: 0.85rem 1.2rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background var(--transition-fast);
}
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--primary-soft); }
.cust-name-wrapper { display: flex; align-items: center; gap: 12px; }
.cust-avatar {
  width: 38px; height: 38px;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; color: var(--primary);
  font-size: 0.9rem;
}
.badge-car {
  background: var(--success-bg); color: var(--success);
  padding: 4px 10px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 600;
}
.action-menu { display: flex; gap: 8px; justify-content: flex-end; }
.btn-action {
  width: 34px; height: 34px; border-radius: var(--radius-md); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); transition: all var(--transition-fast); color: var(--text-muted);
  cursor: pointer;
}
.btn-action:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft-border); }
.btn-action.text-danger { color: var(--danger); }
.btn-action.text-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }

/* Customers page mobile */
@media (max-width: 768px) {
  .custom-table thead { display: none; }
  .custom-table td {
    display: block; text-align: start; padding: 10px 20px;
    border: none; position: relative; padding-inline-end: 50%;
  }
  .custom-table td::before {
    content: attr(data-label); position: absolute; inset-inline-end: 20px;
    font-weight: bold; color: var(--text-muted); font-size: 0.8rem;
  }
  .custom-table tr { border-bottom: 4px solid var(--surface-3); display: block; padding: 10px 0; }
  .action-menu { justify-content: center; margin-top: 10px; }
}

/* ── PAGE SPECIFIC: Products/Services/Suppliers (form-based pages) ─ */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem; }
.form-title { margin: 0 0 0.7rem; font-size: 1rem; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.field label { display: block; color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.22rem; }
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.53rem 0.65rem;
  font-family: inherit;
  font-size: 0.86rem;
}
.field.full { grid-column: 1 / -1; }
.field textarea { min-height: 90px; resize: vertical; }
.msg { margin-top: 0.55rem; font-size: 0.85rem; }
.ok { color: var(--success); }
.err { color: var(--danger); }

/* ── PAGE SPECIFIC: Client Portal Landing ─────────────────────────── */
.wrap { width: min(860px, 100%); margin: 0 auto; display: grid; gap: 0.9rem; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.1rem; box-shadow: var(--shadow-md); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.logo { width: 40px; height: 40px; border-radius: var(--radius-md); display: grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--primary), var(--primary-hover)); }
.logo-img { width: 40px; height: 40px; border-radius: var(--radius-md); object-fit: cover; border: 1px solid var(--border); background: #050505; display: block; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-top: 0.8rem; }
.d { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.65rem 0.75rem; }
.d .t { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 0.2rem; }
.d .v { font-size: 0.9rem; }

/* ── PAGE SPECIFIC: Error 500 ─────────────────────────────────────── */
body.error-page {
  margin: 0; min-height: 100vh; display: grid; place-items: center;
  padding: 1rem; font-family: Cairo, sans-serif;
  color: #f8fafc;
  background: radial-gradient(75% 50% at 10% -10%, rgba(220,38,38,0.15), transparent 62%),
              radial-gradient(65% 45% at 95% 110%, rgba(220,38,38,0.08), transparent 62%),
              #09090b;
}
body.error-page * { box-sizing: border-box; }
body.error-page .error-card { width: min(560px, 100%); background: #18181b; border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius-lg); padding: 1.2rem; box-shadow: var(--shadow-xl); }
body.error-page h1 { margin: 0 0 0.45rem; font-size: 1.2rem; }
body.error-page p { margin: 0.2rem 0; color: #a1a1aa; line-height: 1.7; }
body.error-page .actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
body.error-page .btn { text-decoration: none; border-radius: var(--radius-md); padding: 0.58rem 0.9rem; font-size: 0.86rem; font-weight: 700; border: 1px solid transparent; }
body.error-page .btn.main { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff; }
body.error-page .btn.ghost { background: transparent; border-color: rgba(255,255,255,0.2); color: #e2e8f0; }

/* ── API Docs ─────────────────────────────────────────────────────── */
body.api-docs { font-family: sans-serif; margin: 2rem; }
body.api-docs a { color: var(--primary); }

/* ── Customers page card style ────────────────────────────────────── */
.customer-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.2rem; transition: all var(--transition-fast); }
.customer-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.customer-avatar { width: 50px; height: 50px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 0.5rem; font-size: 1.1rem; }
.customer-stat { display: flex; justify-content: space-between; margin: 0.4rem 0; font-size: 0.85rem; }
.car-photo-preview { width: 100%; max-width: 200px; height: 150px; object-fit: cover; border-radius: var(--radius-md); margin: 0.5rem 0; }

/* ── ANIMATIONS ───────────────────────────────────────────────────── */
@keyframes ds-riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes ds-slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes ds-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.anim { animation: ds-riseIn 0.4s ease both; }
.scard:nth-child(1) { animation-delay: 0.04s; }
.scard:nth-child(2) { animation-delay: 0.08s; }
.scard:nth-child(3) { animation-delay: 0.12s; }
.scard:nth-child(4) { animation-delay: 0.16s; }
.scard:nth-child(5) { animation-delay: 0.20s; }
.scard:nth-child(6) { animation-delay: 0.24s; }
.main-grid > * { animation: ds-riseIn 0.4s ease 0.22s both; }
.main-grid > *:last-child { animation-delay: 0.28s; }

/* ── PRINT ────────────────────────────────────────────────────────── */
@media print {
  @page { size: A5; margin: 7mm; }
  body { background: #fff !important; font-size: 9.5pt; }
  .app-navbar, .no-print, .pay-card, .inv-status, .action-row, .app-footer { display: none !important; }
  .main-content { margin-inline-start: 0 !important; }
  .page-body { padding: 0 !important; }
  .inv-doc { max-width: 100% !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; margin: 0 !important; }
  .inv-head, .thank-bar, .lt thead th, .cust-strip, .totals-box-s { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .inv-head { padding: 7mm 9mm !important; }
  .inv-body { padding: 4mm 9mm !important; }
  .thank-bar { padding: 4mm 9mm !important; }
}

/* ── INVOICES PAGE stat cards ─────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; inset-inline-start: 0;
  width: 100%; height: 3px;
  background: var(--c, var(--primary));
}

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .stats-row { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
  .dash-wrapper { padding: 1rem; }
  .stats-row { grid-template-columns: 1fr 1fr !important; gap: 0.75rem; }
  .cust-info { grid-template-columns: 1fr; }
  .bill-row { grid-template-columns: 1fr 1fr; }
  .details, .grid { grid-template-columns: 1fr; }
  .main-grid { gap: 1rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .totals-bar { flex-direction: column; align-items: stretch; }
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr !important; }
  .scard-value, .s-value { font-size: 1.4rem; }
  .dash-header { flex-direction: column; align-items: flex-start; }
  .summary-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
}

/* ── UTILITY CLASSES ──────────────────────────────────────────────── */
.container-fluid { max-width: 1400px; margin: 0 auto; padding-inline: 1.25rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 0.75rem; }
.gap-2 { gap: 0.5rem; }
.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.text-center { text-align: center; }
.text-end { text-align: end; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.small { font-size: 0.85rem; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.bg-primary { background: var(--primary) !important; color: #fff !important; }

/* ── LANGUAGE SWITCHER ────────────────────────────────────────────── */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2);
}
.lang-switcher button {
  background: transparent;
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.lang-switcher button.active {
  background: var(--primary);
  color: #fff;
}
.lang-switcher button:hover:not(.active) {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ── THEME TOGGLE BUTTON ──────────────────────────────────────────── */
.mode-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1rem;
  padding: 0;
}
.mode-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-soft-border);
}
