/* === Tokens === */
:root {
  /* Color primario Kyndryl (cyan) */
  --primary: #1897AD;
  --primary-hover: #117287;
  --primary-bg: rgba(24, 151, 173, .14);

  /* Paleta Kyndryl */
  --cyan100: #E0F9FC;
  --cyan200: #B8EEF5;
  --cyan300: #80E2EE;
  --cyan400: #42D8EC;
  --cyan500: #20BDD6;
  --cyan600: #1897AD;
  --cyan700: #117287;
  --cyan800: #0A4E5E;
  --cyan900: #052A33;

  --red100: #FFE9E5;
  --red200: #FFBFB3;
  --red300: #FF9280;
  --red400: #FF6650;
  --red500: #FF462D;
  --red600: #E83015;
  --red700: #C42208;
  --red800: #901905;
  --red900: #3D0A02;

  --neutral100: #E8E8E8;
  --neutral200: #C8C8C8;
  --neutral300: #A8A8A8;
  --neutral400: #848484;
  --neutral500: #666666;
  --neutral600: #525252;
  --neutral700: #3A3A3A;
  --neutral800: #252525;
  --neutral900: #181818;

  --green100: #E5F8E2;
  --green200: #BBE8B4;
  --green300: #7DD374;
  --green400: #4DC043;
  --green500: #2BB309;
  --green600: #1E8C06;
  --green700: #145F04;
  --green800: #0C3E02;
  --green900: #062001;

  --amber100: #FFF3E0;
  --amber200: #FFE0A0;
  --amber300: #FFCC6A;
  --amber400: #FFB237;
  --amber500: #FF9800;
  --amber600: #CC7A00;
  --amber700: #995B00;
  --amber800: #663D00;
  --amber900: #332000;

  --blue100: #DDEEFF;
  --blue200: #BAD8FE;
  --blue300: #87B9FC;
  --blue400: #5A9AF7;
  --blue500: #3B82F6;
  --blue600: #2563EB;
  --blue700: #1A46C4;
  --blue800: #112F8A;
  --blue900: #071650;

  /* Dark mode surfaces */
  --bg: #111111;
  --bg-subtle: #2a2a2a;
  --panel: #1e1e1e;
  --panel-alt: #252525;

  /* Semantic */
  --text: #E8E8E8;
  --muted: #A8A8A8;
  --line: #3A3A3A;
  --border: #3A3A3A;
  --blue: #87B9FC;
  --red: #FF6650;
  --orange: #FFCC6A;
  --green: #7DD374;
  --ai: rgba(24, 151, 173, .12);

  /* Elevación */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, .55), 0 4px 8px rgba(0, 0, 0, .25);
  --shadow: var(--shadow-md);

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --radius: var(--radius-lg);

  /* Transición */
  --t: 150ms ease-out;

  /* Tipografía */
  --font-sans: 'Inter', 'Segoe UI', Arial, sans-serif;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-2xl: 32px;

  /* Espaciado 4pt */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;

  /* Z-index */
  --z-overlay: 100;
  --z-sidebar: 150;
  --z-modal: 200;
  --z-skip: 9999;
}

/* === Reset === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  font-size: var(--text-base);
  line-height: 1.5;
  scrollbar-color: #525252 #181818;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #181818;
}

*::-webkit-scrollbar-thumb {
  background: #525252;
  border: 2px solid #181818;
  border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
  background: #666666;
}

*::-webkit-scrollbar-corner {
  background: #181818;
}

/* === Skip link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  z-index: var(--z-skip);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* === Layout === */
.shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100dvh;
  transition: grid-template-columns 0.25s ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 56px 1fr;
}

/* === Sidebar === */
.side {
  background: #1e1e1e;
  border-right: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Brand lockup */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0 var(--sp-4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-4);
  position: relative;
}

/* Logo: siempre visible; se oculta solo al hover del sidebar colapsado (cuando aparece el botón de expandir) */
.sidebar-brand img {
  flex-shrink: 0;
  object-fit: contain;
  max-width: 22px;
  overflow: hidden;
  transition: max-width 0.2s ease, opacity 0.15s ease;
}

.shell.sidebar-collapsed .side:hover .sidebar-brand img {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  max-width: 200px;
  opacity: 1;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

.sidebar-toggle {
  flex-shrink: 0;
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: #848484;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, background var(--t), color var(--t);
  padding: 0;
}

.side:hover .sidebar-toggle {
  opacity: 1;
}

.sidebar-toggle:hover {
  background: var(--primary-bg);
  color: #E8E8E8;
}

.sidebar-toggle svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.sidebar-brand-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: #E8E8E8;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 400;
}

.nav {
  flex: 1;
}

.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  text-align: left;
  margin: 2px 0;
  color: #848484;
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 500;
  transition: background var(--t), color var(--t);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
}

.nav button.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}

.nav button.active,
.nav button:hover {
  background: var(--primary-bg);
  color: #E8E8E8;
  font-weight: 600;
}

.nav button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav button span {
  overflow: hidden;
  white-space: nowrap;
  max-width: 200px;
  transition: max-width 0.2s ease, opacity 0.15s ease;
}

.nav-icon {
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity var(--t);
}

.nav button.active .nav-icon,
.nav button:hover .nav-icon {
  opacity: 1;
}

.section {
  font-size: var(--text-xs);
  color: #525252;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
  padding: var(--sp-2) 0 var(--sp-1);
  margin: var(--sp-4) 0 var(--sp-1);
  overflow: hidden;
  max-height: 40px;
  white-space: nowrap;
  transition: max-height 0.2s ease, opacity 0.15s ease, margin 0.2s ease, padding 0.2s ease;
}

/* Sidebar footer */
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-4) 0 var(--sp-2);
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.sidebar-footer-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  max-width: 200px;
  transition: max-width 0.25s ease, opacity 0.15s ease;
}

.sidebar-footer-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-text {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* === Sidebar collapsed state === */
.shell.sidebar-collapsed .side {
  padding-left: 8px;
  padding-right: 8px;
}

.shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  gap: 0;
}

.shell.sidebar-collapsed .sidebar-brand-text {
  max-width: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.shell.sidebar-collapsed .sidebar-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  margin-left: 0;
  transform: translateY(-50%);
  opacity: 0;
}

.shell.sidebar-collapsed .side:hover .sidebar-toggle {
  opacity: 1;
}

.shell.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

.shell.sidebar-collapsed .section {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.shell.sidebar-collapsed .nav button {
  justify-content: center;
  padding: 9px 0;
  gap: 0;
}

.shell.sidebar-collapsed .nav button span {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

.shell.sidebar-collapsed .sidebar-footer {
  justify-content: center;
  gap: 0;
}

.shell.sidebar-collapsed .sidebar-footer-info {
  max-width: 0;
  opacity: 0;
  flex: none;
  pointer-events: none;
}

.shell.sidebar-collapsed .sidebar-footer .icon-btn {
  display: none;
}

/* === Main === */
.main {
  overflow: auto;
}

/* === Top bar === */
.top {
  height: 56px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  gap: var(--sp-3);
}

/* Zona izquierda */
.top-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  user-select: none;
}

.wordmark-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* Zona central */
.top-title-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
}

.top-title-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.top-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-subtitle {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--muted);
  margin: 0;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* En pantallas estrechas la bajada se oculta para no apretar la barra */
@media (max-width: 768px) {
  .top-subtitle { display: none; }
}

/* Zona derecha */
.top-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* Estado de plataforma */
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--green);
  background: rgba(30, 140, 6, .18);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7DD374;
  flex-shrink: 0;
}

/* Botón icono */
.icon-btn {
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background var(--t), color var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: #FF6650;
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid #1e1e1e;
  line-height: 1;
}

/* Avatar de usuario */
.user-menu-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  transition: box-shadow var(--t);
}

.user-menu-btn:hover {
  box-shadow: 0 0 0 3px var(--bg-subtle);
}

.user-menu-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .03em;
}

/* === Hamburger === */
.hamburger {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--t);
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger:hover {
  background: var(--bg-subtle);
}

.hamburger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* === Buttons === */
.btn {
  border: 1px solid #3A3A3A;
  background: #252525;
  color: #C8C8C8;
  border-radius: var(--radius-sm);
  padding: 9px var(--sp-3);
  font-weight: 600;
  cursor: pointer;
  font-size: var(--text-base);
  transition: background var(--t), border-color var(--t), transform 80ms ease-out;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.btn:hover {
  background: #2d2d2d;
  border-color: #525252;
  color: #E8E8E8;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn+.btn {
  margin-left: var(--sp-2);
}

/* === Content === */
.content {
  padding: var(--sp-6);
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.radar-screen {
  min-height: calc(100vh - 56px - (var(--sp-6) * 2));
}

.radar-frame {
  width: 100%;
  min-height: calc(100vh - 56px - (var(--sp-6) * 2));
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  display: block;
}

.reports-detail .radar-frame {
  min-height: calc(100vh - 56px - (var(--sp-6) * 2) - 108px);
}

.grid {
  display: grid;
  gap: var(--sp-4);
}

.cols4 {
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
}

.cols3 {
  grid-template-columns: repeat(3, 1fr);
}

.cols2 {
  grid-template-columns: repeat(2, 1fr);
}

/* === Cards === */
.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
  transition: box-shadow var(--t), border-color var(--t), transform 120ms ease-out;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 255, 255, .13);
  transform: translateY(-1px);
}

