﻿body {
  background: #f6f8fb;
  min-height: 100vh;
}

#panel-dashboard.dashboard-overview {
  color: #061333;
}

.dashboard-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-eyebrow {
  color: #1f5f9f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.1;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.dashboard-title {
  font-size: clamp(1.85rem, 2.4vw, 2.65rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.dashboard-summary-card {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 0.9rem;
  box-shadow: 0 0.12rem 0.45rem rgba(15, 23, 42, 0.11);
  min-height: 128px;
  padding: 1.45rem 1.65rem;
}

.dashboard-summary-label {
  color: #5c647c;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  line-height: 1.2;
  min-height: 2.1rem;
  text-transform: uppercase;
}

.dashboard-summary-value {
  color: #061333;
  font-size: 2.25rem;
  font-weight: 750;
  line-height: 1;
  margin-top: 0.35rem;
}

.dashboard-summary-caption {
  color: #4d5872;
  font-size: 0.95rem;
  margin-top: 0.55rem;
}

.dashboard-semaphore-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-semaphore-card {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-left-width: 0.42rem;
  border-radius: 0.9rem;
  box-shadow: 0 0.12rem 0.45rem rgba(15, 23, 42, 0.09);
  min-height: 116px;
  padding: 1.1rem 1.25rem;
  position: relative;
}

.dashboard-semaphore-kind {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  position: absolute;
  right: 1.25rem;
  text-transform: uppercase;
  top: 1.1rem;
}

.dashboard-semaphore-card-green {
  border-left-color: #198754;
}

.dashboard-semaphore-card-yellow {
  border-left-color: #f0c536;
}

.dashboard-semaphore-card-red {
  border-left-color: #ed2734;
}

.dashboard-semaphore-risk-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
  max-height: 220px;
  overflow: auto;
  padding-right: 0.2rem;
}

.dashboard-semaphore-risk {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  color: #1c2638;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr) auto;
  padding: 0.42rem 0.55rem;
  text-align: left;
}

.dashboard-semaphore-risk:hover,
.dashboard-semaphore-risk:focus-visible {
  background: #eef6ff;
  border-color: #bfdbfe;
  outline: 2px solid rgba(31, 95, 159, 0.18);
}

.dashboard-semaphore-risk-code {
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-semaphore-risk-title {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-semaphore-risk-gap {
  color: #061333;
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-semaphore-empty {
  color: #64748b;
  font-size: 0.84rem;
  padding: 0.35rem 0;
}

.dashboard-gap-chart-card {
  border-color: #dbe3ee;
  border-radius: 0.9rem;
}

.dashboard-strategic-charts-grid {
  align-items: stretch;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-strategic-charts-grid > .card,
.dashboard-strategic-charts-grid > .card > .card-body {
  min-width: 0;
}

.dashboard-strategic-charts-grid .dashboard-gap-chart-scroll {
  max-height: 460px;
  overflow-y: auto;
}

.dashboard-strategic-charts-grid .dashboard-gap-chart {
  min-width: 560px;
}

.dashboard-strategic-charts-grid .dashboard-gap-chart-axis,
.dashboard-strategic-charts-grid .dashboard-gap-chart-row {
  gap: 0.5rem;
  grid-template-columns: 178px minmax(280px, 1fr) 42px;
}

.dashboard-strategic-charts-grid .dashboard-gap-chart-axis {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 3;
}

.dashboard-strategic-charts-grid .risk-matrix {
  gap: 0.3rem;
  grid-template-columns: 34px repeat(5, minmax(72px, 1fr));
  grid-template-rows: repeat(5, minmax(84px, 1fr)) 28px;
  min-width: 440px;
}

.dashboard-strategic-charts-grid .risk-matrix-cell {
  min-height: 84px;
}

.dashboard-gap-chart-heading {
  align-items: center;
}

.dashboard-gap-chart-controls {
  align-items: center;
  display: flex;
  gap: 0.55rem;
  white-space: nowrap;
}

.dashboard-gap-chart-controls .form-select {
  min-width: 170px;
}

.dashboard-gap-chart-legend {
  align-items: center;
  color: #536079;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 0.65rem 1.2rem;
  margin-bottom: 1rem;
}

.dashboard-gap-chart-legend span {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
}

.dashboard-gap-legend-dot {
  border-radius: 999px;
  display: inline-block;
  height: 0.6rem;
  width: 0.6rem;
}

.dashboard-gap-legend-green,
.dashboard-gap-chart-bar-green {
  background: #198754;
}

.dashboard-gap-legend-yellow,
.dashboard-gap-chart-bar-yellow {
  background: #f0c536;
}

.dashboard-gap-legend-red,
.dashboard-gap-chart-bar-red {
  background: #ed2734;
}

.dashboard-gap-chart-scroll {
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.dashboard-gap-chart {
  display: grid;
  gap: 0.28rem;
  min-width: 720px;
}

.dashboard-gap-chart-axis {
  color: #64748b;
  display: grid;
  font-size: 0.72rem;
  grid-template-columns: 250px minmax(360px, 1fr) 52px;
  padding: 0 0.65rem 0.15rem;
}

.dashboard-gap-chart-axis span:first-child {
  grid-column: 2;
  justify-self: start;
}

.dashboard-gap-chart-axis span:nth-child(2) {
  grid-column: 2;
  justify-self: center;
}

.dashboard-gap-chart-axis span:last-child {
  grid-column: 2;
  justify-self: end;
}

.dashboard-gap-chart-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: #1c2638;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 250px minmax(360px, 1fr) 52px;
  min-height: 42px;
  padding: 0.36rem 0.65rem;
  text-align: left;
  width: 100%;
}

.dashboard-gap-chart-row:hover,
.dashboard-gap-chart-row:focus-visible {
  background: #f5f9ff;
  outline: 2px solid rgba(31, 95, 159, 0.18);
}

.dashboard-gap-chart-risk {
  align-items: baseline;
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.dashboard-gap-chart-risk strong {
  color: #334155;
  font-size: 0.76rem;
}

.dashboard-gap-chart-risk > span {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-gap-chart-track {
  background: linear-gradient(to right, #f1f5f9 0 49.8%, transparent 49.8% 50.2%, #f1f5f9 50.2% 100%);
  border-radius: 0.25rem;
  display: block;
  height: 18px;
  position: relative;
}

.dashboard-gap-chart-zero-line {
  background: #475569;
  bottom: -4px;
  left: calc(50% - 1px);
  position: absolute;
  top: -4px;
  width: 2px;
  z-index: 2;
}

.dashboard-gap-chart-bar {
  border-radius: 0.25rem;
  bottom: 0;
  min-width: 3px;
  position: absolute;
  top: 0;
}

.dashboard-gap-chart-bar-negative {
  right: 50%;
}

.dashboard-gap-chart-bar-positive {
  left: 50%;
}

.dashboard-gap-chart-bar-zero {
  background: #475569;
  left: calc(50% - 3px);
  width: 6px !important;
}

.dashboard-gap-chart-value {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.dashboard-gap-chart-value-green {
  color: #146c43;
}

.dashboard-gap-chart-value-yellow {
  color: #8a6100;
}

.dashboard-gap-chart-value-red {
  color: #c81e2a;
}

.dashboard-gap-chart-empty {
  color: #64748b;
  font-size: 0.88rem;
  padding: 1.25rem 0.5rem;
  text-align: center;
}

.dashboard-matrix-card {
  border-color: #dbe3ee;
  border-radius: 0.9rem;
}

.dashboard-section-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 1.4rem;
}

.dashboard-matrix-wrap {
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

.risk-matrix {
  display: grid;
  grid-template-columns: 42px repeat(5, minmax(120px, 1fr));
  grid-template-rows: repeat(5, minmax(106px, 1fr)) 30px;
  gap: 0.35rem;
  min-width: 720px;
}

.risk-matrix-axis {
  color: #536079;
  font-size: 0.92rem;
}

.risk-matrix-axis-left {
  align-self: center;
  justify-self: end;
  padding-right: 0.35rem;
}

.risk-matrix-axis-bottom {
  align-self: start;
  justify-self: center;
  padding-top: 0.2rem;
}

.risk-matrix-cell {
  border-radius: 0.3rem;
  min-height: 106px;
  position: relative;
}

.risk-matrix-cell-low {
  background: #78c97c;
}

.risk-matrix-cell-medium {
  background: #f0c536;
}

.risk-matrix-cell-high {
  background: #ff7233;
}

.risk-matrix-cell-critical {
  background: #ed2734;
}

.risk-matrix-count {
  background: transparent;
  border: 0;
  color: #050910;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem;
  position: absolute;
  right: 0.55rem;
  top: 0.55rem;
}

.risk-matrix-count:hover,
.risk-matrix-count:focus-visible {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  outline: 2px solid rgba(5, 9, 16, 0.3);
}

.dashboard-matrix-selection {
  border-top: 1px solid #e2e8f0;
  margin-top: 1rem;
  padding-top: 1rem;
}

.dashboard-selection-title {
  color: #061333;
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.dashboard-exec-grid,
.dashboard-detail-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.dashboard-exec-card {
  border-color: #dbe3ee;
  border-radius: 0.9rem;
}

.dashboard-card-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.dashboard-maturity-badge {
  background: #e9f3ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1e4f85;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
}

.dashboard-analysis-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.dashboard-analysis-updated {
  color: #64748b;
  font-size: 0.75rem;
  text-align: right;
}

.dashboard-count-badge {
  background: #eef2f7;
  border: 1px solid #d6e0ec;
  border-radius: 999px;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.58rem;
}

.dashboard-exec-text {
  color: #172033;
  font-size: 1.05rem;
  line-height: 1.45;
  margin: 0 0 0.75rem;
}

.dashboard-exec-muted {
  color: #536079;
  line-height: 1.45;
}

.dashboard-annual-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-annual-card {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 0.65rem;
  min-height: 82px;
  padding: 0.75rem 0.85rem;
  text-align: left;
}

.dashboard-annual-card:hover {
  background: #f8fbff;
}

.dashboard-annual-label {
  color: #5c647c;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
}

.dashboard-annual-value {
  color: #061333;
  font-size: 1.45rem;
  font-weight: 750;
  line-height: 1;
  margin-top: 0.45rem;
}

.dashboard-management-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-management-card {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 0.9rem;
  box-shadow: 0 0.1rem 0.35rem rgba(15, 23, 42, 0.08);
  min-height: 116px;
  padding: 1rem 1.05rem;
}

.dashboard-management-card .dashboard-summary-label {
  font-size: 0.72rem;
  min-height: 1.75rem;
}

.dashboard-management-card .dashboard-summary-value {
  font-size: 1.8rem;
}

.dashboard-management-card .dashboard-summary-caption {
  font-size: 0.82rem;
}

.dashboard-compact-table {
  border-color: #e2e8f0;
}

.dashboard-compact-table thead th {
  background: #f4f7fb;
  border-bottom: 1px solid #dbe3ee;
  color: #536079;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dashboard-compact-table thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}

.dashboard-compact-table td {
  border-color: #e6edf5;
  color: #1c2638;
  font-size: 0.86rem;
  padding-bottom: 0.55rem;
  padding-top: 0.55rem;
}

.dashboard-open-risk-row {
  cursor: pointer;
}

.dashboard-open-risk-row:hover td {
  background: #f5f9ff;
}

.dashboard-total-row td {
  background: #f4f7fb;
  border-top: 2px solid #d6e0ec;
  color: #061333;
  font-weight: 800;
}

.dashboard-dot {
  border-radius: 999px;
  display: inline-block;
  height: 0.55rem;
  margin-right: 0.45rem;
  width: 0.55rem;
}

.dashboard-dot-success {
  background: #198754;
}

.dashboard-dot-warning {
  background: #f0c536;
}

.dashboard-dot-danger {
  background: #ed2734;
}

.dashboard-meta-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
}

.dashboard-meta-pill-ok {
  background: #e7f6ee;
  color: #146c43;
}

.dashboard-meta-pill-empty {
  background: #f1f5f9;
  color: #64748b;
}

.risk-gap-pill-green {
  background: #e7f6ee;
  color: #146c43;
}

.risk-gap-pill-yellow {
  background: #fff7d6;
  color: #8a6100;
}

.risk-gap-pill-red {
  background: #ffe1e5;
  color: #b4232f;
}

.table-max {
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}

.sticky-top {
  top: 0;
  z-index: 1;
}

#catalog-table td,
#appetite-table td {
  white-space: nowrap;
  font-size: 0.8rem;
}

#catalog-table td.risk-inline-editable {
  cursor: text;
}

#catalog-table td.risk-inline-editable:hover {
  background: #eef8ff;
}

#catalog-table td.risk-inline-editing {
  background: #dff3ff;
}

#l2-risks-table td {
  font-size: 0.78rem;
}

#l2-risks-table td.l2-inline-editable {
  cursor: text;
}

#l2-risks-table td.l2-inline-editable:hover {
  background: #fff8e6;
}

#l2-risks-table td.l2-inline-editing {
  background: #fff3cd;
}

#l3-plans-table td.l3-inline-editable {
  cursor: text;
}

#l3-plans-table td {
  font-size: 0.74rem;
  line-height: 1.2;
  padding-top: 0.28rem;
  padding-bottom: 0.28rem;
}

