/* ================================================================
   AhmedPro PFMS — Main Stylesheet v3.0
   Theme: AhmedPro Logo Palette
   Cyan #00D4FF → Blue #3B82F6 → Violet #8B5CF6 → Magenta #C026D3
   Fonts: Syne (display) + DM Sans (body)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap');

/* ── CSS Variables (Light Mode) ────────────────────────────── */
:root {
  /* AhmedPro Logo Palette */
  --ap-cyan:    #00D4FF;
  --ap-blue:    #3B82F6;
  --ap-violet:  #8B5CF6;
  --ap-magenta: #C026D3;

  /* Brand */
  --brand:        #6366F1;
  --brand-light:  #818CF8;
  --brand-dark:   #4F46E5;
  --brand-glow:   rgba(99,102,241,0.16);
  --brand-2:      #00D4FF;

  /* Logo gradient — reusable everywhere */
  --logo-gradient: linear-gradient(135deg, #00D4FF 0%, #3B82F6 30%, #8B5CF6 65%, #C026D3 100%);

  /* Semantic */
  --success:    #10B981;  --success-bg: rgba(16,185,129,0.10);
  --warning:    #F59E0B;  --warning-bg: rgba(245,158,11,0.10);
  --danger:     #EF4444;  --danger-bg:  rgba(239,68,68,0.10);
  --info:       #00D4FF;  --info-bg:    rgba(0,212,255,0.10);

  /* Sidebar — light mode: clean white with violet accents */
  --sb-bg:        #FFFFFF;
  --sb-border:    rgba(99,102,241,0.12);
  --sb-text:      #5B57A0;
  --sb-active-bg: rgba(99,102,241,0.10);
  --sb-active:    #4F46E5;
  --sb-hover:     rgba(99,102,241,0.06);
  --sb-name:      #1A1640;
  --sb-section:   rgba(99,102,241,0.40);
  --sb-width:     256px;

  /* Layout */
  --topbar-h:     60px;
  --mobile-nav-h: 64px;

  /* Light surfaces — soft cyan-blue-tinted */
  --bg:       #F0F4FF;
  --bg-2:     #E5EAFF;
  --card:     #FFFFFF;
  --card-2:   #F6F8FF;
  --border:   #DDE3FF;
  --border-2: #C5CFFF;

  /* Text */
  --text-1:   #0C0A2E;
  --text-2:   #3B3968;
  --text-3:   #9490BE;

  /* Input */
  --input-bg:     #FFFFFF;
  --input-border: #C5CFFF;
  --input-focus:  #6366F1;

  /* Shadows — violet-tinted */
  --shadow-sm:  0 1px 3px rgba(99,102,241,0.07), 0 1px 2px rgba(99,102,241,0.04);
  --shadow:     0 4px 12px rgba(99,102,241,0.09), 0 2px 4px rgba(99,102,241,0.05);
  --shadow-md:  0 8px 24px rgba(99,102,241,0.13), 0 4px 8px rgba(99,102,241,0.07);
  --shadow-lg:  0 16px 48px rgba(99,102,241,0.17);

  /* Radii */
  --r-sm: 6px;  --r: 10px;  --r-md: 14px;  --r-lg: 20px;  --r-full: 9999px;

  /* Transitions */
  --t-fast: 120ms ease;  --t: 200ms ease;  --t-slow: 320ms ease;
}

/* ── Dark Mode ──────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Midnight-violet surfaces */
  --bg:       #070511;
  --bg-2:     #0D0A1E;
  --card:     #120E28;
  --card-2:   #191133;
  --border:   #221845;
  --border-2: #2C2058;

  /* Text */
  --text-1:   #EDE9FF;
  --text-2:   #9B96CC;
  --text-3:   #484270;

  /* Input */
  --input-bg:     #120E28;
  --input-border: #2C2058;
  --input-focus:  #818CF8;

  /* Brand brighter in dark */
  --brand:       #818CF8;
  --brand-light: #A5B4FC;
  --brand-dark:  #6366F1;
  --brand-glow:  rgba(129,140,248,0.18);

  /* Sidebar slightly lighter than page */
  --sb-bg:        #090617;
  --sb-border:    rgba(129,140,248,0.10);
  --sb-text:      rgba(165,180,252,0.68);
  --sb-active-bg: rgba(129,140,248,0.16);
  --sb-active:    #C4B5FD;
  --sb-hover:     rgba(129,140,248,0.08);
  --sb-name:      #E8E0FF;
  --sb-section:   rgba(165,180,252,0.38);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.50);
  --shadow:     0 4px 12px rgba(0,0,0,0.55);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.62);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.72);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Subtle ambient mesh — logo hues bleeding through bg */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 50% at 5% 5%,   rgba(0,212,255,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 95% 90%,  rgba(192,38,211,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(99,102,241,0.025) 0%, transparent 60%);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 70% 50% at 5% 5%,   rgba(0,212,255,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 95% 90%,  rgba(192,38,211,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(99,102,241,0.04) 0%, transparent 60%);
}
a { color: var(--brand); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-light); }
img { max-width: 100%; display: block; }

