/* ==========================================================================
   KYC Legacy — Custom Theme (replaces Metronic 5 defaults)
   Design system: fintech-professional palette, modern spacing, high contrast
   ========================================================================== */

/* ---------- Design Tokens (CSS Custom Properties) ---------- */
:root {
  /* Primary palette */
  --fc-primary: #1e3a5f;
  --fc-primary-light: #2a4f7f;
  --fc-primary-lighter: #e8eef5;
  --fc-primary-dark: #152b47;

  /* Accent / Success — teal */
  --fc-accent: #0d9488;
  --fc-accent-light: #14b8a6;
  --fc-accent-lighter: #ccfbf1;
  --fc-accent-dark: #0a7a70;

  /* Danger */
  --fc-danger: #dc2626;
  --fc-danger-light: #ef4444;
  --fc-danger-lighter: #fee2e2;

  /* Warning */
  --fc-warning: #f59e0b;
  --fc-warning-light: #fbbf24;
  --fc-warning-lighter: #fef3c7;

  /* Info */
  --fc-info: #2563eb;
  --fc-info-light: #3b82f6;
  --fc-info-lighter: #dbeafe;

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

  /* Typography — Inter for everything (see fonts.css) */
  --fc-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fc-font-size: 15px;
  --fc-line-height: 1.5;
  --fc-heading-weight: 600;

  /* Spacing (4px grid) */
  --fc-space-1: 4px;
  --fc-space-2: 8px;
  --fc-space-3: 12px;
  --fc-space-4: 16px;
  --fc-space-5: 20px;
  --fc-space-6: 24px;
  --fc-space-8: 32px;
  --fc-space-10: 40px;
  --fc-space-12: 48px;

  /* Border radius */
  --fc-radius-sm: 4px;
  --fc-radius: 6px;
  --fc-radius-lg: 8px;
  --fc-radius-xl: 12px;

  /* Shadows */
  --fc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --fc-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --fc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --fc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --fc-transition: 150ms ease;
}


/* ---------- Metronic Utility Replacements ---------- */
/* These were in style.bundle.css (82K) — only the ones our templates use */

/* Icon sizes (Font Awesome inside buttons) */
.icon-xs { font-size: 0.5rem !important; }
.icon-sm { font-size: 0.75rem !important; }
.icon-md { font-size: 1.25rem !important; }
.icon-4x { font-size: 4rem !important; }

/* Button large (Metronic, different from Bootstrap btn-lg) */
.btn-large { padding: 10px 20px; }

/* Font size helpers */
.font-size-sm { font-size: 0.85rem !important; }
.font-size-lg { font-size: 1.1rem !important; }
.font-weight-bolder { font-weight: 700 !important; }

/* Card title — needs flex for stacked title + subtitle */
.card-title {
  display: flex;
  margin-bottom: 0;
}

.card-title.flex-column { flex-direction: column; }
.card-title .card-label { font-weight: 700; font-size: 1.2rem; color: var(--fc-slate-900); }

/* Card custom — our main card variant */
.card-custom { background: #fff; }
.card-custom .card-header { background: transparent; border-bottom: 1px solid var(--fc-slate-100); padding: 20px 24px; min-height: auto; }
.card-custom .card-body { padding: 20px 24px; }

/* Navi elements (entity icon/text) */
.navi-icon { display: inline-flex; align-items: center; justify-content: center; }
.navi-text { font-size: 14px; color: var(--fc-slate-700); }

/* Form control solid (Metronic) */
.form-control-solid {
  background-color: var(--fc-slate-50);
  border-color: var(--fc-slate-50);
}

/* Display sizes (Metronic extras beyond Bootstrap) */
.display-5 { font-size: 1.5rem; font-weight: 300; }
.display-7 { font-size: 1rem; font-weight: 400; }

/* Image input (Metronic file upload component) */
.image-input { position: relative; display: inline-block; border-radius: var(--fc-radius); }
.image-input-wrapper { width: 120px; height: 120px; background-size: cover; background-repeat: no-repeat; background-position: center; border-radius: var(--fc-radius); }
.image-input-outline .image-input-wrapper { border: 3px solid #fff; box-shadow: var(--fc-shadow); }

/* Select2 container (from plugins, needs min-height) */
.select2-container .select2-selection { min-height: 40px; }


/* ---------- Page Structure (replaces Metronic 82K bundle layout) ---------- */

/* Full-height flex wrapper so footer sticks to bottom */
.flex-root {
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh;
}

.flex-row-fluid {
  flex: 1 1 auto;
}

.flex-column-fluid {
  flex: 1 1 auto;
}

#kt_wrapper {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto;
}

/* Page container between header and footer grows to push footer down */
#kt_wrapper > .d-flex.flex-row,
#kt_wrapper > .d-flex.flex-column-fluid,
.page {
  flex: 1 1 auto;
}

/* Header layout — logo left, user right */
.header {
  display: flex;
  align-items: center;
}

.header-menu-wrapper {
  display: flex;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
  padding: 0 8px;
}

/* Subheader layout */
.subheader {
  display: flex;
  align-items: center;
}

/* Card background (Bootstrap 4.6 card has transparent bg by default in some contexts) */
.card {
  background-color: #fff;
}

/* Metronic gutter utility */
.gutter-b {
  margin-bottom: 20px;
}

/* Label inline helper */
.label-inline {
  display: inline-flex;
  align-items: center;
}

/* ---------- Global Reset & Typography ---------- */
/* !important on BOTH html AND body to override any remaining bundle rules */
html {
  font-family: var(--fc-font) !important;
  font-size: var(--fc-font-size) !important;
}

body {
  font-family: var(--fc-font) !important;
  font-size: var(--fc-font-size) !important;
  line-height: var(--fc-line-height) !important;
  color: var(--fc-slate-800) !important;
  background-color: var(--fc-slate-50) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Force all table/form text to inherit the corrected size */
td, th, input, select, textarea, .form-control, .form-text, label, .label, .btn {
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6,
.card-title, .card-label {
  font-family: var(--fc-font);
  font-weight: var(--fc-heading-weight);
  color: var(--fc-slate-900);
}

h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; font-weight: 600; }
h5 { font-size: 1.05rem; font-weight: 600; }

/* ---------- Header ---------- */
#kt_header.header-fixed {
  position: sticky;
  top: 0;
  z-index: 999;
  animation: none;
  transition: none;
  background-color: var(--fc-primary-dark) !important;
  background-image: linear-gradient(135deg, var(--fc-primary-dark) 0%, var(--fc-primary) 50%, var(--fc-primary-light) 100%) !important;
  height: 64px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--fc-shadow-md);
}

#kt_header .brand-logo img {
  width: 80px !important;
  filter: brightness(1.2);
}

/* User name in header */
#kt_header .d-flex span[style*="color:rgba"] {
  color: #fff !important;
  font-weight: 500;
}

#kt_header a[href="/accounts/logout/"] {
  color: #fff !important;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--fc-radius);
  border: 1px solid rgba(255, 255, 255, 0.35);
  transition: all var(--fc-transition);
  text-decoration: none;
}

#kt_header a[href="/accounts/logout/"]:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.5);
}


/* ---------- Subheader (blue bar) ---------- */
#kt_subheader {
  position: sticky;
  width: 100%;
  z-index: 100000;
  background-color: var(--fc-primary) !important;
  background-image: linear-gradient(135deg, var(--fc-primary) 0%, var(--fc-info) 100%) !important;
  height: 44px !important;
  top: 64px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#kt_subheader h5 {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #fff !important;
}


