/* ==========================================================
   AITANA SUITE — KPIs & ANALYTICS STYLESHEET
   Glassmorphism UI, Responsive Dashboard, Glowing Scorecards
   ========================================================== */

/* CONTAINER & LAYOUT */
.analytics-container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 1.25rem 2rem 1.5rem 2rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100vh;
}

/* APP HEADER */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  width: 100%;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-glow-devoteam,
.logo-glow-gold {
  width: 36px;
  height: 36px;
  background: #fff1f3;
  border: 1px solid rgba(248, 72, 94, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8485e;
  box-shadow: 0 0 15px rgba(248, 72, 94, 0.12);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
}

.logo-glow-devoteam:hover,
.logo-glow-gold:hover {
  background: #ffe4e8;
  border-color: rgba(248, 72, 94, 0.45);
  box-shadow: 0 0 20px rgba(248, 72, 94, 0.25);
  transform: rotate(5deg) scale(1.05);
}

.logo-glow-devoteam i,
.logo-glow-devoteam svg,
.logo-glow-gold i,
.logo-glow-gold svg,
.logo-icon {
  width: 18px !important;
  height: 18px !important;
  color: #f8485e !important;
  stroke: #f8485e !important;
  display: block;
}

.brand-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.1;
  margin: 0;
}

.brand-text > span {
  font-size: 0.7rem;
  color: #56555a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  display: block;
}

.text-gold-gradient {
  color: #f8485e !important;
  background: none !important;
  -webkit-text-fill-color: #f8485e !important;
  font-size: inherit !important;
  font-weight: inherit !important;
}

/* PREMIUM BACK TO PORTAL BUTTON (TOP HEADER) */
.btn-portal-back-premium {
  position: relative !important;
  z-index: 1000 !important;
  background: #fff1f3 !important;
  border: 1px solid rgba(248, 72, 94, 0.25) !important;
  color: #f8485e !important;
  text-decoration: none !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  font-family: 'Inter', sans-serif !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 8px rgba(248, 72, 94, 0.06) !important;
  box-sizing: border-box !important;
  height: 38px !important;
  width: 165px !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin: 0 !important;
}

.btn-portal-back-premium:hover {
  transform: translateY(-2px) !important;
  background: #ffe4e8 !important;
  border-color: rgba(248, 72, 94, 0.45) !important;
  box-shadow: 0 4px 14px rgba(248, 72, 94, 0.16) !important;
  color: #e0364c !important;
}

.btn-portal-back-premium:active {
  transform: translateY(0) !important;
}

.btn-portal-back-premium i {
  color: #f8485e !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-portal-back-premium:hover i {
  color: #e0364c !important;
  transform: translateX(-4px) !important;
}

/* ACTIVE UNIT BADGE */
.badge-unit-active {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #047857;
  font-family: 'Outfit', sans-serif;
  height: 38px;
  box-sizing: border-box;
}

.badge-unit-active span {
  white-space: nowrap !important;
}

.badge-unit-active select,
#header-unit-switcher {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #047857 !important;
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer !important;
  outline: none !important;
  padding: 0 4px !important;
  margin: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  width: auto !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
}

.badge-unit-active select option,
#header-unit-switcher option {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 500 !important;
  padding: 6px 12px !important;
}

/* CONTROL & FILTERS BAR */
.control-bar {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-md, 12px);
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: nowrap;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  contain: none !important;
  overflow: visible !important;
  transform: none !important;
}

.control-bar.has-open-dropdown,
.control-bar:focus-within {
  z-index: 1000 !important;
}

.control-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  overflow: visible !important;
}

/* Subunidad fijada a la izquierda con ancho cómodo */
.control-left .control-group#control-group-subunit {
  flex: 1.1 1 0;
  min-width: 145px;
}

/* Proyecto con buscador y ancho prioritario */
.control-left .control-group#control-group-project {
  flex: 1.35 1 0;
  min-width: 165px;
  position: relative;
  overflow: visible !important;
}

/* Desplegables de personas (PM, Comercial, Squad Lead) */
.control-left .control-group#control-group-pm,
.control-left .control-group#control-group-comercial,
.control-left .control-group#control-group-squad-lead {
  flex: 1 1 0;
  min-width: 125px;
}

/* Selector de Mes y Año al final con ancho compacto */
.control-left .control-group#control-group-month {
  flex: 0.9 1 0;
  min-width: 115px;
}

.control-left .control-group.control-group-year {
  flex: 0 0 auto;
  min-width: 95px;
}

/* Elevar cualquier control-group cuyo dropdown esté abierto */
.control-left .control-group.has-open-dropdown {
  z-index: 1030 !important;
}

.control-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-left: 0.25rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.control-group label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #56555a;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-family: 'Outfit', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.control-group label i, .control-group label svg {
  width: 13px;
  height: 13px;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.custom-select, .control-select, select {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
  height: 32px;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0 1.7rem 0 0.6rem;
  border-radius: 6px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition-smooth, all 0.25s ease);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2356555a' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.5rem center !important;
  background-size: 0.75rem !important;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #56555a;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-action-icon i, .btn-action-icon svg {
  width: 14px;
  height: 14px;
  color: #56555a;
  transition: all 0.2s ease;
}

.btn-action-icon:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #1e293b;
  transform: none;
}

.btn-action-icon:hover i, .btn-action-icon:hover svg {
  color: #1e293b;
}

.btn-action-icon.btn-reset-filters:hover {
  background: #fff1f3;
  border-color: rgba(248, 72, 94, 0.4);
  color: #f8485e;
}

.btn-action-icon.btn-reset-filters:hover i,
.btn-action-icon.btn-reset-filters:hover svg {
  color: #f8485e;
}

.btn-action-icon.spinning i, .btn-action-icon.spinning svg {
  animation: spin 0.75s linear infinite;
  color: #f8485e;
}

.custom-select:hover, .custom-select:focus,
.control-select:hover, .control-select:focus {
  border-color: #f8485e !important;
  box-shadow: 0 0 0 2px rgba(248, 72, 94, 0.15) !important;
}

.custom-select option, .control-select option, select option {
  background-color: #ffffff !important;
  color: #1e293b !important;
}

.custom-select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background-color: #f1f5f9 !important;
  color: #94a3b8 !important;
}

/* SEARCHABLE SELECT DROPDOWN (PROJECT FILTER) */
.searchable-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  z-index: 1020;
  overflow: visible !important;
}

.searchable-select-wrapper.is-open {
  z-index: 1030 !important;
}

.searchable-select-trigger {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  height: 32px;
  width: 100%;
  min-width: 0;
  padding: 0 0.5rem 0 0.6rem;
  border-radius: 6px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  user-select: none;
  box-sizing: border-box;
}

.searchable-select-trigger:hover,
.searchable-select-trigger:focus,
.searchable-select-trigger.active {
  border-color: #f8485e !important;
  box-shadow: 0 0 0 2px rgba(248, 72, 94, 0.15) !important;
  background: #ffffff !important;
}

.searchable-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
  color: #1e293b;
}

.searchable-trigger-text.is-placeholder {
  color: #64748b;
  font-weight: 500;
}

.searchable-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8485e;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 5px;
  min-width: 17px;
  height: 17px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 2px;
}

.searchable-trigger-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.searchable-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.searchable-clear-btn:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

.searchable-clear-btn svg,
.searchable-clear-btn i {
  width: 10px;
  height: 10px;
}

.searchable-chevron-icon {
  width: 13px;
  height: 13px;
  color: #64748b;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.searchable-select-trigger.active .searchable-chevron-icon {
  transform: rotate(180deg);
  color: #f8485e;
}

.searchable-dropdown-panel {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: 290px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.18), 0 4px 16px -2px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: searchableFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

#project-searchable-dropdown {
  width: 380px;
}

.searchable-dropdown-panel.dropdown-align-right {
  left: auto;
  right: 0;
}