/* ── App Layout ───────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.app-main {
  flex: 1; margin-left: var(--sb-width);
  padding-top: var(--topbar-h); min-width: 0;
  transition: margin var(--t-slow); position: relative; z-index: 1;
}
.page-body { padding: 24px; max-width: 1400px; }
@media (max-width: 1024px) {
  .app-main { margin-left: 0; }
  .page-body { padding: 16px; padding-bottom: calc(var(--mobile-nav-h) + 16px); }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sb-width); background: var(--sb-bg);
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 500; transition: transform var(--t-slow); overflow: hidden;
  border-right: 1px solid var(--sb-border);
  box-shadow: 2px 0 20px rgba(99,102,241,0.06);
}
[data-theme="dark"] .sidebar {
  box-shadow: 2px 0 20px rgba(0,0,0,0.40);
  border-right: none;
}
/* Ambient glow from logo colors */
/* sidebar glow removed — clean flat sidebar */
.sidebar::before, .sidebar::after { display: none; }

/* Sidebar Brand */
.sb-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--sb-border);
  text-decoration: none;
}
.sb-brand-icon {
  width: 34px; height: 34px; background: var(--logo-gradient);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: #fff; flex-shrink: 0;
}
.sb-brand-logo { background: transparent; box-shadow: none; padding: 2px; }
.sb-logo-img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-sm); }
.sb-brand-logo-only { justify-content: center; padding: 10px 16px; gap: 0; }
.sb-logo-full {
  max-width: 160px; max-height: 52px; width: auto; height: auto;
  object-fit: contain; display: block;
  filter: none;
}
.sb-brand-text { display: flex; flex-direction: column; }
.sb-brand-name { font-family: 'Syne', sans-serif; font-size: 13.5px; font-weight: 700; color: var(--sb-name); letter-spacing: 0.01em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand-sub { font-size: 11px; color: var(--sb-text); }

/* Sidebar User */
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--sb-border);
  cursor: pointer; transition: background var(--t-fast); position: relative; z-index: 1;
}
.sb-user:hover { background: var(--sb-hover); }
.sb-avatar {
  width: 34px; height: 34px; border-radius: var(--r-full);
  background: var(--logo-gradient);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
  color: #fff; flex-shrink: 0; box-shadow: 0 2px 10px rgba(99,102,241,0.40);
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name { font-size: 13px; font-weight: 600; color: var(--sb-name); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: var(--sb-text); }

/* Sidebar Nav */

/* ── Sidebar brand — mobile only ──────────────────────────── */
.sb-brand-mobile {
  display: none !important; /* desktop: topbar already shows it */
  align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--sb-border);
}
@media (max-width: 1024px) {
  .sb-brand-mobile { display: flex !important; }
}
.sb-nav { flex: 1; overflow-y: auto; padding: 10px; position: relative; z-index: 1; }
.sb-section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--sb-section); text-transform: uppercase; padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--r); color: var(--sb-text);
  font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: all var(--t-fast); cursor: pointer; margin-bottom: 2px; position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge { font-size: 10px; font-weight: 700; background: var(--danger); color: #fff; border-radius: var(--r-full); padding: 1px 6px; min-width: 18px; text-align: center; }
.nav-item:hover { background: var(--sb-hover); color: var(--sb-active); }
.nav-item.active { background: var(--sb-active-bg); color: var(--sb-active); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--logo-gradient);
  border-radius: 0 var(--r-full) var(--r-full) 0;
}
.nav-group-toggle {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--r); color: var(--sb-text);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all var(--t-fast); margin-bottom: 2px; user-select: none; list-style: none;
}
.nav-group-toggle:hover { background: var(--sb-hover); color: var(--sb-active); }
.nav-group-toggle i.main-icon { width: 18px; text-align: center; font-size: 14px; }
.nav-group-toggle .label { flex: 1; }
.nav-group-toggle .chevron { font-size: 11px; transition: transform var(--t-fast); }
.nav-group.open .chevron { transform: rotate(90deg); }
.nav-submenu { display: none; padding-left: 30px; }
.nav-group.open .nav-submenu { display: block; }
.nav-submenu .nav-item { font-size: 13px; padding: 7px 12px; }
.nav-submenu .nav-item i { font-size: 12px; }
.sb-footer { border-top: 1px solid var(--sb-border); padding: 10px; position: relative; z-index: 1; }

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h); background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 10px;
  z-index: 600; box-shadow: 0 1px 8px rgba(99,102,241,0.07);
}
/* Topbar logo-gradient accent line */
.topbar::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--logo-gradient);
}
@media (max-width: 1024px) {
  .topbar { padding: 0 14px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}
.topbar-hamburger { display: flex; align-items: center; background: none; border: none; cursor: pointer; color: var(--text-2); font-size: 18px; padding: 6px; border-radius: var(--r-sm); transition: all var(--t-fast); }
.topbar-hamburger:hover { background: var(--bg-2); color: var(--brand); }

.topbar-title {
  flex: 1; font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700;
  color: var(--text-1); display: flex; flex-direction: column; justify-content: center;
}
.topbar-title-text {
  background: var(--logo-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* prevents parent color: var(--text-1) from overriding */
  font-family: 'Syne', sans-serif;
  font-size: 17px; font-weight: 800; line-height: 1.2;
  display: inline-block; /* required for background-clip:text to work on inline spans */
}
.topbar-logo-img { display: block; height: 34px; width: auto; max-width: 140px; object-fit: contain; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: all var(--t-fast); position: relative; text-decoration: none;
}
.topbar-btn:hover { background: var(--brand-glow); color: var(--brand); border-color: var(--brand); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--danger); border-radius: var(--r-full); border: 2px solid var(--card); }

/* ── Topbar User Button — animated expand ───────────────────  */
/* ── Avatar idle pulse ring ─────────────────────────────────── */
@keyframes avatar-ring-pulse {
  0%   { box-shadow: 0 0 0 0px rgba(255,255,255,0.50); }
  60%  { box-shadow: 0 0 0 5px rgba(255,255,255,0.00); }
  100% { box-shadow: 0 0 0 0px rgba(255,255,255,0.00); }
}

/* ── Topbar User Button — animated expand ───────────────────  */
.topbar-user-btn {
  display: flex; align-items: center; padding: 4px;
  border-radius: var(--r-full); border: none;
  background: var(--logo-gradient); color: #fff;
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 600;
  /* Use width not max-width — more reliable cross-browser animation */
  transition: width 300ms cubic-bezier(0.34,1.56,0.64,1),
              padding-right 300ms cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 200ms ease, transform 200ms ease;
  white-space: nowrap; overflow: hidden;
  width: 38px; /* exactly avatar (30) + 2×padding (4) */
}
.topbar-user-btn:hover, .topbar-user-btn.expanded {
  width: 200px; padding-right: 12px;
  box-shadow: 0 4px 20px rgba(99,102,241,0.45); transform: translateY(-1px);
}
/* Username slides in — max-width works for any name length */
.topbar-username {
  max-width: 0; overflow: hidden; opacity: 0; white-space: nowrap;
  transition: max-width 300ms cubic-bezier(0.34,1.56,0.64,1),
              opacity 220ms ease 80ms,
              padding-left 300ms cubic-bezier(0.34,1.56,0.64,1);
  padding-left: 0;
}
.topbar-user-btn:hover .topbar-username,
.topbar-user-btn.expanded .topbar-username {
  max-width: 160px; opacity: 1; padding-left: 8px;
}
/* Chevron slides in */
.topbar-chevron {
  font-size: 10px; color: rgba(255,255,255,0.80);
  max-width: 0; overflow: hidden; opacity: 0;
  transition: transform var(--t-fast), opacity 200ms ease 100ms,
              max-width 200ms ease, padding-left 200ms ease;
  padding-left: 0;
}
.topbar-user-btn:hover .topbar-chevron,
.topbar-user-btn.expanded .topbar-chevron { max-width: 16px; opacity: 1; padding-left: 4px; }
.topbar-chevron.open { transform: rotate(180deg); }
/* Avatar circle — solid white bg for contrast, idle pulse ring */
.topbar-avatar {
  width: 30px; height: 30px; border-radius: var(--r-full);
  background: rgba(255,255,255,0.30);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 700; color: #fff;
  flex-shrink: 0; min-width: 30px;
  animation: avatar-ring-pulse 2.8s ease-out 1.5s infinite;
  transition: box-shadow 250ms ease, background 200ms ease;
}
.topbar-user-btn:hover .topbar-avatar,
.topbar-user-btn.expanded .topbar-avatar {
  background: rgba(255,255,255,0.40);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
  animation: none; /* stop pulse when expanded */
}

/* ── Topbar User Dropdown ──────────────────────────────────── */
.topbar-user-wrap { position: relative; }
.topbar-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  z-index: 601; opacity: 0; pointer-events: none;
  transform: translateY(-6px); transition: all var(--t-fast); overflow: hidden;
}
.topbar-user-dropdown::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--logo-gradient); }
.topbar-user-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.tud-header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.tud-avatar { width: 36px; height: 36px; border-radius: var(--r-full); background: var(--logo-gradient); display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; box-shadow: 0 2px 10px rgba(99,102,241,0.35); }
.tud-name { font-weight: 700; font-size: 13.5px; color: var(--text-1); }
.tud-role { font-size: 11px; color: var(--text-3); margin-top: 1px; text-transform: capitalize; }
.tud-divider { height: 1px; background: var(--border); margin: 4px 0; }
.tud-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; transition: background var(--t-fast), color var(--t-fast); cursor: pointer; }
.tud-item i { width: 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.tud-item:hover { background: var(--bg); color: var(--brand); }
.tud-item:hover i { color: var(--brand); }
.tud-item.tud-danger { color: var(--danger); }
.tud-item.tud-danger i { color: var(--danger); }
.tud-item.tud-danger:hover { background: var(--danger-bg); }
.tud-item:last-child { border-radius: 0 0 var(--r-md) var(--r-md); }

/* ── Sidebar Footer ──────────────────────────────────────── */
.sb-brand-footer { text-align: center; font-size: 12px; font-weight: 600; color: var(--sb-section); letter-spacing: 0.03em; padding: 12px 0; }
.sb-brand-gradient { font-weight: 700; background: var(--logo-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Site Footer ─────────────────────────────────────────── */
.site-footer { text-align: center; padding: 14px 24px; font-size: 12px; font-weight: 600; color: var(--text-3); border-top: 1px solid var(--border); background: var(--card); margin-left: var(--sb-width); letter-spacing: 0.02em; }
@media (max-width: 1024px) { .site-footer { margin-left: 0; margin-bottom: var(--mobile-nav-h); } }

/* ── Sidebar Overlay ─────────────────────────────────────── */
.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(7,5,17,0.72); z-index: 499; backdrop-filter: blur(4px); }
@media (max-width: 1024px) { .sb-overlay.active { display: block; } }

/* ── Mobile Bottom Nav ───────────────────────────────────── */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; height: var(--mobile-nav-h); background: var(--card); border-top: 1px solid var(--border); z-index: 200; padding: 0 8px; position: fixed; }
.mobile-nav::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--logo-gradient); opacity: 0.6; }
@media (max-width: 1024px) { .mobile-nav { display: flex; align-items: center; justify-content: space-around; } }
.mn-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 12px; border-radius: var(--r); color: var(--text-3); font-size: 11px; font-weight: 500; text-decoration: none; transition: color var(--t-fast); flex: 1; }
.mn-item i { font-size: 18px; }
.mn-item.active { color: var(--brand); }

