/* ===== MAIN CSS FILE ===== */
/* Import all CSS modules in the correct order */

/* 1. Variables first - defines all CSS custom properties */
@import url('./variables.css');

/* 2. Base styles - resets, typography, global styles */
@import url('./base.css?v=2');

/* 3. Layout - grid system, sidebar, containers */
@import url('./layout.css');

/* 4. Components - reusable UI components */
@import url('./components.css');

/* 4.5. List and Table System - consistent data display */
@import url('./list-system.css');

/* 4.6. Sidebar - navigation components */
@import url('./sidebar.css');

/* 4.7. Modern Typography - consistent text colors */
@import url('./modern-typography.css');

/* 5. Utilities last - override classes */
@import url('./utilities.css');

/* ===== LEGACY COMPATIBILITY ===== */
/* Include specific legacy styles that may still be needed */

/* Church-specific overrides */
.church-branding {
  --primary: var(--primary);
  --secondary: var(--secondary);
}

/* Bootstrap compatibility layer */
.container-fluid {
  width: 100%;
  padding-right: var(--space-4);
  padding-left: var(--space-4);
  margin-right: auto;
  margin-left: auto;
}

/* Ensure Bootstrap grid works with our layout */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(var(--space-2) * -1);
  margin-left: calc(var(--space-2) * -1);
}

/* NOTE: do NOT add `width: 100%; max-width: 100%` here.
   This rule loads after Bootstrap (base.html) at equal specificity (0,1,0),
   so a width here wins by source order over Bootstrap's responsive
   `.col-lg-8 { width: 66.6% }` etc. It previously forced EVERY grid column to
   full width — collapsing all two-column layouts (form + sidebar, card grids)
   to a single stacked column at every breakpoint across ~86 CRM templates.
   Bootstrap's own `.row > *` already sets the 100% base for stacking on mobile;
   let its `.col-{bp}-{n}` rules take back over on larger screens. (6 Jul 2026) */
.row > * {
  flex-shrink: 0;
  padding-right: var(--space-2);
  padding-left: var(--space-2);
}

/* Custom grid columns for compatibility */
.col-xl-3 {
  flex: 0 0 auto;
  width: 25%;
}

.col-md-6 {
  flex: 0 0 auto;
  width: 50%;
}

.col-sm-12 {
  flex: 0 0 auto;
  width: 100%;
}

@media (max-width: 1199.98px) {
  .col-xl-3 {
    width: 50%;
  }
}

@media (max-width: 767.98px) {
  .col-md-6 {
    width: 100%;
  }
}

/* Legacy gap utilities */
.g-3 {
  gap: var(--space-3);
}

.g-4 {
  gap: var(--space-4);
}

/* Legacy margin utilities */
.mb-4 {
  margin-bottom: var(--space-4) !important;
}

.mb-5 {
  margin-bottom: var(--space-5) !important;
}

/* Legacy text decoration */
.text-decoration-none {
  text-decoration: none !important;
}

/* Feather icons compatibility */
[data-feather] {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}