#l3-plans-table td.l3-inline-editable:hover {
  background: #eef8ff;
}

#l3-plans-table td.l3-inline-editing {
  background: #dff3ff;
}

.l3-filters-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  overflow: visible;
}

.l3-filter-search {
  flex: 0 0 360px;
  min-width: 320px;
}

.l3-filter-item {
  flex: 0 0 190px;
  min-width: 170px;
  position: relative;
  z-index: 30;
}

#catalog-table td:nth-child(9),
#appetite-table td:nth-child(5),
#appetite-table td:nth-child(6) {
  white-space: normal;
  min-width: 220px;
}

.table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.l2-map-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

#l2-map-grid {
  min-width: 1280px;
}

#N2-outside-grid {
  table-layout: fixed;
}

#N2-N1-outside-head th[data-sort="code"] {
  width: 82px;
}

#N2-N1-outside-head th[data-sort="title"] {
  width: 45%;
}

#N2-N1-outside-head th[data-sort="area"] {
  width: 15%;
}

#N2-N1-outside-head th[data-sort="appetiteScore"],
#N2-N1-outside-head th[data-sort="inherentRisk"],
#N2-N1-outside-head th[data-sort="gapVsAppetite"],
#N2-N1-outside-head th[data-sort="n2Dismissed"],
#N2-N1-outside-head th[data-sort="n2Plans"],
#N2-N1-outside-head th[data-sort="n2Critical"],
#N2-N1-outside-head th[data-sort="n2Relevant"],
#N2-N1-outside-head th[data-sort="n2Reviewed"] {
  width: 64px;
}

