/* ==========================================================================
   USTH ERP ⇄ Moodle Sync Portal - Modern Design System
   Color Palette: USTH Deep Navy (#002B49), Tech Cyan (#00A3E0), 
   Clean Slate (#0F172A, #F8FAFC), Vibrant Accents (#10B981, #F59E0B, #EF4444)
   ========================================================================== */

:root {
  /* USTH Brand Colors */
  --color-usth-navy: #002B49;
  --color-usth-navy-dark: #001B30;
  --color-usth-navy-light: #003e69;
  --color-usth-cyan: #00A3E0;
  --color-usth-cyan-hover: #008ec2;
  --color-usth-cyan-subtle: rgba(0, 163, 224, 0.12);

  /* Functional Palettes */
  --color-success: #10B981;
  --color-success-bg: #ECFDF5;
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
  --color-danger: #EF4444;
  --color-danger-bg: #FEF2F2;
  --color-info: #3B82F6;
  --color-info-bg: #EFF6FF;

  /* Neutrals & Surfaces */
  --bg-body: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-muted: #F8FAFC;
  --border-color: #E2E8F0;
  --border-focus: #00A3E0;

  /* Typography */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-white: #FFFFFF;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(0, 163, 224, 0.35);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, var(--color-usth-navy) 0%, var(--color-usth-navy-dark) 100%);
  color: var(--text-white);
  padding: 1rem 2rem;
  box-shadow: 0 4px 20px rgba(0, 43, 73, 0.25);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid var(--color-usth-cyan);
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  color: #FFFFFF;
}

.logo-sub {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--color-usth-cyan);
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-divider {
  width: 1px;
  height: 38px;
  background: rgba(255, 255, 255, 0.2);
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFFFFF;
}

.brand-sub {
  font-size: 0.8rem;
  color: #94A3B8;
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-demo .status-dot {
  background: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
}

.status-connected .status-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.status-error .status-dot {
  background: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger);
}

/* ==========================================================================
   Main Layout & Stepper
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem 4rem;
}

.workflow-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Stepper Progress Bar */
.stepper-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 1.25rem 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: var(--transition);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: #E2E8F0;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}

.step-info {
  display: flex;
  flex-direction: column;
}

.step-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.step-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Active Step */
.step-item.active .step-number {
  background: var(--color-usth-cyan);
  color: #FFFFFF;
  box-shadow: var(--shadow-glow);
}
.step-item.active .step-name {
  color: var(--color-usth-navy);
  font-weight: 700;
}

/* Completed Step */
.step-item.completed .step-number {
  background: var(--color-success);
  color: #FFFFFF;
}
.step-item.completed .step-name {
  color: var(--text-primary);
}

/* Locked Step */
.step-item.locked {
  opacity: 0.45;
}

.step-connector {
  flex: 1;
  height: 3px;
  background: #E2E8F0;
  margin: 0 1rem;
  border-radius: 2px;
  transition: var(--transition);
}

.step-connector.completed {
  background: var(--color-success);
}

/* System Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.alert-info {
  background-color: #F0F9FF;
  border: 1px solid #BAE6FD;
  color: #0369A1;
}

.erp-fetch-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
  background: #F0FDF4;
  color: #166534;
  font-size: 0.875rem;
}

.erp-fetch-feedback[data-kind="warning"] {
  border-color: #FDE68A;
  background: #FFFBEB;
  color: #92400E;
}

.erp-fetch-feedback[data-kind="error"] {
  border-color: #FECACA;
  background: #FEF2F2;
  color: #991B1B;
}

.erp-fetch-feedback p {
  margin: 0;
}

.erp-fetch-feedback ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.sync-result-issues {
  margin-top: 0.5rem;
  color: #92400E;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

#btn-staff-login {
  margin-top: 1rem;
}

.text-warning {
  color: var(--color-warning);
}

.banner-icon {
  font-size: 1.25rem;
  color: var(--color-usth-cyan);
}

/* ==========================================================================
   Section Cards & Disabled State Overlays
   ========================================================================== */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
}