@keyframes searchableFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.searchable-dropdown-header {
  padding: 8px 10px 6px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.searchable-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.searchable-input-icon {
  position: absolute;
  left: 8px;
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.searchable-input-field {
  width: 100%;
  height: 32px;
  padding: 0 26px 0 28px;
  font-size: 0.78rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #1e293b;
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.searchable-input-field:focus {
  border-color: #f8485e;
  box-shadow: 0 0 0 2px rgba(248, 72, 94, 0.15);
}

.searchable-input-clear-btn {
  position: absolute;
  right: 6px;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
}

.searchable-input-clear-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.searchable-input-clear-btn svg,
.searchable-input-clear-btn i {
  width: 11px;
  height: 11px;
}

.searchable-quick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
  gap: 6px;
}

.quick-action-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-quick-action {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.btn-quick-action:hover {
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: underline;
}

.quick-action-sep {
  color: #94a3b8;
  font-size: 0.7rem;
}

.searchable-results-count {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 500;
  padding: 0 2px;
}

.searchable-options-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.searchable-options-list::-webkit-scrollbar {
  width: 6px;
}

.searchable-options-list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.searchable-options-list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.searchable-option-item {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}

.searchable-option-item:hover,
.searchable-option-item.highlighted {
  background: #f1f5f9;
  color: #0f172a;
}

.searchable-option-item.selected {
  background: #fff1f3;
  color: #f8485e;
  font-weight: 600;
}

.searchable-option-checkbox {
  width: 15px;
  height: 15px;
  border-radius: 3.5px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.searchable-option-item:hover .searchable-option-checkbox {
  border-color: #94a3b8;
}

.searchable-option-item.selected .searchable-option-checkbox {
  background: #f8485e;
  border-color: #f8485e;
}

.searchable-option-checkbox svg,
.searchable-option-checkbox i {
  width: 10px;
  height: 10px;
  stroke: #ffffff;
  stroke-width: 3;
  display: none;
}

.searchable-option-item.selected .searchable-option-checkbox svg,
.searchable-option-item.selected .searchable-option-checkbox i {
  display: block;
}

.searchable-option-content {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.searchable-code-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 5px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  white-space: nowrap;
  font-family: monospace;
}

.searchable-option-item.selected .searchable-code-badge {
  background: #ffe4e8;
  color: #f8485e;
  border-color: rgba(248, 72, 94, 0.3);
}

.searchable-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-option-check {
  width: 14px;
  height: 14px;
  color: #f8485e;
  flex-shrink: 0;
}

.searchable-dropdown-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  font-size: 0.73rem;
  color: #64748b;
  font-weight: 500;
}

.btn-dropdown-apply {
  background: #f8485e;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn-dropdown-apply:hover {
  background: #e11d48;
}

.btn-dropdown-apply:active {
  transform: scale(0.97);
}

.searchable-empty-state {
  padding: 20px 12px;
  text-align: center;
  color: #64748b;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.searchable-empty-state svg,
.searchable-empty-state i {
  width: 24px;
  height: 24px;
  color: #cbd5e1;
}

.lock-indicator {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f8485e;
  font-size: 0.85rem;
  margin-left: 5px;
  vertical-align: middle;
}

.btn-control-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #56555a;
  padding: 0 1rem;
  height: 38px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth, all 0.25s ease);
  position: relative;
}

.btn-control-toggle:hover, .btn-control-toggle.active {
  background: #fff1f3;
  border-color: rgba(248, 72, 94, 0.4);
  color: #f8485e;
}

.badge-filter-count {
  background: #f8485e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}

.btn-refresh {
  height: 38px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #56555a;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth, all 0.25s ease);
}

.btn-refresh:hover {
  background: #fff1f3;
  color: #f8485e;
  border-color: rgba(248, 72, 94, 0.4);
}

.btn-refresh.spinning svg {
  animation: spin 0.8s linear infinite;
}

/* ADVANCED FILTERS BAR */
.advanced-filters-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.75rem;
  border-radius: var(--radius-md, 14px);
  flex-wrap: wrap;
  animation: slideDown 0.3s ease-out;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-col {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-col label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #56555a;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.filter-actions {
  margin-left: auto;
}

.btn-clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff1f3;
  border: 1px solid rgba(248, 72, 94, 0.25);
  color: #f8485e;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth, all 0.25s ease);
}

.btn-clear-filters:hover {
  background: #ffe4e8;
  border-color: rgba(248, 72, 94, 0.45);
  color: #e0364c;
}

/* MAIN CONTENT */
.dashboard-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* FULLSCREEN CENTRALIZED LOADER OVERLAY */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-overlay.hidden * {
  animation-play-state: paused !important;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(248, 72, 94, 0.15);
  border-radius: 50%;
  border-top-color: #f8485e;
  border-bottom-color: #f8485e;
  animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 15px rgba(248, 72, 94, 0.2);
  margin-bottom: 1.5rem;
}

.loader-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  color: #56555A;
  font-weight: 500;
  animation: pulseText 2s infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* BASE GLASS CARD WITH STRICT GPU ISOLATION */
.glass-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transform: translateZ(0);
  contain: layout paint style;
}

/* 1. SCORECARDS GRID (5 COLUMNS) */
.scorecards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.scorecard-card {
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  transform: translateZ(0);
  contain: layout paint style;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.scorecard-card:hover {
  transform: translateY(-2px) translateZ(0);
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.card-glow-blue:hover { border-color: rgba(59, 130, 246, 0.5); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1); }
.card-glow-indigo:hover { border-color: rgba(99, 102, 241, 0.5); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1); }
.card-glow-gold:hover { border-color: rgba(248, 72, 94, 0.5); box-shadow: 0 8px 24px rgba(248, 72, 94, 0.1); }
.card-glow-violet:hover { border-color: rgba(168, 85, 247, 0.5); box-shadow: 0 8px 24px rgba(168, 85, 247, 0.1); }
.card-glow-cyan:hover { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 8px 24px rgba(6, 182, 212, 0.1); }
.card-glow-emerald:hover { border-color: rgba(16, 185, 129, 0.5); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.1); }