#N2-outside-grid th:nth-child(n + 4):nth-child(-n + 11),
#N2-outside-grid td:nth-child(n + 4):nth-child(-n + 11) {
  text-align: center;
}

#N2-outside-grid td:nth-child(n + 4):nth-child(-n + 11) {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

#l2-map-grid th:last-child,
#l2-map-grid td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  white-space: nowrap;
}

#l2-map-grid th:last-child {
  z-index: 3;
  background: #f8f9fa;
}

#l2-map-grid td:last-child {
  background: #fff;
}

#catalog-table td.detail-cell {
  white-space: normal;
  min-width: 240px;
  max-width: 340px;
  word-break: break-word;
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown summary {
  list-style: none;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-menu {
  position: absolute;
  z-index: 20;
  width: 100%;
  min-width: 220px;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  padding: 0.4rem 0.5rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  cursor: pointer;
}

#risk-table-head th[data-sort] {
  cursor: pointer;
  user-select: none;
}

#risk-table-head th {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  padding-right: 0.95rem;
}

#risk-table-head th::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

#l2-risks-head th[data-sort] {
  cursor: pointer;
  user-select: none;
}

#l2-risks-head th {
  position: relative;
  padding-right: 0.95rem;
}

#l2-risks-head th::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

#l2-risks-card:fullscreen,
#l2-risks-card:-webkit-full-screen {
  background: #f6f8fb;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#l2-risks-card:fullscreen .card-body,
