/**
 * Modern Theme CSS for Industrial Manufacturing ERP
 * This file enhances the default SB Admin 2 styling with a modern, professional look
 * Load this AFTER style.min.css to override default styles
 *
 * Rollback: Simply remove the link to this file from layout templates
 */

/* ============================================
   PHASE 1: CSS VARIABLES & COLOR SCHEME
   ============================================ */

:root {
  /* Primary - Deep Professional Blue */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;

  /* Secondary - Slate Gray */
  --secondary: #64748b;
  --secondary-dark: #475569;
  --secondary-light: #94a3b8;

  /* Success - Modern Green */
  --success: #10b981;
  --success-dark: #059669;
  --success-light: #34d399;
  --success-50: #ecfdf5;

  /* Warning - Warm Amber */
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #fbbf24;
  --warning-50: #fffbeb;

  /* Danger - Clear Red */
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #f87171;
  --danger-50: #fef2f2;

  /* Info - Cyan */
  --info: #06b6d4;
  --info-dark: #0891b2;
  --info-light: #22d3ee;
  --info-50: #ecfeff;

  /* Neutrals */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

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

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;
}


/* ============================================
   PHASE 2: SIDEBAR ENHANCEMENT
   ============================================ */

/* Modern Sidebar Background */
.sidebar,
#accordionSidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

/* Sidebar Brand */
.sidebar .sidebar-brand {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  height: auto;
}

.sidebar .sidebar-brand-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

/* Nav Items */
.sidebar .nav-item .nav-link {
  padding: 0.875rem 1.25rem;
  margin: 0.125rem 0.75rem;
  border-radius: var(--radius);
  transition: all var(--transition);
  color: var(--gray-300) !important;
}

.sidebar .nav-item .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
  transform: translateX(4px);
}

.sidebar .nav-item .nav-link.active,
.sidebar .nav-item.active > .nav-link,
.sidebar .nav-item .nav-link[aria-expanded="true"] {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Nav Link Icons */
.sidebar .nav-item .nav-link i {
  width: 1.5rem;
  text-align: center;
  margin-right: 0.75rem;
  font-size: 1rem;
  transition: transform var(--transition-fast);
}

.sidebar .nav-item .nav-link:hover i {
  transform: scale(1.1);
}

/* Sidebar Heading */
.sidebar .sidebar-heading {
  color: var(--gray-500) !important;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
}

/* Sidebar Divider */
.sidebar .sidebar-divider,
.sidebar hr.sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  margin: 0.5rem 1rem;
}

