:root {
  --accent: #4f46e5;
  --radius: 0.625rem;
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06);
  --shadow-md: 0 4px 12px rgba(2, 6, 23, 0.08);
  --shadow-lg: 0 10px 30px rgba(2, 6, 23, 0.12);
}

/* Typography & base */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Smooth transitions */
a, button, input, select, textarea, .bg-white, .border, .shadow, .shadow-sm, .shadow-md {
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease, opacity .18s ease;
}

/* Buttons & controls */
button { cursor: pointer; }
button[disabled] { cursor: not-allowed; opacity: .6; }
button, .px-3.py-2 { border-radius: var(--radius); }
button:hover:not([disabled]) { transform: translateY(-0.5px); }
button:active:not([disabled]) { transform: translateY(0); }

/* Focus styles */
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, transparent);
  outline-offset: 2px;
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: color-mix(in srgb, var(--accent) 60%, #cbd5e1);
  outline: none;
}

/* Cards & panels */
.bg-white.rounded {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.bg-white.rounded:hover {
  box-shadow: var(--shadow-lg) !important;
  transform: translateY(-2px);
}

/* Sticky header slight elevation on scroll handled via JS */
.flex-1 > header {
  /* position: sticky; */
  top: 0;
  z-index: 40;
  background: inherit;
}

.flex-1 > header.elevated {
  box-shadow: var(--shadow-md);
  backdrop-filter: saturate(140%) blur(4px);
  background-color: rgba(255, 255, 255, 0.9);
}

/* Sidebar active link */
aside a[aria-current="page"] {
  background-color: #eef2ff;
  color: #1f2937;
  border-radius: 0.5rem;
}
aside a:hover { background-color: #f1f5f9; }

/* Table row hover */
table tbody tr:hover { background-color: #f8fafc; }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Accent mapping to existing Tailwind utility colors */
.bg-indigo-600 { background-color: var(--accent) !important; }
.text-indigo-600 { color: var(--accent) !important; }
.border-indigo-600 { border-color: var(--accent) !important; }
.hover\:bg-indigo-700:hover { background-color: color-mix(in srgb, var(--accent) 85%, black) !important; }

/* Mobile sidebar behavior */
@media (max-width: 767.98px) {
  aside.w-72 {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
    width: 18rem;
    max-width: 80vw;
    background: white;
  }
  aside.w-72[data-open="true"] {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(1px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
#overlay[data-show="true"] { opacity: 1; pointer-events: auto; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =======================
   Auth Modal (Login/Register)
   ======================= */
body.auth-blur .min-h-screen {
  filter: blur(6px) saturate(110%);
  transform: translateZ(0) scale(0.995);
  pointer-events: none;
  user-select: none;
}

#authOverlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: radial-gradient(1200px 600px at 30% -10%, rgba(79,70,229,0.12), transparent 60%),
              radial-gradient(1000px 500px at 120% 120%, rgba(16,185,129,0.10), transparent 60%),
              rgba(2,6,23,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  backdrop-filter: blur(4px);
}
#authOverlay[data-show="true"] { opacity: 1; pointer-events: auto; }

.auth-modal {
  width: min(92vw, 420px);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.78));
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255,255,255,0.25);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform-origin: 50% 45%;
  overflow: hidden;
}

.auth-modal[data-state="open"] { animation: modalIn .35s cubic-bezier(.2,.8,.2,1) forwards; }
.auth-modal[data-state="closed"] { animation: modalOut .28s cubic-bezier(.2,.6,.2,1) forwards; }

@keyframes modalIn {
  0% { opacity: 0; transform: translateY(8px) scale(.96); }
  60% { opacity: 1; transform: translateY(0) scale(1.005); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(6px) scale(.98); }
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem 1rem;
}
.auth-brand {
  display: flex; align-items: center; gap: .5rem;
}
.auth-brand-badge {
  height: 34px; width: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, white));
  box-shadow: inset 0 -10px 18px rgba(255,255,255,.28), 0 8px 20px rgba(79,70,229,.28);
}

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  margin: 0 1rem; padding: .375rem; border-radius: .75rem;
  background: rgba(241,245,249,.8);
  border: 1px solid rgba(148,163,184,.35);
}
.auth-tab {
  padding: .5rem .75rem; border-radius: .5rem; text-align: center; font-weight: 600;
  color: #475569; cursor: pointer; user-select: none;
}
.auth-tab.is-active {
  color: #111827; background: white; box-shadow: var(--shadow-sm);
}

.auth-body { padding: 1rem; }
.auth-actions { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }

.auth-error { color: #b91c1c; font-size: .875rem; min-height: 1.25rem; }
.shake { animation: shake .35s ease both; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}