/* ---------- Footer ---------- */
#kt_footer {
  background: var(--fc-slate-900) !important;
  background-image: none !important;
  border-top: 1px solid var(--fc-slate-700);
  padding: var(--fc-space-4) 0 !important;
}

#kt_footer .nav-dark,
#kt_footer .text-muted,
#kt_footer span,
#kt_footer a {
  color: var(--fc-slate-300) !important;
  font-size: 12px;
}

#kt_footer a:hover {
  color: var(--fc-slate-200) !important;
}


/* ---------- Content area ---------- */
#kt_content {
  margin-top: 16px;
}

/* Override Bootstrap 4 container — use available screen space */
.container {
  max-width: calc(100% - 80px);
}

.padded-container {
  padding: var(--fc-space-4) var(--fc-space-6);
}


/* ---------- Cards ---------- */
.card.card-custom {
  border: 1px solid var(--fc-slate-200);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow-sm);
  overflow: hidden;
}

.card-custom .card-header {
  border-bottom: 1px solid var(--fc-slate-100);
  padding: var(--fc-space-5) var(--fc-space-6);
  min-height: auto;
}

.card-custom .card-body {
  padding: var(--fc-space-5) var(--fc-space-6);
}


/* ---------- Buttons — high contrast, 44px touch targets ---------- */
.btn {
  font-weight: 500;
  font-size: 14px !important;
  border-radius: var(--fc-radius);
  padding: 10px 20px;
  min-height: 42px;
  transition: all var(--fc-transition);
  letter-spacing: 0.01em;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--fc-primary-light) !important;
  border-color: var(--fc-primary-light) !important;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.35);
}

.btn-success,
.btn-custom-accent {
  background-color: var(--fc-accent) !important;
  border-color: var(--fc-accent) !important;
  color: #fff !important;
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--fc-accent-dark) !important;
  border-color: var(--fc-accent-dark) !important;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

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

.btn-danger:hover,
.btn-danger:focus {
  background-color: var(--fc-danger-light) !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.btn-warning {
  background-color: var(--fc-warning) !important;
  border-color: var(--fc-warning) !important;
  color: var(--fc-slate-900) !important;
}

.btn-info {
  background-color: var(--fc-info) !important;
  border-color: var(--fc-info) !important;
  color: #fff !important;
}

/* Light button variants */
.btn-light-primary,
.btn-light-info {
  background-color: var(--fc-primary-lighter) !important;
  color: var(--fc-primary) !important;
  border-color: transparent !important;
}

.btn-light-success {
  background-color: var(--fc-accent-lighter) !important;
  color: var(--fc-accent-dark) !important;
  border-color: transparent !important;
}

.btn-light-danger {
  background-color: var(--fc-danger-lighter) !important;
  color: var(--fc-danger) !important;
  border-color: transparent !important;
}

.btn-light-warning {
  background-color: var(--fc-warning-lighter) !important;
  color: var(--fc-slate-800) !important;
  border-color: transparent !important;
}

/* Icon buttons */
.btn-icon.btn-sm {
  width: 36px;
  height: 36px;
  min-height: 36px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Metronic btn-hover-* variants (action buttons in table) */
.btn-hover-info:hover { background-color: var(--fc-info) !important; color: #fff !important; }
.btn-hover-warning:hover { background-color: var(--fc-warning) !important; color: var(--fc-slate-900) !important; }

/* Hover states for light buttons */
.btn-light-primary:hover,
.btn-hover-primary:hover {
  background-color: var(--fc-primary) !important;
  color: #fff !important;
}

.btn-light-success:hover,
.btn-hover-success:hover {
  background-color: var(--fc-accent) !important;
  color: #fff !important;
}

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


/* ---------- Status Labels / Badges ---------- */
.label {
  font-weight: 600;
  font-size: 12px !important;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

.label-lg {
  font-size: 13px !important;
  padding: 7px 16px;
}

/* Metronic theme color overrides */
.label-light-primary {
  background-color: var(--fc-primary-lighter) !important;
  color: var(--fc-primary) !important;
}

.label-light-success {
  background-color: var(--fc-accent-lighter) !important;
  color: var(--fc-accent-dark) !important;
}

.label-light-warning {
  background-color: var(--fc-warning-lighter) !important;
  color: var(--fc-slate-800) !important;
}

.label-light-danger {
  background-color: var(--fc-danger-lighter) !important;
  color: var(--fc-danger) !important;
}

.label-light-info {
  background-color: var(--fc-info-lighter) !important;
  color: var(--fc-primary-dark) !important; /* darker blue for WCAG AA on light-blue bg */
}

/* Bare label variants (not light-*) */
.label-light {
  background-color: var(--fc-slate-100) !important;
  color: var(--fc-slate-600) !important;
}

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

.label-success {
  background-color: var(--fc-accent) !important;
  color: #fff !important;
}

.label-warning {
  background-color: var(--fc-warning) !important;
  color: var(--fc-slate-900) !important;
}

.label-info {
  background-color: var(--fc-info) !important;
  color: #fff !important;
}

.label-primary {
  background-color: var(--fc-primary) !important;
  color: #fff !important;
}


/* ---------- Tables ---------- */
.table thead th {
  font-weight: 600;
  font-size: 12px !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fc-slate-600) !important;
  border-bottom: 2px solid var(--fc-slate-300);
  padding: 12px 12px;
  vertical-align: middle;
}

.table tbody tr {
  transition: background-color var(--fc-transition);
}

/* Alternating row backgrounds for easier scanning */
.table tbody tr:nth-child(even) {
  background-color: rgba(248, 250, 252, 0.5);
}

.table tbody tr:hover {
  background-color: var(--fc-primary-lighter);
  transition: background-color 100ms ease;
}

/* Subtle left accent on hover for interactive hint */
.table tbody tr {
  border-left: 3px solid transparent;
  transition: border-color 100ms ease, background-color 100ms ease;
}

.table tbody tr:hover {
  border-left-color: var(--fc-primary);
}

.table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--fc-slate-200);
  color: var(--fc-slate-800) !important;
  font-size: 14px !important;
}

/* Column headers with sort links — bigger click target */
.table thead th a {
  color: var(--fc-slate-600) !important;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  padding: 4px 0;
}

.table thead th a:hover {
  color: var(--fc-primary) !important;
}

/* Clickable table rows — subtle pointer hint */
.table tbody tr {
  cursor: default;
}

.table tbody tr td a.btn {
  cursor: pointer;
}


/* ---------- Progress Bars ---------- */
.progress {
  height: 8px;
  border-radius: 4px;
  background-color: var(--fc-slate-100);
  overflow: hidden;
}

.progress-bar {
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Color based on progress value — handled via template, but override danger default */
.progress-bar.bg-danger {
  background-color: var(--fc-danger) !important;
}

.progress-bar.bg-warning {
  background-color: var(--fc-warning) !important;
}

.progress-bar.bg-success {
  background-color: var(--fc-accent) !important;
}

.progress-bar.bg-primary {
  background-color: var(--fc-primary) !important;
}


/* ---------- Form Controls ---------- */
.form-control {
  border: 1px solid var(--fc-slate-300);
  border-radius: var(--fc-radius);
  padding: 10px 14px;
  font-size: 15px !important;
  color: var(--fc-slate-800);
  transition: border-color var(--fc-transition), box-shadow var(--fc-transition);
  min-height: 42px;
}

.form-control:focus {
  border-color: var(--fc-primary);
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.1);
  outline: none;
}

.form-control-sm {
  padding: 8px 12px;
  font-size: 14px !important;
  min-height: 38px;
}

select.form-control {
  appearance: auto;
}

/* Disabled inputs — clearly read-only, but still readable */
.form-control:disabled,
.form-control[disabled],
.form-control[readonly] {
  background-color: #fff !important;
  border-color: var(--fc-slate-200) !important;
  color: var(--fc-slate-800) !important;
  opacity: 1;
  cursor: default;
  box-shadow: none !important;
}

/* Code / data values — neutral, not alarming */
code {
  color: var(--fc-primary) !important;
  background-color: var(--fc-primary-lighter) !important;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}

/* Data-change alerts ("Novos dados ... foi introduzido") — compact, subtle */
.alert-custom.alert-default {
  background-color: transparent !important;
  border: none !important;
  border-left: 2px solid var(--fc-slate-300) !important;
  border-radius: 0 !important;
  color: var(--fc-slate-500) !important;
  padding: 4px 12px !important;
  font-size: 12px;
  margin-top: 4px;
  margin-bottom: 0;
}

.alert-custom.alert-default .alert-text {
  color: var(--fc-slate-500);
  font-size: 12px;
  line-height: 1.4;
}

/* Review section — form groups with breathing room */
.review-section .form-group {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fc-slate-100);
}

