/* ════════════════════════════════════════════════════════════════
   SYSTEM DESIGN SYSTEM & TOKENS (IMPECCABLE POLISH)
════════════════════════════════════════════════════════════════ */
:root {
  --p: #059669;
  --p-dark: #047857;
  --p-light: #d1fae5;
  --p-xlight: #ecfdf5;
  --accent: #0d9488;
  --accent-light: #ccfbf1;
  --success: #10b981;
  --suc-l: #d1fae5;
  --warning: #f59e0b;
  --war-l: #fef3c7;
  --danger: #ef4444;
  --dan-l: #fee2e2;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --bg: #f0fdf4;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bdr-a: #6ee7b7;
  --r-xl: 18px;
  --r-lg: 12px;
  --r-md: 8px;
  --r-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 16px -2px rgba(5, 150, 105, .08), 0 2px 6px -1px rgba(0, 0, 0, .04);
  --shadow-lg: 0 12px 32px -4px rgba(5, 150, 105, .12), 0 4px 12px -2px rgba(0, 0, 0, .04);
  --topbar-h: 70px;
  --tr: 200ms cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
  --p: #3b82f6;
  --p-dark: #1d4ed8;
  --p-light: #1e3a8a;
  --p-xlight: #172554;
  --accent: #06b6d4;
  --accent-light: #164e63;
  --success: #34d399;
  --suc-l: #064e3b;
  --warning: #fbbf24;
  --war-l: #451a03;
  --danger: #f87171;
  --dan-l: #450a0a;
  --surface: #0f172a;
  --surface-alt: #1e293b;
  --bg: #090d16;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #1e293b;
  --bdr-a: #2563eb;
  --shadow-md: 0 4px 20px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
}

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

html {
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  transition: background 250ms ease, color 250ms ease;
}

/* ══════════════════════════════════════════
   GLASSMORPHIC TOPBAR
══════════════════════════════════════════ */
#page-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--topbar-h);
  background: rgba(5, 46, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
  transition: all 250ms ease;
}

[data-theme="dark"] #page-topbar {
  background: rgba(9, 13, 22, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.navbar-header {
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .05));
  border: 1px solid rgba(255, 255, 255, .25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  transition: transform var(--tr);
}

.brand-box:hover .brand-icon {
  transform: scale(1.05);
}

.brand-name {
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
}

.brand-sub {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .45);
}

.topbar-sep {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, .15);
  margin: 0 16px;
}

.case-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.case-lbl {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, .45);
}

.case-val {
  font-size: .88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-pdf-export {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--r-md);
  font-size: .83rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
  transition: all var(--tr);
}

.btn-pdf-export:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  opacity: .95;
}

.btn-pdf-export:active {
  transform: translateY(0);
}

.ctrl {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .75);
  cursor: pointer;
  position: relative;
  transition: all var(--tr);
}

.ctrl:hover {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  transform: translateY(-1px);
}

#icon-moon,
#icon-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: all 250ms ease;
}

#icon-sun {
  transform: translate(-50%, -50%) scale(.25);
  opacity: 0;
  filter: blur(4px);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 5px 6px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  cursor: pointer;
  color: rgba(255, 255, 255, .95);
  font-size: .82rem;
  font-weight: 600;
  transition: all var(--tr);
}

.user-chip:hover {
  background: rgba(255, 255, 255, .2);
}

.u-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #0d9488);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* ══════════════════════════════════════════
   MAIN CONTENT CONTAINER
══════════════════════════════════════════ */
.main-content {
  margin-top: var(--topbar-h);
  padding: 24px 32px 32px;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* ══════════════════════════════════════════
   KPI DASHBOARD BANNER
══════════════════════════════════════════ */
.kpi-section-title {
  font-size: .83rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--p);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
}

.kpi-card-indigo::before {
  background: linear-gradient(90deg, #6366f1, #818cf8, #a855f7);
}

.kpi-card-green::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.kpi-card-blue::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.kpi-card-amber::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.kpi-card-red::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(5, 150, 105, .25);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .04);
}

