/* ============================================
   MODERN MINIMAL DESIGN SYSTEM
   ============================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
  /* Brand Colors */
  --brand-gold: #d4af37;
  --brand-gold-light: #e4c567;
  --brand-gold-dark: #b49a2d;
  
  /* Dark Theme for Nav */
  --nav-bg: #000000;
  --nav-text: #ffffff;
  --nav-text-muted: #b3b3b3;
  --nav-hover: rgba(212, 175, 55, 0.1);
  
  /* Neutral Colors - Modern Grays */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  
  /* Semantic Colors */
  --color-primary: var(--brand-gold);
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: var(--gray-100);
  
  /* Text Colors */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-500);
  --text-light: var(--gray-400);
  
  /* Border Colors */
  --border-light: rgba(0, 0, 0, 0.08);
  --border-default: rgba(0, 0, 0, 0.12);
  
  /* Shadows - Subtle and Modern */
  --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);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --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);
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Spacing Scale */
  --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;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Container Widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 700;
}

h2 {
  font-size: clamp(var(--text-xl), 3vw, var(--text-3xl));
  font-weight: 600;
}

h3 {
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-2xl));
  font-weight: 600;
}

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

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

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

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

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

/* ============================================
   CONTAINER - FIXED FOR DESKTOP
   ============================================ */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

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

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

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

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

@media (min-width: 1536px) {
  .container {
    max-width: var(--container-2xl);
  }
}

/* Main content container */
main.container {
  flex: 1;
  width: 100%;
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

/* ============================================
   NAVBAR - BLACK THEME WITH GOLD ACCENTS
   ============================================ */
.navbar {
  background: var(--nav-bg) !important;
  border-bottom: 2px solid var(--brand-gold) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  padding: 0 !important;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-base);
}

.navbar .container {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: var(--text-xl); /* Increased from text-lg for stronger branding */
  color: var(--nav-text) !important;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-base);
}

.navbar-brand:hover {
  opacity: 0.9;
}

.navbar-brand img {
  height: 70px; /* Increased from 45px for stronger branding */
  margin-right: var(--space-4);
  filter: brightness(1.2) contrast(1.1);
}

.navbar-brand span {
  color: var(--brand-gold) !important;
  font-weight: 600;
}

.navbar-nav {
  gap: var(--space-1);
}

.nav-link {
  color: var(--nav-text-muted) !important;
  font-weight: 500;
  font-size: 1rem; /* Increased from text-sm (0.875rem) to 1rem */
  padding: var(--space-2) var(--space-3) !important;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  position: relative;
  white-space: nowrap;
}

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

.nav-link.active {
  color: var(--brand-gold) !important;
  background-color: rgba(212, 175, 55, 0.15);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--brand-gold);
  border-radius: var(--radius-full);
}

.nav-link.text-danger {
  color: var(--color-danger) !important;
  font-weight: 500;
}

.nav-link.text-danger:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ff6b6b !important;
}

/* Navbar Toggler */
.navbar-toggler {
  border: 1px solid var(--gray-700);
  padding: var(--space-2);
  background-color: var(--gray-800);
  border-radius: var(--radius-md);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.3);
  background-color: var(--gray-700);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28212, 175, 55, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   CARDS - MODERN MINIMAL WITH NO BORDERS
   ============================================ */
.card {
  background: var(--bg-primary);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  transition: all var(--transition-base);
  overflow: hidden;
  width: 100%;
  margin-bottom: var(--space-4);
}

.card:hover {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-4) var(--space-5);
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: var(--space-5);
}

@media (min-width: 768px) {
  .card-body {
    padding: var(--space-6) var(--space-8);
  }
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

/* Desktop Form Cards - Multi-column layout */
@media (min-width: 992px) {
  .desktop-form-card .card-body {
    padding: var(--space-8);
  }
  
  .desktop-form-card .row {
    margin-bottom: var(--space-4);
  }
  
  .desktop-form-card .form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
  }
}

/* ============================================
   BUTTONS - MODERN MINIMAL
   ============================================ */
