/* ═══════════════════════════════════════════════════════════════
   Acaedu — Professional Academic Design
   Inspired by minimal.gallery: SAPIENS, Making Software, BASS
   Clean · Generous · Purposeful · Modern
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────────────────── */
:root {
  --primary: #5B8CC0;
  --primary-hover: #4A7BAF;
  --primary-light: #7BAAD4;
  --primary-dark: #3D6A9E;
  --secondary: #C9A96E;
  --secondary-hover: #B8985D;
  --accent: #6B9FCC;
  --accent-warm: #D4B87A;

  --bg-primary: #FAFAF7;
  --bg-secondary: #F0EDE6;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-sidebar: #F5F2EB;
  --bg-dark: #1A2B42;

  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-muted: #888888;
  --text-inverse: #FAFAF7;

  --border: #E5E2DB;
  --border-light: #EDEAE3;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);

  --danger: #D44333;
  --warning: #D4A04A;
  --success: #4CAF70;
  --info: #5B8CC0;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

  /* Metallic gradients */
  --gradient-primary: linear-gradient(135deg, #5B8CC0, #7BAAD4);
  --gradient-warm: linear-gradient(135deg, #C9A96E, #D4B87A);
  --gradient-mixed: linear-gradient(135deg, #5B8CC0, #C9A96E);
  --gradient-card: linear-gradient(180deg, #FFFFFF 0%, #FAFAF7 100%);
  --gradient-lustre: linear-gradient(135deg, #3D6A9E 0%, #5B8CC0 20%, #C9A96E 50%, #7BAAD4 80%, #3D6A9E 100%);
  --gradient-hero: linear-gradient(160deg, #F0EDE6 0%, #FAFAF7 40%, #F5F2EB 100%);
}

[data-theme="dark"] {
  --primary: #7BAAD4;
  --primary-hover: #90BCDE;
  --primary-light: #A0C8E8;
  --primary-dark: #5B8CC0;
  --secondary: #D4B87A;
  --accent: #5B8CC0;
  --accent-warm: #C9A96E;
  --bg-primary: #111111;
  --bg-secondary: #1A1A1A;
  --bg-card: #1E1E1E;
  --bg-elevated: #222222;
  --bg-sidebar: #161616;
  --bg-dark: #0A0A0A;
  --text-primary: #F0EDE6;
  --text-secondary: #BBBBBB;
  --text-muted: #888888;
  --text-inverse: #1A1A1A;
  --border: #2A2A2A;
  --border-light: #222222;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* ─── Base Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: var(--font-sans); scroll-behavior: smooth; font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; background: transparent; color: var(--text-primary); overflow-x: hidden; }
#app-root { min-height: 100vh; position: relative; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Typography — Strong, confident hierarchy ──────────────── */
h1, h2, h3, h4, h5, h6 { color: var(--text-primary); line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.1; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; letter-spacing: -0.025em; }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.65rem); font-weight: 700; letter-spacing: -0.015em; }
h4 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--text-secondary); line-height: 1.75; }

/* ─── Monospace labels — Making Software style ──────────────── */
.mono-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Section Spacing — generous whitespace ─────────────────── */
.section { padding: 6rem 2rem; }
.section-lg { padding: 8rem 2rem; }
.section-sm { padding: 4rem 2rem; }

/* ─── Container ─────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── Card — Clean, minimal, SAPIENS-style ──────────────────── */
.card {
  background: var(--bg-card);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.card:hover { box-shadow: var(--shadow); }

.card-featured {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.card-featured:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem; font-size: 0.9rem; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; line-height: 1.4; position: relative;
  font-family: var(--font-sans); letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(91, 140, 192, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary);
}

.btn-ghost {
  background: transparent; color: var(--text-secondary);
  padding: 0.5rem 1rem;
}
.btn-ghost:hover:not(:disabled) { color: var(--primary); background: rgba(91, 140, 192, 0.06); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(212, 67, 51, 0.3); }

.btn-accent {
  background: var(--gradient-warm);
  color: var(--text-primary);
  font-weight: 700;
}
.btn-accent:hover:not(:disabled) { box-shadow: 0 4px 16px rgba(201, 169, 110, 0.35); transform: translateY(-1px); }

.btn-lg { padding: 1rem 2.5rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* ─── Navigation — Clean, minimal ──────────────────────────── */
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  transition: all var(--transition); font-size: 0.9rem;
}
.nav-item:hover { background: rgba(91, 140, 192, 0.06); color: var(--text-primary); text-decoration: none; }
.nav-item.active { color: var(--primary); background: rgba(91, 140, 192, 0.08); font-weight: 600; }

/* ─── Forms ─────────────────────────────────────────────────── */
input, select, textarea {
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(91, 140, 192, 0.12);
}

.card-input {
  background: var(--bg-primary); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 0.75rem 1rem; width: 100%; font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 192, 0.12);
}

.tab-btn {
  padding: 0.5rem 1.25rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 0.85rem;
  cursor: pointer; transition: all var(--transition); background: transparent;
  color: var(--text-secondary); font-weight: 500;
}
.tab-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
}

/* ─── Toggle Switch ─────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px; transition: var(--transition);
}
.toggle-slider::before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: white; border-radius: 50%;
  transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ─── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; padding: 0.25rem 0.75rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: rgba(76,175,112,0.1); color: #2E8B57; }
.badge-warning { background: rgba(212,160,74,0.1); color: #A07830; }
.badge-danger { background: rgba(212,67,51,0.1); color: #B83328; }
.badge-info { background: rgba(91,140,192,0.1); color: #3D6A9E; }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS — Purposeful, Not Overwhelming
   ═══════════════════════════════════════════════════════════════ */

/* ─── Gradient Text — Metallic Lustre ───────────────────────── */
.gradient-text {
  background: var(--gradient-lustre);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metallic-text {
  background: linear-gradient(135deg, #3D6A9E, #5B8CC0, #C9A96E, #7BAAD4, #3D6A9E);
  background-size: 300% 300%;
  animation: metallicSheen 7s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

@keyframes metallicSheen {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 50%; }
}

@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ─── Fractal Background — Subtle, Professional ─────────────── */
.fractal-bg-overlay {
  position: fixed; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 0;
  background: var(--gradient-hero);
  will-change: transform;
  contain: layout style;
}

@keyframes fractalOrbFloat {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  33% { transform: translate(-45%, -55%) rotate(120deg) scale(1.15); }
  66% { transform: translate(-55%, -48%) rotate(240deg) scale(1.05); }
}

@keyframes fractalOrbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -40px) scale(1.2); }
}

@keyframes fractalOrbDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 30px) scale(1.15); }
}

