/* ============================================================
   Nixus — Professional Invoicing Platform
   File: static/css/style.css
   Purpose: Main stylesheet (dark high-end minimalist)
   Author: Nixus Team
   License: MIT
   ============================================================ */

/* ============================================================
   1. CSS VARIABLES (Design tokens)
   ============================================================ */
:root {
  /* Backgrounds — deep dark */
  --bg-base: #0a0a0a;
  --bg-elev-1: #0e0e0e;
  --bg-elev-2: #111111;
  --bg-elev-3: #161616;
  --bg-elev-4: #1a1a1a;
  --bg-elev-5: #1f1f1f;
  --bg-overlay: rgba(10, 10, 10, 0.72);

  /* Borders — thin, subtle */
  --border-subtle: #1a1a1a;
  --border-default: #262626;
  --border-strong: #333333;
  --border-focus: #00ff9d;

  /* Text */
  --text-primary: #f5f5f5;
  --text-secondary: #d4d4d4;
  --text-tertiary: #a3a3a3;
  --text-muted: #737373;
  --text-disabled: #4d4d4d;
  --text-inverse: #0a0a0a;

  /* Accent — neon green */
  --accent: #00ff9d;
  --accent-dim: #00cc7d;
  --accent-dark: #009960;
  --accent-glow: rgba(0, 255, 157, 0.15);
  --accent-glow-strong: rgba(0, 255, 157, 0.35);
  --accent-soft: rgba(0, 255, 157, 0.08);

  /* Electric blue (secondary accent) */
  --electric: #5b8cff;
  --electric-dim: #3a6fe0;
  --electric-glow: rgba(91, 140, 255, 0.2);

  /* Status colors */
  --success: #00ff9d;
  --success-bg: rgba(0, 255, 157, 0.1);
  --warning: #ffb547;
  --warning-bg: rgba(255, 181, 71, 0.1);
  --danger: #ff5c5c;
  --danger-bg: rgba(255, 92, 92, 0.1);
  --info: #5b8cff;
  --info-bg: rgba(91, 140, 255, 0.1);
  --muted: #737373;
  --muted-bg: rgba(115, 115, 115, 0.1);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 0 1px var(--accent-glow), 0 0 30px var(--accent-glow);
  --shadow-glow-strong: 0 0 0 1px var(--accent-glow-strong), 0 0 40px var(--accent-glow);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-base: 0.25s var(--ease-out);
  --transition-slow: 0.4s var(--ease-out);

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 960px;
  --sidebar-width: 256px;
  --navbar-height: 64px;
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { margin: 0 0 1em; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-dim); }

img, svg, video { display: block; max-width: 100%; height: auto; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; padding: 0; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  padding: 2px 6px;
  background: var(--bg-elev-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--accent);
}


/* ============================================================
   3. SELECTION / SCROLLBAR
   ============================================================ */
::selection {
  background: var(--accent-glow-strong);
  color: var(--text-primary);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border: 2px solid var(--bg-base);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

* { scrollbar-width: thin; scrollbar-color: var(--border-default) var(--bg-base); }


/* ============================================================
   4. FOCUS / ACCESSIBILITY
   ============================================================ */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: var(--text-inverse);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 16px; }


/* ============================================================
   5. LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--space-2); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-8); }
.row { display: flex; flex-direction: row; gap: var(--space-4); align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.row-wrap { flex-wrap: wrap; }

.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding: 0 var(--space-4); }
}


/* ============================================================
   6. BACKGROUND EFFECTS
   ============================================================ */
.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 48px 48px;
}

.glow-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.glow-orb-accent { background: var(--accent); }
.glow-orb-electric { background: var(--electric); }


/* ============================================================
   7. TYPOGRAPHY UTILITIES
   ============================================================ */
