/*
 * style.css — Design system for Lallubhai Amichand ERP
 * Theming via CSS custom properties.
 */

/* ── CSS Custom Properties ───────────────────────────────────────── */

:root {
  /* Primary — fixed brand accent (gold), no longer switchable */
  --color-primary:        #EEBC2E;
  --color-primary-dark:   #C39A26;
  --color-primary-light:  rgba(238,188,46,.12);
  --color-primary-ring:   rgba(238,188,46,.20);
  /* Gold is a high-luminance hue — white text on it fails WCAG AA contrast.
     Anything using --color-primary/--color-primary-dark as a solid background
     must pair it with this dark text color, not white. */
  --color-primary-text:   #09090B;
  /* The reverse case: brand-colored TEXT/icon-stroke/link sitting directly on
     a white or pale surface. The bright base gold measures ~1.8:1 there too —
     use this darker, text-safe gold (~5.2:1 on white) instead. */
  --color-primary-strong: #8E6B0B;
  --shadow-glow:          0 10px 32px rgba(238,188,46,.333);
  --app-bg:               #f4f6f9;

  --color-brand:          var(--color-primary);
  --color-brand-ring:     var(--color-primary-ring);

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

  /* Semantic colors */
  --color-success:        #059669;
  --color-success-bg:     #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-success-text:   #047857;
  --color-warning:        #d97706;
  --color-warning-bg:     #fffbeb;
  --color-warning-border: #fde68a;
  --color-warning-text:   #b45309;
  --color-danger:         #dc2626;
  --color-danger-bg:      #fef2f2;
  --color-danger-border:  #fecaca;
  --color-danger-text:    #b91c1c;
  --color-info:           #2563eb;
  --color-info-bg:        #eff6ff;
  --color-info-border:    #bfdbfe;
  --color-info-text:      #1d4ed8;
  --color-neutral-bg:     #f1f5f9;
  --color-neutral-text:   #475569;
  --color-neutral-border: #e2e8f0;
  --color-purple:         #7c3aed;
  --color-purple-bg:      #f5f3ff;
  --color-purple-border:  #ddd6fe;
  --color-purple-text:    #6d28d9;

  /* Spacing scale */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  /* Type scale */
  --text-2xs: 10.5px; --text-xs: 11px; --text-sm: 12.5px; --text-base: 13.5px;
  --text-md: 15px; --text-lg: 17px; --text-xl: 19px;
  --font-weight-regular: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700;

  /* Surfaces / text — light values; dark overrides below */
  --surface:        #ffffff;
  --surface-alt:    #f8fafc;
  --text-primary:   var(--gray-900);
  --text-secondary: var(--gray-500);
  --text-muted:     var(--gray-400);

  /* Shadow scale */
  --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 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.10), 0 3px 8px rgba(0,0,0,0.05);
  --shadow-xl:  0 20px 48px rgba(0,0,0,0.14), 0 6px 16px rgba(0,0,0,0.06);

  /* Border */
  --border-light:  #f1f5f9;
  --border-base:   #e2e8f0;
  --border-strong: #cbd5e1;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 20px;

  /* Sidebar rail — intentionally always dark, regardless of light/dark app mode */
  --sidebar-bg:            #101013;
  --sidebar-border:        #1c1c22;
  --sidebar-text:          #e4e4e7;
  --sidebar-text-muted:    #a1a1aa;
  --sidebar-icon-muted:    #71717a;
  --sidebar-section-label: #3f3f46;
  --sidebar-signout-muted: #52525b;
}

/* ── Dark mode ────────────────────────────────────────────────────── */

html[data-theme="dark"] {
  --app-bg:      #101215;
  --surface:     #17191d;
  --surface-alt: #1c1f24;

  --text-primary:   #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted:     #6b7280;

  --border-light:  #23262b;
  --border-base:   #2b2e34;
  --border-strong: #3a3e46;

  --color-primary-light: rgba(238,188,46,.18);
  --color-primary-ring:  rgba(238,188,46,.30);

  --color-success-bg: rgba(5,150,105,.15);  --color-success-text: #34d399;
  --color-warning-bg: rgba(217,119,6,.15);  --color-warning-text: #fbbf24;
  --color-danger-bg:  rgba(220,38,38,.15);  --color-danger-text:  #f87171;
  --color-info-bg:    rgba(37,99,235,.15);  --color-info-text:    #60a5fa;
  --color-neutral-bg: rgba(255,255,255,.06); --color-neutral-text: #cbd5e1;
  --color-purple-bg:  rgba(124,58,237,.18); --color-purple-text: #a78bfa;
}

/* ── Base ────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--app-bg);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', ui-sans-serif, system-ui, -apple-system, sans-serif;
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 150ms ease, color 150ms ease;
}

/* ── Scrollbar ───────────────────────────────────────────────────── */

