/* ============================================================
   Bizia by Brandsap — Design Tokens
   Premium SaaS design system. Light-first with dark mode.
   ============================================================ */

:root {
  /* Brand */
  --primary: #5B5CFF;
  --primary-600: #4B4CF0;
  --primary-700: #3E3FD6;
  --primary-soft: #ECECFF;
  --secondary: #12B8A6;
  --secondary-soft: #DCF6F2;
  --accent: #FFB454;
  --accent-soft: #FFF1DC;

  /* Neutral surfaces (light) */
  --bg: #F7F8FC;
  --bg-grad-1: #F4F5FF;
  --bg-grad-2: #F7FBFA;
  --surface: #FFFFFF;
  --surface-2: #FBFBFE;
  --surface-3: #F4F5FA;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);

  /* Text */
  --text: #111827;
  --text-2: #374151;
  --muted: #6B7280;
  --muted-2: #9CA3AF;

  /* Lines */
  --border: #E5E7EB;
  --border-soft: #EEF0F4;
  --border-strong: #D7DAE2;
  --ring: rgba(91, 92, 255, 0.35);

  /* Semantic */
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --warning: #D97706;
  --warning-soft: #FEF0D5;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info: #2563EB;
  --info-soft: #DBEAFE;

  /* Radii */
  --r-xs: 7px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --r-pill: 999px;

  /* Shadows — soft, layered, premium */
  --sh-xs: 0 1px 2px rgba(17, 24, 39, 0.05);
  --sh-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --sh-md: 0 4px 14px -2px rgba(17, 24, 39, 0.08), 0 2px 6px -2px rgba(17, 24, 39, 0.05);
  --sh-lg: 0 18px 40px -12px rgba(17, 24, 39, 0.16), 0 4px 12px -4px rgba(17, 24, 39, 0.07);
  --sh-xl: 0 40px 80px -24px rgba(17, 24, 39, 0.28), 0 8px 24px -8px rgba(17, 24, 39, 0.10);
  --sh-primary: 0 12px 30px -8px rgba(91, 92, 255, 0.45);
  --sh-primary-sm: 0 6px 16px -6px rgba(91, 92, 255, 0.45);

  /* Type */
  --font-sans: "Geist", "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "SFMono-Regular", ui-monospace, "Menlo", monospace;

  /* Layout */
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 64px;
  --maxw: 1320px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.22s;
}

[data-theme="dark"] {
  --primary: #7D7EFF;
  --primary-600: #6E6FFF;
  --primary-700: #5B5CFF;
  --primary-soft: rgba(125, 126, 255, 0.16);
  --secondary: #2DD4BF;
  --secondary-soft: rgba(45, 212, 191, 0.15);
  --accent: #FFC36E;
  --accent-soft: rgba(255, 180, 84, 0.16);

  --bg: #0B1020;
  --bg-grad-1: #0C1226;
  --bg-grad-2: #0A1320;
  --surface: #121830;
  --surface-2: #161D38;
  --surface-3: #1B2342;
  --glass: rgba(20, 26, 48, 0.66);
  --glass-strong: rgba(20, 26, 48, 0.86);

  --text: #F1F3FB;
  --text-2: #C9CFE3;
  --muted: #8B93AD;
  --muted-2: #6B7390;

  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ring: rgba(125, 126, 255, 0.5);

  --success-soft: rgba(22, 163, 74, 0.18);
  --warning-soft: rgba(217, 119, 6, 0.18);
  --danger-soft: rgba(220, 38, 38, 0.18);
  --info-soft: rgba(37, 99, 235, 0.2);

  --sh-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --sh-md: 0 6px 18px -4px rgba(0, 0, 0, 0.55);
  --sh-lg: 0 22px 48px -16px rgba(0, 0, 0, 0.7);
  --sh-xl: 0 44px 90px -28px rgba(0, 0, 0, 0.8);
  --sh-primary: 0 12px 32px -8px rgba(125, 126, 255, 0.55);
  --sh-primary-sm: 0 6px 18px -6px rgba(125, 126, 255, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

#root { min-height: 100%; }

::selection { background: var(--primary-soft); color: var(--primary-700); }

/* Scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }

/* Typography defaults */
h1, h2, h3, h4, h5 { margin: 0; font-weight: 650; letter-spacing: -0.022em; line-height: 1.08; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* App-wide page background with subtle gradient mesh */
.bz-app-bg {
  background:
    radial-gradient(1200px 700px at 12% -8%, var(--bg-grad-1) 0%, transparent 55%),
    radial-gradient(1000px 600px at 100% 0%, var(--bg-grad-2) 0%, transparent 50%),
    var(--bg);
}

/* Utility: focus ring */
.bz-focusable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

/* keyframes — bz-fade-up is transform-only (no opacity) so route content is
   ALWAYS visible even if the animation timeline never advances (unpainted pane). */
@keyframes bz-fade-up { from { transform: translateY(12px); } to { transform: translateY(0); } }
@keyframes bz-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bz-scale-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes bz-pop { 0% { transform: scale(0.8); opacity: 0; } 60% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
@keyframes bz-spin { to { transform: rotate(360deg); } }
@keyframes bz-pulse-soft { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes bz-shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes bz-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bz-dash { to { stroke-dashoffset: 0; } }
@keyframes bz-ring { 0% { transform: scale(0.6); opacity: 0.7; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes bz-slide-r { from { transform: translateX(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes bz-slide-l { from { transform: translateX(-40px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* Entrance animations use `forwards` (not `both`): if a pane is never painted
   the animation stays un-started and the element keeps its natural (visible)
   opacity, instead of being held at the 0% invisible frame. */
.bz-anim-up { animation: bz-fade-up 0.5s var(--ease) forwards; }
.bz-anim-in { animation: bz-fade-in 0.4s var(--ease) forwards; }
.bz-anim-scale { animation: bz-scale-in 0.3s var(--ease) forwards; }

/* Skeleton shimmer */
.bz-skel {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--border-soft) 37%, var(--surface-3) 63%);
  background-size: 800px 100%;
  animation: bz-shimmer 1.4s infinite linear;
  border-radius: var(--r-sm);
}

.bz-mono { font-family: var(--font-mono); }
.bz-grad-text {
  background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