.card h2 {
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 0 var(--sp-4);
  color: #E8E8E8;
}

.card.chat {
  background: #181818;
  border-color: rgba(24, 151, 173, .18);
}

.card.chat:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

/* === KPI === */
.kpi {
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.kpi-body {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-2) 0 var(--sp-3);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon--warn {
  background: rgba(204, 122, 0, .20);
  color: #FFCC6A;
}

.kpi-icon--red {
  background: rgba(196, 34, 8, .20);
  color: #FF9280;
}

.kpi-icon--green {
  background: rgba(30, 140, 6, .20);
  color: #7DD374;
}

.kpi-icon--neutral {
  background: var(--primary-bg);
  color: #42D8EC;
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.kpi-value-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  width: fit-content;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  padding: 2px 6px;
  white-space: nowrap;
}

.kpi-trend--up-bad {
  background: rgba(196, 34, 8, .20);
  color: var(--red300);
}

/* Ambas tendencias "buenas" comparten estilo */
.kpi-trend--down-good,
.kpi-trend--up-good {
  background: rgba(30, 140, 6, .20);
  color: var(--green300);
}

.kpi .num {
  font-size: var(--text-xl);
  font-weight: 800;
  font-feature-settings: 'tnum' 1;
  line-height: 1;
  color: var(--text);
}

.kpi .lab {
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 400;
}

.kpi-divider {
  border: none;
  border-top: 1px dashed var(--border);
  margin: 0;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) 0 var(--sp-1);
  font-size: var(--text-sm);
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease-out;
}

.kpi-footer:hover {
  color: var(--primary);
}

/* === Alert rows === */
.alert-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  margin-bottom: var(--sp-2);
  width: 100%;
  text-align: left;
  background: none;
  cursor: pointer;
  transition: filter 150ms ease-out, transform 150ms ease-out;
}

.alert-row:hover {
  filter: brightness(1.15);
  transform: translateX(2px);
}

.alert-row:active {
  transform: translateX(1px);
}

.alert-row:last-child {
  margin-bottom: 0;
}

.alert-row--red {
  border-color: #FF9280;
  background: rgba(196, 34, 8, .10);
}

.alert-row--red .alert-icon {
  color: #FF9280;
}

.alert-row--orange {
  border-color: #FFCC6A;
  background: rgba(204, 122, 0, .10);
}

.alert-row--orange .alert-icon {
  color: #FFCC6A;
}

.alert-row--green {
  border-color: #7DD374;
  background: rgba(30, 140, 6, .10);
}

.alert-row--green .alert-icon {
  color: #7DD374;
}

.alert-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.alert-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.alert-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #E8E8E8;
}

.alert-desc {
  font-size: var(--text-xs);
  color: var(--muted);
}

.alert-chevron {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 150ms ease-out;
}

.alert-row:hover .alert-chevron {
  transform: translateX(2px);
  color: #E8E8E8;
}

/* === Pills === */
.pill--eq {
  min-width: 52px;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  padding: 4px 5px;
  font-size: 10px;
  font-weight: 700;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

.red {
  background: rgba(196, 34, 8, .20);
  color: #FF9280;
}

.orange {
  background: rgba(204, 122, 0, .20);
  color: #FFCC6A;
}

.blue {
  background: rgba(26, 70, 196, .20);
  color: #87B9FC;
}

.green {
  background: rgba(30, 140, 6, .20);
  color: #7DD374;
}

.gray {
  background: rgba(255, 255, 255, .08);
  color: #C8C8C8;
}

/* === Incident list === */
.incident {
  display: grid;
  grid-template-columns: 80px 1fr 140px 110px 120px;
  gap: var(--sp-3);
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.incident:first-child {
  border-top: 0;
}

.muted {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* === Progress === */
.progress {
  height: 8px;
  background: #3A3A3A;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}

/* === Timeline === */
.timeline {
  border-left: 3px solid #3A3A3A;
  margin-left: 8px;
  padding-left: 18px;
}

.event {
  position: relative;
  margin: 0 0 18px;
}

.event::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1e1e1e;
  border: 3px solid var(--primary);
}

/* === Chat === */
.chat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.msg {
  max-width: 76%;
  border-radius: var(--radius-lg);
  padding: var(--sp-3) 14px;
  background: #2a2a2a;
  font-size: var(--text-base);
  color: var(--text);
}

.msg.ai {
  background: rgba(24, 151, 173, .12);
  align-self: flex-start;
  border: 1px solid rgba(24, 151, 173, .30);
}

.msg.user {
  background: rgba(255, 255, 255, .06);
  align-self: flex-end;
}

.presence-avatar {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cyan700);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #2a2a3d;
  letter-spacing: .02em;
}

.presence-avatar--more {
  background: rgba(255, 255, 255, .12);
  color: var(--neutral200);
}

.presence-avatar[data-status]::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #2a2a3d;
  background: var(--neutral400);
}

.presence-avatar[data-status="online"]::after {
  background: var(--green400);
}

.presence-avatar[data-status="busy"]::after {
  background: var(--red400);
}

.presence-avatar[data-status="away"]::after {
  background: var(--amber400);
}

.tab__badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(24, 151, 173, .20);
  color: var(--cyan300);
  border: 1px solid rgba(24, 151, 173, .35);
  border-radius: var(--radius-full);
  padding: 2px 7px;
  margin-left: 4px;
}

.teams-chat__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.teams-chat__title {
  font-weight: 700;
  color: var(--text);
}

.msg-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--sp-2);
  align-items: flex-start;
}

.msg-row--user {
  grid-template-columns: 1fr 28px;
}

.msg-row--user .msg-avatar {
  order: 2;
}

.msg-row--user .msg-bubble {
  order: 1;
  align-items: flex-end;
}

.msg-row--user .msg-meta {
  text-align: right;
}

.msg-bubble {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.msg-avatar--user {
  background: rgba(255, 255, 255, .10);
  color: var(--neutral200);
}

.msg-avatar--ai {
  background: rgba(24, 151, 173, .18);
  color: var(--cyan300);
  font-size: 14px;
  border: 1px solid rgba(24, 151, 173, .35);
}

.msg-meta {
  font-size: var(--text-xs);
  color: var(--muted);
  padding: 0 4px;
}

.msg-row .msg {
  max-width: 100%;
}

.msg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  white-space: nowrap;
}

.chip--confidence {
  background: rgba(45, 179, 9, .14);
  color: var(--green300);
  border-color: rgba(45, 179, 9, .35);
}

.chip--rule {
  background: rgba(24, 151, 173, .10);
  color: var(--cyan300);
  border-color: rgba(24, 151, 173, .28);
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: rgba(24, 151, 173, .08);
  border: 1px dashed rgba(24, 151, 173, .30);
  border-radius: var(--radius-lg);
  padding: 8px 12px;
  font-size: var(--text-xs);
}

.typing-indicator__dots {
  display: inline-flex;
  gap: 3px;
}

.typing-indicator__dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan400);
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-indicator__dots span:nth-child(2) { animation-delay: .15s; }
.typing-indicator__dots span:nth-child(3) { animation-delay: .30s; }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-3px); opacity: 1; }
}

.teams-composer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
  padding: 10px 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
}

.teams-composer__placeholder {
  font-size: var(--text-sm);
  color: var(--muted);
}

.teams-composer__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--muted);
}

.teams-composer__icon {
  font-size: var(--text-md);
  opacity: .7;
}

.teams-composer__send {
  background: var(--primary);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.btn--ghost-amber {
  background: transparent;
  color: var(--amber300);
  border-color: rgba(255, 178, 55, .40);
}

.btn--ghost-amber:hover {
  background: rgba(255, 178, 55, .10);
  color: var(--amber300);
}

/* =========================================================== */
/* === Detail section: list + 360°                          === */
/* =========================================================== */

.detail-list,
.detail-360 {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.detail-list[hidden],
.detail-360[hidden],
.incident-360[hidden] {
  display: none !important;
}

/* Portfolio KPIs */
.detail-portfolio-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.matching-kpis {
  grid-template-columns: repeat(3, 1fr);
}

.detail-kpi {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.detail-kpi--alert {
  border-color: rgba(196, 34, 8, .35);
  background: linear-gradient(180deg, rgba(196, 34, 8, .08) 0%, var(--panel) 60%);
}

.detail-kpi__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
}

.detail-kpi__value {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  font-feature-settings: 'tnum' 1;
  line-height: 1.05;
}

.detail-kpi__hint {
  font-size: var(--text-xs);
  color: var(--muted);
}

.detail-kpi__hint--good {
  color: var(--green300);
  font-weight: 600;
}

/* Section header */
.detail-section__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--sp-3);
}

.detail-section__header h2 {
  margin: 0;
}

/* ========= Incident table ========= */
.incident-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.incident-table__head,
.incident-table__row {
  display: grid;
  grid-template-columns:
    80px              /* severidad */
    minmax(220px, 2.2fr) /* incidente */
    minmax(120px, 1fr)   /* owner */
    100px             /* inicio */
    130px             /* sla */
    130px             /* impacto */
    110px             /* expertos */
    130px             /* war room */
    70px              /* ia */
    20px;             /* chevron */
  gap: var(--sp-3);
  align-items: center;
}