::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Keyframes ───────────────────────────────────────────────────── */

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-10px) rotate(-1deg); }
  66%       { transform: translateY(-5px) rotate(1deg); }
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(0.97) translateY(6px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Animations ──────────────────────────────────────────────────── */

.login-logo      { animation: float 4s ease-in-out infinite; }
.login-card      { animation: fadeSlide 0.5s cubic-bezier(0.16,1,0.3,1) both; }
.animate-fade-in { animation: fade-in 180ms ease-out; }
.animate-pop-in  { animation: pop-in 200ms cubic-bezier(0.16,1,0.3,1); }
.animate-slide-down { animation: slide-down 180ms ease-out; }

/* ── Card ────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-base);
  box-shadow: var(--shadow-xs);
}

.card-hover {
  transition: box-shadow 200ms, transform 200ms, border-color 200ms;
}
.card-hover:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

/* ── Buttons — shared base ───────────────────────────────────────── */

.btn, .btn-primary, .btn-secondary, .btn-ghost,
.btn-danger, .btn-success, .btn-warn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: all 150ms ease;
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn:disabled, .btn-primary:disabled, .btn-secondary:disabled,
.btn-ghost:disabled, .btn-danger:disabled, .btn-success:disabled,
.btn-warn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
}

/* Focus visible — keyboard navigation */
.btn:focus-visible, .btn-primary:focus-visible, .btn-secondary:focus-visible,
.btn-ghost:focus-visible, .btn-danger:focus-visible, .btn-success:focus-visible,
.btn-warn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-primary-text);
  box-shadow: 0 1px 3px var(--color-primary-ring);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(0.93);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); filter: brightness(0.87); }

/* Secondary */
.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--gray-400);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:active:not(:disabled) { background: var(--border-light); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 12px;
  font-weight: 500;
}
.btn-ghost:hover:not(:disabled) { background: var(--border-light); color: var(--text-primary); }
.btn-ghost:active:not(:disabled) { background: var(--border-base); }

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 1px 3px rgba(220,38,38,0.25);
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(0.92);
  box-shadow: 0 4px 12px rgba(220,38,38,0.35);
  transform: translateY(-1px);
}

/* Success */
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 1px 3px rgba(5,150,105,0.25);
}
.btn-success:hover:not(:disabled) {
  filter: brightness(0.92);
  box-shadow: 0 4px 12px rgba(5,150,105,0.35);
  transform: translateY(-1px);
}

/* Warn */
.btn-warn {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  box-shadow: 0 1px 3px rgba(217,119,6,0.25);
}
.btn-warn:hover:not(:disabled) {
  filter: brightness(0.92);
  box-shadow: 0 4px 12px rgba(217,119,6,0.35);
  transform: translateY(-1px);
}

/* ── Button Sizes ────────────────────────────────────────────────── */

.btn-sm  { padding: 5px 11px !important; font-size: 12px !important; gap: 4px !important; border-radius: var(--radius-sm) !important; }
.btn-xs  { padding: 3px 8px  !important; font-size: 11px !important; gap: 3px !important; border-radius: 5px !important; font-weight: 500 !important; }
.btn-lg  { padding: 10px 22px !important; font-size: 14px !important; border-radius: var(--radius-lg) !important; }

/* ── Icon button ─────────────────────────────────────────────────── */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  background: transparent;
  transition: background 150ms, color 150ms;
  outline: none;
}
.icon-btn:hover { background: var(--border-light); color: var(--text-primary); }
.icon-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.icon-btn.danger:hover { background: var(--color-danger-bg); color: var(--color-danger); }

/* ── Form Input ──────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color 150ms, box-shadow 150ms;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}
.input::placeholder { color: var(--text-muted); }
.input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}
.input:disabled { background: var(--surface-alt); color: var(--text-muted); cursor: not-allowed; }

/* Textarea */
textarea.input { resize: vertical; line-height: 1.5; }

/* Select */
select.input { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; -webkit-appearance: none; appearance: none; }

/* ── Form Label ──────────────────────────────────────────────────── */

.label {
  display: block;
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
  line-height: 1;
}

/* ── Page Heading ────────────────────────────────────────────────── */

.page-title {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-sub {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

/* ── Page Header Block ───────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Segmented Control ───────────────────────────────────────────── */

.seg {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 150ms;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  font-family: inherit;
}
.seg-btn:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }

.seg-btn-active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Table ───────────────────────────────────────────────────────── */

.table-th {
  text-align: left;
  padding: 10px 14px;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-alt);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-base);
}

.table-td {
  padding: 11px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  line-height: 1.4;
}