/* ── Cards ─────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-1); margin: 0; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--brand); font-size: 14px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--card-2); border-radius: 0 0 var(--r-md) var(--r-md); }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 20px; display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow-sm); transition: all var(--t); position: relative; overflow: hidden;
}
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; width: 80px; height: 80px; background: radial-gradient(circle at top right, var(--card-accent, rgba(99,102,241,0.05)), transparent 70%); pointer-events: none; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card:hover::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--logo-gradient); }
.stat-icon { width: 44px; height: 44px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-icon.blue    { background: rgba(99,102,241,0.12); color: var(--brand); }
.stat-icon.green   { background: var(--success-bg); color: var(--success); }
.stat-icon.amber   { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red     { background: var(--danger-bg); color: var(--danger); }
.stat-icon.purple  { background: rgba(139,92,246,0.12); color: #8B5CF6; }
.stat-icon.cyan    { background: rgba(0,212,255,0.10); color: #00B8D9; }
.stat-icon.magenta { background: rgba(192,38,211,0.10); color: #C026D3; }
.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-family: 'Syne', sans-serif; font-size: 26px; font-weight: 700; color: var(--text-1); line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.stat-sub.positive { color: var(--success); }
.stat-sub.negative { color: var(--danger); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--r); font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 500; cursor: pointer; border: none; transition: all var(--t-fast); text-decoration: none; white-space: nowrap; line-height: 1.4; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-primary { background: var(--logo-gradient); color: #fff; box-shadow: 0 2px 12px rgba(99,102,241,0.35); }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(99,102,241,0.50); transform: translateY(-1px); filter: brightness(1.06); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; color: var(--text-2); border: 1px solid var(--border-2); }
.btn-outline:hover { background: var(--brand-glow); color: var(--brand); border-color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--brand); }
.btn-icon { padding: 8px; border-radius: var(--r); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-left: 3px; }
.form-control { display: block; width: 100%; padding: 9px 12px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--r); font-family: 'DM Sans', sans-serif; font-size: max(14px, 16px); color: var(--text-1); transition: border-color var(--t-fast), box-shadow var(--t-fast); -webkit-appearance: none; }
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.form-control::placeholder { color: var(--text-3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 5px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 14px; background: var(--bg-2); font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
tbody tr:hover { background: var(--bg-2); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 14px; font-size: 13.5px; color: var(--text-1); }
.td-muted { color: var(--text-3); font-size: 12px; }
.td-amount { font-family: 'Syne', sans-serif; font-weight: 600; }

@media (max-width: 768px) {
  table, thead, tbody, th, td, tr { display: block; }
  thead tr { position: absolute; top: -9999px; left: -9999px; }
  tbody tr { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 16px; background: var(--card); overflow: hidden; }
  tbody td { position: relative; padding: 12px 14px 12px 45% !important; text-align: right; border-bottom: 1px solid var(--border); min-height: 44px; display: flex; align-items: center; justify-content: flex-end; }
  tbody td:last-child { border-bottom: none; }
  tbody td::before { 
    content: attr(data-label); 
    position: absolute; left: 14px; top: 12px; width: 40%; 
    text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
  }
  .table-wrap { overflow-x: visible; }
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-success   { background: var(--success-bg); color: var(--success); }
.badge-danger    { background: var(--danger-bg); color: var(--danger); }
.badge-warning   { background: var(--warning-bg); color: var(--warning); }
.badge-info      { background: var(--info-bg); color: #0088AA; }
.badge-secondary { background: rgba(148,163,184,0.12); color: var(--text-3); }
.badge-blue      { background: rgba(99,102,241,0.12); color: var(--brand); }
.badge-violet    { background: rgba(139,92,246,0.12); color: #8B5CF6; }
.badge-cyan      { background: rgba(0,212,255,0.10); color: #0088AA; }
[data-theme="dark"] .badge-info { color: #67E8F9; }
[data-theme="dark"] .badge-cyan { color: #67E8F9; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--r); font-size: 13.5px; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid rgba(16,185,129,0.20); }
.alert-danger  { background: var(--danger-bg); color: #991B1B; border: 1px solid rgba(239,68,68,0.20); }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid rgba(245,158,11,0.20); }
.alert-info    { background: var(--info-bg); color: #005570; border: 1px solid rgba(0,212,255,0.20); }
[data-theme="dark"] .alert-success { color: #6EE7B7; }
[data-theme="dark"] .alert-danger  { color: #FCA5A5; }
[data-theme="dark"] .alert-warning { color: #FCD34D; }
[data-theme="dark"] .alert-info    { color: #67E8F9; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(7,5,17,0.68); backdrop-filter: blur(6px); z-index: 550; display: flex; align-items: center; justify-content: center; padding: calc(var(--topbar-h) + 16px) 16px 16px; opacity: 0; pointer-events: none; transition: opacity var(--t); }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(99,102,241,0.22); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; transform: translateY(20px) scale(0.97); transition: transform var(--t); position: relative; }
.modal::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--logo-gradient); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 700px; }
.modal-sm { max-width: 380px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; color: var(--text-1); }
.modal-close { width: 30px; height: 30px; border-radius: var(--r-sm); border: none; background: var(--bg-2); color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: all var(--t-fast); }
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 12px; flex-wrap: wrap; }
.page-header h1 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; color: var(--text-1); margin-bottom: 3px; }
.page-header .page-sub { font-size: 13px; color: var(--text-3); }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-wrap { height: 8px; background: var(--bg-2); border-radius: var(--r-full); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--r-full); transition: width 0.6s ease; }
.progress-bar.blue     { background: var(--logo-gradient); }
.progress-bar.green    { background: var(--success); }
.progress-bar.amber    { background: var(--warning); }
.progress-bar.red      { background: var(--danger); }

/* ── Avatar ─────────────────────────────────────────────────── */
.avatar { width: 38px; height: 38px; border-radius: var(--r-full); background: var(--logo-gradient); display: inline-flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; text-transform: uppercase; box-shadow: 0 2px 10px rgba(99,102,241,0.35); }

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