.btn {
  font-weight: 500;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Primary Button */
.btn-primary,
.btn-success,
.btn-outline-secondary {
  background: var(--brand-gold);
  color: var(--gray-900);
  border-color: var(--brand-gold);
  font-weight: 600;
}

.btn-primary:hover,
.btn-success:hover,
.btn-outline-secondary:hover {
  background: var(--brand-gold-dark);
  border-color: var(--brand-gold-dark);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Danger Button */
.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Outline Buttons */
.btn-outline-primary {
  background: transparent;
  color: var(--brand-gold);
  border-color: var(--brand-gold);
}

.btn-outline-primary:hover {
  background: var(--brand-gold);
  color: var(--gray-900);
  border-color: var(--brand-gold);
}

.btn-outline-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.btn-outline-danger:hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

/* Small Button */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

/* Large Button */
.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
}

/* Desktop Button Groups */
@media (min-width: 768px) {
  .btn-group-desktop {
    display: flex;
    gap: var(--space-2);
    justify-content: flex-end;
  }
  
  .btn-group-desktop .btn {
    min-width: 120px;
  }
}

/* ============================================
   FORMS - MODERN MINIMAL WITH DESKTOP LAYOUT
   ============================================ */
.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control,
.form-select {
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: all var(--transition-base);
  width: 100%;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
  background: var(--bg-primary);
}

.form-control::placeholder {
  color: var(--text-light);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Form Groups */
.form-group {
  margin-bottom: var(--space-4);
}

/* Desktop Form Layout */
@media (min-width: 992px) {
  .desktop-form-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    align-items: end;
  }
  
  .desktop-form-layout .form-group {
    margin-bottom: 0;
  }
  
  .desktop-form-layout .full-width {
    grid-column: 1 / -1;
  }
  
  .desktop-form-layout .half-width {
    grid-column: span 1;
  }
}

/* ============================================
   TABLES - CLEAN MODERN DESIGN
   ============================================ */
.table-responsive {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  width: 100%;
  background: var(--bg-primary);
  margin-bottom: var(--space-6);
}

.table {
  width: 100%;
  background: var(--bg-primary);
  margin-bottom: 0;
  border: none;
}

.table thead {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
}

.table thead th {
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-gold);
  padding: var(--space-4) var(--space-4);
  white-space: normal;
  line-height: 1.4;
  text-align: center;
  vertical-align: middle;
  border: none;
}

.table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.table tbody tr:hover {
  background: rgba(212, 175, 55, 0.05);
}

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

.table tbody td {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  vertical-align: middle;
  border: none;
  text-align: center;
}

.table tfoot {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--bg-primary) 100%);
  border-top: 2px solid var(--brand-gold);
}

.table tfoot td,
.table tfoot th {
  padding: var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  border: none;
  text-align: center;
}

.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(0, 0, 0, 0.02);
}

.table-bordered {
  border: none;
}

.table-dark {
  background: var(--gray-800);
  color: var(--nav-text);
}

.table-dark thead {
  background: var(--gray-900);
}

.table-dark thead th {
  color: var(--brand-gold);
}

.table-dark tbody tr {
  border-bottom: 1px solid var(--gray-700);
}

.table-dark tbody tr:hover {
  background: var(--gray-700);
}

/* Sales Table Specific Styles */
#sales-table {
  table-layout: auto;
  width: 100%;
}

#sales-table thead th {
  min-width: 60px;
  padding: var(--space-3) var(--space-2);
}

#sales-table thead th:first-child {
  min-width: 80px;
}

#sales-table tbody td {
  text-align: center;
}

#sales-table tbody td:first-child {
  font-weight: 500;
}

/* ============================================
   ALERTS - MODERN MINIMAL
   ============================================ */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: none;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.alert-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
  color: #1e40af;
}

.alert-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: #065f46;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  color: #92400e;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  color: #991b1b;
}

.alert .btn-close {
  margin-left: auto;
  opacity: 0.5;
  transition: opacity var(--transition-base);
}

.alert .btn-close:hover {
  opacity: 1;
}

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

.badge.bg-primary {
  background: var(--brand-gold);
  color: var(--gray-900);
}

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

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

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

.badge.bg-secondary {
  background: var(--gray-200);
  color: var(--text-primary);
}

/* ============================================
   MOBILE COMPONENTS - COMPACT FIXED CARDS
   ============================================ */
.mobile-cards {
  display: grid;
  gap: 10px;
  padding: 0;
  width: 100%;
}

/* Single column on phones */
@media (max-width: 575px) {
  .mobile-cards {
    grid-template-columns: 1fr;
  }
}

/* 2 columns on tablets */
@media (min-width: 576px) and (max-width: 991px) {
  .mobile-cards {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: row;
  }
  
  /* Full width for odd last card */
  .mobile-card:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

.mobile-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  display: block;
}

.mobile-card:active {
  transform: scale(0.98);
}

/* Fixed height for 2-column layout */
@media (min-width: 576px) and (max-width: 991px) {
  .mobile-card .card-body {
    height: 180px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  /* Taller for full-width cards */
  .mobile-card:last-child:nth-child(odd) .card-body {
    height: 200px;
    padding: 12px;
  }
}

/* Natural height for single column */
@media (max-width: 575px) {
  .mobile-card .card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
}

.mobile-card .card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--brand-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Hide icons in 2-column */
@media (min-width: 576px) and (max-width: 991px) {
  .mobile-card .card-title i {
    display: none;
  }
}

.mobile-card .card-details {
  flex: 1;
  overflow: hidden;
}

.mobile-card .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 0;
  font-size: 0.75rem;
  line-height: 1.3;
  min-height: 22px;
}