.review-section .form-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Informational helper text — small and unobtrusive */
.review-section .form-text.text-muted {
  font-size: 11px;
  margin-top: 3px;
  color: var(--fc-slate-400) !important;
}

/* Empty field warnings — keep visible but not screaming */
.review-section .form-text.text-danger {
  font-size: 12px;
  margin-top: 4px;
}

/* Audit trail lines ("Por:CreditScore em...") — very low visual weight */
.review-section .form-group > .row:last-child {
  font-size: 11px;
  color: var(--fc-slate-400);
  margin-top: 2px;
}

/* Entity header — sticky while scrolling through that entity's data */
/* Non-sticky scroll target — immune to sticky position reporting */
.entity-scroll-anchor { height: 0; margin: 0; padding: 0; }

#tab-entidades .entity-row {
  position: sticky;
  top: 160px; /* header (64) + subheader (46) + nav-tabs (~50) */
  z-index: 10;
  margin-left: -15px;
  margin-right: -15px;
  padding-left: 15px;
  padding-right: 15px;
  background: var(--fc-slate-50);
}

/* Entity sections — clear separation between entities */
#tab-entidades .entity-row + .row,
#tab-entidades .review-section {
  margin-bottom: 12px;
}

/* Filter dropdowns */
.form-inline .form-control {
  border-radius: var(--fc-radius);
}

/* Crispy forms labels */
.control-label,
label {
  font-weight: 600;
  font-size: 14px;
  color: var(--fc-slate-800);
  margin-bottom: var(--fc-space-1);
}


/* ---------- Alerts ---------- */
.alert {
  border-radius: var(--fc-radius-lg);
  border: none;
  padding: var(--fc-space-4) var(--fc-space-5);
  font-size: 14px;
}

.alert-success {
  background-color: var(--fc-accent-lighter);
  color: var(--fc-accent-dark);
  border-left: 4px solid var(--fc-accent);
}

.alert-danger,
.alert-error {
  background-color: var(--fc-danger-lighter);
  color: var(--fc-danger);
  border-left: 4px solid var(--fc-danger);
}

.alert-warning {
  background-color: var(--fc-warning-lighter);
  color: var(--fc-slate-800);
  border-left: 4px solid var(--fc-warning);
}

.alert-info {
  background-color: var(--fc-info-lighter);
  color: var(--fc-info);
  border-left: 4px solid var(--fc-info);
}


/* ---------- Entity Cards (entities.html) ---------- */
.entity-row {
  padding: var(--fc-space-4);
}

/* Entity card layout — name gets priority, button wraps below on mobile */
@media (max-width: 576px) {
  .entity-row .d-flex.align-items-start.justify-content-between {
    flex-direction: column;
    gap: 12px !important;
  }
  .entity-row .d-flex.align-items-start.justify-content-between > .d-flex:last-child {
    width: 100%;
  }
  .entity-row .d-flex.align-items-start.justify-content-between > .d-flex:last-child .btn {
    flex: 1;
  }
}

.entity-column-primary {
  background-color: var(--fc-primary-lighter) !important;
  border: 1px solid rgba(30, 58, 95, 0.2) !important;
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5) var(--fc-space-4);
  transition: box-shadow var(--fc-transition);
}

.entity-column-primary:hover {
  box-shadow: var(--fc-shadow-md);
}

.entity-column-success {
  background-color: var(--fc-accent-lighter) !important;
  border: 1px solid rgba(13, 148, 136, 0.2) !important;
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5) var(--fc-space-4);
}

.entity-column-warning {
  background-color: var(--fc-warning-lighter) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5) var(--fc-space-4);
}

.entity-column-danger {
  background-color: var(--fc-danger-lighter) !important;
  border: 1px solid rgba(220, 38, 38, 0.2) !important;
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5) var(--fc-space-4);
}

.entity-column-add-new {
  background-color: var(--fc-slate-50) !important;
  border: 2px dashed var(--fc-slate-300) !important;
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5) var(--fc-space-4);
  cursor: pointer;
}


/* ---------- Review Page — Approve/Reject ---------- */
.btn-approve,
a.btn[onclick*="approveDetail"],
button[onclick*="approveDetail"] {
  min-width: 36px;
  min-height: 36px;
}

.btn-reject,
a.btn[onclick*="rejectDetail"],
button[onclick*="rejectDetail"] {
  min-width: 36px;
  min-height: 36px;
}


/* ---------- Pagination ---------- */
.btn-icon.btn-sm.border-0 {
  border-radius: var(--fc-radius) !important;
  font-weight: 500;
}

.btn-icon.btn-sm.border-0.active {
  background-color: var(--fc-primary) !important;
  color: #fff !important;
}


/* ---------- SweetAlert2 overrides ---------- */
.swal2-popup {
  border-radius: var(--fc-radius-xl) !important;
  padding: var(--fc-space-8) !important;
}

.swal2-confirm {
  background-color: var(--fc-primary) !important;
  border-radius: var(--fc-radius) !important;
}

.swal2-cancel {
  border-radius: var(--fc-radius) !important;
}


/* ---------- Loader overlay ---------- */
#fp-loader {
  position: fixed;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  z-index: 1000000;
  text-align: center;
  display: none;
  background: rgba(15, 23, 42, 0.6) !important;
}

#fp-loader span {
  position: absolute;
  top: 50%;
  font-family: var(--fc-font);
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  padding: 12px 24px;
  background: var(--fc-primary);
  border-radius: var(--fc-radius-lg);
}


/* ---------- Node form — red border override ---------- */
.form-group .form-control[style*="border-left: 3px solid red"],
.form-group .form-control[style*="border-left: solid red"] {
  border-left-color: var(--fc-primary) !important;
}


/* ---------- Badge overrides ---------- */
.badge-success,
.bg-success:not(.progress-bar) {
  background-color: var(--fc-accent) !important;
}

.badge-danger,
.bg-danger:not(.progress-bar) {
  background-color: var(--fc-danger) !important;
}

.badge-warning,
.bg-warning:not(.progress-bar) {
  background-color: var(--fc-warning) !important;
}

.badge-primary,
.bg-primary:not(.progress-bar) {
  background-color: var(--fc-primary) !important;
}