.kpi-indigo {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .12);
}

.kpi-green {
  background: var(--p-xlight);
  color: var(--p);
  border: 1px solid var(--bdr-a);
}

.kpi-blue {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

.kpi-amber {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.kpi-red {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

[data-theme="dark"] .kpi-indigo {
  background: #1e1b4b;
  color: #a5b4fc;
  border-color: #3730a3;
}

[data-theme="dark"] .kpi-blue {
  background: #172554;
  color: #60a5fa;
  border-color: #1e40af;
}

[data-theme="dark"] .kpi-amber {
  background: #451a03;
  color: #fbbf24;
  border-color: #78350f;
}

[data-theme="dark"] .kpi-red {
  background: #450a0a;
  color: #fca5a5;
  border-color: #991b1b;
}

.kpi-label {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 2px;
}

.kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-val-name {
  font-size: .88rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 3px 0 4px;
  word-break: break-word;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kpi-sub {
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}

/* ══════════════════════════════════════════
   SLA MONITORING WIDGET
══════════════════════════════════════════ */
/* ══════════════════════════════════════════
   SLA MONITORING WIDGET (PREMIUM ENHANCED)
══════════════════════════════════════════ */
.sla-widget-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
  padding: 24px 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--tr);
}

.sla-widget-card.sla-card-red {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.12);
}

.sla-widget-card.sla-card-amber {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 10px 30px -5px rgba(245, 158, 11, 0.12);
}

.sla-widget-card.sla-card-green {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 30px -5px rgba(16, 185, 129, 0.12);
}

.sla-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.sla-title-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sla-icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .18);
  flex-shrink: 0;
}

.sla-widget-card.sla-card-green .sla-icon-badge {
  background: #d1fae5;
  color: #059669;
  box-shadow: 0 4px 14px rgba(16, 185, 129, .18);
}

.sla-widget-card.sla-card-amber .sla-icon-badge {
  background: #fef3c7;
  color: #d97706;
  box-shadow: 0 4px 14px rgba(245, 158, 11, .18);
}

.sla-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -.2px;
}

.sla-subtitle {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 3px;
}

.sla-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .06);
}

/* STEPPER & ROADMAP MULTI-ETAPA */
.sla-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 26px 0 22px;
  padding: 0 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sla-stepper::-webkit-scrollbar {
  display: none;
}

.sla-stepper::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 40px;
  right: 40px;
  height: 4px;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
  border-radius: 4px;
  z-index: 1;
}

.sla-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 120px;
  max-width: 160px;
  flex: 1;
}

.sla-step-node {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 3.5px solid var(--border);
  color: var(--muted);
  font-size: .95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 5px var(--surface);
  flex-shrink: 0;
  transition: all var(--tr);
}

.sla-step-node.node-done {
  border-color: #10b981;
  color: #10b981;
  background: #d1fae5;
}

.sla-step-node.node-active-red {
  border-color: #ef4444;
  color: #ef4444;
  background: #fff1f2;
  animation: pulseSla 2.2s infinite;
}

.sla-step-node.node-active-amber {
  border-color: #f59e0b;
  color: #f59e0b;
  background: #fef3c7;
  animation: pulseSla 2.2s infinite;
}

.sla-step-node.node-active-green {
  border-color: #10b981;
  color: #10b981;
  background: #d1fae5;
  animation: pulseSla 2.2s infinite;
}

.sla-step-node.node-future {
  border-color: var(--border);
  color: var(--muted);
  background: var(--surface-alt);
  opacity: .7;
}

.sla-step-label {
  font-size: .76rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 10px;
  line-height: 1.2;
}

.sla-step-date {
  font-size: .7rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 3px;
}

/* ══════════════════════════════════════════
   SKELETON LOADERS & CACHE BADGES
══════════════════════════════════════════ */
.cache-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 8px;
}