#l2-risks-card:-webkit-full-screen .card-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#l2-risks-card:fullscreen .table-responsive.table-max,
#l2-risks-card:-webkit-full-screen .table-responsive.table-max {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#l3-plans-head th[data-sort] {
  cursor: pointer;
  user-select: none;
}

#l3-plans-head th {
  position: relative;
  padding-right: 0.95rem;
}

#l3-plans-head th::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

#l3-evidences-head th[data-sort] {
  cursor: pointer;
  user-select: none;
}

#l3-evidences-head th {
  position: relative;
  padding-right: 0.95rem;
}

#l3-evidences-head th::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

#l3-plans-head th:nth-child(18),
#l3-plans-head th:nth-child(19) {
  white-space: pre-line;
  line-height: 1.05;
  text-align: center;
}

#l3-plans-head th:nth-child(1),
#l3-plans-head th:nth-child(3),
#l3-plans-head th:nth-child(17),
#l3-plans-head th:nth-child(18),
#l3-plans-head th:nth-child(19),
#l3-plans-table td:nth-child(1),
#l3-plans-table td:nth-child(3),
#l3-plans-table td:nth-child(17),
#l3-plans-table td:nth-child(18),
#l3-plans-table td:nth-child(19) {
  text-align: center;
}

#l3-plans-head th:nth-child(1),
#l3-plans-table td:nth-child(1) {
  min-width: 52px;
  width: 52px;
}

