/* ==========================================================================
   PAPA Admin Panel - Responsive CSS Framework
   Inspired by Projet Résurgence Theme System
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties (Variables) - Projet Résurgence Theme
   ========================================================================== */
:root {
  /* === BRAND COLORS === */
  --primary-gold: #D5B654;
  --primary-gold-dark: #B89A3D;
  --primary-gold-light: #E6C76A;

  /* === DARK THEME (DEFAULT) === */
  /* Background colors - darkest to lightest */
  --bg-primary: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-tertiary: #2d2d2d;
  --bg-quaternary: #404040;

  /* Backdrop overlays for scrolled header */
  --bg-backdrop-dark: rgba(26, 26, 26, 0.95);
  --bg-backdrop-light: rgba(255, 255, 255, 0.95);

  /* Text colors - lightest to darkest */
  --text-primary: #f8f9fa;
  --text-secondary: #e0e0e0;
  --text-muted: #a0a0a0;

  /* === ACCENT COLORS === */
  --accent-danger: #dc2626;
  --accent-success: #16a34a;
  --accent-warning: #d97706;
  --accent-info: #2563eb;
  --accent-info-dark: #1e40af;

  /* === LIGHT THEME VARIABLES (for override) === */
  --bg-primary-light: #f7f8f9;
  --bg-secondary-light: #ffffff;
  --bg-tertiary-light: #e9ecef;
  --bg-quaternary-light: #f1f3f4;
  --text-primary-light: #1a202c;
  --text-secondary-light: #4a5568;
  --text-muted-light: #718096;

  /* Legacy variables for backward compatibility */
  --primary-color: var(--primary-gold);
  --secondary-color: var(--primary-gold-dark);
  --success-color: var(--accent-success);
  --warning-color: var(--accent-warning);
  --danger-color: var(--accent-danger);
  --info-color: var(--accent-info);
  --dark-color: var(--text-primary);
  --light-color: var(--bg-primary);
  
  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-title: var(--font-family-base);
  --font-size-base: 1rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-xxl: 1.5rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2rem;
  --line-height-base: 1.5;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  
  /* Borders */
  --border-radius-sm: 0.25rem;
  --border-radius-md: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 0.75rem;
  --border-radius-xxl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --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);
  
  /* Transitions */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.15s ease;
  --transition-normal: all 0.2s ease;
  --transition-slow: all 0.5s ease;
  
  /* Breakpoints */
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --breakpoint-xxl: 1400px;
  
  /* Layout */
  --sidebar-width-desktop: 280px;
  --sidebar-width-tablet: 250px;
  --header-height: 60px;
  --footer-height: 50px;

  /* Gradients */
  --primary-gradient: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-gold-dark) 100%);
  --bg-gradient: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  --success-gradient: linear-gradient(135deg, var(--accent-success) 0%, #22c55e 100%);
  --warning-gradient: linear-gradient(135deg, var(--accent-warning) 0%, #f59e0b 100%);
  --danger-gradient: linear-gradient(135deg, var(--accent-danger) 0%, #ef4444 100%);
  --info-gradient: linear-gradient(135deg, var(--accent-info) 0%, var(--accent-info-dark) 100%);
}

/* === LIGHT THEME OVERRIDE === */
[data-theme="light"] {
  --bg-primary: var(--bg-primary-light);
  --bg-secondary: var(--bg-secondary-light);
  --bg-tertiary: var(--bg-tertiary-light);
  --bg-quaternary: var(--bg-quaternary-light);
  --text-primary: var(--text-primary-light);
  --text-secondary: var(--text-secondary-light);
  --text-muted: var(--text-muted-light);
  --dark-color: var(--text-primary-light);
  --light-color: var(--bg-primary-light);
  
/* Light theme specific shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  height: 100%;
  overflow-x: hidden;
}

/* === THEME SWITCHER === */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.theme-switcher:hover {
  background: var(--bg-quaternary);
  border-color: var(--primary-gold-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.theme-switcher .theme-label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: var(--spacing-xs);
}

.theme-toggle {
  position: relative;
  width: 58px;
  height: 32px;
  background: var(--bg-quaternary);
  border-radius: 32px;
  border: 2px solid var(--primary-gold-light);
  cursor: pointer;
  transition: var(--transition-base);
  outline: none;
  overflow: hidden;
}

.theme-toggle:focus {
  box-shadow: 0 0 0 3px rgba(213, 182, 84, 0.2);
}

.theme-toggle:hover {
  border-color: var(--primary-gold);
  transform: scale(1.05);
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: var(--primary-gradient);
  border-radius: 50%;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

[data-theme="light"] .theme-toggle::before {
  transform: translateX(26px);
}

.theme-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  transition: var(--transition-base);
  z-index: 1;
}

.theme-icon.sun-icon {
  left: 8px;
  opacity: 1;
}

.theme-icon.moon-icon {
  right: 8px;
  opacity: 0.4;
}

[data-theme="light"] .theme-icon.sun-icon {
  opacity: 0.4;
}

[data-theme="light"] .theme-icon.moon-icon {
  opacity: 1;
}

/* Add subtle animation to theme transition */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* === UTILITY CLASSES === */
/* Display utilities */
.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Responsive display utilities */
@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
  .d-sm-inline-flex { display: inline-flex !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-inline-flex { display: inline-flex !important; }
  .d-md-table-cell { display: table-cell !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
  .d-lg-inline-flex { display: inline-flex !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-inline { display: inline !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex { display: flex !important; }
  .d-xl-inline-flex { display: inline-flex !important; }
}

/* Flexbox utilities */
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-baseline { align-items: baseline !important; }
.align-items-stretch { align-items: stretch !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

/* Gap utilities */
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }

/* Margin utilities */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }

/* Padding utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Text utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.text-primary { color: var(--primary-gold) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-info { color: var(--accent-info) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-success { color: var(--accent-success) !important; }
.text-danger { color: var(--accent-danger) !important; }

/* Button group */
.btn-group {
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
}

.btn-group > .btn:not(:first-child) {
  margin-left: -1px;
}

.btn-group > .btn:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.btn-group > .btn:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.btn-group-sm > .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

/* === UTILITY CLASSES === */
/* Display utilities */
.d-none { display: none !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flex utilities */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

/* Gap utilities */
.gap-1 { gap: var(--spacing-xs) !important; }
.gap-2 { gap: var(--spacing-sm) !important; }
.gap-3 { gap: var(--spacing-md) !important; }
.gap-4 { gap: var(--spacing-lg) !important; }
.gap-5 { gap: var(--spacing-xl) !important; }

/* Text utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }

.text-primary { color: var(--primary-gold) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success { color: var(--accent-success) !important; }
.text-danger { color: var(--accent-danger) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-info { color: var(--accent-info) !important; }
.text-light { color: var(--text-primary) !important; }
.text-dark { color: var(--text-primary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Margin utilities */
.m-0 { margin: 0 !important; }
.m-1 { margin: var(--spacing-xs) !important; }
.m-2 { margin: var(--spacing-sm) !important; }
.m-3 { margin: var(--spacing-md) !important; }
.m-4 { margin: var(--spacing-lg) !important; }
.m-5 { margin: var(--spacing-xl) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-5 { margin-top: var(--spacing-xl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }
.mb-5 { margin-bottom: var(--spacing-xl) !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: var(--spacing-xs) !important; }
.ms-2 { margin-left: var(--spacing-sm) !important; }
.ms-3 { margin-left: var(--spacing-md) !important; }
.ms-4 { margin-left: var(--spacing-lg) !important; }
.ms-5 { margin-left: var(--spacing-xl) !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: var(--spacing-xs) !important; }
.me-2 { margin-right: var(--spacing-sm) !important; }
.me-3 { margin-right: var(--spacing-md) !important; }
.me-4 { margin-right: var(--spacing-lg) !important; }
.me-5 { margin-right: var(--spacing-xl) !important; }

/* Padding utilities */
.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-1 { padding-top: var(--spacing-xs) !important; }
.pt-2 { padding-top: var(--spacing-sm) !important; }
.pt-3 { padding-top: var(--spacing-md) !important; }
.pt-4 { padding-top: var(--spacing-lg) !important; }
.pt-5 { padding-top: var(--spacing-xl) !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-1 { padding-bottom: var(--spacing-xs) !important; }
.pb-2 { padding-bottom: var(--spacing-sm) !important; }
.pb-3 { padding-bottom: var(--spacing-md) !important; }
.pb-4 { padding-bottom: var(--spacing-lg) !important; }
.pb-5 { padding-bottom: var(--spacing-xl) !important; }

.ps-0 { padding-left: 0 !important; }
.ps-1 { padding-left: var(--spacing-xs) !important; }
.ps-2 { padding-left: var(--spacing-sm) !important; }
.ps-3 { padding-left: var(--spacing-md) !important; }
.ps-4 { padding-left: var(--spacing-lg) !important; }
.ps-5 { padding-left: var(--spacing-xl) !important; }

.pe-0 { padding-right: 0 !important; }
.pe-1 { padding-right: var(--spacing-xs) !important; }
.pe-2 { padding-right: var(--spacing-sm) !important; }
.pe-3 { padding-right: var(--spacing-md) !important; }
.pe-4 { padding-right: var(--spacing-lg) !important; }
.pe-5 { padding-right: var(--spacing-xl) !important; }

/* Width utilities */
.w-25 { width: 25% !important; }
.w-50 { width: 50% !important; }
.w-75 { width: 75% !important; }
.w-100 { width: 100% !important; }

/* Height utilities */
.h-25 { height: 25% !important; }
.h-50 { height: 50% !important; }
.h-75 { height: 75% !important; }
.h-100 { height: 100% !important; }

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--spacing-md) * -0.5);
  margin-right: calc(var(--spacing-md) * -0.5);
}

.row > * {
  padding-left: calc(var(--spacing-md) * 0.5);
  padding-right: calc(var(--spacing-md) * 0.5);
}

.col, .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
  flex: 0 0 auto;
}

.col { flex: 1 0 0%; }
.col-1 { flex: 0 0 auto; width: 8.33333333%; }
.col-2 { flex: 0 0 auto; width: 16.66666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.33333333%; }
.col-5 { flex: 0 0 auto; width: 41.66666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.33333333%; }
.col-8 { flex: 0 0 auto; width: 66.66666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.33333333%; }
.col-11 { flex: 0 0 auto; width: 91.66666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

/* Responsive grid */
@media (min-width: 576px) {
  .col-sm, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
  .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12 {
    flex: 0 0 auto;
  }
  .col-sm { flex: 1 0 0%; }
  .col-sm-1 { width: 8.33333333%; }
  .col-sm-2 { width: 16.66666667%; }
  .col-sm-3 { width: 25%; }
  .col-sm-4 { width: 33.33333333%; }
  .col-sm-5 { width: 41.66666667%; }
  .col-sm-6 { width: 50%; }
  .col-sm-7 { width: 58.33333333%; }
  .col-sm-8 { width: 66.66666667%; }
  .col-sm-9 { width: 75%; }
  .col-sm-10 { width: 83.33333333%; }
  .col-sm-11 { width: 91.66666667%; }
  .col-sm-12 { width: 100%; }
}

@media (min-width: 768px) {
  .col-md, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
  .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    flex: 0 0 auto;
  }
  .col-md { flex: 1 0 0%; }
  .col-md-1 { width: 8.33333333%; }
  .col-md-2 { width: 16.66666667%; }
  .col-md-3 { width: 25%; }
  .col-md-4 { width: 33.33333333%; }
  .col-md-5 { width: 41.66666667%; }
  .col-md-6 { width: 50%; }
  .col-md-7 { width: 58.33333333%; }
  .col-md-8 { width: 66.66666667%; }
  .col-md-9 { width: 75%; }
  .col-md-10 { width: 83.33333333%; }
  .col-md-11 { width: 91.66666667%; }
  .col-md-12 { width: 100%; }
}

@media (min-width: 992px) {
  .col-lg, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
  .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12 {
    flex: 0 0 auto;
  }
  .col-lg { flex: 1 0 0%; }
  .col-lg-1 { width: 8.33333333%; }
  .col-lg-2 { width: 16.66666667%; }
  .col-lg-3 { width: 25%; }
  .col-lg-4 { width: 33.33333333%; }
  .col-lg-5 { width: 41.66666667%; }
  .col-lg-6 { width: 50%; }
  .col-lg-7 { width: 58.33333333%; }
  .col-lg-8 { width: 66.66666667%; }
  .col-lg-9 { width: 75%; }
  .col-lg-10 { width: 83.33333333%; }
  .col-lg-11 { width: 91.66666667%; }
  .col-lg-12 { width: 100%; }
}

@media (min-width: 1200px) {
  .col-xl, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6,
  .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 {
    flex: 0 0 auto;
  }
  .col-xl { flex: 1 0 0%; }
  .col-xl-1 { width: 8.33333333%; }
  .col-xl-2 { width: 16.66666667%; }
  .col-xl-3 { width: 25%; }
  .col-xl-4 { width: 33.33333333%; }
  .col-xl-5 { width: 41.66666667%; }
  .col-xl-6 { width: 50%; }
  .col-xl-7 { width: 58.33333333%; }
  .col-xl-8 { width: 66.66666667%; }
  .col-xl-9 { width: 75%; }
  .col-xl-10 { width: 83.33333333%; }
  .col-xl-11 { width: 91.66666667%; }
  .col-xl-12 { width: 100%; }
}

/* Responsive display utilities */
@media (max-width: 575.98px) {
  .d-sm-none { display: none !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
}

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-block { display: inline-block !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-block { display: inline-block !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
}

@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-block { display: inline-block !important; }
  .d-lg-block { display: block !important; }
  .d-lg-flex { display: flex !important; }
}

@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-inline { display: inline !important; }
  .d-xl-inline-block { display: inline-block !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex { display: flex !important; }
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--dark-color);
  background-color: var(--light-color);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

/* Main Container */
.admin-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width-desktop);
  background: var(--bg-secondary);
  color: var(--text-primary);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  transform: translateX(0);
  transition: var(--transition-base);
  z-index: 1000;
  border-right: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

/* Desktop: Always visible */
@media (min-width: 992px) {
  .admin-sidebar {
    transform: translateX(0) !important;
    visibility: visible !important;
    display: block !important;
  }
  
  .admin-sidebar.collapsed {
    transform: translateX(0) !important;
  }
}

/* Mobile/Tablet: Collapsible */
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.show {
    transform: translateX(0);
  }
  
  .admin-sidebar.collapsed {
    transform: translateX(-100%);
  }
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--spacing-lg) var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
  background: var(--bg-tertiary);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  color: var(--primary-gold);
  text-decoration: none;
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  transition: var(--transition-base);
}

.sidebar-brand:hover {
  color: var(--primary-gold-light);
  text-decoration: none;
  transform: translateY(-1px);
}

.sidebar-brand i {
  font-size: 1.5rem;
  color: var(--primary-gold);
}

.sidebar-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  transition: var(--transition-base);
}

.sidebar-brand:hover .sidebar-logo {
  transform: scale(1.2);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  padding: var(--spacing-sm);
  background: var(--bg-quaternary);
  border-radius: var(--border-radius-md);
  margin: 0 var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
}

.sidebar-user-info i {
  font-size: 1.2rem;
  color: var(--primary-gold);
}

.sidebar-nav {
  padding: var(--spacing-md);
}

.nav-section {
  margin-bottom: var(--spacing-lg);
}

.nav-section-title {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-sm);
  padding: 0 var(--spacing-sm);
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  transition: var(--transition-base);
  margin-bottom: var(--spacing-xs);
  font-size: var(--font-size-sm);
  border: 1px solid transparent;
}

.nav-link:hover {
  background: var(--bg-quaternary);
  color: var(--primary-gold);
  transform: translateX(4px);
  border-color: var(--primary-gold-light);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary-gradient);
  color: white;
  font-weight: 600;
  border-color: var(--primary-gold);
  box-shadow: var(--shadow-sm);
}

.nav-link i {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

/* Main Content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: var(--transition-base);
}

/* Desktop: Always with sidebar margin */
@media (min-width: 992px) {
  .admin-main {
    margin-left: var(--sidebar-width-desktop);
  }
}

/* Mobile/Tablet: Full width by default, expanded when sidebar open */
@media (max-width: 991.98px) {
  .admin-main {
    margin-left: 0;
  }
  
  .admin-main.expanded {
    margin-left: 0; /* Keep full width on mobile even when sidebar is open */
  }
}

/* Mobile Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
  z-index: 999;
  display: none; /* Hidden by default */
}

/* Only show overlay on mobile/tablet */
@media (max-width: 991.98px) {
  .sidebar-overlay {
    display: block;
  }
  
  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  min-height: var(--header-height);
  box-shadow: var(--shadow-sm);
}

.header-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-gold);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-md);
  transition: var(--transition-fast);
  display: none; /* Hidden by default */
  border: 1px solid transparent;
}