/* ── Grid Layouts ────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ── List Items ─────────────────────────────────────────────── */
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--border); transition: background var(--t-fast); }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-2); }

/* ── Budget Ring ─────────────────────────────────────────────── */
.budget-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.budget-ring svg { transform: rotate(-90deg); }
.budget-ring-text { position: absolute; text-align: center; }

/* ── Chart Containers ────────────────────────────────────────── */
.chart-container { position: relative; }
.chart-container canvas { max-width: 100%; }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
  background: linear-gradient(135deg,
    rgba(0,212,255,0.12) 0%,
    rgba(59,130,246,0.10) 25%,
    rgba(240,240,255,1)  50%,
    rgba(139,92,246,0.10) 75%,
    rgba(192,38,211,0.12) 100%);
}
/* Top-left cyan orb */
.auth-page::before {
  content: ''; position: absolute; top: -160px; left: -160px;
  width: 600px; height: 600px; pointer-events: none;
  background: radial-gradient(circle, rgba(0,212,255,0.18) 0%, transparent 65%);
}
/* Bottom-right magenta orb */
.auth-page::after {
  content: ''; position: absolute; bottom: -160px; right: -160px;
  width: 550px; height: 550px; pointer-events: none;
  background: radial-gradient(circle, rgba(192,38,211,0.16) 0%, transparent 65%);
}
/* ── Auth card: animated rotating gradient border + glow ── */
@keyframes auth-border-spin {
  0%   { --auth-angle: 135deg; }
  100% { --auth-angle: 495deg; }
}
@keyframes auth-glow-pulse {
  0%, 100% {
    box-shadow:
      0 0 18px 2px rgba(0,212,255,0.25),
      0 0 40px 4px rgba(139,92,246,0.18),
      0 20px 60px rgba(99,102,241,0.14);
  }
  25% {
    box-shadow:
      0 0 24px 4px rgba(59,130,246,0.30),
      0 0 50px 6px rgba(0,212,255,0.20),
      0 20px 60px rgba(99,102,241,0.16);
  }
  50% {
    box-shadow:
      0 0 28px 5px rgba(139,92,246,0.32),
      0 0 56px 8px rgba(192,38,211,0.22),
      0 20px 60px rgba(139,92,246,0.18);
  }
  75% {
    box-shadow:
      0 0 22px 3px rgba(192,38,211,0.28),
      0 0 44px 5px rgba(139,92,246,0.20),
      0 20px 60px rgba(192,38,211,0.14);
  }
}