.incident-table__head {
  padding: 8px var(--sp-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.incident-table--closed .incident-table__head,
.incident-table__head--closed {
  grid-template-columns:
    80px
    minmax(220px, 1.8fr)
    minmax(110px, 1fr)
    100px
    100px
    minmax(160px, 1.2fr)
    100px
    100px
    20px;
}

.incident-table__row {
  padding: var(--sp-3);
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  background: transparent;
  text-align: left;
}

.incident-table__row:hover {
  background: rgba(255, 255, 255, .04);
}

.incident-table__row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.incident-table__row--crit {
  border-left-color: var(--red400);
  background: rgba(196, 34, 8, .04);
}

.incident-table__row--warn {
  border-left-color: var(--amber400);
  background: rgba(204, 122, 0, .04);
}

.incident-table__row--info {
  border-left-color: var(--blue400);
  background: rgba(59, 130, 246, .04);
}

.incident-table__row--closed {
  border-left-color: var(--neutral600);
  grid-template-columns:
    80px
    minmax(220px, 1.8fr)
    minmax(110px, 1fr)
    100px
    100px
    minmax(160px, 1.2fr)
    100px
    100px
    20px;
}

.incident-table__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.incident-table__id {
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan300);
  letter-spacing: .02em;
  font-feature-settings: 'tnum' 1;
}

.incident-table__title b {
  color: var(--text);
}

.incident-table__time,
.incident-table__impact {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.incident-table__time b,
.incident-table__impact b {
  font-size: var(--text-sm);
  color: var(--text);
}

.incident-table__sla {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.incident-table__sla b {
  font-feature-settings: 'tnum' 1;
}

.incident-table__chevron {
  color: var(--muted);
  font-size: var(--text-md);
  text-align: center;
}

.incident-table__row:hover .incident-table__chevron {
  color: var(--cyan300);
  transform: translateX(2px);
}

/* SLA bar */
.sla-bar {
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}

.sla-bar span {
  display: block;
  height: 100%;
  background: var(--neutral400);
  border-radius: var(--radius-full);
}

.sla-bar--crit span { background: var(--red400); }
.sla-bar--warn span { background: var(--amber400); }
.sla-bar--ok span { background: var(--green400); }

/* Owner chip */
.owner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text);
}

/* Stacked experts (reuses .presence-avatar) */
.experts-stack {
  display: inline-flex;
}

.experts-stack .presence-avatar+.presence-avatar {
  margin-left: -8px;
}

/* Confidence pill */
.confidence-pill {
  background: rgba(45, 179, 9, .14);
  color: var(--green300);
  border: 1px solid rgba(45, 179, 9, .30);
}

.confidence-pill--mid {
  background: rgba(204, 122, 0, .14);
  color: var(--amber300);
  border-color: rgba(204, 122, 0, .30);
}

.confidence-pill--low {
  background: rgba(59, 130, 246, .14);
  color: var(--blue300);
  border-color: rgba(59, 130, 246, .30);
}

/* Closed pills (muted variants) */
.pill--muted {
  opacity: .65;
  filter: saturate(.55);
}

.post-link {
  color: var(--cyan300);
  font-size: var(--text-sm);
  text-decoration: none;
  font-weight: 600;
}

.post-link:hover {
  text-decoration: underline;
}

/* ========= 360° View ========= */
.back-link {
  align-self: flex-start;
  background: transparent;
  border: 1px solid rgba(24, 151, 173, .30);
  color: var(--cyan300);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t), border-color var(--t);
}

.back-link:hover {
  background: rgba(24, 151, 173, .10);
  border-color: var(--cyan400);
}

.back-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.incident-360__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.incident-360__header h2 {
  margin: 0 0 var(--sp-2);
}

.incident-360__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  text-align: right;
}

.incident-360__meta .owner-chip {
  align-items: center;
  gap: var(--sp-2);
  line-height: 1.2;
}

.incident-360__closed-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: rgba(45, 179, 9, .08);
  border: 1px solid rgba(45, 179, 9, .25);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.incident-360--closed .card h2 {
  font-size: var(--text-md);
}

/* Experts list (inside 360) */
.experts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.experts-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}

.experts-list li:last-child {
  border-bottom: 0;
}

.experts-list b {
  display: block;
  line-height: 1.2;
}

.experts-list .muted {
  display: block;
  font-size: var(--text-xs);
}

/* War room mini summary */
.war-room-mini {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-3);
}

.war-room-mini__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: var(--text-sm);
}

.war-room-mini__row:last-child {
  border-bottom: 0;
}

/* Governance list */
.governance-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.governance-list li {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: var(--text-sm);
}

.governance-list li:last-child {
  border-bottom: 0;
}

.governance-list__time {
  font-feature-settings: 'tnum' 1;
  color: var(--cyan300);
  font-weight: 700;
  font-size: var(--text-xs);
}

.governance-list .muted {
  display: block;
  font-size: var(--text-xs);
}

/* Action suggestion */
.action-suggestion {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  border: 1px solid rgba(24, 151, 173, .20);
  border-radius: var(--radius-md);
  background: rgba(24, 151, 173, .04);
  margin-bottom: var(--sp-3);
}

.action-suggestion:last-child {
  margin-bottom: 0;
}

.action-suggestion b {
  display: block;
  margin-bottom: 2px;
}

.action-suggestion p {
  margin: 0;
  font-size: var(--text-sm);
}

.action-suggestion__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* === Incident Copilot agentic console === */
.agent-console {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.agent-context {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
}

.agent-context h2 {
  margin: var(--sp-2) 0 0;
}

.agent-context p {
  margin-bottom: 0;
}

.agent-context__signals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: flex-end;
}

.agent-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, .85fr);
  gap: var(--sp-4);
  align-items: start;
}

.agent-chat {
  gap: var(--sp-4);
}

.agent-chat .teams-chat__header {
  margin-bottom: var(--sp-1);
}

.agent-action {
  margin-top: var(--sp-1);
}

.agent-side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.agent-policy .governance-list li {
  grid-template-columns: 52px 1fr;
}

.agent-closure-grid {
  align-items: stretch;
}

.agent-chat--closure,
.agent-close-panel {
  min-height: 100%;
}

.agent-close-panel {
  display: flex;
  flex-direction: column;
}

/* === Governance control console === */
.governance-console {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.governance-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
}

.governance-hero h2 {
  margin: var(--sp-2) 0 0;
}

.governance-hero p {
  margin-bottom: 0;
}

.governance-hero__signals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
}

.governance-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

.governance-capability {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.governance-capability__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}

.governance-capability--allow {
  border-color: rgba(45, 179, 9, .22);
}

.governance-capability--review {
  border-color: rgba(255, 183, 3, .24);
}

.governance-capability--deny {
  border-color: rgba(255, 83, 73, .26);
}

.governance-bullets {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.governance-main {
  align-items: stretch;
}

.governance-primary {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.governance-decision .action-suggestion__actions {
  min-width: 190px;
}

.governance-menu {
  position: relative;
  flex: 0 0 auto;
}

.governance-menu__trigger {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  list-style: none;
}

.governance-menu__trigger::-webkit-details-marker {
  display: none;
}

.governance-menu__trigger:hover,
.governance-menu[open] .governance-menu__trigger {
  border-color: rgba(24, 151, 173, .35);
  background: rgba(24, 151, 173, .12);
}

.governance-menu__trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.governance-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: var(--z-overlay);
  min-width: 178px;
  padding: var(--sp-2);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius-md);
  background: #1f1f1f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
}

.governance-menu__item {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
}

.governance-menu__item:hover,
.governance-menu__item:focus-visible {
  background: rgba(24, 151, 173, .14);
  outline: none;
}

.governance-menu__item--danger {
  color: var(--red300);
}

.governance-menu__item--danger:hover,
.governance-menu__item--danger:focus-visible {
  background: rgba(255, 83, 73, .12);
}

.governance-rules li {
  grid-template-columns: 110px 1fr auto;
}

.governance-side {
  height: 100%;
}

.governance-role-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
}

.governance-role {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .025);
}

.governance-role .muted {
  grid-column: 1 / -1;
  font-size: var(--text-xs);
}

.governance-exception .action-suggestion {
  margin-top: var(--sp-3);
}

