* {
  font-family: 'Bai Jamjuree', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf6 100%);
  min-height: 100vh;
  padding-top: 150px; /* เพิ่มพื้นที่สำหรับ header และ tabs ที่ตรึง */
}

.purple-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  color: white;
  padding: 20px 40px;
  margin: 0;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  overflow: hidden;
}

.purple-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.purple-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.purple-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.purple-header small {
  font-size: 16px;
  opacity: 0.95;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

.nav-tabs {
  background: white;
  margin: 0;
  border-bottom: none;
  padding: 0 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  position: fixed;
  top: 95px;
  left: 0;
  right: 0;
  z-index: 999;
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.nav-tabs::-webkit-scrollbar {
  height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.nav-tabs::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.nav-tabs .nav-item {
  flex-shrink: 0;
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 0;
  background: transparent;
  color: #475569;
  padding: 14px 16px 10px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 4px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.nav-tabs .nav-link i {
  font-size: 16px;
  margin-right: 6px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.nav-tabs .nav-link:hover {
  background: linear-gradient(to bottom, rgba(102, 126, 234, 0.08), transparent);
  color: #667eea;
  transform: translateY(-2px);
}

.nav-tabs .nav-link:hover i {
  transform: scale(1.2) rotate(5deg);
}

.nav-tabs .nav-link.active {
  background: linear-gradient(to bottom, rgba(102, 126, 234, 0.15), rgba(102, 126, 234, 0.05));
  color: #667eea;
  border-bottom: 4px solid #667eea;
  font-weight: 800;
  font-size: 14px;
}

.nav-tabs .nav-link.active i {
  transform: scale(1.15);
}

.tab-content {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 0;
}

.summary-section {
  background: white;
  margin: 25px 30px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-section:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.summary-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 25px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.summary-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.summary-table th {
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  color: white;
  text-align: center;
  font-weight: 700;
  padding: 14px 10px;
  border: 1px solid #7c3aed;
  font-size: 15px;
  letter-spacing: 0.3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.summary-table td {
  text-align: center;
  vertical-align: middle;
  padding: 12px 10px;
  border: 1px solid #e2e8f0;
  background: white;
  font-size: 17px;
  font-weight: 700;
  color: #1e40af;
  transition: all 0.2s ease;
}

.summary-table .row-number {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 800;
  color: #475569;
  font-size: 18px;
}

.summary-table .department-name {
  text-align: left;
  padding-left: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  font-weight: 700;
  color: #1e293b;
  font-size: 16px;
}

.summary-table tbody tr:hover {
  background-color: #faf5ff;
}

.summary-table tbody tr:hover .row-number,
.summary-table tbody tr:hover .department-name {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #6b21a8;
}

.clickable-cell {
  cursor: pointer;
  transition: all 0.2s ease;
}

.clickable-cell:hover {
  background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%) !important;
  color: #6b21a8 !important;
  font-weight: 800;
  transform: scale(1.08);
  box-shadow: inset 0 0 10px rgba(107, 33, 168, 0.2);
}

.clickable-cell:not(:empty) {
  color: #7c3aed;
  font-weight: 800;
  font-size: 18px;
  text-shadow: 0 1px 2px rgba(124, 58, 237, 0.2);
}

/* Notification Badge Animation */
.notification-badge {
  animation: pulse 2s infinite;
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
  font-weight: 700;
  border: 2px solid white;
}

@keyframes pulse {
  0%, 100% {
    transform: translate(-50%, 0) scale(1);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
  }
  50% {
    transform: translate(-50%, 0) scale(1.15);
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.9);
  }
}

/* Notification Popup on Tab Menu */
.notification-popup {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 3px solid #f59e0b;
  border-radius: 16px;
  padding: 20px;
  min-width: 320px;
  box-shadow: 0 12px 32px rgba(245, 158, 11, 0.4);
  z-index: 10000;
  animation: popupSlideDown 0.3s ease-out;
}

.notification-popup::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #f59e0b;
}

.notification-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #fbbf24;
}

.notification-popup-header i {
  font-size: 20px;
  color: #f59e0b;
  animation: bellRing 1s ease-in-out infinite;
}

.notification-popup-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.notification-popup-count {
  text-align: center;
  background: white;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.notification-popup-count span {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: #dc2626;
  line-height: 1;
  margin-bottom: 5px;
}

.notification-popup-count small {
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
}

.notification-popup-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.popup-type-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 10px 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 600;
}

.popup-type-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.popup-type-item span {
  flex: 1;
}

.popup-type-item strong {
  font-size: 18px;
  font-weight: 800;
  min-width: 30px;
  text-align: right;
}

.popup-edit {
  color: #d97706;
  border-left: 4px solid #fbbf24;
}

.popup-cancel {
  color: #dc2626;
  border-left: 4px solid #fca5a5;
}

.popup-destroy {
  color: #1f2937;
  border-left: 4px solid #9ca3af;
}

@keyframes popupSlideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes bellRing {
  0%, 100% {
    transform: rotate(0deg);
  }
  10%, 30% {
    transform: rotate(-10deg);
  }
  20%, 40% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(0deg);
  }
}

/* Button improvements */
.btn {
  transition: all 0.3s ease;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 8px;
  padding: 10px 20px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

/* Table improvements */
.table {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table thead th {
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 14px;
}

.table tbody td {
  font-weight: 500;
}

/* Form improvements */
.form-control, .form-select {
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  padding: 10px 15px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

/* Badge improvements */
.badge {
  font-weight: 600;
  padding: 6px 12px;
  font-size: 13px;
  letter-spacing: 0.3px;
}

/* Card improvements */
.card {
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

/* Modal positioning and sizing */
.modal {
  overflow: visible !important;
}

.modal-dialog {
  z-index: 1050;
  margin: 1.75rem auto;
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100vh - 3.5rem);
}

.modal-content {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  border: none;
  margin: auto;
}

/* Custom modal sizes */
.modal-custom-height .modal-dialog {
  max-width: 90%;
  width: 90%;
  height: auto;
  min-height: 70vh;
  max-height: 90vh;
  overflow: visible;
}

.modal-custom-height .modal-content {
  height: 100%;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.modal-custom-height .modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  position: relative;
  max-height: calc(90vh - 120px);
}

/* Extra large modal */
.modal-xl {
  max-width: 95%;
  width: 95%;
}

/* Large modal */
.modal-lg {
  max-width: 80%;
  width: 80%;
}

/* Medium modal */
.modal-md {
  max-width: 60%;
  width: 60%;
}

/* Small modal */
.modal-sm {
  max-width: 40%;
  width: 40%;
}

/* Prevent modal from clipping dropdowns */
.modal-backdrop {
  z-index: 1040;
}

/* Center modal animation */
.modal.fade .modal-dialog {
  transform: translateY(-50px);
  transition: transform 0.3s ease-out;
}

.modal.show .modal-dialog {
  transform: translateY(0);
}

/* Fix dropdown z-index in modal and tables */
.modal .dropdown-menu {
  z-index: 9999 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
  border: 2px solid #e2e8f0;
  position: fixed !important;
}

.dropdown-menu {
  z-index: 9999 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px;
  min-width: 200px;
  position: absolute !important;
}

.dropdown-item {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.dropdown-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateX(4px);
}

.dropdown-item i {
  margin-right: 8px;
  font-size: 16px;
}

.modal .btn-group {
  position: static;
}

.btn-group {
  position: static;
}

.modal .table-responsive {
  overflow: visible !important;
}

.table-responsive {
  overflow: visible !important;
}

/* Ensure modal content allows dropdowns */
.modal-body {
  overflow: visible !important;
}

.modal-content {
  overflow: visible !important;
}

.modal-dialog {
  overflow: visible !important;
}

/* Make sure table cells don't clip dropdowns */
table {
  overflow: visible !important;
}

tbody, thead, tr, td, th {
  overflow: visible !important;
}

/* Responsive modal sizing */
@media (max-width: 1200px) {
  .modal-xl {
    max-width: 98%;
    width: 98%;
  }
  
  .modal-lg {
    max-width: 90%;
    width: 90%;
  }
}

@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem;
    min-height: calc(100vh - 1rem);
  }
  
  .modal-xl,
  .modal-lg,
  .modal-md {
    max-width: 95%;
    width: 95%;
  }
  
  .modal-custom-height .modal-dialog {
    max-width: 95%;
    width: 95%;
    min-height: 80vh;
    max-height: 95vh;
  }
  
  .modal-custom-height .modal-body {
    max-height: calc(95vh - 120px);
  }
}

@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.25rem;
    min-height: calc(100vh - 0.5rem);
  }
  
  .modal-xl,
  .modal-lg,
  .modal-md,
  .modal-sm {
    max-width: 98%;
    width: 98%;
  }
  
  .modal-custom-height .modal-dialog {
    max-width: 98%;
    width: 98%;
    min-height: 85vh;
    max-height: 98vh;
  }
  
  .modal-custom-height .modal-body {
    max-height: calc(98vh - 120px);
  }
}

/* Modal header improvements */
.modal-header {
  border-bottom: 2px solid #e2e8f0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.modal-header.bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white;
}

.modal-header.bg-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important;
  color: white;
}

