:root {
  /* Primary Colors */
  --primary-blue: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-lighter: #ebf5ff;
  /* Lighter for softer backgrounds */

  /* Status Colors */
  --success-green: #10b981;
  --success-bg: #d1fae5;
  --warning-yellow: #f59e0b;
  --warning-bg: #fef3c7;
  --danger-red: #ef4444;
  --danger-bg: #fee2e2;
  --info-blue: #3b82f6;
  --info-bg: #dbeafe;
  --void-gray: #6b7280;
  --void-bg: #f3f4f6;

  /* Neutral Colors */
  --background: #f9fafb;
  /* Softer gray */
  --surface: #ffffff;
  --white: #ffffff;
  --border: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  /* Spacing System */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows - Premium Soft Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.3);

  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --secondary-light: #e5e7eb;
  --secondary-gray: #9ca3af;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--background);
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: var(--text-base);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

a {
  text-decoration: none;
  color: var(--primary-blue);
  transition: color 0.2s;
}

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

/* 1. Buttons - Premium & Modern */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
  gap: 0.5rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-blue));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
}

.btn-secondary:hover {
  background: var(--background);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-red), #dc2626);
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, var(--danger-red));
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

/* New: Create Button (often used) */
.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-blue);
  /* Fallback */
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-create:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-light), var(--primary-blue));
}


.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

.btn-md {
  padding: 0.625rem 1.25rem;
  font-size: var(--text-base);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--text-lg);
}

/* Action Buttons - For Quick Actions sections */
.action-btn {
  display: block;
  width: 100%;
  padding: 0.875rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: var(--text-sm);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 0.75rem;
}

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-blue));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.action-btn.secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}

.action-btn.secondary:hover {
  background: var(--background);
  border-color: var(--text-muted);
  color: var(--text-primary);
}


/* 2. Input Fields - Modern & Accessible */
.form-group {
  margin-bottom: var(--space-5);
  position: relative;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  background-color: var(--surface);
  color: var(--text-primary);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.form-hint {
  display: block;
  margin-top: 0.375rem;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* 3. Cards - Soft & Elevated */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-6);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(249, 250, 251, 0.5);
  /* Subtle bg */
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem;
}


/* 4. Tables - Clean & Spacious */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.table thead th {
  text-align: left;
  padding: 1rem 1.5rem;
  background: var(--background);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}

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

.table tbody tr:hover td {
  background-color: var(--primary-lighter);
}

/* 5. Badges - Soft & Rounded */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success-green);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-yellow);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-red);
}

.badge-primary {
  background: var(--info-bg);
  color: var(--primary-blue);
}

.badge-secondary {
  background: var(--void-bg);
  color: var(--void-gray);
}


/* 6. Layout Components */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar - sleek & modern */
.sidebar {
  width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  z-index: 50;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid transparent;
}

.sidebar-logo {
  font-size: var(--text-2xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-nav {
  padding: 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  color: var(--text-secondary);
  font-weight: 500;
  gap: 1rem;
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  margin-bottom: 0.125rem;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--background);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-lighter);
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.nav-link:hover svg,
.nav-link.active svg {
  opacity: 1;
}

/* Main Content */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-header {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--secondary-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-8);
}

.page-title-group h1 {
  font-size: var(--text-2xl);
  margin-bottom: 0.25rem;
}

.page-title-group p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.header-actions {
  display: flex;
  gap: var(--space-3);
}

/* Stats Cards - Premium & Clean */
.stats-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
  transition: all var(--transition-fast);
}

.stat-icon-wrapper.orange {
  background: var(--warning-bg);
  color: var(--warning-yellow);
}

.stat-icon-wrapper.yellow {
  background: var(--warning-bg);
  color: var(--warning-yellow);
}

.stat-icon-wrapper.green {
  background: var(--success-bg);
  color: var(--success-green);
}

.stat-icon-wrapper.red {
  background: var(--danger-bg);
  color: var(--danger-red);
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
  letter-spacing: -0.025em;
}