/* Responsive (1101–1599px): incident-table en fila compacta de 2 líneas */
@media (min-width: 1101px) and (max-width: 1599px) {
  .incident-table__head,
  .incident-table__head--closed,
  .incident-table--closed .incident-table__head {
    display: none;
  }

  .incident-table {
    gap: var(--sp-2);
  }

  .incident-table__row,
  .incident-table__row--closed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .06);
    border-left-width: 4px;
    border-radius: var(--radius-md);
    /* Anula grid-template-columns heredados (incluido --closed) */
    grid-template-columns: none;
  }

  /* === Línea 1: severidad · título · owner · chevron === */
  .incident-table__row > .pill:first-child {
    order: 1;
    flex: 0 0 auto;
  }

  .incident-table__row > .incident-table__title {
    order: 2;
    flex: 1 1 280px;
    min-width: 0;
  }

  .incident-table__row > .owner-chip {
    order: 3;
    flex: 0 0 auto;
  }

  .incident-table__row > .incident-table__chevron {
    order: 4;
    flex: 0 0 auto;
    margin-left: auto;
  }

  /* === Salto a línea 2: métricas === */
  .incident-table__row::before {
    content: "";
    order: 5;
    flex-basis: 100%;
    height: 1px;
    background: rgba(255, 255, 255, .05);
    margin: 2px 0;
  }

  /* === Línea 2: métricas con etiqueta === */
  .incident-table__row > .incident-table__time,
  .incident-table__row > .incident-table__sla,
  .incident-table__row > .incident-table__impact,
  .incident-table__row > .experts-stack,
  .incident-table__row > .pill:not(:first-child):not(.pill--muted),
  .incident-table__row > .post-link,
  .incident-table__row > .btn,
  .incident-table__row > span:not(.pill):not(.incident-table__chevron):not(.owner-chip) {
    order: 6;
    flex: 0 1 auto;
    position: relative;
    padding: 0 var(--sp-3) 0 0;
    border-right: 1px solid rgba(255, 255, 255, .06);
  }

  /* Quita el separador del último item antes del chevron */
  .incident-table__row > .incident-table__chevron + *,
  .incident-table__row > :last-of-type {
    border-right: none;
  }

  /* Etiquetas superiores para métricas estructuradas */
  .incident-table__row > .incident-table__time::before,
  .incident-table__row > .incident-table__sla::before,
  .incident-table__row > .incident-table__impact::before {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
  }

  .incident-table__row > .incident-table__time::before {
    content: "Inicio";
  }

  .incident-table__row > .incident-table__sla::before {
    content: "SLA";
  }

  .incident-table__row > .incident-table__impact::before {
    content: "Impacto";
  }

  /* Experts-stack: conserva avatares en horizontal con etiqueta superior
     usando posicionamiento absoluto del ::before (no rompemos el inline-flex
     que solapa avatares con margin-left:-8px). */
  .incident-table__row > .experts-stack {
    position: relative;
    margin-top: 14px;
    align-self: flex-end;
  }

  .incident-table__row > .experts-stack::before {
    content: "Expertos";
    position: absolute;
    top: -14px;
    left: 0;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* Las pills secundarias (war room, IA, postmortem) ya son autodescriptivas
     por su contenido ("Activo · 6 en sala", "82%", "Ver postmortem"); no se
     añaden etiquetas para no romper el border-radius/padding del .pill. */

}

/* Responsive (<1100px): incident-table collapses to cards */
@media (max-width: 1100px) {
  .detail-portfolio-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .incident-table__head {
    display: none;
  }

  .incident-table__row,
  .incident-table__row--closed {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "sev title chev"
      "meta meta meta";
    row-gap: var(--sp-2);
    padding: var(--sp-3);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .06);
    border-left-width: 4px;
    border-radius: var(--radius-md);
  }

  .incident-table__row > .pill:first-child {
    grid-area: sev;
  }

  .incident-table__row > .incident-table__title {
    grid-area: title;
  }

  .incident-table__row > .incident-table__chevron {
    grid-area: chev;
  }

  .incident-table__row > .owner-chip,
  .incident-table__row > .incident-table__time,
  .incident-table__row > .incident-table__sla,
  .incident-table__row > .incident-table__impact,
  .incident-table__row > .experts-stack,
  .incident-table__row > .pill:not(:first-child),
  .incident-table__row > .post-link,
  .incident-table__row > span:not(.pill):not(.incident-table__chevron) {
    grid-area: meta;
  }

  .incident-table__row > .owner-chip {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .incident-table {
    gap: var(--sp-2);
  }

  /* Stack secondary chips on second row */
  .incident-table__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    align-items: center;
  }

  .incident-table__row > .incident-table__title {
    flex: 1 1 60%;
    min-width: 200px;
  }

  .incident-table__row > .incident-table__chevron {
    margin-left: auto;
  }

  .incident-360__header {
    flex-direction: column;
  }

  .incident-360__meta {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .detail-portfolio-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .detail-kpi__value {
    font-size: var(--text-xl);
  }

  .action-suggestion {
    grid-template-columns: 1fr;
  }

  .action-suggestion__actions {
    justify-content: flex-start;
  }
}

/* =========================================================== */
/* === War Room section: list + 360° per room              === */
/* =========================================================== */

.warroom-list,
.warroom-360 {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.warroom-list[hidden],
.warroom-360[hidden],
.warroom-room[hidden] {
  display: none !important;
}

.detail-kpi__value--text {
  font-size: var(--text-lg);
}

/* === Warroom table === */
.warroom-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.warroom-table__head,
.warroom-table__row {
  display: grid;
  grid-template-columns:
    80px             /* severidad */
    minmax(220px, 1.8fr) /* sala+incidente */
    110px            /* participantes */
    100px            /* SLA */
    110px            /* impacto */
    minmax(150px, 1fr) /* minuta IA */
    110px            /* tono */
    64px             /* IA */
    20px;            /* chevron */
  gap: var(--sp-3);
  align-items: center;
}

.warroom-table__head {
  padding: 8px var(--sp-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.warroom-table__row {
  padding: var(--sp-3);
  border-left: 3px solid transparent;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  transition: background var(--t), border-color var(--t);
  background: transparent;
  text-align: left;
}

.warroom-table__row:hover {
  background: rgba(255, 255, 255, .04);
}

.warroom-table__row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.warroom-table__row--active {
  border-left-color: var(--green400);
  background: rgba(45, 179, 9, .05);
}

.warroom-table__row--convocatoria {
  border-left-color: var(--amber400);
  background: rgba(204, 122, 0, .04);
}

.warroom-table__row--inactivo {
  border-left-color: var(--neutral600);
  opacity: .85;
}

.warroom-table__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.warroom-table__channel {
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan300);
  font-family: var(--font-sans);
  letter-spacing: .02em;
}

.warroom-table__time,
.warroom-table__minuta,
.warroom-table__update {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.warroom-table__minuta {
  font-size: var(--text-xs);
}

.warroom-table__update b {
  font-feature-settings: 'tnum' 1;
}

.chip.chip--muted {
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  border-color: rgba(255, 255, 255, .08);
}

/* === Sentiment mini bar (used in list rows) === */
.sentiment-mini {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  height: 14px;
}

.sentiment-mini__cell {
  width: 8px;
  height: 14px;
  border-radius: 2px;
  background: var(--neutral600);
}

.sentiment-mini__cell--calm { background: var(--green400); }
.sentiment-mini__cell--warn { background: var(--amber400); }
.sentiment-mini__cell--crit { background: var(--red400); }

/* === 360° header === */
.warroom-360__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.warroom-360__header h2 {
  margin: 4px 0 var(--sp-2);
}

.warroom-360__channel {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--cyan300);
  letter-spacing: .02em;
}

.warroom-360__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sp-2);
  text-align: right;
}

.warroom-360__update {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  font-size: var(--text-sm);
}

/* === Warroom chat (variant of teams chat) === */
.warroom-chat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
}

/* === Minuta live === */
.minuta-live__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.minuta-live__header h2 {
  margin: 0 0 4px;
  display: inline-block;
}

.minuta-live__actions {
  display: flex;
  gap: var(--sp-2);
}

.minuta-live__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.minuta-live__block {
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.minuta-live__block:nth-child(1),
.minuta-live__block:nth-child(2),
.minuta-live__block:nth-child(3) {
  grid-row: 1;
}

.minuta-live__block:nth-child(4),
.minuta-live__block:nth-child(5) {
  grid-row: 2;
}

.minuta-live__block:nth-child(5) {
  grid-column: 2 / span 2;
}

.minuta-live__block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}

.minuta-live__tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.minuta-live__tag--hipotesis {
  background: rgba(24, 151, 173, .18);
  color: var(--cyan300);
}

.minuta-live__tag--decision {
  background: rgba(45, 179, 9, .14);
  color: var(--green300);
}

.minuta-live__tag--accion {
  background: rgba(59, 130, 246, .14);
  color: var(--blue300);
}

.minuta-live__tag--riesgo {
  background: rgba(196, 34, 8, .18);
  color: var(--red300);
}

.minuta-live__tag--next {
  background: rgba(204, 122, 0, .14);
  color: var(--amber300);
}

.minuta-live__block p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.minuta-live__block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: var(--text-sm);
}

.minuta-live__block ul li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .03);
}

.minuta-live__block ul li:last-child {
  border-bottom: 0;
}

/* === Sentiment strip === */
.sentiment-strip {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.sentiment-strip__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sentiment-strip__bar {
  display: flex;
  gap: 3px;
  height: 28px;
}

.sentiment-strip__cell {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--neutral600);
  position: relative;
}

.sentiment-strip__cell--calm { background: var(--green400); }
.sentiment-strip__cell--warn { background: var(--amber400); }
.sentiment-strip__cell--crit { background: var(--red400); }

.sentiment-strip__cell--marker::after {
  content: '!';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red500);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--panel);
}

.sentiment-strip__cell--now {
  outline: 2px solid var(--cyan400);
  outline-offset: 1px;
}

.sentiment-strip__axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .04em;
}

.sentiment-strip__note {
  margin: 0;
  font-size: var(--text-xs);
}