.badge-info,
.bg-info {
  background-color: var(--fc-info) !important;
}


/* ---------- Text color overrides ---------- */
.text-primary {
  color: var(--fc-primary) !important;
}

.text-success {
  color: var(--fc-accent) !important;
}

.text-danger {
  color: var(--fc-danger) !important;
}

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

.text-info {
  color: var(--fc-info) !important;
}

.text-muted {
  color: var(--fc-slate-600) !important;
}


/* ---------- SVG icon color overrides ---------- */
.svg-icon-primary svg [fill]:not([fill="none"]) {
  fill: var(--fc-primary) !important;
}

.svg-icon-success svg [fill]:not([fill="none"]) {
  fill: var(--fc-accent) !important;
}

.svg-icon-danger svg [fill]:not([fill="none"]) {
  fill: var(--fc-danger) !important;
}

.svg-icon-warning svg [fill]:not([fill="none"]) {
  fill: var(--fc-warning) !important;
}


/* ---------- Login page ---------- */
body.login-page,
.login-form-wrapper {
  background-color: var(--fc-slate-50);
}

.login-form-wrapper .card,
.account-wall {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--fc-radius-xl);
  box-shadow: var(--fc-shadow-lg);
  border: 1px solid var(--fc-slate-200);
  padding: var(--fc-space-10) var(--fc-space-8);
}

.login-form-wrapper .btn-primary,
.account-wall .btn-primary,
.account-wall .btn-danger {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-top: var(--fc-space-4);
}


/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  #kt_header.header-fixed {
    height: 56px !important;
  }

  #kt_subheader {
    height: 40px !important;
    top: 56px !important;
  }

  #kt_content {
    margin-top: 48px;
  }

  .padded-container {
    padding: var(--fc-space-3);
  }

  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }

  .table-responsive {
    font-size: 13px;
  }

  .entity-column-primary,
  .entity-column-success,
  .entity-column-warning,
  .entity-column-danger {
    margin-bottom: var(--fc-space-3);
  }
}

@media (max-width: 576px) {
  .card-custom .card-header,
  .card-custom .card-body {
    padding: var(--fc-space-4);
  }

  /* Filter bar: stack vertically on mobile */
  .card-body form.d-flex.flex-wrap {
    flex-direction: column;
    gap: 8px !important;
  }
  .filter-search-wrapper,
  .filter-search-input,
  .filter-select {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Table: scroll hint + minimum column widths */
  .table thead th { font-size: 11px !important; padding: 8px 6px; }
  .table tbody td { padding: 8px 6px; font-size: 13px !important; }
  .col-id { width: 32px; }
  .col-progress { width: 80px; }

  /* Officer column: hide name, show avatar only */
  .officer-avatar { margin-right: 0; }

  /* Survey list: clickable rows taller for touch */
  .kyc-row-clickable td { padding-top: 12px; padding-bottom: 12px; }

  /* Node form: full-width image inputs */
  .image-input { width: 100% !important; max-width: 200px; }
  .image-input-wrapper { width: 100% !important; max-width: 200px; }

  /* Container narrow: full width on mobile */
  .container-narrow { max-width: 100%; padding: 0 12px; }
  .container-medium { max-width: 100%; padding: 0 12px; }

  /* Node form: stack navigation buttons */
  #kt_content form .d-flex.justify-content-between {
    flex-direction: column;
    gap: 8px;
  }
  #kt_content form .d-flex.justify-content-between .btn {
    width: 100%;
  }

  /* Entity add button: larger touch target */
  .entity-add-content { padding: 16px 0; }

  /* Submit page: scroll terms container */
  .terms-scroll { max-height: 200px; }

  /* Review summary: entity icon smaller */
  .entity-icon-lg, .entity-icon { font-size: 18px; min-width: 24px; }

  /* Form groups: reduce side padding */
  #kt_content form .form-group {
    padding: 12px 14px;
    margin-left: -14px;
    margin-right: -14px;
  }

  /* Gap utilities: tighten on mobile */
  .gap-5 { gap: 8px; }
  .gap-6 { gap: 12px; }
}


/* ---------- Utility classes ---------- */
.fc-truncate-uuid {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--fc-slate-400);
}

.fc-company-name {
  font-weight: 600;
  color: var(--fc-slate-900);
}


/* ---------- Review Page — Summary Header ---------- */
.review-header {
  background: #fff;
  border: 1px solid var(--fc-slate-200);
  border-radius: var(--fc-radius-lg);
  box-shadow: var(--fc-shadow);
  padding: var(--fc-space-5) var(--fc-space-6);
  margin-bottom: var(--fc-space-4);
}

.review-header .review-company {
  font-size: 20px;
  font-weight: 700;
  color: var(--fc-slate-900);
  margin: 0;
  line-height: 1.3;
}

.review-header .review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fc-space-4);
  margin-top: var(--fc-space-3);
  font-size: 13px;
  color: var(--fc-slate-500);
}

.review-header .review-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.review-header .review-meta .meta-item i {
  font-size: 12px;
  color: var(--fc-slate-400);
}

.review-header .review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fc-space-2);
  margin-top: var(--fc-space-4);
  padding-top: var(--fc-space-4);
  border-top: 1px solid var(--fc-slate-100);
}


/* ---------- Review Page — Tabs ---------- */
.review-tabs {
  margin-bottom: var(--fc-space-5);
}

.review-tabs .nav-tabs {
  border-bottom: 2px solid var(--fc-slate-200);
  gap: 0;
  background: var(--fc-slate-50);
  position: sticky;
  top: 110px; /* header (64px) + subheader (46px) */
  z-index: 100;
  padding-top: var(--fc-space-2);
  margin-left: -15px;
  margin-right: -15px;
  padding-left: 15px;
  padding-right: 15px;
}

/* Entity quick-nav parent needs relative for absolute dropdown */
.review-tabs .nav-item { position: relative; }

.review-tabs .nav-tabs .nav-link {
  color: var(--fc-slate-500);
  font-weight: 500;
  font-size: 14px;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 20px;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color var(--fc-transition), border-color var(--fc-transition);
}

.review-tabs .nav-tabs .nav-link:hover {
  color: var(--fc-primary);
  border-bottom-color: var(--fc-slate-300);
  background: transparent;
}

.review-tabs .nav-tabs .nav-link.active {
  color: var(--fc-primary);
  border-bottom-color: var(--fc-primary);
  background: transparent;
  font-weight: 600;
}

.review-tabs .tab-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  margin-left: 4px;
}

.review-tabs .tab-badge-default {
  background: var(--fc-slate-100);
  color: var(--fc-slate-600);
}

.review-tabs .tab-badge-danger {
  background: var(--fc-danger-lighter);
  color: var(--fc-danger);
}

.review-tabs .tab-content {
  padding-top: var(--fc-space-4);
}

/* Tab pane sections */
.review-section {
  background: #fff;
  border: 1px solid var(--fc-slate-200);
  border-radius: var(--fc-radius-lg);
  padding: var(--fc-space-5);
  margin-bottom: var(--fc-space-4);
}

.review-section h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--fc-space-4);
  color: var(--fc-slate-900);
}

.review-section h5 i {
  color: var(--fc-primary);
  margin-right: var(--fc-space-2);
}

/* Entity detail + image layout inside tabs */
.review-section .col-md-7 h5,
.review-section .col-md-5 h5 {
  font-size: 15px;
  font-weight: 600;
  color: var(--fc-slate-800);
  margin-top: 16px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--fc-slate-100);
}