@keyframes fractalOrbPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

@keyframes fractalTriangleSpin {
  0% { transform: rotate(0deg) translateY(0); }
  100% { transform: rotate(720deg) translateY(0); }
}

@keyframes fractalParticleFloat {
  0%, 100% { transform: translateY(0) translateX(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(-80px) translateX(20px) scale(1.3); opacity: 0.7; }
}

@keyframes fractalLineMove {
  0% { transform: translateX(-300px); opacity: 0; }
  15% { opacity: 0.8; }
  85% { opacity: 0.8; }
  100% { transform: translateX(calc(100vw + 300px)); opacity: 0; }
}

@keyframes fractalCircleSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes fractalCircleSpinReverse {
  0% { transform: translate(-50%, -50%) rotate(360deg); }
  100% { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes fractalDotFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { transform: translateY(-40px) scale(1.5); opacity: 0.7; }
}

@keyframes fractalSparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 0.8; transform: scale(1.5); }
}

@keyframes fractalShapeSpin {
  0% { transform: rotate(0deg) scale(1) translateY(0); }
  100% { transform: rotate(720deg) scale(1) translateY(0); }
}

@keyframes wave1 {
  0%, 100% { d: path("M0,80 C360,140 720,20 1080,80 C1260,110 1380,50 1440,80 L1440,160 L0,160 Z"); }
  50% { d: path("M0,100 C360,60 720,140 1080,60 C1260,90 1380,120 1440,80 L1440,160 L0,160 Z"); }
}

@keyframes wave2 {
  0%, 100% { d: path("M0,120 C400,80 800,160 1440,100 L1440,160 L0,160 Z"); }
  50% { d: path("M0,100 C400,150 800,70 1440,120 L1440,160 L0,160 Z"); }
}