/* === Exec comm draft === */
.exec-comm__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

.exec-comm__header h2 {
  margin: 0 0 4px;
}

.exec-comm__body {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--cyan500);
  background: rgba(24, 151, 173, .06);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-sm);
  line-height: 1.6;
  font-style: normal;
  color: var(--text);
}

.exec-comm__actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* === Adaptive Cards gallery === */
.cards-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.cards-gallery__item {
  background: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color var(--t), transform var(--t);
}

.cards-gallery__item:hover {
  border-color: rgba(24, 151, 173, .35);
  transform: translateY(-1px);
}

.cards-gallery__item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
}

.cards-gallery__item h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.cards-gallery__item p {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.5;
}

.cards-gallery__item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid rgba(255, 255, 255, .04);
  font-size: var(--text-xs);
}

/* === Convocatoria status === */
.convocatoria-status {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.convocatoria-status__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-sm);
}

/* === No warroom (inactive state) === */
.no-warroom p {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.activate-manual {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.activate-manual__check {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
  color: var(--text);
  cursor: pointer;
}

.activate-manual__check input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan500);
}

/* Responsive */
@media (max-width: 1100px) {
  .warroom-table__head {
    display: none;
  }

  .warroom-table__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-3);
    align-items: center;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .06);
    border-left-width: 4px;
    padding: var(--sp-3);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    min-width: 0;
  }

  .warroom-table__row > .warroom-table__title {
    flex: 1 1 60%;
    min-width: 0;
  }

  .warroom-table__row > .incident-table__chevron {
    margin-left: auto;
  }

  .warroom-table__minuta {
    min-width: 0;
  }

  .warroom-table__minuta .muted,
  .warroom-table__title > .muted,
  .warroom-table__title b {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .warroom-table {
    gap: var(--sp-2);
  }

  .minuta-live__grid {
    grid-template-columns: 1fr;
  }

  .minuta-live__block:nth-child(n) {
    grid-row: auto;
    grid-column: auto;
  }

  .cards-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .warroom-360__header {
    flex-direction: column;
  }

  .warroom-360__meta {
    align-items: flex-start;
    text-align: left;
  }
}

/* Warroom table compact layout for desktop shells with reduced content width */
@media (min-width: 1101px) and (max-width: 1599px) {
  .warroom-table__head {
    display: none;
  }

  .warroom-table {
    gap: var(--sp-2);
  }

  .warroom-table__row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) auto auto auto 20px;
    grid-template-areas:
      "title  title  sev part sla chev"
      "impact minuta .   tono ia  chev";
    gap: var(--sp-2) var(--sp-3);
    align-items: center;
    min-width: 0;
    padding: var(--sp-3) var(--sp-4);
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, .06);
    border-left-width: 4px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .warroom-table__row--active {
    border-left-color: var(--green400);
    background: rgba(45, 179, 9, .05);
  }

  .warroom-table__row--convocatoria {
    border-left-color: var(--amber400);
    background: rgba(204, 122, 0, .04);
  }

  .warroom-table__row--inactivo {
    border-left-color: var(--neutral600);
  }

  .warroom-table__row > .pill:first-child {
    grid-area: sev;
    align-self: center;
    justify-self: start;
  }

  .warroom-table__row > .warroom-table__title {
    grid-area: title;
    min-width: 0;
  }

  .warroom-table__row > .experts-stack {
    grid-area: part;
    align-self: center;
  }

  .warroom-table__row > .incident-table__sla {
    grid-area: sla;
    min-width: 0;
  }

  .warroom-table__row > .incident-table__impact {
    grid-area: impact;
    min-width: 0;
  }

  .warroom-table__row > .warroom-table__minuta {
    grid-area: minuta;
    min-width: 0;
    overflow: hidden;
  }

  .warroom-table__row > .sentiment-mini,
  .warroom-table__row > span.muted {
    grid-area: tono;
  }

  .warroom-table__row > .pill.confidence-pill {
    grid-area: ia;
    justify-self: start;
  }

  .warroom-table__row > .incident-table__chevron {
    grid-area: chev;
    justify-self: end;
  }

  .warroom-table__row > .incident-table__impact,
  .warroom-table__row > .warroom-table__minuta,
  .warroom-table__row > .sentiment-mini,
  .warroom-table__row > span.muted {
    border-top: 1px solid rgba(255, 255, 255, .05);
    padding-top: var(--sp-2);
    margin-top: 2px;
  }

  .warroom-table__row > .incident-table__sla::before,
  .warroom-table__row > .incident-table__impact::before,
  .warroom-table__row > .warroom-table__minuta::before {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
  }

  .warroom-table__row > .incident-table__sla::before {
    content: "SLA";
  }

  .warroom-table__row > .incident-table__impact::before {
    content: "Impacto";
  }

  .warroom-table__row > .warroom-table__minuta::before {
    content: "Minuta IA";
  }

  .warroom-table__title b,
  .warroom-table__title > .muted,
  .warroom-table__minuta .muted {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .warroom-table__minuta .muted {
    max-width: 180px;
  }
}

@media (max-width: 768px) {
  .warroom-table__row {
    align-items: flex-start;
  }

  .warroom-table__row > .warroom-table__title {
    flex-basis: calc(100% - 92px);
  }

  .warroom-table__row > .experts-stack,
  .warroom-table__row > .warroom-table__time,
  .warroom-table__row > .warroom-table__minuta,
  .warroom-table__row > .sentiment-mini,
  .warroom-table__row > .warroom-table__update {
    flex: 1 1 130px;
  }

  .warroom-table__row > .warroom-table__minuta {
    max-width: 100%;
  }

  .cards-gallery {
    grid-template-columns: 1fr;
  }

  .exec-comm__header {
    flex-direction: column;
  }
}

/* === Screens (fade-in on activate) === */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Action list === */
.action-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin: var(--sp-2) 0 0 0;
  padding: 0;
}

.action-item {
  display: flex;
  flex-direction: column;
  gap: 0px;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--line);
}

.action-item:first-child {
  border-top: none;
  padding-top: 0;
}

.action-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-deadline {
  font-size: var(--text-xs);
  font-weight: 700;
  font-feature-settings: 'tnum' 1;
  color: var(--muted);
}

.action-deadline--urgent { color: #FF9280; }
.action-deadline--soon   { color: #FFCC6A; }

.action-owner {
  font-size: 10px;
  color: var(--muted);
}

.action-desc {
  font-size: var(--text-xs);
  color: #E8E8E8;
  line-height: 1.0;
  margin: 0;
}

/* === Teams context panel (Home) === */
.teams-context__summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

.teams-context__summary::-webkit-details-marker {
  display: none;
}

.teams-context__summary svg {
  color: var(--cyan400);
  flex-shrink: 0;
}

.teams-context__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3) var(--sp-5);
  margin-top: var(--sp-4);
}

.teams-context__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--text-sm);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .teams-context__grid { grid-template-columns: 1fr; }
}

/* === Domain list === */
.domain-list {
  list-style: none;
  padding: 0;
  margin: var(--sp-2) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.domain-item {
  display: grid;
  grid-template-columns: 8px 90px 1fr 80px;
  align-items: center;
  gap: var(--sp-3);
}

.domain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.domain-name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: #E8E8E8;
  white-space: nowrap;
}

.domain-list-header {
  display: grid;
  grid-template-columns: 8px 90px 1fr 80px;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.domain-col-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.domain-incidents {
  display: flex;
  align-items: center;
  gap: 5px;
}

.domain-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
  flex-shrink: 0;
}

