/* ── Lumina Admin Custom Styles ── */
/* Tailwind Play CDN handles most styling; this file covers dark mode
   variables and edge cases Tailwind can't easily address. */

/* Dark mode CSS variables (backstop for dynamic content) */
:root {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
}
html.dark {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-muted: #94a3b8;
  --color-border: #334155;
}

/* ── Sidebar transitions (Tailwind cannot do dynamic className toggles) ── */
.sidebar-mobile { transition: transform 0.25s ease-in-out; }
@media (max-width: 1023px) {
  .sidebar-mobile { transform: translateX(-100%); }
  .sidebar-mobile.open { transform: translateX(0); }
}

/* ── Flash message animation ── */
.flash-fade {
  animation: flashIn 0.3s ease-out;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Custom scrollbar ── */
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
html.dark .sidebar-scroll::-webkit-scrollbar-thumb { background: #475569; }

/* ── Switch toggle (for form-switch) ── */
.switch-toggle {
  position: relative;
  width: 40px; height: 22px;
  appearance: none;
  background: #cbd5e1;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch-toggle:checked { background: #4f46e5; }
.switch-toggle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.switch-toggle:checked::after { left: 20px; }
html.dark .switch-toggle { background: #475569; }
html.dark .switch-toggle:checked { background: #6366f1; }

/* ── Safe area for mobile bottom nav ── */
.safe-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ── Table responsive: card layout on mobile ── */
@media (max-width: 767px) {
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tr {
    display: block;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
  }
  .table-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }
}