.modal-header.bg-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: white;
}

.modal-header.bg-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: white;
}

.modal-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.3px;
}

/* Modal footer improvements */
.modal-footer {
  border-top: 2px solid #e2e8f0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Modal body improvements */
.modal-body {
  padding: 1.5rem;
}

/* Tab styling in modals */
.modal .nav-tabs {
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1rem;
  position: static;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.modal .nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #64748b;
  font-weight: 600;
  padding: 12px 20px;
  transition: all 0.3s ease;
}

.modal .nav-tabs .nav-link:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-bottom-color: #667eea;
}

.modal .nav-tabs .nav-link.active {
  background: rgba(102, 126, 234, 0.15);
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 700;
}

/* Table styling in modals */
.modal .table {
  margin-bottom: 0;
}

.modal .table thead th {
  border-top: none;
  font-weight: 700;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  color: #475569;
}

.modal .table-primary thead th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: white;
}

.modal .table-secondary thead th {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important;
  color: white;
}
/* Animation for refresh button */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Filter result counter styling */
.filter-result-counter,
.history-filter-result-counter {
  border-left: 4px solid #0dcaf0;
  background-color: #e7f3ff;
}

/* Improved filter card styling */
.card-header h6 {
  color: #495057;
  font-weight: 600;
}

/* Better spacing for filter controls */
.card-body .row .col-md-2,
.card-body .row .col-md-3,
.card-body .row .col-md-4 {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .card-body .row .col-md-2,
  .card-body .row .col-md-3,
  .card-body .row .col-md-4 {
    margin-bottom: 0.5rem;
  }
}
/* CAR Type Dropdown Styling */
#carType option {
  padding: 8px 12px;
  font-weight: 500;
}

