/* ============================================
   MoneyBexX Design System
   Based on invoicifySmart purple-forward palette
   ============================================ */

:root {
  /* Primary Brand Colors - Purple Forward */
  --brand: #5b21b6;           /* Deep Purple - Main brand color */
  --brand2: #6366f1;          /* Indigo - Secondary brand accent */
  --brandSoft: rgba(99, 102, 241, 0.12);  /* Soft indigo background */

  /* Neutral Palette */
  --bg: #ffffff;              /* Clean white backgrounds */
  --bgHover: rgba(99, 102, 241, 0.08);    /* Hover background */
  --surface: rgba(255, 255, 255, 0.86);   /* Glass-morphism surface */
  --surface2: rgba(249, 250, 251, 0.82);  /* Lighter surface variant */
  --text: #0f172a;            /* Deep slate for text */
  --textMuted: #64748b;       /* Muted gray for secondary text */
  --border: rgba(148, 163, 184, 0.28);    /* Subtle borders */

  /* Semantic Colors */
  --success: #16a34a;         /* Green for positive actions */
  --successLight: rgba(22, 163, 74, 0.08);
  --successBorder: rgba(22, 163, 74, 0.25);
  --warn: #ec4899;            /* Pink for warnings (matches purple theme) */
  --warnLight: rgba(236, 72, 153, 0.10);
  --warnBorder: rgba(236, 72, 153, 0.25);
  --error: #f43f5e;           /* Rose for errors (softer, more purple-compatible) */
  --errorLight: rgba(244, 63, 94, 0.06);
  --errorBorder: rgba(244, 63, 94, 0.35);
  --info: #0ea5e9;            /* Sky blue for info */
  --infoLight: rgba(14, 165, 233, 0.08);
  --infoBorder: rgba(14, 165, 233, 0.25);

  /* Spacing System */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Border Radius */
  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-full: 999px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.10);
  --shadow-hover: 0 12px 30px rgba(15, 23, 42, 0.12);

  /* Transitions */
  --transition-fast: 0.08s ease;
  --transition-normal: 0.15s ease;
  --transition-slow: 0.3s ease;

  /* Z-Index Layers */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* Dark Mode Support (future) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bgHover: rgba(99, 102, 241, 0.15);
    --surface: rgba(30, 41, 59, 0.86);
    --surface2: rgba(51, 65, 85, 0.82);
    --text: #f1f5f9;
    --textMuted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
  }
}

/* ============================================
   Base Styles
   ============================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: 40px; font-weight: 900; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }
h5 { font-size: 18px; font-weight: 600; }
h6 { font-size: 16px; font-weight: 600; }

p {
  margin: 0 0 1rem 0;
}

a {
  color: var(--brand2);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: var(--brand);
}

/* ============================================
   Typography Utilities
   ============================================ */

.page-title {
  font-size: 40px;
  font-weight: 900;
  color: var(--text);
}

.dashboard-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--text);
}

.section-header {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--spacing-md);
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.metric-label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--textMuted);
}

.metric-subtext {
  font-size: 13px;
  font-weight: 400;
  color: var(--textMuted);
}

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

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

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

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

/* ============================================
   Utility Classes
   ============================================ */

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-none { display: none; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }

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

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