.scorecard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scorecard-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blue { background: #eff6ff; color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.2); }
.icon-indigo { background: #eef2ff; color: #4f46e5; border: 1px solid rgba(79, 70, 229, 0.2); }
.icon-gold { background: #fff1f3; color: #f8485e; border: 1px solid rgba(248, 72, 94, 0.25); }
.icon-violet { background: #f5f3ff; color: #7c3aed; border: 1px solid rgba(124, 58, 237, 0.2); }
.icon-cyan { background: #ecfeff; color: #0891b2; border: 1px solid rgba(8, 145, 178, 0.2); }
.icon-emerald { background: #ecfdf5; color: #059669; border: 1px solid rgba(5, 150, 105, 0.2); }

.scorecard-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.scorecard-tag {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #56555a;
}

.btn-kpi-help {
  background: transparent;
  border: none;
  color: #56555a;
  cursor: pointer;
  padding: 3px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.btn-kpi-help:hover {
  opacity: 1;
  color: #f8485e;
  background: #fff1f3;
  transform: scale(1.1);
}

.btn-kpi-help i,
.btn-kpi-help svg {
  width: 14px !important;
  height: 14px !important;
  display: block;
}

.scorecard-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scorecard-value {
  font-family: var(--font-title);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #1e293b;
  line-height: 1.1;
}

.value-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.kpi-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.badge-emerald { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.badge-cyan { background: #cffafe; border: 1px solid #67e8f9; color: #0e7490; }
.badge-gold { background: #fef3c7; border: 1px solid #fde047; color: #b45309; }
.badge-rose { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }

.kpi-cost-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  flex-shrink: 0;
}

.kpi-cost-mode-btn {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.15;
}

.kpi-cost-mode-btn:hover:not(.active) {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}

.kpi-cost-mode-btn#btn-kpi-cost-planned.active {
  background: #7c3aed;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(124, 58, 237, 0.28);
}

.kpi-cost-mode-btn#btn-kpi-cost-precierre.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.32);
}

.scorecard-submetrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
}

.submetric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sub-label {
  font-size: 0.7rem;
  color: #56555a;
}

.sub-val {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.submetric-divider {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
}

.text-emerald { color: #10b981; }
.text-rose { color: #f43f5e; }
.text-gold { color: #f8485e; }
.text-cyan { color: #0ea5e9; }
.text-muted { color: #56555a; }

/* 2. CHARTS SECTION GRID */
.charts-section-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  .charts-section-grid {
    grid-template-columns: 1fr;
  }
}

.chart-box {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transform: translateZ(0);
  contain: layout paint style;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chart-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chart-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff1f3;
  border: 1px solid rgba(248, 72, 94, 0.25);
  color: #f8485e;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-header h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: #56555a;
}

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  transform: translateZ(0);
  contain: layout paint style;
}

.chart-canvas-wrapper-tall {
  position: relative;
  width: 100%;
  height: 360px;
  transform: translateZ(0);
  contain: layout paint style;
}

/* 3. BREAKDOWNS SECTION */
.breakdown-section {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transform: translateZ(0);
  contain: layout paint style;
}

.breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.breakdown-tabs {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: #56555a;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: #1e293b;
  background: #ffffff;
}

.tab-btn.active {
  background: #f8485e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(248, 72, 94, 0.25);
}

.breakdown-content-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.25fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1150px) {
  .breakdown-content-grid {
    grid-template-columns: 1fr;
  }
}

.breakdown-chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 360px;
  height: 380px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md, 12px);
  padding: 1rem;
  box-sizing: border-box;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateZ(0);
  contain: layout paint style;
}

.breakdown-table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  min-height: 360px;
  max-height: 380px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
  box-sizing: border-box;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 4. OCCUPANCY & CAPACITY SECTION */
.occupancy-section {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transform: translateZ(0);
  contain: layout paint style;
}

.occupancy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.view-switch-group {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 0.3rem;
  border-radius: var(--radius-md);
  gap: 0.3rem;
}

.btn-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: #56555a;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-switch.active {
  background: #f8485e;
  border: 1px solid #f8485e;
  color: #fff;
}

.occupancy-charts-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1100px) {
  .occupancy-charts-grid {
    grid-template-columns: 1fr;
  }
}

.box-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.box-sub-header h4 {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.threshold-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.threshold-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.pill-over { background: #fee2e2; border: 1px solid #fca5a5; color: #b91c1c; }
.pill-opt { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.pill-under { background: #fef3c7; border: 1px solid #fde047; color: #b45309; }

/* SUBUNITS SUMMARY ROW (FULL WIDTH GRID) */
.subunits-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  width: 100%;
}

/* UNIT HERO CARD (EXECUTIVE SUMMARY) */
.unit-hero-container {
  margin-bottom: 1rem;
  width: 100%;
}

.unit-hero-card {
  display: grid;
  grid-template-columns: 1.15fr 1.65fr 0.8fr;
  gap: 1.25rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.unit-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #f8485e 0%, #e0364c 100%);
}

.unit-hero-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.unit-hero-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.unit-hero-badge-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.unit-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: #fff1f3;
  border: 1px solid rgba(248, 72, 94, 0.3);
  border-radius: 9999px;
  color: #f8485e;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.unit-hero-headcount {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #56555a;
  font-weight: 500;
}

.unit-hero-name {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unit-hero-metric-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.unit-hero-occ-val {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
}

.unit-hero-subtext {
  font-size: 0.8rem;
  color: #56555a;
}

.unit-hero-middle {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid #e2e8f0;
}

.unit-hero-breakdown-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #56555a;
}

.hero-legend {
  font-size: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.unit-hero-right {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.unit-hero-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm, 8px);
  text-align: center;
}

.unit-hero-stat-label {
  font-size: 0.68rem;
  color: #56555a;
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.unit-hero-stat-val {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

@media (max-width: 1024px) {
  .unit-hero-card {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .unit-hero-right {
    grid-template-columns: 1fr 1fr;
  }
}

.team-card {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  transform: translateZ(0);
  contain: layout paint style;
}

.team-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px) translateZ(0);
}

.team-card.team-card-excluded {
  opacity: 0.52;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  filter: grayscale(0.2);
}

.team-card.team-card-excluded:hover {
  opacity: 0.85;
}

.team-card-checkbox {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #2563eb;
  margin: 0;
  flex-shrink: 0;
}

.team-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-headcount {
  font-size: 0.70rem;
  color: #56555a;
  white-space: nowrap;
}

.team-metrics-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.team-occ-val {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
}

/* TEAM CARD BREAKDOWN */
.team-breakdown-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.15rem;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid #e2e8f0;
}

.team-breakdown-bar {
  display: flex;
  height: 6px;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
  background: #e2e8f0;
}

.team-bar-exec {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s ease;
}

.team-bar-fc {
  background: linear-gradient(90deg, #a855f7, #c084fc);
  transition: width 0.3s ease;
}

.team-bar-abs {
  background: linear-gradient(90deg, #64748b, #94a3b8);
  transition: width 0.3s ease;
}

.team-breakdown-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.70rem;
  color: #94a3b8;
  gap: 0.25rem;
}

.team-breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.team-breakdown-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-exec {
  background: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.dot-fc {
  background: #c084fc;
  box-shadow: 0 0 6px rgba(192, 132, 252, 0.4);
}

.dot-abs {
  background: #94a3b8;
  box-shadow: 0 0 6px rgba(148, 163, 184, 0.4);
}

/* MATRIX TABLE */
.occupancy-matrix-section {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1rem;
}

.matrix-hint {
  font-size: 0.75rem;
  color: #56555a;
}

.matrix-table-container {
  overflow-x: auto;
  overflow-y: auto;
  min-height: 480px;
  max-height: calc(100vh - 220px);
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  background: #ffffff;
}

/* GLASS TABLES */
.glass-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.glass-table th {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
  color: #56555a !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.glass-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
  white-space: nowrap;
}

.glass-table tbody tr {
  transition: background 0.2s ease;
}

.glass-table tbody tr:hover {
  background: #f8fafc;
}

.text-right { text-align: right; }
/* MATRIX LEGEND INDICATORS */
.matrix-legend-indicators {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #56555a;
  font-weight: 500;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-over { background: #dc2626; box-shadow: 0 0 6px rgba(220, 38, 38, 0.4); }
.dot-optimal { background: #047857; box-shadow: 0 0 6px rgba(4, 120, 87, 0.4); }
.dot-under { background: #b45309; box-shadow: 0 0 6px rgba(180, 83, 9, 0.4); }
.dot-zero { background: #94a3b8; }

/* ==========================================================
   MATRIX TABLE: CAPACITY PLANNING DESIGN & THREE-TIER STICKY HEADERS
   ========================================================== */

.matrix-table {
  table-layout: fixed !important;
  width: max-content !important;
  min-width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

/* PROMEDIO MENSUAL & PROMEDIO SEMANAL LOAD ROWS */
.global-load-row td,
.global-load-row th {
  padding: 0.35rem 0.3rem !important;
  font-size: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  height: 32px !important;
  box-sizing: border-box !important;
  line-height: 1.2 !important;
}

.monthly-load-row {
  height: 32px !important;
}

.monthly-load-row td,
.monthly-load-row th {
  position: sticky !important;
  top: 0px !important;
  z-index: 28 !important;
  background: #f1f5f9 !important;
  background-color: #f1f5f9 !important;
  opacity: 1 !important;
  height: 32px !important;
  box-sizing: border-box !important;
  color: #56555a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.weekly-load-row {
  height: 32px !important;
}

.weekly-load-row td,
.weekly-load-row th {
  position: sticky !important;
  top: 32px !important;
  z-index: 27 !important;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  height: 32px !important;
  box-sizing: border-box !important;
  color: #56555a !important;
}

.matrix-column-headers-row {
  height: 34px !important;
}

.matrix-column-headers-row th {
  position: sticky !important;
  top: 64px !important;
  z-index: 26 !important;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
  border-bottom: 2px solid #e2e8f0 !important;
  color: #56555a !important;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 0.35rem 0.25rem !important;
  height: 34px !important;
  box-sizing: border-box !important;
}

.matrix-table.view-monthly .matrix-column-headers-row th {
  top: 32px !important;
}

/* STICKY COLUMNS INTERSECTION (High Z-Index) */
.glass-table thead tr.monthly-load-row .sticky-col,
.glass-table thead tr.monthly-load-row th.sticky-col,
.glass-table thead tr.monthly-load-row td.sticky-col {
  position: sticky !important;
  top: 0px !important;
  z-index: 55 !important;
  background: #f1f5f9 !important;
  background-color: #f1f5f9 !important;
  opacity: 1 !important;
  height: 32px !important;
  box-sizing: border-box !important;
}

.glass-table thead tr.weekly-load-row .sticky-col,
.glass-table thead tr.weekly-load-row th.sticky-col,
.glass-table thead tr.weekly-load-row td.sticky-col {
  position: sticky !important;
  top: 32px !important;
  z-index: 54 !important;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
  height: 32px !important;
  box-sizing: border-box !important;
}

.glass-table thead tr.matrix-column-headers-row .sticky-col,
.glass-table thead tr.matrix-column-headers-row th.sticky-col,
.glass-table thead tr.matrix-column-headers-row th.col-prof,
.glass-table thead tr.matrix-column-headers-row th.col-subunit {
  position: sticky !important;
  top: 64px !important;
  z-index: 53 !important;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
  height: 34px !important;
  box-sizing: border-box !important;
}

.matrix-table.view-monthly thead tr.matrix-column-headers-row .sticky-col,
.matrix-table.view-monthly thead tr.matrix-column-headers-row th.sticky-col,
.matrix-table.view-monthly thead tr.matrix-column-headers-row th.col-prof,
.matrix-table.view-monthly thead tr.matrix-column-headers-row th.col-subunit {
  top: 32px !important;
}

/* TOTAL CELL COLORS */
.total-cell {
  vertical-align: middle;
  text-align: center;
  font-weight: 700;
}

.matrix-cell {
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  padding: 0.35rem 0.2rem !important;
  font-size: 0.75rem !important;
}

.matrix-table.view-monthly .matrix-cell {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
}

.matrix-cell.cell-overallocated {
  background: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
  color: #dc2626 !important;
  font-weight: 700;
}

.matrix-cell.cell-optimal {
  background: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #047857 !important;
  font-weight: 700;
}

.matrix-cell.cell-underallocated {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
  font-weight: 700;
}

.matrix-cell.cell-empty {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #94a3b8 !important;
  font-weight: 500;
}

/* Solid OPAQUE colors for sticky header summary rows (Monthly & Weekly loads) */
.monthly-load-row .total-cell,
.weekly-load-row .total-cell,
.global-load-row .total-cell {
  background-color: #f8fafc !important;
  opacity: 1 !important;
}

.monthly-load-row .total-cell.cell-overallocated,
.weekly-load-row .total-cell.cell-overallocated,
.global-load-row .total-cell.cell-overallocated {
  background-color: #fef2f2 !important;
  border: 1px solid #fca5a5 !important;
  color: #dc2626 !important;
  font-weight: 700;
}

.monthly-load-row .total-cell.cell-optimal,
.weekly-load-row .total-cell.cell-optimal,
.global-load-row .total-cell.cell-optimal {
  background-color: #ecfdf5 !important;
  border: 1px solid #a7f3d0 !important;
  color: #047857 !important;
  font-weight: 700;
}

.monthly-load-row .total-cell.cell-underallocated,
.weekly-load-row .total-cell.cell-underallocated,
.global-load-row .total-cell.cell-underallocated {
  background-color: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
  font-weight: 700;
}

.monthly-load-row .total-cell.cell-empty,
.global-load-row.monthly-load-row td.cell-empty {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #94a3b8 !important;
  font-weight: 500;
}

.weekly-load-row .total-cell.cell-empty,
.global-load-row.weekly-load-row td.cell-empty {
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #94a3b8 !important;
  font-weight: 500;
}

/* STICKY COLUMNS (Profesional, Subunidad, Media Anual) */
.glass-table th.sticky-col,
.glass-table td.sticky-col {
  position: sticky;
  box-sizing: border-box;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  background-color: #ffffff !important;
  opacity: 1 !important;
}

.glass-table th.col-prof,
.glass-table td.col-prof {
  left: 0 !important;
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
}

.glass-table th.col-subunit,
.glass-table td.col-subunit {
  left: 200px !important;
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
  text-align: center !important;
  border-right: 2px solid #e2e8f0 !important;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.04);
}

.glass-table tbody td.sticky-col {
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  z-index: 20 !important;
}

.glass-table tbody tr:hover td.sticky-col {
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
}

.total-indicator-label {
  font-weight: 700;
  color: #56555a;
  font-size: 0.75rem;
}

/* WEEK HEADERS & MONTH HEADERS */
.week-header-cell,
.month-header-cell,
.matrix-table td.global-week-cell,
.matrix-column-headers-row th.week-header-cell,
.matrix-column-headers-row th.month-header-cell {
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  box-sizing: border-box !important;
  padding: 0.3rem 0.15rem !important;
  text-align: center;
  background: #f8fafc !important;
  background-color: #f8fafc !important;
  opacity: 1 !important;
  color: #56555a !important;
  transition: var(--transition-smooth);
}

.matrix-table.view-monthly .month-header-cell,
.matrix-table.view-monthly td.global-month-cell,
.matrix-table.view-monthly .matrix-column-headers-row th {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
}

.matrix-table.view-monthly .matrix-column-headers-row th.col-prof {
  width: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
}

.matrix-table.view-monthly .matrix-column-headers-row th.col-subunit {
  width: 140px !important;
  min-width: 140px !important;
  max-width: 140px !important;
}

.week-header-cell:hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}

.week-date {
  display: block;
  font-size: 0.56rem;
  color: #64748b;
  font-weight: 400;
  text-transform: none;
  margin-top: 0.05rem;
  letter-spacing: -0.02em;
}

/* CURRENT WEEK HIGHLIGHT */
.current-week-header {
  background: #fff1f3 !important;
  box-shadow: inset 0 0 0 1.5px rgba(248, 72, 94, 0.45) !important;
  color: #56555a !important;
  font-weight: 700 !important;
}

.current-week-header .week-date {
  color: #64748b !important;
  font-weight: 500 !important;
}

.current-week-cell {
  position: relative;
  box-shadow: inset 0 0 0 1.5px rgba(248, 72, 94, 0.45) !important;
}

.matrix-cell {
  font-size: 0.73rem;
  font-weight: 700;
  padding: 0.35rem 0.25rem !important;
  text-align: center;
  border-radius: 3px;
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  box-sizing: border-box;
}

/* ==========================================================
   TEAM ABSENCES SECTION
   ========================================================== */
.absences-section {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  transform: translateZ(0);
  contain: layout paint style;
}

.absences-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.abs-stat-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
  transform: translateZ(0);
  contain: layout paint style;
}

.abs-stat-card:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px) translateZ(0);
}

.abs-stat-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: #56555a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.abs-stat-val-group {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.abs-stat-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.1;
  color: #1e293b;
}

.abs-stat-unit {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.abs-table-search-box {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
}

.abs-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #1e293b;
  font-size: 0.82rem;
  width: 210px;
}

.abs-search-input::placeholder {
  color: #94a3b8;
}

.abs-reason-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
}

.badge-reason-vacation {
  background: #cffafe;
  color: #0891b2;
  border: 1px solid #a5f3fc;
}

.badge-reason-sick {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.badge-reason-personal {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde047;
}

.badge-reason-other {
  background: #f3e8ff;
  color: #9333ea;
  border: 1px solid #d8b4fe;
}

.abs-status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.status-upcoming {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}

.status-current {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.15);
}

.status-past {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Absences Table Alignment and Sorting */
#table-absences th:not(:first-child),
#table-absences td:not(:first-child) {
  text-align: center !important;
}

#table-absences th:first-child,
#table-absences td:first-child {
  text-align: left !important;
}

#table-absences th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

#table-absences th.sortable-th:hover {
  background: #f1f5f9 !important;
  color: #f8485e !important;
}

#table-absences th.sortable-th .th-content {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

#table-absences th.sortable-th .sort-indicator {
  font-size: 0.7rem;
  opacity: 0.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#table-absences th.sortable-th:hover .sort-indicator {
  opacity: 0.8;
}

#table-absences th.sort-active {
  color: #f8485e !important;
}

#table-absences th.sort-active .sort-indicator {
  opacity: 1;
  color: #f8485e;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 900px) {
  .analytics-container {
    padding: 1rem;
  }
  
  .analytics-navbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-controls {
    justify-content: space-between;
  }
}

/* ==========================================================
   KPI HELP MODAL (SUITE COMPLIANT)
   ========================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-container {
  max-width: 620px;
  width: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header .modal-title-group,
.modal-title-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.85rem !important;
  flex-wrap: nowrap !important;
}

.modal-header .modal-title-icon,
.modal-title-group .modal-title-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header .modal-title-icon i,
.modal-header .modal-title-icon svg,
.modal-title-group > i,
.modal-title-group > svg {
  width: 20px !important;
  height: 20px !important;
  flex-shrink: 0;
}

.modal-header h3,
.modal-title-group h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #56555a;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.modal-close-btn i,
.modal-close-btn svg {
  width: 18px !important;
  height: 18px !important;
}

.modal-body {
  padding: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-info-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.info-block-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #56555a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.formula-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #f8485e;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.86rem;
  color: #1e293b;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
}

.explanation-p {
  margin: 0;
  color: #374151;
  font-size: 0.88rem;
  line-height: 1.55;
}

.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.metrics-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.84rem;
}

.metrics-item strong {
  color: #f8485e;
  font-weight: 600;
  white-space: nowrap;
}

.metrics-item span {
  color: #4b5563;
}

.modal-footer {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  gap: 0.75rem;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.btn-modal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f8485e;
  border: 1px solid #f8485e;
  color: #ffffff;
  padding: 0.55rem 1.35rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(248, 72, 94, 0.25);
  line-height: 1.2;
  white-space: nowrap;
}

.btn-modal-primary:hover:not(:disabled) {
  background: #e0364c;
  border-color: #e0364c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(248, 72, 94, 0.35);
}

.btn-modal-primary:disabled {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.8;
}

.btn-modal-primary i,
.btn-modal-primary svg {
  width: 16px !important;
  height: 16px !important;
}

.btn-modal-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}

.btn-modal-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-modal-secondary:disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-modal-secondary i,
.btn-modal-secondary svg {
  width: 16px !important;
  height: 16px !important;
  color: #64748b;
}

.btn-modal-secondary:hover:not(:disabled) i,
.btn-modal-secondary:hover:not(:disabled) svg {
  color: #0f172a;
}

.btn-modal-secondary.text-rose {
  color: #e11d48;
  border-color: #fecdd3;
  background: #fff1f2;
}

.btn-modal-secondary.text-rose:hover {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #be123c;
}

.btn-modal-secondary.btn-modal-accent {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.btn-modal-secondary.btn-modal-accent:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.btn-modal-secondary.btn-modal-accent i,
.btn-modal-secondary.btn-modal-accent svg {
  color: #2563eb;
}

/* ==========================================================
   MODULE MAIN NAVIGATION (ECONOMIC VS CAPACITY TABS)
   ========================================================== */
.module-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.6rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  gap: 1rem;
  flex-wrap: wrap;
}

.module-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.module-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1.15rem;
  border-radius: 7px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #56555a;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.module-nav-btn i, .module-nav-btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.module-nav-btn:hover {
  color: #1e293b;
  background: #f1f5f9;
}

.module-nav-btn.active {
  color: #f8485e;
  background: #fff1f3;
  border-color: rgba(248, 72, 94, 0.35);
  box-shadow: 0 2px 6px rgba(248, 72, 94, 0.12);
}

.module-nav-btn.active i, .module-nav-btn.active svg {
  color: #f8485e !important;
  transform: scale(1.08);
}

.module-nav-scope-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 500;
  color: #56555a;
  background: #f8fafc;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.module-nav-scope-hint i, .module-nav-scope-hint svg {
  width: 14px;
  height: 14px;
  color: #f8485e;
}

.module-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeIn 0.3s ease-out;
}