#carType option[value="NCR"] {
  background-color: #f8d7da;
  color: #721c24;
}

#carType option[value="OB"] {
  background-color: #d1ecf1;
  color: #0c5460;
}

#carType option[value="Minor"] {
  background-color: #fff3cd;
  color: #856404;
}

#carType option[value="Major"] {
  background-color: #f8d7da;
  color: #721c24;
}

/* Enhanced CAR Type Badges */
.badge i {
  margin-right: 4px;
}

/* CAR Statistics Cards Enhancement */
.card.bg-warning .card-body h3,
.card.bg-danger .card-body h3,
.card.bg-info .card-body h3,
.card.bg-success .card-body h3 {
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* CAR Form Enhancement */
.border.p-3.rounded {
  border: 2px solid #e9ecef !important;
  border-radius: 10px !important;
  background-color: #f8f9fa;
}

.border.p-3.rounded:hover {
  border-color: #ffc107 !important;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
  transition: all 0.3s ease;
}

/* CAR Table Enhancement */
.table-warning th {
  background-color: #ffc107 !important;
  color: #000 !important;
  font-weight: 600;
  text-align: center;
  border: 1px solid #ffb300 !important;
}

.table-bordered td {
  vertical-align: middle;
  text-align: center;
}

.table-bordered td:nth-child(4) {
  text-align: left;
  max-width: 200px;
  word-wrap: break-word;
}

/* Button Group Enhancement */
.btn-group .btn {
  margin: 0 1px;
}

.btn-group .btn:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease;
}
/* Enhanced Modal Styling */
.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

.modal-content {
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  border: none;
}

.modal-header {
  border-radius: 15px 15px 0 0;
  border-bottom: 2px solid rgba(255,255,255,0.2);
}