#l3-plans-head th:nth-child(3),
#l3-plans-table td:nth-child(3) {
  min-width: 62px;
  width: 62px;
}

#l3-plans-head th:nth-child(17),
#l3-plans-head th:nth-child(18),
#l3-plans-head th:nth-child(19),
#l3-plans-table td:nth-child(17),
#l3-plans-table td:nth-child(18),
#l3-plans-table td:nth-child(19) {
  min-width: 88px;
  width: 88px;
}

body.resizing-columns,
body.resizing-columns * {
  cursor: col-resize !important;
  user-select: none !important;
}

main.container-fluid.py-3 {
  min-height: calc(100vh - 56px);
}

#panel-catalogo {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

#panel-catalogo > .card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#panel-catalogo > .card > .card-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.config-context-card .card-body {
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9ff 100%);
}

.config-context-summary {
  border: 1px solid #dbe4f4;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.55rem 0.65rem;
}

.config-summary-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.config-summary-item {
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  background: #f8fbff;
  padding: 0.35rem 0.45rem;
}

.config-summary-label {
  font-size: 0.72rem;
  color: #64748b;
  margin-bottom: 0.05rem;
}

.config-summary-value {
  font-size: 0.9rem;
  font-weight: 600;
  word-break: break-word;
}

.config-block {
  background: #fff;
  border-color: #dbe2ec !important;
}

.config-block-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f2937;
}

.config-danger-zone {
  border: 1px dashed #f3b0b0;
  border-radius: 0.5rem;
  background: #fff8f8;
  padding: 0.55rem 0.65rem;
}

#panel-catalogos .card-header strong,
#panel-usuarios .card-header strong,
#panel-configuracion .card-header strong {
  letter-spacing: 0.01em;
}

.users-admin-layout .card {
  min-height: 0;
}

.users-table-wrap {
  max-height: 62vh;
}

.users-row-selected {
  box-shadow: inset 3px 0 0 #0d6efd;
}

.users-table-wrap tbody tr[data-user-row] {
  cursor: pointer;
}

#users-head th[data-sort] {
  cursor: pointer;
  user-select: none;
}

#users-table td {
  vertical-align: middle;
}

.users-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.users-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d0d7e2;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-size: 0.7rem;
  line-height: 1.2;
  color: #243447;
  background: #f7fafc;
}

.users-chip-area {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e3a8a;
}

.users-chip-company {
  background: #ecfeff;
  border-color: #99f6e4;
  color: #155e75;
}

.users-chip-context {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.users-chip-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #166534;
}

.users-chip-muted {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.users-scope-cells {
  display: grid;
  gap: 0.2rem;
}

.users-flag-card {
  border: 1px solid #dee2e6;
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
  background: #f8fafc;
  min-height: 72px;
}

.users-scope-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.users-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 0.7rem;
  max-height: 170px;
  overflow: auto;
}

.users-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  padding: 0.1rem 0.12rem;
  border-radius: 0.3rem;
}

.users-check-item:hover {
  background: #eef4ff;
}

@media (max-width: 1199.98px) {
  .users-table-wrap {
    max-height: none;
  }
}

.modal-form-section {
  margin: 0;
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c757d;
}

#l2RiskClassification,
#l2RiskTreatment,
#l2RiskStatus {
  font-weight: 700;
  border-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#l2RiskClassification.n2-select-danger,
#l2RiskTreatment.n2-select-danger,
#l2RiskStatus.n2-select-danger {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

#l2RiskClassification.n2-select-warning,
#l2RiskTreatment.n2-select-warning,
#l2RiskStatus.n2-select-warning {
  color: #000;
  background-color: #ffc107;
  border-color: #ffc107;
}

#l2RiskClassification.n2-select-success,
#l2RiskTreatment.n2-select-success,
#l2RiskStatus.n2-select-success {
  color: #fff;
  background-color: #198754;
  border-color: #198754;
}