.domain-item--crit .domain-pip--fill  { background: #FF9280; }
.domain-item--warn .domain-pip--fill  { background: #FFCC6A; }
.domain-item--good .domain-pip--fill  { background: #7DD374; }

.domain-status {
  font-size: 10px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-item--crit .domain-dot { background: #FF9280; }
.domain-item--crit .domain-bar-fill { background: #FF9280; }
.domain-item--crit .domain-status { color: #FF9280; }

.domain-item--warn .domain-dot { background: #FFCC6A; }
.domain-item--warn .domain-bar-fill { background: #FFCC6A; }
.domain-item--warn .domain-status { color: #FFCC6A; }

.domain-item--good .domain-dot { background: #7DD374; }
.domain-item--good .domain-bar-fill { background: #7DD374; }
.domain-item--good .domain-status { color: #7DD374; }

/* === Heatmap === */
.heat {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.heat div {
  min-height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 6px 4px;
  border: 1px solid transparent;
  transition: transform var(--t), box-shadow var(--t);
  cursor: default;
}

.heat div:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
  z-index: 1;
  position: relative;
}

.heat div::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

.heat div.h-good {
  background: rgba(30, 140, 6, .15);
  color: #7DD374;
  border-color: rgba(125, 211, 116, .20);
}

.heat div.h-warn {
  background: rgba(204, 122, 0, .15);
  color: #FFCC6A;
  border-color: rgba(255, 204, 106, .20);
}

.heat div.h-crit {
  background: rgba(196, 34, 8, .15);
  color: #FF9280;
  border-color: rgba(255, 146, 128, .20);
}

.heat div.h-neutral {
  background: rgba(26, 70, 196, .15);
  color: #87B9FC;
  border-color: rgba(135, 185, 252, .20);
}

/* === Executive Dashboard (Valor del piloto) === */

/* Header + periodo */
.exec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--sp-4);
}
.exec-head h2 { margin: 0 0 var(--sp-1); font-size: var(--text-lg); color: var(--text); }
.exec-head p  { margin: 0; }

.exec-period { display: flex; align-items: center; }
.exec-period__group { display: flex; }

.exec-period__btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 4px 12px;
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
  margin-left: -1px;
}
.exec-period__group .exec-period__btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.exec-period__group .exec-period__btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.exec-period__btn--active {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--cyan400);
  z-index: 1;
  position: relative;
}
.exec-period__btn:hover:not(.exec-period__btn--active) {
  background: var(--panel-alt);
  color: var(--text);
}
.exec-period__btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  z-index: 2;
  position: relative;
}

/* Titular de impacto */
.exec-headline {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--ai);
  border: 1px solid rgba(24,151,173,.20);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  flex-wrap: wrap;
}
.exec-headline__icon { color: var(--cyan400); flex-shrink: 0; }
.exec-headline__text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  flex: 1;
  min-width: 180px;
}
.exec-headline__text strong { color: var(--text); font-weight: 700; }

.exec-headline__stats { display: flex; gap: var(--sp-5); flex-shrink: 0; }
.exec-headline__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  color: var(--muted);
}
.exec-headline__stat-val {
  font-size: var(--text-md);
  font-weight: 800;
  color: var(--cyan400);
  font-feature-settings: 'tnum' 1;
}
.exec-headline__badge { flex-shrink: 0; }

/* KPI grid */
.executive-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}
.executive-kpis .kpi,
.executive-kpis .kpi-header { min-width: 0; }
.executive-kpis .lab { overflow-wrap: anywhere; }

/* Sparkline dentro del KPI */
.kpi-spark {
  display: block;
  width: 100%;
  height: 24px;
  margin-top: var(--sp-3);
  overflow: visible;
}
.kpi-spark-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  opacity: 0.65;
}

/* Analytics grid: trend chart + donut */
.exec-analytics-grid { grid-template-columns: 3fr 2fr; }

.exec-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.exec-chart__legend {
  display: flex;
  gap: var(--sp-5);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}
.exec-chart__legend-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}
.exec-chart__legend-item::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  flex-shrink: 0;
}
.exec-chart__legend-item--base::before {
  background: repeating-linear-gradient(
    90deg,
    #848484 0, #848484 5px,
    transparent 5px, transparent 8px
  );
  height: 1.5px;
  margin-top: 1px;
}
.exec-chart__legend-item--ia::before { background: var(--primary); }

/* Donut Mesa */
.exec-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
}
.exec-donut { width: 180px; height: 180px; flex-shrink: 0; overflow: visible; }

.exec-mesa-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.exec-mesa-legend__item {
  display: grid;
  grid-template-columns: 10px 1fr auto auto auto;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
}
.exec-mesa-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.exec-mesa-legend__name  { color: var(--muted); }
.exec-mesa-legend__count { font-weight: 700; color: var(--text); font-feature-settings: 'tnum' 1; }
.exec-mesa-legend__pct   { color: var(--muted); min-width: 28px; text-align: right; }
.exec-mesa-legend__trend {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  background: rgba(30,140,6,.20);
  color: #7DD374;
}