/* Collapse Menu Styling */
.sidebar .collapse-inner {
  background: var(--gray-50) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.75rem !important;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

.sidebar .collapse-inner .collapse-item {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--gray-700) !important;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sidebar .collapse-inner .collapse-item:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

.sidebar .collapse-inner .collapse-item.active {
  background: var(--primary-100) !important;
  color: var(--primary-dark) !important;
  font-weight: 500;
}

/* Collapse header */
.sidebar .collapse-inner .collapse-header {
  color: var(--gray-500);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Toggled sidebar adjustments */
.sidebar.toggled .nav-item .nav-link {
  margin: 0.125rem 0.5rem;
  padding: 0.75rem;
  text-align: center;
}

.sidebar.toggled .nav-item .nav-link i {
  margin-right: 0;
  font-size: 1.1rem;
}


/* ============================================
   PHASE 3: CARD & DASHBOARD ENHANCEMENT
   ============================================ */

/* Modern Card Base */
.card {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  transition: all var(--transition);
  overflow: hidden;
}

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

/* Card Body Padding */
.card .card-body {
  padding: 1.25rem;
}

/* Card Header - Default styling (can be overridden by inline styles) */
.card .card-header {
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--gray-800, #1f2937);
}

/* Only apply transparent background when no inline style is set */
.card .card-header:not([style*="background"]) {
  background: transparent;
}

/* Default icon color - inherit from parent when text-white is used */
.card .card-header i {
  color: inherit;
}

/* Card header h6 - inherit color when parent has text-white */
.card-header h6 {
  font-weight: 600;
  color: inherit;
}

/* Explicit styling for card headers without gradient/colored backgrounds */
.card .card-header:not([style*="background"]) h6 {
  color: var(--primary);
}

/* Ensure text-white works on card headers */
.card .card-header.text-white,
.card .card-header .text-white {
  color: #fff !important;
}

/* Modern Stat Cards - Replace border-left with gradient backgrounds */
.card.border-left-primary {
  border-left: none !important;
  background: linear-gradient(135deg, #fff 0%, var(--primary-50) 100%) !important;
}

.card.border-left-success {
  border-left: none !important;
  background: linear-gradient(135deg, #fff 0%, var(--success-50) 100%) !important;
}

.card.border-left-info {
  border-left: none !important;
  background: linear-gradient(135deg, #fff 0%, var(--info-50) 100%) !important;
}

.card.border-left-warning {
  border-left: none !important;
  background: linear-gradient(135deg, #fff 0%, var(--warning-50) 100%) !important;
}

.card.border-left-danger {
  border-left: none !important;
  background: linear-gradient(135deg, #fff 0%, var(--danger-50) 100%) !important;
}

/* Add subtle left accent to stat cards */
.card.border-left-primary::before,
.card.border-left-success::before,
.card.border-left-info::before,
.card.border-left-warning::before,
.card.border-left-danger::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.card.border-left-primary { position: relative; }
.card.border-left-primary::before { background: var(--primary); }

.card.border-left-success { position: relative; }
.card.border-left-success::before { background: var(--success); }

.card.border-left-info { position: relative; }
.card.border-left-info::before { background: var(--info); }

.card.border-left-warning { position: relative; }
.card.border-left-warning::before { background: var(--warning); }

.card.border-left-danger { position: relative; }
.card.border-left-danger::before { background: var(--danger); }

/* Stat Card Icon Styling */
.card .fa-2x,
.card .fa-3x {
  opacity: 0.8;
}

.card.border-left-primary .fa-2x,
.card.border-left-primary .fa-3x { color: var(--primary) !important; }

.card.border-left-success .fa-2x,
.card.border-left-success .fa-3x { color: var(--success) !important; }

.card.border-left-info .fa-2x,
.card.border-left-info .fa-3x { color: var(--info) !important; }

.card.border-left-warning .fa-2x,
.card.border-left-warning .fa-3x { color: var(--warning) !important; }

.card.border-left-danger .fa-2x,
.card.border-left-danger .fa-3x { color: var(--danger) !important; }

/* Stat Value Styling */
.card .h5.font-weight-bold,
.card .text-gray-800 {
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: var(--gray-800) !important;
}

/* Card Small Text */
.card .text-xs {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ============================================
   PHASE 4: FORM ENHANCEMENT
   ============================================ */

/* Modern Form Controls */
.form-control {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  padding: 0.625rem 0.875rem !important;
  font-size: 0.9rem;
  transition: all var(--transition);
  background: var(--gray-50) !important;
  color: var(--gray-700) !important;
}

.form-control:hover {
  border-color: var(--gray-300) !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  background: #fff !important;
  outline: none !important;
}

/* Form Labels */
.form-group label,
label.form-label,
.col-form-label {
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
  font-size: 0.85rem;
}

/* Select Styling */
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
  background-position: right 0.75rem center !important;
  background-repeat: no-repeat !important;
  background-size: 1.25em 1.25em !important;
  padding-right: 2.5rem !important;
}

/* File Input */
input[type="file"].form-control {
  padding: 0.5rem !important;
}

input[type="file"].form-control::file-selector-button {
  padding: 0.375rem 0.875rem;
  margin-right: 0.875rem;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}

input[type="file"].form-control::file-selector-button:hover {
  background: var(--primary-dark);
}

/* Textarea */
textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Form Control Small */
.form-control-sm {
  padding: 0.375rem 0.75rem !important;
  font-size: 0.8rem;
}

/* Input Group */
.input-group .form-control {
  border-radius: var(--radius) !important;
}

.input-group .btn {
  border-radius: var(--radius) !important;
}

.input-group-text {
  background: var(--gray-100) !important;
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  color: var(--gray-600);
}

/* Select2 Enhancement */
.select2-container--bootstrap4 .select2-selection {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  min-height: 38px;
  background: var(--gray-50) !important;
}

.select2-container--bootstrap4.select2-container--focus .select2-selection {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.select2-container--bootstrap4 .select2-dropdown {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg);
}

.select2-container--bootstrap4 .select2-results__option--highlighted {
  background: var(--primary) !important;
}

/* Custom Checkbox/Radio */
.custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}


/* ============================================
   PHASE 5: TABLE ENHANCEMENT
   ============================================ */

/* Modern Table Styling */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  background: var(--gray-50) !important;
  border-bottom: 2px solid var(--gray-200) !important;
  border-top: none !important;
  color: var(--gray-600) !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 0.875rem 1rem !important;
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: var(--gray-50) !important;
}

.table tbody td {
  padding: 0.875rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--gray-100) !important;
  border-top: none !important;
  color: var(--gray-600);
  font-size: 0.875rem;
}

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

/* DataTable Wrapper */
.dataTables_wrapper {
  padding: 0.5rem 0;
}

/* DataTable Buttons */
.dt-buttons .btn,
.dataTables_wrapper .dt-buttons .btn {
  border-radius: var(--radius) !important;
  padding: 0.5rem 1rem !important;
  font-weight: 500;
  font-size: 0.8rem !important;
  border: 1px solid var(--gray-200) !important;
  background: #fff !important;
  color: var(--gray-700) !important;
  transition: all var(--transition-fast);
  margin-right: 0.375rem;
}

.dt-buttons .btn:hover,
.dataTables_wrapper .dt-buttons .btn:hover {
  background: var(--gray-50) !important;
  border-color: var(--gray-300) !important;
}

.dt-buttons .btn i {
  margin-right: 0.375rem;
}

/* DataTable Search */
.dataTables_filter input,
.dataTables_wrapper .dataTables_filter input {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  padding: 0.5rem 1rem !important;
  transition: all var(--transition);
  background: var(--gray-50) !important;
  font-size: 0.875rem;
}

.dataTables_filter input:focus,
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  background: #fff !important;
  outline: none !important;
}

/* DataTable Length Select */
.dataTables_length select {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  padding: 0.375rem 2rem 0.375rem 0.75rem !important;
  background: var(--gray-50) !important;
}

/* DataTable Pagination */
.dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius) !important;
  margin: 0 0.125rem !important;
  padding: 0.5rem 0.875rem !important;
  border: 1px solid var(--gray-200) !important;
  background: #fff !important;
  transition: all var(--transition-fast);
}

.dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.dataTables_paginate .paginate_button:hover:not(.current),
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current) {
  background: var(--gray-100) !important;
  border-color: var(--gray-300) !important;
  color: var(--gray-700) !important;
}

.dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

/* DataTable Info */
.dataTables_info {
  color: var(--gray-500);
  font-size: 0.85rem;
}


/* ============================================
   PHASE 6: BUTTON ENHANCEMENT
   ============================================ */

/* Modern Button Base */
.btn {
  border-radius: var(--radius) !important;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all var(--transition);
  border: none !important;
  box-shadow: var(--shadow-sm);
  font-size: 0.875rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  color: #fff !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4) !important;
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%) !important;
  color: #fff !important;
}

.btn-success:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4) !important;
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%) !important;
  color: #fff !important;
}

.btn-danger:hover {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

/* Warning Button */
.btn-warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%) !important;
  color: #fff !important;
}

.btn-warning:hover {
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4) !important;
}

/* Info Button */
.btn-info {
  background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%) !important;
  color: #fff !important;
}

.btn-info:hover {
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4) !important;
}

/* Secondary Button */
.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%) !important;
  color: #fff !important;
}

/* Light Button */
.btn-light {
  background: #fff !important;
  border: 1px solid var(--gray-200) !important;
  color: var(--gray-700) !important;
}

.btn-light:hover {
  background: var(--gray-50) !important;
  border-color: var(--gray-300) !important;
}

/* Outline Buttons */
.btn-outline-primary {
  border: 2px solid var(--primary) !important;
  color: var(--primary) !important;
  background: transparent !important;
}

.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

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

.btn-outline-secondary:hover {
  background: var(--secondary) !important;
  color: #fff !important;
}

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

.btn-outline-success:hover {
  background: var(--success) !important;
  color: #fff !important;
}

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

.btn-outline-danger:hover {
  background: var(--danger) !important;
  color: #fff !important;
}