@property --auth-angle {
  syntax: '<angle>';
  initial-value: 135deg;
  inherits: false;
}

.auth-card {
  background:
    rgba(255,255,255,0.76) padding-box,
    conic-gradient(from var(--auth-angle),
      #00D4FF 0%,
      #3B82F6 25%,
      #8B5CF6 50%,
      #C026D3 75%,
      #00D4FF 100%) border-box;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 2px solid transparent;
  border-radius: var(--r-lg); padding: 40px;
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
  animation:
    auth-border-spin 4s linear infinite,
    auth-glow-pulse  3s ease-in-out infinite;
}

/* Fallback for browsers without @property support (Firefox < 128) */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .auth-card {
    background:
      rgba(255,255,255,0.76) padding-box,
      linear-gradient(135deg,#00D4FF 0%,#3B82F6 30%,#8B5CF6 65%,#C026D3 100%) border-box;
    animation: auth-glow-pulse 3s ease-in-out infinite;
  }
}
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.auth-logo-icon { width: 44px; height: 44px; background: var(--logo-gradient); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,0.55); }
.auth-logo-text { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 800; color: var(--text-1,#0C0A2E); }
.auth-title { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; color: var(--text-1,#0C0A2E); margin-bottom: 6px; }
.auth-sub { font-size: 13.5px; color: var(--text-2,#3B3968); margin-bottom: 28px; }
.auth-form .form-label { color: var(--text-2,#3B3968); }
.auth-form .form-control { background: rgba(255,255,255,0.80); border-color: rgba(99,102,241,0.22); color: var(--text-1,#0C0A2E); }
.auth-form .form-control:focus { border-color: #6366F1; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.auth-form .form-control::placeholder { color: rgba(99,102,241,0.35); }
.auth-link { color: #A5B4FC; font-size: 13px; }
.auth-link:hover { color: #C4B5FD; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.35; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; }

/* ── Search / Filter Bar ─────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--card-2); border-radius: var(--r-md) var(--r-md) 0 0; }
.search-input-wrap { position: relative; flex: 1; min-width: 180px; }
.search-input-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 13px; }
.search-input-wrap .form-control { padding-left: 32px; }

/* ── Dropdown ────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md); min-width: 180px; z-index: 100; overflow: hidden; opacity: 0; pointer-events: none; transform: translateY(-8px); transition: all var(--t-fast); }
.dropdown-menu.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13.5px; color: var(--text-1); cursor: pointer; transition: background var(--t-fast); text-decoration: none; }
.dropdown-item:hover { background: var(--bg-2); color: var(--brand); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 16px; font-size: 13.5px; font-weight: 500; color: var(--text-3); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--t-fast); }
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tab-btn:hover { color: var(--text-1); }

/* ── Loader ──────────────────────────────────────────────────── */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border-2); border-top-color: var(--brand); border-radius: var(--r-full); animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: inherit; }

/* ── Toasts ──────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 1024px) { #toast-container { bottom: calc(var(--mobile-nav-h) + 12px); } }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-md); font-size: 13.5px; color: var(--text-1); max-width: 340px; min-width: 240px; animation: slideIn 0.25s ease forwards; }
.toast.success { border-left: 3px solid var(--success); }
.toast.danger  { border-left: 3px solid var(--danger); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info    { border-left: 3px solid var(--brand); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── Dashboard Net Position ──────────────────────────────────── */
.net-position-card {
  background: linear-gradient(135deg, #070511 0%, #0C0820 50%, #130926 100%);
  border: 1px solid rgba(99,102,241,0.20);
  border-radius: var(--r-lg); padding: 24px;
  color: #E8E0FF; position: relative; overflow: hidden;
}
.net-position-card::before { content: ''; position: absolute; top: -60px; right: -60px; width: 240px; height: 240px; background: radial-gradient(circle, rgba(0,212,255,0.13) 0%, transparent 70%); pointer-events: none; }
.net-position-card::after  { content: ''; position: absolute; bottom: -40px; left: -40px; width: 180px; height: 180px; background: radial-gradient(circle, rgba(192,38,211,0.10) 0%, transparent 70%); pointer-events: none; }
.net-position-card > * { position: relative; z-index: 1; }
.net-amount { font-family: 'Syne', sans-serif; font-size: 40px; font-weight: 800; line-height: 1; }
.net-amount.positive { color: #34D399; }
.net-amount.negative { color: #F87171; }

/* ── Utilities ───────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }
.mb-1 { margin-bottom: 6px; }  .mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }
.mb-6 { margin-bottom: 32px; } .mt-2 { margin-top: 12px; }
.text-sm { font-size: 12.5px; }  .text-xs { font-size: 11px; }
.text-muted { color: var(--text-3); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-syne { font-family: 'Syne', sans-serif; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-gradient { background: var(--logo-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Mobile overrides ────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; }
  .topbar-hamburger { flex-shrink: 0; margin-right: 8px; }
  .topbar-title { display: flex !important; flex-direction: row; align-items: center; white-space: nowrap; overflow: hidden; flex: 1; min-width: 0; }
  .topbar-logo-img { display: block !important; height: 30px; width: auto; max-width: 110px; object-fit: contain; }
  .topbar-title-text { display: none !important; }
  .topbar-title .text-sm { display: none !important; }
  .topbar-actions { margin-left: auto; flex-shrink: 0; gap: 2px !important; }
  .topbar-user-btn { width: 38px !important; overflow: hidden; padding: 4px !important; border-radius: 50% !important; min-width: 36px; min-height: 36px; justify-content: center; }
  .topbar-username { display: none !important; }
  .topbar-chevron  { display: none !important; }
  .topbar-avatar   { width: 28px !important; height: 28px !important; font-size: 11px !important; }
  #notifDropdown { position: fixed !important; top: var(--topbar-h) !important; left: 12px !important; right: 12px !important; width: auto !important; max-height: calc(100vh - var(--topbar-h) - 16px) !important; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-header h1 { font-size: 18px; }
  .card-body { padding: 14px; }
  .modal { border-radius: var(--r-md); }
  .auth-card { padding: 28px 20px; }
}
@media (max-width: 380px) { .stat-grid { grid-template-columns: 1fr; } }

/* Print */
@media print {
  .sidebar, .topbar, .mobile-nav, #toast-container { display: none !important; }
  .app-main { margin-left: 0 !important; padding-top: 0 !important; }
}


/* ── Topbar app icon + name ─────────────────────────────────── */
@keyframes icon-bling {
  0%   { box-shadow: 0 0 0px rgba(0,212,255,0);   transform: scale(1)    rotate(0deg); }
  20%  { box-shadow: 0 0 8px rgba(0,212,255,0.70); transform: scale(1.12) rotate(-6deg); }
  40%  { box-shadow: 0 0 14px rgba(139,92,246,0.65); transform: scale(1.15) rotate(6deg); }
  60%  { box-shadow: 0 0 10px rgba(192,38,211,0.60); transform: scale(1.10) rotate(-3deg); }
  80%  { box-shadow: 0 0 6px rgba(59,130,246,0.50);  transform: scale(1.05) rotate(2deg); }
  100% { box-shadow: 0 0 0px rgba(0,212,255,0);   transform: scale(1)    rotate(0deg); }
}
@keyframes name-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.topbar-app-icon {
  width: 30px; height: 30px; border-radius: var(--r-md);
  background: var(--logo-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #fff; flex-shrink: 0;
  animation: icon-bling 3.2s ease-in-out infinite;
  animation-delay: 1.5s;
}
.topbar-app-name {
  font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700;
  background: linear-gradient(90deg,
    #00D4FF 0%, #3B82F6 20%, #8B5CF6 40%, #C026D3 60%, #8B5CF6 80%, #00D4FF 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: name-shimmer 4s linear infinite;
}
@media (max-width: 768px) {
  .topbar-app-name { font-size: 13px; max-width: 130px; }
}

/* ── Sidebar collapse (desktop push, mobile overlay) ─────── */
body.sb-collapsed .sidebar { transform: translateX(-100%); }
body.sb-collapsed .app-main { margin-left: 0; }
.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 499; top: var(--topbar-h); }
.sb-overlay.active { display: block; }
@media (max-width: 1024px) {
  .app-main { margin-left: 0 !important; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  body.sb-collapsed .app-main { margin-left: 0; }
}


/* ── Brand gradient scrollbar ──────────────────────────────── */
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: #8B5CF6 transparent; }

/* Chrome / Safari / Edge */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00D4FF 0%, #3B82F6 30%, #8B5CF6 65%, #C026D3 100%);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3B82F6 0%, #8B5CF6 50%, #C026D3 100%);
}
::-webkit-scrollbar-corner { background: transparent; }

/* Keep sidebar nav scrollbar hidden */
.sb-nav { scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
