/* ========================================
   Knights of Columbus - Design System
   Modern "Chapel" Aesthetic
   ======================================== */

/* ============== CSS RESET ============== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============== DESIGN TOKENS ============== */
:root {
  /* === COLOR PALETTE === */

  /* Primary - Refined Deep Blue (warmer undertones) */
  --primary-950: #020617;
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #0D3471;
  --primary-600: #1d4ed8;
  --primary-500: #3b82f6;
  --primary-400: #60a5fa;
  --primary-300: #93c5fd;

  /* Accent - Refined Gold (warmer, more sophisticated) */
  --accent-600: #d97706;
  --accent-500: #f59e0b;
  --accent-400: #fbbf24;
  --accent-300: #fcd34d;
  --accent-200: #fde68a;
  --accent-100: #fef3c7;

  /* Neutrals - Warmer Stone Tones */
  --neutral-50: #fafaf9;
  --neutral-100: #f5f5f4;
  --neutral-200: #e7e5e4;
  --neutral-300: #d6d3d1;
  --neutral-400: #a8a29e;
  --neutral-500: #78716c;
  --neutral-600: #57534e;
  --neutral-700: #44403c;
  --neutral-800: #292524;
  --neutral-900: #1c1917;

  /* Semantic Colors */
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-50: #f0fdf4;

  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-50: #fffbeb;

  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-50: #fef2f2;

  --info-500: #3b82f6;
  --info-600: #2563eb;
  --info-50: #eff6ff;

  /* === SURFACES & EFFECTS === */

  /* Glass morphism */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-light: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-light: rgba(0, 0, 0, 0.08);

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* Colored shadows for accents */
  --shadow-primary: 0 4px 14px 0 rgba(13, 52, 113, 0.25);
  --shadow-accent: 0 4px 14px 0 rgba(245, 158, 11, 0.35);

  /* === TYPOGRAPHY === */

  /* Font Families */
  --font-display: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-accent: 'Cardo', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Type Scale */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */
  --text-6xl: 3.75rem;
  /* 60px */

  /* Font Weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Letter Spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;

  /* === SPACING SCALE === */
  --space-0: 0;
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */

  /* === BORDER RADIUS === */
  --radius-none: 0;
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-md: 0.375rem;
  /* 6px */
  --radius-lg: 0.5rem;
  /* 8px */
  --radius-xl: 0.75rem;
  /* 12px */
  --radius-2xl: 1rem;
  /* 16px */
  --radius-3xl: 1.5rem;
  /* 24px */
  --radius-full: 9999px;

  /* === TRANSITIONS === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Easing */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* === Z-INDEX SCALE === */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* === SIDEBAR LAYOUT === */
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 56px;
  --navbar-height: 64px;
}

/* ============== BASE STYLES ============== */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--neutral-800);
  background: var(--neutral-100);
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--neutral-900);
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

h5 {
  font-size: var(--text-lg);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
}

/* Links */
a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-500);
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent-200);
  color: var(--neutral-900);
}

/* ============== COMPONENT PATTERNS ============== */

/* === CARDS === */
.card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--neutral-200);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card--glass {
  background: var(--glass-bg-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border-light);
}

.card--dark {
  background: var(--primary-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

.card--dark h1,
.card--dark h2,
.card--dark h3,
.card--dark h4 {
  color: white;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: 1;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 52, 113, 0.35);
}

.btn--accent {
  background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-600) 100%);
  color: var(--neutral-900);
  box-shadow: var(--shadow-accent);
}

.btn--accent:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-400) 0%, var(--accent-500) 100%);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border: 2px solid var(--primary-700);
  color: var(--primary-700);
}

.btn--outline:hover:not(:disabled) {
  background: var(--primary-700);
  color: white;
}

.btn--ghost {
  background: transparent;
  color: var(--neutral-600);
}

.btn--ghost:hover:not(:disabled) {
  background: #0D3471;
  color: var(--neutral-900);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-xl);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--icon {
  padding: var(--space-3);
  border-radius: var(--radius-lg);
}

/* === FORM INPUTS === */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--neutral-700);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--neutral-800);
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.input::placeholder {
  color: var(--neutral-400);
}

.input:hover {
  border-color: var(--neutral-400);
}

.input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input--error {
  border-color: var(--error-500);
}

.input--error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input-hint {
  font-size: var(--text-sm);
  color: var(--neutral-500);
}

.input-error {
  font-size: var(--text-sm);
  color: var(--error-600);
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
}

.badge--primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge--success {
  background: var(--success-50);
  color: var(--success-600);
}

.badge--warning {
  background: var(--warning-50);
  color: var(--warning-600);
}

