/* :root {
  --bs-primary: #E70E16 !important;
  --bs-link-color: #E70E16 !important;
}


.btn-primary {
  background-color: #E70E16 !important;
  border-color: #E70E16 !important;
  --bs-btn-hover-bg: #C20C13 !important;
  --bs-btn-hover-border-color: #C20C13 !important;
  --bs-btn-active-bg: #A30A10 !important;
  --bs-btn-active-border-color: #A30A10 !important;
  --bs-btn-disabled-bg: #E70E16 !important;
  --bs-btn-disabled-border-color: #E70E16 !important;
}  */


/* Force navbar background to primary */
.navbar {
  background-color: #ffffff !important;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Ensure text-primary uses the exact color */
/* .text-primary {
  color: #E70E16 !important;
} */

/* Anchor color */
/* a {
  color: #E70E16 !important;
} */

/* Ensure navbar links are black on white background */
.navbar .nav-link,
.navbar .navbar-brand {
  color: #000000 !important;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #000000 !important;
}

/* Prevent navigation menu text from wrapping to multiple lines */
.navbar-nav .nav-link {
  white-space: nowrap !important;
  padding-left: 0.75rem !important;
  padding-right: 0.75rem !important;
  /* font-size: 0.875rem !important;  */
}

/* Ensure navbar has enough width for all menu items */
/* .navbar .container {
  max-width: 100% !important;
} */

.navbar-collapse {
  flex-grow: 1 !important;
}
.nav-logo, .navbar-brand{
    width: 50% !important;
    height: auto !important;
}

.navbar-nav .nav-link.active {
    border: 2px solid #0d6efd;   /* Bootstrap primary color */
    border-radius: 8px;          /* rounded corners */
    padding: 4px 12px;           /* extra space inside */
    background-color: #e9f2ff;   /* light background */
  }

/* User Group Selector Bar (below navigation) */
.user-group-selector-bar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 0 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.user-group-selector-card {
    background-color: #ffffff !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 12px !important;
    padding: 12px 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    display: inline-block !important;
    min-width: fit-content !important;
}

.user-group-selector-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.user-group-info-flex {
    flex-wrap: nowrap;
    position: relative;
    z-index: 1;
}

.user-group-info-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
    z-index: 1;
}

.user-group-selector-inline {
    display: inline-block;
    margin: 0 4px;
    vertical-align: middle;
    position: relative;
    z-index: 1051;
}

.user-group-selector-inline .user-group-selector-nav {
    display: inline-flex;
    position: relative;
    z-index: 1051;
}

.user-group-selector-nav .dropdown {
    position: relative;
    z-index: 1051;
}

/* Responsive: allow wrapping on smaller screens */
@media (max-width: 991.98px) {
    .user-group-info-flex {
        flex-wrap: wrap !important;
    }
    
    .user-group-info-text {
        min-width: 0;
    }
    
    .user-group-selector-inline {
        display: inline-block;
        margin: 4px 0;
    }
}

@media (max-width: 575.98px) {
    .user-group-info-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .user-group-info-flex .flex-shrink-0 {
        margin-bottom: 0.5rem;
    }
    
    .user-group-selector-inline {
        display: block;
        margin: 4px 0;
    }
}

.user-group-badge-dropdown {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    padding: 4px 12px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    transition: all 0.2s ease !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
}

.user-group-badge-dropdown:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
}