.header-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--primary-gold-light);
  border-color: var(--primary-gold-light);
  transform: scale(1.05);
}

/* Show toggle only on mobile/tablet */
@media (max-width: 991.98px) {
  .header-toggle {
    display: block;
  }
}

.header-toggle:hover {
  background-color: var(--light-color);
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  font-size: var(--font-size-sm);
}

.header-actions .text-muted {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Content Area */
.admin-content {
  flex: 1;
  padding: var(--spacing-xl);
  background: var(--bg-primary);
}

/* ==========================================================================
   Card Components
   ========================================================================== */
.content-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: var(--transition-base);
}

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

.card {
	background-color: var(--bg-secondary);
}

.card-header {
  background: var(--primary-gradient);
  color: white;
  padding: var(--spacing-lg);
  border: none;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gold-light);
}

.card-body {
  padding: var(--spacing-xl);
  color: var(--text-primary);
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
  border: 1px solid var(--border-color);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-gold);
}

.stat-number {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-gold);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* ==========================================================================
   Table Components
   ========================================================================== */
.table-responsive {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  overflow-y: visible;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  display: block; /* Ensure block display for proper scrolling */
}

.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-secondary);
  width: 100%;
  min-width: 100%; /* Full width on all screens */
  table-layout: auto; /* Allow table to adapt to content */
}