/* Small Buttons */
.btn-sm {
  padding: 0.375rem 0.75rem !important;
  font-size: 0.8rem !important;
}

/* Large Buttons */
.btn-lg {
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
}

/* Icon Buttons */
.btn i {
  margin-right: 0.375rem;
}

.btn-icon {
  padding: 0.5rem !important;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.btn-icon i {
  margin: 0 !important;
}

/* Button Group */
.btn-group .btn {
  border-radius: 0 !important;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius) !important;
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0 !important;
}


/* ============================================
   PHASE 7: PAGE HEADER & NAVIGATION
   ============================================ */

/* Modern Page Header */
.bg-white.p-2.d-sm-flex,
.d-sm-flex.align-items-center.justify-content-between.mb-4 {
  background: linear-gradient(135deg, #fff 0%, var(--gray-50) 100%) !important;
  border-radius: var(--radius-lg) !important;
  padding: 1rem 1.25rem !important;
  box-shadow: var(--shadow) !important;
  margin-bottom: 1.25rem !important;
}

.bg-white.p-2.d-sm-flex h1,
.d-sm-flex h1.h3 {
  font-size: 1.125rem !important;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0;
}

/* Date/Time Display */
.display-date {
  font-size: 0.85rem;
  color: var(--gray-500);
  font-weight: 500;
}

.display-time {
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  background: var(--gray-100);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--gray-600);
}

/* Topbar Enhancement - Fixed & Compact */
.topbar {
  position: fixed !important;
  top: 0;
  right: 0;
  left: 15.5rem;
  z-index: 1020;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
  border-bottom: 1px solid var(--gray-100);
  height: 3rem !important;
  min-height: 3rem !important;
  padding: 0 1rem !important;
  background: #fff !important;
  margin: 0 !important;
  display: flex;
  align-items: center;
}

/* Adjust topbar when sidebar is collapsed */
body.sidebar-toggled .topbar {
  left: 5rem;
}

.topbar .nav-link {
  padding: 0.4rem 0.75rem !important;
  color: var(--gray-600) !important;
  transition: all var(--transition-fast);
  font-size: 0.85rem;
}

.topbar .nav-link:hover {
  color: var(--primary) !important;
}

.topbar .dropdown-menu {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.375rem !important;
  margin-top: 0.25rem !important;
}

.topbar .dropdown-item {
  border-radius: var(--radius-sm) !important;
  padding: 0.5rem 0.875rem !important;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
}

.topbar .dropdown-item:hover {
  background: var(--gray-100) !important;
}

.topbar .dropdown-item i {
  width: 1rem;
  margin-right: 0.4rem;
  color: var(--gray-400);
}

/* Topbar User Info - Compact */
.topbar .img-profile {
  width: 1.85rem;
  height: 1.85rem;
  border: 2px solid var(--gray-200);
}

.topbar .dropdown-toggle::after {
  display: none;
}

/* Topbar mobile toggle */
#sidebarToggleTop {
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}

/* Content area padding adjustment for fixed topbar */
#content {
  padding-top: 3.5rem !important;
}

/* Container fluid top padding */
#content > .container-fluid {
  padding-top: 1rem;
}

/* Mobile topbar */
@media (max-width: 768px) {
  .topbar {
    left: 0 !important;
  }
}


/* ============================================
   PHASE 8: ALERTS & BADGES
   ============================================ */

/* Modern Alerts */
.alert {
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 1rem 1.25rem !important;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: linear-gradient(135deg, var(--success-50) 0%, #d1fae5 100%) !important;
  color: var(--success-dark) !important;
  border-left: 4px solid var(--success) !important;
}

.alert-danger {
  background: linear-gradient(135deg, var(--danger-50) 0%, #fee2e2 100%) !important;
  color: var(--danger-dark) !important;
  border-left: 4px solid var(--danger) !important;
}

.alert-warning {
  background: linear-gradient(135deg, var(--warning-50) 0%, #fef3c7 100%) !important;
  color: var(--warning-dark) !important;
  border-left: 4px solid var(--warning) !important;
}

.alert-info {
  background: linear-gradient(135deg, var(--info-50) 0%, #cffafe 100%) !important;
  color: var(--info-dark) !important;
  border-left: 4px solid var(--info) !important;
}

.alert-primary {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%) !important;
  color: var(--primary-dark) !important;
  border-left: 4px solid var(--primary) !important;
}

/* Modern Badges */
.badge {
  font-weight: 500 !important;
  padding: 0.35rem 0.65rem !important;
  border-radius: 9999px !important;
  font-size: 0.7rem !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary,
.badge.bg-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  color: #fff !important;
}

.badge-success,
.badge.bg-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%) !important;
  color: #fff !important;
}

.badge-danger,
.badge.bg-danger {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%) !important;
  color: #fff !important;
}

.badge-warning,
.badge.bg-warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%) !important;
  color: #fff !important;
}

.badge-info,
.badge.bg-info {
  background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%) !important;
  color: #fff !important;
}

.badge-secondary,
.badge.bg-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%) !important;
  color: #fff !important;
}

.badge-light,
.badge.bg-light {
  background: var(--gray-100) !important;
  color: var(--gray-700) !important;
}

/* Status Badges */
.badge-pending {
  background: var(--warning) !important;
  color: #fff !important;
}

.badge-approved {
  background: var(--success) !important;
  color: #fff !important;
}

.badge-rejected {
  background: var(--danger) !important;
  color: #fff !important;
}

.badge-in-progress {
  background: var(--info) !important;
  color: #fff !important;
}


/* ============================================
   PHASE 9: MODAL ENHANCEMENT
   ============================================ */

/* Modern Modal */
.modal-content {
  border: none !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
  overflow: hidden;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  color: #fff !important;
  border: none !important;
  padding: 1.25rem 1.5rem !important;
}

.modal-header .modal-title {
  font-weight: 600;
  font-size: 1.125rem;
}

.modal-header .close,
.modal-header .btn-close {
  color: #fff !important;
  opacity: 0.8;
  text-shadow: none !important;
  font-size: 1.25rem;
  padding: 0.5rem;
  margin: -0.5rem -0.5rem -0.5rem auto;
}

.modal-header .close:hover,
.modal-header .btn-close:hover {
  opacity: 1;
}

.modal-body {
  padding: 1.5rem !important;
}