.badge--error {
  background: var(--error-50);
  color: var(--error-600);
}

.badge--neutral {
  background: var(--neutral-100);
  color: var(--neutral-600);
}

/* === STAT CARDS === */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--neutral-200);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--primary-700);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--neutral-500);
  font-weight: var(--font-medium);
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.stat-change--up {
  color: var(--success-600);
}

.stat-change--down {
  color: var(--error-600);
}

/* ============== SIDEBAR LAYOUT ============== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0D3471 0%, #0a2a5e 100%);
  border-right: none;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  transition: width var(--transition-slow);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Slim scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  margin-bottom: var(--space-3);
}

.sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
}

.sidebar-brand-text {
  color: white;
}

.sidebar-brand-text h3 {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: #fbbf24;
  margin: 0;
  line-height: 1.2;
}

.sidebar-brand-text p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fbbf24;
}

.sidebar-link.active {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: #fbbf24;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.sidebar-link i {
  width: 16px;
  text-align: center;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.sidebar-section {
  margin-top: var(--space-3);
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: var(--font-semibold);
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(251, 191, 36, 0.5);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--neutral-100);
}

.main-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--neutral-200);
}

.main-header-title h1 {
  font-size: var(--text-xl);
  color: var(--primary-700);
}

.main-header-title p {
  font-size: var(--text-xs);
  color: var(--neutral-500);
}

.main-body {
  padding: var(--space-6);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.breadcrumb-item {
  color: var(--neutral-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
  color: var(--primary-600);
}

.breadcrumb-item.current {
  color: var(--neutral-600);
}

.breadcrumb-separator {
  color: var(--neutral-300);
  font-size: 0.6rem;
  margin: 0 var(--space-1);
}

/* ============== ANIMATIONS ============== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation Utilities */
.animate-fadeIn {
  animation: fadeIn var(--transition-slow) var(--ease-out);
}

.animate-fadeInUp {
  animation: fadeInUp var(--transition-slow) var(--ease-out);
}

.animate-fadeInDown {
  animation: fadeInDown var(--transition-slow) var(--ease-out);
}

.animate-slideInLeft {
  animation: slideInLeft var(--transition-slow) var(--ease-out);
}

.animate-slideInRight {
  animation: slideInRight var(--transition-slow) var(--ease-out);
}

.animate-scaleIn {
  animation: scaleIn var(--transition-base) var(--ease-out);
}

.animate-pulse {
  animation: pulse 2s var(--ease-in-out) infinite;
}

/* Stagger animations for children */
.stagger-children>* {
  animation: fadeInUp var(--transition-slow) var(--ease-out) both;
}

.stagger-children>*:nth-child(1) {
  animation-delay: 0.02s;
}

.stagger-children>*:nth-child(2) {
  animation-delay: 0.04s;
}

.stagger-children>*:nth-child(3) {
  animation-delay: 0.06s;
}

.stagger-children>*:nth-child(4) {
  animation-delay: 0.08s;
}

.stagger-children>*:nth-child(5) {
  animation-delay: 0.1s;
}

.stagger-children>*:nth-child(6) {
  animation-delay: 0.12s;
}

.stagger-children>*:nth-child(7) {
  animation-delay: 0.14s;
}

.stagger-children>*:nth-child(8) {
  animation-delay: 0.16s;
}

.stagger-children>*:nth-child(n+9) {
  animation-delay: 0.18s;
}

/* Reduced motion preference - disable animations for accessibility */
@media (prefers-reduced-motion: reduce) {
  .stagger-children>* {
    animation: none;
    opacity: 1;
  }
}

/* ============== UTILITY CLASSES ============== */

/* Display */
.hidden {
  display: none;
}