.review-section .col-md-5 div[style*="background:url"] {
  width: 100% !important;
  max-width: 400px;
  height: 300px !important;
  border-radius: var(--fc-radius);
  border: 1px solid var(--fc-slate-200);
}

.review-section .col-md-5 img[style*="width:175px"] {
  width: 120px !important;
  border-radius: var(--fc-radius);
  border: 1px solid var(--fc-slate-200);
  padding: 8px;
}

/* Empty field warnings — amber instead of red for "Sem dados introduzidos" */
.review-section .form-group .form-control + .form-text.text-danger {
  color: var(--fc-warning) !important;
  font-weight: 500;
}

/* Empty state styling for tabs with no data */
.review-section p[style*="color:var(--fc-slate-400)"],
.review-section div[style*="text-align:center"] {
  padding: var(--fc-space-8) 0;
}

/* Document image containers — cleaner frame */
.review-section .col-md-5 div[id^="fg-"] {
  color: var(--fc-slate-400);
  font-size: 13px;
  font-style: italic;
}

/* PDF download links — cleaner look */
.review-section .col-md-5 a[target="_blank"] img {
  transition: opacity var(--fc-transition);
}

.review-section .col-md-5 a[target="_blank"]:hover img {
  opacity: 0.8;
}

/* Approve/reject button rows — better alignment */
.review-section .form-group.row {
  align-items: center;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 8px;
}

/* Approved/rejected disabled buttons — clearer state */
.review-section .btn[disabled] {
  opacity: 0.6 !important;
  cursor: not-allowed;
}

/* Entity quick-nav dropdown hover */
.entity-quick-nav-item:hover {
  background-color: var(--fc-primary-lighter) !important;
  color: var(--fc-primary) !important;
}

/* Links within table — clean primary color */
.table tbody td a {
  color: var(--fc-primary);
  text-decoration: none;
  transition: color var(--fc-transition);
}

.table tbody td a:hover {
  color: var(--fc-primary-light);
}

/* Scrollbar styling for long entity lists */
.entity-quick-nav-menu::-webkit-scrollbar {
  width: 4px;
}

.entity-quick-nav-menu::-webkit-scrollbar-thumb {
  background: var(--fc-slate-300);
  border-radius: 2px;
}

/* Focus visible for accessibility */
/* Keyboard-only focus ring (not on mouse click) */
.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--fc-primary);
  outline-offset: 2px;
}

/* Form controls use box-shadow only — no double ring */
.form-control:focus-visible {
  outline: none;
}

@media (max-width: 768px) {
  .review-tabs .nav-tabs {
    top: 96px; /* header (56px) + subheader (40px) on mobile */
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .review-tabs .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 13px;
  }

  .review-header .review-meta {
    flex-direction: column;
    gap: var(--fc-space-2);
  }

  .review-header .review-actions {
    flex-direction: column;
  }

  .review-header .review-actions .btn {
    width: 100%;
  }
}


/* ---------- Client-Facing Hero (home.html) ---------- */
.kyc-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--fc-space-6);
}

.kyc-hero-card {
  background: #fff;
  border-radius: var(--fc-radius-xl);
  box-shadow: var(--fc-shadow-lg);
  padding: 48px 40px;
  max-width: 520px;
  width: 100%;
  border: 1px solid var(--fc-slate-200);
}

.kyc-hero-logo {
  background: var(--fc-primary);
  border-radius: var(--fc-radius-lg);
  padding: 12px 24px;
  display: inline-block;
  margin-bottom: 24px;
}

.kyc-hero-logo img {
  width: 80px;
  filter: brightness(1.2);
}

.kyc-hero-icon {
  font-size: 36px;
  color: var(--fc-primary);
  margin-bottom: 16px;
}

.kyc-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--fc-slate-900);
  margin-bottom: 12px;
}

.kyc-hero-text {
  font-size: 15px;
  color: var(--fc-slate-600);
  line-height: 1.6;
  margin-bottom: 28px;
}

.kyc-hero-btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 36px !important;
  font-size: 16px !important;
  font-weight: 600;
  border-radius: var(--fc-radius-lg) !important;
  min-width: 200px;
  justify-content: center;
}

.kyc-hero-footer {
  margin-top: 20px;
  font-size: 12px;
  color: var(--fc-slate-400);
}

/* ---------- Client-Facing Completed State ---------- */
.kyc-completed {
  text-align: center;
  padding: 48px 24px;
  max-width: 560px;
  margin: 0 auto;
}

.kyc-completed-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--fc-accent-lighter);
  color: var(--fc-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
}

.kyc-completed h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--fc-slate-900);
  margin-bottom: 12px;
}

.kyc-completed p {
  font-size: 15px;
  color: var(--fc-slate-600);
  line-height: 1.6;
  margin-bottom: 8px;
}

.kyc-completed .kyc-completed-note {
  margin-top: 24px;
  padding: 16px;
  background: var(--fc-slate-50);
  border-radius: var(--fc-radius-lg);
  border: 1px solid var(--fc-slate-200);
  font-size: 13px;
  color: var(--fc-slate-500);
}

/* ---------- Node Step Indicator (within form) ---------- */
.node-step-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(30, 58, 95, 0.15);
}

.node-step-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--fc-slate-700);
  white-space: nowrap;
}

.node-step-progress {
  flex: 1;
  height: 6px;
}

.node-step-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--fc-slate-500);
  white-space: nowrap;
}

@media (max-width: 576px) {
  .node-step-indicator { gap: 8px; }
  .node-step-text { font-size: 12px; }
}

/* Client-side validation error highlight */
.has-validation-error {
  border-left-color: var(--fc-danger) !important;
  background-color: var(--fc-danger-lighter) !important;
}
.has-validation-error .form-control {
  border-color: var(--fc-danger) !important;
}


/* ---------- Client Entity Progress Bar ---------- */
.kyc-progress-summary {
  background: #fff;
  border: 1px solid var(--fc-slate-200);
  border-radius: var(--fc-radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.kyc-progress-summary .progress {
  flex: 1;
}

.kyc-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--fc-slate-700);
  white-space: nowrap;
}

@media (max-width: 576px) {
  .kyc-hero-card { padding: 32px 24px; }
  .kyc-hero-btn { width: 100%; }
  .kyc-progress-summary { flex-direction: column; gap: 8px; }
}

/* ---------- Client Submit Page ---------- */
.submit-container {
  max-width: 720px;
  margin: 0 auto;
}

.kyc-submit-header {
  text-align: center;
  margin-bottom: 24px;
}

.kyc-submit-header i {
  font-size: 32px;
  color: var(--fc-primary);
  margin-bottom: 12px;
  display: block;
}

.kyc-submit-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--fc-slate-900);
  margin-bottom: 8px;
}

.kyc-submit-header p {
  font-size: 14px;
  color: var(--fc-slate-500);
  margin: 0;
}


/* ---------- Node Form — Layout & Styling ---------- */

/* Wrap the form area in a card-like container */
#kt_content > .row > .col-md-12 > form {
  background: #fff;
  border: 1px solid var(--fc-slate-200);
  border-radius: var(--fc-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

/* Node section heading */
#kt_content > .row > .col-md-12 > .display-7 {
  font-size: 18px;
  font-weight: 600;
  color: var(--fc-slate-900);
  margin-bottom: 8px;
}

