/* Base Styles */
body { 
  font-size: 0.95rem; 
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
}

/* Layout */
.sidebar { 
  border-right: 1px solid #e5e5e5; 
  background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
  transition: all 0.2s ease;
}

/* Typography */
.card-title { 
  font-weight: 600; 
  margin-bottom: 0.5rem;
}

.text-gray-800 {
  color: #5a5c69 !important;
}

/* Gradient Cards */
.gradient-card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.gradient-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.25);
}

.gradient-primary {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
}

.gradient-success {
  background: linear-gradient(135deg, #1cc88a 0%, #17a673 100%) !important;
}

.gradient-info {
  background: linear-gradient(135deg, #36b9cc 0%, #2c9faf 100%) !important;
}

.gradient-warning {
  background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%) !important;
}

.gradient-danger {
  background: linear-gradient(135deg, #e74a3b 0%, #be2617 100%) !important;
}

.gradient-secondary {
  background: linear-gradient(135deg, #858796 0%, #60616f 100%) !important;
}

/* Icon Containers */
.icon-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

/* Modern Cards */
.card {
  border: none;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
  border-bottom: 1px solid #e3e6f0;
  padding: 1.25rem 1.5rem 1rem;
}

.card-body {
  padding: 1.5rem;
}

/* Progress Bars */
.progress {
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  border-radius: 10px;
  transition: width 0.6s ease;
}

/* Badges */
.badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

/* Buttons */
.btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  padding: 0.5rem 1rem;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
}

.btn-success {
  background: linear-gradient(135deg, #1cc88a 0%, #17a673 100%);
}

.btn-outline-primary {
  color: #4e73df;
  border-color: #4e73df;
  background: transparent;
}

.btn-outline-primary:hover {
  background: #4e73df;
  border-color: #4e73df;
  color: white;
}

/* Quick Actions */
.quick-actions .btn {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
}

/* List Groups */
.list-group-item {
  border: none;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e3e6f0;
  transition: background-color 0.2s ease;
}

.list-group-item:hover {
  background-color: #f8f9fc;
}

.list-group-item:last-child {
  border-bottom: none;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.card {
  animation: fadeInUp 0.5s ease-out;
}

/* Shadow utilities */
.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .quick-actions {
    margin-top: 1rem;
  }
  
  .quick-actions .btn {
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .icon-container {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .gradient-card .card-body {
    padding: 1rem;
  }
}

/* Chart and Analytics Styles */
.analytics-card {
  position: relative;
  overflow: hidden;
}

.analytics-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4e73df, #1cc88a, #36b9cc, #f6c23e);
}

/* Status Indicators */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.5rem;
}

.status-paid { background-color: #1cc88a; }
.status-pending { background-color: #f6c23e; }
.status-refunded { background-color: #e74a3b; }
.status-unknown { background-color: #858796; }

/* Hover Effects */
.hover-lift:hover {
  transform: translateY(-2px);
  transition: all 0.2s ease;
}

/* Text colors */
.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Loading states */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Navbar enhancements */
.navbar-brand {
  font-weight: 600;
  font-size: 1.25rem;
}

.nav-link {
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #e9ecef !important;
}

/* Sidebar enhancements */
.sidebar .nav-link {
  color: #5a5c69;
  padding: 0.75rem 1rem;
  margin: 0.125rem 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: #e3e6f0;
  color: #4e73df;
}

.sidebar .nav-link.active {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  color: white;
}

/* Collapsible Sidebar */
body.sidebar-collapsed .sidebar {
  display: none !important;
}

main {
  transition: all 0.25s ease;
}

body.sidebar-collapsed main {
  flex: 0 0 100% !important;
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0 !important;
}

/* Date Range Picker Styles */
.date-range-form {
  background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f6 100%);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid #e3e6f0;
}

.date-range-form .form-label {
  font-weight: 600;
  color: #5a5c69;
  margin-bottom: 0.5rem;
}

.date-range-form .form-select,
.date-range-form .form-control {
  border: 2px solid #e3e6f0;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
  background-color: white;
}

.date-range-form .form-select:focus,
.date-range-form .form-control:focus {
  border-color: #4e73df;
  box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
  background-color: white;
}

.date-range-form .btn-group-sm .btn {
  margin: 0.125rem;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.date-range-form .btn-group-sm .btn.active {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  border-color: #4e73df;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(78, 115, 223, 0.3);
}

.date-range-form .btn-group-sm .btn:hover:not(.active) {
  background-color: #e3e6f0;
  border-color: #4e73df;
  color: #4e73df;
  transform: translateY(-1px);
}

/* Smooth transitions for custom date fields */
#customStartDate,
#customEndDate {
  transition: all 0.3s ease;
  overflow: hidden;
}

#customStartDate[style*="display: none"],
#customEndDate[style*="display: none"] {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

#customStartDate:not([style*="display: none"]),
#customEndDate:not([style*="display: none"]) {
  max-height: 100px;
  opacity: 1;
}

/* Form validation styles */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #e74a3b;
  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='%23e74a3b'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4M7.2 4.6l-1.4 1.4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid,
.form-select.is-valid {
  border-color: #1cc88a;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%231cc88a' d='m2.3 6.73.94-.94 2.94-2.94-1.41-1.41-1.53 1.53-.94-.94-1.41 1.41z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Loading states for date range */
.date-range-loading {
  position: relative;
  overflow: hidden;
}

.date-range-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(78, 115, 223, 0.2), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  100% {
    left: 100%;
  }
}

/* Date range info badge */
.date-range-info {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
}

/* Responsive improvements for date range */
@media (max-width: 768px) {
  .date-range-form .row {
    flex-direction: column;
  }
  
  .date-range-form .col-md-3 {
    margin-bottom: 1rem;
  }
  
  .date-range-form .btn-group-sm {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .date-range-form .btn-group-sm .btn {
    flex: 1;
    min-width: calc(50% - 0.125rem);
  }
}

/* Dashboard to Orders Integration */
.hover-link {
  transition: all 0.2s ease;
  position: relative;
}

.hover-link:hover {
  color: #4e73df !important;
  text-decoration: none !important;
  transform: translateX(2px);
}

.hover-link:hover .fas {
  opacity: 1;
  transform: translateX(2px);
}

.hover-link .fas {
  opacity: 0.6;
  transition: all 0.2s ease;
}

/* DataTables Customization */
.dataTables_wrapper {
  font-family: inherit;
}

.dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_filter input {
  border: 2px solid #e3e6f0;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
}

.dataTables_length select {
  border: 2px solid #e3e6f0;
  border-radius: 8px;
  padding: 0.375rem 0.75rem;
  margin: 0 0.5rem;
}

.dataTables_info {
  color: #6c757d;
  font-size: 0.9rem;
}

.dataTables_paginate .paginate_button {
  border-radius: 6px;
  margin: 0 2px;
}

.dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  border-color: #4e73df;
  color: white !important;
}

.dataTables_paginate .paginate_button:hover {
  background: #e3e6f0;
  border-color: #4e73df;
  color: #4e73df !important;
}

/* Orders Table Styling */
#ordersTable {
  border-radius: 8px;
  overflow: hidden;
}

#ordersTable thead th {
  background: linear-gradient(135deg, #6c757d 0%, #5a6169 100%);
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 1rem 0.75rem;
}

#ordersTable tbody tr {
  transition: all 0.2s ease;
}

#ordersTable tbody tr:hover {
  background-color: #f8f9fc;
  transform: translateY(-1px);
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

#ordersTable tbody td {
  vertical-align: middle;
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid #e3e6f0;
}

/* Badge enhancements for orders table */
.badge {
  font-size: 0.75rem;
  padding: 0.4em 0.8em;
  border-radius: 12px;
  font-weight: 500;
}

/* Orders actions styling */
.orders-actions .btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.orders-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* Export button dropdown styling */
.dt-buttons {
  margin-bottom: 1rem;
}

.dt-buttons .btn {
  margin: 0 0.25rem 0.5rem 0;
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
}

/* Responsive table improvements */
@media (max-width: 768px) {
  #ordersTable {
    font-size: 0.85rem;
  }
  
  #ordersTable td {
    padding: 0.5rem 0.375rem;
  }
  
  .orders-actions {
    margin-top: 1rem;
  }
  
  .orders-actions .btn {
    width: 100%;
    margin: 0.25rem 0;
  }
}