.text-xs { font-size: 0.75rem; line-height: 1.4; }
.text-sm { font-size: 0.875rem; line-height: 1.5; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }
.text-7xl { font-size: 4.5rem; }
.text-8xl { font-size: 6rem; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.font-mono { font-family: var(--font-mono); }

.tracking-tight { letter-spacing: -0.02em; }
.tracking-tighter { letter-spacing: -0.04em; }
.tracking-wide { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.15em; }

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.lowercase { text-transform: lowercase; }

.leading-tight { line-height: 1.15; }
.leading-snug { line-height: 1.35; }
.leading-normal { line-height: 1.55; }
.leading-relaxed { line-height: 1.7; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-electric { color: var(--electric); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gradient-text {
  background: linear-gradient(180deg, #ffffff 0%, #737373 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gradient-text-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--electric) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}


/* ============================================================
   8. SPACING UTILITIES
   ============================================================ */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }


/* ============================================================
   9. CARDS
   ============================================================ */
.card {
  background: linear-gradient(180deg, var(--bg-elev-2) 0%, var(--bg-elev-1) 100%);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
  position: relative;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow-lg);
}

.card-interactive { cursor: pointer; }
.card-interactive:hover { transform: translateY(-2px); }

.card-flat {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.card-elevated {
  background: var(--bg-elev-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body { color: var(--text-secondary); }

.card-footer {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.card-glow {
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}


/* ============================================================
   10. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Primary — accent green */
.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  box-shadow: 0 0 24px var(--accent-glow-strong);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

/* Secondary — outlined */
.btn-secondary {
  background: var(--bg-elev-3);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-elev-4);
  border-color: var(--border-strong);
}

/* Ghost — transparent */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
}
.btn-ghost:hover {
  background: var(--bg-elev-3);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Outline accent */
.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent-soft);
  box-shadow: 0 0 16px var(--accent-glow);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: #e04a4a;
  box-shadow: 0 0 24px rgba(255, 92, 92, 0.3);
}

/* Success */
.btn-success {
  background: var(--success);
  color: var(--text-inverse);
  border-color: var(--success);
}
.btn-success:hover {
  background: var(--accent-dim);
  box-shadow: 0 0 24px var(--accent-glow-strong);
}

/* Sizes */
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-sm svg { width: 14px; height: 14px; }

.btn-lg { padding: 14px 24px; font-size: 0.95rem; }
.btn-lg svg { width: 18px; height: 18px; }

.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
}
.btn-icon svg { width: 18px; height: 18px; }

.btn-block { width: 100%; }


/* ============================================================
   11. BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-glow); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: rgba(0, 255, 157, 0.2); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(255, 181, 71, 0.2); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255, 92, 92, 0.2); }
.badge-info { background: var(--info-bg); color: var(--info); border-color: rgba(91, 140, 255, 0.2); }
.badge-muted { background: var(--muted-bg); color: var(--muted); border-color: var(--border-default); }


/* ============================================================
   12. ALERTS
   ============================================================ */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 0.9rem;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.alert-icon { flex-shrink: 0; width: 20px; height: 20px; }
.alert-content { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-message { color: var(--text-secondary); font-size: 0.875rem; }

.alert-success { background: var(--success-bg); border-color: rgba(0, 255, 157, 0.25); color: var(--success); }
.alert-warning { background: var(--warning-bg); border-color: rgba(255, 181, 71, 0.25); color: var(--warning); }
.alert-danger { background: var(--danger-bg); border-color: rgba(255, 92, 92, 0.25); color: var(--danger); }
.alert-info { background: var(--info-bg); border-color: rgba(91, 140, 255, 0.25); color: var(--info); }


/* ============================================================
   13. DIVIDERS
   ============================================================ */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
  margin: var(--space-6) 0;
  border: 0;
}

.divider-solid { height: 1px; background: var(--border-default); margin: var(--space-4) 0; border: 0; }


/* ============================================================
   14. NAVBAR
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-height);
  background: var(--bg-overlay);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-default);
}

.navbar-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.navbar-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.navbar-brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.navbar-link {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  transition: color var(--transition-fast);
}
.navbar-link:hover { color: var(--text-primary); }
.navbar-link.active { color: var(--text-primary); }
.navbar-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.navbar-actions { display: flex; align-items: center; gap: var(--space-3); }

@media (max-width: 768px) {
  .navbar-nav { display: none; }
}


/* ============================================================
   15. SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-base);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
}

.sidebar-header {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border-default);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-6) var(--space-3);
  overflow-y: auto;
}

.sidebar-section-label {
  padding: 0 var(--space-3);
  padding-bottom: var(--space-2);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-disabled);
}

.sidebar-section + .sidebar-section { margin-top: var(--space-6); }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-elev-2);
}

.sidebar-link.active {
  color: var(--text-primary);
  background: var(--bg-elev-3);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent);
}

.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--border-default);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-default);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--electric));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 0.85rem;
}

.sidebar-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}


/* ============================================================
   16. PAGE LAYOUT (with sidebar)
   ============================================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  min-width: 0;
  background: var(--bg-base);
}

.app-topbar {
  height: var(--navbar-height);
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-content {
  padding: var(--space-8) var(--space-6);
  max-width: var(--container-max);
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .sidebar { display: none; }
}


/* ============================================================
   17. PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.page-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}


/* ============================================================
   18. EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--bg-elev-3);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto var(--space-6);
}


/* ============================================================
   19. AVATARS
   ============================================================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), var(--electric));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-default);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -10px; border: 2px solid var(--bg-base); }
.avatar-group .avatar:first-child { margin-left: 0; }


/* ============================================================
   20. KPI / STATS
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.kpi {
  padding: var(--space-5);
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.kpi:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}

.kpi-meta {
  margin-top: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }


/* ============================================================
   21. FEATURE CARD (marketing)
   ============================================================ */
.feature-card {
  padding: var(--space-6);
  background: linear-gradient(180deg, var(--bg-elev-2), var(--bg-elev-1));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent-glow), var(--shadow-lg);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: var(--space-4);
}

.feature-icon svg { width: 22px; height: 22px; }

.feature-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.feature-text {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}


/* ============================================================
   22. HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--space-24) 0 var(--space-20);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: rgba(17, 17, 17, 0.5);
  backdrop-filter: blur(10px);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: var(--space-8);
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s var(--ease-in-out) infinite;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin-bottom: var(--space-8);
}

.hero-subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--text-tertiary);
  max-width: 640px;
  line-height: 1.6;
  margin-bottom: var(--space-10);
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-12);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero-trust-item { display: flex; align-items: center; gap: 8px; }


/* ============================================================
   23. FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--border-default);
  margin-top: var(--space-24);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-4);
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

.footer-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--text-primary); }

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ============================================================
   24. MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-elev-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s var(--ease-out);
}

.modal-lg { max-width: 720px; }
.modal-sm { max-width: 380px; }

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.modal-title { font-size: 1rem; font-weight: 600; }

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--bg-elev-4); color: var(--text-primary); }

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* ============================================================
   25. DROPDOWN
   ============================================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elev-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.dropdown-item:hover {
  background: var(--bg-elev-4);
  color: var(--text-primary);
}

.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: var(--space-2) 0;
}


/* ============================================================
   26. TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev-4);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::after { opacity: 1; }


/* ============================================================
   27. SKELETON / LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elev-2) 0%, var(--bg-elev-3) 50%, var(--bg-elev-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-sm);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }


/* ============================================================
   28. PROGRESS
   ============================================================ */
.progress {
  height: 6px;
  background: var(--bg-elev-3);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--electric));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}


/* ============================================================
   29. ANIMATIONS
   ============================================================ */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.4s var(--ease-out); }
.animate-slide-up { animation: slideUp 0.5s var(--ease-out); }
.animate-slide-down { animation: slideDown 0.4s var(--ease-out); }


/* ============================================================
   30. UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border { border: 1px solid var(--border-default); }
.border-t { border-top: 1px solid var(--border-default); }
.border-b { border-bottom: 1px solid var(--border-default); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-glow { box-shadow: var(--shadow-glow); }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

.pointer { cursor: pointer; }
.select-none { user-select: none; }

.bg-base { background: var(--bg-base); }
.bg-elev-1 { background: var(--bg-elev-1); }
.bg-elev-2 { background: var(--bg-elev-2); }
.bg-elev-3 { background: var(--bg-elev-3); }


/* ============================================================
   31. PRINT RESET
   ============================================================ */
@media print {
  body { background: #fff; color: #000; }
  .navbar, .sidebar, .footer, .no-print { display: none !important; }
}


/* ============================================================
   32. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}