/* Node description text */
.node_description {
  font-size: 14px;
  color: var(--fc-slate-600);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Form group spacing in node form — dark label accent */
#kt_content form .form-group {
  margin-bottom: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fc-slate-100);
  border-left: 3px solid var(--fc-primary);
  background: var(--fc-slate-50);
  border-radius: 0 var(--fc-radius) var(--fc-radius) 0;
  margin-left: -24px;
  margin-right: -24px;
}

#kt_content form .form-group:nth-child(odd) {
  background: #fff;
}

#kt_content form .form-group:last-of-type {
  border-bottom: none;
}

#kt_content form .form-group label {
  font-weight: 700;
  font-size: 14px;
  color: var(--fc-primary-dark);
  text-transform: none;
  letter-spacing: 0;
}

/* "Não pode editar" helper text — amber background strip */
#kt_content form .form-group .form-control[disabled] ~ .form-text.text-muted,
#kt_content form .form-group .form-control[disabled] + .form-text.text-muted {
  background: var(--fc-warning-lighter) !important;
  color: var(--fc-slate-800) !important;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--fc-radius);
  border-left: 3px solid var(--fc-warning);
  margin-top: 6px;
  display: inline-block;
}

/* Navigation buttons at bottom of node form */
#kt_content form .d-flex.justify-content-between,
#kt_content form + .d-flex {
  margin-top: 16px;
}

/* "Início" / navigation button styling */
#kt_content .btn-primary:only-child,
#kt_content a.btn:only-child {
  min-width: 120px;
}


/* ---------- Node Form — Read More/Less (extracted from node.html) ---------- */
.addReadMore.showlesscontent { padding-bottom: 10px; }
.addReadMore.showlesscontent .SecSec,
.addReadMore.showlesscontent .readLess { display: none; }
.addReadMore.showmorecontent .readMore { display: none; }
.addReadMore .readMore,
.addReadMore .readLess {
  font-weight: 600;
  margin-left: 2px;
  color: var(--fc-primary);
  cursor: pointer;
}
.addReadMoreWrapTxt.showmorecontent .SecSec,
.addReadMoreWrapTxt.showmorecontent .readLess { display: block; }
.node_description_restricted { overflow: hidden; height: 40px; }
.node_description_read_more,
.node_description_read_less {
  font-weight: 600;
  margin-left: 2px;
  color: var(--fc-primary);
  cursor: pointer;
  float: right;
  display: none;
}