.btn-refresh-cache {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  border-radius: var(--r-md);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--tr);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-refresh-cache:hover {
  background: var(--p);
  color: #fff;
  border-color: var(--p);
}

@keyframes skeletonShimmer {
  0% {
    background-position: -200px 0;
  }

  100% {
    background-position: 200px 0;
  }
}

.skeleton-loading {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 50%, var(--surface-alt) 75%);
  background-size: 400px 100%;
  animation: skeletonShimmer 1.5s infinite ease-in-out;
  border-radius: var(--r-md);
}


/* METRICS GRID: Layout en columnas verticales limpias sin solapamiento */
.sla-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.sla-metric-item {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--border);
  transition: all var(--tr);
}

.sla-metric-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .04);
}

.sla-metric-lbl {
  font-size: .73rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.sla-metric-val {
  font-size: .94rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  word-break: break-word;
}

.sla-metric-item.metric-highlight-red {
  background: rgba(254, 226, 226, 0.4);
  border-color: rgba(252, 165, 165, 0.6);
}

[data-theme="dark"] .sla-metric-item.metric-highlight-red {
  background: rgba(127, 29, 29, 0.3);
  border-color: rgba(153, 27, 27, 0.6);
}

.sla-metric-item.metric-highlight-green {
  background: rgba(209, 250, 229, 0.4);
  border-color: rgba(110, 231, 183, 0.6);
}

[data-theme="dark"] .sla-metric-item.metric-highlight-green {
  background: rgba(6, 95, 70, 0.3);
  border-color: rgba(4, 120, 87, 0.6);
}


/* ══════════════════════════════════════════
   CARDS & TABS
══════════════════════════════════════════ */
.card {
  background: var(--surface) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: var(--shadow-md) !important;
  border: 1px solid var(--border) !important;
  overflow: hidden;
  margin-bottom: 20px;
  transition: all var(--tr);
}

.card-body {
  padding: 0 !important;
}

.nav-tabs {
  display: flex !important;
  background: var(--surface-alt) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0 20px !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tabs .nav-item {
  flex-shrink: 0;
}

.nav-tabs .nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px !important;
  height: 54px;
  font-size: .84rem !important;
  font-weight: 600 !important;
  color: var(--muted) !important;
  border: none !important;
  background: none !important;
  white-space: nowrap;
  transition: color var(--tr), background var(--tr);
  cursor: pointer;
}

.nav-tabs .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 16px;
  right: 16px;
  height: 0;
  background: var(--p);
  border-radius: 4px 4px 0 0;
  transition: height 200ms ease;
}

.nav-tabs .nav-link:hover {
  color: var(--p) !important;
  background: var(--p-xlight) !important;
}

.nav-tabs .nav-link.active {
  color: var(--p) !important;
  font-weight: 800 !important;
  background: var(--surface) !important;
}

.nav-tabs .nav-link.active::after {
  height: 3.5px;
}

.tab-content {
  padding: 24px 26px 26px !important;
}

/* ══════════════════════════════════════════
   POLISHED TABLES
══════════════════════════════════════════ */
.table {
  font-size: .85rem !important;
  font-variant-numeric: tabular-nums;
  width: 100% !important;
}

.table thead th {
  font-size: .72rem !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--p) !important;
  background: var(--p-xlight) !important;
  border-bottom: 2px solid var(--bdr-a) !important;
  padding: 12px 16px !important;
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px !important;
  vertical-align: middle !important;
  color: var(--text) !important;
}

.table tbody tr {
  transition: background 120ms ease;
}

.table tbody tr:hover>* {
  background: var(--p-xlight) !important;
}

.table tbody tr.row-detalle td {
  font-weight: 700 !important;
  background: var(--p-xlight) !important;
  color: var(--p-dark) !important;
}

.map-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--p-xlight);
  border: 1px solid var(--bdr-a);
  color: var(--p);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--tr);
  text-decoration: none;
}

.map-link:hover {
  background: var(--p);
  color: #fff;
  transform: scale(1.15);
}

