/* ═══════════════════════════════════════
   DESIGN SYSTEM — Prenoty Vetrina
   Inspired by TailAdmin / Shadcn
   ═══════════════════════════════════════ */

/* ═══ CSS TOKENS ═══ */
:root {
  /* Surface hierarchy (dark) */
  --bg-0: #09090B;
  --bg-1: #0C0C0F;
  --bg-2: #111114;
  --bg-3: #18181B;
  --bg-4: #1F1F23;
  --bg-5: #27272A;

  /* Borders */
  --border: #27272A;
  --border-hover: #3F3F46;
  --border-focus: #465FFF;

  /* Text */
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --text-muted: #52525B;

  /* Brand — TailAdmin blue */
  --accent: #465FFF;
  --accent-hover: #3651E8;
  --accent-muted: rgba(70,95,255,0.10);
  --accent-glow: rgba(70,95,255,0.18);

  /* Status */
  --success: #22C55E;
  --success-muted: rgba(34,197,94,0.12);
  --warning: #F59E0B;
  --warning-muted: rgba(245,158,11,0.12);
  --error: #EF4444;
  --error-muted: rgba(239,68,68,0.12);
  --info: #3B82F6;
  --info-muted: rgba(59,130,246,0.12);

  /* Chart */
  --chart-1: #465FFF;
  --chart-2: #22C55E;
  --chart-3: #F59E0B;
  --chart-4: #EF4444;
  --chart-5: #8B5CF6;

  /* Typography */
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'SF Mono', 'Cascadia Code', monospace;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px var(--accent-glow);

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 0.2s;

  /* Gradient */
  --grad-brand: linear-gradient(135deg, #465FFF, #8B5CF6);

  /* Layout */
  --sidebar-w: 256px;
  --sidebar-collapsed-w: 72px;
}

/* ═══ LIGHT MODE ═══ */
[data-theme="light"] {
  --bg-0: #F1F5F9;
  --bg-1: #F1F5F9;
  --bg-2: #1C2434; /* sidebar stays dark */
  --bg-3: #FFFFFF;
  --bg-4: #F8FAFC;
  --bg-5: #F1F5F9;

  --border: #E2E8F0;
  --border-hover: #CBD5E1;
  --border-focus: #465FFF;

  --text-primary: #1C2434;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;
  --text-muted: #CBD5E1;

  --accent: #465FFF;
  --accent-hover: #3651E8;
  --accent-muted: rgba(70,95,255,0.08);
  --accent-glow: rgba(70,95,255,0.15);

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 24px var(--accent-glow);
}

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; border: none; outline: none; background: transparent; color: var(--text-primary); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes barGrow { from { height: 0; } to { height: var(--h); } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes stampPop { 0% { transform: scale(0) rotate(-180deg); opacity: 0; } 50% { transform: scale(1.2) rotate(5deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes confettiFall { 0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }
@keyframes scanLine { 0% { top: 10%; opacity: .5; } 50% { opacity: 1; } 100% { top: 85%; opacity: .5; } }

/* Stagger utility */
.stagger > * { animation: fadeUp .5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .1s; }
.stagger > *:nth-child(3) { animation-delay: .15s; }
.stagger > *:nth-child(4) { animation-delay: .2s; }
.stagger > *:nth-child(5) { animation-delay: .25s; }
.stagger > *:nth-child(6) { animation-delay: .3s; }
.stagger > *:nth-child(7) { animation-delay: .35s; }
.stagger > *:nth-child(8) { animation-delay: .4s; }

/* Scroll reveal */
.anim-scroll { opacity: 0; transform: translateY(20px); transition: all .6s var(--ease); }
.anim-scroll.vis { opacity: 1; transform: translateY(0); }
.stagger-grid > * { opacity: 0; transform: translateY(20px); transition: all .5s var(--ease); }
.stagger-grid.vis > * { opacity: 1; transform: translateY(0); }
.stagger-grid.vis > *:nth-child(1) { transition-delay: .05s; }
.stagger-grid.vis > *:nth-child(2) { transition-delay: .1s; }
.stagger-grid.vis > *:nth-child(3) { transition-delay: .15s; }
.stagger-grid.vis > *:nth-child(4) { transition-delay: .2s; }
.stagger-grid.vis > *:nth-child(5) { transition-delay: .25s; }
.stagger-grid.vis > *:nth-child(6) { transition-delay: .3s; }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%); background-size: 400px 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-md); }
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: var(--r-sm); }
.skeleton-title { height: 24px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 120px; border-radius: var(--r-lg); }

/* Page enter */
.page-enter { animation: fadeUp .4s var(--ease) both; }

/* Utilities */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.tgrad { background: var(--grad-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.glass { background: rgba(24,24,27,.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); }
[data-theme="light"] .glass { background: rgba(255,255,255,.7); }

/* Skip link (a11y) */
.skip-link { position: absolute; top: -100%; left: 16px; padding: 12px 24px; background: var(--accent); color: #fff; border-radius: var(--r-md); z-index: 9999; font-weight: 700; font-size: .88rem; transition: top .2s; }
.skip-link:focus { top: 16px; }

/* Preloader */
.preloader { position: fixed; inset: 0; background: var(--bg-0); display: flex; align-items: center; justify-content: center; z-index: 99999; transition: opacity .5s, visibility .5s; }
.preloader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-spinner { width: 40px; height: 40px; border: 3px solid var(--bg-5); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