/* On larger screens, enforce minimum width for better readability */
@media (min-width: 992px) {
  .table {
    min-width: 800px;
  }
}

/* Scrollbar styling for table-responsive */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-sm);
}

.table-responsive::-webkit-scrollbar-thumb {
  background: var(--primary-gold);
  border-radius: var(--border-radius-sm);
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold-hover);
}

/* Fade effect to indicate scrollability */
.table-responsive::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to left, var(--bg-secondary), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.table-responsive:not(.scrolled-end)::after {
  opacity: 1;
}

.table thead th {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: var(--spacing-lg);
  font-weight: 600;
  text-transform: uppercase;
  font-size: var(--font-size-sm);
  letter-spacing: 0.5px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody td {
  padding: var(--spacing-lg);
  vertical-align: middle;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  white-space: nowrap;
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--bg-tertiary);
}

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

/* Ensure text remains visible in all table states */
.table tbody tr td,
.table tbody tr:hover td,
.table tbody tr td * {
  color: var(--text-primary) !important;
}

.table tbody tr td a {
  color: var(--primary-gold) !important;
}

.table tbody tr td a:hover {
  color: var(--primary-gold-hover) !important;
}

/* Table content styling */
.table td strong {
  color: var(--primary-gold);
  font-weight: 600;
}