/* Filter section enhancements */
.filter-section {
  background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f6 100%);
  border-radius: 12px;
  border: 1px solid #e3e6f0;
}

/* Active filters styling */
.active-filters .badge {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  color: white;
  padding: 0.5rem 0.75rem;
  margin: 0.125rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.active-filters .badge a {
  color: white;
  text-decoration: none;
  margin-left: 0.25rem;
}

.active-filters .badge a:hover {
  color: #ffc107;
}

/* ==========================================
   Creative Library Styles
   ========================================== */

/* Creative Card Grid */
.creative-card {
  transition: all 0.3s ease;
  overflow: hidden;
  border-radius: 12px;
}

.creative-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.15) !important;
}

.creative-thumbnail {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.creative-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.creative-card:hover .creative-thumbnail img {
  transform: scale(1.05);
}

.video-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.9);
  opacity: 0.8;
  transition: all 0.3s ease;
}

.creative-card:hover .video-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.video-placeholder,
.carousel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: rgba(255,255,255,0.6);
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.slide-count {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: white;
}

.type-badge.type-video { background: linear-gradient(135deg, #36b9cc, #2c9faf); }
.type-badge.type-static { background: linear-gradient(135deg, #1cc88a, #17a673); }
.type-badge.type-carousel { background: linear-gradient(135deg, #f6c23e, #dda20a); }

.status-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-active { background: #1cc88a; color: white; }
.status-badge.status-draft { background: #858796; color: white; }
.status-badge.status-archived { background: #5a5c69; color: white; }

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
}

.creative-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.creative-tag-more {
  font-size: 0.65rem;
  padding: 2px 6px;
  background: #e3e6f0;
  border-radius: 4px;
  color: #5a5c69;
}

.rating-stars {
  font-size: 0.75rem;
}

.creative-meta {
  font-size: 0.75rem;
}

/* List View Styles */
.list-thumbnail {
  width: 60px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.list-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
}

/* Upload Zone */
.upload-zone {
  position: relative;
  border: 2px dashed #dee2e6;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: #f8f9fc;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: #4e73df;
  background: #eef2ff;
}

.upload-zone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone-small {
  min-height: 150px;
  padding: 1rem;
}

.upload-placeholder {
  pointer-events: none;
}

.upload-preview {
  position: relative;
  width: 100%;
  max-height: 300px;
}

.preview-image,
.preview-video {
  max-width: 100%;
  max-height: 250px;
  border-radius: 8px;
  object-fit: contain;
}

/* Hook Card Styles */
.hook-card {
  transition: all 0.3s ease;
}

.hook-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.15) !important;
}

.hook-text {
  font-size: 1.1rem;
  line-height: 1.6;
  font-style: italic;
}

/* Creative Preview */
.creative-preview-container {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.creative-preview-video {
  max-width: 100%;
  max-height: 500px;
}

.creative-preview-image {
  max-width: 100%;
  max-height: 500px;
  object-fit: contain;
}

.hook-display {
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.6;
}

/* Rating Input */
.rating-input {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-star {
  font-size: 1.5rem;
  cursor: pointer;
  color: #dee2e6;
  transition: all 0.2s ease;
}

.rating-star:hover,
.rating-star.active {
  color: #f6c23e;
  transform: scale(1.1);
}

/* Platforms Grid */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.platform-checkbox .btn {
  padding: 0.5rem;
  font-size: 0.875rem;
}

.platform-checkbox .btn-check:checked + .btn {
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  border-color: #4e73df;
  color: white;
}

.platform-checkbox .btn-check:checked + .btn i {
  color: white !important;
}

/* Tags Selection */
.tags-selection {
  max-height: 250px;
  overflow-y: auto;
}

.tag-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

/* Responsive Creative Grid */
@media (max-width: 768px) {
  .creative-thumbnail {
    height: 140px;
  }
  
  .creative-card .card-body {
    padding: 0.5rem;
  }
}

/* ==========================================
   User Management Styles
   ========================================== */

/* User avatar circle */
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
}

/* Role badges */
.badge-role-admin {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.badge-role-basic {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

/* Permission checkbox styling */
.permission-check {
  transition: all 0.2s ease;
}

.permission-check:hover {
  background-color: #f8f9fc;
}

.permission-check.selected {
  background-color: #e8f4ff;
  border-color: #4e73df;
}

/* Administration section header */
.sidebar .nav-item small.text-muted {
  font-size: 0.65rem;
  letter-spacing: 0.5px;
  display: block;
  padding: 0.5rem 0;
}

/* User table row hover */
.table tbody tr:hover {
  background-color: #f8f9fc;
}

/* Form switch styling */
.form-check.form-switch {
  padding-left: 2.5em;
}

.form-check-input:checked {
  background-color: #4e73df;
  border-color: #4e73df;
}

/* Danger zone styling */
.card.border-danger .card-header.bg-danger {
  border-bottom: none;
}

/* Input group addon */
.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* User management specific */
.users-table .btn-group-sm .btn {
  padding: 0.25rem 0.5rem;
}

/* Role permission grid */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

/* Code elements */
code {
  background-color: #f8f9fa;
  padding: 0.125rem 0.25rem;
  border-radius: 4px;
  font-size: 0.875em;
}

/* ==========================================
   Column Toggle Component Styles
   ========================================== */

/* Column Toggle Button */
.btn-column-toggle {
  position: relative;
  z-index: 1045; /* Higher than overlay (1040) so button remains clickable */
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-column-toggle:hover {
  background: linear-gradient(135deg, #5a6268 0%, #3d4349 100%);
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
  color: white;
}

.btn-column-toggle .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
  font-size: 0.65rem;
  padding: 0.25em 0.5em;
  min-width: 18px;
}

/* Column Toggle Dropdown */
.column-toggle-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1050;
  min-width: 300px;
  max-width: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
  border: 1px solid #e3e6f0;
  margin-top: 0.25rem;
}

/* Ensure hidden attribute works - browsers support this natively but add fallback */
/* Note: When showing, JS removes hidden BEFORE adding show class */
/* When hiding, JS adds hidden AND removes show class */
.column-toggle-dropdown[hidden]:not(.show),
.column-toggle-overlay[hidden]:not(.show) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.column-toggle-dropdown.show {
  display: block !important;
  visibility: visible;
  opacity: 1;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dropdown Header */
.column-toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e3e6f0;
  background: linear-gradient(135deg, #f8f9fc 0%, #e9ecef 100%);
  border-radius: 12px 12px 0 0;
}

.column-toggle-header h6 {
  margin: 0;
  font-weight: 600;
  color: #5a5c69;
}

.column-toggle-header .btn-group-sm .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Column List */
.column-toggle-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
}

.column-toggle-list::-webkit-scrollbar {
  width: 6px;
}

.column-toggle-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.column-toggle-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.column-toggle-list::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Column Toggle Item */
.column-toggle-item {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.75rem;
  margin: 0.125rem 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  border: 1px solid transparent;
}

.column-toggle-item:hover {
  background-color: #f8f9fc;
  border-color: #e3e6f0;
}

.column-toggle-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.column-toggle-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: #4e73df;
  flex-shrink: 0;
}

.column-toggle-item label {
  margin: 0;
  cursor: pointer;
  font-size: 0.875rem;
  color: #495057;
  flex-grow: 1;
}

.column-toggle-item.checked {
  background-color: #eef2ff;
  border-color: #4e73df;
}

.column-toggle-item.checked label {
  color: #4e73df;
  font-weight: 500;
}

/* Dropdown Footer */
.column-toggle-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e3e6f0;
  background: linear-gradient(135deg, #f8f9fc 0%, #fff 100%);
  border-radius: 0 0 12px 12px;
}

.column-toggle-footer .text-muted {
  font-size: 0.75rem;
}

.column-toggle-footer .btn {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
}

/* Save Status Indicator */
.column-save-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
}

.column-save-status.saving {
  background: #fff3cd;
  color: #856404;
}

.column-save-status.saved {
  background: #d4edda;
  color: #155724;
}

.column-save-status.error {
  background: #f8d7da;
  color: #721c24;
}

/* Column Toggle Container (wrapper for positioning) */
.column-toggle-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Overlay for closing dropdown */
.column-toggle-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: transparent;
}

.column-toggle-overlay.show {
  display: block;
}

/* Hidden state handled by [hidden] attribute selector above */

/* Responsive adjustments */
@media (max-width: 576px) {
  .column-toggle-dropdown {
    min-width: 280px;
    max-width: calc(100vw - 2rem);
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .column-toggle-dropdown.show {
    position: fixed;
    top: auto;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
    max-height: 70vh;
  }
  
  .column-toggle-list {
    max-height: 50vh;
  }
}

/* Hidden column styling for DataTables */
table th.column-hidden,
table td.column-hidden {
  display: none !important;
}