#l2RiskClassification.n2-select-secondary,
#l2RiskTreatment.n2-select-secondary,
#l2RiskStatus.n2-select-secondary {
  color: #fff;
  background-color: #6c757d;
  border-color: #6c757d;
}

#l2RiskClassification.n2-select-dark,
#l2RiskTreatment.n2-select-dark,
#l2RiskStatus.n2-select-dark {
  color: #fff;
  background-color: #212529;
  border-color: #212529;
}

#l2RiskClassification.n2-select-info,
#l2RiskTreatment.n2-select-info,
#l2RiskStatus.n2-select-info {
  color: #000;
  background-color: #0dcaf0;
  border-color: #0dcaf0;
}

#l2RiskClassification.n2-select-primary,
#l2RiskTreatment.n2-select-primary,
#l2RiskStatus.n2-select-primary {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.l2-risk-dialog {
  max-width: min(96vw, 1320px);
}

.l2-risk-content {
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.l2-risk-header {
  background: #fff;
  border-bottom: 1px solid #dbe3ee;
  padding: 1.35rem 1.6rem 1.15rem;
}

.l2-risk-body {
  background: #f6f8fb;
  padding: 1.1rem 1.35rem;
}

.l2-risk-form {
  align-items: stretch;
}

#l2RiskModal .modal-form-section {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 0.75rem;
  color: #061333;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0.35rem 0 -0.35rem;
  padding: 0.85rem 1rem;
  text-transform: none;
}

#l2RiskModal .form-label {
  color: #536079;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

#l2RiskModal .form-control,
#l2RiskModal .form-select {
  border-color: #d6e0ec;
  border-radius: 0.45rem;
  color: #1c2638;
  min-height: 2.35rem;
}

#l2RiskModal .form-control:focus,
#l2RiskModal .form-select:focus {
  border-color: #8bb7e6;
  box-shadow: 0 0 0 0.18rem rgba(31, 95, 159, 0.14);
}

#l2RiskModal textarea.form-control {
  font-size: 0.92rem;
  line-height: 1.45;
  resize: vertical;
}

#l2RiskModal .col-md-2:has(#l2RiskProbability),
#l2RiskModal .col-md-2:has(#l2RiskImpact),
#l2RiskModal .col-md-2:has(#l2RiskInherent),
#l2RiskModal .col-md-2:has(#l2RiskAppetiteRef),
#l2RiskModal .col-md-2:has(#l2RiskGap) {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
}

#l2RiskModal .col-md-2:has(#l2RiskProbability) input,
#l2RiskModal .col-md-2:has(#l2RiskImpact) input,
#l2RiskModal .col-md-2:has(#l2RiskInherent) input,
#l2RiskModal .col-md-2:has(#l2RiskAppetiteRef) input,
#l2RiskModal .col-md-2:has(#l2RiskGap) input {
  background: transparent;
  border: 0;
  color: #061333;
  font-size: 1.35rem;
  font-weight: 800;
  min-height: auto;
  padding: 0;
}

#l2RiskModal .col-md-2:has(#l2RiskProbability) input:focus,
#l2RiskModal .col-md-2:has(#l2RiskImpact) input:focus,
#l2RiskModal .col-md-2:has(#l2RiskInherent) input:focus,
#l2RiskModal .col-md-2:has(#l2RiskAppetiteRef) input:focus,
#l2RiskModal .col-md-2:has(#l2RiskGap) input:focus {
  box-shadow: none;
}

#l2RiskModal .btn-group .btn {
  border-color: #cbd5e1;
}

.l2-risk-footer {
  background: #fff;
  border-top: 1px solid #dbe3ee;
  padding: 1rem 1.6rem;
}

#new-risk-form .form-label {
  font-size: 0.84rem;
}

#newRiskSemaforoPreview {
  font-size: 0.85rem;
}

.risk-view-dialog {
  max-width: min(96vw, 1320px);
}