.table-row {
  transition: background-color 100ms;
}
.table-row:hover { background: var(--surface-alt); }

/* ── Status Pill / Badge ─────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill-neutral { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.pill-success { background: var(--color-success-bg); color: var(--color-success-text); }
.pill-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.pill-danger  { background: var(--color-danger-bg);  color: var(--color-danger-text); }
.pill-info    { background: var(--color-info-bg);    color: var(--color-info-text); }
.pill-brand   { background: var(--color-primary-light); color: var(--color-primary-dark); }
.pill-purple  { background: var(--color-purple-bg); color: var(--color-purple-text); }
.pill-sm      { padding: 2px 8px; font-size: var(--text-2xs); }

/* ── Divider ─────────────────────────────────────────────────────── */

.divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

/* ── Topbar ──────────────────────────────────────────────────────── */

#topbar { flex-shrink: 0; position: sticky; top: 0; z-index: 20; }
#topbar-inner {
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px; height: 54px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
#topbar-title {
  font-size: var(--text-md); font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em; margin: 0;
}

/* ── Modal overlay ───────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade-in 150ms ease-out;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: pop-in 200ms cubic-bezier(0.16,1,0.3,1);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.modal-header-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-primary-light); color: var(--color-primary-dark);
  flex-shrink: 0;
}

.modal-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Toast notification ──────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #1e293b;
  color: #f1f5f9;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  max-width: 340px;
  pointer-events: auto;
  animation: slide-down 200ms cubic-bezier(0.16,1,0.3,1);
  border: 1px solid rgba(255,255,255,0.08);
}

.toast.success { background: #064e3b; border-color: rgba(16,185,129,0.25); }
.toast.error   { background: #7f1d1d; border-color: rgba(239,68,68,0.25); }
.toast.warn    { background: #78350f; border-color: rgba(245,158,11,0.25); }

/* ── Confirm dialog ──────────────────────────────────────────────── */

.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 360px;
  padding: 24px;
  animation: pop-in 200ms cubic-bezier(0.16,1,0.3,1);
}

/* ── Login Input Focus ───────────────────────────────────────────── */

.login-input:focus {
  border-color: var(--color-brand) !important;
  box-shadow: 0 0 0 3px var(--color-brand-ring) !important;
}

/* ── Stat card accent bar ────────────────────────────────────────── */

.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
}
.stat-card.red::before    { background: #ef4444; }
.stat-card.amber::before  { background: #f59e0b; }
.stat-card.green::before  { background: #10b981; }
.stat-card.purple::before { background: #8b5cf6; }
.stat-card.indigo::before { background: #5e6ad2; }

/* ── Empty state ─────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}
.empty-state-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Loading skeleton ────────────────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border-base) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ── Badge ───────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--color-primary);
  color: var(--color-primary-text);
}
.badge-danger  { background: var(--color-danger); }
.badge-neutral { background: var(--color-neutral-text); }
.badge-dot     { min-width: 8px; width: 8px; height: 8px; padding: 0; }

/* ── Scrollable table wrapper ────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Utility ─────────────────────────────────────────────────────── */

.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.font-mono   { font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace; }
.sr-only     { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ── Selection color ─────────────────────────────────────────────── */
::selection { background: var(--color-primary-light); }

/* ── Sticky table header helpers ─────────────────────────────────── */
.bg-slate-50\/95 { background-color: rgba(248,250,252,0.97); }
.bg-slate-50\/80 { background-color: rgba(248,250,252,0.80); }

/* ── Mobile responsive ───────────────────────────────────────────── */

@media (max-width: 767px) {
  /* Topbar hidden on mobile (bottom-nav handles it) */
  #topbar { display: none !important; }

  /* Full width modals on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100%;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    max-height: 92vh;
  }

  /* Tables scroll horizontally */
  .table-wrap { overflow-x: auto; }
  .table-th, .table-td { padding: 9px 10px; font-size: 12px; }

  /* Buttons on mobile — minimum touch target */
  .btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn-success, .btn-warn {
    min-height: 40px;
  }

  /* Page header stack on mobile */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-actions { width: 100%; }

  /* Page title smaller */
  .page-title { font-size: 17px; }

  /* Toast full width on mobile */
  #toast-container { left: 12px; right: 12px; bottom: 72px; }
  .toast { max-width: 100%; min-width: unset; }
}

@media (max-width: 480px) {
  .seg-btn { padding: 4px 10px; font-size: 11px; }
  .pill    { font-size: 10.5px; padding: 2px 8px; }
}

/* ── Print ───────────────────────────────────────────────────────── */

@media print {
  #sidebar, #topbar, #bottom-nav, .btn, button { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #e2e8f0 !important; }
  #shell-body { margin-left: 0 !important; }
}