.mobile-card .detail-label {
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-card .detail-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  max-width: 40%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Allow text wrapping for description fields */
.mobile-card .detail-value.text-wrap {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-overflow: initial;
  max-width: 50%;
  line-height: 1.3;
}

/* Hide extra rows in 2-column */
@media (min-width: 576px) and (max-width: 991px) {
  .mobile-card .detail-row:nth-child(n+5) {
    display: none !important;
  }
  
  /* Show all for full-width card */
  .mobile-card:last-child:nth-child(odd) .detail-row {
    display: flex !important;
  }
}

/* Actions - Fixed at bottom for 2-column */
@media (min-width: 576px) and (max-width: 991px) {
  .mobile-card .card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: rgba(248, 249, 250, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 6px;
  }
  
  .mobile-card .card-actions .btn {
    flex: 1;
    font-size: 0.7rem;
    padding: 4px 6px;
    height: 24px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Show only primary button */
  .mobile-card .card-actions .btn:not(:first-child) {
    display: none;
  }
  
  /* Full-width card shows all buttons */
  .mobile-card:last-child:nth-child(odd) .card-actions .btn {
    display: block;
  }
}

/* Natural actions for single column */
@media (max-width: 575px) {
  .mobile-card .card-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 6px;
  }
  
  .mobile-card .card-actions .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 6px 8px;
    min-height: 30px;
  }
}

/* Mobile Header Styling */
.mobile-header {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.02) 100%);
  border-left: 3px solid var(--brand-gold);
}

.mobile-header h5 {
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.mobile-header p {
  margin-bottom: 0;
}

/* Summary Cards - Fixed Grid Layout */
.summary-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-6);
}

/* Override Bootstrap grid classes for summary cards */
.summary-cards .col-6,
.summary-cards .col-md-4,
.summary-cards .col-lg-3 {
  padding: 0 !important;
  display: flex;
}