.table td code {
  background: var(--bg-quaternary);
  color: var(--text-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  border: 1px solid var(--border-color);
  font-family: 'Consolas', 'Monaco', 'Lucida Console', monospace;
}

.table .text-info code {
  color: var(--accent-info);
  border-color: var(--accent-info);
}

.table .text-warning code {
  color: var(--accent-warning);
  border-color: var(--accent-warning);
}

.table .text-muted code {
  color: var(--text-muted);
  border-color: var(--text-muted);
}

/* Badge styling in tables */
.table .badge {
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.badge-primary {
  background: var(--primary-gradient);
  color: white;
  border: 1px solid var(--primary-gold);
}

/* ==========================================================================
   Form Components
   ========================================================================== */
.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-label {
  font-weight: 600;
  color: var(--dark-color);
  margin-bottom: var(--spacing-sm);
  display: block;
  font-size: var(--font-size-sm);
}

.form-control {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-base);
  transition: var(--transition-base);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-control:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 0 3px rgba(213, 182, 84, 0.15);
  outline: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.form-control:invalid {
  border-color: var(--accent-danger);
  background: var(--bg-secondary);
}

.form-select {
  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 var(--spacing-md) center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  padding-right: calc(var(--spacing-md) * 3);
}

/* ==========================================================================
   Button Components
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border: none;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition-base);
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-secondary {
  background: var(--secondary-gradient);
  color: white;
}

.btn-success {
  background: var(--success-gradient);
  color: white;
}

.btn-warning {
  background: var(--warning-gradient);
  color: var(--dark-color);
}

.btn-danger {
  background: var(--danger-gradient);
  color: white;
}

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

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

.btn-sm {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--spacing-lg) var(--spacing-xl);
  font-size: var(--font-size-lg);
}

/* ==========================================================================
   Alert Components
   ========================================================================== */
.alert {
  padding: var(--spacing-lg);
  border-radius: var(--border-radius-lg);
  border: none;
  margin-bottom: var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

.alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.alert-success {
  background: rgba(40, 167, 69, 0.1);
  color: var(--success-color);
}

.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
}

.alert-danger {
  background: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
}

.alert-info {
  background: rgba(23, 162, 184, 0.1);
  color: var(--info-color);
}

/* ==========================================================================
   Badge Components
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--border-radius-xl);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

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

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

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

/* Spacing */
.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

.m-0 { margin: 0 !important; }
.m-1 { margin: var(--spacing-xs) !important; }
.m-2 { margin: var(--spacing-sm) !important; }
.m-3 { margin: var(--spacing-md) !important; }
.m-4 { margin: var(--spacing-lg) !important; }
.m-5 { margin: var(--spacing-xl) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }
.mb-5 { margin-bottom: var(--spacing-xl) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-5 { margin-top: var(--spacing-xl) !important; }

/* Text */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-info { color: var(--info-color) !important; }
.text-dark { color: var(--dark-color) !important; }
.text-light { color: var(--light-color) !important; }
.text-white { color: white !important; }

.font-weight-light { font-weight: 300 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-bold { font-weight: 700 !important; }

/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

/* Flexbox */
.justify-content-start { justify-content: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }

.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }

/* Borders */
.border { border: 1px solid #dee2e6 !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid #dee2e6 !important; }
.border-bottom { border-bottom: 1px solid #dee2e6 !important; }
.border-left { border-left: 1px solid #dee2e6 !important; }
.border-right { border-right: 1px solid #dee2e6 !important; }

.rounded { border-radius: var(--border-radius-md) !important; }
.rounded-sm { border-radius: var(--border-radius-sm) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.rounded-xl { border-radius: var(--border-radius-xl) !important; }

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

/* ==========================================================================
   Grid System
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.container-fluid {
  width: 100%;
  padding: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 calc(-1 * var(--spacing-md) / 2);
}

.col,
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
  padding: 0 calc(var(--spacing-md) / 2);
}

.col-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
.col-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
.col-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
.col-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

.col {
  flex: 1 0 0%;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Large screens (desktops) */
@media (min-width: 992px) {
  .col-lg-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-lg-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-lg-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Medium screens (tablets) */
@media (max-width: 991.98px) {
  :root {
    --sidebar-width-desktop: var(--sidebar-width-tablet);
  }
  
  .admin-sidebar {
    width: var(--sidebar-width-tablet);
  }
  
  .admin-main {
    margin-left: var(--sidebar-width-tablet);
  }
  
  .admin-content {
    padding: var(--spacing-lg);
  }
  
  .col-md-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-md-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-md-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

/* Small screens (mobile) */
@media (max-width: 767.98px) {
  .header-toggle {
    display: block;
  }
  
  .admin-sidebar {
    transform: translateX(-100%);
  }
  
  .admin-sidebar.show {
    transform: translateX(0);
  }
  
  .admin-main {
    margin-left: 0;
  }
  
  .admin-content {
    padding: var(--spacing-md);
  }
  
  .sidebar-header {
    padding: var(--spacing-md);
  }
  
  .sidebar-nav {
    padding: var(--spacing-sm);
  }
  
  .nav-link {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
  }
  
  .card-body {
    padding: var(--spacing-lg);
  }
  
  .btn {
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
  }
  
  .table-responsive {
    border-radius: var(--border-radius-md);
  }
  
  .table thead th,
  .table tbody td {
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
  }
  
  .col-sm-1 { flex: 0 0 8.333333%; max-width: 8.333333%; }
  .col-sm-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
  .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
  .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
  .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
  .col-sm-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
  .col-sm-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
  .col-sm-9 { flex: 0 0 75%; max-width: 75%; }
  .col-sm-10 { flex: 0 0 83.333333%; max-width: 83.333333%; }
  .col-sm-11 { flex: 0 0 91.666667%; max-width: 91.666667%; }
  .col-sm-12 { flex: 0 0 100%; max-width: 100%; }
  
  /* Mobile specific utilities */
  .d-sm-none { display: none !important; }
  .d-sm-block { display: block !important; }
  .d-sm-flex { display: flex !important; }
  
  .text-sm-center { text-align: center !important; }
  .text-sm-left { text-align: left !important; }
  .text-sm-right { text-align: right !important; }
}

/* Extra small screens */
@media (max-width: 575.98px) {
  :root {
    --font-size-base: 0.9rem;
    --spacing-xl: 1.5rem;
    --spacing-lg: 1rem;
  }
  
  .admin-content {
    padding: var(--spacing-sm);
  }
  
  .content-card {
    border-radius: var(--border-radius-lg);
  }
  
  .card-body {
    padding: var(--spacing-md);
  }
  
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
  }
  
  /* More compact table on mobile */
  .table {
    font-size: 0.75rem;
    min-width: 100% !important; /* Remove minimum width on mobile */
  }
  
  .table thead th,
  .table tbody td {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    white-space: nowrap; /* Prevent text wrapping in cells */
  }
  
  /* Hide less important columns on mobile - add classes to templates */
  .table .hide-mobile {
    display: none;
  }
  
  /* Ensure table is scrollable */
  .table-responsive {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--spacing-md);
  }
  
  .form-control {
    padding: var(--spacing-sm);
  }
  
  .nav-link {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.85rem;
  }
  
  .sidebar-brand {
    font-size: var(--font-size-base);
  }
  
  .stat-card {
    padding: var(--spacing-md);
  }
  
  .stat-number {
    font-size: var(--font-size-xl);
  }
}

/* ==========================================================================
   Mobile Table Styles
   ========================================================================== */

/* Mobile table transformation */
@media (max-width: 767.98px) {
  .table-mobile {
    border: 0;
  }

  .table-mobile thead {
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }

  .table-mobile tbody tr {
    border: 1px solid var(--border-color, #e9ecef);
    border-radius: var(--border-radius-md);
    display: block;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    background: white;
  }

  .table-mobile tbody td {
    border: none;
    border-bottom: 1px solid #eee;
    display: block;
    font-size: var(--font-size-sm);
    text-align: right;
    padding: var(--spacing-sm) var(--spacing-md);
    position: relative;
    padding-left: 50% !important;
  }

  .table-mobile tbody td:last-child {
    border-bottom: 0;
  }

  .table-mobile tbody td:before {
    content: attr(data-label);
    font-weight: 600;
    left: var(--spacing-md);
    position: absolute;
    text-align: left;
    top: 50%;
    transform: translateY(-50%);
    width: 45%;
    white-space: nowrap;
  }

  .table-mobile tbody td .btn-group {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: flex-end;
  }

  .table-mobile tbody td .btn {
    font-size: 0.75rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}

/* ==========================================================================
   Action Button Groups for Mobile
   ========================================================================== */
@media (max-width: 767.98px) {
  .btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .btn-group-sm .btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
  }

  .d-flex.justify-content-between {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .d-flex.justify-content-between > * {
    width: 100%;
  }
}

/* ==========================================================================
   Form Responsive Enhancements
   ========================================================================== */
@media (max-width: 767.98px) {
  .form-row {
    flex-direction: column;
  }

  .form-group {
    margin-bottom: var(--spacing-md);
  }

  .btn-group {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .btn-group .btn {
    width: 100%;
    margin: 0;
  }

  .input-group {
    flex-direction: column;
  }

  .input-group .form-control,
  .input-group .btn {
    border-radius: var(--border-radius-md) !important;
    margin-bottom: var(--spacing-sm);
  }

  .input-group .btn {
    margin-bottom: 0;
  }
}

/* ==========================================================================
   Card Responsive Behavior
   ========================================================================== */
@media (max-width: 575.98px) {
  .row > [class*="col-"] {
    margin-bottom: var(--spacing-md);
  }

  .card-columns {
    column-count: 1;
  }

  .card-deck {
    flex-direction: column;
  }

  .card-deck .card {
    margin-bottom: var(--spacing-md);
  }
}

/* ==========================================================================
   Navigation Improvements for Touch
   ========================================================================== */
@media (max-width: 991.98px) {
  .nav-link {
    min-height: 44px; /* Touch target size */
    display: flex;
    align-items: center;
    touch-action: manipulation;
  }

  .nav-link i {
    margin-right: var(--spacing-sm);
    min-width: 20px;
  }
}

/* ==========================================================================
   Header Actions Mobile
   ========================================================================== */
@media (max-width: 767.98px) {
  .header-actions {
    display: none; /* Hide on mobile to save space */
  }

  .admin-header {
    padding: 0 var(--spacing-md);
  }

  .page-title {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
  }

  .page-subtitle {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
  }
}

/* ==========================================================================
   File Upload Mobile Styles
   ========================================================================== */
.file-upload-wrapper {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: var(--spacing-md);
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  border: 2px dashed #ccc;
  border-radius: var(--border-radius-lg);
  background: var(--light-color);
  cursor: pointer;
  transition: var(--transition-base);
  text-align: center;
  min-height: 120px;
}

.file-upload-label:hover,
.file-upload-wrapper.drag-over .file-upload-label {
  border-color: var(--primary-color);
  background: rgba(102, 126, 234, 0.05);
}

.file-upload-wrapper.has-file .file-upload-label {
  border-color: var(--success-color);
  background: rgba(40, 167, 69, 0.05);
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.file-upload-label i {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-sm);
  color: var(--secondary-color);
}

@media (max-width: 575.98px) {
  .file-upload-label {
    padding: var(--spacing-lg);
    min-height: 100px;
  }

  .file-upload-label span {
    font-size: var(--font-size-sm);
  }
}

/* ==========================================================================
   Enhanced Select Styles
   ========================================================================== */
.enhanced-select {
  position: relative;
  margin-bottom: var(--spacing-md);
}

.enhanced-select input {
  margin-bottom: var(--spacing-sm);
}

.enhanced-select select {
  max-height: 200px;
  overflow-y: auto;
}

@media (max-width: 575.98px) {
  .enhanced-select select {
    max-height: 150px;
  }
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.btn.loading {
  position: relative;
  color: transparent !important;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Form Validation Styles
   ========================================================================== */
.form-control.is-invalid {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.invalid-feedback {
  display: block;
  color: var(--danger-color);
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

.form-control.is-valid {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* ==========================================================================
   Print Optimizations
   ========================================================================== */
@media print {
  /* Reset mobile-specific table styles for print */
  .table-mobile thead {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    padding: 0;
    clip: auto;
  }

  .table-mobile tbody tr {
    display: table-row;
    border: 1px solid #ccc;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .table-mobile tbody td {
    display: table-cell;
    text-align: left;
    padding: var(--spacing-sm) !important;
    border-bottom: 1px solid #ccc;
    position: static;
  }

  .table-mobile tbody td:before {
    display: none;
  }

  .sidebar-overlay,
  .header-toggle,
  .btn,
  .alert {
    display: none !important;
  }

  .admin-main {
    margin-left: 0 !important;
  }

  .content-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   Accessibility Improvements
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn,
  .form-control,
  .content-card {
    border: 2px solid currentColor;
  }
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* ==========================================================================
   Special Components
   ========================================================================== */

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: var(--spacing-md) 0;
  margin-bottom: var(--spacing-lg);
  list-style: none;
  background: transparent;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  padding: 0 var(--spacing-sm);
  color: var(--secondary-color);
}

.breadcrumb-item.active {
  color: var(--secondary-color);
}

/* Progress bars */
.progress {
  display: flex;
  height: 1rem;
  overflow: hidden;
  background-color: #e9ecef;
  border-radius: var(--border-radius-md);
}

.progress-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  color: white;
  text-align: center;
  white-space: nowrap;
  background: var(--primary-gradient);
  transition: var(--transition-base);
}

/* Tooltips */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--dark-color);
  color: white;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  white-space: nowrap;
  z-index: 1000;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: white;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: var(--transition-base);
}

.modal.show .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: var(--spacing-lg);
}

.modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
}

/* Console Logs Terminal Styling */
.logs-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.4;
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 0 0 1px rgba(0, 255, 65, 0.5);
}

.logs-terminal::-webkit-scrollbar {
    width: 8px;
}

.logs-terminal::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.logs-terminal::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.logs-terminal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.log-entry {
    margin-bottom: 5px;
    white-space: pre-wrap;
}

.log-timestamp {
    color: #666;
    margin-right: 10px;
}

/* Command Output Terminal Styling */
.command-output-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 20px;
    height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 0 0 8px 8px;
    text-shadow: 0 0 1px rgba(0, 255, 65, 0.5);
}

.command-output-terminal::-webkit-scrollbar {
    width: 8px;
}

.command-output-terminal::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.command-output-terminal::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.command-output-terminal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.output-placeholder {
    color: #666;
    text-align: center;
    padding: var(--spacing-2xl);
    font-style: italic;
    font-size: var(--font-size-lg);
}

.output-line {
    margin-bottom: var(--spacing-sm);
    font-family: inherit;
    font-size: inherit;
    line-height: 1.6;
}

.output-timestamp {
    color: #666;
    font-size: 12px;
    margin-right: var(--spacing-sm);
}

.output-prompt {
    color: #00bfff;
    font-weight: bold;
    text-shadow: 0 0 1px rgba(0, 191, 255, 0.5);
}

.output-text {
    color: #ffffff;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.output-success .output-text {
    color: #00ff41;
    text-shadow: 0 0 1px rgba(0, 255, 65, 0.5);
}

.output-error .output-text {
    color: #ff6b6b;
    text-shadow: 0 0 1px rgba(255, 107, 107, 0.5);
    font-weight: 500;
}

.command-echo .output-prompt {
    color: #00bfff;
    text-shadow: 0 0 1px rgba(0, 191, 255, 0.5);
}

/* Console-specific styling */
.console-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: var(--font-size-sm);
}

.user-mode-badge {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.admin-mode {
    background: var(--danger-gradient);
    color: white;
}

.user-mode {
    background: var(--info-gradient);
    color: white;
}

.console-section {
    margin-bottom: var(--spacing-xl);
}

.command-interface {
    padding: var(--spacing-xl);
    background: #0c0c0c;
    border-top: 1px solid #333;
}

.command-prompt {
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 15px;
    margin-bottom: var(--spacing-md);
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0, 255, 65, 0.5);
}

.prompt-user {
    color: #00ff41;
    font-weight: 700;
}

.prompt-host {
    color: #ffff00;
    font-weight: 700;
    text-shadow: 0 0 2px rgba(255, 255, 0, 0.5);
}

.prompt-path {
    color: #00bfff;
    font-weight: 700;
    text-shadow: 0 0 2px rgba(0, 191, 255, 0.5);
}

.command-input-container {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    align-items: stretch;
}

.command-input {
    flex: 1;
    background: #1a1a1a;
    border: 2px solid #333;
    color: #00ff41;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition-base);
    text-shadow: 0 0 1px rgba(0, 255, 65, 0.5);
}

.command-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(213, 182, 84, 0.3), 0 0 8px rgba(0, 255, 65, 0.4);
    background: #111;
}

.command-execute {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--primary-gradient);
    border: 2px solid var(--primary-gold);
    color: white;
    border-radius: var(--border-radius-lg);
    transition: var(--transition-base);
    font-weight: 600;
    font-size: var(--font-size-base);
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.command-execute:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-gold-light);
}

.command-help {
    color: #888;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.command-help code {
    background: #1a1a1a;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    color: var(--primary-gold);
    border: 1px solid #333;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Security Notice */
.security-notice {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--accent-info);
}

.notice-header {
    color: var(--accent-info);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notice-content {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.notice-content p {
    margin-bottom: var(--spacing-sm);
}

.notice-mode {
    color: var(--text-primary);
    font-weight: 500;
}

/* Dropdown Menu Styling for Console */
.dropdown-menu-dark {
    background: #1a1a1a;
    border: 2px solid #333;
    box-shadow: var(--shadow-xl);
    border-radius: var(--border-radius-lg);
    z-index: 1050;
}

.dropdown-menu-dark .dropdown-item {
    color: #e0e0e0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    padding: var(--spacing-sm) var(--spacing-md);
    transition: var(--transition-fast);
}

.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu-dark .dropdown-item:focus {
    background: #2d2d2d;
    color: var(--primary-gold);
    text-decoration: none;
}

.dropdown-menu-dark .dropdown-item code {
    background: transparent;
    color: inherit;
    border: none;
    padding: 0;
}

.dropdown-menu-dark .dropdown-divider {
    border-color: #444;
}

/* Service Terminal Components */
.service-info-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.info-line {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    line-height: 1.5;
}

.info-label {
    color: #00bfff;
    min-width: 120px;
    margin-right: 15px;
    font-weight: 500;
}

.info-value {
    background: #1a1a1a;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #333;
    font-family: inherit;
    font-size: inherit;
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.status-active {
    background: rgba(0, 255, 65, 0.2);
    color: #00ff41;
    border: 1px solid rgba(0, 255, 65, 0.4);
}

.status-inactive {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.status-unknown {
    background: rgba(255, 255, 0, 0.2);
    color: #ffff00;
    border: 1px solid rgba(255, 255, 0, 0.4);
}

/* Action Terminal */
.action-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.action-group,
.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 0;
}

.terminal-btn {
    background: none;
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: #00ff41;
    padding: 10px 15px;
    border-radius: 4px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.terminal-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    color: #ffffff;
    text-decoration: none;
}

.terminal-btn.btn-info {
    border-color: rgba(0, 191, 255, 0.3);
    color: #00bfff;
}

.terminal-btn.btn-info:hover {
    background: rgba(0, 191, 255, 0.1);
    border-color: #00bfff;
    color: #ffffff;
}

.terminal-btn.btn-primary {
    border-color: rgba(213, 182, 84, 0.3);
    color: var(--primary-gold);
}

.terminal-btn.btn-primary:hover {
    background: rgba(213, 182, 84, 0.1);
    border-color: var(--primary-gold);
    color: #ffffff;
}

.terminal-btn.btn-success {
    border-color: rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

.terminal-btn.btn-success:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #ffffff;
}

.terminal-btn.btn-warning {
    border-color: rgba(255, 255, 0, 0.3);
    color: #ffff00;
}

.terminal-btn.btn-warning:hover {
    background: rgba(255, 255, 0, 0.1);
    border-color: #ffff00;
    color: #000000;
}

.terminal-btn.btn-danger {
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff4444;
}

.terminal-btn.btn-danger:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff4444;
    color: #ffffff;
}

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

.terminal-btn:disabled:hover {
    background: none;
    border-color: rgba(0, 255, 65, 0.3);
    color: #00ff41;
}

/* File Tree Terminal */
.file-tree-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
}

.tree-item {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tree-folder {
    color: #ffff00;
    font-weight: 500;
}

.tree-file {
    color: #ffffff;
}

.tree-size {
    color: #888;
    margin-left: auto;
}

.tree-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.tree-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* Service Logs Terminal Output */
.terminal-output {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 20px;
    height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 0 0 8px 8px;
    text-shadow: 0 0 1px rgba(0, 255, 65, 0.5);
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* File Manager Terminal Styling */
.path-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 15px;
    border-radius: 0 0 8px 8px;
}

.path-prompt {
    margin-bottom: 10px;
    color: #00ff41;
}

.prompt-user {
    color: #00ff41;
    font-weight: bold;
}

.prompt-host {
    color: #ffff00;
    font-weight: bold;
}

.prompt-path {
    color: #00bfff;
    font-weight: bold;
}

.path-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.path-link {
    color: #00bfff;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.path-link:hover {
    background: rgba(0, 191, 255, 0.2);
    color: #ffffff;
}

.path-separator {
    color: #666;
    margin: 0 2px;
}

.console-breadcrumb .breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: var(--spacing-sm);
}

.console-breadcrumb .breadcrumb-item a {
    color: var(--primary-gold);
    text-decoration: none;
}

.console-breadcrumb .breadcrumb-item a:hover {
    color: #ffffff;
}

.console-breadcrumb .breadcrumb-item.active {
    color: var(--text-secondary);
}

/* File List Terminal Styling */
.file-list-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 0 0 8px 8px;
}

.file-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

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

.file-item:hover {
    background: rgba(0, 255, 65, 0.1);
    padding-left: 10px;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

.file-name {
    flex: 1;
    color: #ffffff;
    font-weight: 500;
}

.file-info {
    color: #888;
    font-size: 12px;
    margin-left: auto;
    margin-right: 15px;
}

.file-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-action-btn {
    background: none;
    border: none;
    color: #00bfff;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.file-action-btn:hover {
    background: rgba(0, 191, 255, 0.2);
    color: #ffffff;
}

.file-action-btn.btn-delete:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff4444;
}

.file-action-btn.btn-download:hover {
    background: rgba(0, 255, 0, 0.2);
    color: #44ff44;
}

.dir-item .file-name {
    color: #ffff00;
}

.empty-directory {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-directory i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.file-count {
    color: #888;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* File Viewer Terminal Styling */
.file-viewer-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 0;
    max-height: 60vh;
    overflow: auto;
    border-radius: 0 0 8px 8px;
}

.file-viewer-terminal pre {
    margin: 0;
    padding: 20px;
    background: transparent;
    color: inherit;
    border: none;
    font-family: inherit;
    font-size: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.file-viewer-terminal code {
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    font-size: inherit;
}

.file-language {
    background: rgba(0, 191, 255, 0.2);
    color: #00bfff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.terminal-action-btn {
    background: none;
    border: none;
    color: #00ff41;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.terminal-action-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    color: #ffffff;
}

/* File Stats Terminal */
.file-stats-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.stat-line {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
}

.stat-label-terminal {
    color: #00bfff;
    min-width: 80px;
    margin-right: 10px;
}

.stat-label-terminal::after {
    content: "";
    margin-left: 5px;
}

.stat-value {
    color: #ffffff;
    flex: 1;
    word-break: break-all;
}

/* Actions Terminal */
.actions-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.terminal-command-btn {
    display: block;
    width: 100%;
    background: none;
    border: 1px solid rgba(0, 255, 65, 0.3);
    color: #00ff41;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
    text-decoration: none;
}

.terminal-command-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    color: #ffffff;
}

.terminal-command-btn.btn-danger {
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff4444;
}

.terminal-command-btn.btn-danger:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff4444;
    color: #ffffff;
}

.terminal-command-btn i {
    margin-right: 8px;
    width: 16px;
}

/* Terminal scrollbar styling */
.file-viewer-terminal::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.file-viewer-terminal::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.file-viewer-terminal::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.file-viewer-terminal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Service Page Terminal Styling */
.service-info-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.info-line {
    display: flex;
    margin-bottom: 12px;
    align-items: center;
}

.info-label {
    color: #00bfff;
    min-width: 120px;
    margin-right: 10px;
    font-weight: 500;
}

.info-value {
    color: #ffffff;
    background: #1a1a1a;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #333;
    font-family: inherit;
}

.status-indicator {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
}

.status-active {
    background: rgba(0, 255, 65, 0.2);
    color: #00ff41;
    border: 1px solid #00ff41;
}

.status-inactive {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

.status-unknown {
    background: rgba(255, 255, 0, 0.2);
    color: #ffff00;
    border: 1px solid #ffff00;
}

.action-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    padding: 20px;
    border-radius: 0 0 8px 8px;
}

.action-group {
    margin-bottom: 15px;
}

.action-divider {
    height: 1px;
    background: #333;
    margin: 15px 0;
}

.control-group {
    margin-top: 15px;
}

.terminal-btn {
    display: inline-block;
    background: none;
    border: 2px solid rgba(0, 255, 65, 0.3);
    color: #00ff41;
    padding: 8px 15px;
    margin: 5px 5px 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.terminal-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    color: #ffffff;
    text-decoration: none;
}

.terminal-btn.btn-info {
    border-color: rgba(0, 191, 255, 0.3);
    color: #00bfff;
}

.terminal-btn.btn-info:hover {
    background: rgba(0, 191, 255, 0.1);
    border-color: #00bfff;
    color: #ffffff;
}

.terminal-btn.btn-primary {
    border-color: rgba(213, 182, 84, 0.3);
    color: var(--primary-gold);
}

.terminal-btn.btn-primary:hover {
    background: rgba(213, 182, 84, 0.1);
    border-color: var(--primary-gold);
    color: #ffffff;
}

.terminal-btn.btn-success {
    border-color: rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

.terminal-btn.btn-success:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #ffffff;
}

.terminal-btn.btn-warning {
    border-color: rgba(255, 255, 0, 0.3);
    color: #ffff00;
}

.terminal-btn.btn-warning:hover {
    background: rgba(255, 255, 0, 0.1);
    border-color: #ffff00;
    color: #000000;
}

.terminal-btn.btn-danger {
    border-color: rgba(255, 0, 0, 0.3);
    color: #ff4444;
}

.terminal-btn.btn-danger:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff4444;
    color: #ffffff;
}

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

.terminal-btn:disabled:hover {
    background: none;
    border-color: rgba(0, 255, 65, 0.3);
    color: #00ff41;
}

/* File Editor Terminal Styling */
.file-editor-terminal {
    background: #0a0a0a;
    color: #00ff41;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 14px;
    border-radius: 0 0 8px 8px;
    position: relative;
}

.editor-textarea {
    width: 100%;
    height: 400px;
    background: #0a0a0a;
    color: #00ff41;
    border: none;
    outline: none;
    padding: 20px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    min-height: 300px;
    max-height: 800px;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    text-shadow: 0 0 1px rgba(0, 255, 65, 0.5);
}

.editor-textarea:focus {
    background: #111;
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.3);
}

.editor-textarea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.editor-textarea::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.editor-textarea::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.editor-textarea::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.editor-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #333;
    background: #111;
}

.editor-info {
    margin-left: auto;
    color: #888;
    font-size: 12px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
}

.terminal-action-btn.btn-success {
    border-color: rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

.terminal-action-btn.btn-success:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #ffffff;
}

.action-btn {
    background: none;
    border: 2px solid rgba(0, 255, 65, 0.3);
    color: #00ff41;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: #00ff41;
    color: #ffffff;
    text-decoration: none;
}

.action-btn.btn-success {
    border-color: rgba(0, 255, 0, 0.3);
    color: #00ff00;
}

.action-btn.btn-success:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    color: #ffffff;
}

.action-btn.btn-secondary {
    border-color: rgba(128, 128, 128, 0.3);
    color: #888;
}

.action-btn.btn-secondary:hover {
    background: rgba(128, 128, 128, 0.1);
    border-color: #888;
    color: #ffffff;
}

/* ==========================================================================
   World Map Dashboard Styles
   ========================================================================== */

.world-map-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--primary-gold);
}