.filter-economic-only {
  transition: all 0.25s ease;
}

.control-bar.capacity-mode .filter-economic-only {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Help circle button (Devoteam Corporate Style) */
.btn-help-circle {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  color: #56555A;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: all 0.2s ease-in-out;
  height: 38px;
  width: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.btn-help-circle:hover {
  background: #FFF1F3 !important;
  color: #F8485E !important;
  border-color: rgba(248, 72, 94, 0.35) !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(248, 72, 94, 0.15);
}

/* Modal Section Info (General Help) */
.modal-card {
  max-width: 680px;
  width: 90%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-section-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-section-info-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.modal-section-info-card-header i,
.modal-section-info-card-header svg {
  color: #f8485e;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.modal-section-info-card p,
.modal-section-info-card ul {
  margin: 0;
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.55;
}

.modal-section-info-card ul {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* ==========================================================================
   SECTION: PROFILES & JOB RANKS CATALOG STYLES
   ========================================================================== */

.control-bar.reports-mode .filter-economic-only,
.control-bar.reports-mode .control-group-year {
  display: none !important;
}

/* ==========================================================================
   ========================================================================== */

.control-bar.profiles-mode .filter-economic-only,
.control-bar.profiles-mode .control-group-year {
  display: none !important;
}

.profiles-scorecards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1.15rem;
  margin-bottom: 0;
}

.profiles-scorecards-grid .scorecard-card {
  min-height: 120px;
}

.profiles-table-section {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profiles-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.profiles-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.profiles-title-group h3 {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.profiles-title-group .chart-subtitle,
.section-subtitle {
  font-size: 0.8rem;
  color: #56555a;
  margin: 0.2rem 0 0 0;
  line-height: 1.4;
  font-weight: 400;
}

.unit-context-pill {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.profiles-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.btn-action-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-action-secondary.btn-action-accent {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.btn-action-secondary.btn-action-accent:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.btn-action-secondary i,
.btn-action-secondary svg {
  width: 15px;
  height: 15px;
}

/* Filter Bar & Search */
.profiles-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.profiles-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 270px;
  max-width: 420px;
}

.profiles-search-box .search-icon {
  position: absolute;
  left: 0.85rem;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.profiles-search-input {
  width: 100%;
  height: 38px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 2.2rem 0 2.45rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.84rem;
  color: #1e293b;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.profiles-search-input:focus {
  border-color: #f8485e;
  box-shadow: 0 0 0 3px rgba(248, 72, 94, 0.12);
}

.profiles-search-box .btn-clear-search {
  position: absolute;
  right: 0.6rem;
  width: 22px;
  height: 22px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.profiles-search-box .btn-clear-search:hover {
  color: #1e293b;
  background: #e2e8f0;
}

.profiles-search-box .btn-clear-search i,
.profiles-search-box .btn-clear-search svg {
  width: 13px;
  height: 13px;
}

.profiles-filter-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.profiles-filter-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.profiles-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.profiles-filter-label i,
.profiles-filter-label svg {
  width: 14px;
  height: 14px;
  color: #94a3b8;
}

.profiles-filter-item .select-wrapper {
  width: auto;
  min-width: 175px;
  max-width: 230px;
}

/* Generic Form Inputs & Labels */
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.custom-input {
  width: 100%;
  height: 38px;
  padding: 0.45rem 0.75rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.85rem;
  color: #1e293b;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.custom-input:focus {
  border-color: #f8485e;
  box-shadow: 0 0 0 3px rgba(248, 72, 94, 0.15);
}

.custom-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

.custom-input::placeholder {
  color: #94a3b8;
}

/* Profiles Table Specifics */
.profiles-table td {
  vertical-align: middle;
  padding: 0.75rem 1rem;
}

.prof-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.prof-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #a5b4fc;
}

.prof-info {
  display: flex;
  flex-direction: column;
}

.prof-name {
  font-weight: 600;
  font-size: 0.87rem;
  color: #1e293b;
}

.prof-email {
  font-size: 0.76rem;
  color: #64748b;
}

.subunit-squad-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.subunit-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0f172a;
}

.squad-tag {
  font-size: 0.8rem;
  color: #64748b;
}

.select-table-inline {
  width: 100% !important;
  height: 34px !important;
  font-size: 0.82rem !important;
  padding: 0 1.8rem 0 0.65rem !important;
  border-radius: 6px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.55rem center !important;
  background-size: 0.75rem !important;
}

.select-table-inline:focus {
  outline: none;
  border-color: #f8485e !important;
  box-shadow: 0 0 0 2px rgba(248, 72, 94, 0.15) !important;
}

.select-table-inline.is-pending {
  border-color: #f59e0b !important;
  background-color: #fffbeb !important;
  color: #b45309 !important;
  font-weight: 500;
}

.cost-cell-val {
  font-weight: 600;
  font-size: 0.88rem;
  color: #0f172a;
}

.origin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.origin-badge.origin-rank {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.origin-badge.origin-custom {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.origin-badge.origin-none {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.btn-icon-table {
  background: transparent;
  border: none;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-icon-table:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.btn-icon-table.btn-cost-override:hover {
  background: #fef3c7;
  color: #b45309;
}

.profiles-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-counter {
  font-size: 0.8rem;
  color: #64748b;
}

.footer-legend {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #64748b;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-purple { background: #9333ea; }
.dot-amber { background: #f59e0b; }
.dot-gray { background: #94a3b8; }

/* Modals Extra Styles */
.modal-lg {
  max-width: 820px !important;
}

.ranks-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.ranks-alert-banner.banner-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.banner-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bulk-instructions-banner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.code-pill-preview {
  display: inline-block;
  background: #1e293b;
  color: #f8fafc;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin: 0.25rem 0;
}

.bulk-input-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
  border: 1px solid #e2e8f0;
  width: fit-content;
}

.btn-tab-sub {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.45rem 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-tab-sub:hover {
  color: #0f172a;
}

.btn-tab-sub.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.custom-textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  resize: vertical;
}

.custom-textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.file-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  color: #64748b;
  transition: all 0.2s ease;
}

.file-dropzone:hover {
  border-color: #6366f1;
  background: #f5f3ff;
  color: #4338ca;
}

.dropzone-icon {
  width: 32px;
  height: 32px;
  color: #94a3b8;
}

.badge-count {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #334155;
}

.status-badge-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
}

.status-badge-preview.valid {
  background: #dcfce7;
  color: #15803d;
}

.status-badge-preview.warning {
  background: #fef3c7;
  color: #b45309;
}

.status-badge-preview.invalid {
  background: #fee2e2;
  color: #b91c1c;
}

.bulk-feedback {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.bulk-feedback.feedback-success {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.bulk-feedback.feedback-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.icon-purple {
  background: rgba(147, 51, 234, 0.1);
  color: #9333ea;
}

.icon-rose {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
}

.icon-amber {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

/* Profiles Table Container & Sticky Header */
.profiles-table-section {
  display: flex;
  flex-direction: column;
}

.profiles-table-section .table-responsive-wrapper {
  max-height: 640px;
  min-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.profiles-table-section .glass-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Toggle Presales Checkbox in Occupancy / Consolidated Subunit */
.toggle-presales-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.65rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.18s ease;
}

.toggle-presales-checkbox:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.toggle-presales-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--color-devoteam-coral, #f8485e);
  width: 14px;
  height: 14px;
  margin: 0;
}

.hero-presales-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.55rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.18s ease;
}

.hero-presales-toggle:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Header Unit Switcher final override against global select rules */
.badge-unit-active select,
#header-unit-switcher {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #047857 !important;
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer !important;
  outline: none !important;
  padding: 0 4px !important;
  margin: 0 !important;
  box-shadow: none !important;
  height: auto !important;
  width: auto !important;
  appearance: auto !important;
  -webkit-appearance: auto !important;
  -moz-appearance: auto !important;
}

.badge-unit-active select option,
#header-unit-switcher option {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 500 !important;
  padding: 6px 12px !important;
}

/* ==========================================================================
   SECTION: PRESSURE & FATIGUE ANALYTICAL MODEL (#panel-pressure)
   Native Aitana Suite / Devoteam Executive Design Language
   ========================================================================== */

/* Coral Scorecard Glow & Icon (Complements blue, gold, violet, emerald, cyan) */
.card-glow-coral::before {
  background: linear-gradient(90deg, #f8485e, #fb7185);
}

.icon-coral {
  background: rgba(248, 72, 94, 0.1);
  color: #f8485e;
  border: 1px solid rgba(248, 72, 94, 0.22);
}

/* Toolbar Week Picker inside .profiles-actions-bar */
.pf-week-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  padding: 0.28rem 0.45rem 0.28rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.pf-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pf-toolbar-label svg {
  width: 14px;
  height: 14px;
  color: #f8485e;
}

.btn-action-secondary.active {
  background: #fff1f3;
  border-color: rgba(248, 72, 94, 0.45);
  color: #e11d48;
  box-shadow: 0 2px 6px rgba(248, 72, 94, 0.12);
}

.btn-action-secondary.active svg {
  color: #f8485e;
}

/* Collapsible Parameter Simulator Drawer */
.pf-params-drawer {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-left: 4px solid #f8485e;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: inset 0 1px 0 #ffffff, 0 4px 12px rgba(15, 23, 42, 0.04);
  animation: fadeIn 0.22s ease-out;
}

.pf-params-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.pf-params-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pf-params-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #fff1f3;
  border: 1px solid rgba(248, 72, 94, 0.25);
  color: #f8485e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-params-icon svg {
  width: 17px;
  height: 17px;
}

.pf-params-title-group strong {
  display: block;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.pf-params-hint {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.1rem;
}

.pf-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
  gap: 0.85rem;
  align-items: stretch;
}

.pf-param-control {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  background: #ffffff;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
  transition: border-color 0.18s ease;
}

.pf-param-control:hover {
  border-color: #cbd5e1;
}

.pf-param-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.pf-param-label-row label {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1e293b;
}

.pf-param-badge {
  font-size: 0.71rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pf-param-control input[type="range"] {
  width: 100%;
  accent-color: #f8485e;
  cursor: pointer;
  margin: 0.2rem 0;
}

.pf-param-control small {
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.35;
}

.pf-param-toggles {
  justify-content: flex-start;
  gap: 0.48rem;
}

/* ============================================================================
   SINGLE FILTER NORMAL WIDTH IN CONTROL BAR & SECTION FILTER BARS
   ============================================================================ */
.control-bar.capacity-mode .control-left,
.control-bar.profiles-mode .control-left,
.control-bar.reports-mode .control-left {
  flex: 0 1 auto;
  justify-content: flex-start;
}

.control-bar.capacity-mode #control-group-subunit,
.control-bar.profiles-mode #control-group-subunit,
.control-bar.reports-mode #control-group-subunit {
  flex: 0 0 280px;
  width: 280px;
  max-width: 320px;
  min-width: 220px;
}

#panel-pressure .profiles-filter-bar .profiles-search-box {
  flex: 0 1 380px;
  max-width: 420px;
  min-width: 240px;
}

#panel-pressure .profiles-filter-controls {
  flex: 0 1 auto;
  justify-content: flex-end;
}

#panel-pressure .profiles-filter-item {
  flex: 0 0 auto;
}

#panel-pressure .profiles-filter-item .select-wrapper {
  width: auto;
  min-width: 195px;
  max-width: 260px;
}

/* Unit Hero Card Customizations for Pressure & Fatigue (Matching #panel-capacity 100%) */
.pf-unit-hero {
  margin-bottom: 1.25rem;
  align-items: stretch;
}

.pf-unit-hero .unit-hero-left {
  justify-content: center;
}

.pf-hero-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pf-hero-metric-divider {
  width: 1px;
  height: 36px;
  background: #cbd5e1;
  margin: 0 0.35rem;
}

.pf-unit-hero .unit-hero-occ-val {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.pf-unit-hero .unit-hero-right {
  grid-template-columns: repeat(2, minmax(145px, 1fr));
  grid-template-rows: repeat(2, 1fr);
  align-self: stretch;
  height: 100%;
  box-sizing: border-box;
}

.pf-unit-hero .unit-hero-stat-box {
  min-width: 145px;
  height: 100%;
  box-sizing: border-box;
}

.pf-unit-hero #pf-hero-stat-top-person {
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.pf-hero-middle {
  gap: 0.6rem;
  align-self: stretch;
  justify-content: space-between;
  box-sizing: border-box;
}

.pf-hero-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pf-hero-bar-title {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
}

.pf-hero-bar-legend {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.76rem;
  color: #334155;
}

.pf-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.28rem;
  vertical-align: middle;
}

.pf-dot-pressure {
  background: #2563eb;
}

.pf-dot-fatigue {
  background: #ea580c;
}

.pf-hero-stacked-bg {
  height: 12px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.pf-hero-seg-pressure {
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
  height: 100%;
  transition: width 0.35s ease;
}

.pf-hero-seg-fatigue {
  background: linear-gradient(90deg, #ea580c 0%, #f97316 100%);
  height: 100%;
  transition: width 0.35s ease;
}

.pf-executive-narrative {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #334155;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}

.pf-executive-narrative strong {
  color: #0f172a;
  font-weight: 700;
}

/* Squad Summary Cards (.team-card inside #pf-squads-summary-cards) */
.team-card.pf-squad-card {
  cursor: pointer;
  position: relative;
}

.team-card.pf-squad-card.active-squad-filter {
  border-color: #f8485e;
  background: linear-gradient(180deg, #fff1f3 0%, #ffffff 45%);
  box-shadow: 0 6px 16px rgba(248, 72, 94, 0.14);
}

.pf-squad-card .team-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.pf-squad-card .team-info-col {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.pf-squad-card .team-occ-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  text-align: right;
  line-height: 1.1;
}

.pf-squad-card .team-occ-val {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.pf-squad-card .team-occ-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.64rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  margin-top: 0.18rem;
}

.pf-squad-card-submetrics {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.6rem;
  background: #f8fafc;
  border-radius: 7px;
  border: 1px solid #f1f5f9;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.71rem;
  color: #475569;
}

.pf-squad-card-submetrics span {
  white-space: nowrap;
}

.pf-squad-card-submetrics span strong {
  color: #0f172a;
  font-weight: 700;
}

.pf-squad-stacked-mini {
  width: 100%;
  height: 7px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

/* Inline Legend in Section Header */
.pf-inline-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pf-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Prevent duplicate arrow icons beside .custom-select (which already has a built-in SVG chevron) */
.select-wrapper .select-arrow {
  display: none !important;
}

/* Matrix Section Header & Legend Toolbar (Never compressed beside Centrar Semana button) */
.pf-matrix-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}

.pf-matrix-header .chart-title-group {
  flex: 1 1 380px;
  min-width: 280px;
}

.pf-matrix-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex: 0 1 auto;
}

.pf-matrix-legend {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.pf-btn-center-week {
  flex-shrink: 0;
  white-space: nowrap;
}

.pf-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.pf-swatch-pressure {
  background: #2563eb;
}

.pf-swatch-fatigue {
  background: #ea580c;
}

.pf-thin-pill-demo {
  display: inline-block;
  padding: 0.05rem 0.38rem;
  border-radius: 4px;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* ============================================================================
   TABLES: OPAQUE STICKY HEADERS & NO CLIPPED DATA (#pf-ranking-table & #pf-worked-table)
   ============================================================================ */
.pf-ranking-table-wrapper {
  max-height: 580px;
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.pf-worked-table-wrapper {
  max-height: none;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

#pf-ranking-table,
#pf-worked-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#pf-ranking-table thead th,
#pf-worked-table thead th {
  position: sticky;
  top: 0;
  z-index: 25;
  background-color: #f8fafc !important;
  background-image: none !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
  color: #475569;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 0.75rem;
  border-bottom: 2px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  white-space: nowrap;
}

/* Center all columns in Ranking table EXCEPT column 2 (Profesional) */
#pf-ranking-table thead th:not(:nth-child(2)),
#pf-ranking-table tbody td:not(:nth-child(2)) {
  text-align: center !important;
}

#pf-ranking-table thead th:nth-child(2),
#pf-ranking-table tbody td:nth-child(2) {
  text-align: left !important;
}

/* Center all columns in Worked Example table EXCEPT column 1 (Proyecto Activo) */
#pf-worked-table thead th:not(:first-child),
#pf-worked-table tbody td:not(:first-child),
#pf-worked-table tfoot td:not(:first-child) {
  text-align: center !important;
}

#pf-worked-table thead th:first-child,
#pf-worked-table tbody td:first-child,
#pf-worked-table tfoot td:first-child {
  text-align: left !important;
}

#pf-ranking-table tbody td {
  padding: 0.65rem 0.75rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.81rem;
  color: #1e293b;
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: nowrap;
}

#pf-ranking-table tbody tr:nth-child(even) td {
  background-color: #fcfdfe;
}

#pf-ranking-table tbody tr:hover td {
  background-color: #f1f5f9 !important;
}

#pf-ranking-table tbody td .prof-name {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 0.83rem;
}

#pf-ranking-table tbody td .prof-sub {
  white-space: nowrap;
  font-size: 0.71rem;
}

/* Worked Example Table: Allow natural wrapping so formulas, project names & chips never cut off */
#pf-worked-table tbody td {
  padding: 0.75rem 0.85rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.81rem;
  color: #1e293b;
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  white-space: normal !important;
  word-break: break-word;
}

#pf-worked-table tbody td.text-right,
#pf-worked-table tbody td.text-center {
  white-space: nowrap !important;
}

#pf-worked-table tbody td.pf-td-teammates {
  white-space: normal !important;
}

.pf-ranking-table tbody tr {
  cursor: pointer;
}

.pf-ranking-table tbody tr.pf-row-selected td {
  background-color: #fff1f3 !important;
}

.pf-ranking-table tbody tr.pf-row-selected td:first-child {
  box-shadow: inset 4px 0 0 #f8485e;
}

.pf-ranking-table tbody tr.pf-row-selected:hover td {
  background-color: #ffe4e6 !important;
}

.pf-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.75rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #475569;
}