.risk-view-content {
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.risk-view-header {
  background: #fff;
  border-bottom: 1px solid #dbe3ee;
  padding: 1.35rem 1.6rem 1.15rem;
}

.risk-view-eyebrow {
  color: #1f5f9f;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.risk-view-title {
  color: #061333;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.risk-view-body {
  background: #f6f8fb;
  padding: 1.1rem 1.35rem;
}

.risk-view-form {
  display: grid;
  gap: 1rem;
}

.risk-view-section {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 0.8rem;
  box-shadow: 0 0.1rem 0.35rem rgba(15, 23, 42, 0.06);
  padding: 1rem 1.1rem 1.1rem;
}

.risk-view-section-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.risk-view-section-header h6 {
  color: #061333;
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.risk-view-section-subtitle {
  color: #64748b;
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

#riskViewModal .form-label {
  color: #536079;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

#riskViewModal .form-control,
#riskViewModal .form-select {
  border-color: #d6e0ec;
  border-radius: 0.45rem;
  color: #1c2638;
  min-height: 2.35rem;
}

#riskViewModal .form-control:focus,
#riskViewModal .form-select:focus {
  border-color: #8bb7e6;
  box-shadow: 0 0 0 0.18rem rgba(31, 95, 159, 0.14);
}

.risk-view-title-input {
  font-weight: 700;
}

.risk-view-metrics-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.risk-view-metric {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
}

.risk-view-metric input {
  background: transparent;
  border: 0;
  color: #061333;
  font-size: 1.35rem;
  font-weight: 800;
  min-height: auto;
  padding: 0;
}

.risk-view-metric input:focus {
  box-shadow: none;
}

.risk-view-editor-head {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

#riskViewModal textarea.form-control {
  font-size: 0.92rem;
  line-height: 1.45;
  min-height: 190px;
  resize: vertical;
}

.risk-view-n2-list {
  display: grid;
  gap: 0.45rem;
  max-height: 260px;
  overflow: auto;
  padding-right: 0.25rem;
}

.risk-view-n2-item {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #dbe3ee;
  border-radius: 0.55rem;
  color: #1c2638;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 82px minmax(0, 1fr) auto 54px;
  padding: 0.55rem 0.7rem;
  text-align: left;
  width: 100%;
}

.risk-view-n2-item:hover,
.risk-view-n2-item:focus-visible {
  background: #eef6ff;
  border-color: #bfdbfe;
  outline: 2px solid rgba(31, 95, 159, 0.18);
}

.risk-view-n2-id {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.risk-view-n2-main {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.risk-view-n2-process {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.risk-view-n2-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-view-n2-gap {
  font-size: 0.95rem;
  font-weight: 800;
  text-align: right;
}

.risk-view-n2-empty {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 0.55rem;
  color: #64748b;
  padding: 0.75rem 0.85rem;
}

.risk-view-meta-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.risk-view-meta-row > div {
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 0.65rem;
  padding: 0.75rem 0.9rem;
}

.risk-view-meta-row span {
  color: #64748b;
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.risk-view-meta-row strong {
  color: #1c2638;
  display: block;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.risk-view-footer {
  background: #fff;
  border-top: 1px solid #dbe3ee;
  padding: 1rem 1.6rem;
}

.l3-evidence-modal {
  max-width: min(96vw, 1600px);
}

.l3-plan-modal {
  max-width: min(94vw, 1380px);
}

#l3PlanModal .modal-body {
  background: #f8fafc;
}

#l3PlanModal .l3-plan-form {
  gap: 0.8rem 0.9rem;
}

#l3PlanModal .modal-form-section {
  margin: 0.2rem 0 0;
  padding: 0.35rem 0.55rem;
  border-radius: 0.4rem;
  background: #e9eef5;
  color: #445469;
  font-size: 0.76rem;
}

#l3PlanModal .form-label {
  font-weight: 500;
  color: #263242;
}

#l3PlanModal textarea.form-control {
  resize: vertical;
  min-height: 92px;
}

#l3PlanModal .l3-residual-details {
  border: 1px solid #d6dde8;
  border-radius: 0.5rem;
  background: #fff;
  padding: 0.5rem 0.65rem 0.75rem;
}

#l3PlanModal .l3-residual-details > summary {
  cursor: pointer;
  font-weight: 600;
  color: #334155;
}

#l3EvidenceModal .modal-body {
  font-size: 0.92rem;
}

#l3EvidenceModal .l3-evidence-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 1fr) minmax(280px, 1.6fr) 150px 150px 150px 170px;
  gap: 0.5rem;
  align-items: end;
}

#l3EvidenceModal .l3-evidence-form .form-label {
  white-space: nowrap;
}

#l3EvidenceModal .l3-ev-action {
  display: flex;
  align-items: end;
}

#l3EvidenceModal .l3-ev-completed .form-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-left: 0;
  margin-bottom: 0;
}

#l3EvidenceModal #l3EvidenceCompleted {
  float: none;
  position: static;
  margin: 0;
  width: 1rem;
  height: 1rem;
  opacity: 1;
}

