/* ============================================================
   ANEAES — Sistema de Acreditación  v2
   Tema oscuro moderno
   ============================================================ */

:root {
  --bg:      #0f172a;
  --bg2:     #1e293b;
  --card:    #1e293b;
  --border:  #334155;
  --text:    #e2e8f0;
  --muted:   #94a3b8;
  --accent:  #6366f1;
  --green:   #10b981;
  --yellow:  #f59e0b;
  --red:     #ef4444;
  --sidebar: 230px;
}

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

body {
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  background: #0d1526;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.logo-title { font-size: 15px; font-weight: 700; color: #fff; }
.logo-sub   { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Proceso chip */
.proceso-chip {
  margin: 10px 10px 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
}
.proceso-chip.cluster { border-color: #7c3aed; }
.proceso-tipo {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .08em;
  margin-bottom: 2px;
}
.proceso-chip.cluster .proceso-tipo { color: #7c3aed; }
.proceso-nombre {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
}
.proceso-cambiar {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.proceso-cambiar:hover { color: var(--accent); }

.sidebar-nav { padding: 10px 8px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  margin-bottom: 1px;
}
.nav-item:hover { background: #1e293b; color: var(--text); text-decoration: none; }
.nav-item.active { background: #6366f120; color: var(--accent); font-weight: 600; }
.nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-sep { height: 1px; background: var(--border); margin: 6px 0; }

.sidebar-export {
  padding: 10px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-export {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
  justify-content: center;
}
.btn-export:hover { border-color: var(--accent); color: var(--accent); }
.btn-export.word  { border-color: #2563eb20; color: #60a5fa; }
.btn-export.word:hover { border-color: #2563eb; }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar);
  flex: 1;
  padding: 28px 32px;
  width: calc(100vw - var(--sidebar));
  max-width: 1380px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.page-title { font-size: 22px; font-weight: 700; color: #fff; }
.page-sub   { color: var(--muted); font-size: 13px; margin-top: 2px; }
.page-badge { background: var(--bg2); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: 12px; color: var(--muted); align-self: center; }
.page-title, .page-sub, .card-title, .alert, .cluster-summary { overflow-wrap: anywhere; }
.breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.warn-title { color: var(--yellow); }
.mt-16 { margin-top: 16px; }

/* ── STATS ROW ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stats-row.five { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--muted); }
.stat-bar { height: 4px; background: #334155; border-radius: 2px; margin-top: 10px; }
.stat-bar-fill { height: 100%; border-radius: 2px; transition: width .4s; }

.ev-pendiente  { color: var(--yellow); }
.ev-verificado { color: var(--green); }
.ev-rechazado  { color: var(--red); }

/* ── DASHBOARD GRID ──────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dim-name { font-size: 12px; font-weight: 600; width: 160px; flex-shrink: 0; }
.dim-bar-wrap { flex: 1; height: 6px; background: #334155; border-radius: 3px; }
.dim-bar-fill { height: 100%; border-radius: 3px; transition: width .4s; }
.dim-pct { font-size: 12px; color: var(--muted); width: 32px; text-align: right; }

.ev-progress-stacked {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin: 14px 0 6px;
  gap: 2px;
}
.ev-seg { height: 100%; transition: width .4s; border-radius: 2px; }
.ev-total-label { font-size: 12px; color: var(--muted); text-align: center; }
.ev-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.ev-leg-item { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.ev-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── PROCESOS ────────────────────────────────────────────── */
.procesos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.proceso-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color .2s;
}
.proceso-card:hover { border-color: var(--accent); }
.proceso-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.proceso-card.cluster { border-color: #7c3aed40; }
.proceso-card.cluster:hover,
.proceso-card.cluster.active { border-color: #7c3aed; }

.proceso-card-header { display: flex; gap: 8px; margin-bottom: 10px; }
.badge-tipo {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .05em;
}
.badge-tipo.individual { background: #6366f120; color: var(--accent); }
.badge-tipo.cluster    { background: #7c3aed20; color: #a78bfa; }
.badge-estado { font-size: 10px; padding: 2px 8px; border-radius: 10px; background: #f59e0b20; color: var(--yellow); font-weight: 600; }
.badge-estado.completado { background: #10b98120; color: var(--green); }

.proceso-card-name     { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.proceso-card-carreras { font-size: 12px; color: var(--muted); margin-bottom: 14px; line-height: 1.4; }
.proceso-card-actions  { display: flex; gap: 8px; flex-wrap: wrap; }

.carreras-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.carrera-tag {
  background: #6366f115;
  border: 1px solid #6366f140;
  color: #818cf8;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

/* ── DIMENSIÓN / CRITERIOS ───────────────────────────────── */
.dim-section { margin-bottom: 28px; }
.dim-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid;
  padding: 8px 14px;
  background: var(--bg2);
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
}
.dim-number {
  font-size: 11px; font-weight: 800; color: #fff;
  padding: 3px 8px; border-radius: 5px; letter-spacing: .04em;
}
.dim-title { font-size: 14px; font-weight: 700; color: #fff; flex: 1; }
.comp-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 6px 8px; text-transform: uppercase; letter-spacing: .05em; }

.criterios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.criterio-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c, #6366f1);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .2s, transform .15s;
  color: var(--text);
}
.criterio-card:hover { border-color: var(--c, #6366f1); transform: translateY(-1px); text-decoration: none; }
.criterio-card-top { display: flex; justify-content: space-between; align-items: center; }
.criterio-id   { font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.criterio-nombre { font-size: 12px; color: var(--text); line-height: 1.4; flex: 1; }
.criterio-nivel { font-size: 11px; font-weight: 600; margin-top: 2px; }
.criterio-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.criterio-prog { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.criterio-meta { display: flex; gap: 8px; font-size: 11px; color: var(--muted); }

.criterio-tipo {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; letter-spacing: .04em;
}
.criterio-tipo.sust  { background: #6366f120; color: var(--accent); }
.criterio-tipo.nsust { background: #f59e0b20; color: var(--yellow); }

.mini-bar { width: 60px; height: 4px; background: #334155; border-radius: 2px; }
.mini-bar div { height: 100%; border-radius: 2px; }
.mini-bar-wide { width: 80px; height: 6px; background: #334155; border-radius: 3px; display: inline-block; vertical-align: middle; }
.mini-bar-wide div { height: 100%; border-radius: 3px; }
.pct-label { font-size: 11px; color: var(--muted); margin-left: 6px; }

/* ── CRITERIO DETALLE ────────────────────────────────────── */
.criterio-meta-row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.dim-badge { font-size: 11px; padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.empty-hint { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* Indicadores */
.ind-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.ind-table thead th {
  background: var(--bg);
  font-size: 11px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  padding: 8px; border-bottom: 1px solid var(--border);
}
.ind-table tbody tr:hover { background: #ffffff05; }
.ind-texto { padding: 10px 8px; font-size: 12px; line-height: 1.4; }
.ind-radio { text-align: center; padding: 8px; width: 60px; }
.radio-opt {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px; font-weight: 700;
  transition: all .15s;
}
.radio-opt input { display: none; }
.radio-opt:hover { border-color: var(--accent); color: var(--accent); }
.radio-opt.sel-CT { background: #6366f120; border-color: var(--accent); color: var(--accent); }
.radio-opt.sel-CP { background: #f59e0b20; border-color: var(--yellow); color: var(--yellow); }
.radio-opt.sel-NC { background: #ef444420; border-color: var(--red); color: var(--red); }

/* Evidencia por indicador */
.ind-ev-cell { padding: 6px 8px; }
.ind-ev-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 9px;
  font-size: 11px;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
}
.ind-ev-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #6366f130;
}
.ind-ev-input::placeholder { color: #475569; }
.ind-ev-badge {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  display: inline-block;
  vertical-align: middle;
}
/* Scroll horizontal en tabla de indicadores */
.ind-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}
.ind-table { min-width: 700px; }

.ind-ct  { color: var(--accent); font-weight: 700; }
.ind-cp  { color: var(--yellow); font-weight: 700; }
.ind-nc  { color: var(--red); font-weight: 700; }
.ind-sin { color: var(--muted); }

.nivel-section { margin-top: 20px; }
.nivel-options { display: flex; flex-wrap: wrap; gap: 8px; }
.nivel-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: all .15s;
}
.nivel-opt input { display: none; }
.nivel-opt:hover { border-color: var(--nc); color: var(--nc); }
.nivel-opt.sel { border-color: var(--nc); background: color-mix(in srgb, var(--nc) 12%, transparent); color: var(--nc); }

/* ── EVIDENCIAS ──────────────────────────────────────────── */
.evidencias-list { display: flex; flex-direction: column; gap: 10px; }
.evid-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.evid-card.estado-rechazado { border-color: #ef444440; }
.evid-card.estado-verificado { border-color: #10b98140; }
.evid-card.estado-entregado  { border-color: #6366f140; }
.evid-card.estado-vencida    { border-color: #7f1d1d80; background: #7f1d1d08; }

.evid-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.evid-nombre { font-size: 13px; font-weight: 600; color: #fff; }
.evid-meta   { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.evid-desc   { font-size: 12px; color: var(--text); margin: 6px 0; }
.evid-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.gdrive-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: #0ea5e920; border: 1px solid #0ea5e940;
  color: #38bdf8;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  margin-top: 6px;
  transition: all .15s;
}
.gdrive-btn:hover { background: #0ea5e930; text-decoration: none; }

.rechazo-motivo {
  background: #ef444415;
  border-left: 3px solid var(--red);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #fca5a5;
  margin-top: 8px;
  line-height: 1.5;
}
.vencida-label {
  font-size: 11px; color: #fca5a5; font-weight: 600;
  background: #7f1d1d30;
  padding: 2px 8px; border-radius: 6px;
}

/* Workflow buttons */
.btn-estado {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-estado.entregado { background: #6366f120; color: var(--accent); border: 1px solid #6366f140; }
.btn-estado.entregado:hover { background: #6366f130; }
.btn-estado.verificado { background: #10b98120; color: var(--green); border: 1px solid #10b98140; }
.btn-estado.verificado:hover { background: #10b98130; }
.btn-estado.rechazado { background: #ef444415; color: var(--red); border: 1px solid #ef444440; }
.btn-estado.rechazado:hover { background: #ef444425; }
.btn-estado.pendiente { background: #f59e0b15; color: var(--yellow); border: 1px solid #f59e0b40; }
.btn-estado.pendiente:hover { background: #f59e0b25; }
.verificado-final { font-size: 12px; color: var(--green); font-weight: 600; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-pendiente  { background: #f59e0b20; color: var(--yellow); }
.badge-entregado  { background: #6366f120; color: #818cf8; }
.badge-verificado { background: #10b98120; color: var(--green); }
.badge-rechazado  { background: #ef444420; color: var(--red); }
.badge-vencida    { background: #7f1d1d40; color: #fca5a5; }

/* ── SÍNTESIS ────────────────────────────────────────────── */
.sintesis-wrap { display: flex; flex-direction: column; gap: 20px; }
.sintesis-dim { background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.sintesis-dim-header {
  padding: 12px 18px;
  font-size: 14px; font-weight: 700;
  border-left: 4px solid;
  display: flex; align-items: center; gap: 10px;
}
.sintesis-table { width: 100%; border-collapse: collapse; }
.sintesis-table th {
  background: var(--bg);
  padding: 8px 12px;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.sintesis-table td { padding: 10px 12px; font-size: 12px; border-bottom: 1px solid #1e293b; }
.sintesis-table tr:last-child td { border-bottom: none; }
.sintesis-notas { padding: 12px 18px; background: var(--bg); border-top: 1px solid var(--border); }
.sintesis-notas p { font-size: 12px; margin-bottom: 8px; line-height: 1.5; }

/* ── FORMS ───────────────────────────────────────────────── */
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 180px; }
.form-group label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.form-group-btn { justify-content: flex-end; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  transition: border-color .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #6366f130;
}
textarea { resize: vertical; line-height: 1.5; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

.form-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.inline-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  color: #fff; border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-primary:hover { background: #4f46e5; text-decoration: none; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.btn-danger {
  background: #ef444420;
  color: var(--red);
  border: 1px solid #ef444440;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-danger:hover { background: #ef444430; }

.btn-warn {
  background: #f59e0b20;
  color: var(--yellow);
  border: 1px solid #f59e0b40;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.btn-warn:hover { background: #f59e0b30; }

.btn-primary.sm, .btn-ghost.sm, .btn-danger.sm { padding: 5px 11px; font-size: 12px; }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-ok  { background: #10b98115; border: 1px solid #10b98140; color: var(--green); }
.alert-err { background: #ef444415; border: 1px solid #ef444440; color: var(--red); }

/* ── TABLES ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  background: var(--bg);
  padding: 9px 12px;
  font-size: 11px; font-weight: 700;
  color: var(--muted); text-align: left;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid #1e293b; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #ffffff04; }
.card-table {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.td-actions { white-space: nowrap; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }

/* ── ESTADÍSTICAS ────────────────────────────────────────── */
.export-actions { display: flex; gap: 8px; }
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.filter-tab {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  transition: all .15s;
}
.filter-tab:hover { color: var(--text); text-decoration: none; }
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-tab.vencida { color: #fca5a5; border-color: #7f1d1d; }
.filter-tab.vencida.active { background: #7f1d1d; border-color: #7f1d1d; }

.criterios-sin-resp { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
  font-size: 11px; padding: 4px 10px;
  border: 1px solid;
  border-radius: 6px;
  color: var(--muted);
  transition: all .15s;
}
.tag-link:hover { color: var(--text); text-decoration: none; }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.overview-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.overview-card-title {
  font-size: 13px; font-weight: 700; color: #fff;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

/* Panorama general */
.overview-proceso {
  margin-bottom: 20px;
}
.overview-proceso-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.overview-proc-name {
  font-size: 16px; font-weight: 700; color: #fff;
  margin: 6px 0 3px;
}
.overview-carreras { font-size: 12px; color: var(--muted); }
.overview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.ov-stat { min-width: 80px; }
.ov-val  { font-size: 22px; font-weight: 800; color: #fff; line-height: 1; }
.ov-lbl  { font-size: 11px; color: var(--muted); margin-top: 3px; }
.vencida-stat .ov-lbl { color: #fca5a5; }
.overview-resp-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 8px;
}
.row-vencida td { background: #7f1d1d08; }
.row-vencida:hover td { background: #7f1d1d15 !important; }

/* ── MISC ────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 13px; line-height: 1.6; }

.no-proceso {
  text-align: center; padding: 80px 24px;
  max-width: 400px; margin: 0 auto;
}
.no-proceso-icon { font-size: 48px; margin-bottom: 16px; color: var(--muted); }
.no-proceso h2 { font-size: 20px; margin-bottom: 8px; }
.no-proceso p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.smtp-hints {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px;
  font-size: 12px; margin: 10px 0;
}
.smtp-hints ul { margin: 6px 0 0 18px; color: var(--muted); }
.smtp-hints li { margin-bottom: 4px; }
.smtp-hints a { color: var(--accent); }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 30px;
  width: 460px; max-width: 94%;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-desc  { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.modal-box textarea, .modal-box input { margin-bottom: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1e293b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13px; color: var(--text);
  z-index: 300;
  transform: translateY(20px); opacity: 0;
  transition: all .25s;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── SIDEBAR FOOTER (logout + user) ──────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
}
.sidebar-user-name {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout {
  width: 100%;
  background: none;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #64748b;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  text-align: left;
}
.btn-logout:hover { border-color: var(--red); color: #fca5a5; }

/* ── PANEL USER CHIP (panel.php sidebar) ─────────────────── */
.panel-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 4px;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
}
.panel-user-avatar {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.panel-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.panel-user-rol  { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* ── RESPONSABLE PANEL ───────────────────────────────────── */
.row-inactivo { opacity: .5; }
.resp-criterio-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.resp-criterio-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.criterio-id-badge {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.resp-criterio-nombre { font-size: 13px; font-weight: 600; }
.resp-evidencias-ref {
  background: #0f172a; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 11px;
}
.resp-ref-title { color: var(--muted); margin-bottom: 5px; }
.resp-ref-row   { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 3px; }
.resp-ref-key   { font-weight: 700; color: #818cf8; flex-shrink: 0; }
.resp-ref-chip  { background: #1e293b; border: 1px solid #334155; border-radius: 14px; padding: 1px 8px; color: var(--muted); }
.resp-evids-list { display: flex; flex-direction: column; gap: 10px; }
.resp-ev-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; transition: border-color .2s;
}
.resp-ev-card.estado-rechazado { border-color: #ef444440; }
.resp-ev-card.estado-verificado { border-color: #10b98140; }
.resp-ev-card.vencida { border-color: #fca5a540; }
.resp-ev-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.resp-ev-nombre { font-weight: 600; font-size: 14px; }
.resp-ev-meta   { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.text-red       { color: #fca5a5 !important; }
.resp-rechazo-motivo {
  background: #7f1d1d20; border: 1px solid #ef4444; border-radius: 6px;
  padding: 8px 12px; font-size: 12px; color: #fca5a5; margin: 8px 0; line-height: 1.5;
}
.resp-ev-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.resp-upload-form { margin-top: 10px; }
.resp-waiting { font-size: 12px; color: var(--muted); font-style: italic; }
.resp-no-evids { font-size: 13px; color: var(--muted); padding: 8px 0; }

/* ── CALIDAD PANEL ───────────────────────────────────────── */
.cal-ev-card {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 10px; transition: opacity .3s;
}
.cal-ev-top    { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cal-ev-nombre { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.cal-ev-resp   { font-size: 12px; color: var(--muted); }
.cal-ev-desc   { font-size: 12px; color: var(--muted); margin-top: 6px; }
.cal-ev-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cal-rechazo-form {
  background: #0f172a; border: 1px solid #334155;
  border-radius: 6px; padding: 10px; margin-top: 8px;
}
.cal-motivo-input {
  width: 100%; background: #1e293b; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 8px 10px;
  font-size: 13px; font-family: inherit; resize: vertical;
}
.btn-gdrive-cal {
  display: inline-flex; align-items: center; gap: 5px;
  background: #10b98120; border: 1px solid #10b981; border-radius: 7px;
  color: #6ee7b7; padding: 6px 12px; font-size: 12px; text-decoration: none;
  white-space: nowrap; flex-shrink: 0; font-weight: 600;
}
.btn-gdrive-cal:hover { background: #10b98130; text-decoration: none; }

/* ── EVIDENCIAS DE INDICADOR (chips multi-evidencia) ─────── */
.ev-ind-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 20px;
  margin-bottom: 5px;
}
.ev-ind-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #1a2a42;
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 3px 9px 3px 8px;
  font-size: 11px;
  color: var(--text);
  max-width: 340px;
}
.ev-ind-chip-name {
  font-weight: 600;
  color: #818cf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.ev-ind-chip-resp {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.ev-ind-chip-link {
  color: var(--green);
  font-size: 11px;
  text-decoration: none;
  flex-shrink: 0;
}
.ev-ind-chip-link:hover { opacity: .8; }
.ev-ind-chip-del {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  padding: 0 1px;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s;
}
.ev-ind-chip-del:hover { color: var(--red); }

.ev-ind-addform {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  margin-bottom: 5px;
}
.ev-ind-input {
  display: block;
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  margin-bottom: 4px;
  font-family: inherit;
}
.ev-ind-input:focus {
  outline: none;
  border-color: var(--accent);
}
.ev-ind-form-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.ev-ind-add-btn {
  display: inline-block;
  background: none;
  border: 1px dashed #4f46e5;
  border-radius: 14px;
  color: #818cf8;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 11px;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.ev-ind-add-btn:hover {
  background: #6366f115;
  color: var(--accent);
}

/* ── PRINT ───────────────────────────────────────────────── */
@media print {
  .sidebar, .btn-export, .btn-primary, .btn-ghost, .btn-danger,
  .btn-warn, .btn-estado, .evid-actions, .card-title button,
  .export-actions, .filter-tabs, .modal-overlay, .toast,
  .page-header button, .page-header a.btn-primary { display: none !important; }

  body { background: #fff; color: #000; font-size: 10pt; }
  .main-content { margin-left: 0; padding: 0; max-width: 100%; }
  .page-title { font-size: 16pt; color: #1e3a5f; }
  .card { background: #fff; border: 1px solid #ccc; border-radius: 0; page-break-inside: avoid; }
  .stat-card { background: #f5f5f5; border: 1px solid #ddd; }
  .stat-value { color: #000; }
  .data-table th, .sintesis-table th { background: #1e3a5f; color: #fff; }
  .data-table td, .sintesis-table td { color: #000; }
  .sintesis-dim-header { background: #f5f5f5 !important; color: #000 !important; }
  .badge { border: 1px solid currentColor; }

  @page { margin: 1.5cm 2cm; }
}

/* ── SUB-MATRICES (cluster/bimodal) ─────────────────────── */
.submatrix-selector {
  padding: 8px 12px;
  border-top: 1px solid #1e293b;
  margin-top: 4px;
}
.submatrix-label {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
  font-weight: 600;
}
.submatrix-tab {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #94a3b8;
  text-decoration: none;
  margin-bottom: 3px;
  transition: background .15s, color .15s;
  border: 1px solid transparent;
}
.submatrix-tab:hover { background: #1e293b; color: #e2e8f0; }
.submatrix-tab.active { background: #6366f120; color: #818cf8; border-color: #6366f140; font-weight: 600; }
.sm-tipo { font-weight: 700; margin-right: 4px; }
.sm-mod  { font-size: 9px; background: #334155; border-radius: 3px; padding: 1px 4px; color: #94a3b8; }

/* ── AUDIT TABLE ──────────────────────────────────────────── */
.alert-warn { background: #78350f30; border: 1px solid #f59e0b; color: #fcd34d; }

/* ── @media print — Matriz oficial ──────────────────────── */
@media print {
  body { background: #fff !important; color: #000 !important; font-family: 'Times New Roman', serif; font-size: 10pt; }
  .sidebar, .main-content > .page-header .btn-primary, .btn-export, .btn-logout,
  .sidebar-export, nav, form button, .btn-ghost, .modal-overlay, #rechazoModal, #gdriveModal { display: none !important; }
  .main-content { margin: 0; padding: 0; max-width: 100%; }

  .print-matrix-header { text-align: center; margin-bottom: 20pt; }
  .print-matrix-header h1 { font-size: 14pt; font-weight: bold; }
  .print-matrix-header p  { font-size: 10pt; margin: 2pt 0; }

  .print-dimension { page-break-before: always; }
  .print-dimension:first-child { page-break-before: avoid; }
  .print-dim-title { font-size: 13pt; font-weight: bold; background: #1e3a5f; color: #fff !important; padding: 6pt 10pt; margin-bottom: 8pt; }

  .print-criterio { margin-bottom: 12pt; border: 1px solid #ccc; padding: 8pt; }
  .print-criterio-header { font-weight: bold; font-size: 10pt; margin-bottom: 4pt; }
  .print-nivel-row { display: flex; gap: 20pt; font-size: 9pt; margin-bottom: 4pt; }
  .print-text-block { font-size: 9pt; margin-bottom: 4pt; }
  .print-text-block strong { display: block; }

  .print-ind-table { width: 100%; border-collapse: collapse; font-size: 8pt; margin-top: 6pt; }
  .print-ind-table th { background: #374151; color: #fff !important; padding: 3pt 5pt; text-align: left; }
  .print-ind-table td { border: 1px solid #ccc; padding: 3pt 5pt; vertical-align: top; }
  .print-ind-table tr:nth-child(even) td { background: #f9fafb; }

  .nivel-A { background: #dcfce7 !important; }
  .nivel-B { background: #dbeafe !important; }
  .nivel-C { background: #fef9c3 !important; }
  .nivel-D { background: #fee2e2 !important; }

  .print-dim-cierre { border: 1px solid #ccc; padding: 6pt; margin-top: 8pt; font-size: 9pt; }
  .print-dim-cierre .cierre-seccion { font-weight: bold; margin-top: 4pt; }
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  body { display: block; }

  .sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .sidebar-logo { padding: 12px 14px; }
  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    padding: 12px;
  }
  .nav-item {
    margin-bottom: 0;
    min-height: 36px;
    background: #1e293b;
    border: 1px solid #334155;
  }
  .nav-sep { display: none; }
  .sidebar-export {
    padding: 0 12px 12px;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .btn-export { flex: 1 1 180px; }

  .submatrix-selector {
    margin: 0 12px 10px;
    border: 1px solid #334155;
    border-radius: 8px;
  }
  .submatrix-tab {
    display: inline-flex;
    margin-right: 6px;
    margin-bottom: 6px;
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 14px;
  }
  .card {
    padding: 16px;
    overflow-x: auto;
  }
  .card-table { overflow-x: auto; }
  .data-table, .sintesis-table {
    min-width: 640px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .stats-row, .stats-row.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .page-title { font-size: 19px; }
  .page-sub { font-size: 12px; }
  .stats-row, .stats-row.five { grid-template-columns: 1fr; }
  .form-group { min-width: 100%; }
  .form-row { gap: 10px; }
  .modal-box { width: 100%; max-width: 100%; padding: 16px; }
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-actions .btn-primary,
  .modal-actions .btn-ghost,
  .modal-actions .btn-danger,
  .modal-actions .btn-warn {
    width: 100%;
    justify-content: center;
  }
  .evid-header,
  .resp-ev-top,
  .cal-ev-top,
  .overview-proceso-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