.pf-rank-badge.rank-top {
  background: #fff1f3;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

/* Avatar Color Variants for Ranking & Small Multiples */
.prof-avatar.avatar-high {
  background: linear-gradient(135deg, #fff1f3, #ffe4e6);
  color: #e11d48;
  border-color: #fecdd3;
}

.prof-avatar.avatar-med {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c;
  border-color: #fed7aa;
}

.prof-avatar.avatar-low {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
  border-color: #bfdbfe;
}

/* Squad Pills */
.pf-squad-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pf-squad-pill.squad-s1 { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pf-squad-pill.squad-s2 { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
.pf-squad-pill.squad-s3 { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pf-squad-pill.squad-s4 { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pf-squad-pill.squad-other { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }

/* Stacked Horizontal Bar in Ranking Table */
.pf-stacked-bar-cell {
  display: flex;
  flex-direction: column;
  gap: 0.26rem;
  width: 100%;
  max-width: 210px;
  min-width: 165px;
  margin: 0 auto;
}

.pf-stacked-bar-track {
  width: 100%;
  height: 10px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  border: 1px solid #e2e8f0;
}

.pf-bar-seg-pressure {
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  height: 100%;
  transition: width 0.25s ease;
}

.pf-bar-seg-fatigue {
  background: linear-gradient(90deg, #ea580c, #f97316);
  height: 100%;
  transition: width 0.25s ease;
}

.pf-stacked-bar-sub {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.69rem;
  color: #64748b;
  font-weight: 500;
}

/* Load Index Badges */
.pf-load-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  min-width: 48px;
  border: 1px solid transparent;
}

.pf-load-high {
  background: #fff1f3;
  color: #be123c;
  border-color: #fecdd3;
}

.pf-load-med {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.pf-load-mod {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.pf-load-low {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.pf-thin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.73rem;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.pf-peak-week-tag {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
  margin-left: 0.25rem;
}

/* Worked Example Section & Visual Formula Pipeline */
.pf-pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}

@media (max-width: 1100px) {
  .pf-pipeline-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .pf-pipeline-grid {
    grid-template-columns: 1fr;
  }
}

.pf-pipeline-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  position: relative;
}

.pf-pipeline-card.pf-pipeline-total {
  background: linear-gradient(135deg, #fff1f3 0%, #ffffff 100%);
  border-color: rgba(248, 72, 94, 0.35);
}

.pf-pipeline-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.pf-pipeline-step-tag {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.14rem 0.48rem;
  border-radius: 5px;
  background: #e2e8f0;
  color: #334155;
}

.pf-pipeline-val {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.pf-pipeline-title {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.pf-pipeline-desc {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.4;
}

.pf-teammate-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
}

.pf-teammate-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.52rem;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.74rem;
  color: #334155;
  white-space: nowrap;
}

.pf-teammate-chip strong {
  color: #0f172a;
  font-weight: 700;
}

.pf-formula-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  background: #f8fafc;
  padding: 0.26rem 0.55rem;
  border-radius: 6px;
  color: #334155;
  border: 1px solid #e2e8f0;
  display: inline-block;
  white-space: nowrap;
}

.pf-formula-code strong {
  color: #1d4ed8;
  font-weight: 800;
}

.pf-streak-thin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #c2410c;
  font-weight: 700;
  background: #fff7ed;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  border: 1px solid #fed7aa;
  font-size: 0.73rem;
  white-space: nowrap;
}

.pf-streak-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  white-space: nowrap;
}

.pf-worked-table tfoot td {
  background-color: #f8fafc !important;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 700;
  color: #0f172a;
  border-top: 2px solid #cbd5e1;
  padding: 0.75rem 0.85rem;
  font-size: 0.82rem;
}

.pf-worked-callout {
  margin-top: 1rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-left: 4px solid #7c3aed;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.2rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.82rem;
  color: #1e293b;
  line-height: 1.55;
}

/* ============================================================================
   TEAM MATRIX HEATMAP (#pf-heatmap-table): ZERO TRANSPARENCY ON STICKY HEADERS & COLS
   ============================================================================ */
.pf-matrix-container {
  max-height: 660px;
  position: relative;
  background: #ffffff;
}

.pf-dot-lvl0 { background: #e2e8f0; border: 1px solid #cbd5e1; }
.pf-dot-lvl1 { background: #93c5fd; }
.pf-dot-lvl2 { background: #fcd34d; }
.pf-dot-lvl3 { background: #fb923c; }
.pf-dot-lvl4 { background: #f8485e; }

/* Fix 2-row thead offsets (overrides 3-row .matrix-table top:32px/64px so there is NO gap at top:0!) */
#pf-heatmap-table thead tr.weekly-load-row th {
  position: sticky !important;
  top: 0px !important;
  height: 34px !important;
  background-color: #f1f5f9 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
  z-index: 35 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

#pf-heatmap-table thead tr.matrix-column-headers-row th {
  position: sticky !important;
  top: 34px !important;
  height: 36px !important;
  background-color: #f8fafc !important;
  background-image: none !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
  z-index: 34 !important;
  border-bottom: 2px solid #cbd5e1 !important;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

/* Top-left sticky corner cells in thead must stay above both horizontal & vertical scroll */
#pf-heatmap-table thead tr.weekly-load-row th.sticky-col {
  z-index: 46 !important;
  background-color: #e2e8f0 !important;
}

#pf-heatmap-table thead tr.matrix-column-headers-row th.sticky-col {
  z-index: 45 !important;
  background-color: #f1f5f9 !important;
}

/* Selected / Current Week header highlight in thead must be 100% opaque (never rgba) */
#pf-heatmap-table thead tr.weekly-load-row th.current-week-header {
  background-color: #ffe4e6 !important;
  color: #be123c !important;
}

#pf-heatmap-table thead tr.matrix-column-headers-row th.current-week-header {
  background-color: #fff1f3 !important;
  color: #e11d48 !important;
}

/* Sticky left columns in tbody must be 100% opaque so scrolling week cells never show behind names */
#pf-heatmap-table tbody td.sticky-col {
  position: sticky !important;
  z-index: 22 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  backdrop-filter: none !important;
  opacity: 1 !important;
}

#pf-heatmap-table tbody tr:nth-child(even) td.sticky-col {
  background-color: #f8fafc !important;
}

#pf-heatmap-table tbody tr:hover td.sticky-col {
  background-color: #f1f5f9 !important;
}

#pf-heatmap-table tbody tr.pf-row-selected td.sticky-col {
  background-color: #fff1f3 !important;
}

/* Ensure column widths in #pf-heatmap-table prevent text truncation */
#pf-heatmap-table .col-prof {
  left: 0 !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
}

#pf-heatmap-table .col-subunit {
  left: 220px !important;
  width: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  box-shadow: 3px 0 6px -2px rgba(15, 23, 42, 0.08);
}