.section-card:hover {
  box-shadow: var(--shadow-md);
}

/* Disabled Section Overlay (Lock Mechanism) */
.section-card.is-disabled {
  user-select: none;
  border-color: #CBD5E1;
}

.section-card.is-disabled > *:not(.card-overlay) {
  opacity: 0.35;
  filter: grayscale(80%);
  pointer-events: none;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(248, 250, 252, 0.75);
  backdrop-filter: blur(2px);
  border-radius: var(--radius-lg);
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.section-card.is-disabled .card-overlay {
  display: flex;
}

.lock-indicator {
  background: #FFFFFF;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.lock-indicator i {
  color: var(--color-warning);
  font-size: 1.1rem;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-badge {
  background: var(--color-usth-navy);
  color: #FFFFFF;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-usth-navy);
}

.section-tag {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: #F1F5F9;
  color: var(--text-muted);
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Step 1: Category Controls
   ========================================================================== */
.category-controls-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: flex-end;
}

@media (max-width: 860px) {
  .category-controls-grid {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.badge-required {
  font-size: 0.75rem;
  color: var(--color-danger);
  font-weight: 500;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

.form-select,
.form-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background-color: #FFFFFF;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.15);
}

.form-select:disabled,
.form-input:disabled {
  background-color: #F8FAFC;
  color: var(--text-muted);
  cursor: not-allowed;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Category Selected Info Card */
.selected-category-card {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fadeIn 0.3s ease-out;
}

.category-info-icon {
  font-size: 1.5rem;
  color: var(--color-usth-cyan);
}

.category-info-details {
  flex: 1;
}

.cat-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.cat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cat-name {
  font-size: 0.95rem;
  color: var(--color-usth-navy);
}

.cat-path-row {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Step 2: ERP Class & Student Retrieval
   ========================================================================== */
.erp-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-cohort-options-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  margin-top: 0.75rem;
}

.custom-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-usth-cyan);
  margin-top: 2px;
  cursor: pointer;
}

.custom-checkbox-label strong {
  font-size: 0.9rem;
  color: var(--color-usth-navy);
}

.group-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-sm);
  color: #1E40AF;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
}

.cohort-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  background: #FDF4FF;
  border: 1px solid #F0ABFC;
  border-radius: var(--radius-sm);
  color: #86198F;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
}

.quick-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.presets-title {
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.preset-chip {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  color: var(--color-usth-navy);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover:not(:disabled) {
  background: var(--color-usth-cyan-subtle);
  border-color: var(--color-usth-cyan);
  color: var(--color-usth-cyan-hover);
}

/* ==========================================================================
   Step 3: Class Roster Cards & Lecturer Assignment
   ========================================================================== */
.class-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #F8FAFC;
  border-radius: var(--radius-md);
  border: 2px dashed #E2E8F0;
}

.empty-icon {
  font-size: 2.5rem;
  color: #CBD5E1;
  margin-bottom: 0.75rem;
}

.empty-title {
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Individual Class Card */
.class-roster-card {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.class-roster-card:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

.class-roster-card.staged {
  border-color: var(--color-success);
  background: #F0FDF4;
}

.card-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border-color);
  gap: 1rem;
}

.class-roster-card.staged .card-top-bar {
  background: #DCFCE7;
  border-bottom-color: #BBF7D0;
}

.class-ident {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.class-code-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  background: var(--color-usth-navy);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
}

.class-roster-card.staged .class-code-badge {
  background: var(--color-success);
}

.class-names {
  display: flex;
  flex-direction: column;
}

.class-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.class-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

.card-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Card Body: Lecturer & Actions */
.card-body-content {
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 860px) {
  .card-body-content {
    grid-template-columns: 1fr;
  }
}

.lecturer-assignment-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
}

.lecturer-search-wrap {
  position: relative;
}

.lecturer-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.lecturer-results-dropdown.show {
  display: block;
}