/* ---------- Histórico Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 36px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--fc-slate-200);
}

.timeline-item {
  position: relative;
  padding: 10px 0;
  border-bottom: 1px solid var(--fc-slate-100);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
}
.timeline-dot-primary { background: var(--fc-primary); }
.timeline-dot-success { background: var(--fc-accent); }
.timeline-dot-danger  { background: var(--fc-danger); }
.timeline-dot-warning { background: var(--fc-warning); color: var(--fc-slate-900); }
.timeline-dot-info    { background: var(--fc-info); }

.timeline-body { min-width: 0; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.timeline-desc {
  font-weight: 600;
  font-size: 14px;
  color: var(--fc-slate-800);
}
.timeline-time {
  font-size: 13px;
  font-weight: 500;
  color: var(--fc-slate-600);
  white-space: nowrap;
}
.timeline-user {
  font-size: 13px;
  color: var(--fc-slate-500);
  display: block;
  margin-top: 2px;
}
.timeline-user i { font-size: 11px; margin-right: 4px; }
.timeline-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--fc-slate-600);
  background: var(--fc-slate-50);
  padding: 8px 12px;
  border-radius: var(--fc-radius);
  border-left: 3px solid var(--fc-warning);
}
.timeline-note i { font-size: 11px; margin-right: 4px; color: var(--fc-slate-400); }

@media (max-width: 576px) {
  .timeline { padding-left: 28px; }
  .timeline-dot { left: -28px; width: 20px; height: 20px; font-size: 9px; }
  .timeline-header { flex-direction: column; gap: 2px; }
}


/* ---------- Print Stylesheet ---------- */
@media print {
  /* Hide navigation, header, footer, buttons */
  #kt_header, #kt_subheader, #kt_footer,
  .review-actions, .review-tabs .nav-tabs,
  .entity-quick-nav-menu, .entity-dropdown-caret,
  .btn-approve, .btn-reject, .btn-large,
  .form-group.row .col-md-3, .form-group.row .col-md-6 input[type="text"],
  form[action*="survey-request"],
  .btn-light-primary, .btn-success, .btn-warning, .btn-danger {
    display: none !important;
  }

  /* Show all tab panes (no hiding on print) */
  .tab-pane { display: block !important; opacity: 1 !important; }
  .tab-pane.fade { opacity: 1 !important; }

  /* Clean backgrounds */
  body { background: #fff !important; font-size: 12px !important; }
  .card, .review-section, .review-header { box-shadow: none !important; border: 1px solid #ddd !important; }
  .entity-column-primary, .entity-column-success,
  .entity-column-warning, .entity-column-danger {
    border: 1px solid #999 !important;
    background: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Keep entity names visible */
  .entity-row { position: static !important; }

  /* Labels print with background */
  .label {
    border: 1px solid currentColor !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Page breaks between entities */
  .entity-row { page-break-before: auto; }
  .review-section { page-break-inside: avoid; }

  /* Remove link decorations */
  a { color: inherit !important; text-decoration: none !important; }
}


/* ==========================================================================
   Extracted Inline-Style Utilities (Session 4)
   Replaces 300+ inline style="" attributes across templates
   ========================================================================== */

/* ---------- Gap Utilities (not in Bootstrap 4.6) ---------- */
.gap-1 { gap: 4px; }
.gap-2 { gap: 6px; }
.gap-3 { gap: 8px; }
.gap-4 { gap: 10px; }
.gap-5 { gap: 12px; }
.gap-6 { gap: 16px; }
.gap-8 { gap: 24px; }

/* ---------- Icon Spacing ---------- */
.icon-mr    { margin-right: 6px; }
.icon-mr-sm { margin-right: 4px; }
.icon-mr-lg { margin-right: 8px; }

/* ---------- Form Utilities ---------- */
.form-inline-action { display: inline; }
.form-compact { margin: 0; }
.btn-unstyled { border: none; background: none; padding: 0; cursor: pointer; font: inherit; }

/* ---------- Text Utilities ---------- */
.text-sm      { font-size: 13px !important; }
.text-xs      { font-size: 12px !important; }
.text-semibold { font-weight: 600 !important; }
.nowrap       { white-space: nowrap; }

/* ---------- Flex Utilities ---------- */
.flex-1 { flex: 1; }

/* ---------- Container Width Variants ---------- */
.container-narrow { max-width: 1200px; }
.container-medium { max-width: 720px; }

/* ---------- Entity Component Classes ---------- */
.entity-name     { font-weight: 600; font-size: 16px; color: var(--fc-slate-800); }
.entity-message  { margin: 4px 0 0; font-size: 13px; color: var(--fc-slate-700); }
.entity-icon-lg  { font-size: 20px; min-width: 28px; text-align: center; margin-top: 2px; }
.entity-add-link { color: inherit; text-decoration: none; }
.entity-add-center { text-align: center; cursor: pointer; }
.entity-add-content { padding: 12px 0; }
.entity-add-icon { font-size: 16px; color: var(--fc-slate-400); margin-right: 8px; }
.entity-add-text { font-size: 15px; font-weight: 500; color: var(--fc-slate-600); }

/* ---------- Alert Spacing ---------- */
.alert-mt { margin: 12px 0 0; }

/* ---------- Section Divider (ESG separator) ---------- */
.section-divider { border-top: 2px solid var(--fc-slate-200); margin: 24px 0; }

/* ---------- Comment Card ---------- */
.comment-card    { background: #fff; border: 1px solid var(--fc-slate-200); border-radius: var(--fc-radius-lg); padding: 20px; }
.comment-heading { font-weight: 600; color: var(--fc-slate-700); margin-bottom: 8px; }

/* ---------- Progress Variants ---------- */
.progress-sm { height: 10px; }
.progress-mt { margin-top: 4px; }

/* ---------- Search Filter Components ---------- */
.filter-search-wrapper { position: relative; flex: 0 0 auto; }
.filter-search-icon    { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--fc-slate-400); pointer-events: none; }
.filter-search-input   { max-width: 240px; padding-left: 30px; padding-right: 28px; }
.filter-clear-icon     { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--fc-slate-400); cursor: pointer; display: none; }
.filter-select         { max-width: 200px; }

/* ---------- Table Column Helpers ---------- */
.col-id       { width: 40px; }
.col-progress { width: 100px; }
.col-actions  { text-align: right; white-space: nowrap; }

/* ---------- Officer Avatar ---------- */
.officer-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--fc-primary-lighter); color: var(--fc-primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; margin-right: 6px;
}

/* ---------- Survey List Cell Styles ---------- */
.survey-type       { font-weight: 600; font-size: 13px; color: var(--fc-slate-600); }
.td-date           { white-space: nowrap; font-size: 13px; color: var(--fc-slate-700); }
.td-progress-label { font-weight: 600; font-size: 13px; color: var(--fc-slate-700); }
.td-progress-fraction { font-size: 12px; color: var(--fc-slate-500); margin-left: 4px; }

/* ---------- Empty State ---------- */
.empty-state      { color: var(--fc-slate-400); font-size: 15px; margin: 0; }
.empty-state-icon { font-size: 32px; color: var(--fc-slate-300); display: block; margin-bottom: 12px; }

/* ---------- Pagination ---------- */
.pagination-info { font-size: 13px; }

/* ---------- Entity Quick-Nav (extracted from inline styles) ---------- */
.entity-quick-nav-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 1050;
  min-width: 240px; max-height: 360px; overflow-y: auto;
  background: #fff; border: 1px solid var(--fc-slate-200);
  border-radius: var(--fc-radius); box-shadow: var(--fc-shadow-md); padding: 4px 0;
}

.entity-quick-nav-item {
  display: flex; align-items: center; padding: 6px 16px;
  color: var(--fc-slate-700); text-decoration: none;
  font-size: 13px; white-space: nowrap;
}

.entity-nav-icon {
  margin-right: 8px; width: 16px; text-align: center; font-size: 12px;
}

/* Dropdown caret in tab */
.entity-dropdown-caret {
  margin-left: 6px; font-size: 9px; opacity: 0.5;
}

/* Reviewed-pending label spacing */
.label-reviewed-pending { margin-right: 8px; }

/* ---------- Review Summary inline button label ---------- */
.btn-icon-left  { margin-right: 6px; }

/* ---------- Heading in entities.html ---------- */
.entity-page-heading { margin: 0; font-weight: 600; color: var(--fc-slate-900); }

/* ==========================================================================
   Review Summary — Extracted Inline Styles
   ========================================================================== */

/* ---------- User Comment / Inline Text ---------- */
.comment-inline      { margin: 0; color: var(--fc-slate-600); }

/* ---------- Info Fields (Company info section) ---------- */
.info-field          { margin-bottom: 8px; }

/* ---------- Entity Header ---------- */
.entity-subtitle     { margin: 4px 0 0; font-size: 12px; color: var(--fc-slate-500); }

/* ---------- Review Section Spacing ---------- */
.review-mb-lg        { margin-bottom: 24px; }
.review-mb           { margin-bottom: 16px; }
.review-mt           { margin-top: 10px; }
.review-mt-md        { margin-top: 15px; }

/* ---------- Approved/Rejected Disabled Buttons ---------- */
.btn-approved-disabled { background: var(--fc-accent-light); opacity: 0.7; }
.btn-rejected-disabled { background: var(--fc-danger-light); opacity: 0.7; }

/* ---------- Status Icon Spacing ---------- */
.icon-mr-5           { margin-right: 5px; }

/* ---------- Guardar Button ---------- */
.btn-save-inline     { display: inline-block; }

/* ---------- Image/Document Containers ---------- */
.img-preview-box     { width: 500px; height: 500px; background-size: contain; background-position: center; background-repeat: no-repeat; }
.img-pdf-thumb       { width: 175px; }

/* ---------- Add Entity Components ---------- */
.add-entity-hint     { font-size: 12px; color: var(--fc-slate-500); margin: 4px 0 0; }

/* ---------- Label Margin-Left (Dow Jones / Documents) ---------- */
.label-ml            { margin-left: 8px; }
.label-ml-md         { margin-left: 10px; }
.label-ml-sm         { margin-left: 5px; }

/* ---------- Dow Jones — Match Card ---------- */
.dj-match-card {
  background: var(--fc-slate-50); border: 1px solid var(--fc-slate-200);
  padding: 12px; margin-bottom: 8px; border-radius: var(--fc-radius-lg);
  display: flex; justify-content: space-between; align-items: center;
}

/* ---------- Dow Jones — Association Card ---------- */
.dj-assoc-card {
  background: var(--fc-slate-50); border: 1px solid var(--fc-slate-200);
  padding: 10px; margin-bottom: 8px; border-radius: var(--fc-radius-lg);
}

/* ---------- Dow Jones — Alert Indicator ---------- */
.dj-alert            { color: var(--fc-danger); margin-left: 8px; }

/* ---------- Dow Jones — Classification Meta ---------- */
.dj-classification-meta { font-size: 11px; color: var(--fc-slate-500); margin-left: 5px; }

/* ---------- Screening / Scoring — Shared Row ---------- */
.screening-row       { padding: 10px 0; }
.screening-row-border { padding: 10px 0; border-bottom: 1px solid var(--fc-slate-100); }

/* ---------- Scoring Flex Layout ---------- */
.scoring-flex        { display: flex; align-items: center; justify-content: space-between; }

/* ---------- Scoring Detail Text ---------- */
.scoring-detail      { font-size: 12px; color: var(--fc-slate-500); }
.scoring-indicators  { margin-top: 8px; font-size: 12px; }

/* ---------- Scoring Check / Absent Icons ---------- */
.scoring-check       { color: var(--fc-accent); }
.scoring-absent      { color: var(--fc-slate-300); }

/* ---------- Empty State (text-align + padding variant) ---------- */
.empty-state-section { text-align: center; padding: 40px; }

/* ---------- Verification Detail ---------- */
.verification-detail { margin-top: 5px; font-size: 12px; color: var(--fc-slate-500); }
.verification-online { margin-left: 8px; font-size: 11px; color: var(--fc-accent); }

/* ---------- PDF Icon Color ---------- */
.pdf-icon            { color: var(--fc-danger); }

/* ---------- Document Status ---------- */
.doc-status-row      { margin-bottom: 12px; }

/* ---------- Status Text Colors ---------- */
.text-fc-danger-bold { color: var(--fc-danger); font-weight: bold; }
.text-fc-accent      { color: var(--fc-accent); }
.text-fc-muted       { color: var(--fc-slate-400); }

/* ---------- Match Classify Button Spacing ---------- */
.classify-mr         { margin-right: 4px; }

/* ---------- Case ID Footer ---------- */
.dj-case-footer      { font-size: 11px; color: var(--fc-slate-400); margin-top: 10px; margin-bottom: 0; }

/* ---------- Screening Status Inline ---------- */
.screening-status-muted { margin-left: 8px; color: var(--fc-slate-400); }
.screening-matches      { margin-left: 10px; font-size: 11px; color: var(--fc-slate-500); }
.screening-error        { margin-left: 8px; font-size: 11px; color: var(--fc-danger); }

/* ---------- Row Margin Variants ---------- */
.row-mb              { margin-bottom: 10px; }

/* ---------- Detail Input (review mode inline editing) ---------- */
.border-danger       { border: 1px solid var(--fc-danger) !important; }
.detail-input-inline { width: 86%; display: inline-block; }

/* ---------- Auth / Account Page Utilities ---------- */
.auth-heading {
  text-align: center;
  margin-bottom: 24px;
}
.auth-heading h2 {
  font-weight: 700;
  color: var(--fc-slate-900);
  margin-bottom: 4px;
  font-size: 22px;
}
.auth-heading p {
  color: var(--fc-slate-500);
  font-size: 14px;
  margin: 0;
}
.auth-footer-link {
  text-align: center;
  margin-top: 16px;
}
.auth-footer-link a {
  color: var(--fc-slate-500);
  font-size: 13px;
  text-decoration: none;
}
.socialaccount_ballot {
  margin-bottom: 20px;
}
.socialaccount_providers {
  list-style: none;
  padding: 0;
}
.social-divider {
  text-align: center;
  color: var(--fc-slate-400);
  font-size: 13px;
  margin: 12px 0;
}

/* ---------- Submit Page Utilities ---------- */
.terms-scroll {
  max-height: 300px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}
.section-heading {
  font-weight: 600;
  margin-bottom: 12px;
}
.section-heading-inline {
  font-weight: 600;
  margin: 0;
}
.icon-primary {
  color: var(--fc-primary);
}
.verification-row {
  padding: 6px 0;
}
.verification-row-border {
  border-bottom: 1px solid var(--fc-slate-100);
}
.score-row {
  padding: 8px 0;
}
.score-row-border {
  border-bottom: 1px solid var(--fc-slate-100);
}
.score-meta {
  font-size: 12px;
  color: var(--fc-slate-400);
}
.upload-form-mt {
  margin-top: 12px;
}
.missing-list {
  margin-top: 8px;
  margin-bottom: 0;
}

/* ---------- Header Utilities ---------- */
.header-actions {
  padding: 0 20px;
}
.header-username {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  margin-right: 16px;
}
.header-login-hidden {
  color: transparent;
}
.footer-copyright {
  color: var(--fc-slate-500);
  font-size: 12px;
}
.logo-img {
  width: 72px;
}

/* ---------- Entity Complete Page (aliases for entity_complete.html) ---------- */
.entity-review-msg { margin: 2px 0 0; font-size: 13px; color: var(--fc-slate-700); }
.entity-icon       { font-size: 20px; min-width: 28px; text-align: center; margin-top: 2px; }
.entity-add-inner  { padding: 12px 0; }
.entity-comment-box   { background: #fff; border: 1px solid var(--fc-slate-200); border-radius: var(--fc-radius-lg); padding: 20px; }
.entity-comment-label { font-weight: 600; color: var(--fc-slate-700); margin-bottom: 8px; }

/* Clickable table rows */
.kyc-row-clickable { cursor: pointer; }

/* ---------- Node Page Utilities ---------- */
.node-entity-name {
  font-weight: 600;
  font-size: 18px;
  color: var(--fc-slate-800);
  word-break: break-word;
}
.nif-meta {
  margin-left: 10px;
  font-size: 11px;
  color: var(--fc-slate-500);
}
.verified-online-badge {
  margin-left: 5px;
  font-size: 11px;
}
.other-input-mt {
  margin-top: 10px;
}
.form-images-mb {
  margin-bottom: 25px;
}
.file-radio-group {
  margin-top: 25px;
}
.add-images-mb {
  margin-bottom: 20px;
}
.save-btn-ml {
  margin-left: 8px;
}

/* ---------- Account Wall Centering ---------- */
.account-wall-wrapper {
  min-height: calc(100vh - 200px);
  align-items: center;
  padding: 24px 16px;
}

/* ---------- Base.html Content Offset ---------- */
.base-content-offset {
  margin-top: 80px;
}

/* ---------- PDF Label Positioning ---------- */
.pdf-upload-label {
  width: 250px;
  position: relative;
  top: 10px;
}

/* ---------- Link Utilities ---------- */
.text-inherit       { color: inherit !important; }
.text-decoration-none { text-decoration: none !important; }


/* ---------- Yes/No radio active state (bug 6) ---------- */
.radio.selected-option {
  background-color: var(--fc-primary-lighter);
  border-radius: 6px;
  padding: 6px 12px;
  margin-right: 6px;
  font-weight: 600;
  color: var(--fc-primary-dark);
  box-shadow: inset 0 0 0 2px var(--fc-primary);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.radio.selected-option > span {
  border-color: var(--fc-primary) !important;
  background-color: var(--fc-primary) !important;
}
.radio.selected-option > span:after {
  background-color: #fff !important;
}

/* ---------- PDF download button wait state (bug 1) ---------- */
.btn-loading {
  pointer-events: none;
  opacity: 0.75;
  cursor: wait;
}
.pdf-download-btn .btn-icon {
  margin-right: 6px;
}

/* ---------- Rejected field indication (bug 3) ---------- */
.field-rejected-banner {
  background-color: var(--fc-danger-lighter);
  border-left: 4px solid var(--fc-danger);
  color: var(--fc-danger);
  padding: 10px 14px;
  margin: 8px 0 14px 0;
  border-radius: 6px;
  font-size: 0.95em;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.field-rejected-banner strong {
  font-weight: 700;
  color: var(--fc-danger);
  margin-right: 4px;
}
.field-rejected-reason {
  flex: 1 1 auto;
  color: var(--fc-danger);
  font-weight: 500;
}

/* ---------- Step indicator breadcrumb (bug 2) ---------- */
.node-step-indicator {
  margin: 12px 0 18px 0;
}
.node-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.92em;
  color: var(--fc-primary-dark, #152b47);
}
.node-step-text { font-weight: 600; white-space: nowrap; }
.node-step-pct { font-weight: 500; opacity: 0.85; white-space: nowrap; flex-shrink: 0; }
.node-step-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.node-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.node-step-pill:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.node-step-pill-label { font-weight: 700; }
.node-step-pill-pending {
  background-color: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}
.node-step-pill-filled {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.node-step-pill-approved {
  background-color: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.node-step-pill-rejected {
  background-color: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.node-step-pill-current {
  background-color: var(--fc-primary, #1e3a5f);
  color: #fff;
  border-color: var(--fc-primary-dark, #152b47);
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.25);
}
.node-step-pill-current .node-step-pill-label { color: #fff; }

/* Entidades dropdown revision-status badges (Bruno 2026-04-13 18:48)
   — small pastel pills, same palette family as node-step-pill above. */
.entity-status-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid;
    margin-right: 12px;
    vertical-align: middle;
    line-height: 1.5;
}
.entity-status-pending {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
.entity-status-partial {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.entity-status-rejected {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}
.entity-status-approved {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #6ee7b7;
}