.user-group-badge-dropdown:focus {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.user-group-badge-dropdown:active {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
}

.user-group-selector-nav .dropdown-menu {
    background-color: #ffffff !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 4px 0 !important;
    margin-top: 8px !important;
    overflow: hidden !important;
    z-index: 9999 !important;
    position: absolute !important;
}

.user-group-selector-nav .dropdown.show .dropdown-menu {
    display: block !important;
    z-index: 9999 !important;
}

/* Ensure dropdown menu is visible when shown */
.user-group-selector-nav .dropdown-menu.show {
    display: block !important;
    z-index: 9999 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.user-group-selector-nav .dropdown-item {
    padding: 6px 12px !important;
    font-size: 0.875rem !important;
    display: flex !important;
    align-items: center !important;
    border-radius: 0 !important;
}

.user-group-selector-nav .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

.user-group-selector-nav .dropdown-item.active {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;
    font-weight: 500 !important;
}

/* Help Menu Dropdown Styles */
.modern-navbar .dropdown-toggle {
    text-decoration: none;
    color: var(--mdetect-text, #1f2937);
}

.modern-navbar .dropdown-toggle:hover {
    color: var(--mdetect-text, #1f2937);
}

.modern-navbar .dropdown-toggle::after {
    margin-left: 0.5rem;
    vertical-align: 0.15em;
    border-top-color: var(--mdetect-text, #1f2937);
}

.modern-navbar .dropdown-menu {
    background: var(--mdetect-surface, #ffffff);
    border: 1px solid var(--mdetect-border, #e5e7eb);
    border-radius: var(--mdetect-radius, 8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 250px;
}

.modern-navbar .dropdown-item {
    color: var(--mdetect-text, #1f2937);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
    text-decoration: none;
}

.modern-navbar .dropdown-item:hover {
    background-color: var(--mdetect-surface-alt, #f9fafb);
    color: var(--mdetect-text, #1f2937);
}

.modern-navbar .dropdown-item:focus {
    background-color: var(--mdetect-surface-alt, #f9fafb);
    color: var(--mdetect-text, #1f2937);
}

.modern-navbar .dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--mdetect-border, #e5e7eb);
}

.modern-navbar .dropdown-item a:hover {
    color: var(--mdetect-text, #1f2937);
}

.modern-navbar .dropdown-item .manual-link:hover {
    text-decoration: none;
}

.modern-navbar .dropdown-item a[download]:hover {
    color: var(--mdetect-accent, #FF746C);
}

/* Responsive adjustments for user group selector */
@media (max-width: 991.98px) {
    .user-group-selector-bar {
        padding: 10px 0 18px 0;
    }
    
    .user-group-selector-bar .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .user-group-selector-card {
        width: 100%;
        max-width: 100%;
        padding: 10px 16px;
    }
    
    .user-group-selector-nav {
        width: 100%;
        justify-content: center;
    }
    
    .user-group-badge-dropdown {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .user-group-selector-bar {
        padding: 8px 0 16px 0;
    }
    
    .user-group-selector-card {
        padding: 8px 12px;
        border-width: 1.5px;
    }
    
    .user-group-badge-dropdown {
        font-size: 0.8rem !important;
        padding: 4px 10px !important;
    }
    
    .user-group-selector-nav .dropdown-menu {
        width: 100%;
        max-width: 100%;
    }
}

/* Custom Table Styling */
@import url('https://fonts.googleapis.com/css?family=Montserrat|Open+Sans|Roboto');

/* Override Bootstrap table styles for custom design */
.table {
  position: relative;
  z-index: 2;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  box-shadow: 0 2px 15px rgba(64,64,64,.7);
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  margin: 20px 0;
  font-size: large;
}

.table td, 
.table th {
  /* padding: 15px 20px; */
  text-align: center;
  border: none;
}

.table thead th {
  background-color: #FF746C;
  color: #fafafa;
  font-family: 'Open Sans', sans-serif;
  /* font-weight: 200; */
  text-transform: uppercase;
  border: none;
}

.table tbody tr {
  width: 100%;
  background-color: #fafafa;
  font-family: 'Montserrat', sans-serif;
  border: none;
}

.table tbody tr:nth-child(even) {
  background-color: #eeeeee;
}

.table tbody tr:hover {
  background-color: #e0e0e0;
  transition: background-color 0.3s ease;
}

/* Ensure table is responsive but maintains custom styling */
.table-responsive {
  position: relative;
  background: transparent;
}

/* Override Bootstrap table classes */
.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
  background-color: #fafafa;
}

.table-striped > tbody > tr:nth-of-type(even) > td,
.table-striped > tbody > tr:nth-of-type(even) > th {
  background-color: #eeeeee;
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  background-color: #e0e0e0;
}

/* Dark table header override */
.table-dark {
  --bs-table-bg: #FF746C;
  --bs-table-color: #fafafa;
}

.table-dark > :not(caption) > * > * {
  background-color: #FF746C;
  color: #fafafa;
}

/* Custom Alert Styling */
.alert {
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

/* Allow overflow for alert containing user group selector */
.alert.user-group-info-alert {
  overflow: visible !important;
  position: relative;
  z-index: 1;
}

.alert.user-group-info-alert .container {
  overflow: visible !important;
  position: relative;
  z-index: 1;
}

.alert.user-group-info-alert .d-flex {
  overflow: visible !important;
  position: relative;
}

.alert.user-group-info-alert .flex-grow-1 {
  overflow: visible !important;
  position: relative;
}

.alert.user-group-info-alert .flex-shrink-0 {
  overflow: visible !important;
}

/* Ensure nested containers allow overflow, but not the dropdown menu itself */
.alert.user-group-info-alert .user-group-selector-inline,
.alert.user-group-info-alert .user-group-selector-nav,
.alert.user-group-info-alert .dropdown {
  overflow: visible !important;
}

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

.alert .alert-heading {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 16px;
}

.alert .btn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px;
  background: none;
  border: none;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

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

/* Success Alert */
.alert-success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border-left: 4px solid #28a745;
}

.alert-success::before {
  background: #28a745;
}

.alert-success .alert-heading {
  color: #0f5132;
}

/* Error Alert */
.alert-danger,
.alert-error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.alert-danger::before,
.alert-error::before {
  background: #dc3545;
}

.alert-danger .alert-heading,
.alert-error .alert-heading {
  color: #58151c;
}

/* Warning Alert */
.alert-warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
  border-left: 4px solid #ffc107;
}

.alert-warning::before {
  background: #ffc107;
}

.alert-warning .alert-heading {
  color: #664d03;
}

/* Info Alert */
.alert-info {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.alert-info::before {
  background: #17a2b8;
}

.alert-info .alert-heading {
  color: #055160;
}

/* Primary Alert */
.alert-primary {
  background: linear-gradient(135deg, #cce7ff 0%, #b3d9ff 100%);
  color: #004085;
  border-left: 4px solid #007bff;
}

.alert-primary::before {
  background: #007bff;
}

.alert-primary .alert-heading {
  color: #002752;
}

/* Secondary Alert */
.alert-secondary {
  background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
  color: #383d41;
  border-left: 4px solid #6c757d;
}

.alert-secondary::before {
  background: #6c757d;
}

.alert-secondary .alert-heading {
  color: #212529;
}

/* Alert with Icons */
.alert .fas,
.alert .far,
.alert .fab {
  margin-right: 8px;
  font-size: 16px;
}

.alert-success .fas,
.alert-success .far {
  color: #28a745;
}

.alert-danger .fas,
.alert-danger .far,
.alert-error .fas,
.alert-error .far {
  color: #dc3545;
}

.alert-warning .fas,
.alert-warning .far {
  color: #ffc107;
}

.alert-info .fas,
.alert-info .far {
  color: #17a2b8;
}

.alert-primary .fas,
.alert-primary .far {
  color: #007bff;
}

/* Alert Dismissible Animation */
.alert-dismissible .btn-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  padding: 1.25rem 1rem;
}

.alert-dismissible .btn-close::before {
  content: '×';
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
}

/* Alert Fade Animation */
.alert.fade {
  transition: opacity 0.15s linear;
}

.alert.show {
  opacity: 1;
}

/* Alert in Cards */
.card .alert {
  margin: 0 0 20px 0;
  border-radius: 8px;
}

/* Alert in Forms */
.form .alert {
  margin-bottom: 15px;
}

/* Alert with Strong Text */
.alert strong {
  font-weight: 600;
}

/* Alert Links */
.alert a {
  /* color: inherit; */
  text-decoration: underline;
  font-weight: 500;
}

.alert a:hover {
  text-decoration: none;
  opacity: 0.8;
}

/* Alert Lists */
.alert ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.alert li {
  margin-bottom: 4px;
}

/* Alert in Container */
.container .alert {
  margin-left: 0;
  margin-right: 0;
}

/* Alert with Custom Icons */
.alert .alert-icon {
  display: inline-block;
  margin-right: 8px;
  font-size: 18px;
  vertical-align: middle;
}

/* Alert Success with Check Icon */
.alert-success .alert-icon::before {
  content: '✓';
  color: #28a745;
  font-weight: bold;
}

/* Alert Error with X Icon */
.alert-danger .alert-icon::before,
.alert-error .alert-icon::before {
  content: '✕';
  color: #dc3545;
  font-weight: bold;
}

/* Alert Warning with Exclamation Icon */
.alert-warning .alert-icon::before {
  content: '⚠';
  color: #ffc107;
  font-weight: bold;
}

/* Alert Info with Info Icon */
.alert-info .alert-icon::before {
  content: 'ℹ';
  color: #17a2b8;
  font-weight: bold;
}

/* Alert Primary with Info Icon */
.alert-primary .alert-icon::before {
  content: 'ℹ';
  color: #007bff;
  font-weight: bold;
}

/* Alert in Navbar (for privacy warning) */
.navbar + .alert {
  border-radius: 0;
  margin-bottom: 0;
}

.navbar + .alert::before {
  display: none;
}

/* Alert in Fixed Position (GDPR banner) */
.alert.position-fixed {
  border-radius: 0;
  margin-bottom: 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive Alert */
@media (max-width: 768px) {
  .alert {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .alert .alert-heading {
    font-size: 15px;
  }
  
  .alert .btn-close {
    top: 8px;
    right: 8px;
    padding: 6px;
  }
  
  .alert .alert-icon {
    font-size: 16px;
  }
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
  .alert-success {
    background: linear-gradient(135deg, #1e4d2b 0%, #2d5a3d 100%);
    color: #d4edda;
  }
  
  .alert-danger,
  .alert-error {
    background: linear-gradient(135deg, #4d1e1e 0%, #5a2d2d 100%);
    color: #f8d7da;
  }
  
  .alert-warning {
    background: linear-gradient(135deg, #4d3e00 0%, #5a4a00 100%);
    color: #fff3cd;
  }
  
  .alert-info {
    background: linear-gradient(135deg, #1e3d4d 0%, #2d4d5a 100%);
    color: #d1ecf1;
  }
}

/* ========================================
   FORM SWITCH STYLES
   ======================================== */
.form-switch .form-check-input {
  width: 3em;
  height: 1.5em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
  background-position: left center;
  border-radius: 2em;
  transition: background-position .15s ease-in-out;
}

.form-switch .form-check-input:checked {
  background-color: #198754;
  border-color: #198754;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  background-position: right center;
}

.form-switch .form-check-input:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-switch .form-check-label {
  margin-left: 0.5em;
  font-weight: 500;
}

/* ========================================
   READ-ONLY FIELD STYLES
   ======================================== */
.readonly-field {
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6 !important;
  color: #6c757d !important;
  font-style: italic;
}

.readonly-field-label {
  color: #6c757d;
  font-weight: 500;
}

/* ========================================
   FILE UPLOAD DROP ZONE STYLES
   ======================================== */
.drop-zone {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: #007bff;
  background-color: #e3f2fd;
}

.drop-zone.dragover {
  border-color: #007bff;
  background-color: #e3f2fd;
  transform: scale(1.02);
}

.drop-zone-content {
  pointer-events: none;
}

.drop-zone button {
  pointer-events: auto;
}

.upload-icon {
  font-size: 3rem;
  opacity: 0.6;
}

.drop-zone-files {
  margin-top: 1rem;
  text-align: left;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.file-item .file-info {
  flex-grow: 1;
}

.file-item .file-size {
  color: #6c757d;
  font-size: 0.875rem;
}

.file-item .file-remove {
  color: #dc3545;
  cursor: pointer;
  margin-left: 1rem;
}

.file-item .file-remove:hover {
  color: #c82333;
}


/* ========================================
   PRINT STYLES (for backup codes)
   ======================================== */
.print-body {
  font-family: Arial, sans-serif;
  margin: 20px;
}

.print-header {
  text-align: center;
  margin-bottom: 30px;
}

.print-codes {
  font-family: monospace;
  font-size: 14px;
}

.print-warning {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 15px;
  margin: 20px 0;
  border-radius: 5px;
}

.print-footer {
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: #666;
}

/* ========================================
   EMAIL TEMPLATES PAGE STYLES
   ======================================== */
/* Email preview styling */
.email-preview {
  font-size: 12px;
  line-height: 1.4;
}

.email-preview h1,
.email-preview h2,
.email-preview h3 {
  font-size: 14px;
  margin: 0.5rem 0;
}

.email-preview p {
  margin: 0.25rem 0;
  font-size: 11px;
}

.email-preview .email-header,
.email-preview .email-content,
.email-preview .email-footer {
  padding: 8px;
  margin: 2px 0;
  border-radius: 4px;
}

.email-preview .email-header {
  color: white;
}

.email-preview .email-content {
  background-color: #f8f9fa;
}

.email-preview .email-footer {
  background-color: #e9ecef;
  font-size: 10px;
}

.template-preview {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  background-color: #f8f9fa;
}

/* Fullscreen overlay styles */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-container {
  width: 95vw;
  height: 95vh;
  background-color: white;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fullscreen-header {
  background-color: #343a40;
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #495057;
}

.fullscreen-actions {
  display: flex;
  gap: 0.5rem;
}

.fullscreen-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.template-display {
  flex: 1;
  overflow: auto;
  padding: 2rem;
  background-color: #f8f9fa;
}

.email-template-fullscreen {
  max-width: 800px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.email-template-fullscreen .email-body {
  margin: 0;
  padding: 0;
}

.email-template-fullscreen .email-container {
  max-width: none;
  margin: 0;
  padding: 0;
}

.email-template-fullscreen .email-header {
  padding: 2rem;
  text-align: center;
}

.email-template-fullscreen .email-content {
  padding: 2rem;
}

.email-template-fullscreen .email-footer {
  padding: 1.5rem;
  text-align: center;
}

.email-template-fullscreen .email-alert {
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 4px;
}

.email-template-fullscreen .email-button {
  display: inline-block;
  padding: 12px 24px;
  margin: 1rem 0;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
}

/* Responsive adjustments for email templates page */
@media (max-width: 768px) {
  .fullscreen-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  .template-display {
    padding: 1rem;
  }
  
  .fullscreen-header {
    padding: 0.75rem 1rem;
  }
  
  .fullscreen-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* ========================================
   ASSAY LIST COUNT BADGE STYLES
   ======================================== */
.table-card a .count-badge.count-badge-primary.me-2 {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%) !important;
    color: #064E3B !important;
    transition: background 0.3s ease !important;
}

.table-card a:hover .count-badge.count-badge-primary.me-2,
.table-card a .count-badge.count-badge-primary.me-2:hover {
    background: linear-gradient(135deg, #A7F3D0 0%, #6EE7B7 100%) !important;
    color: #022C22 !important;
}

/* ========================================
   ANALYSIS DETAIL PAGE STYLES
   (Moved from core/templates/core/analyses/detail.html)
   ======================================== */
.file-display-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.file-display-link:hover {
    text-decoration: none;
}

.file-display-link:hover .file-display-name {
    color: var(--mdetect-accent);
}

.file-display-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-radius: var(--mdetect-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.file-display-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--mdetect-text);
    transition: color 0.15s ease;
}

.file-display-size {
    font-size: 0.8125rem;
    color: var(--mdetect-text-muted);
}

.file-display-icon-pdf {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #DC2626;
}

.file-display-icon-zip {
    background: linear-gradient(135deg, #FED7AA 0%, #FDBA74 100%);
    color: #EA580C;
}

.file-display-icon-excel {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #059669;
}

.pdf-action-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-action-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
}

.pdf-action-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
}

.pdf-action-link i {
    font-size: 0.875rem;
}

/* PDF Viewer Modal Styles */
.pdf-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.2s ease;
}

.pdf-modal.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pdf-modal-content {
    position: relative;
    margin: 20px auto;
    width: 95%;
    height: calc(100% - 100px);
    background-color: #fff;
    border-radius: var(--mdetect-radius-md, 8px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.pdf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: var(--mdetect-radius-md, 8px) var(--mdetect-radius-md, 8px) 0 0;
    gap: 15px;
}

.pdf-modal-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--mdetect-text, #1f2937);
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.pdf-modal-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.pdf-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 5px 10px;
    line-height: 1;
    transition: color 0.2s ease;
}

.pdf-modal-close:hover {
    color: #1f2937;
}

.pdf-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: var(--mdetect-accent, #059669);
    color: white;
    border: none;
    border-radius: var(--mdetect-radius-sm, 6px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.pdf-download-btn:hover {
    background-color: var(--mdetect-accent-dark, #047857);
    color: white;
    text-decoration: none;
}

.pdf-modal-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.excel-viewer-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.excel-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 15px;
    color: var(--mdetect-text-muted, #6b7280);
    font-size: 0.9375rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.excel-loading i {
    font-size: 2rem;
    color: var(--mdetect-accent, #059669);
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.excel-table th,
.excel-table td {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}

.excel-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: var(--mdetect-text, #1f2937);
    position: sticky;
    top: 0;
    z-index: 1;
}

.excel-table td {
    background-color: #fff;
    color: var(--mdetect-text, #1f2937);
}

.excel-table tr:nth-child(even) td {
    background-color: #f9fafb;
}

.excel-sheet-tab {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 4px;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mdetect-text, #6b7280);
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    top: 1px;
}

.excel-sheet-tab:hover {
    background-color: #f3f4f6;
    color: var(--mdetect-text, #1f2937);
}

.excel-sheet-tab.active {
    background-color: #fff;
    color: var(--mdetect-accent, #059669);
    border-color: #e5e7eb;
    border-bottom-color: #fff;
    font-weight: 600;
    z-index: 2;
}

.excel-sheet-tab.active:hover {
    background-color: #fff;
}

.pdf-nav-arrows {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdf-nav-arrows:hover {
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.05);
}

.pdf-nav-arrows:active {
    transform: translateY(-50%) scale(0.95);
}

.pdf-nav-arrows.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.pdf-nav-arrows.disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pdf-nav-prev {
    left: 20px;
}

.pdf-nav-next {
    right: 20px;
}

.pdf-nav-arrows i {
    font-size: 1.25rem;
    color: var(--mdetect-text, #1f2937);
}

/* ========================================
   ANALYSIS CREATE PAGE STYLES
   (Moved from core/templates/core/analyses/create.html)
   ======================================== */
/* Style for assays without amplicons in dropdown */
.assay-no-codes {
    color: #dc3545 !important;
    font-weight: 500;
}

/* Error message styling */
.assay-validation-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

/* Invalid select styling */
.form-select.is-invalid {
    border-color: #dc3545;
    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='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6 .4.4.4-.4m0 4.8-.4-.4-.4.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);
    padding-right: calc(1.5em + 0.75rem);
}

/* Modern Upload Zone */
.upload-zone {
    border: 2px dashed var(--mdetect-border);
    border-radius: var(--mdetect-radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--mdetect-surface-alt);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--mdetect-accent);
    background: var(--mdetect-accent-light);
}

.upload-zone-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--mdetect-accent-light) 0%, #FED7D5 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.upload-zone h5 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--mdetect-text);
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--mdetect-text-secondary);
    margin-bottom: 1rem;
}

.upload-file-list {
    margin-top: 1.5rem;
    text-align: left;
}

.upload-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--mdetect-surface);
    border: 1px solid var(--mdetect-border);
    border-radius: var(--mdetect-radius-xs);
    margin-bottom: 0.5rem;
}

.upload-file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.upload-file-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-radius: var(--mdetect-radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
}

.upload-file-name {
    font-weight: 500;
    color: var(--mdetect-text);
}

.upload-file-size {
    font-size: 0.8125rem;
    color: var(--mdetect-text-muted);
}

.upload-file-remove {
    color: #DC2626;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.15s ease;
}

.upload-file-remove:hover {
    color: #B91C1C;
}