.lecturer-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

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

.lecturer-item:hover {
  background-color: var(--color-usth-cyan-subtle);
}

.lecturer-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.lecturer-email {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lecturer-dept {
  font-size: 0.75rem;
  background: #E2E8F0;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.assigned-lecturers-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.assigned-lecturer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  color: #1E40AF;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: fadeIn 0.2s ease-out;
}

.assigned-lecturer-badge:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
}

.btn-remove-lecturer {
  background: none;
  border: none;
  color: #EF4444;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.2rem;
  margin-left: 0.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-remove-lecturer:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #DC2626;
}

/* ==========================================================================
   Step 4: Staged Courses Table & Sync Section
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.data-table th {
  background: #F8FAFC;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #F8FAFC;
}

.staging-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.staging-summary {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
}

.summary-item {
  display: flex;
  flex-direction: column;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.summary-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-usth-navy);
}

/* ==========================================================================
   Buttons & UI Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background-color: var(--color-usth-navy);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-usth-navy-light);
  box-shadow: 0 4px 12px rgba(0, 43, 73, 0.2);
}

.btn-secondary {
  background-color: #FFFFFF;
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #F8FAFC;
  border-color: #CBD5E1;
}

.btn-success {
  background-color: var(--color-success);
  color: #FFFFFF;
}

.btn-success:hover:not(:disabled) {
  background-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger-outline {
  background: transparent;
  border-color: #FECACA;
  color: var(--color-danger);
}

.btn-danger-outline:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem 0.85rem;
}

.btn-input-addon {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-text-small {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-text-small:hover {
  color: #FFFFFF;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-primary {
  background: var(--color-usth-cyan-subtle);
  color: #0077A8;
}

.badge-neutral {
  background: #F1F5F9;
  color: var(--text-secondary);
}

.badge-success {
  background: var(--color-success-bg);
  color: #065F46;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-dialog.modal-lg {
  max-width: 800px;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-usth-navy);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #F8FAFC;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Sync Progress & Terminal Log
   ========================================================================== */
.sync-progress-wrap {
  margin-bottom: 1.25rem;
}

.progress-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: #E2E8F0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-usth-cyan) 0%, var(--color-success) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.terminal-log-wrapper {
  background: #0F172A;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.25rem;
}

.terminal-header {
  background: #1E293B;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #EF4444; }
.dot-yellow { background: #F59E0B; }
.dot-green { background: #10B981; }

.terminal-title {
  color: #94A3B8;
  font-size: 0.75rem;
  font-family: monospace;
}

.terminal-logs {
  padding: 0.85rem 1rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.82rem;
  height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: #E2E8F0;
}

.log-entry {
  display: flex;
  gap: 0.75rem;
  line-height: 1.4;
}

.log-time {
  color: #64748B;
  user-select: none;
}

.log-info { color: #60A5FA; }
.log-success { color: #34D399; }
.log-warning { color: #FBBF24; }
.log-error { color: #F87171; }

.sync-results-box {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.results-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-card-item {
  background: #FFFFFF;
  border: 1px solid #DCFCE7;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ==========================================================================
   Switch Toggle
   ========================================================================== */
.toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 1rem;
}

.toggle-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.toggle-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked + .slider {
  background-color: var(--color-usth-cyan);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: #FFFFFF;
  color: var(--text-primary);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 420px;
  border-left: 4px solid var(--color-usth-navy);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.9rem;
}

.toast.toast-success { border-left-color: var(--color-success); }
.toast.toast-error { border-left-color: var(--color-danger); }
.toast.toast-warning { border-left-color: var(--color-warning); }

/* Keyframe Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.hidden {
  display: none !important;
}

.text-muted { color: var(--text-muted); }
.text-primary { color: var(--color-usth-cyan); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-center { text-align: center; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.me-2 { margin-right: 0.5rem; }
.mt-1 { margin-top: 0.25rem; }
.d-block { display: block; }