.stat-amount {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.stat-change {
  font-size: var(--text-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive {
  color: var(--success-green);
}

.stat-change.negative {
  color: var(--danger-red);
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 7. Alerts - Premium Notifications */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: var(--text-sm);
  border: 1px solid transparent;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.alert-success {
  background-color: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--success-green);
}

.alert-danger {
  background-color: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger-red);
}

.alert-warning {
  background-color: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--warning-yellow);
}

.alert-info {
  background-color: var(--info-bg);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--primary-blue);
}


/* Desktop: 4 columns */
@media (min-width: 1024px) {
  .stats-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Grid Layouts */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-6);
}

/* 📱 Breakpoints & Responsive Variables */
:root {
  --breakpoint-xs: 320px;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
}

/* 📱 Mobile Layout & Grid System */
/* Container */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* 📱 Mobile Header */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border-bottom: 1px solid var(--secondary-light);
  position: sticky;
  top: 0;
  z-index: 90;
}

.menu-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: relative;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 5px;
}

.menu-toggle.active .hamburger {
  background: transparent;
}

.menu-toggle.active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  top: -2px;
}

@media (min-width: 1024px) {
  .mobile-header {
    display: none;
  }

  .drawer,
  .drawer-overlay {
    display: none !important;
  }
}

/* 📱 Side Drawer */
.drawer {
  position: fixed;
  top: 0;
  left: -300px;
  width: 300px;
  height: 100vh;
  background: white;
  z-index: 1001;
  transition: left 0.3s ease;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.drawer.open {
  left: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.drawer-header {
  padding: 2rem 1rem;
  background: var(--primary-blue);
  color: white;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.drawer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-menu li a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--secondary-light);
}

.drawer-menu li a:active {
  background: var(--background);
}

.drawer-icon {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  display: inline-block;
  width: 24px;
}

/* 📱 Bottom Navigation - Modern Floating Design */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  /* Changed from flex-end to center for better balance */
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

@media (max-width: 380px) {
  .nav-label {
    display: none;
  }

  .bottom-nav {
    height: calc(56px + env(safe-area-inset-bottom));
  }
}

.nav-item {
  flex: 1;
  /* Ensure equal width for all items */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9ca3af;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item.active {
  color: #2563eb;
}

.nav-item:not(.nav-item-fab):active {
  transform: scale(0.95);
}

.nav-icon {
  flex-shrink: 0;
}

.nav-label {
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

/* Floating Action Button in Nav */
.nav-item-fab {
  position: relative;
  overflow: visible;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
  color: white;
  transform: translateY(-24px);
  /* Float above the bar */
  border: 4px solid white;
  /* Add border to make it pop from the bar */
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item-fab:active .fab-button {
  transform: translateY(-20px) scale(0.9);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* Hide mobile components on desktop */
@media (min-width: 1024px) {

  .bottom-nav,
  .stats-mobile,
  .checks-list-mobile,
  .banks-list-mobile {
    display: none !important;
  }
}

/* 📱 Mobile Stats */
.stats-mobile {
  display: grid;
  gap: 1rem;
  padding-bottom: 1rem;
}

.stat-card-mobile {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.stat-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stat-icon-mobile {
  font-size: 1.5rem;
}

/* Renamed to avoid overlap if needed, or reuse stat-icon */
.stat-label-mobile {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value-mobile {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-amount {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.stat-change {
  font-size: var(--text-xs);
  margin-top: 0.5rem;
}

.stat-change.positive {
  color: var(--success-green);
}

@media (min-width: 768px) {
  .stats-mobile {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-mobile {
    display: none;
  }

  /* Hide mobile stats on desktop */
}

@media (max-width: 1023px) {
  .stats-grid {
    display: none;
  }

  /* Hide desktop stats on mobile */
}


/* 📱 Mobile Table Cards */
.checks-list-mobile {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.check-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.check-card-header {
  padding: 1rem;
  border-bottom: 1px solid var(--secondary-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: var(--font-bold);
}

.check-card-body {
  padding: 1rem;
}

.check-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
}

.info-row .label {
  color: var(--text-muted);
}

.info-row .value {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.info-row.highlight .value {
  font-weight: var(--font-bold);
  font-size: var(--text-base);
}

.check-card-footer {
  padding: 0.75rem 1rem;
  background: var(--background);
  border-top: 1px solid var(--secondary-light);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary-gray);
  padding: 0.25rem;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: var(--primary-blue);
}

.btn-icon.text-danger:hover {
  color: var(--danger-red);
}

/* Handled by consolidated media query above */

@media (max-width: 1023px) {

  .stats-container {
    display: none !important;
  }

  .table-container {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
  }

  /* Hide table on mobile/tablet */
  .main-content {
    padding: var(--space-4);
    padding-bottom: 80px;
  }

  /* Adjust padding for bottom nav */
  .top-header {
    display: none !important;
  }

  /* Hide desktop header on mobile */
  .sidebar {
    display: none !important;
  }
}

/* Reports */
.report-card {
  transition: all 0.2s;
  border: 1px solid transparent;
}

.report-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}


/* 📱 App Header (Fix 1) */
.app-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

@media (min-width: 1024px) {
  .app-header {
    display: none;
  }
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  max-width: 100%;
}

.menu-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo {
  flex: 1;
  text-align: center;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: #2563eb;
  letter-spacing: -0.025em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  color: #f59e0b;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}

/* 📄 Page Header (Fix 2) */
.page-header {
  background: white;
  padding: 0.75rem 0.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.page-header-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-title-section {
  flex: 1;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.25rem 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.page-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-import {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-import:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-create:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* Tablet and up: Horizontal layout */
@media (min-width: 640px) {
  .page-header-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .page-actions {
    flex-wrap: nowrap;
  }
}

/* 📦 Content Grid & Sections (Fix 4) */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0 0.5rem 5rem;
  /* Extra bottom padding for bottom nav */
}

.content-section {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-header {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.5;
}

.section-body {
  padding: 1rem;
}

/* Action Buttons */
.action-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 0.75rem;
}

.action-btn:last-child {
  margin-bottom: 0;
}

.action-btn.primary {
  background: #2563eb;
  color: white;
}

.action-btn.primary:hover {
  background: #1d4ed8;
}

.action-btn.secondary {
  background: white;
  border-color: #d1d5db;
  color: #374151;
}

.action-btn.secondary:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Desktop: Side by side layout */
@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr 300px;
    /* Default sidebar right */
  }

  .content-grid.layout-sidebar-left {
    grid-template-columns: 280px 1fr;
  }
}

/* 📱 Mobile Filter Panel */
@media (max-width: 767px) {
  .filter-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 1100;
    padding: 1rem;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
  }

  .filter-panel.active {
    transform: translateY(0);
  }

  .filter-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--secondary-light);
  }
}

@media (min-width: 768px) {
  .filter-close-btn {
    display: none;
  }

  .filter-header-mobile {
    display: none;
    /* Hide mobile header on desktop */
  }
}

/* 💳 Payments Section (Fix 5) */
.payments-section {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 1rem;
}

.payments-list {
  padding: 0.5rem 0;
}

.payment-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.2s;
}

.payment-item:last-child {
  border-bottom: none;
}

.payment-item:active {
  background: #f9fafb;
}

.payment-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6b7280;
}

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

.payment-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.125rem;
  line-height: 1.3;
}

.payment-date {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.3;
}

.payment-amount {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  flex-shrink: 0;
}

/* 📊 Outgoing Stats Responsive */
.stats-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.stats-divider {
  width: 1px;
  height: 40px;
  background: var(--primary-light);
}

@media (max-width: 767px) {
  .stats-overview {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0;
  }

  .stats-divider {
    display: none;
  }

  .stats-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(37, 99, 235, 0.1);
  }

  .stats-item:last-child {
    border-bottom: none;
  }

  .stats-item:first-child {
    padding-top: 0;
  }
}

@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
}

/* Layout & Grid Integration */
.content-grid {
  display: grid;
  gap: 1.5rem;
}

@media (max-width: 767px) {
  .content-grid {
    display: flex;
    flex-direction: column;
  }

  .sidebar-column {
    order: -1;
    /* Move Quick Actions & Upcoming Payments to top */
  }
}

@media (min-width: 1024px) {
  .content-grid.layout-sidebar-left {
    grid-template-columns: 280px 1fr;
  }

  /* Hide mobile filter close button on desktop */
  .filter-close-btn {
    display: none;
  }
}

/* Mobile Filter Panel */
@media (max-width: 1023px) {
  .filter-panel {
    display: none;
    /* Controlled by toggle */
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    /* Full viewport height */
    width: 300px;
    max-width: 85%;
    background-color: var(--white);
    /* Ensure background is set */
    z-index: 1060;
    /* Higher than overlay */
    padding: 1rem;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }

  .filter-panel.active {
    display: block;
    animation: slideInLeft 0.3s ease-out;
  }

  @keyframes slideInLeft {
    from {
      transform: translateX(-100%);
      opacity: 0;
    }

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

/* 7. Pagination Styles (Custom for the System) */
.pagination {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.25rem;
  justify-content: center;
}

.page-item {
  display: inline-block;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.page-item.active .page-link {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.page-link:hover:not(.disabled) {
  background: var(--primary-lighter);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  cursor: not-allowed;
  background: var(--background);
}

/* 8. Print Styles - 'Perfect Printing' */
@media print {

  /* Hide elements that shouldn't be printed */
  .sidebar,
  .app-header,
  .top-header,
  .bottom-nav,
  .drawer,
  .drawer-overlay,
  .page-actions,
  .filter-panel,
  .pagination-footer,
  .btn,
  .btn-icon,
  .alert,
  .form-actions,
  .modal-overlay,
  .no-print {
    display: none !important;
  }

  /* Adjust layout for print */
  body {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    color: black !important;
  }

  .app-container {
    display: block !important;
    min-height: auto !important;
  }

  .main-wrapper {
    display: block !important;
    overflow: visible !important;
  }

  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .content-grid {
    display: block !important;
    padding: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #eee !important;
    margin-bottom: 2rem !important;
    break-inside: avoid;
  }

  .card-header {
    background: #f8f9fa !important;
    border-bottom: 2px solid #333 !important;
  }

  .table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .table th,
  .table td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
    color: black !important;
  }

  .table thead th {
    background-color: #f2f2f2 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .badge {
    border: 1px solid #ccc !important;
    color: black !important;
    background: transparent !important;
    padding: 2px 6px !important;
  }

  /* Stats cards in print */
  .stats-container {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1rem !important;
    margin-bottom: 2rem !important;
  }

  .stat-card {
    border: 1px solid #ddd !important;
    padding: 1rem !important;
    break-inside: avoid;
  }

  .stat-icon-wrapper {
    display: none !important;
  }

  .stat-value {
    font-size: 1.25rem !important;
    color: black !important;
  }

  /* Page Header optimization for print */
  .page-header {
    margin-bottom: 2rem !important;
    border-bottom: 2px solid black !important;
    padding-bottom: 1rem !important;
  }

  .page-title {
    font-size: 2rem !important;
    margin: 0 !important;
  }

  /* Force colors in some browsers */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

.payment-icon.upcoming {
  background: var(--primary-lighter);
  color: var(--primary-blue);
}

/* Pagination Styles - Premium & Modern */
.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  border-radius: var(--radius-md);
  gap: 0.35rem;
  align-items: center;
  margin: 1.5rem 0;
}

.page-item {
  display: inline-block;
}

.page-link {
  position: relative;
  display: block;
  padding: 0.51rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  background-color: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  min-width: 40px;
  text-align: center;
}

.page-link:hover {
  z-index: 2;
  color: var(--primary-blue);
  background-color: var(--primary-lighter);
  border-color: var(--primary-blue);
}

.page-item.active .page-link {
  z-index: 3;
  color: #fff !important;
  background-color: var(--primary-blue) !important;
  border-color: var(--primary-blue) !important;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  pointer-events: none;
  background-color: var(--background);
  border-color: var(--border);
  opacity: 0.6;
}

/* For small text summary "Showing X to Y of Z" */
.pagination-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pagination-footer .text-muted,
.pagination-footer p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}

@media (max-width: 640px) {
  .pagination-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}