/* Mobile: 2 columns */
@media (max-width: 767px) {
  .summary-cards .col-6 {
    flex: 0 0 calc(50% - 6px);
    max-width: calc(50% - 6px);
  }
  
  /* Last item full width if odd */
  .summary-cards .col-6:last-child:nth-child(odd) {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Tablet: 3 columns */
@media (min-width: 768px) and (max-width: 991px) {
  .summary-cards .col-md-4 {
    flex: 0 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
  }
}

/* Desktop: 4 columns */
@media (min-width: 992px) {
  .summary-cards .col-lg-3 {
    flex: 0 0 calc(25% - 9px);
    max-width: calc(25% - 9px);
  }
}

.summary-cards .summary-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  width: 100%;
  height: auto !important; /* Override h-100 */
}

/* Remove h-100 effect */
.summary-cards .summary-card.h-100 {
  height: auto !important;
}

.summary-cards .summary-card .card-body {
  padding: 12px !important;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Compact layout for mobile */
@media (max-width: 767px) {
  .summary-cards .summary-card .card-body {
    padding: 10px !important;
  }
  
  .summary-cards .summary-card i {
    font-size: 1.5rem !important;
    margin-bottom: 4px !important;
  }
  
  .summary-cards .summary-card h6 {
    font-size: 0.65rem !important;
    margin-bottom: 2px !important;
  }
  
  .summary-cards .summary-card h4 {
    font-size: 0.9rem !important;
  }
}

/* Normal sizing for tablets and desktop */
@media (min-width: 768px) {
  .summary-cards .summary-card .card-body {
    padding: 16px !important;
  }
  
  .summary-cards .summary-card i {
    font-size: 1.75rem !important;
    margin-bottom: 6px !important;
  }
  
  .summary-cards .summary-card h6 {
    font-size: 0.7rem !important;
    margin-bottom: 4px !important;
  }
  
  .summary-cards .summary-card h4 {
    font-size: 1.1rem !important;
  }
}

.summary-cards .summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gold);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.summary-cards .summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.summary-cards .summary-card:hover::before {
  opacity: 1;
}

.summary-cards .summary-card i {
  display: block;
  margin: 0 auto;
}

.summary-cards .summary-card h6 {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.summary-cards .summary-card h4 {
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Collapsible Components */
.collapsible-form-container .card,
.collapsible-filter-container .card {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.collapsible-form-container .card-header,
.collapsible-filter-container .card-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--bg-primary) 100%);
  border-bottom: 2px solid var(--brand-gold);
  padding: var(--space-4);
  cursor: pointer;
  transition: background var(--transition-base);
  user-select: none;
}

.collapsible-form-container .card-header:hover,
.collapsible-filter-container .card-header:hover {
  background: var(--gray-100) !important;
}

.collapsible-form-container .collapse-icon,
.collapsible-filter-container .collapse-icon {
  color: var(--brand-gold);
  transition: transform var(--transition-base);
}

.collapsible-form-container .card-header[aria-expanded="true"] .collapse-icon,
.collapsible-filter-container .card-header[aria-expanded="true"] .collapse-icon {
  transform: rotate(180deg);
}

/* Desktop Form Enhancements */
@media (min-width: 992px) {
  .collapsible-form-container .card-body {
    padding: var(--space-6);
  }
  
  .collapsible-form-container form .row {
    align-items: end;
  }
  
  .collapsible-form-container form .col-md-3,
  .collapsible-form-container form .col-md-4,
  .collapsible-form-container form .col-md-6 {
    margin-bottom: var(--space-4);
  }
}

/* ============================================
   FOOTER - MODERN MINIMAL
   ============================================ */
footer {
  background: var(--nav-bg);
  border-top: 2px solid var(--brand-gold);
  padding: var(--space-6) 0;
  margin-top: auto;
  color: var(--nav-text-muted);
  font-size: var(--text-sm);
}

footer small {
  color: var(--nav-text-muted);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-info { color: var(--color-info) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-light { background-color: var(--gray-50) !important; }
.bg-white { background-color: var(--bg-primary) !important; }

.border-success { border-color: var(--color-success) !important; }
.border-danger { border-color: var(--color-danger) !important; }
.border-warning { border-color: var(--color-warning) !important; }
.border-info { border-color: var(--color-info) !important; }
.border-primary { border-color: var(--brand-gold) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

/* Desktop Professional Layouts */
@media (min-width: 992px) {
  .desktop-section {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  }
  
  .desktop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
  }
  
  .desktop-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-6);
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 991.98px) {
  :root {
    --text-base: 0.9375rem;
  }
  
  .navbar-brand span {
    font-size: 0.9rem;
    display: inline-block !important; /* Show text on tablets and larger phones */
  }
  
  .navbar-brand img {
    height: 55px; /* Proportionally sized for tablets */
  }
  
  .card-body {
    padding: var(--space-4);
  }
  
  .btn {
    padding: var(--space-2) var(--space-3);
  }
  
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  h4 { font-size: var(--text-lg); }
  
  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }
  
  /* Keep summary tables visible on mobile */
  .summary-table-container .table-responsive {
    display: block !important;
  }
  
  /* Hide desktop data tables on mobile */
  .desktop-table-container {
    display: none !important;
  }
  
  /* Mobile-only display utilities */
  .d-lg-none {
    display: block !important;
  }
  
  .d-none.d-lg-block {
    display: none !important;
  }
  
  .d-none.d-lg-table {
    display: none !important;
  }
}

@media (min-width: 992px) {
  /* Desktop-only display utilities */
  .d-lg-none {
    display: none !important;
  }
  
  .d-none.d-lg-block {
    display: block !important;
  }
  
  .d-none.d-lg-table {
    display: table !important;
  }
  
  /* Hide mobile components on desktop */
  .mobile-cards {
    display: none !important;
  }
  
  .swipeable-list {
    display: none !important;
  }
}

@media (max-width: 575.98px) {
  :root {
    --text-base: 0.875rem;
  }
  
  .navbar-brand img {
    height: 50px; /* Strong branding on mobile */
    margin-right: 10px;
  }
  
  .navbar-brand span {
    display: inline-block !important; /* Show text on mobile */
    font-size: 0.8rem; /* Readable font for mobile */
    line-height: 1.2;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .btn-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .form-control,
  .form-select {
    min-height: 44px;
  }
  
  .nav-link {
    padding: var(--space-3) var(--space-4) !important;
    font-size: 1.1rem; /* Larger font for mobile touch devices */
  }
}

/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: var(--radius-full);
  border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Dark scrollbar for navbar */
.navbar::-webkit-scrollbar-track {
  background: var(--gray-800);
}

.navbar::-webkit-scrollbar-thumb {
  background: var(--gray-600);
  border-color: var(--gray-800);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

/* ============================================
   LOADING STATES
   ============================================ */
.spinner-border {
  width: 1.5rem;
  height: 1.5rem;
  border-width: 0.2rem;
  border-color: var(--brand-gold);
  border-right-color: transparent;
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* ============================================
   CHARTS CONTAINER FIX
   ============================================ */
.chart-container {
  position: relative;
  height: 400px;
  width: 100%;
  margin: var(--space-4) 0;
}

@media (min-width: 768px) {
  .chart-container {
    height: 350px;
  }
}

canvas {
  max-width: 100% !important;
  height: auto !important;
}