/* ============================================
   AI BUSINESS ADVISOR & AUDITOR
   Minimalist Light Theme — Global Styles
   Clean, modern, Apple-inspired design
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
  /* Background Colors — Light & Clean */
  --color-bg-primary: #FBFBFD;
  --color-bg-secondary: #FFFFFF;
  --color-bg-card: #FFFFFF;
  --color-bg-card-hover: #F8F9FC;
  --color-bg-elevated: #F4F5F9;
  --color-bg-input: #F2F3F7;
  --color-bg-modal: rgba(255, 255, 255, 0.75);
  --color-bg-sidebar: #FFFFFF;
  --color-bg-page: #F6F7FB;

  /* Accent Colors */
  --color-accent-blue: #4F6EF7;
  --color-accent-blue-light: #7B93FA;
  --color-accent-blue-glow: rgba(79, 110, 247, 0.08);
  --color-accent-blue-bg: rgba(79, 110, 247, 0.06);
  --color-accent-purple: #8B5CF6;
  --color-accent-purple-light: #A78BFA;
  --color-accent-purple-glow: rgba(139, 92, 246, 0.08);
  --color-accent-cyan: #06B6D4;
  --color-accent-cyan-glow: rgba(6, 182, 212, 0.08);
  --color-accent-emerald: #10B981;
  --color-accent-emerald-glow: rgba(16, 185, 129, 0.08);
  --color-accent-amber: #F59E0B;
  --color-accent-amber-glow: rgba(245, 158, 11, 0.08);
  --color-accent-rose: #F43F5E;
  --color-accent-rose-glow: rgba(244, 63, 94, 0.08);

  /* Text Colors */
  --color-text-primary: #1A1D26;
  --color-text-secondary: #5F6777;
  --color-text-muted: #9CA3B4;
  --color-text-accent: var(--color-accent-blue);

  /* Borders */
  --color-border: #ECEDF2;
  --color-border-hover: #D8DAE3;
  --color-border-active: rgba(79, 110, 247, 0.4);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4F6EF7, #8B5CF6);
  --gradient-secondary: linear-gradient(135deg, #06B6D4, #4F6EF7);
  --gradient-success: linear-gradient(135deg, #10B981, #06B6D4);
  --gradient-danger: linear-gradient(135deg, #F43F5E, #F59E0B);
  --gradient-card: linear-gradient(145deg, #FFFFFF, #FAFBFE);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  --gradient-hero: linear-gradient(135deg, #F6F7FB 0%, #EEEFFE 50%, #F0F7FF 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(79, 110, 247, 0.04), rgba(139, 92, 246, 0.04));

  /* Shadows — Soft & Subtle */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow-blue: 0 4px 20px rgba(79, 110, 247, 0.15);
  --shadow-glow-purple: 0 4px 20px rgba(139, 92, 246, 0.15);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 60px;
  --content-max-width: 1400px;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg-primary: #0F1117;
  --color-bg-secondary: #171921;
  --color-bg-card: #1A1D28;
  --color-bg-card-hover: #222532;
  --color-bg-elevated: #1E2130;
  --color-bg-input: #1E2130;
  --color-bg-modal: rgba(15, 17, 23, 0.85);
  --color-bg-sidebar: #171921;
  --color-bg-page: #0F1117;

  --color-text-primary: #E8EAF0;
  --color-text-secondary: #9BA1B5;
  --color-text-muted: #5E6478;

  --color-border: #2A2D3A;
  --color-border-hover: #3A3E4F;
  --color-border-active: rgba(79, 110, 247, 0.5);

  --gradient-card: linear-gradient(145deg, #1A1D28, #1E2130);
  --gradient-glass: linear-gradient(135deg, rgba(26, 29, 40, 0.9), rgba(26, 29, 40, 0.7));
  --gradient-hero: linear-gradient(135deg, #0F1117 0%, #161830 50%, #111827 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(79, 110, 247, 0.08), rgba(139, 92, 246, 0.08));

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.3);

  --color-accent-blue-glow: rgba(79, 110, 247, 0.15);
  --color-accent-purple-glow: rgba(139, 92, 246, 0.15);
  --color-accent-cyan-glow: rgba(6, 182, 212, 0.15);
  --color-accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --color-accent-amber-glow: rgba(245, 158, 11, 0.15);
  --color-accent-rose-glow: rgba(244, 63, 94, 0.15);
}

html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== CSS Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg-page);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: var(--color-bg-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-logo .logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  box-shadow: var(--shadow-glow-blue);
}

.sidebar-logo .logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.sidebar-logo .logo-text span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}

.nav-section {
  margin-bottom: var(--space-xl);
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-sm);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 9px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.nav-item.active {
  background: var(--color-accent-blue-glow);
  color: var(--color-accent-blue);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--color-accent-rose);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  line-height: 1.3;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.sidebar-user:hover {
  background: var(--color-bg-elevated);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-plan {
  font-size: 0.68rem;
  color: var(--color-accent-emerald);
  font-weight: 600;
}

/* ===== Main Content ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  background: var(--color-bg-page);
}

/* ===== Top Header ===== */
.top-header {
  height: var(--header-height);
  padding: 0 var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
}

.header-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.header-breadcrumb .separator {
  color: var(--color-text-muted);
  opacity: 0.4;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.header-btn:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.header-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--color-accent-rose);
  border-radius: 50%;
  border: 2px solid white;
}

/* ===== Page Content ===== */
.page-content {
  padding: var(--space-2xl);
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* ===== Cards ===== */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-card);
}

.card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.card-icon.blue {
  background: var(--color-accent-blue-glow);
  color: var(--color-accent-blue);
}

.card-icon.purple {
  background: var(--color-accent-purple-glow);
  color: var(--color-accent-purple);
}

.card-icon.cyan {
  background: var(--color-accent-cyan-glow);
  color: var(--color-accent-cyan);
}

.card-icon.emerald {
  background: var(--color-accent-emerald-glow);
  color: var(--color-accent-emerald);
}

.card-icon.amber {
  background: var(--color-accent-amber-glow);
  color: var(--color-accent-amber);
}

.card-icon.rose {
  background: var(--color-accent-rose-glow);
  color: var(--color-accent-rose);
}

/* ===== Grid Layouts ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ===== Stat Cards ===== */
.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: var(--space-md);
  color: var(--color-text-primary);
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-sm);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.stat-change.positive {
  background: var(--color-accent-emerald-glow);
  color: var(--color-accent-emerald);
}