/* ══════════════════════════════════════════
   BUTTONS & BITÁCORA TIMELINE
══════════════════════════════════════════ */
.btn-vivid {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--p) 0%, var(--accent) 100%);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--r-md);
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(5, 150, 105, .3);
  transition: all var(--tr);
}

.btn-vivid:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(5, 150, 105, .4);
  opacity: .95;
}

.btn-muted {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: var(--r-md);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr);
}

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

.view-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.btn-group-toggle {
  display: inline-flex;
  background: var(--bg);
  padding: 4px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.btn-toggle-opt {
  padding: 6px 16px;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--tr);
}

.btn-toggle-opt.active {
  background: var(--surface);
  color: var(--p);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.timeline-container {
  position: relative;
  padding: 10px 0 10px 32px;
  margin-top: 14px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14px;
  width: 3.5px;
  background: linear-gradient(180deg, var(--p) 0%, var(--accent) 100%);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-badge {
  position: absolute;
  left: -32px;
  top: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--p);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--p);
  font-size: .9rem;
  box-shadow: 0 0 0 4px var(--surface);
  z-index: 2;
}

.timeline-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--tr);
}

.timeline-card:hover {
  transform: translateX(3px);
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.timeline-title {
  font-size: .92rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.timeline-date {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
}

.timeline-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tag-chip {
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--p-xlight);
  color: var(--p);
  border: 1px solid var(--bdr-a);
}

.timeline-desc {
  font-size: .84rem;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}

/* MODAL & FOOTER */
.modal-content {
  border-radius: var(--r-xl) !important;
  border: none !important;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}

.modal-header {
  background: linear-gradient(125deg, #052e16, #064e3b) !important;
  border: none !important;
  padding: 22px 26px !important;
}

.modal-title {
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
}

.modal-body {
  padding: 26px !important;
}

.modal-footer {
  border-top: 1px solid var(--border) !important;
  background: var(--surface-alt) !important;
  padding: 16px 26px !important;
}

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 10px;
}

/* ════════════════════════════════════════════════════════════════
   PLANTILLA ESPECIALIZADA DEDICADA PARA EL REPORTE PDF (OCULTA EN WEB)
════════════════════════════════════════════════════════════════ */
#pdf-report-template {
  background: #ffffff;
  color: #0f172a;
  font-family: 'Inter', Arial, sans-serif;
  padding: 36px 44px;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  box-sizing: border-box;
}

.pdf-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #059669;
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.pdf-logo {
  font-size: 22px;
  font-weight: 800;
  color: #059669;
  letter-spacing: -.6px;
}

.pdf-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: .5px;
}

.pdf-meta-box {
  text-align: right;
  font-size: 10.5px;
  color: #334155;
  line-height: 1.4;
}

.pdf-sec-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #059669;
  border-bottom: 1.5px solid #a7f3d0;
  padding-bottom: 4px;
  margin: 22px 0 12px;
}

.pdf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.pdf-info-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11px;
}

.pdf-info-lbl {
  font-size: 9px;
  text-transform: uppercase;
  font-weight: 800;
  color: #64748b;
  margin-bottom: 2px;
}

.pdf-info-val {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 10px;
}

.pdf-table th {
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
  text-transform: uppercase;
  padding: 8px 10px;
  border: 1px solid #a7f3d0;
  text-align: left;
}

.pdf-table td {
  padding: 7px 10px;
  border: 1px solid #e2e8f0;
  vertical-align: middle;
}

.pdf-table tr:nth-child(even) td {
  background: #f8fafc;
}

.pdf-sla-box {
  background: #fff1f2;
  border: 1.5px solid #fecdd3;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.pdf-sla-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.pdf-badge-red {
  background: #dc2626;
  color: #fff;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: .4px;
}

.pdf-footer {
  margin-top: 36px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  text-align: center;
  font-size: 9px;
  color: #94a3b8;
}

#modalPdfPreview .modal-dialog {
  max-width: 980px;
}