.pf-heatmap-table th.week-header-cell {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.pf-heatmap-table th.week-header-cell:hover {
  background-color: #e2e8f0 !important;
}

.pf-heatmap-table td.matrix-cell {
  cursor: pointer;
  font-family: var(--font-title, 'Outfit', sans-serif);
}

.pf-heatmap-table td.matrix-cell:hover {
  transform: scale(1.06);
  z-index: 5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

/* Semantic Load Index Cell Levels (100% Opaque solid colors) */
.matrix-cell.pf-cell-lvl0 {
  background-color: #f8fafc;
  color: #cbd5e1;
  border: 1px dashed #e2e8f0;
  font-weight: 500;
}

.matrix-cell.pf-cell-lvl1 {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.matrix-cell.pf-cell-lvl2 {
  background-color: #fefce8;
  color: #a16207;
  border: 1px solid #fde047;
}

.matrix-cell.pf-cell-lvl3 {
  background-color: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.matrix-cell.pf-cell-lvl4 {
  background-color: #fff1f3;
  color: #e11d48;
  border: 1px solid #fda4af;
  font-weight: 800;
}

.pf-heatmap-table tr.pf-squad-divider td {
  border-top: 2px solid #cbd5e1 !important;
}

/* Small Multiples Grid (Native .team-card aesthetic) */
.pf-small-multiples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.pf-sm-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem 0.7rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.02);
}

.pf-sm-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.pf-sm-card.pf-sm-selected {
  border-color: #f8485e;
  background: linear-gradient(180deg, #fff1f3 0%, #ffffff 35%);
  box-shadow: 0 6px 16px rgba(248, 72, 94, 0.14);
}

.pf-sm-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.pf-sm-person {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.pf-sm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.pf-sm-name {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.84rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-sm-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: #f8fafc;
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
  border: 1px solid #f1f5f9;
}

.pf-sm-kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.66rem;
  color: #64748b;
}

.pf-sm-kpi-item strong {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
}

.pf-sm-svg {
  width: 100%;
  height: 84px;
  display: block;
  overflow: visible;
}

/* ============================================================================
   7. MARCO METODOLÓGICO: STRUCTURED 2-TIER EXECUTIVE ARCHITECTURE
   ============================================================================ */
.pf-method-tier-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.pf-method-section-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.pf-method-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pf-method-bar-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #fff1f3;
  border: 1px solid #fecdd3;
  color: #f8485e;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pf-method-bar-icon svg {
  width: 18px;
  height: 18px;
}

.pf-method-bar-left h4 {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.96rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pf-method-bar-left p {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.77rem;
  color: #64748b;
  margin: 0.15rem 0 0 0;
}

.pf-method-master-equation {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid #fecdd3;
  padding: 0.42rem 0.8rem;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(248, 72, 94, 0.06);
}

.pf-eq-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #e11d48;
}

.pf-method-master-equation code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0f172a;
}

/* 6 Steps Grid (3x2 on desktop, 2x3 on tablet, 1 col on mobile) */
.pf-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

@media (max-width: 1200px) {
  .pf-steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .pf-steps-grid {
    grid-template-columns: 1fr;
  }
}

.pf-step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.pf-step-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.pf-step-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pf-step-card-head h5 {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pf-step-num {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.pf-step-num-amber {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.pf-step-num-coral {
  background: linear-gradient(135deg, #f8485e 0%, #e11d48 100%);
}

.pf-step-card p {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.pf-formula-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.pf-formula-pill-amber {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.pf-formula-pill-coral {
  background: #fff1f3;
  border-color: #fecdd3;
  color: #be123c;
}

/* Tier 2: Balanced 2-Column Bottom Grid */
.pf-methodology-bottom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  align-items: stretch;
}

@media (max-width: 1100px) {
  .pf-methodology-bottom-grid {
    grid-template-columns: 1fr;
  }
}

.pf-method-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pf-method-col-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #e2e8f0;
}

.pf-method-col-header svg {
  width: 18px;
  height: 18px;
  color: #f8485e;
}

.pf-method-col-header h4 {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.94rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.pf-method-panel-lead {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.79rem;
  color: #475569;
  margin: 0;
  line-height: 1.45;
}

.pf-ref-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.pf-mini-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.77rem;
  background: #ffffff;
}

.pf-mini-ref-table th {
  background: #f1f5f9;
  text-align: left;
  padding: 0.5rem 0.7rem;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  border-bottom: 1px solid #cbd5e1;
}

.pf-mini-ref-table td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}

.pf-mini-ref-table tbody tr:last-child td {
  border-bottom: none;
}

/* Scale Guide Box inside Left Methodology Panel */
.pf-scale-guide-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: auto;
}

.pf-scale-guide-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.82rem;
  color: #0f172a;
}

.pf-scale-guide-title svg {
  width: 16px;
  height: 16px;
  color: #2563eb;
}

.pf-scale-pills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .pf-scale-pills-grid {
    grid-template-columns: 1fr;
  }
}

.pf-scale-pill-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 7px;
}