.modal-footer {
  border-radius: 0 0 15px 15px;
  border-top: 1px solid #dee2e6;
}

.modal-body .card {
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-body .card-header {
  border-radius: 10px 10px 0 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.modal-body .card-body {
  font-size: 0.85rem;
}

.modal-body .row {
  margin-bottom: 0.5rem;
}

.modal-body .row:last-child {
  margin-bottom: 0;
}

/* Alert styling in modal */
.modal-body .alert {
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border-radius: 8px;
}

.modal-body .alert-warning {
  background-color: #fff3cd;
  border-color: #ffeaa7;
  color: #856404;
}

.modal-body .alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

/* Badge enhancements in modal */
.modal-body .badge {
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
}

/* Button enhancements */
.modal-footer .btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.modal-footer .btn i {
  margin-right: 0.5rem;
}

/* Toast notification */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-body .col-5,
  .modal-body .col-7 {
    font-size: 0.8rem;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-footer .d-flex {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Icon spacing in modal */
.modal-body i {
  margin-right: 0.5rem;
  width: 16px;
  text-align: center;
}

/* Card header icons */
.card-header i {
  margin-right: 0.5rem;
}

/* Status badge colors */
.badge.bg-light {
  color: #495057 !important;
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6;
}
/* CAR Registry Table Styling */
#carRegistryTable {
  font-size: 0.85rem;
}

#carRegistryTable th {
  background-color: #17a2b8 !important;
  color: white !important;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  border: 1px solid #138496 !important;
}

#carRegistryTable td {
  vertical-align: middle;
  text-align: center;
}

#carRegistryTable td:nth-child(4) {
  text-align: left;
}

/* Progress bar styling */
.progress {
  border-radius: 10px;
  background-color: #e9ecef;
}

.progress-bar {
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 20px;
}

/* Overdue row styling */
.table-danger {
  background-color: #f8d7da !important;
}

.table-danger td {
  border-color: #f5c6cb !important;
}

/* Registry statistics cards */
.card.bg-primary .card-body h4,
.card.bg-warning .card-body h4,
.card.bg-info .card-body h4,
.card.bg-success .card-body h4 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

/* Registry filter section */
.card .card-header h6 {
  margin-bottom: 0;
  font-weight: 600;
}

/* Button group in registry table */
#carRegistryTable .btn-group .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Responsive adjustments for registry */
@media (max-width: 1200px) {
  #carRegistryTable {
    font-size: 0.75rem;
  }
  
  #carRegistryTable .btn-group .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  .table-responsive {
    font-size: 0.7rem;
  }
  
  #carRegistryTable th,
  #carRegistryTable td {
    padding: 0.5rem 0.25rem;
  }
}
/* File Attachment Styling */
.file-preview-item {
  transition: all 0.3s ease;
}

.file-preview-item:hover {
  background-color: #e9ecef !important;
  border-color: #6c757d !important;
}

.file-preview-item .btn-outline-danger:hover {
  transform: scale(1.1);
}

/* File input styling */
#carAttachment {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 1rem;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
}

#carAttachment:hover {
  border-color: #6c757d;
  background-color: #e9ecef;
}

#carAttachment:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* File preview container */
#carAttachmentPreview {
  max-height: 300px;
  overflow-y: auto;
}

#carAttachmentPreview::-webkit-scrollbar {
  width: 6px;
}

#carAttachmentPreview::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#carAttachmentPreview::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

#carAttachmentPreview::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Image preview styling */
.file-preview-item .img-thumbnail {
  border: 2px solid #dee2e6;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.file-preview-item .img-thumbnail:hover {
  transform: scale(1.05);
  border-color: #6c757d;
}

/* File type icons */
.file-preview-item .bi {
  font-size: 1.5rem;
}

/* Form text styling */
.form-text {
  font-size: 0.875rem;
  color: #6c757d;
}

.form-text .bi-info-circle {
  color: #0d6efd;
}

/* Loading state for submit button */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Alert styling in file preview */
#carAttachmentPreview .alert {
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

/* Responsive file preview */
@media (max-width: 768px) {
  .file-preview-item {
    font-size: 0.875rem;
  }
  
  .file-preview-item .img-thumbnail {
    max-width: 150px !important;
    max-height: 100px !important;
  }
  
  .file-preview-item .bi {
    font-size: 1.25rem;
  }
}
/* Sticky form styles */
.sticky-form {
  position: sticky;
  top: 20px;
  z-index: 100;
  background: white;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border-radius: 8px;
}