.modal-footer {
  border-top: 1px solid var(--gray-200) !important;
  padding: 1rem 1.5rem !important;
  background: var(--gray-50) !important;
}

/* Modal backdrop */
.modal-backdrop.show {
  opacity: 0.5;
}

/* Large Modal */
.modal-lg {
  max-width: 900px;
}

/* Full Width Modal */
.modal-xl {
  max-width: 1140px;
}


/* ============================================
   PHASE 10: PROGRESS BARS & MISC
   ============================================ */

/* Modern Progress Bars */
.progress {
  height: 0.625rem !important;
  border-radius: 9999px !important;
  background: var(--gray-200) !important;
  overflow: hidden;
}

.progress-bar {
  border-radius: 9999px !important;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%) !important;
  transition: width 0.6s ease;
}

.progress-bar.bg-success {
  background: linear-gradient(90deg, var(--success) 0%, var(--success-light) 100%) !important;
}

.progress-bar.bg-warning {
  background: linear-gradient(90deg, var(--warning) 0%, var(--warning-light) 100%) !important;
}

.progress-bar.bg-danger {
  background: linear-gradient(90deg, var(--danger) 0%, var(--danger-light) 100%) !important;
}

.progress-bar.bg-info {
  background: linear-gradient(90deg, var(--info) 0%, var(--info-light) 100%) !important;
}

/* Breadcrumb */
.breadcrumb {
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 1rem;
}

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

.breadcrumb-item a:hover {
  text-decoration: underline;
}

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

/* Dropdown Enhancement */
.dropdown-menu {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.5rem !important;
}

.dropdown-item {
  border-radius: var(--radius-sm) !important;
  padding: 0.5rem 1rem !important;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
}

.dropdown-item:hover {
  background: var(--gray-100) !important;
  color: var(--gray-800) !important;
}

.dropdown-item:active,
.dropdown-item.active {
  background: var(--primary) !important;
  color: #fff !important;
}

/* Nav Tabs */
.nav-tabs {
  border-bottom: 2px solid var(--gray-200) !important;
}

.nav-tabs .nav-link {
  border: none !important;
  border-bottom: 2px solid transparent !important;
  margin-bottom: -2px;
  color: var(--gray-500);
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  transition: all var(--transition-fast);
}

.nav-tabs .nav-link:hover {
  color: var(--primary);
  border-color: transparent !important;
}

.nav-tabs .nav-link.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
  background: transparent !important;
}

/* Nav Pills */
.nav-pills .nav-link {
  border-radius: var(--radius) !important;
  color: var(--gray-600);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.nav-pills .nav-link.active {
  background: var(--primary) !important;
  color: #fff !important;
}

/* List Group */
.list-group-item {
  border: 1px solid var(--gray-200) !important;
  padding: 0.875rem 1.25rem;
  transition: all var(--transition-fast);
}

.list-group-item:first-child {
  border-top-left-radius: var(--radius) !important;
  border-top-right-radius: var(--radius) !important;
}

.list-group-item:last-child {
  border-bottom-left-radius: var(--radius) !important;
  border-bottom-right-radius: var(--radius) !important;
}

.list-group-item:hover {
  background: var(--gray-50);
}

.list-group-item.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

/* Tooltip */
.tooltip .tooltip-inner {
  background: var(--gray-800) !important;
  border-radius: var(--radius) !important;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

/* Popover */
.popover {
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
}

.popover-header {
  background: var(--gray-50) !important;
  border-bottom: 1px solid var(--gray-200) !important;
  font-weight: 600;
}


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

/* Text Colors */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-muted { color: var(--gray-500) !important; }

/* Background Colors */
.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-info { background-color: var(--info) !important; }
.bg-light { background-color: var(--gray-50) !important; }

/* Border Colors */
.border-primary { border-color: var(--primary) !important; }
.border-success { border-color: var(--success) !important; }
.border-danger { border-color: var(--danger) !important; }
.border-warning { border-color: var(--warning) !important; }
.border-info { border-color: var(--info) !important; }

/* Rounded corners */
.rounded { border-radius: var(--radius) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: 9999px !important; }

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


/* ============================================
   ANIMATIONS
   ============================================ */

/* Fade in animation for page load */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeIn 0.3s ease-out;
}

/* Pulse animation for notifications */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.badge-counter {
  animation: pulse 2s infinite;
}

/* Smooth loading transition */
.container-fluid {
  animation: fadeIn 0.2s ease-out;
}


/* ============================================
   CUSTOM SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

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


/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .card .card-body {
    padding: 1rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.625rem 0.75rem !important;
    font-size: 0.8rem;
  }

  .btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
  }

  .sidebar .nav-item .nav-link {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 576px) {
  .bg-white.p-2.d-sm-flex {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .display-date,
  .display-time {
    font-size: 0.75rem;
  }
}


/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .sidebar,
  .topbar,
  .btn,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_paginate {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  #content-wrapper {
    margin-left: 0 !important;
  }
}


/* ============================================
   UI/UX ENHANCEMENT v2.0
   Fixed: Dropdown text truncation, Select2, Polish
   ============================================ */

/* ============================================
   DROPDOWN & SELECT FIX - TEXT TRUNCATION
   ============================================ */

/* Native Select - Fix text truncation */
select.form-control {
  min-height: 42px !important;
  height: auto !important;
  line-height: 1.5 !important;
  padding: 0.5rem 2.5rem 0.5rem 0.875rem !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}

/* Ensure select options are fully visible */
select.form-control option {
  padding: 0.5rem 0.75rem;
  white-space: normal;
  word-wrap: break-word;
}

/* Select placeholder color */
select.form-control option[value=""],
select.form-control option:disabled {
  color: var(--gray-400);
}

/* Small select */
select.form-control-sm {
  min-height: 34px !important;
  padding: 0.25rem 2rem 0.25rem 0.625rem !important;
  font-size: 0.8rem !important;
}

/* Large select */
select.form-control-lg {
  min-height: 50px !important;
  padding: 0.75rem 2.75rem 0.75rem 1rem !important;
  font-size: 1rem !important;
}

/* ============================================
   SELECT2 COMPREHENSIVE FIX
   ============================================ */

/* Select2 Container Fix */
.select2-container {
  width: 100% !important;
}

/* Select2 Single Selection - Fix height and text visibility */
.select2-container--bootstrap4 .select2-selection--single,
.select2-container--bootstrap-5 .select2-selection--single,
.select2-container--default .select2-selection--single {
  min-height: 42px !important;
  height: auto !important;
  padding: 0.375rem 0.75rem !important;
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  background-color: var(--gray-50) !important;
  display: flex !important;
  align-items: center !important;
}

/* Select2 Rendered Text - Prevent truncation */
.select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--gray-700) !important;
  line-height: 1.5 !important;
  padding: 0 !important;
  padding-right: 2rem !important;
  overflow: visible !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  display: block !important;
  width: 100% !important;
}

