:root {
  --nav: #1e3a5c;
  --nav2: #172f4e;
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-bg: #eff6ff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --purple: #7c3aed;
  --purple-bg: #f5f3ff;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --bg: #f4f7fb;
  --card: #fff;
  --text: #0f172a;
  --text-secondary: #475569;
  --sidebar-width: 272px;
  --topbar-h: 70px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 20px rgba(15,23,42,.09);
  --shadow-lg: 0 12px 40px rgba(15,23,42,.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  font-family: Inter, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── APP SHELL ─────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(175deg, var(--nav) 0%, var(--nav2) 100%);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 999px; }

.brand {
  height: var(--topbar-h);
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,.4);
}

.brand h1 { font-size: 15px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.brand span { font-size: 11px; color: #64748b; display: block; margin-top: 1px; }

.side-nav { padding: 10px 10px 30px; flex: 1; }

.nav-section {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: #4ade80;
  margin: 20px 0 4px;
  padding: 0 10px 6px;
  font-weight: 700;
  border-bottom: 1px solid rgba(74,222,128,.22);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.nav-section-arrow {
  font-size: 11px;
  color: rgba(74,222,128,.6);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.nav-section.collapsed .nav-section-arrow { transform: rotate(-90deg); }
.nav-group {
  overflow: hidden;
  max-height: 600px;
  transition: max-height .28s ease, opacity .2s ease;
  opacity: 1;
}
.nav-group.collapsed { max-height: 0; opacity: 0; }

.nav-link-app {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  margin: 1px 0;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-link-app i { font-size: 15px; flex-shrink: 0; }
.nav-link-app:hover { background: rgba(255,255,255,.07); color: #e2e8f0; }
.nav-link-app.active { background: rgba(59,130,246,.2); color: #dbeafe; font-weight: 600; }
.nav-link-app.active i { color: #60a5fa; }
.nav-link-app.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: #3b82f6;
  border-radius: 999px;
}

/* sidebar user info */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-size: 12px; font-weight: 600; color: #cbd5e1; line-height: 1.2; }
.sidebar-user-role { font-size: 11px; color: #64748b; }

/* brand logo image — contenedor flexible para logos rectangulares */
.brand-icon--logo {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  width: auto;
  height: auto;
  max-width: 120px;
  max-height: 48px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.brand-logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 120px;
  max-height: 48px;
  object-fit: contain;
}

/* sidebar copyright */
.sidebar-copyright {
  padding: 8px 18px;
  font-size: 10px;
  color: #475569;
  line-height: 1.6;
  flex-shrink: 0;
  text-align: center;
}

/* ── MAIN CONTENT ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ─────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  gap: 16px;
}

.topbar-left h2 { font-size: 17px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2; }
.topbar-left p { font-size: 12px; color: var(--muted); margin-top: 1px; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.role-gerencia    { background: #eff6ff; color: #1d4ed8;  border-color: #bfdbfe; }
.role-lider       { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.role-jefe        { background: var(--purple-bg);  color: #5b21b6; border-color: #ddd6fe; }
.role-auditoria   { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.role-admin       { background: #fdf4ff; color: #6b21a8; border-color: #e9d5ff; }
.role-default     { background: var(--line-light); color: var(--muted); border-color: var(--line); }

/* ── CONTENT AREA ─────────────────────────────────── */
.content-wrap { padding: 24px 28px; flex: 1; }

/* ── MESSAGES ─────────────────────────────────── */
.messages-wrap { padding: 10px 28px 0; }
.messages-wrap .alert { border-radius: var(--radius); font-size: 13.5px; }

/* ── WELCOME BANNER ─────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(120deg, #1e3a8a 0%, #1d4ed8 45%, #2563eb 100%);
  border-radius: var(--radius-xl);
  padding: 22px 26px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative;
}
.welcome-banner::before {
  content: '';
  position: absolute;
  right: -20px; top: -30px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.05);
  border-radius: 50%;
}
.welcome-banner::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -40px;
  width: 100px; height: 100px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.welcome-text { position: relative; z-index: 1; }
.welcome-text h2 { font-size: 18px; font-weight: 800; margin-bottom: 3px; }
.welcome-text p { font-size: 13px; opacity: .75; margin: 0; }
.welcome-icon { font-size: 48px; opacity: .15; position: relative; z-index: 1; }

/* ── KPI CARDS ─────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  border-top-width: 3px;
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 32px; font-weight: 900; line-height: 1.1; letter-spacing: -1px; margin-top: 2px; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.kpi-icon {
  position: absolute;
  right: 18px; bottom: 14px;
  font-size: 38px;
  opacity: .08;
}

.kpi-primary { border-top-color: var(--primary); }
.kpi-primary .kpi-value { color: var(--primary); }
.kpi-success { border-top-color: var(--success); }
.kpi-success .kpi-value { color: var(--success); }
.kpi-warning { border-top-color: var(--warning); }
.kpi-warning .kpi-value { color: var(--warning); }
.kpi-danger  { border-top-color: var(--danger); }
.kpi-danger  .kpi-value { color: var(--danger); }
.kpi-purple  { border-top-color: var(--purple); }
.kpi-purple  .kpi-value { color: var(--purple); }

/* ── DASHBOARD GRIDS ─────────────────────────────────── */
.dashboard-grid   { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.dashboard-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.col-span-2 { grid-column: span 2; }

/* ── PANELS ─────────────────────────────────── */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.panel-wide { grid-column: 1 / -1; }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.panel-header h3 { font-size: 15px; font-weight: 800; letter-spacing: -.3px; }
.panel-header .ph-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.panel-header .ph-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ── PROGRESS BARS ─────────────────────────────────── */
.progress-list { display: flex; flex-direction: column; gap: 12px; }
.progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 12.5px; font-weight: 600; }
.progress-label .pl-pct { font-weight: 700; }
.progress-bg { height: 7px; background: var(--line-light); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.fill-primary { background: linear-gradient(90deg, var(--primary-light), var(--primary)); }
.fill-success { background: linear-gradient(90deg, #34d399, var(--success)); }
.fill-warning { background: linear-gradient(90deg, #fcd34d, var(--warning)); }
.fill-danger  { background: linear-gradient(90deg, #f87171, var(--danger)); }
.fill-purple  { background: linear-gradient(90deg, #a78bfa, var(--purple)); }

/* ── GANTT ─────────────────────────────────── */
.gantt-row {
  display: grid;
  grid-template-columns: 150px 1fr 38px;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-light);
}
.gantt-row:last-child { border-bottom: none; }
.gantt-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-track { height: 12px; background: var(--line-light); border-radius: 999px; overflow: hidden; }
.gantt-track div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.gantt-pct { font-size: 11.5px; font-weight: 700; color: var(--primary); text-align: right; }

/* ── STATUS BADGES ─────────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
}
.badge-verde    { background: var(--success-bg); color: #065f46; }
.badge-amarillo { background: var(--warning-bg); color: #92400e; }
.badge-rojo     { background: var(--danger-bg);  color: #991b1b; }
.badge-azul     { background: var(--primary-bg); color: var(--primary-dark); }
.badge-gris     { background: var(--line-light); color: var(--muted); }

/* ── CLEAN LIST ─────────────────────────────────── */
.clean-list { list-style: none; padding: 0; margin: 0; }
.clean-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-light);
  font-size: 13px; font-weight: 500;
}
.clean-list li:last-child { border-bottom: none; }
.clean-list i { color: var(--primary); font-size: 15px; flex-shrink: 0; }
.clean-list .li-meta { font-size: 11.5px; color: var(--muted); margin-left: auto; }

/* ── STAT ROW ─────────────────────────────────── */
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-light);
  gap: 8px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-value { font-size: 15px; font-weight: 800; }

/* ── AUDIT LIST ─────────────────────────────────── */
.audit-item {
  display: flex; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
  align-items: flex-start;
}
.audit-item:last-child { border-bottom: none; }
.audit-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.audit-dot.green  { background: var(--success); }
.audit-dot.yellow { background: var(--warning); }
.audit-dot.red    { background: var(--danger); }
.audit-dot.blue   { background: var(--primary); }
.audit-body { font-size: 12.5px; line-height: 1.5; }
.audit-body strong { font-weight: 700; }
.audit-body .audit-time { color: var(--muted); font-size: 11.5px; margin-top: 1px; display: block; }

/* ── ROLE INFO CARD ─────────────────────────────────── */
.role-info-card {
  background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-xl);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 20px;
}
.role-info-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--primary-bg);
  border: 2px solid #bfdbfe;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: var(--primary);
  flex-shrink: 0;
}
.role-info-text h3 { font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.role-info-text p { font-size: 12.5px; color: var(--muted); }

/* ── MODULE TOOLBAR ─────────────────────────────────── */
.module-toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px; gap: 14px;
}
.module-toolbar-left h3 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.module-toolbar-left p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.module-toolbar .btn { white-space: nowrap; }

/* ── TABLES ─────────────────────────────────── */
.table-panel { padding: 0; overflow: hidden; }

.table { margin: 0; font-size: 13px; }
.table thead th {
  background: var(--line-light);
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td { padding: 12px 15px; vertical-align: middle; border-color: var(--line-light); }
.table tbody tr:hover td { background: #f8faff; }
.table tbody tr:last-child td { border-bottom: none; }
.actions-cell { white-space: nowrap; text-align: right; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 20px !important; font-size: 13.5px; }

/* ── FORMS ─────────────────────────────────── */
.form-panel { max-width: 1100px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; }
.form-field label {
  font-size: 12.5px; font-weight: 700;
  margin-bottom: 5px; color: var(--text-secondary);
}
.form-field .form-control,
.form-field .form-select {
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-size: 13.5px;
  padding: 9px 12px;
  background: var(--card);
  transition: border-color .15s, box-shadow .15s;
  color: var(--text);
}
.form-field .form-control:focus,
.form-field .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}
.form-field textarea { min-height: 95px; resize: vertical; }
.form-field small { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.form-field .text-danger { font-size: 12px; margin-top: 3px; }

.form-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--line-light);
}

/* ── BUTTONS ─────────────────────────────────── */
.btn { font-weight: 600; font-size: 13px; border-radius: var(--radius); padding: 8px 16px; transition: all .15s; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { font-size: 12px; padding: 5px 10px; border-radius: 8px; }
.btn-outline-secondary { border-color: var(--line); color: var(--text-secondary); }
.btn-outline-secondary:hover { background: var(--line-light); border-color: var(--line); color: var(--text); }

/* ── QUICK ACTIONS ─────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600;
  background: var(--card);
  transition: all .15s;
}
.qa-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.qa-btn i { font-size: 15px; color: var(--primary); }

/* ── LOGIN ─────────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #0f172a;
  position: relative;
  overflow: hidden;
}
.login-body::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(37,99,235,.25) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(124,58,237,.18) 0%, transparent 55%);
}
.login-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
}
.login-card {
  position: relative; z-index: 1;
  width: min(440px, 94vw);
  background: #fff;
  border-radius: 26px;
  padding: 38px;
  box-shadow: 0 32px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.08);
}
.login-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  display: grid; place-items: center;
  font-size: 26px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}
.login-card h1 { font-size: 24px; font-weight: 900; letter-spacing: -.5px; margin-bottom: 5px; }
.login-card > p { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }
.login-card label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 5px; display: block; }
.login-card .form-control {
  border: 1.5px solid var(--line);
  border-radius: 11px;
  padding: 10px 13px;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}
.login-card .btn-primary { padding: 11px; font-size: 14px; font-weight: 700; border-radius: 12px; }
.login-footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 22px; }

/* ── PERSPECTIVE CARDS ──────────────────────────────── */
.persp-section-title {
  font-size: 18px; font-weight: 800; letter-spacing: -.3px;
  margin-bottom: 4px;
}
.persp-section-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

.persp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.persp-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.persp-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Header band with gradient */
.persp-card-header {
  padding: 20px 22px 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.persp-card-header::before {
  content: '';
  position: absolute;
  right: -18px; top: -18px;
  width: 90px; height: 90px;
  background: rgba(255,255,255,.1);
  border-radius: 50%;
}
.persp-card-header::after {
  content: '';
  position: absolute;
  right: 20px; bottom: -30px;
  width: 60px; height: 60px;
  background: rgba(255,255,255,.07);
  border-radius: 50%;
}

.persp-header-top {
  display: flex; align-items: flex-start; gap: 12px;
  position: relative; z-index: 1;
}
.persp-icon {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  backdrop-filter: blur(4px);
}
.persp-name { font-size: 15px; font-weight: 800; line-height: 1.3; }
.persp-orden { font-size: 11px; opacity: .7; margin-top: 2px; }

/* Progress arc / big number */
.persp-avance-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px;
  position: relative; z-index: 1;
}
.persp-avance-pct {
  font-size: 36px; font-weight: 900; line-height: 1;
  letter-spacing: -1px;
}
.persp-avance-label { font-size: 11px; opacity: .75; margin-top: 2px; }
.persp-mini-bar {
  flex: 1; margin-left: 14px;
  height: 6px;
  background: rgba(255,255,255,.2);
  border-radius: 999px;
  overflow: hidden;
}
.persp-mini-fill {
  height: 100%;
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  transition: width .8s ease;
}

/* Stats grid inside card */
.persp-card-body { padding: 16px 22px 18px; flex: 1; }

.persp-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.persp-stat {
  background: var(--line-light);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
}
.persp-stat-value {
  font-size: 22px; font-weight: 900;
  letter-spacing: -.5px;
  line-height: 1.1;
}
.persp-stat-label {
  font-size: 10.5px; color: var(--muted);
  margin-top: 3px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
}

/* Bottom alert/risk row */
.persp-alerts-row {
  display: flex; align-items: center; gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
}
.persp-alert-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  flex: 1; justify-content: center;
}
.chip-rojo   { background: var(--danger-bg);  color: #991b1b; }
.chip-alerta { background: var(--warning-bg); color: #92400e; }

/* Color gradients per perspective type */
.pg-financial   { background: linear-gradient(135deg, #047857 0%, #059669 50%, #10b981 100%); }
.pg-cliente     { background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%); }
.pg-proceso     { background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 50%, #7c3aed 100%); }
.pg-aprendizaje { background: linear-gradient(135deg, #9a3412 0%, #c2410c 50%, #ea580c 100%); }
.pg-social      { background: linear-gradient(135deg, #0c4a6e 0%, #0369a1 50%, #0891b2 100%); }
.pg-default-0   { background: linear-gradient(135deg, #047857, #10b981); }
.pg-default-1   { background: linear-gradient(135deg, #1e40af, #2563eb); }
.pg-default-2   { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.pg-default-3   { background: linear-gradient(135deg, #9a3412, #ea580c); }
.pg-default-4   { background: linear-gradient(135deg, #0c4a6e, #0891b2); }

/* Stat value color tinting */
.persp-stat.stat-obj  .persp-stat-value { color: var(--text); }
.persp-stat.stat-proy .persp-stat-value { color: var(--primary); }

/* ── PERSPECTIVAS V2 (CMI redesign) ─────────────────────────── */
.persp-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.persp-card-v2 {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .2s, transform .2s;
}
.persp-card-v2:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transform: translateY(-3px);
  text-decoration: none;
  color: inherit;
}

.persp-card-v2-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.persp-card-v2-body {
  padding: 16px 20px 18px;
  flex: 1;
}

/* ── ALERT STATS BOX (2x2 grid inside panel) ───────────── */
.alert-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.alert-stat-box {
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  border: 1.5px solid transparent;
  transition: transform .15s;
}
.alert-stat-box:hover { transform: translateY(-1px); }
.alert-stat-box i { font-size: 22px; margin-bottom: 2px; }
.alert-stat-box strong { font-size: 28px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.alert-stat-box span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.asb-danger  { background: var(--danger-bg);  color: #991b1b; border-color: #fecaca; }
.asb-warning { background: var(--warning-bg); color: #92400e; border-color: #fde68a; }
.asb-success { background: var(--success-bg); color: #065f46; border-color: #a7f3d0; }
.asb-blue    { background: var(--primary-bg); color: #1e40af; border-color: #bfdbfe; }

/* ── OBJECTIVE RANKING LIST ─────────────────────────────── */
.obj-ranking-list { display: flex; flex-direction: column; gap: 12px; }
.obj-ranking-item { padding: 12px 14px; background: var(--line-light); border-radius: var(--radius); }
.obj-ranking-header { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.obj-ranking-code {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  background: var(--card); padding: 2px 7px; border-radius: 999px;
  color: var(--muted); border: 1px solid var(--line); flex-shrink: 0;
}
.obj-ranking-name { font-size: 13px; font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obj-ranking-pct { font-size: 15px; font-weight: 900; flex-shrink: 0; }
.obj-ranking-pct.pct-danger  { color: var(--danger); }
.obj-ranking-pct.pct-warning { color: var(--warning); }
.obj-ranking-pct.pct-success { color: var(--success); }
.obj-ranking-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── AREA COMPLIANCE TABLE ──────────────────────────────── */
.area-table { display: flex; flex-direction: column; }
.area-table-row { border-bottom: 1px solid var(--line-light); }
.area-table-row:last-child { border-bottom: none; }
.area-summary { display: flex; align-items: center; gap: 10px; padding: 11px 4px; }
.area-rank {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.rank-gold   { background: #fef3c7; color: #92400e; }
.rank-silver { background: #f1f5f9; color: #64748b; }
.rank-bronze { background: #fef3c7; color: #b45309; }
.rank-other  { background: #f1f5f9; color: #94a3b8; }
.area-name { font-size: 13.5px; font-weight: 700; flex: 1; }
.area-avance-bar { width: 80px; height: 5px; background: var(--line-light); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.area-avance-fill { height: 100%; border-radius: 999px; }
.area-avance-pct { font-size: 13px; font-weight: 800; width: 34px; text-align: right; flex-shrink: 0; }
.area-projects { background: #f8faff; padding: 4px 8px 10px 36px; }
.proj-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; margin: 3px 0;
  background: var(--card); border: 1px solid var(--line-light);
}
.proj-name { font-size: 12.5px; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-estado {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .03em;
}
.pe-ejecucion  { background: #dbeafe; color: #1e40af; }
.pe-formulacion{ background: #f1f5f9; color: #64748b; }
.pe-suspendido { background: var(--danger-bg); color: #991b1b; }
.pe-finalizado { background: var(--success-bg); color: #065f46; }
.pe-cerrado    { background: #f1f5f9; color: #94a3b8; }
.proj-avance-wrap { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.proj-avance-bar { width: 48px; height: 5px; background: var(--line-light); border-radius: 999px; overflow: hidden; }
.proj-avance-fill { height: 100%; border-radius: 999px; }
.proj-avance-pct { font-size: 12px; font-weight: 800; width: 30px; text-align: right; }
.proj-alert-icon { font-size: 13px; flex-shrink: 0; }

/* ── PERSPECTIVE RANKING ────────────────────────────────── */
.persp-ranking-list { display: flex; flex-direction: column; gap: 8px; }
.persp-ranking-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  background: var(--line-light); border: 1px solid transparent;
}
.pr-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; color: #fff; }
.pr-info { flex: 1; min-width: 0; }
.pr-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-meta { font-size: 11px; color: var(--muted); }
.pr-pct { font-size: 16px; font-weight: 900; flex-shrink: 0; }
.pr-bar-wrap { width: 60px; flex-shrink: 0; }
.pr-bar-bg { height: 5px; background: rgba(0,0,0,.08); border-radius: 999px; overflow: hidden; }
.pr-bar-fill { height: 100%; border-radius: 999px; background: rgba(0,0,0,.25); transition: width .6s; }

/* ── RISK AREA LIST ─────────────────────────────────────── */
.risk-area-list { display: flex; flex-direction: column; gap: 8px; }
.risk-area-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1.5px solid #fecaca; background: #fff9f9;
}
.risk-area-item.risk-ind { border-color: #fde68a; background: #fffdf5; }
.risk-area-name { font-size: 13px; font-weight: 700; flex: 1; }
.risk-count { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }

/* ── SECTION DIVIDER ────────────────────────────────────── */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 14px;
}
.section-divider h3 { font-size: 15px; font-weight: 800; white-space: nowrap; letter-spacing: -.3px; }
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ══════════════════════════════════════════════════════════
   FORMULARIOS DE PROYECTO / ACTIVIDAD
══════════════════════════════════════════════════════════ */
.pf-section {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-xl); padding: 24px 28px; margin-bottom: 18px;
}
.pf-section-header {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}
.pf-section-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.pf-icon-blue   { background: var(--primary-bg); color: var(--primary); }
.pf-icon-green  { background: var(--success-bg); color: var(--success); }
.pf-icon-purple { background: var(--purple-bg);  color: var(--purple); }
.pf-icon-orange { background: #fff7ed; color: #ea580c; }
.pf-section-title { font-size: 15px; font-weight: 800; margin: 0 0 2px; letter-spacing: -.2px; }
.pf-section-sub   { font-size: 12px; color: var(--muted); margin: 0; }
.pf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.pf-full  { grid-column: 1 / -1; }
.pf-field { display: flex; flex-direction: column; }
.pf-field > label { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.pf-req { color: var(--danger); margin-left: 2px; }
.pf-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.pf-err  { font-size: 12px; color: var(--danger); margin-top: 4px; }
.pf-date-wrap { position: relative; }
.pf-date-wrap .form-control { padding-right: 36px; }
.pf-date-icon {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  color: var(--muted-light); pointer-events: none; font-size: 15px;
}
.pf-date-err {
  font-size: 12px; color: var(--danger); margin-top: 4px; display: none;
}
.pf-date-err.show { display: block; }
.pf-currency-wrap { position: relative; }
.pf-currency-sym {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 700; color: var(--muted); z-index: 1;
}
.pf-currency-wrap .form-control { padding-left: 26px; }
.pf-check-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pf-check-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.pf-check-row label { font-size: 13.5px; font-weight: 600; cursor: pointer; margin: 0; }
.pf-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 20px 0 6px;
}

/* Avance input with mini-bar */
.avance-input-wrap { display: flex; align-items: center; gap: 6px; }
.avance-input-wrap input { width: 72px; }
.avance-pct-sym { font-size: 13px; color: var(--muted); font-weight: 600; }
.avance-bar-track { height: 5px; background: var(--line-light); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.avance-bar-fill  { height: 100%; border-radius: 999px; transition: width .3s, background .3s; }

/* Status badge-select */
.status-select-wrap { position: relative; }
.status-badge-overlay {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  pointer-events: none; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; display: flex; align-items: center; gap: 4px;
}
.status-select-wrap .form-select { padding-left: 80px; }

/* Activities inline table */
.act-section {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-xl); margin-bottom: 18px; overflow: hidden;
}
.act-section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px 14px; border-bottom: 1px solid var(--line-light);
}
.act-section-hdr h4 { font-size: 15px; font-weight: 800; margin: 0 0 2px; }
.act-section-hdr p  { font-size: 12px; color: var(--muted); margin: 0; }
.act-add-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s;
}
.act-add-btn:hover { background: var(--primary-dark); }
.act-table-scroll { overflow-x: auto; }
.act-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 900px; }
.act-table thead th {
  padding: 8px 8px; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); background: var(--line-light);
  border-bottom: 1.5px solid var(--line); white-space: nowrap;
}
.act-table tbody tr { border-bottom: 1px solid var(--line-light); }
.act-table tbody tr:nth-child(even) { background: #fafbff; }
.act-table tbody tr:hover { background: #f0f5ff; }
.act-table tbody td { padding: 5px 5px; vertical-align: middle; }
.act-table .form-control,
.act-table .form-select { font-size: 12.5px !important; padding: 4px 7px !important; height: 30px !important; border-radius: 6px !important; }
.act-num-td { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); width: 28px; }
.act-avance-td { min-width: 96px; }
.act-avance-row { display: flex; align-items: center; gap: 4px; }
.act-avance-row input { width: 52px !important; text-align: center; }
.act-mini-bar { height: 3px; background: var(--line-light); border-radius: 999px; margin-top: 3px; }
.act-mini-fill { height: 100%; border-radius: 999px; transition: width .3s, background .3s; }
.act-del-td { text-align: center; width: 34px; }
.act-del-btn {
  background: none; border: none; cursor: pointer; color: var(--muted-light);
  font-size: 14px; padding: 3px 5px; border-radius: 5px;
  transition: color .12s, background .12s;
}
.act-del-btn:hover { color: var(--danger); background: var(--danger-bg); }
.act-empty-row td {
  text-align: center; padding: 28px; color: var(--muted-light);
  font-size: 13px; font-style: italic;
}

/* ══════════════════════════════════════════════════════════
   PROYECTOS — Vista de lista personalizada
══════════════════════════════════════════════════════════ */
.proj-kpi-strip {
  display: flex; align-items: stretch;
  background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 20px;
}
.proj-kpi-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 18px 12px; gap: 4px; text-align: center;
}
.proj-kpi-sep { width: 1px; background: var(--line); flex-shrink: 0; align-self: stretch; }
.proj-kpi-value { font-size: 30px; font-weight: 900; letter-spacing: -1.5px; line-height: 1; }
.proj-kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.pk-total   { color: var(--text); }
.pk-activo  { color: var(--primary); }
.pk-tiempo  { color: var(--success); }
.pk-retraso { color: var(--warning); }
.pk-critico { color: var(--danger); }

.proj-toolbar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.proj-filters { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.proj-filters .form-select {
  max-width: 210px; min-width: 150px;
  border-radius: var(--radius-sm) !important;
  border: 1.5px solid var(--line) !important;
  font-size: 13px; height: 36px; padding: 0 10px;
  background-color: var(--card);
}
.proj-filters .form-select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
}

/* Table */
.proj-table { width: 100%; border-collapse: collapse; }
.proj-table thead th {
  padding: 10px 14px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); border-bottom: 2px solid var(--line);
  white-space: nowrap; background: var(--card);
}
.proj-table tbody tr {
  border-bottom: 1px solid var(--line-light);
  transition: background .1s;
  position: relative;
}
.proj-table tbody tr:hover { background: #f8faff; }
.proj-table tbody tr:last-child { border-bottom: none; }
.proj-table tbody td { padding: 13px 14px; vertical-align: middle; }

.proj-col-name { min-width: 220px; }
.proj-name-wrap { display: flex; flex-direction: column; gap: 4px; }
.proj-code {
  display: inline-block; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  background: var(--line-light); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; color: var(--muted);
  width: fit-content; flex-shrink: 0;
}
.proj-nombre { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.3; }

.persp-tag {
  display: inline-block; padding: 3px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  color: #fff; white-space: nowrap;
}

.proj-col-resp { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.proj-col-fecha { font-size: 13px; color: var(--muted); white-space: nowrap; }
.proj-col-avance { min-width: 150px; }

.proj-avance-wrap { display: flex; align-items: center; gap: 8px; }
.proj-avance-track {
  flex: 1; height: 7px; background: var(--line-light);
  border-radius: 999px; overflow: hidden;
}
.proj-avance-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.proj-avance-fill.sem-tiempo   { background: linear-gradient(90deg, #16a34a, #22c55e); }
.proj-avance-fill.sem-progreso { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.proj-avance-fill.sem-retraso  { background: linear-gradient(90deg, #d97706, #fbbf24); }
.proj-avance-fill.sem-critico  { background: linear-gradient(90deg, #dc2626, #f87171); }
.proj-avance-num {
  font-size: 13px; font-weight: 800; white-space: nowrap;
  flex-shrink: 0; min-width: 36px; text-align: right; color: var(--text);
}

.sem-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.sem-badge::before {
  content: ''; display: block; width: 6px; height: 6px;
  border-radius: 50%; flex-shrink: 0;
}
.sem-badge-tiempo   { background: var(--success-bg); color: #166534; }
.sem-badge-tiempo::before   { background: var(--success); }
.sem-badge-progreso { background: var(--primary-bg);  color: #1e40af; }
.sem-badge-progreso::before { background: var(--primary); }
.sem-badge-retraso  { background: var(--warning-bg);  color: #92400e; }
.sem-badge-retraso::before  { background: var(--warning); }
.sem-badge-critico  { background: var(--danger-bg);   color: #991b1b; }
.sem-badge-critico::before  { background: var(--danger); }

.proj-col-actions { width: 48px; text-align: center; }
.proj-edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: transparent; color: var(--muted);
  border: 1.5px solid transparent;
  font-size: 14px; text-decoration: none;
  opacity: 0; transition: opacity .15s, background .12s, color .12s, border-color .12s;
}
.proj-table tbody tr:hover .proj-edit-btn {
  opacity: 1; background: var(--primary-bg);
  color: var(--primary); border-color: #bfdbfe;
}
.proj-col-actions { width: 80px !important; }
.proj-delete-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid #fca5a5; color: #dc2626; background: #fff;
  cursor: pointer; text-decoration: none; font-size: 14px;
  opacity: 0; transition: opacity .15s, background .12s;
}
.proj-table tbody tr:hover .proj-delete-btn { opacity: 1; }
.proj-delete-btn:hover { background: #fef2f2; border-color: #dc2626; }
.act-inner-table tbody tr:hover .proj-delete-btn { opacity: 1; }

.btn-orden {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; background: transparent;
  color: #94a3b8; cursor: pointer; border-radius: 4px;
  font-size: 13px; padding: 0; line-height: 1;
  transition: color .12s, background .12s;
}
.btn-orden:hover:not(:disabled) { color: #374151; background: #f1f5f9; }
.btn-orden:disabled { color: #cbd5e1; cursor: default; }

.proj-empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.proj-empty-state i { font-size: 36px; opacity: .25; margin-bottom: 12px; }
.proj-empty-state p { font-size: 14px; margin-bottom: 16px; }

/* ══════════════════════════════════════════════════════════
   IDENTIDAD ESTRATÉGICA
══════════════════════════════════════════════════════════ */

/* -- Dashboard banner (compact) -- */
.identidad-banner {
  background: linear-gradient(135deg, #0c1e40 0%, #0f2d5c 45%, #1a4a8a 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(15,45,92,.28);
}
.identidad-banner::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.22) 0%, transparent 70%);
  pointer-events: none;
}
.identidad-banner::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 40%;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96,165,250,.12) 0%, transparent 70%);
  pointer-events: none;
}
.identidad-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.identidad-icon-wrap {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.identidad-titulo {
  font-size: 16px; font-weight: 800; letter-spacing: -.3px; line-height: 1.2;
}
.identidad-periodo-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .05em;
  color: rgba(255,255,255,.6); margin-top: 2px;
}
.identidad-edit-btn {
  background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9);
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.identidad-edit-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.identidad-mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.identidad-mv-block {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.identidad-mv-label {
  font-size: 10px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255,255,255,.55);
  margin-bottom: 9px;
  display: flex; align-items: center; gap: 5px;
}
.identidad-mv-label i { font-size: 12px; opacity: .9; }
.identidad-mv-text {
  font-size: 13.5px; line-height: 1.7;
  color: rgba(255,255,255,.88);
  font-style: italic;
}
.identidad-valores-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.identidad-valores-title {
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.45);
}
.identidad-valor-chip {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px; font-weight: 700;
  color: rgba(255,255,255,.88);
  letter-spacing: .02em;
  transition: background .12s;
}
.identidad-valor-chip:hover { background: rgba(255,255,255,.18); }
.identidad-empty-banner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #0c1e40 0%, #0f2d5c 100%);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  color: rgba(255,255,255,.8);
  margin-bottom: 28px;
  border: 1px dashed rgba(255,255,255,.2);
}
.identidad-empty-banner i { font-size: 22px; flex-shrink: 0; opacity: .6; }
.identidad-empty-banner strong { font-size: 13.5px; display: block; color: #fff; margin-bottom: 2px; }
.identidad-empty-banner span { font-size: 12px; }

/* -- Dedicated identity page -- */
.id-hero {
  background: linear-gradient(135deg, #0c1e40 0%, #0f2d5c 40%, #1e4db5 100%);
  border-radius: var(--radius-xl);
  padding: 40px 44px;
  margin-bottom: 28px;
  position: relative; overflow: hidden;
  box-shadow: 0 12px 48px rgba(15,45,92,.3);
}
.id-hero::before {
  content: '';
  position: absolute; top: -80px; right: -40px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.2) 0%, transparent 65%);
  pointer-events: none;
}
.id-hero-content {
  display: flex; align-items: center; gap: 20px; position: relative; z-index: 1;
}
.id-hero-icon {
  width: 64px; height: 64px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.25);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff; flex-shrink: 0;
}
.id-hero-title {
  font-size: 26px; font-weight: 900; color: #fff;
  letter-spacing: -.5px; line-height: 1.15; margin: 0 0 4px;
}
.id-hero-sub {
  font-size: 13px; color: rgba(255,255,255,.6);
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.id-hero-spacer { flex: 1; }
.id-edit-hero-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1.5px solid rgba(255,255,255,.28);
  color: #fff; border-radius: var(--radius);
  padding: 11px 22px; font-size: 14px; font-weight: 600;
  text-decoration: none; transition: background .15s;
}
.id-edit-hero-btn:hover { background: rgba(255,255,255,.22); color: #fff; }
.id-mv-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.id-mv-card {
  border-radius: var(--radius-xl);
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow);
}
.id-mision {
  background: linear-gradient(160deg, #eef4ff 0%, #dbeafe 100%);
  border-color: #bfdbfe;
}
.id-vision {
  background: linear-gradient(160deg, #f0fdf8 0%, #d1fae5 100%);
  border-color: #a7f3d0;
}
.id-mv-card-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.id-mv-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.id-mv-icon.id-mv-icon-vision {
  background: linear-gradient(135deg, #10b981, #059669);
}
.id-mv-card-label {
  font-size: 14px; font-weight: 900; color: var(--text);
  letter-spacing: -.2px; text-transform: uppercase; font-size: 12px;
  letter-spacing: .1em;
}
.id-quote-mark {
  font-size: 72px; line-height: .7; font-family: Georgia, serif;
  color: rgba(37,99,235,.15); margin-bottom: 8px;
  position: absolute; top: 18px; right: 22px;
  pointer-events: none;
}
.id-vision .id-quote-mark { color: rgba(16,185,129,.15); }
.id-mv-body {
  font-size: 14.5px; line-height: 1.75;
  color: var(--text-secondary);
  font-style: italic;
  position: relative; z-index: 1;
}
.id-valores-grid {
  display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0;
}
.id-valor-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--line-light);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  min-width: 140px; flex: 1 1 140px;
  transition: transform .12s, box-shadow .12s;
}
.id-valor-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.id-valor-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  flex-shrink: 0;
}
.id-valor-name {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.id-empty-state {
  text-align: center; padding: 60px 40px;
  background: var(--card); border-radius: var(--radius-xl);
  border: 2px dashed var(--line); margin-bottom: 24px;
}
.id-empty-state .id-empty-icon {
  font-size: 48px; color: var(--muted-light); margin-bottom: 16px;
}
.id-empty-state h3 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.id-empty-state p { font-size: 14px; color: var(--muted); max-width: 420px; margin: 0 auto; }
.id-form-label {
  display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px;
  color: var(--text);
}
.id-form-textarea {
  font-size: 14px; line-height: 1.65; border-radius: var(--radius) !important;
  border: 1.5px solid var(--line) !important; resize: vertical;
}
.id-form-textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important; }
.id-form-hint {
  font-size: 11.5px; color: var(--muted); margin-top: 5px;
}

/* ══════════════════════════════════════════════════════════
   ACTIVIDADES LIST — Accordion by project
══════════════════════════════════════════════════════════ */
.act-list-kpi-strip {
  display: flex; align-items: center; gap: 0;
  background: var(--surface); border-radius: var(--radius-xl);
  border: 1.5px solid var(--border); padding: 16px 24px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.act-list-kpi-item {
  display: flex; flex-direction: column; align-items: center;
  min-width: 80px; padding: 0 16px;
}
.act-list-kpi-value {
  font-size: 26px; font-weight: 900; line-height: 1;
  letter-spacing: -.5px;
}
.act-list-kpi-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; margin-top: 4px;
}
.act-list-kpi-sep {
  width: 1.5px; height: 36px; background: var(--border); margin: 0 4px;
  align-self: center;
}
.akv-total    { color: #1e3a5f; }
.akv-pending  { color: #64748b; }
.akv-progress { color: #1e40af; }
.akv-done     { color: #065f46; }
.akv-overdue  { color: #991b1b; }

.act-list-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.act-list-toolbar .act-search-wrap {
  position: relative; flex: 1; min-width: 220px; max-width: 360px;
}
.act-list-toolbar .act-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.act-list-toolbar .act-search-input {
  padding-left: 34px; font-size: 13px;
}
.act-list-toolbar .form-select { font-size: 13px; max-width: 180px; }

/* Accordion */
.act-accordion { display: flex; flex-direction: column; gap: 12px; }

.act-acc-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow .15s;
}
.act-acc-item:hover { box-shadow: var(--shadow-md); }

.act-acc-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; cursor: pointer;
  user-select: none;
  border-bottom: 1.5px solid transparent;
  transition: background .12s, border-color .12s;
}
.act-acc-header:hover { background: var(--primary-bg); }
.act-acc-item.open .act-acc-header {
  background: var(--primary-bg); border-color: var(--border);
}
.act-acc-code {
  font-size: 11px; font-weight: 800; color: var(--muted);
  background: var(--bg); border: 1.5px solid var(--border);
  padding: 2px 8px; border-radius: 6px; letter-spacing: .03em;
  flex-shrink: 0;
}
.act-acc-title {
  font-size: 14px; font-weight: 700; color: var(--text); flex: 1;
}
.act-acc-count {
  font-size: 12px; color: var(--muted); flex-shrink: 0;
}
.act-acc-avance {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; width: 100px;
}
.act-acc-bar-track {
  flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.act-acc-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .3s;
}
.act-acc-pct {
  font-size: 11px; font-weight: 700; color: var(--muted); width: 30px; text-align: right;
}
.act-acc-chevron {
  font-size: 12px; color: var(--muted); transition: transform .2s; flex-shrink: 0;
}
.act-acc-item.open .act-acc-chevron { transform: rotate(180deg); }

.act-acc-body {
  display: none; padding: 0;
}
.act-acc-item.open .act-acc-body { display: block; }

/* Table inside accordion */
.act-inner-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.act-inner-table th {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  padding: 10px 16px; background: var(--bg);
  border-bottom: 1.5px solid var(--border);
}
.act-inner-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.act-inner-table tbody tr:last-child td { border-bottom: none; }
.act-inner-table tbody tr:hover td { background: var(--primary-bg); }

.act-inner-name {
  font-weight: 600; color: var(--text);
}
.act-inner-bar-wrap {
  display: flex; align-items: center; gap: 8px;
}
.act-inner-bar-track {
  width: 80px; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; flex-shrink: 0;
}
.act-inner-bar-fill {
  height: 100%; border-radius: 99px;
}
.act-inner-pct {
  font-size: 12px; font-weight: 700; color: var(--text); width: 36px;
}

/* Estado badges in activity table */
.act-badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.act-badge-pending   { background: #f1f5f9; color: #64748b; }
.act-badge-progress  { background: #dbeafe; color: #1e40af; }
.act-badge-done      { background: #d1fae5; color: #065f46; }
.act-badge-overdue   { background: #fee2e2; color: #991b1b; }
.act-badge-cancelled { background: #f1f5f9; color: #94a3b8; }

.act-overdue-flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #dc2626; font-weight: 600;
}

.act-empty-row td {
  text-align: center; padding: 24px; color: var(--muted); font-size: 13px;
}
.act-list-empty {
  text-align: center; padding: 56px 24px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-xl); color: var(--muted);
}
.act-list-empty i { font-size: 36px; opacity: .2; display: block; margin-bottom: 12px; }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1050px) {
  :root { --sidebar-width: 230px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content-wrap { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}


/* ── MAPA ESTRATÉGICO ───────────────────────────────────────── */
.mapa-contenedor {
  max-width: 1200px;
  margin: 0 auto;
}

.mapa-header {
  background: #0f172a;
  border-radius: 14px 14px 0 0;
  padding: 24px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  position: relative;
}

.mapa-header-btns {
  position: absolute;
  top: 14px; right: 14px;
  display: flex; gap: 8px;
}
.mapa-btn-config {
  background: rgba(255,255,255,.1);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,.15);
  font-size: 12px;
}
.mapa-btn-config:hover { background: rgba(255,255,255,.2); color: #fff; }
.mapa-btn-print {
  background: rgba(255,255,255,.1);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,.15);
  font-size: 12px;
}
.mapa-btn-print:hover { background: rgba(255,255,255,.2); color: #fff; }

.mapa-header-logo { display: flex; align-items: center; }
.mapa-header-titulo { text-align: center; }

.mapa-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px; height: 60px;
  background: rgba(255,255,255,.08);
  border: 1px dashed rgba(255,255,255,.2);
  border-radius: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.mapa-banner-mision {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-top: none;
  padding: 16px 32px;
}
.mapa-banner-vision {
  background: #0c1a2e;
  border-top: 1px solid #1e3a5f;
  padding: 16px 32px;
}

.mapa-perspectivas {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  padding-right: 40px;
}

.mapa-fila {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.mapa-fila:last-child { border-bottom: none; }

.mapa-persp-badge {
  color: white;
  border-radius: 12px;
  padding: 14px 16px;
  min-width: 150px;
  max-width: 150px;
  text-align: center;
  flex-shrink: 0;
}

.mapa-objetivos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
  align-items: center;
}

.mapa-obj-pill {
  background: #1a3a6b;
  color: white;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12.5px;
  text-align: center;
  max-width: 220px;
  line-height: 1.4;
}

.mapa-flecha-lateral {
  position: absolute;
  right: 0; top: 0;
  width: 32px;
  height: 100%;
  background: linear-gradient(to top, #f59e0b, #fcd34d);
  clip-path: polygon(0 5%, 50% 0%, 100% 5%, 100% 100%, 0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .mapa-header {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 12px;
    padding: 20px 16px 48px;
  }
  .mapa-header-logo { justify-content: center; }
  .mapa-logo-placeholder { margin: 0 auto; }
  .mapa-fila { flex-direction: column; align-items: flex-start; padding: 14px 12px; }
  .mapa-persp-badge { width: 100%; max-width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; }
  .mapa-flecha-lateral { display: none; }
  .mapa-perspectivas { padding-right: 0; }
  .mapa-banner-mision, .mapa-banner-vision { padding: 14px 16px; }
}

@media print {
  nav, aside, header, .sidebar, .topbar, .btn,
  .mapa-btn-config, .mapa-btn-print, .mapa-header-btns { display: none !important; }
  .content-wrap { margin: 0 !important; padding: 0 !important; }
  .mapa-contenedor { max-width: 100%; }
  .mapa-header { border-radius: 0; }
  .mapa-perspectivas { border-radius: 0; }
  .mapa-fila { break-inside: avoid; }
  body { background: white !important; }
}

/* ── Módulo Presupuesto ──────────────────────────────────────────────── */
.ppto-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ppto-kpi-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.ppto-kpi-valor {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: .25rem 0;
}
.ppto-kpi-label {
  font-size: .8rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ppto-global-track {
  height: 18px;
  background: #e5e7eb;
  border-radius: 9px;
  overflow: hidden;
  margin: .5rem 0;
}
.ppto-global-fill {
  height: 100%;
  border-radius: 9px;
  transition: width .5s ease;
}
.ppto-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
  width: 120px;
  display: inline-block;
  vertical-align: middle;
}
.ppto-fill {
  height: 100%;
  border-radius: 4px;
}
.ppto-fill.sem-verde    { background: #198754; }
.ppto-fill.sem-amarillo { background: #f59e0b; }
.ppto-fill.sem-rojo     { background: #dc3545; }
.ppto-fill.sem-gris     { background: #adb5bd; }
.ejecutado-valor {
  cursor: pointer;
  border-bottom: 1px dashed #6b7280;
}
.ejecutado-valor:hover { color: #1a56db; }