.world-map-preview {
    max-height: 400px;
    width: auto;
    transition: var(--transition-base);
    border: 2px solid var(--bg-quaternary);
}

.world-map-preview:hover {
    transform: scale(1.05);
    border-color: var(--primary-gold);
    box-shadow: var(--shadow-xl);
    cursor: pointer;
}

/* Responsive world map */
@media (max-width: 768px) {
    .world-map-preview {
        max-height: 300px;
    }
    
    .world-map-dashboard {
        padding: var(--spacing-sm);
    }
}

/* ==========================================================================
   Audit Logs Code Block Styling (Override reboot.scss)
   ========================================================================== */

/* Audit log code blocks - ensure proper contrast */
pre code {
  color: #f8f9fa !important; /* Light text color */
  background: transparent !important;
  font-size: 0.875rem !important;
  word-break: normal !important;
}

/* Pre elements with dark background */
pre.bg-dark {
  background-color: #1a1a1a !important;
  border: 1px solid var(--border-color) !important;
  padding: 1rem !important;
  border-radius: var(--border-radius-md) !important;
  overflow-x: auto !important;
}

pre.bg-dark code {
  color: #f8f9fa !important; /* Ensure light text on dark background */
}

/* Inline code elements in audit logs */
.card-body code {
  background-color: var(--bg-quaternary) !important;
  color: var(--text-primary) !important;
  padding: 0.2em 0.4em !important;
  border-radius: var(--border-radius-sm) !important;
  font-size: 0.875rem !important;
  border: 1px solid var(--border-color) !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

/* JSON details display in audit log detail page */
.card-body pre code {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
  line-height: 1.5 !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

/* Ensure proper syntax highlighting for JSON */
.card-body pre.bg-dark code {
  color: #e8e8e8 !important; /* Slightly lighter for better readability */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

@media (max-width: 576px) {
    .world-map-preview {
        max-height: 250px;
    }
}

/* ==========================================================================
   Modular Table System
   ========================================================================== */

/* Table Container */
.modular-table-container {
    width: 100%;
}

/* Table Controls Bar */
.table-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table-controls-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    min-width: 200px;
}

.table-controls-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Search Box */
.table-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.table-search i.bi-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.table-search-input {
    padding-left: 38px !important;
    padding-right: 38px !important;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.table-search-input:focus {
    background: var(--bg-primary);
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(213, 182, 84, 0.15);
}

.table-search-input::placeholder {
    color: var(--text-muted);
}

.table-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

.table-search-clear:hover {
    color: var(--danger-color);
    background: var(--bg-quaternary);
}

/* Count Badge */
.table-count {
    font-size: 0.875rem;
    padding: var(--spacing-sm) var(--spacing-md);
    white-space: nowrap;
}

/* Search Info Bar */
.table-search-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(213, 182, 84, 0.1);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.table-search-info .btn-link {
    color: var(--primary-gold);
    text-decoration: none;
    padding: 0;
}

.table-search-info .btn-link:hover {
    text-decoration: underline;
}

/* Modular Table Styles */
.modular-table {
    margin-bottom: 0;
    width: 100%;
}

.modular-table thead th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Sortable Headers */
.modular-table th[data-sort-key] {
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.modular-table th[data-sort-key]:hover {
    background: var(--bg-quaternary);
}

.modular-table th[data-sort-key]:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: -2px;
}

.th-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.modular-table th[data-sort-key]:hover .sort-indicator {
    opacity: 1;
}

.modular-table th[data-sort-dir="asc"] .sort-indicator,
.modular-table th[data-sort-dir="desc"] .sort-indicator {
    opacity: 1;
    color: var(--primary-gold);
}

/* Table Body */
.modular-table tbody td {
    padding: var(--spacing-md) var(--spacing-lg);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.modular-table tbody tr:hover {
    background: var(--bg-secondary);
}

.modular-table tbody tr.search-match {
    background: rgba(213, 182, 84, 0.05);
}

/* Search Highlight */
.search-highlight {
    background: rgba(213, 182, 84, 0.3);
    color: inherit;
    padding: 0.1em 0.2em;
    border-radius: 2px;
    font-weight: 600;
}

/* Empty State Row */
.empty-state-row td {
    padding: var(--spacing-3xl) !important;
}

/* No Results State */
.table-no-results {
    text-align: center;
    padding: var(--spacing-3xl);
    color: var(--text-muted);
}

.table-no-results h5 {
    color: var(--text-secondary);
}

/* Table Footer */
.table-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.table-footer-left {
    flex: 1;
}

.table-footer-right {
    display: flex;
    gap: var(--spacing-sm);
}

/* ==========================================================================
   Improved Table Responsiveness
   ========================================================================== */

/* Mobile Card Layout for Tables */
@media (max-width: 767.98px) {
    .table-controls {
        flex-direction: column;
        padding: var(--spacing-md);
    }
    
    .table-controls-left {
        width: 100%;
    }
    
    .table-search {
        max-width: none;
    }
    
    .table-controls-right {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Card-style table rows on mobile */
    .modular-table.table-mobile-cards thead {
        display: none;
    }
    
    .modular-table.table-mobile-cards tbody tr {
        display: block;
        margin-bottom: var(--spacing-md);
        padding: var(--spacing-md);
        background: var(--bg-secondary);
        border-radius: var(--border-radius-md);
        border: 1px solid var(--border-color);
    }
    
    .modular-table.table-mobile-cards tbody tr:last-child {
        margin-bottom: 0;
    }
    
    .modular-table.table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-subtle);
    }
    
    .modular-table.table-mobile-cards tbody td:last-child {
        border-bottom: none;
        padding-top: var(--spacing-md);
        justify-content: flex-end;
    }
    
    .modular-table.table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }
    
    /* Standard table scroll on mobile (default) */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0;
    }
    
    /* Better touch scrolling indicator */
    .table-responsive::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(to right, transparent, var(--bg-primary));
        pointer-events: none;
        opacity: 0;
        transition: opacity var(--transition-fast);
    }
    
    .table-responsive.has-scroll::after {
        opacity: 1;
    }
    
    /* Adjust table footer on mobile */
    .table-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .table-footer-left,
    .table-footer-right {
        width: 100%;
        justify-content: center;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .table-search {
        max-width: 300px;
    }
    
    .modular-table thead th,
    .modular-table tbody td {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Large screens - full width tables */
@media (min-width: 1200px) {
    .modular-table thead th,
    .modular-table tbody td {
        padding: var(--spacing-md) var(--spacing-xl);
    }
}

/* ==========================================================================
   Improved Overall Responsiveness
   ========================================================================== */

/* Content Card Responsiveness */
@media (max-width: 767.98px) {
    .content-card {
        border-radius: 0;
        margin-left: calc(-1 * var(--spacing-md));
        margin-right: calc(-1 * var(--spacing-md));
        border-left: none;
        border-right: none;
    }
    
    .content-card .card-header {
        padding: var(--spacing-md);
    }
    
    .content-card .card-body {
        padding: var(--spacing-md);
    }
    
    /* Page titles */
    h1 {
        font-size: 1.5rem;
    }
    
    /* Button groups */
    .btn-group-sm > .btn {
        padding: 0.25rem 0.5rem;
    }
    
    /* Forms in cards */
    .card-body .form-label {
        font-size: 0.875rem;
    }
    
    .card-body .form-control {
        font-size: 1rem; /* Prevents iOS zoom */
    }
}

/* Better flex wrapping */
.d-flex.flex-wrap > * {
    flex-shrink: 0;
}

/* Improved button responsiveness */
@media (max-width: 575.98px) {
    .btn-group {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .btn-group > .btn {
        flex: 1 1 auto;
    }
    
    /* Stack action buttons vertically on very small screens */
    td .btn-group {
        flex-direction: column;
    }
    
    td .btn-group > .btn {
        border-radius: var(--border-radius-md) !important;
        margin-left: 0 !important;
    }
}

/* Print styles for tables */
@media print {
    .modular-table-container .table-controls,
    .modular-table-container .table-footer,
    .modular-table-container .table-search-info,
    .modular-table-container .table-no-results,
    .sort-indicator {
        display: none !important;
    }
    
    .modular-table {
        font-size: 10pt;
    }
    
    .modular-table thead th {
        background: #f0f0f0 !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .modular-table tbody tr {
        page-break-inside: avoid;
    }
    
    /* Show hidden columns when printing */
    .d-none {
        display: table-cell !important;
    }
}