.stat-change.negative {
  background: var(--color-accent-rose-glow);
  color: var(--color-accent-rose);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.86rem;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
  box-shadow: 0 6px 25px rgba(79, 110, 247, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-card-hover);
  color: var(--color-text-primary);
  border-color: var(--color-border-hover);
}

.btn-ghost {
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-bg-elevated);
  color: var(--color-text-primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
}

/* ===== Health Score Ring ===== */
.health-score-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.health-score-ring {
  width: 190px;
  height: 190px;
  position: relative;
}

.health-score-ring svg {
  transform: rotate(-90deg);
}

.health-score-ring .ring-bg {
  fill: none;
  stroke: var(--color-bg-elevated);
  stroke-width: 10;
}

.health-score-ring .ring-progress {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.health-score-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.health-score-value .score-number {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.health-score-value .score-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 600;
}

/* ===== Progress Bars ===== */
.progress-bar {
  width: 100%;
  height: 5px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.blue {
  background: var(--gradient-secondary);
}

.progress-fill.purple {
  background: var(--gradient-primary);
}

.progress-fill.emerald {
  background: var(--gradient-success);
}

.progress-fill.amber {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

.progress-fill.rose {
  background: var(--gradient-danger);
}

/* ===== Tags / Badges ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tag-blue {
  background: var(--color-accent-blue-glow);
  color: var(--color-accent-blue);
}

.tag-purple {
  background: var(--color-accent-purple-glow);
  color: var(--color-accent-purple);
}

.tag-cyan {
  background: var(--color-accent-cyan-glow);
  color: var(--color-accent-cyan);
}

.tag-emerald {
  background: var(--color-accent-emerald-glow);
  color: var(--color-accent-emerald);
}

.tag-amber {
  background: var(--color-accent-amber-glow);
  color: var(--color-accent-amber);
}

.tag-rose {
  background: var(--color-accent-rose-glow);
  color: var(--color-accent-rose);
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 11px 16px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.form-input:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px var(--color-accent-blue-glow);
  background: white;
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-select {
  width: 100%;
  padding: 11px 16px;
  background: var(--color-bg-input);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3B4' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all var(--transition-fast);
}

.form-select:focus {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px var(--color-accent-blue-glow);
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: var(--space-md);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: var(--space-md);
  font-size: 0.86rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.data-table tr:hover td {
  background: var(--color-bg-card-hover);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  padding: 3px;
}

.tab {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.tab:hover {
  color: var(--color-text-secondary);
}

.tab.active {
  background: white;
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 560px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-spring);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(79, 110, 247, 0.15);
  }

  50% {
    box-shadow: 0 0 24px rgba(79, 110, 247, 0.25);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-out forwards;
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

.delay-1 {
  animation-delay: 0.1s;
  opacity: 0;
}

.delay-2 {
  animation-delay: 0.2s;
  opacity: 0;
}

.delay-3 {
  animation-delay: 0.3s;
  opacity: 0;
}

.delay-4 {
  animation-delay: 0.4s;
  opacity: 0;
}

.delay-5 {
  animation-delay: 0.5s;
  opacity: 0;
}

/* ===== Loading States ===== */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-elevated) 25%, #e8e9f0 50%, var(--color-bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.18);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: var(--space-lg);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .top-header {
    padding: 0 var(--space-lg);
  }

  .mobile-menu-btn {
    display: flex;
  }
}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-accent {
  color: var(--color-accent-blue);
}

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.font-mono {
  font-family: var(--font-mono);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.w-full {
  width: 100%;
}

.overflow-hidden {
  overflow: hidden;
}

.relative {
  position: relative;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}