.pf-scale-pill-item div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.pf-scale-pill-item strong {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.76rem;
  color: #0f172a;
}

.pf-scale-pill-item span {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.7rem;
  color: #64748b;
  line-height: 1.3;
}

.pf-why-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.pf-why-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 0.85rem 1rem;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.79rem;
  color: #334155;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pf-why-card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pf-why-card-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pf-why-card strong {
  font-family: var(--font-title, 'Outfit', sans-serif);
  color: #0f172a;
  font-size: 0.84rem;
}

.pf-why-card p {
  margin: 0;
}

.pf-why-card ul {
  margin: 0.15rem 0 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pf-limitations-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fde68a;
  margin-top: auto;
}

/* =========================================================================
   5. OBJETIVOS VS ACTUAL (BUDGET, TACE, ADP & AMC)
   ========================================================================= */

/* Control bar behavior in Targets Mode: keep Subunit, Month, Year & Reset */
.control-bar.targets-mode #control-group-project,
.control-bar.targets-mode #control-group-pm,
.control-bar.targets-mode #control-group-comercial,
.control-bar.targets-mode #control-group-squad-lead {
  display: none !important;
}

.control-bar.targets-mode .control-left .control-group#control-group-subunit {
  flex: 0 1 280px;
}

.control-bar.targets-mode .control-left .control-group#control-group-month {
  flex: 0 1 180px;
}

/* Executive Toolbar Card */
.targets-toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 1.35rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  flex-wrap: wrap;
}

.targets-toolbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 380px;
  min-width: 0;
}

.targets-toolbar-title-group {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.targets-toolbar-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #fff1f3 0%, #ffe4e8 100%);
  border: 1px solid rgba(248, 72, 94, 0.25);
  color: #f8485e;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(248, 72, 94, 0.12);
}

.targets-toolbar-icon i,
.targets-toolbar-icon svg {
  width: 21px;
  height: 21px;
}

.targets-toolbar-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.targets-toolbar-title-row h2 {
  margin: 0;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.targets-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.targets-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.targets-status-badge i,
.targets-status-badge svg {
  width: 12px;
  height: 12px;
}

.targets-status-badge.is-baseline {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.targets-status-badge.is-partial {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.targets-toolbar-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.targets-toolbar-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.targets-control-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.3rem;
}

.targets-control-label {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.targets-control-label i,
.targets-control-label svg {
  width: 11px;
  height: 11px;
  color: #f8485e;
  flex-shrink: 0;
}

#targets-horizon-switcher {
  display: inline-flex;
  align-items: center;
  height: 38px !important;
  padding: 3px !important;
  border-radius: 8px !important;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  box-sizing: border-box !important;
  margin: 0 !important;
  gap: 2px;
}

#targets-horizon-switcher .btn-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 100% !important;
  padding: 0 0.85rem !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  white-space: nowrap;
  margin: 0 !important;
}

#targets-horizon-switcher .btn-switch i,
#targets-horizon-switcher .btn-switch svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.targets-inline-select {
  height: 38px !important;
  min-width: 195px !important;
  padding: 0 2rem 0 0.75rem !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #f8fafc !important;
  color: #334155 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.targets-checkbox-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 38px !important;
  padding: 0 0.85rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin: 0;
  white-space: nowrap;
}

.targets-checkbox-pill:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.targets-checkbox-pill input[type="checkbox"] {
  accent-color: #f8485e;
  width: 14px;
  height: 14px;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.btn-targets-configure {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 38px !important;
  padding: 0 1rem;
  background: linear-gradient(135deg, #f8485e 0%, #e11d48 100%);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(248, 72, 94, 0.25);
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin: 0;
  white-space: nowrap;
}

.btn-targets-configure:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(248, 72, 94, 0.35);
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
}

.btn-targets-configure i,
.btn-targets-configure svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* 5 Scorecards Grid */
.targets-scorecards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1500px) {
  .targets-scorecards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .targets-scorecards-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

.target-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.15rem;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
}

.target-card-DualRows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}

.target-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.76rem;
}

.target-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #475569;
  font-weight: 500;
}

.target-metric-val {
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-weight: 700;
  color: #0f172a;
  font-size: 0.8rem;
}