/* Select2 Placeholder - Make fully visible */
.select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: var(--gray-400) !important;
  line-height: 1.5 !important;
  overflow: visible !important;
}

/* Select2 Arrow - Position correctly */
.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow,
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  top: 0 !important;
  right: 0.75rem !important;
  width: 1.5rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b,
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b,
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: var(--gray-500) transparent transparent transparent !important;
  border-width: 5px 5px 0 5px !important;
  margin-top: 2px !important;
}

/* Select2 Clear Button */
.select2-container--bootstrap4 .select2-selection__clear,
.select2-container--bootstrap-5 .select2-selection__clear,
.select2-container--default .select2-selection__clear {
  color: var(--gray-400) !important;
  font-size: 1.25rem !important;
  margin-right: 0.5rem !important;
  cursor: pointer;
}

.select2-container--bootstrap4 .select2-selection__clear:hover,
.select2-container--bootstrap-5 .select2-selection__clear:hover {
  color: var(--danger) !important;
}

/* Select2 Focus State */
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--default.select2-container--focus .select2-selection {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  background-color: #fff !important;
}

/* Select2 Open State */
.select2-container--bootstrap4.select2-container--open .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Select2 Dropdown Panel */
.select2-container--bootstrap4 .select2-dropdown,
.select2-container--bootstrap-5 .select2-dropdown,
.select2-container--default .select2-dropdown {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-xl) !important;
  margin-top: 4px !important;
  background: #fff !important;
  z-index: 9999 !important;
}

/* Select2 Search Box */
.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field,
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  padding: 0.5rem 0.75rem !important;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.select2-container--bootstrap4 .select2-search--dropdown .select2-search__field:focus,
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus,
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
  outline: none !important;
}

/* Select2 Results Options */
.select2-container--bootstrap4 .select2-results__option,
.select2-container--bootstrap-5 .select2-results__option,
.select2-container--default .select2-results__option {
  padding: 0.625rem 1rem !important;
  font-size: 0.9rem;
  color: var(--gray-700);
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  margin: 0.125rem 0.25rem;
}

.select2-container--bootstrap4 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--primary) !important;
  color: #fff !important;
}

.select2-container--bootstrap4 .select2-results__option--selected,
.select2-container--bootstrap-5 .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: var(--primary-100) !important;
  color: var(--primary-dark) !important;
}

/* Select2 Multiple Selection */
.select2-container--bootstrap4 .select2-selection--multiple,
.select2-container--bootstrap-5 .select2-selection--multiple,
.select2-container--default .select2-selection--multiple {
  min-height: 42px !important;
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  background-color: var(--gray-50) !important;
  padding: 0.25rem 0.5rem !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--primary) !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 0.25rem 0.5rem !important;
  color: #fff !important;
  font-size: 0.8rem;
  margin: 0.125rem !important;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: rgba(255, 255, 255, 0.7) !important;
  margin-right: 0.25rem;
}

.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
  color: #fff !important;
}

/* Select2 No Results */
.select2-container--bootstrap4 .select2-results__message,
.select2-container--bootstrap-5 .select2-results__message,
.select2-container--default .select2-results__message {
  color: var(--gray-500);
  padding: 1rem;
  text-align: center;
  font-style: italic;
}

/* Select2 Loading */
.select2-container--bootstrap4 .select2-results__option--load-more,
.select2-container--bootstrap4 .select2-results__option--loading {
  color: var(--gray-500);
  text-align: center;
}

/* ============================================
   BOOTSTRAP SELECT (selectpicker) FIX
   ============================================ */

.bootstrap-select > .dropdown-toggle {
  min-height: 42px !important;
  padding: 0.5rem 2.5rem 0.5rem 0.875rem !important;
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius) !important;
  background-color: var(--gray-50) !important;
  transition: all var(--transition);
}

.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select.show > .dropdown-toggle {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
  outline: none !important;
}

.bootstrap-select .dropdown-menu {
  border: 2px solid var(--gray-200) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-xl) !important;
  padding: 0.5rem !important;
}

.bootstrap-select .dropdown-item {
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm) !important;
  transition: all var(--transition-fast);
}

.bootstrap-select .dropdown-item:hover,
.bootstrap-select .dropdown-item.active {
  background: var(--primary) !important;
  color: #fff !important;
}

.bootstrap-select .filter-option-inner-inner {
  line-height: 1.5;
  overflow: visible !important;
}

/* ============================================
   ENHANCED FORM GROUP STYLING
   ============================================ */

/* Form Group with better spacing */
.form-group {
  margin-bottom: 1rem;
}

/* Required field indicator */
.form-group label.required::after,
label.required::after {
  content: " *";
  color: var(--danger);
  font-weight: 600;
}

/* Form help text */
.form-text,
.help-block,
small.text-muted {
  font-size: 0.75rem;
  color: var(--gray-500) !important;
  margin-top: 0.25rem;
}

/* Form validation states */
.form-control.is-valid {
  border-color: var(--success) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right calc(0.375em + 0.1875rem) center !important;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
  padding-right: calc(1.5em + 0.75rem) !important;
}

.form-control.is-invalid {
  border-color: var(--danger) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right calc(0.375em + 0.1875rem) center !important;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
  padding-right: calc(1.5em + 0.75rem) !important;
}