.block {
  display: block;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.inline-flex {
  display: inline-flex;
}

/* Flex */
.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

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

.gap-6 {
  gap: var(--space-6);
}

.gap-8 {
  gap: var(--space-8);
}

/* Grid */
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Text */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

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

.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-2xl {
  font-size: var(--text-2xl);
}

.font-medium {
  font-weight: var(--font-medium);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-bold {
  font-weight: var(--font-bold);
}

/* Colors */
.text-primary {
  color: var(--primary-700);
}

.text-accent {
  color: var(--accent-500);
}

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

.text-white {
  color: white;
}

.bg-primary {
  background-color: var(--primary-700);
}

.bg-accent {
  background-color: var(--accent-500);
}

.bg-white {
  background-color: white;
}

/* Spacing */
.p-4 {
  padding: var(--space-4);
}

.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-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.m-0 {
  margin: 0;
}

.mt-4 {
  margin-top: var(--space-4);
}

.mt-6 {
  margin-top: var(--space-6);
}

.mt-8 {
  margin-top: var(--space-8);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.mb-6 {
  margin-bottom: var(--space-6);
}

/* Border Radius */
.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* Width */
.w-full {
  width: 100%;
}

.max-w-sm {
  max-width: 24rem;
}

.max-w-md {
  max-width: 28rem;
}

.max-w-lg {
  max-width: 32rem;
}

.max-w-xl {
  max-width: 36rem;
}

.max-w-2xl {
  max-width: 42rem;
}

.max-w-4xl {
  max-width: 56rem;
}

.max-w-6xl {
  max-width: 72rem;
}

/* ============== DATA TABLES ============== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead {
  background: var(--neutral-50);
  border-bottom: 2px solid var(--neutral-200);
}

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--neutral-600);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  color: var(--neutral-700);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--neutral-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table with striped rows */
.data-table--striped tbody tr:nth-child(even) {
  background-color: var(--neutral-50);
}

/* Table with bordered cells */
.data-table--bordered th,
.data-table--bordered td {
  border: 1px solid var(--neutral-200);
}

/* Compact table */
.data-table--compact th,
.data-table--compact td {
  padding: var(--space-2) var(--space-3);
}

/* ============== FORM COMPONENTS ============== */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--neutral-700);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--neutral-800);
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: var(--neutral-400);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

.form-select:disabled {
  background-color: var(--neutral-100);
  cursor: not-allowed;
}

/* ============== SEMANTIC COLOR VARS ============== */
:root {
  --primary-100: #dbeafe;
  --danger-500: #ef4444;
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-muted: var(--neutral-500);
  --bg-secondary: var(--neutral-50);
  --bg-tertiary: var(--neutral-100);
  --border-light: var(--neutral-200);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 240px;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .main-body {
    padding: var(--space-4);
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.5rem;
  }
}

/* --- Added Styles for Manage Councils & System Consistency --- */

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: var(--z-modal);
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background-color: white;
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-2xl);
  transform: translateY(20px);
  transition: transform var(--transition-base);
  border: 1px solid var(--neutral-200);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--primary-900);
  margin: 0;
}

.close-modal {
  background: none;
  border: none;
  font-size: var(--text-xl);
  color: var(--neutral-400);
  cursor: pointer;
  padding: var(--space-1);
  transition: color var(--transition-base);
}

.close-modal:hover {
  color: var(--primary-600);
}

.modal-body {
  margin-bottom: var(--space-6);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--neutral-100);
}

/* Search Bar */
.search-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--neutral-200);
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 400px;
  transition: box-shadow var(--transition-base);
}

.search-container:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-300);
}

.search-container i {
  color: var(--neutral-400);
}

.search-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: var(--text-sm);
  color: var(--neutral-700);
}

/* Event Table aliases for Data Table */
.event-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.event-table th {
  text-align: left;
  padding: var(--space-4);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neutral-400);
  background: white;
  border-bottom: 1px solid var(--neutral-200);
  font-weight: var(--font-bold);
}

.event-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--neutral-100);
  font-size: var(--text-sm);
  vertical-align: middle;
  color: var(--neutral-700);
}

.event-table tr:last-child td {
  border-bottom: none;
}

.event-table tr:hover td {
  background-color: var(--neutral-50);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: var(--space-2);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  color: var(--neutral-500);
  background: transparent;
  border: none;
  cursor: pointer;
}

.btn-icon:hover {
  background-color: var(--neutral-100);
  color: var(--primary-600);
}

.btn-icon.delete:hover {
  background-color: var(--error-50);
  color: var(--error-600);
}

.btn-icon.edit:hover {
  background-color: var(--primary-50);
  color: var(--primary-600);
}

/* Legacy/Compatibility Mappings */
/* Legacy/Compatibility Mappings - Revamped */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  background: var(--neutral-50);
  color: var(--neutral-600);
}

.edit-btn {
  /* Inherits base action-btn styles */
}

.edit-btn:hover {
  background: var(--primary-50);
  color: var(--primary-700);
}

.delete-btn {
  /* Inherits base action-btn styles */
}

.delete-btn:hover {
  background: var(--error-50);
  color: var(--error-700);
}

.secondary-btn {
  /* Map to btn--ghost/outline look implicitly or define here */
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--font-medium);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--neutral-300);
  color: var(--neutral-700);
  transition: all var(--transition-base);
}

.secondary-btn:hover {
  background: var(--neutral-100);
  border-color: var(--neutral-400);
}

.add-council-btn {
  /* Map to btn--primary */
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--font-medium);
  cursor: pointer;
  background: var(--primary-700);
  color: white;
  border: none;
  transition: all var(--transition-base);
}

.add-council-btn:hover {
  background: var(--primary-800);
}