#l3EvidenceModal #l3EvidenceDate {
  min-width: 0;
}

@media (max-width: 1199.98px) {
  .risk-view-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #l3EvidenceModal .l3-evidence-form {
    grid-template-columns: minmax(200px, 1fr) minmax(170px, 1fr) minmax(220px, 1.3fr) 140px 140px 140px 150px;
  }
}

@media (max-width: 991.98px) {
  .risk-view-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #l3EvidenceModal .l3-evidence-form {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .l2-risk-header {
    padding: 1rem 1.1rem;
  }

  .l2-risk-body {
    padding: 0.85rem;
  }

  .risk-view-header {
    padding: 1rem 1.1rem;
  }

  .risk-view-body {
    padding: 0.85rem;
  }

  .risk-view-metrics-grid,
  .risk-view-meta-row {
    grid-template-columns: 1fr;
  }

  .risk-view-n2-item {
    grid-template-columns: 1fr auto;
  }

  .risk-view-n2-main {
    grid-column: 1 / -1;
  }

  .risk-view-editor-head {
    align-items: flex-start;
    display: grid;
  }

  #l3EvidenceModal .l3-evidence-form {
    grid-template-columns: 1fr;
  }
}

#l3EvidenceModal .table {
  table-layout: fixed;
}

#l3EvidenceModal .table th,
#l3EvidenceModal .table td {
  white-space: normal;
  word-break: break-word;
  font-size: 0.9rem;
}

#l3EvidenceModal .table th:nth-child(1),
#l3EvidenceModal .table td:nth-child(1) {
  width: 56px;
  text-align: center;
}

#l3EvidenceModal .table th:nth-child(2),
#l3EvidenceModal .table td:nth-child(2) {
  width: 220px;
}

#l3EvidenceModal .table th:nth-child(3),
#l3EvidenceModal .table td:nth-child(3) {
  width: 150px;
}

#l3EvidenceModal .table th:nth-child(4),
#l3EvidenceModal .table td:nth-child(4) {
  width: 110px;
  text-align: center;
}

#l3EvidenceModal .table th:nth-child(5),
#l3EvidenceModal .table td:nth-child(5) {
  width: 90px;
  text-align: center;
}

#l3EvidenceModal .table th:nth-child(6),
#l3EvidenceModal .table td:nth-child(6) {
  width: 120px;
  text-align: center;
}

#l3EvidenceModal .table th:nth-child(7),
#l3EvidenceModal .table td:nth-child(7) {
  width: 180px;
}

#l3EvidenceModal .table th:nth-child(8),
#l3EvidenceModal .table td:nth-child(8) {
  width: 96px;
  text-align: center;
}

@media (max-width: 1199.98px) {
  .dashboard-strategic-charts-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-strategic-charts-grid .dashboard-gap-chart-scroll {
    max-height: none;
  }

  .dashboard-strategic-charts-grid .dashboard-gap-chart {
    min-width: 720px;
  }

  .dashboard-strategic-charts-grid .dashboard-gap-chart-axis,
  .dashboard-strategic-charts-grid .dashboard-gap-chart-row {
    gap: 0.75rem;
    grid-template-columns: 250px minmax(360px, 1fr) 52px;
  }

  .dashboard-strategic-charts-grid .risk-matrix {
    gap: 0.35rem;
    grid-template-columns: 38px repeat(5, minmax(104px, 1fr));
    grid-template-rows: repeat(5, 92px) 30px;
    min-width: 600px;
  }

  .dashboard-strategic-charts-grid .risk-matrix-cell {
    min-height: 92px;
  }

  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-management-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-semaphore-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .risk-matrix {
    grid-template-columns: 38px repeat(5, minmax(104px, 1fr));
    grid-template-rows: repeat(5, 92px) 30px;
    min-width: 600px;
  }

  .risk-matrix-cell {
    min-height: 92px;
  }
}

@media (max-width: 575.98px) {
  .dashboard-hero {
    display: grid;
  }

  .dashboard-exec-grid,
  .dashboard-detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card-heading {
    display: grid;
  }

  .dashboard-summary-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .dashboard-management-grid,
  .dashboard-annual-grid,
  .dashboard-semaphore-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary-card {
    min-height: 112px;
    padding: 1.1rem 1.2rem;
  }

  .dashboard-title {
    font-size: 1.9rem;
  }
}