.form-control.is-valid:focus {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.invalid-feedback {
  color: var(--danger) !important;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.valid-feedback {
  color: var(--success) !important;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* ============================================
   ENHANCED CARD STYLING
   ============================================ */

/* Card with accent top border */
.card-accent-primary {
  border-top: 3px solid var(--primary) !important;
}

.card-accent-success {
  border-top: 3px solid var(--success) !important;
}

.card-accent-warning {
  border-top: 3px solid var(--warning) !important;
}

.card-accent-danger {
  border-top: 3px solid var(--danger) !important;
}

.card-accent-info {
  border-top: 3px solid var(--info) !important;
}

/* Card title enhancement */
.card-title {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

/* Card subtitle */
.card-subtitle {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Card footer */
.card-footer {
  background: var(--gray-50) !important;
  border-top: 1px solid var(--gray-200) !important;
  padding: 0.875rem 1.25rem;
}

/* Collapsible card animation */
.card .collapse,
.card .collapsing {
  transition: height 0.3s ease;
}

/* ============================================
   ENHANCED TABLE STYLING
   ============================================ */

/* Table with better row separation */
.table-hover tbody tr:hover {
  background-color: var(--primary-50) !important;
}

/* Table action buttons */
.table .btn-group .btn {
  padding: 0.25rem 0.5rem !important;
  font-size: 0.75rem !important;
}

/* Table status column */
.table .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

.table .status-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

/* Table compact */
.table-sm th,
.table-sm td {
  padding: 0.5rem 0.75rem !important;
}

/* Table responsive shadow indicator */
.table-responsive {
  position: relative;
}

/* ============================================
   ENHANCED BUTTON STYLING
   ============================================ */

/* Button with icon only */
.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-only i {
  margin: 0 !important;
}

/* Button loading state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 1rem;
  height: 1rem;
  top: 50%;
  left: 50%;
  margin-left: -0.5rem;
  margin-top: -0.5rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Button ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* ============================================
   ENHANCED MODAL STYLING
   ============================================ */

/* Modal animation */
.modal.fade .modal-dialog {
  transform: scale(0.95) translateY(-20px);
  transition: transform 0.3s ease;
}

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

/* Modal sizes */
.modal-sm { max-width: 400px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1140px; }
.modal-full { max-width: calc(100% - 2rem); }

/* Modal with form */
.modal-body .form-group:last-child {
  margin-bottom: 0;
}

/* ============================================
   ENHANCED SIDEBAR STYLING
   ============================================ */

/* Sidebar scroll */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

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

/* Sidebar mini badge for notifications */
.sidebar .nav-link .badge-counter {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  padding: 0.2rem 0.4rem;
}

/* ============================================
   TOASTR ENHANCEMENT
   ============================================ */

.toast-success {
  background: linear-gradient(135deg, var(--success) 0%, var(--success-dark) 100%) !important;
}

.toast-error {
  background: linear-gradient(135deg, var(--danger) 0%, var(--danger-dark) 100%) !important;
}

.toast-warning {
  background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%) !important;
}

.toast-info {
  background: linear-gradient(135deg, var(--info) 0%, var(--info-dark) 100%) !important;
}

#toast-container > div {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  opacity: 1 !important;
}

/* ============================================
   SWEETALERT2 ENHANCEMENT
   ============================================ */

.swal2-popup {
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
}

.swal2-title {
  color: var(--gray-800) !important;
  font-weight: 600 !important;
}

.swal2-confirm {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border-radius: var(--radius) !important;
  font-weight: 500 !important;
}

.swal2-cancel {
  background: var(--gray-200) !important;
  color: var(--gray-700) !important;
  border-radius: var(--radius) !important;
  font-weight: 500 !important;
}

.swal2-cancel:hover {
  background: var(--gray-300) !important;
}

/* ============================================
   LOADING & SKELETON STATES
   ============================================ */

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

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

/* Page loading overlay */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ============================================
   DATATABLE ENHANCEMENTS v2
   ============================================ */

/* DataTable responsive */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 0.75rem 0;
}

/* DataTable empty state */
.dataTables_empty {
  padding: 2rem !important;
  color: var(--gray-500);
  font-style: italic;
}

/* DataTable processing indicator */
.dataTables_processing {
  background: rgba(255, 255, 255, 0.95) !important;
  border: none !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--radius-md) !important;
  padding: 1rem 2rem !important;
  color: var(--gray-600);
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   DARK MODE READY (Future enhancement)
   ============================================ */

/*
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
  }
}
*/

/* ============================================
   TABLE ACTION BUTTONS - Unified Styling
   ============================================ */

/* Action button container */
.btn-action-group {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

/* Base action button style */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.btn-action:active {
  transform: translateY(0);
}

.btn-action i {
  font-size: 0.85rem;
}

/* View button - Blue */
.btn-action-view {
  background-color: var(--info, #06b6d4);
  color: #fff;
}

.btn-action-view:hover {
  background-color: var(--info-dark, #0891b2);
  color: #fff;
}

/* Edit button - Primary Blue */
.btn-action-edit {
  background-color: var(--primary, #2563eb);
  color: #fff;
}

.btn-action-edit:hover {
  background-color: var(--primary-dark, #1d4ed8);
  color: #fff;
}

/* Delete button - Red */
.btn-action-delete {
  background-color: var(--danger, #ef4444);
  color: #fff;
}

.btn-action-delete:hover {
  background-color: var(--danger-dark, #dc2626);
  color: #fff;
}

/* Print button - Gray */
.btn-action-print {
  background-color: var(--secondary, #64748b);
  color: #fff;
}

.btn-action-print:hover {
  background-color: var(--secondary-dark, #475569);
  color: #fff;
}

/* Approve button - Green */
.btn-action-approve {
  background-color: var(--success, #10b981);
  color: #fff;
}

.btn-action-approve:hover {
  background-color: var(--success-dark, #059669);
  color: #fff;
}

/* Reject button - Orange/Warning */
.btn-action-reject {
  background-color: var(--warning, #f59e0b);
  color: #fff;
}

.btn-action-reject:hover {
  background-color: var(--warning-dark, #d97706);
  color: #fff;
}

/* Download button - Teal */
.btn-action-download {
  background-color: #14b8a6;
  color: #fff;
}

.btn-action-download:hover {
  background-color: #0d9488;
  color: #fff;
}

/* Legacy btn-sm action buttons - Unified styling */
.table .btn-sm,
.dataTables_wrapper .btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.table .btn-sm i,
.dataTables_wrapper .btn-sm i {
  font-size: 0.85rem;
}

.table .btn-sm:hover,
.dataTables_wrapper .btn-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Icon-only buttons in tables */
.table .btn-sm i:only-child,
.dataTables_wrapper .btn-sm i:only-child {
  margin: 0;
}

/* Button with text and icon */
.table .btn-sm i + span,
.table .btn-sm span + i,
.dataTables_wrapper .btn-sm i + span,
.dataTables_wrapper .btn-sm span + i {
  margin-left: 0.25rem;
}

/* Standardize Bootstrap button colors in tables */
.table .btn-info,
.dataTables_wrapper .btn-info {
  background-color: var(--info, #06b6d4);
  border-color: var(--info, #06b6d4);
}

.table .btn-info:hover,
.dataTables_wrapper .btn-info:hover {
  background-color: var(--info-dark, #0891b2);
  border-color: var(--info-dark, #0891b2);
}

.table .btn-primary,
.dataTables_wrapper .btn-primary {
  background-color: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
}

.table .btn-primary:hover,
.dataTables_wrapper .btn-primary:hover {
  background-color: var(--primary-dark, #1d4ed8);
  border-color: var(--primary-dark, #1d4ed8);
}

.table .btn-warning,
.dataTables_wrapper .btn-warning {
  background-color: var(--warning, #f59e0b);
  border-color: var(--warning, #f59e0b);
  color: #fff;
}

.table .btn-warning:hover,
.dataTables_wrapper .btn-warning:hover {
  background-color: var(--warning-dark, #d97706);
  border-color: var(--warning-dark, #d97706);
  color: #fff;
}

.table .btn-danger,
.dataTables_wrapper .btn-danger {
  background-color: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
}

.table .btn-danger:hover,
.dataTables_wrapper .btn-danger:hover {
  background-color: var(--danger-dark, #dc2626);
  border-color: var(--danger-dark, #dc2626);
}

.table .btn-success,
.dataTables_wrapper .btn-success {
  background-color: var(--success, #10b981);
  border-color: var(--success, #10b981);
}

.table .btn-success:hover,
.dataTables_wrapper .btn-success:hover {
  background-color: var(--success-dark, #059669);
  border-color: var(--success-dark, #059669);
}

.table .btn-secondary,
.dataTables_wrapper .btn-secondary {
  background-color: var(--secondary, #64748b);
  border-color: var(--secondary, #64748b);
}

.table .btn-secondary:hover,
.dataTables_wrapper .btn-secondary:hover {
  background-color: var(--secondary-dark, #475569);
  border-color: var(--secondary-dark, #475569);
}

/* Action column in DataTables - no wrap */
.table td:last-child,
.dataTables_wrapper td:last-child {
  white-space: nowrap;
}

/* ============================================
   RESPONSIVE FIXES
   ============================================ */

@media (max-width: 992px) {
  /* Select2 on tablets */
  .select2-container--bootstrap4 .select2-selection--single,
  .select2-container--bootstrap-5 .select2-selection--single {
    min-height: 40px !important;
  }

  /* Cards stack better */
  .card {
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  /* Form controls mobile */
  .form-control,
  select.form-control {
    min-height: 44px !important; /* Touch-friendly */
  }

  /* Buttons mobile */
  .btn {
    min-height: 44px;
    padding: 0.625rem 1rem;
  }

  /* Table scroll hint */
  .table-responsive::after {
    content: '← scroll →';
    display: block;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.75rem;
    padding: 0.5rem;
  }
}

@media (max-width: 576px) {
  /* Full-width buttons on mobile */
  .btn-block-mobile {
    width: 100%;
    display: block;
  }

  /* Stack form buttons */
  .form-actions .btn {
    margin-bottom: 0.5rem;
    width: 100%;
  }

  /* Modal full screen on mobile */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
}


/* ============================================
   SIDEBAR ENHANCEMENT v2.0 - COMPACT & PROFESSIONAL
   ============================================ */

/* Modern Sidebar Background - Darker professional look */
.sidebar,
#accordionSidebar {
  background: linear-gradient(180deg, #111827 0%, #0f172a 100%) !important;
  width: 15.5rem !important;
  transition: width 0.15s ease-in-out;
  position: fixed !important;
  top: 0;
  left: 0;
  height: 100vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 1030;
}

/* Content wrapper adjustment for fixed sidebar */
#content-wrapper {
  margin-left: 15.5rem;
  transition: margin-left 0.15s ease-in-out;
}

/* When sidebar is toggled, adjust content wrapper */
body.sidebar-toggled #content-wrapper {
  margin-left: 5rem;
}

/* Collapsed sidebar width */
.sidebar.toggled,
#accordionSidebar.toggled {
  width: 5rem !important;
}

/* Sidebar Brand - More compact */
.sidebar .sidebar-brand {
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: auto;
  min-height: auto;
}

.sidebar .sidebar-brand-icon img {
  max-height: 28px !important;
  filter: brightness(1.1);
}

.sidebar .sidebar-brand-text {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.3px;
  color: #fff;
}

/* Section Headings - Cleaner look */
.sidebar .sidebar-heading {
  color: rgba(148, 163, 184, 0.7) !important;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.625rem 1rem 0.375rem;
  margin: 0;
}

/* Sidebar Divider - Minimal */
.sidebar .sidebar-divider,
.sidebar hr.sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  margin: 0.375rem 0.75rem;
}

/* Nav Items - Compact spacing */
.sidebar .nav-item {
  margin-bottom: 1px;
}

.sidebar .nav-item .nav-link {
  padding: 0.55rem 0.875rem;
  margin: 0 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
  color: rgba(203, 213, 225, 0.9) !important;
  font-size: 0.85rem;
  font-weight: 400;
  display: flex;
  align-items: center;
}

.sidebar .nav-item .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
  transform: none;
}

.sidebar .nav-item .nav-link.active,
.sidebar .nav-item.active > .nav-link,
.sidebar .nav-item .nav-link[aria-expanded="true"] {
  background: rgba(37, 99, 235, 0.9) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  font-weight: 500;
}

/* Nav Link Icons - Compact */
.sidebar .nav-item .nav-link i {
  width: 1.125rem;
  text-align: center;
  margin-right: 0.625rem;
  font-size: 0.875rem;
  opacity: 0.85;
  transition: none;
}

.sidebar .nav-item .nav-link:hover i,
.sidebar .nav-item .nav-link.active i {
  opacity: 1;
  transform: none;
}

/* Collapse Arrow */
.sidebar .nav-item .nav-link[data-toggle="collapse"]::after {
  font-family: "Font Awesome 5 Free";
  content: "\f107";
  font-weight: 900;
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.15s ease;
  opacity: 0.6;
}

.sidebar .nav-item .nav-link[aria-expanded="true"]::after {
  transform: rotate(180deg);
  opacity: 1;
}

/* Collapse Menu - Compact dropdown */
.sidebar .collapse-inner {
  background: #1e293b !important;
  border-radius: 0.375rem !important;
  padding: 0.375rem !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0.25rem 0.5rem 0.5rem;
}

.sidebar .collapse-inner .collapse-header {
  display: none; /* Hide headers for cleaner look */
}

.sidebar .collapse-inner .collapse-item {
  padding: 0.4rem 0.75rem;
  border-radius: 0.25rem;
  color: rgba(203, 213, 225, 0.85) !important;
  font-size: 0.8rem;
  font-weight: 400;
  transition: all 0.12s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar .collapse-inner .collapse-item:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.sidebar .collapse-inner .collapse-item.active {
  background: rgba(37, 99, 235, 0.25) !important;
  color: #60a5fa !important;
  font-weight: 500;
}

/* Toggled sidebar - Compact icons */
.sidebar.toggled {
  width: 5rem !important;
  overflow: visible !important;
  padding: 0 !important;
}

.sidebar.toggled .nav-item {
  padding: 0 0.5rem;
}

.sidebar.toggled .nav-item .nav-link {
  margin: 0.15rem 0;
  padding: 0.65rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  width: 100%;
}

.sidebar.toggled .nav-item .nav-link i {
  margin: 0;
  font-size: 1.1rem;
  width: auto;
}

.sidebar.toggled .nav-item .nav-link span {
  display: none;
}

.sidebar.toggled .nav-item .nav-link::after {
  display: none;
}

.sidebar.toggled .sidebar-heading {
  display: none;
}

.sidebar.toggled .sidebar-brand {
  padding: 0.75rem 0.5rem;
  display: flex;
  justify-content: center;
}

.sidebar.toggled .sidebar-brand-text {
  display: none;
}

.sidebar.toggled .sidebar-brand-icon {
  margin: 0;
  display: flex;
  justify-content: center;
}

.sidebar.toggled .sidebar-brand-icon img {
  max-height: 28px !important;
}

.sidebar.toggled hr.sidebar-divider {
  margin: 0.5rem;
}

/* Toggled sidebar - Flyout submenus */
.sidebar.toggled .collapse-inner {
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 0;
  margin: 0;
  min-width: 13rem;
  z-index: 1050;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

.sidebar.toggled .nav-item .collapse {
  position: absolute;
  left: 100%;
  top: 0;
  z-index: 1050;
}

/* Sidebar Toggle Container - Fixed at top-right of sidebar */
.sidebar-toggle-container {
  position: fixed;
  top: 0.25rem;
  left: 14.25rem;
  z-index: 1040;
}

/* When sidebar is toggled (collapsed) - using body class */
body.sidebar-toggled .sidebar-toggle-container {
  left: 3.85rem;
}

/* Sidebar Toggle Button */
.btn-sidebar-toggle,
#sidebarToggle {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.45);
  cursor: pointer;
  color: #fff;
  font-size: 0.95rem;
}

.btn-sidebar-toggle:hover,
#sidebarToggle:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.55);
}

.btn-sidebar-toggle:focus,
#sidebarToggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35), 0 4px 15px rgba(59, 130, 246, 0.45);
}

/* Rotate icon when sidebar is toggled */
body.sidebar-toggled .sidebar-toggle-container .btn-sidebar-toggle i {
  transform: rotate(180deg);
}

.btn-sidebar-toggle i {
  transition: transform 0.2s ease;
}

/* Collapsed toggle button size */
body.sidebar-toggled .sidebar-toggle-container .btn-sidebar-toggle {
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.85rem;
}


/* Collapsed sidebar - Better icon highlight */
.sidebar.toggled .nav-item .nav-link:hover {
  background: rgba(59, 130, 246, 0.2) !important;
}

.sidebar.toggled .nav-item.active .nav-link,
.sidebar.toggled .nav-item .nav-link[aria-expanded="true"] {
  background: rgba(59, 130, 246, 0.25) !important;
}

/* Collapsed sidebar - Submenu styling */
.sidebar.toggled .collapse-inner .collapse-item {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: 4px;
  margin: 0.15rem 0.5rem;
}

.sidebar.toggled .collapse-inner .collapse-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar.toggled .collapse-inner .collapse-item.active {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

/* Custom scrollbar for sidebar */
.sidebar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .sidebar,
  #accordionSidebar {
    position: fixed !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.toggled,
  #accordionSidebar.toggled {
    transform: translateX(0);
    width: 15.5rem !important;
  }

  #content-wrapper {
    margin-left: 0 !important;
  }

  .sidebar .nav-item .nav-link {
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
  }

  .sidebar .collapse-inner .collapse-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* ============================================
   PAGE HEADER COMPONENT - GLOBAL STYLES
   ============================================ */

/* Main Page Header Container */
.page-header {
  background: linear-gradient(135deg, #fff 0%, #f8f9fc 100%);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.page-header h1 {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
  display: flex;
  align-items: center;
}

.page-header h1 i {
  font-size: 1.1rem;
}

/* Page Header Right Section */
.page-header-right {
  gap: 0.75rem;
}

.page-header-actions .btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* DateTime Display */
.datetime-display {
  gap: 0.5rem;
}

.date-box,
.time-box {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 500;
}

.date-box i {
  color: var(--success, #1cc88a);
  font-size: 0.7rem;
}

.time-box {
  background: linear-gradient(135deg, var(--success, #1cc88a) 0%, var(--success-dark, #17a673) 100%);
  color: #fff;
  border: none;
  min-width: 95px;
  justify-content: center;
}

.time-box i {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.7rem;
}

.time-box .display-time {
  font-family: 'Courier New', 'SF Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Responsive adjustments for page header */
@media (max-width: 768px) {
  .page-header {
    padding: 0.5rem 0.75rem;
  }

  .page-header h1 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .datetime-display {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .date-box,
  .time-box {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .time-box {
    min-width: 85px;
  }
}

@media (max-width: 576px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  .page-header-right {
    width: 100%;
    justify-content: space-between;
  }
}