/* Gobernanza IA */
.exec-gov__rows { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.exec-gov__row  {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
}
.exec-gov__label    { font-size: var(--text-xs); color: var(--muted); }
.exec-gov__bar-wrap { min-width: 70px; }
.exec-gov__val      { font-size: var(--text-xs); font-weight: 700; color: var(--text); font-feature-settings: 'tnum' 1; white-space: nowrap; }
.exec-gov__val--full { color: var(--green400); }
.exec-gov__note {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

/* Salud condensada */
.exec-health-compact .heat { grid-template-columns: repeat(4, 1fr); }

/* Reportes: KPIs (2x2) + tendencia MTTR en la columna izquierda,
   tabla de ejecuciones ocupando toda la altura en la columna derecha */
.reports-trend-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: var(--sp-4);
}
.reports-trend-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.reports-trend-col .executive-kpis {
  grid-template-columns: repeat(2, 1fr);
}
.exec-trend-card--compact { padding: var(--sp-3); }
.exec-trend-card--compact .exec-chart { max-height: 220px; }

/* Responsive */
@media (max-width: 960px) {
  .exec-analytics-grid { grid-template-columns: 1fr; }
  .exec-headline__stats { display: none; }
  .reports-trend-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .executive-kpis { grid-template-columns: repeat(2, 1fr); }

  .exec-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .exec-headline, .exec-chart * { animation: none !important; transition: none !important; }
}

/* Heat legend */
.heat-legend {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

.heat-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 500;
}

.heat-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.heat-legend-dot--good {
  background: #7DD374;
}

.heat-legend-dot--warn {
  background: #FFCC6A;
}

.heat-legend-dot--crit {
  background: #FF9280;
}

.heat-legend-dot--neutral {
  background: #87B9FC;
}

/* === Persona === */
.persona {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #42D8EC;
  flex-shrink: 0;
}

.score {
  font-size: var(--text-xl);
  font-weight: 800;
  color: #42D8EC;
}

/* === Expert Matching === */
.matching-list,
.matching-360 {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.matching-list[hidden],
.matching-360[hidden],
.expert-360[hidden] {
  display: none !important;
}

.matching-context,
.matching-toolbar {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  align-items: flex-start;
}

.matching-context h2,
.matching-toolbar h2,
.expert-360__header h2 {
  margin: var(--sp-2) 0 0;
}

.matching-context p {
  margin-bottom: 0;
}

.matching-context__chips,
.matching-toolbar__actions,
.matching-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: flex-end;
}

.matching-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.matching-card:hover,
.matching-card:focus-visible {
  border-color: rgba(66, 216, 236, .45);
  background: rgba(66, 216, 236, .04);
  transform: translateY(-1px);
  outline: none;
}

.matching-card--recommended {
  border-color: rgba(125, 211, 116, .32);
}

.matching-card--backup {
  border-color: rgba(255, 255, 255, .10);
}

.matching-card__top,
.matching-score-row,
.expert-360__header {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  align-items: flex-start;
}

.matching-card__top .persona {
  flex: 1 1 auto;
  min-width: 0;
}

.matching-card__top .persona > div {
  min-width: 0;
}

.matching-card__top .presence-avatar {
  width: 34px;
  min-width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.matching-card__top > .pill {
  width: 92px;
  min-width: 92px;
  min-height: 34px;
  flex: 0 0 92px;
  padding: 5px var(--sp-2);
  text-align: center;
  white-space: normal;
  line-height: 1.15;
}

.matching-card p {
  margin: 0;
}

.matching-score-row {
  align-items: center;
  padding: var(--sp-3) 0;
  border-top: 1px solid rgba(255, 255, 255, .05);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.matching-score-row__meta,
.expert-360__score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
}

.expert-360__persona .presence-avatar {
  width: 52px;
  height: 52px;
  font-size: var(--text-base);
}

.expert-360__score .score {
  font-size: var(--text-3xl);
  line-height: 1;
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.score-factor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px var(--sp-2);
  align-items: center;
  font-size: var(--text-sm);
}

.score-factor .progress {
  grid-column: 1 / -1;
}

.skill-matrix {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.skill-matrix > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.skill-matrix > div:last-child {
  border-bottom: 0;
}

@media (max-width: 1100px) {
  .matching-context,
  .matching-toolbar,
  .expert-360__header {
    flex-direction: column;
  }

  .matching-context__chips,
  .matching-toolbar__actions,
  .expert-360__score {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .matching-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .matching-score-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .matching-card__top {
    align-items: flex-start;
  }

  .matching-score-row__meta {
    align-items: flex-start;
    text-align: left;
  }
}

/* === Workflow === */
.workflow {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.step {
  background: #252525;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-3) 14px;
  min-width: 120px;
  text-align: center;
  font-size: var(--text-base);
  color: var(--text);
}

.arrow {
  color: #525252;
  font-size: 24px;
}

/* === Misc === */
.small {
  font-size: var(--text-sm);
}

.full {
  grid-column: 1 / -1;
}

/* === Mobile backdrop === */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: var(--z-overlay);
}

.backdrop.open {
  display: block;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .hamburger {
    display: flex;
  }

  .wordmark-name {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }

  .side {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    z-index: var(--z-sidebar);
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, .5);
  }

  .side.open {
    display: flex;
    animation: slideIn 0.2s ease-out;
  }

  @keyframes slideIn {
    from {
      transform: translateX(-16px);
      opacity: 0;
    }

    to {
      transform: translateX(0);
      opacity: 1;
    }
  }

  .cols4,
  .cols3,
  .cols2 {
    grid-template-columns: 1fr;
  }

  .incident {
    grid-template-columns: 1fr;
  }

  .executive-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .heat {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .agent-main {
    grid-template-columns: 1fr;
  }

  .agent-context {
    flex-direction: column;
  }

  .agent-context__signals {
    justify-content: flex-start;
  }

  .governance-hero {
    flex-direction: column;
  }

  .governance-hero__signals {
    justify-content: flex-start;
  }

  .governance-matrix {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 768px) {
  .content {
    padding: var(--sp-4);
  }

  .top {
    padding: 0 var(--sp-4);
  }

  .status-pill {
    display: none;
  }

  .executive-kpis {
    grid-template-columns: 1fr;
  }

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

  .executive-health-card .detail-section__header {
    flex-direction: column;
  }

  .agent-context__signals .chip,
  .agent-action .chip,
  .agent-close-panel .chip,
  .governance-hero__signals .chip,
  .governance-decision .chip {
    white-space: normal;
  }

  .agent-policy .governance-list li {
    grid-template-columns: 1fr;
  }

  .governance-rules li,
  .governance-role {
    grid-template-columns: 1fr;
  }

  .governance-decision .action-suggestion__actions {
    min-width: 0;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ========================================================
   Tablero Ejecutivo — Desempeño por proveedor
   ======================================================== */

.exec-provider-card,
.exec-expansion-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Tabla de proveedores: grid propio, hereda estilos base de .incident-table */
.incident-table__head--providers,
.incident-table__row--providers {
  grid-template-columns:
    minmax(150px, 1.6fr)   /* proveedor */
    100px                  /* incidentes */
    minmax(130px, 1.2fr)   /* sla barra */
    80px                   /* mttr */
    minmax(100px, 0.9fr)   /* concentración */
    100px;                 /* estado */
}

/* Ancho mínimo para que la tabla dense no rompa en pantallas medias */
.exec-provider-card .incident-table {
  min-width: 0;
  overflow-x: auto;
}

/* Barra de SLA inline dentro de la celda */
.provider-sla {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.provider-sla .sla-bar {
  flex: 1;
  min-width: 60px;
}

.provider-sla__pct {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--green300);
  white-space: nowrap;
}

.provider-sla__pct--crit {
  color: var(--red400);
}

.exec-provider-note {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.5;
  padding-top: var(--sp-2);
  border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ========================================================
   Tablero Ejecutivo — Preparación para expansión
   ======================================================== */

.expansion-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.expansion-row {
  background: var(--panel-alt);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--t);
}

.expansion-row:hover {
  border-color: rgba(255, 255, 255, .12);
}

.expansion-row--warn {
  border-color: rgba(255, 178, 55, .2);
  background: linear-gradient(180deg, rgba(255, 178, 55, .05) 0%, var(--panel-alt) 60%);
}

.expansion-row__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}

.expansion-row__country {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.expansion-row__country b {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}

.expansion-row__country .muted {
  font-size: var(--text-xs);
}

.expansion-row__metrics {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.expansion-metric {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.expansion-metric__label {
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  min-width: 170px;
  flex-shrink: 0;
}

.expansion-metric__bar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
}

.expansion-metric__bar .sla-bar {
  flex: 1;
}

.expansion-metric__pct {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--green300);
  min-width: 30px;
  text-align: right;
}

.expansion-metric__pct--neutral {
  color: var(--muted);
}

/* Responsive: en pantallas <900px las dos cards del grid cols2 apilan */
@media (max-width: 900px) {
  .exec-provider-card .incident-table {
    overflow-x: auto;
  }

  .incident-table__head--providers,
  .incident-table__row--providers {
    min-width: 640px;
  }

  .expansion-metric__label {
    min-width: 120px;
  }
}

/* === Cursor en celdas del heatmap ejecutivo === */
.exec-health-compact .heat div {
  cursor: pointer;
}

/* Garantiza que el atributo hidden no sea sobreescrito por display:flex/grid */
.dm[hidden], .dm-backdrop[hidden] { display: none !important; }

/* === Modal: detalle de salud por dominio (dm = domain modal) === */
@keyframes dm-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .60);
  z-index: var(--z-modal);
  animation: dm-in 180ms ease-out both;
}

.dm {
  position: fixed;
  inset: 0;
  margin: auto;
  width: clamp(320px, 90vw, 480px);
  height: fit-content;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  padding: var(--sp-5);
  z-index: calc(var(--z-modal) + 1);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  animation: dm-in 200ms ease-out both;
}

.dm__header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.dm__header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm__title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin: 0;
}

.dm__subtitle {
  font-size: var(--text-xs);
}

.dm__badge {
  flex-shrink: 0;
  align-self: center;
}

.dm__close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: color var(--t), background var(--t);
}

.dm__close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.dm__close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* KPI chips */
.dm__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
}

.dm__metric {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dm__metric-value {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
}

.dm__metric-label {
  font-size: var(--text-xs);
  color: var(--muted);
  text-align: center;
}

/* Section label */
.dm__section-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Breakdown rows */
.dm__breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.dm__breakdown-row {
  display: grid;
  grid-template-columns: 100px 1fr 28px;
  align-items: center;
  gap: var(--sp-2);
}

.dm__breakdown-label {
  font-size: var(--text-sm);
  color: var(--muted);
}

.dm__pips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dm__pip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dm__pip--empty {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.dm__breakdown-count {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* AI Insight */
.dm__insight {
  display: flex;
  gap: var(--sp-3);
  background: rgba(255, 255, 255, .04);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--sp-3);
}

.dm__insight-icon {
  color: var(--primary);
  font-size: var(--text-base);
  flex-shrink: 0;
  margin-top: 1px;
}

.dm__insight-text {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Footer */
.dm__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

.dm__ttr-label {
  font-size: var(--text-xs);
}

@media (max-width: 480px) {
  .dm__metrics { grid-template-columns: repeat(3, 1fr); }
  .dm { padding: var(--sp-4); }
}

/* ============================================================================
 * Panel de impacto comercial (decisión rápida)
 * ========================================================================== */
.biz { display: flex; flex-direction: column; gap: var(--sp-5); }

.biz__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.biz__head h2 { margin: 0; }

.biz__risk {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: var(--text-xl);
  font-weight: 800;
  line-height: 1;
  font-feature-settings: 'tnum' 1;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  white-space: nowrap;
}
.biz__risk span { font-size: var(--text-xs); font-weight: 500; opacity: .85; margin-top: 3px; }
.biz__risk--crit { color: var(--red300); background: rgba(196, 34, 8, .14); }
.biz__risk--warn { color: var(--amber300); background: rgba(204, 122, 0, .14); }
.biz__risk--ok   { color: var(--green300); background: rgba(30, 140, 6, .14); }

/* Métricas comerciales */
.biz-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.biz-metric {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  border-left: 3px solid var(--line);
}
.biz-metric--crit { border-left-color: var(--red400); }
.biz-metric--warn { border-left-color: var(--amber400); }
.biz-metric--ok   { border-left-color: var(--green400); }
.biz-metric__val {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  font-feature-settings: 'tnum' 1;
  line-height: 1.1;
}
.biz-metric__unit { font-size: var(--text-xs); font-weight: 500; color: var(--muted); }
.biz-metric__lab { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-top: var(--sp-1); }
.biz-metric__sub { font-size: var(--text-xs); color: var(--muted); margin-top: 2px; line-height: 1.35; }

.biz-footnote {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  font-size: var(--text-xs);
  color: var(--muted);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.biz-footnote b { color: var(--text); font-weight: 600; }

/* Decisión */
.biz-decision { display: flex; flex-direction: column; gap: var(--sp-3); }
.biz-decision__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.biz-decision__head h3 { margin: 0; font-size: var(--text-md); font-weight: 700; color: var(--text); }

.biz-options { display: flex; flex-direction: column; gap: var(--sp-2); }
.biz-option {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  border: 1px solid var(--line);
}
.biz-option--reco { border-color: var(--green600); background: rgba(30, 140, 6, .08); }
.biz-option--no { opacity: .72; }
.biz-option__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.biz-option__title { font-weight: 700; color: var(--text); font-size: var(--text-sm); }

.biz-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.biz-tag--reco { color: #062001; background: var(--green400); }
.biz-tag--neutral { color: var(--neutral100); background: var(--neutral700); }
.biz-tag--no { color: var(--red200); background: rgba(196, 34, 8, .22); }

.biz-option__grid {
  display: grid;
  grid-template-columns: repeat(2, auto) 1fr;
  gap: var(--sp-1) var(--sp-5);
  align-items: baseline;
}
.biz-option__wide { grid-column: 1 / -1; display: flex; gap: var(--sp-2); }
.biz-option__grid > div { display: flex; gap: var(--sp-2); align-items: baseline; }
.biz-option__k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.biz-option__v { font-size: var(--text-xs); color: var(--text); line-height: 1.4; }

.biz-reco {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--ai);
  border: 1px solid var(--cyan700);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
}
.biz-reco__icon { color: var(--primary); font-size: var(--text-md); line-height: 1.4; flex-shrink: 0; }
.biz-reco b { color: var(--cyan300); }

.biz-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }

@media (max-width: 1100px) {
  .biz-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .biz-metrics { grid-template-columns: 1fr; }
  .biz-option__grid { grid-template-columns: 1fr; }
  .biz-option__wide { grid-column: auto; }
}

/* ============================================================================
 * Reporte ejecutivo exportable (one-pager imprimible · tema claro)
 * ========================================================================== */
#incidentReport { display: none; }

.report-sheet {
  color: #1a1a1a;
  background: #fff;
  font-family: var(--font-sans);
  padding: var(--sp-6);
  max-width: 920px;
  margin: 0 auto;
}
.report-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  border-bottom: 2px solid var(--primary);
}
.report-sheet__brand { font-size: var(--text-xs); color: var(--primary); font-weight: 700; letter-spacing: .02em; }
.report-sheet__title { margin: 2px 0 0; font-size: var(--text-xl); font-weight: 800; color: #111; }
.report-sheet__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3) var(--sp-5);
  margin: var(--sp-5) 0;
}
.report-sheet__facts > div { display: flex; flex-direction: column; }
.report-sheet__facts span { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #777; font-weight: 600; }
.report-sheet__facts b { font-size: var(--text-sm); color: #111; }
.report-sheet__foot { margin-top: var(--sp-5); padding-top: var(--sp-3); border-top: 1px solid #ddd; font-size: var(--text-xs); color: #777; }

/* La tabla comercial reutilizada en tema claro */
.report-sheet .biz { gap: var(--sp-4); }
.report-sheet .biz__head h2 { color: #111; }
.report-sheet .biz__head .muted { color: #777; }
.report-sheet .biz-metric { background: #f5f7f8; border-left-width: 3px; }
.report-sheet .biz-metric__val,
.report-sheet .biz-metric__lab { color: #111; }
.report-sheet .biz-metric__unit,
.report-sheet .biz-metric__sub { color: #777; }
.report-sheet .biz-footnote { border-color: #ddd; color: #555; }
.report-sheet .biz-footnote b { color: #111; }
.report-sheet .biz-decision__head h3 { color: #111; }
.report-sheet .biz-option { background: #f5f7f8; border-color: #e0e0e0; }
.report-sheet .biz-option--reco { background: #eef8ec; border-color: var(--green500); }
.report-sheet .biz-option__title,
.report-sheet .biz-option__v { color: #1a1a1a; }
.report-sheet .biz-option__k { color: #777; }
.report-sheet .biz-reco { background: #eaf6f8; border-color: var(--primary); color: #1a1a1a; }
.report-sheet .biz-reco b { color: var(--cyan700); }
.report-sheet .biz-reco__icon { color: var(--primary); }

@media print {
  body.printing-report > *:not(#incidentReport) { display: none !important; }
  body.printing-report #incidentReport { display: block; }
  @page { margin: 14mm; }
  .report-sheet { padding: 0; }
  .biz-option { break-inside: avoid; }
}

/* ============================================================================
 * Banda de exposición comercial (tablero ejecutivo)
 * ========================================================================== */
.exec-exp {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.exec-exp__hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(196, 34, 8, .18), rgba(196, 34, 8, .04));
  border: 1px solid rgba(196, 34, 8, .35);
}
.exec-exp__hero-lab { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--red200); font-weight: 700; }
.exec-exp__hero-val { font-size: var(--text-2xl); font-weight: 800; color: var(--text); line-height: 1; font-feature-settings: 'tnum' 1; }
.exec-exp__hero-sub { font-size: var(--text-xs); color: var(--muted); margin-top: var(--sp-1); line-height: 1.4; }

.exec-exp__list { display: flex; flex-direction: column; gap: var(--sp-2); }
.exec-exp__item {
  display: grid;
  grid-template-columns: auto minmax(140px, 1.4fr) auto 1.6fr;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  border: 1px solid var(--line);
}
.exec-exp__item-main { display: flex; flex-direction: column; min-width: 0; }
.exec-exp__item-main b { color: var(--text); font-size: var(--text-sm); }
.exec-exp__item-main .muted { font-size: var(--text-xs); }
.exec-exp__item-risk { font-weight: 800; font-size: var(--text-md); color: var(--text); font-feature-settings: 'tnum' 1; white-space: nowrap; text-align: right; }
.exec-exp__item-reco { display: flex; flex-direction: column; min-width: 0; }
.exec-exp__reco-k { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); font-weight: 700; }
.exec-exp__item-reco span:last-child { font-size: var(--text-xs); color: var(--text); line-height: 1.35; }

@media (max-width: 1100px) {
  .exec-exp { grid-template-columns: 1fr; }
  .exec-exp__item { grid-template-columns: auto 1fr auto; }
  .exec-exp__item-reco { grid-column: 1 / -1; flex-direction: row; gap: var(--sp-2); align-items: baseline; }
}
@media (max-width: 600px) {
  .exec-exp__item { grid-template-columns: auto 1fr; }
  .exec-exp__item-risk { grid-column: 2; text-align: left; }
}

/* ============================================================================
 * Tabs genéricos — salas de War Room y Gobierno · Indicadores
 * ========================================================================== */
.wr-tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  overflow-x: auto;
  scrollbar-width: none;
  margin: var(--sp-2) 0 var(--sp-4);
}
.wr-tabs::-webkit-scrollbar { display: none; }

.wr-tab {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-sans);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t), border-color var(--t);
}
.wr-tab:hover { color: var(--text); }
.wr-tab--active { color: var(--cyan300); border-bottom-color: var(--primary); }
.wr-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.wr-tabpanel[hidden] { display: none !important; }
.wr-tabpanel { margin-top: var(--sp-2); }
.wr-tabpanel > * + * { margin-top: var(--sp-4); }

/* ============================================================================
 * Team Center — roster y tarjeta de persona
 * ========================================================================== */
.team-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-4);
}

.person-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color var(--t), box-shadow var(--t);
}
.person-card:hover { box-shadow: var(--shadow-md); }
.person-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.person-card--en-mesa { border-left-color: var(--red400); }
.person-card--proxima-asignacion { border-left-color: var(--amber400); }
.person-card--standby { border-left-color: var(--green400); }
.person-card--no-disponible { border-left-color: var(--neutral600); opacity: .82; }

.person-card__top {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.person-card__id { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.person-card__id b { color: var(--text); }
.person-card__detail { margin: 0; font-size: var(--text-sm); }
.person-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-2);
}
.person-card__carga {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
  font-size: var(--text-xs);
}
.person-card__carga .progress { width: 100%; }

/* ============================================================================
 * Reportes — tabla de ejecuciones y deltas
 * ========================================================================== */
.incident-table--runs .incident-table__head,
.incident-table--runs .incident-table__row {
  grid-template-columns:
    minmax(160px, 1.3fr)
    110px
    110px
    130px
    130px
    130px
    20px;
}
.incident-table--runs [data-report-runs] { display: contents; }
.incident-table__row--runs:not([tabindex]) { cursor: default; }
.incident-table__row--runs:not([tabindex]):hover { background: transparent; }

.incident-table__metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.incident-table__metric b {
  font-feature-settings: 'tnum' 1;
}

/* Etiquetas propias para MTTR / Brecha / Horas en el layout compacto de escritorio
   (1101–1599px): no reutilizan la etiqueta genérica "SLA" de .incident-table__sla. */
@media (min-width: 1101px) and (max-width: 1599px) {
  .incident-table--runs .incident-table__row > .incident-table__metric {
    order: 6;
    flex: 0 1 auto;
    position: relative;
    padding: 0 var(--sp-3) 0 0;
    border-right: 1px solid rgba(255, 255, 255, .06);
  }
  .incident-table--runs .incident-table__row > .incident-table__metric::before {
    display: block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.2;
  }
  /* Los 3 .incident-table__metric siempre son el 3er, 4to y 5to hijo de la fila
     (título y n.º de incidentes van antes) — nth-child (no nth-of-type) los distingue. */
  .incident-table--runs .incident-table__row > .incident-table__metric:nth-child(3)::before { content: "MTTR"; }
  .incident-table--runs .incident-table__row > .incident-table__metric:nth-child(4)::before { content: "Brecha"; }
  .incident-table--runs .incident-table__row > .incident-table__metric:nth-child(5)::before { content: "Horas"; }
}

.run-delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  margin-top: 2px;
}
.run-delta--good { color: var(--green300); }
.run-delta--bad { color: var(--red300); }
.run-delta--flat { color: var(--muted); font-weight: 500; }

/* ============================================================================
 * Gobierno · Indicadores — catálogo de KPIs y modal de edición
 * ========================================================================== */
.kpi-def-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}
.kpi-def {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
}
.kpi-def__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: 4px;
}
.kpi-def__code {
  font-family: monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--cyan300);
  background: rgba(24, 151, 173, .12);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.kpi-def__head b { color: var(--text); }
.kpi-def__objetivo { font-size: var(--text-xs); color: var(--muted); margin-left: auto; }
.kpi-def__formula { margin: 0 0 var(--sp-2); font-size: var(--text-sm); }
.kpi-def__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  font-size: var(--text-xs);
  margin-bottom: var(--sp-2);
}
.kpi-def__usado { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

/* Campos editables del modal de indicador (reusa .dm) */
.dm__field { display: flex; flex-direction: column; gap: 4px; margin-top: var(--sp-3); }
.dm__field label { font-size: var(--text-xs); color: var(--muted); font-weight: 600; }
.dm__field input,
.dm__field textarea {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  resize: vertical;
}
.dm__field input:focus-visible,
.dm__field textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.dm__field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--sp-3);
}
.dm__field-row .dm__field { margin-top: 0; }

@media (max-width: 768px) {
  .kpi-def { grid-template-columns: 1fr; }
  .dm__field-row { grid-template-columns: 1fr; }
}