/* Document action type badges */
.action-type-badge {
  font-size: 0.85em;
  padding: 0.4em 0.8em;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.action-type-add {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: 2px solid #0056b3;
}

.action-type-new {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  color: white;
  border: 2px solid #1e7e34;
}

.action-type-edit {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #212529;
  border: 2px solid #e0a800;
}

/* Document table improvements */
.table-documents {
  margin-top: 20px;
}

.table-documents th {
  background: linear-gradient(135deg, #6f42c1, #5a32a3);
  color: white;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  border: none;
  position: sticky;
  top: 0;
  z-index: 50;
}

.table-documents td {
  vertical-align: middle;
  text-align: center;
  border-color: #dee2e6;
}

.table-documents tbody tr:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

/* Document row styling */
.document-row {
  transition: all 0.2s ease;
}

.document-row:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Cell-specific styling */
.doc-number-cell {
  font-weight: bold;
}

.department-cell,
.type-cell,
.revision-cell {
  text-align: center;
}

.date-cell {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.file-cell,
.status-cell {
  text-align: center;
}

.actions-cell {
  text-align: center;
}

.actions-cell .btn-group {
  gap: 2px;
}

.actions-cell .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* Action type column styling */
.action-type-column {
  min-width: 150px;
  max-width: 200px;
}

.action-type-column .badge {
  display: block;
  margin-bottom: 0.25rem;
}

.action-type-column small {
  display: block;
  font-size: 0.75em;
  opacity: 0.8;
}

/* Document number styling */
.doc-number {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  font-size: 0.9em;
  background: #f8f9fa;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  border-left: 3px solid #007bff;
}

/* Department badge styling */
.dept-badge {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  font-size: 0.8em;
  padding: 0.3em 0.6em;
  border-radius: 15px;
}

/* File status improvements */
.file-status-updated {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  color: white;
}

.file-status-pending {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #212529;
}

/* Responsive improvements */
@media (max-width: 768px) {
  .sticky-form {
    position: relative;
    top: 0;
  }
  
  .table-responsive {
    font-size: 0.85em;
  }
  
  .action-type-column {
    min-width: 120px;
  }
}
/* Force Modal Display */
.modal.show {
  display: block !important;
  z-index: 9999 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: auto !important;
}

.modal-backdrop.show {
  display: block !important;
  z-index: 9998 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0,0,0,0.5) !important;
}

.modal-dialog {
  position: relative !important;
  margin: 1.75rem auto !important;
  max-width: 500px !important;
  z-index: 10000 !important;
}

.modal-content {
  position: relative !important;
  background-color: #fff !important;
  border: 1px solid rgba(0,0,0,.2) !important;
  border-radius: 0.3rem !important;
  box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.5) !important;
}

/* Modal Large */
.modal-lg {
  max-width: 800px !important;
}

/* Modal Center */
.modal-dialog-centered {
  display: flex !important;
  align-items: center !important;
  min-height: calc(100% - 3.5rem) !important;
}

/* Modal Header */
.modal-header {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  padding: 1rem 1rem !important;
  border-bottom: 1px solid #dee2e6 !important;
  border-top-left-radius: calc(0.3rem - 1px) !important;
  border-top-right-radius: calc(0.3rem - 1px) !important;
}

.modal-title {
  margin-bottom: 0 !important;
  line-height: 1.5 !important;
}

.btn-close {
  padding: 0.5rem 0.5rem !important;
  margin: -0.5rem -0.5rem -0.5rem auto !important;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.235.867 8 8a.5.5 0 0 0 .707 0l8-8A.5.5 0 0 0 16.5.5v15a.5.5 0 0 1-.5.5H.5a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .235-.133z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
  border: 0 !important;
  border-radius: 0.25rem !important;
  opacity: 0.5 !important;
}

.btn-close:hover {
  opacity: 0.75 !important;
}

/* Modal Body */
.modal-body {
  position: relative !important;
  flex: 1 1 auto !important;
  padding: 1rem !important;
}

/* Modal Footer */
.modal-footer {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 0.75rem !important;
  border-top: 1px solid #dee2e6 !important;
  border-bottom-right-radius: calc(0.3rem - 1px) !important;
  border-bottom-left-radius: calc(0.3rem - 1px) !important;
}

.modal-footer > * {
  margin: 0.25rem !important;
}

/* Body when modal is open */
body.modal-open {
  overflow: hidden !important;
}

/* ========================================
   SIDEBAR LAYOUT STYLES
   ======================================== */

/* Main container with sidebar */
.sidebar-layout {
  display: flex;
  gap: 20px;
  padding: 25px 30px;
  min-height: calc(100vh - 150px);
}

/* Sidebar (Filter Panel) */
.sidebar-filter {
  width: 280px;
  min-width: 280px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0;
  position: sticky;
  top: 170px;
  height: fit-content;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  transition: all 0.3s ease;
}

.sidebar-filter:hover {
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

/* Sidebar Header */
.sidebar-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 16px 16px 0 0;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-header i {
  font-size: 20px;
}

/* Sidebar Body */
.sidebar-body {
  padding: 20px;
}

/* Filter Group */
.filter-group {
  margin-bottom: 20px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group label {
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  display: block;
  font-size: 14px;
}

.filter-group .form-select,
.filter-group .form-control {
  font-size: 14px;
  padding: 8px 12px;
}

/* Filter Actions */
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 15px;
  border-top: 2px solid #e2e8f0;
  margin-top: 20px;
}

.filter-actions .btn {
  width: 100%;
  font-size: 14px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.main-content:hover {
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

/* Content Header */
.content-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 20px 25px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.content-header h4 {
  margin: 0;
  font-weight: 700;
  color: #1e293b;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.content-header .header-actions {
  display: flex;
  gap: 10px;
}

/* Content Body */
.content-body {
  padding: 25px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}

/* Statistics Cards in Sidebar */
.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.stat-card {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 15px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
  border-left: 4px solid #667eea;
}

.stat-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.stat-card .stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: #667eea;
}

.stat-card.stat-primary {
  border-left-color: #667eea;
}

.stat-card.stat-primary .stat-value {
  color: #667eea;
}

.stat-card.stat-warning {
  border-left-color: #f59e0b;
}

.stat-card.stat-warning .stat-value {
  color: #f59e0b;
}

.stat-card.stat-danger {
  border-left-color: #ef4444;
}

.stat-card.stat-danger .stat-value {
  color: #ef4444;
}

.stat-card.stat-success {
  border-left-color: #10b981;
}

.stat-card.stat-success .stat-value {
  color: #10b981;
}

/* Responsive Sidebar */
@media (max-width: 1200px) {
  .sidebar-filter {
    width: 250px;
    min-width: 250px;
  }
}

@media (max-width: 992px) {
  .sidebar-layout {
    flex-direction: column;
  }
  
  .sidebar-filter {
    width: 100%;
    min-width: 100%;
    position: relative;
    top: 0;
    max-height: none;
  }
  
  .content-body {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .sidebar-layout {
    padding: 15px;
  }
  
  .sidebar-header {
    font-size: 14px;
    padding: 15px;
  }
  
  .sidebar-body {
    padding: 15px;
  }
  
  .content-header h4 {
    font-size: 18px;
  }
  
  .content-body {
    padding: 15px;
  }
}

/* Scrollbar Styling for Sidebar */
.sidebar-filter::-webkit-scrollbar,
.content-body::-webkit-scrollbar {
  width: 6px;
}

.sidebar-filter::-webkit-scrollbar-track,
.content-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.sidebar-filter::-webkit-scrollbar-thumb,
.content-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.sidebar-filter::-webkit-scrollbar-thumb:hover,
.content-body::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Filter Result Counter */
.filter-result {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  border-left: 4px solid #0ea5e9;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
  font-weight: 600;
  color: #075985;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-result i {
  font-size: 16px;
}

/* Toggle Sidebar Button (for mobile) */
.toggle-sidebar-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.toggle-sidebar-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

@media (max-width: 992px) {
  .toggle-sidebar-btn {
    display: flex;
  }
  
  .sidebar-filter.collapsed {
    display: none;
  }
}


.stat-card.stat-info {
  border-left-color: #06b6d4;
}

.stat-card.stat-info .stat-value {
  color: #06b6d4;
}