/* ─── Utility Animations ────────────────────────────────────── */
.anim-fade-in { animation: fadeIn 0.5s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.anim-fade-in-up { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

.anim-fade-in-down { animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }

.anim-fade-in-left { animation: fadeInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }

.anim-fade-in-right { animation: fadeInRight 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }

.anim-scale-in { animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.anim-spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.anim-pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.anim-float { animation: float 4s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.anim-shimmer {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(255,255,255,0.4) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.anim-gradient {
  background: var(--gradient-lustre);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.anim-glow { animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow {
  from { box-shadow: 0 0 8px rgba(91, 140, 192, 0.2); }
  to { box-shadow: 0 0 20px rgba(91, 140, 192, 0.4); }
}

.anim-bounce { animation: bounce 2s ease infinite; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ─── Stagger Children ──────────────────────────────────────── */
.stagger-children > * { animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }

/* ─── Hover Effects ─────────────────────────────────────────── */
.hover-lift { transition: transform var(--transition), box-shadow var(--transition); }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hover-glow:hover { box-shadow: 0 0 24px rgba(91, 140, 192, 0.2); }
.hover-scale:hover { transform: scale(1.02); }
.hover-border:hover { border-color: var(--primary) !important; }

/* ─── Skeleton ──────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(255,255,255,0.5) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%; animation: shimmer 2s infinite; border-radius: var(--radius);
}

/* ─── Page Transition ───────────────────────────────────────── */
.page-enter { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  html { font-size: 15px; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.85rem; }
  .card { padding: 1.25rem; }
  .section { padding: 4rem 1.5rem; }
  .section-lg { padding: 5rem 1.5rem; }
}
@media (max-width: 480px) { html { font-size: 14px; } }

/* ─── Theme Helpers ─────────────────────────────────────────── */
.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-card { background: var(--bg-card); }
.bg-dark { background: var(--bg-dark); color: var(--text-inverse); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-inverse { color: var(--text-inverse); }
.border-themed { border-color: var(--border); }
.input-themed { background: var(--bg-primary); border: 1.5px solid var(--border); color: var(--text-primary); }
.input-themed:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,140,192,0.12); }
.nav-themed { background: rgba(250,250,247,0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-light); }
.sidebar-themed { background: var(--bg-sidebar); border-right: 1px solid var(--border); }
.footer-themed { border-top: 1px solid var(--border); color: var(--text-muted); }

/* ─── Feature Grid — SAPIENS-style card grid ────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ─── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

/* ─── Stat Counter — BASS-style ─────────────────────────────── */
.stat-counter {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

/* ─── Tag/Label — Making Software style ─────────────────────── */
.tag {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-secondary);
}

/* ─── Desktop Animations ────────────────────────────────────── */
.page-transition-enter { animation: pageTransitionIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
.page-transition-exit { animation: pageTransitionOut 0.25s cubic-bezier(0.4, 0, 1, 1) both; }
@keyframes pageTransitionIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pageTransitionOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px); } }

.card-hover-enhanced { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.card-hover-enhanced:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }

.sidebar-slide-in { animation: sidebarSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes sidebarSlideIn { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.tab-content-enter { animation: tabContentEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes tabContentEnter { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.notification-slide-in { animation: notificationSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes notificationSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.focus-ring:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
.smooth-scroll { scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

.loading-bar {
  position: fixed; top: 0; left: 0; width: 0; height: 2px;
  background: var(--gradient-primary);
  z-index: 10000; animation: loadingBarProgress 1.5s ease-in-out infinite;
}
@keyframes loadingBarProgress { 0% { width: 0; left: 0; } 50% { width: 50%; left: 25%; } 100% { width: 0; left: 100%; } }

.stat-number { display: inline-block; animation: statNumberPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes statNumberPop { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }

.chart-fade-in { animation: chartFadeIn 0.6s ease both; }
@keyframes chartFadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.gradient-border { position: relative; border: none; }
.gradient-border::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: var(--gradient-mixed); background-size: 200% 200%;
  animation: gradientBorderShift 5s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
@keyframes gradientBorderShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* ─── Dark Section ──────────────────────────────────────────── */
.dark-section {
  background: var(--bg-dark);
  color: var(--text-inverse);
}
.dark-section h1, .dark-section h2, .dark-section h3 { color: var(--text-inverse); }
.dark-section p { color: rgba(250,250,247,0.7); }

/* ─── Animated Icons — Lucide-style SVG icons ───────────────── */
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.25em; height: 1.25em; vertical-align: middle;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: all var(--transition);
}

/* Icon sizes */
.icon-sm { width: 1em; height: 1em; }
.icon-md { width: 1.25em; height: 1.25em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2em; height: 2em; }
.icon-2xl { width: 2.5em; height: 2.5em; }

/* Subtle idle animations for icons */
.icon-float {
  animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.icon-pulse {
  animation: iconPulse 2.5s ease-in-out infinite;
}
@keyframes iconPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.icon-spin-slow {
  animation: iconSpin 8s linear infinite;
}
@keyframes iconSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.icon-wiggle {
  animation: iconWiggle 2s ease-in-out infinite;
}
@keyframes iconWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.icon-bounce {
  animation: iconBounce 2s ease-in-out infinite;
}
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
  60% { transform: translateY(-2px); }
}

.icon-glow {
  filter: drop-shadow(0 0 4px rgba(91, 140, 192, 0.4));
  animation: iconGlow 2s ease-in-out infinite alternate;
}
@keyframes iconGlow {
  from { filter: drop-shadow(0 0 4px rgba(91, 140, 192, 0.3)); }
  to { filter: drop-shadow(0 0 8px rgba(201, 169, 110, 0.5)); }
}

.icon-shimmer {
  animation: iconShimmer 3s ease-in-out infinite;
}
@keyframes iconShimmer {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; filter: drop-shadow(0 0 3px rgba(201, 169, 110, 0.3)); }
}

/* Icon container with background */
.icon-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: var(--radius-sm);
  background: rgba(91, 140, 192, 0.08);
  color: var(--primary);
  transition: all var(--transition);
}
.icon-box:hover {
  background: rgba(91, 140, 192, 0.15);
  transform: translateY(-1px);
}

.icon-box-lg {
  width: 4rem; height: 4rem; border-radius: var(--radius);
}

/* Icon in card context */
.feature-icon {
  width: 3rem; height: 3rem; border-radius: var(--radius-sm);
  background: rgba(91, 140, 192, 0.08); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; transition: all var(--transition);
}
.feature-icon:hover {
  background: rgba(91, 140, 192, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 140, 192, 0.15);
}

/* Nav icon */
.nav-icon {
  width: 1.1rem; height: 1.1rem; opacity: 0.6;
  transition: all var(--transition);
}
.nav-item:hover .nav-icon { opacity: 1; color: var(--primary); }

/* Hero decorative icon */
.hero-icon {
  position: absolute; opacity: 0.06; color: var(--primary);
  pointer-events: none;
}

/* ─── WhatsApp Pulse ──────────────────────────────────────── */
@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(37,211,102,0.45); }
  50% { box-shadow: 0 6px 32px rgba(37,211,102,0.7), 0 0 0 8px rgba(37,211,102,0.15); }
}

/* ─── Floating Widgets (Responsive) ─────────────────────── */
.floating-review-buttons {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  gap: 0.75rem;
  z-index: 999;
  flex-wrap: wrap;
}
.floating-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: #191A1A;
  color: #fff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.01em;
}
.floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}
.floating-btn-g2 {
  background: #FF492C;
  box-shadow: 0 4px 16px rgba(255,73,44,0.3);
}
.floating-btn-g2:hover {
  box-shadow: 0 6px 24px rgba(255,73,44,0.4);
}
.floating-btn-label {
  display: inline;
}
.floating-btn-brand {
  font-weight: 800;
}
.floating-whatsapp-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366, #128C7E);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 24px rgba(37,211,102,0.45);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s;
  animation: whatsappPulse 2s ease-in-out infinite;
}
.floating-whatsapp-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 32px rgba(37,211,102,0.6);
}
.floating-whatsapp-label {
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* ─── Floating Widgets: Tablet ──────────────────────────── */
@media (max-width: 1024px) {
  .floating-review-buttons {
    bottom: 1.5rem;
    left: 1rem;
    gap: 0.5rem;
  }
  .floating-btn {
    padding: 0.45rem 0.8rem;
    font-size: 0.75rem;
  }
  .floating-whatsapp-btn {
    width: 80px;
    height: 80px;
    bottom: 1.5rem;
    right: 1rem;
  }
  .floating-whatsapp-btn svg {
    width: 26px;
    height: 26px;
  }
  .floating-whatsapp-label {
    font-size: 0.6rem;
  }
}

/* ─── Floating Widgets: Mobile ──────────────────────────── */
@media (max-width: 640px) {
  .floating-review-buttons {
    bottom: 5rem;
    left: 0.75rem;
    gap: 0.4rem;
  }
  .floating-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.65rem;
    gap: 0.3rem;
    border-radius: 6px;
  }
  .floating-btn svg {
    width: 14px;
    height: 14px;
  }
  .floating-btn-label {
    display: none;
  }
  .floating-whatsapp-btn {
    width: 60px;
    height: 60px;
    bottom: 5rem;
    right: 0.75rem;
  }
  .floating-whatsapp-btn svg {
    width: 22px;
    height: 22px;
  }
  .floating-whatsapp-label {
    font-size: 0.5rem;
    margin-top: 1px;
  }
}

/* ─── AI Assistant (Responsive) ─────────────────────────── */
.ai-assistant-btn {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5B8CC0, #C9A96E);
  border: none;
  cursor: pointer;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(91,140,192,0.4);
  transition: all 0.3s;
}
.ai-assistant-btn:hover {
  transform: translateX(-50%) scale(1.08);
  box-shadow: 0 6px 28px rgba(91,140,192,0.5);
}
.ai-assistant-popup {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  max-height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: scaleIn 0.2s ease;
}
@media (max-width: 640px) {
  .ai-assistant-btn {
    width: 44px;
    height: 44px;
    bottom: 1rem;
  }
  .ai-assistant-btn svg {
    width: 20px;
    height: 20px;
  }
  .ai-assistant-popup {
    width: calc(100vw - 2rem);
    max-height: 70vh;
    bottom: 4rem;
  }
}
}

/* ─── Sidebar Items — SAPIENS-style clean ─────────────────── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition);
  font-size: 0.875rem;
  color: var(--text-muted);
  position: relative;
}
.sidebar-item:hover {
  color: var(--text-primary);
  background: rgba(91, 140, 192, 0.06);
  transform: translateX(2px);
}
.sidebar-item.active {
  color: var(--primary);
  background: rgba(91, 140, 192, 0.1);
  font-weight: 600;
  border-left: 3px solid var(--primary);
  padding-left: calc(0.75rem - 3px);
}
.sidebar-item.active svg { stroke: var(--primary); }
.sidebar-item:hover svg { stroke: var(--primary); }

/* ─── App Background — fractal overlay for dashboard ─────── */
.app-bg {
  background: var(--gradient-hero);
  position: relative;
}
[data-theme="dark"] .app-bg {
  background: linear-gradient(160deg, #111111 0%, #1A1A1A 40%, #141414 100%);
}

/* ─── Glow Hover — buttons, tabs, cards (minimal.gallery) ── */
.btn { transition: all var(--transition); }
.btn:hover {
  box-shadow: 0 0 20px rgba(91, 140, 192, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.btn-primary:hover {
  box-shadow: 0 0 24px rgba(91, 140, 192, 0.4), 0 4px 16px rgba(91, 140, 192, 0.2);
}
.btn-secondary:hover {
  box-shadow: 0 0 24px rgba(201, 169, 110, 0.35), 0 4px 16px rgba(201, 169, 110, 0.15);
}
.btn-ghost:hover {
  box-shadow: 0 0 16px rgba(91, 140, 192, 0.2);
  background: rgba(91, 140, 192, 0.06);
}

/* Card glow on hover — Making Software style */
.hover-glow {
  transition: all var(--transition);
}
.hover-glow:hover {
  box-shadow: 0 0 30px rgba(91, 140, 192, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
[data-theme="dark"] .hover-glow:hover {
  box-shadow: 0 0 30px rgba(91, 140, 192, 0.2), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Stack cards — layered effect */
.stack-card {
  position: relative;
  transition: all var(--transition);
}
.stack-card::before {
  content: '';
  position: absolute;
  inset: 4px -4px -4px 4px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  opacity: 0.5;
  z-index: -1;
  transition: all var(--transition);
}
.stack-card:hover::before {
  inset: 6px -6px -6px 6px;
  opacity: 0.8;
}

/* ─── Button icon danger ──────────────────────────────────── */
.btn-icon-danger:hover {
  color: var(--danger) !important;
  background: rgba(212, 67, 51, 0.08);
  box-shadow: 0 0 12px rgba(212, 67, 51, 0.2);
}

/* ─── Mobile responsive ───────────────────────────────────── */
@media (max-width: 1024px) {
  .desktop-only { display: none !important; }
  .mobile-topbar { display: flex !important; }
  main { margin-left: 0 !important; padding: 1rem !important; padding-top: 3.5rem !important; }
  aside { transform: translateX(-100%) !important; }
  aside[style*="translateX(0)"] { transform: translateX(0) !important; }
}
@media (min-width: 1025px) {
  .mobile-topbar { display: none !important; }
}

/* ─── Settings Institution — academic feel ────────────────── */
.settings-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.settings-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.settings-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .settings-row { grid-template-columns: 1fr; }
}
.settings-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.settings-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
}
.settings-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 192, 0.15);
}
.settings-select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
}
.settings-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 140, 192, 0.15);
}

/* ─── Billing Plan Cards ──────────────────────────────────── */
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.plan-card:hover {
  box-shadow: 0 0 30px rgba(91, 140, 192, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.plan-card.popular {
  border-color: var(--primary);
}
.plan-card.popular::before {
  content: 'Most Popular';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gradient-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 0 0 0 var(--radius-sm);
}

/* ─── Enhanced Stat Cards ─────────────────────────────────────── */
.stat-card {
  background: linear-gradient(135deg, rgba(91,140,192,0.04), rgba(201,169,110,0.04));
  border-top: 3px solid transparent;
  background-image: 
    linear-gradient(var(--bg-card), var(--bg-card)),
    linear-gradient(135deg, var(--primary), var(--secondary));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 140px;
}
.stat-card:nth-child(1) { --card-accent: linear-gradient(135deg, #5B8CC0, #7BAAD4); }
.stat-card:nth-child(2) { --card-accent: linear-gradient(135deg, #C9A96E, #D4B87A); }
.stat-card:nth-child(3) { --card-accent: linear-gradient(135deg, #6B9FCC, #5B8CC0); }
.stat-card:nth-child(4) { --card-accent: linear-gradient(135deg, #4CAF70, #6BCB8F); }
.stat-card:nth-child(5) { --card-accent: linear-gradient(135deg, #D4A04A, #E0BD6F); }
.stat-card:nth-child(6) { --card-accent: linear-gradient(135deg, #5B8CC0, #C9A96E); }
.stat-card:nth-child(7) { --card-accent: linear-gradient(135deg, #8B5CF6, #A78BFA); }
.stat-card:nth-child(8) { --card-accent: linear-gradient(135deg, #06B6D4, #67E8F9); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--gradient-mixed));
  opacity: 0.9;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(91, 140, 192, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(91,140,192,0.15), 0 0 20px rgba(201,169,110,0.08);
}
.stat-card .stat-counter {
  background: var(--gradient-mixed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.stat-card .mono-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}
.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}
.stat-card:hover .stat-card-icon {
  background: var(--primary);
}
.stat-card:hover .stat-card-icon svg {
  stroke: white !important;
}

/* ─── Dashboard Welcome Banner ─────────────────────────────────── */
.dash-welcome {
  padding: 2rem 2.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--gradient-card, var(--bg-card));
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.dash-welcome::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(201, 169, 110, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Quick Action Pills ───────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.quick-actions::-webkit-scrollbar { display: none; }
.quick-action-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.quick-action-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(91, 140, 192, 0.04);
}

/* ─── Sidebar Enhanced ─────────────────────────────────────────── */
.sidebar-themed {
  background: var(--gradient-card, var(--bg-card));
  backdrop-filter: blur(12px);
}
.sidebar-item {
  transition: all 0.2s;
}
.sidebar-item:hover {
  background: rgba(91, 140, 192, 0.06);
  color: var(--text-primary);
}
.sidebar-item.active {
  background: rgba(91, 140, 192, 0.1);
  color: var(--primary);
  font-weight: 500;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

/* ─── Fractal Background ──────────────────────────────────────── */
.fractal-bg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.6;
}
[data-theme="dark"] .fractal-bg-overlay {
  opacity: 0.4;
}

/* ─── App Background ──────────────────────────────────────────── */
.app-bg {
  background: transparent;
  position: relative;
}
.app-bg > *:not(.fractal-bg-overlay) {
  position: relative;
  z-index: 1;
}
main.app-bg,
.app-bg main,
.app-bg .dashboard-content {
  background: rgba(250, 250, 247, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] main.app-bg,
[data-theme="dark"] .app-bg main,
[data-theme="dark"] .app-bg .dashboard-content {
  background: rgba(17, 17, 17, 0.92);
}
.app-bg .sidebar-themed,
aside.sidebar-themed {
  background: rgba(245, 242, 235, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .app-bg .sidebar-themed,
[data-theme="dark"] aside.sidebar-themed {
  background: rgba(22, 22, 22, 0.95);
}
.app-bg .card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
[data-theme="dark"] .app-bg .card {
  background: rgba(30, 30, 30, 0.92);
}

/* ─── Logo ──────────────────────────────────────────────────── */
.app-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

/* ─── Chart Animations (enhanced) ───────────────────────────── */
@keyframes chartBarGrow {
  from { height: 0; transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes chartPieReveal {
  from { transform: scale(0.7) rotate(-120deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes chartValueCount {
  from { opacity: 0; transform: translateY(8px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes chartLegendFade {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes chartSegmentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; filter: brightness(1.1); }
}
.chart-bar {
  animation-fill-mode: both;
  transform-origin: bottom;
}
.chart-bar:hover {
  filter: brightness(1.15);
  transform: scaleY(1.05);
}
.chart-pie {
  animation-fill-mode: both;
}
.chart-pie:hover {
  transform: scale(1.03);
  filter: brightness(1.05);
}
.chart-value {
  animation-fill-mode: both;
}
.chart-legend-item {
  animation-fill-mode: both;
}

/* ─── Mobile Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-topbar { display: flex !important; }
  main { margin-left: 0 !important; padding-top: 60px !important; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (min-width: 769px) {
  .mobile-topbar { display: none !important; }
}

/* ─── Chart Animations ───────────────────────────────────── */
@keyframes chartBarGrow {
  from { height: 0; transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes chartPieReveal {
  from { transform: scale(0.8) rotate(-90deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes chartBarPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 140, 192, 0.4); }
  50% { box-shadow: 0 0 12px 4px rgba(91, 140, 192, 0.2); }
}
@keyframes chartSegmentGrow {
  from { stroke-dasharray: 0 100; }
  to { stroke-dasharray: var(--segment-length) 100; }
}
@keyframes chartValueCount {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes chartLegendFade {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Bar chart enhanced styles */
.chart-bar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: bottom;
}
.chart-bar:hover {
  filter: brightness(1.1);
  transform: scaleY(1.05);
  box-shadow: 0 0 16px rgba(91, 140, 192, 0.3);
}

/* Pie chart enhanced styles */
.chart-pie {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.chart-pie:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* Chart value animation */
.chart-value {
  animation: chartValueCount 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Chart legend animation */
.chart-legend-item {
  animation: chartLegendFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.table-row-hover:hover {
  background: rgba(91, 140, 192, 0.04);
}

/* ─── Reduced Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fractal-bg-overlay { display: none; }
}

/* ─── Hued Sheen Lustres & Metallic Beige Blue Theme ──────── */

/* Sidebar items — hued gradient on active, glow on hover */
.sidebar-item {
  border-left: 3px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-item:hover {
  background: linear-gradient(90deg, rgba(91,140,192,0.06), rgba(201,169,110,0.04));
  border-left-color: rgba(91,140,192,0.3);
  box-shadow: 0 0 16px rgba(91,140,192,0.08);
  transform: translateX(2px);
}
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(91,140,192,0.14), rgba(201,169,110,0.10));
  border-left-color: var(--primary);
  box-shadow: inset 0 0 20px rgba(91,140,192,0.08), 0 0 12px rgba(201,169,110,0.06);
}
.sidebar-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.05));
  pointer-events: none;
}
.sidebar-themed {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(240,237,230,0.5) 100%);
  border-right: 1px solid var(--border);
}
[data-theme="dark"] .sidebar-themed {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(22,22,22,0.8) 100%);
}

/* Cards — metallic sheen on hover, gradient border glow */
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(91,140,192,0.3), rgba(201,169,110,0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover::before {
  opacity: 1;
}
.card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(201,169,110,0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.4s;
}
.card:hover::after {
  transform: scale(1.5);
  background: radial-gradient(circle, rgba(91,140,192,0.08) 0%, transparent 70%);
}
.card:hover {
  box-shadow: 0 4px 20px rgba(91,140,192,0.10), 0 0 24px rgba(201,169,110,0.06);
  border-color: rgba(91,140,192,0.2);
}

/* Stat cards — enhanced metallic gradient */
.stat-card {
  border-top: 3px solid transparent;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)), linear-gradient(135deg, var(--primary), var(--secondary));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.stat-card::after {
  background: radial-gradient(circle, rgba(91,140,192,0.06) 0%, transparent 70%);
}
.stat-card:hover::after {
  background: radial-gradient(circle, rgba(201,169,110,0.10) 0%, transparent 70%);
}
.stat-card:hover {
  box-shadow: 0 8px 32px rgba(91,140,192,0.15), 0 0 20px rgba(201,169,110,0.08);
}

/* Tabs — hued gradient active, glow on hover */
.tab-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: all 0.3s;
  transform: translateX(-50%);
}
.tab-btn:hover::after {
  width: 80%;
}
.tab-btn:hover {
  box-shadow: 0 0 12px rgba(91,140,192,0.15);
  color: var(--primary);
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 2px 12px rgba(91,140,192,0.35), 0 0 20px rgba(201,169,110,0.12);
  color: white;
  border-color: transparent;
}
.tab-btn.active::after {
  display: none;
}

/* Stack cards — layered depth with glow */
.stack-card {
  box-shadow: 0 2px 8px rgba(91,140,192,0.06);
}
.stack-card:hover {
  box-shadow: 0 8px 28px rgba(91,140,192,0.14), 0 0 16px rgba(201,169,110,0.08);
}
.stack-card::before {
  background: linear-gradient(135deg, rgba(91,140,192,0.03), rgba(201,169,110,0.03));
}

/* Buttons — metallic glow on hover */
.btn-primary {
  box-shadow: 0 2px 8px rgba(91,140,192,0.2);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(91,140,192,0.35), 0 0 16px rgba(201,169,110,0.15);
}
.btn-secondary:hover {
  box-shadow: 0 0 16px rgba(201,169,110,0.2);
  border-color: var(--secondary);
  color: var(--secondary);
}

/* Plan cards — hued glow */
.plan-card.popular {
  box-shadow: 0 0 24px rgba(201,169,110,0.18), 0 8px 24px rgba(91,140,192,0.10);
  border-color: var(--primary);
}
.plan-card.popular::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(201,169,110,0.04) 100%);
  pointer-events: none;
}
.plan-card:hover {
  box-shadow: 0 0 30px rgba(91,140,192,0.15), 0 12px 32px rgba(201,169,110,0.10);
}

/* Settings tabs — hued glow */
button[style*="border-radius:0.5rem"][style*="cursor:pointer"]:hover {
  box-shadow: 0 0 12px rgba(91,140,192,0.12);
}

/* Table rows — subtle glow on hover */
.table-row-hover:hover {
  background: linear-gradient(90deg, rgba(91,140,192,0.04), rgba(201,169,110,0.03));
  box-shadow: 0 0 8px rgba(91,140,192,0.06);
}

/* Inputs — metallic focus ring */
.card-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,140,192,0.12), 0 0 12px rgba(201,169,110,0.06);
}

/* Badge — subtle glow */
.badge {
  box-shadow: 0 0 6px rgba(91,140,192,0.08);
}

/* Quick action pills — hued glow on hover */
.quick-action-pill:hover {
  box-shadow: 0 0 16px rgba(91,140,192,0.15), 0 0 8px rgba(201,169,110,0.10);
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(91,140,192,0.04), rgba(201,169,110,0.03));
}

/* Welcome banner — subtle metallic sheen */
.dash-welcome {
  background: linear-gradient(135deg, var(--bg-card) 60%, rgba(201,169,110,0.04) 100%);
  border: 1px solid var(--border-light);
  box-shadow: 0 2px 12px rgba(91,140,192,0.06);
}

/* Overall body — warm metallic tint */
body {
  background: linear-gradient(160deg, var(--bg-primary) 0%, rgba(240,237,230,0.5) 50%, var(--bg-primary) 100%);
}
[data-theme="dark"] body {
  background: linear-gradient(160deg, #111111 0%, #161616 50%, #111111 100%);
}

/* Scrollbar — themed */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 4px;
}

/* ─── Click Sound Trigger ──────────────────────────────────── */
button:active,
a:active {
  transform: scale(0.97);
}

/* ─── Print ─────────────────────────────────────────────────── */
@media print { body { background: white; color: black; } .card { border: 1px solid #ddd; box-shadow: none; } .btn, nav { display: none; } }