.target-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.target-dot.dot-actual { background: #3b82f6; }
.target-dot.dot-real { background: #0d9488; }
.target-dot.dot-target { background: #0f172a; }
.target-dot.dot-eac { background: #8b5cf6; }
.target-dot.dot-pam { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.22); }

.target-metric-row-pam {
  background: rgba(16, 185, 129, 0.06);
  border-left: 2.5px solid #10b981;
  padding: 0.18rem 0.4rem;
  margin: 0.08rem -0.4rem;
  border-radius: 4px;
}

.target-metric-row-pam .target-metric-lbl {
  color: #065f46;
  font-weight: 600;
}

.target-metric-row-pam .target-metric-val {
  color: #047857;
}

/* Progress Bar inside Scorecards */
.targets-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.targets-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: visible;
}

.targets-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
}

.targets-progress-fill.fill-blue {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}

.targets-progress-fill.fill-emerald {
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
}

.targets-progress-fill.fill-purple {
  background: linear-gradient(90deg, #8b5cf6 0%, #6d28d9 100%);
}

.targets-progress-fill.fill-amber {
  background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.targets-progress-fill.fill-rose {
  background: linear-gradient(90deg, #f8485e 0%, #e11d48 100%);
}

.targets-progress-marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  background: #0f172a;
  border-radius: 2px;
  box-shadow: 0 0 0 1.5px #ffffff;
  pointer-events: none;
}

.target-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.2rem;
}

.variance-pill {
  font-size: 0.72rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-title, 'Outfit', sans-serif);
  white-space: nowrap;
}

.variance-pill.var-positive {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.variance-pill.var-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.variance-pill.var-negative {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.variance-pill.var-neutral {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.target-sub-pill {
  font-size: 0.71rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

/* 2x2 Charts Grid */
.targets-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 1150px) {
  .targets-charts-grid {
    grid-template-columns: 1fr;
  }
}

.targets-chart-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.35rem;
  min-height: 340px;
}

.targets-chart-legend {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.targets-chart-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: #475569;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.legend-swatch.swatch-actual-blue {
  background: rgba(37, 99, 235, 0.85);
}

.legend-swatch.swatch-forecast-blue {
  background: rgba(96, 165, 250, 0.45);
  border: 1px dashed #2563eb;
}

.legend-swatch.swatch-target-line {
  height: 3px;
  width: 16px;
  background: #0f172a;
  border-radius: 2px;
}

.legend-swatch.swatch-tace-bar {
  background: rgba(139, 92, 246, 0.82);
}

.legend-swatch.swatch-tace-target {
  height: 3px;
  width: 16px;
  background: #f8485e;
  border-radius: 2px;
}

.legend-swatch.swatch-adp-actual {
  background: rgba(245, 158, 11, 0.85);
}

.legend-swatch.swatch-adp-target {
  height: 3px;
  width: 16px;
  background: #0f172a;
  border-radius: 2px;
}

.legend-swatch.swatch-amc-actual {
  background: rgba(244, 63, 94, 0.82);
}

.legend-swatch.swatch-amc-target {
  height: 3px;
  width: 16px;
  background: #0f172a;
  border-radius: 2px;
}

.legend-swatch.swatch-pam-line {
  height: 3px;
  width: 16px;
  background: #10b981;
  border-radius: 2px;
}

.targets-chart-canvas-wrap {
  position: relative;
  height: 265px;
  width: 100%;
  margin-top: 0.5rem;
}

/* Breakdown Section & Audit Tables */
.targets-breakdown-section {
  padding: 1.25rem 1.4rem;
}

.targets-breakdown-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

#targets-breakdown-tabs {
  display: inline-flex;
  align-items: center;
  height: 38px !important;
  padding: 3px !important;
  border-radius: 8px !important;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  box-sizing: border-box !important;
  margin: 0 !important;
  gap: 2px;
}

#targets-breakdown-tabs .tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 100% !important;
  padding: 0 0.9rem !important;
  font-size: 0.78rem !important;
  font-weight: 600;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  white-space: nowrap;
}

.btn-export-targets-csv {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 38px !important;
  padding: 0 0.95rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin: 0;
  white-space: nowrap;
}

.btn-export-targets-csv:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-export-targets-csv i,
.btn-export-targets-csv svg {
  width: 14px;
  height: 14px;
  color: #f8485e;
  flex-shrink: 0;
}

.targets-table-wrapper {
  overflow-x: hidden !important;
  width: 100%;
}
.targets-audit-table {
  font-size: 0.72rem !important;
}
.targets-audit-table th {
  font-size: 0.63rem !important;
  letter-spacing: 0.02em !important;
}
.targets-table-wrapper-legacy {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.targets-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.targets-audit-table th {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.5rem 0.26rem;
  white-space: nowrap;
}

.targets-audit-table td {
  padding: 0.46rem 0.26rem;
  white-space: nowrap;
  border-bottom: 1px solid #f1f5f9;
}

.targets-audit-table tbody tr:hover {
  background: #f8fafc;
}

.targets-audit-table tbody tr > td:first-child {
  border-left: 3px solid transparent;
}

.targets-audit-table tbody tr.row-closed-month,
.targets-audit-table tbody tr.row-closed-month > td {
  background-color: #f1f4f9 !important;
}

.targets-audit-table tbody tr.row-closed-month > td:first-child {
  border-left: 3px solid #6366f1 !important;
}

.targets-audit-table tbody tr.row-closed-month:hover,
.targets-audit-table tbody tr.row-closed-month:hover > td {
  background-color: #e2e8f0 !important;
}

.targets-audit-table tbody tr.is-highlighted-month,
.targets-audit-table tbody tr.is-highlighted-month > td {
  background: #fff1f3;
}

.targets-audit-table .th-group-target {
  background: #f8fafc;
  color: #475569;
  border-left: 2px solid #e2e8f0;
}

.targets-audit-table .th-group-actual {
  background: #eff6ff;
  color: #1e40af;
}

.targets-audit-table .th-group-var {
  background: #f8fafc;
  color: #0f172a;
}

.targets-audit-table td.cell-group-start {
  border-left: 2px solid #f1f5f9;
}

.targets-audit-table tfoot tr {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
  font-weight: 700;
  color: #0f172a;
}

.targets-audit-table tfoot td {
  padding: 0.58rem 0.26rem;
}
.targets-audit-table .variance-pill {
  font-size: 0.66rem !important;
  padding: 0.12rem 0.32rem;
  border-radius: 5px;
  border-bottom: none;
}

.targets-audit-table tfoot tr.tfoot-pam-row {
  background: #ecfdf5;
  border-top: 1px dashed #6ee7b7;
  color: #065f46;
}

.pam-cell-subline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.22rem;
  padding-top: 0.2rem;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #047857;
  line-height: 1.2;
}

.text-right .pam-cell-subline {
  justify-content: flex-end;
}

.pam-tag {
  display: inline-block;
  padding: 0.06rem 0.32rem;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pam-mini-badge {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.05rem 0.32rem;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.month-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.month-status-pill.is-closed {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.month-status-pill.is-open {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.subunit-target-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.16rem 0.52rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.subunit-target-source-pill i,
.subunit-target-source-pill svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
}

.subunit-target-source-pill.is-custom {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.subunit-target-source-pill.is-baseline {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.btn-row-edit-target {
  font-size: 0.72rem !important;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-row-edit-target:hover {
  background: #fff1f3;
  border-color: #f8485e;
  color: #f8485e;
}

.btn-row-edit-target i,
.btn-row-edit-target svg {
  width: 12px;
  height: 12px;
}

/* =========================================================================
   MODAL DE CONFIGURACIÓN DE OBJETIVOS ANUALES Y MENSUALES (#modal-kpi-targets)
   ========================================================================= */

#modal-kpi-targets {
  padding: 0.75rem 1.25rem !important;
}

.targets-modal-card {
  max-width: 1180px !important;
  width: 96% !important;
  max-height: 95vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.targets-modal-header {
  padding: 0.85rem 1.4rem !important;
  flex-shrink: 0 !important;
}

.targets-modal-header .modal-subtitle {
  margin: 0.15rem 0 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

.targets-modal-body {
  max-height: none !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  gap: 0.6rem !important;
  padding: 0.75rem 1.4rem !important;
  display: flex !important;
  flex-direction: column !important;
}

.targets-modal-banner {
  margin-bottom: 0 !important;
  padding: 0.45rem 0.85rem !important;
  font-size: 0.77rem !important;
  flex-shrink: 0 !important;
}

.targets-modal-top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  flex-shrink: 0 !important;
}

.targets-modal-selectors {
  display: flex;
  align-items: flex-end;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.targets-modal-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.22rem;
}

.targets-modal-field label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  line-height: 1.1;
  margin: 0;
}

.targets-modal-field label i,
.targets-modal-field label svg {
  width: 11px;
  height: 11px;
  color: #f8485e;
  flex-shrink: 0;
}

.targets-modal-select {
  min-width: 195px !important;
  height: 36px !important;
  padding: 0 2rem 0 0.75rem !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.targets-modal-year-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.9rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  box-sizing: border-box;
}

#targets-modal-source-badge,
.targets-config-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  box-sizing: border-box;
  white-space: nowrap;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

#targets-modal-source-badge.is-baseline,
.targets-config-pill.is-baseline {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.targets-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.targets-modal-actions .btn-modal-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px !important;
  padding: 0 0.85rem !important;
  border-radius: 8px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  white-space: nowrap;
}

.targets-modal-actions .btn-modal-secondary i,
.targets-modal-actions .btn-modal-secondary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.targets-modal-footer .btn-modal-secondary,
.targets-modal-footer .btn-modal-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  height: 38px !important;
  padding: 0 1.05rem !important;
  border-radius: 8px !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  white-space: nowrap;
}

.targets-modal-footer .btn-modal-secondary i,
.targets-modal-footer .btn-modal-secondary svg,
.targets-modal-footer .btn-modal-primary i,
.targets-modal-footer .btn-modal-primary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Quick Annual Target Box */
.targets-quick-annual-box {
  background: linear-gradient(135deg, #fff1f3 0%, #fff8f9 100%);
  border: 1px solid rgba(248, 72, 94, 0.25);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0 !important;
}

.targets-quick-annual-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  font-size: 0.77rem;
  color: #475569;
  line-height: 1.35;
}

.targets-quick-annual-header span {
  display: inline;
  line-height: 1.35;
}

.targets-quick-annual-header i,
.targets-quick-annual-header svg {
  width: 15px;
  height: 15px;
  color: #f8485e;
  flex-shrink: 0;
}

.targets-quick-annual-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
}

@media (max-width: 1020px) {
  .targets-quick-annual-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.quick-annual-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.22rem;
  min-width: 0;
}

.quick-annual-item label {
  font-size: 0.69rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.quick-input-wrap input {
  width: 100%;
  height: 32px;
  padding: 0 2.15rem 0 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.81rem;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.quick-input-wrap input::-webkit-outer-spin-button,
.quick-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.quick-input-wrap input:focus {
  border-color: #f8485e;
  box-shadow: 0 0 0 2px rgba(248, 72, 94, 0.15);
}

.quick-unit {
  position: absolute;
  right: 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #64748b;
  pointer-events: none;
  background: #ffffff;
  padding-left: 2px;
}

.quick-margin-preview {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 7px;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.77rem;
  font-weight: 700;
  color: #047857;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* Monthly 12-Month Editor Table */
.targets-monthly-editor-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow-x: auto;
  overflow-y: visible;
  background: #ffffff;
  flex-shrink: 0 !important;
}

.targets-editor-table {
  width: 100% !important;
  min-width: 780px;
  table-layout: fixed !important;
  border-collapse: collapse !important;
  font-size: 0.78rem;
}

.targets-editor-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.45rem 0.55rem !important;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.targets-editor-table tbody td {
  padding: 0.22rem 0.55rem !important;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  box-sizing: border-box;
}

.targets-editor-table tbody tr:hover {
  background: #f8fafc;
}

.targets-month-input {
  width: 100% !important;
  max-width: 100% !important;
  height: 26px !important;
  padding: 0 0.5rem !important;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  color: #0f172a;
  text-align: right;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box !important;
  display: block;
  -moz-appearance: textfield;
}

.targets-month-input::-webkit-outer-spin-button,
.targets-month-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.targets-month-input:focus {
  border-color: #f8485e;
  box-shadow: 0 0 0 2px rgba(248, 72, 94, 0.15);
}

.targets-month-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

.targets-editor-tfoot tr {
  background: #f8fafc;
  border-top: 2px solid #cbd5e1;
  font-weight: 700;
  color: #0f172a;
}

.targets-editor-tfoot td {
  padding: 0.45rem 0.55rem !important;
  font-family: var(--font-title, 'Outfit', sans-serif);
  font-size: 0.8rem;
  box-sizing: border-box;
}

.targets-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.4rem !important;
  flex-shrink: 0 !important;
}

.targets-modal-footer-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  color: #64748b;
}

.targets-modal-footer-hint i,
.targets-modal-footer-hint svg {
  width: 14px;
  height: 14px;
  color: #10b981;
  flex-shrink: 0;
}

.targets-modal-footer-btns {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}


