/* ============================================================
   Sistema de Control Interno · Sales del Valle
   Paleta: Azul marino profundo, azul claro, blanco — institucional
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --navy:           #0B1F42;
  --navy-mid:       #0F2D5E;
  --navy-light:     #17408A;
  --blue:           #1A5FBE;
  --blue-hover:     #1450A8;
  --blue-pale:      #EBF4FF;
  --blue-border:    #B8D9F8;
  --white:          #FFFFFF;
  --gray-50:        #F8FAFC;
  --gray-100:       #F1F5F9;
  --gray-200:       #E2E8F0;
  --gray-300:       #CBD5E1;
  --gray-400:       #94A3B8;
  --gray-500:       #64748B;
  --gray-600:       #475569;
  --gray-700:       #334155;
  --gray-800:       #1E293B;
  --gray-900:       #0F172A;
  --critica:        #DC2626;
  --critica-bg:     #FEF2F2;
  --critica-border: #FECACA;
  --prioritaria:        #D97706;
  --prioritaria-bg:     #FFFBEB;
  --prioritaria-border: #FDE68A;
  --moderada:        #B45309;
  --moderada-bg:     #FEFCE8;
  --moderada-border: #FEF08A;
  --programable:        #16A34A;
  --programable-bg:     #F0FDF4;
  --programable-border: #BBF7D0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- NAVBAR ---- */
.navbar {
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 72px;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 4px 20px rgba(0,0,0,.4);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  color: white;
  white-space: nowrap;
  text-transform: uppercase;
  padding-right: 16px;
  border-right: 1px solid rgba(255,255,255,.1);
}
.nav-brand-logo {
  height: 30px;
  object-fit: contain;
  background: rgba(255,255,255,.92);
  border-radius: 6px;
  padding: 3px 8px;
}
.nav-brand-divider { color: rgba(255,255,255,.2); margin: 0 4px; }
.nav-links { display: flex; gap: 1px; flex: 1; align-items: center; }
.nav-link {
  color: rgba(255,255,255,.6);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
  letter-spacing: .1px;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: white; text-decoration: none; }
.nav-link.active {
  background: rgba(255,255,255,.12);
  color: white;
  font-weight: 600;
}
.nav-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.28);
  padding: 0 6px;
  user-select: none;
}
.nav-divider { width: 1px; height: 24px; background: rgba(255,255,255,.12); margin: 0 6px; }
.nav-user { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-email { color: rgba(255,255,255,.45); font-size: 11.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-role-badge { padding: 2px 8px; border-radius: 9999px; font-size: 10.5px; font-weight: 700; letter-spacing: .3px; }
.badge-admin    { background: #F59E0B; color: #451a03; }
.badge-director { background: #3B82F6; color: #fff; }
.badge-lector   { background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.55);
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-logout:hover { background: rgba(255,255,255,.08); color: white; border-color: rgba(255,255,255,.35); }

/* ---- LAYOUT ---- */
.page-container { max-width: 1200px; margin: 0 auto; padding: 28px 24px; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header-left {}
.page-title { font-size: 22px; font-weight: 700; color: var(--navy); line-height: 1.2; margin-bottom: 3px; }
.page-subtitle { color: var(--gray-500); font-size: 13px; }

/* ---- CARDS ---- */
.card { background: white; border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--gray-50);
}
.card-title { font-weight: 600; color: var(--gray-700); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 20px; }

/* ---- STATS GRID ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--gray-300);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card.stat-navy    { border-left-color: var(--navy); }
.stat-card.stat-blue    { border-left-color: var(--blue); }
.stat-card.stat-critica { border-left-color: var(--critica); }
.stat-card.stat-prioritaria { border-left-color: var(--prioritaria); }
.stat-card.stat-ok      { border-left-color: var(--programable); }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gray-500); margin-bottom: 6px; }
.stat-value { font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 4px; }
.stat-sub { font-size: 11px; color: var(--gray-400); }

/* ---- TWO-COL GRID ---- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; border-radius: 0 0 10px 10px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--blue-pale); }
.td-id { font-weight: 700; color: var(--navy); font-family: monospace; font-size: 12px; }
.td-seg { font-size: 11px; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.td-pts { font-weight: 700; font-size: 15px; color: var(--navy); text-align: center; }

/* Row tinting by classification */
tr.row-critica    td { background: #fff5f5; }
tr.row-prioritaria td { background: #fffcf0; }
tr.row-moderada   td { background: #fefff0; }
tr.row-critica:hover    td { background: #fee2e2; }
tr.row-prioritaria:hover td { background: #fef9c3; }
tr.row-moderada:hover   td { background: #fef9c3; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge-critica    { background: var(--critica-bg);    color: var(--critica);    border: 1px solid var(--critica-border); }
.badge-prioritaria{ background: var(--prioritaria-bg);color: var(--prioritaria);border: 1px solid var(--prioritaria-border); }
.badge-moderada   { background: var(--moderada-bg);   color: var(--moderada);   border: 1px solid var(--moderada-border); }
.badge-programable{ background: var(--programable-bg);color: var(--programable);border: 1px solid var(--programable-border); }
.badge-programada { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.badge-en_curso   { background: #FFF7ED; color: #C2410C; border: 1px solid #FED7AA; }
.badge-completada { background: var(--programable-bg);color: #15803D; border: 1px solid var(--programable-border); }
.badge-cancelada  { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-300); }
.badge-pendiente  { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-300); }
.badge-respondido { background: var(--programable-bg);color: #15803D; border: 1px solid var(--programable-border); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--blue); color: white; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-secondary { background: white; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-navy      { background: var(--navy); color: white; }
.btn-navy:hover{ background: var(--navy-mid); }
.btn-danger    { background: var(--critica-bg); color: var(--critica); border-color: var(--critica-border); }
.btn-danger:hover { background: #fee2e2; }
.btn-sm  { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs  { padding: 2px 8px; font-size: 11px; border-radius: 5px; }
.btn-icon { padding: 5px; border-radius: 6px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-900);
  background: white;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 99 235 / .1); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
}
.login-panel-brand {
  width: 42%;
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}
.login-panel-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(26,95,190,.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(23,64,138,.4) 0%, transparent 60%);
}
.login-panel-brand-content { position: relative; z-index: 1; text-align: center; }
.login-brand-logo-sdv {
  height: 80px;
  object-fit: contain;
  background: rgba(255,255,255,.95);
  border-radius: 12px;
  padding: 8px 16px;
  margin-bottom: 32px;
}
.login-brand-title {
  font-size: 20px;
  font-weight: 800;
  color: white;
  letter-spacing: -.2px;
  line-height: 1.2;
  margin-bottom: 8px;
}
.login-brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  line-height: 1.6;
  max-width: 220px;
  margin: 0 auto 48px;
}
.login-brand-divider {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,.15);
  margin: 0 auto 36px;
  border-radius: 2px;
}
.login-brand-bga {
  height: 26px;
  object-fit: contain;
  background: rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 3px 10px;
  opacity: .7;
}
.login-panel-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: white;
}
.login-form-inner {
  width: 100%;
  max-width: 360px;
}
.login-form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -.4px;
  margin-bottom: 6px;
}
.login-form-sub {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 36px;
  line-height: 1.5;
}
.login-divider { display: none; }
.login-error {
  background: var(--critica-bg);
  border: 1px solid var(--critica-border);
  color: var(--critica);
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
@media (max-width: 768px) {
  .login-page { flex-direction: column; }
  .login-panel-brand { width: 100%; min-height: auto; padding: 36px 24px; flex-direction: row; gap: 20px; justify-content: flex-start; }
  .login-panel-brand-content { text-align: left; display: flex; align-items: center; gap: 16px; }
  .login-brand-logo-sdv { height: 48px; margin-bottom: 0; }
  .login-brand-title { font-size: 16px; }
  .login-brand-sub, .login-brand-divider, .login-brand-bga { display: none; }
  .login-panel-form { padding: 32px 24px; }
}

/* ---- MEETING CARDS ---- */
.reunion-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.reunion-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue-border); }
.reunion-num {
  min-width: 40px; height: 40px;
  background: var(--navy);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
}
.reunion-info { flex: 1; min-width: 0; }
.reunion-title { font-weight: 600; color: var(--gray-900); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reunion-meta { font-size: 12px; color: var(--gray-500); display: flex; gap: 12px; flex-wrap: wrap; }
.reunion-meta span { display: flex; align-items: center; gap: 4px; }

/* ---- AGENDA ITEMS ---- */
.agenda-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: white;
  transition: border-color .15s;
}
.agenda-item:hover { border-color: var(--blue-border); }
.agenda-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.agenda-num {
  min-width: 22px; height: 22px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.agenda-cat { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); background: var(--gray-100); padding: 1px 7px; border-radius: 9999px; margin-top: 3px; }
.agenda-pregunta { font-weight: 500; color: var(--gray-900); flex: 1; }
.agenda-respuesta {
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  border-radius: 6px;
  padding: 10px 13px;
  font-size: 13px;
  color: var(--gray-700);
  margin-top: 8px;
}
.agenda-pendiente { font-size: 13px; color: var(--gray-400); font-style: italic; margin-top: 6px; }
.agenda-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.agenda-meta-info { font-size: 11px; color: var(--gray-400); display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- FILES ---- */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 8px;
  background: white;
  transition: border-color .15s;
}
.file-item:hover { border-color: var(--blue-border); }
.file-icon { font-size: 22px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 500; font-size: 13px; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 11px; color: var(--gray-400); }
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  color: var(--gray-400);
  font-size: 13px;
}
.upload-area:hover { border-color: var(--blue); background: var(--blue-pale); color: var(--blue); }
.upload-area input[type="file"] { display: none; }

/* ---- PARTICIPANTS ---- */
.participant-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.participant-row:last-child { border-bottom: none; }
.participant-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.participant-info { flex: 1; min-width: 0; }
.participant-name { font-weight: 500; font-size: 13px; color: var(--gray-900); }
.participant-area { font-size: 11px; color: var(--gray-400); }
.asistencia-btn {
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  transition: all .15s;
}
.asistencia-presente { background: var(--programable-bg); color: #15803D; border-color: var(--programable-border); }
.asistencia-ausente  { background: var(--critica-bg); color: var(--critica); border-color: var(--critica-border); }
.asistencia-null     { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-300); }

/* ---- FILTERS ---- */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-select {
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-700);
  background: white;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.filter-select:focus { border-color: var(--blue); }
.filter-input {
  padding: 6px 11px;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-900);
  outline: none;
  font-family: inherit;
  min-width: 200px;
}
.filter-input:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgb(37 99 235 / .1); }

/* ---- INFO ROWS (detail view) ---- */
.info-row { display: flex; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.info-label { font-weight: 600; color: var(--gray-500); min-width: 130px; flex-shrink: 0; }
.info-value { color: var(--gray-900); }

/* ---- DEVIATION DETAIL ---- */
.dev-header { background: var(--navy); color: white; padding: 16px 20px; border-radius: 10px 10px 0 0; }
.dev-id   { font-size: 13px; opacity: .7; margin-bottom: 4px; font-family: monospace; }
.dev-titulo { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.dev-seg  { font-size: 12px; opacity: .7; }
.criteria-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.crit-box { text-align: center; padding: 8px; border-radius: 8px; }
.crit-box.crit-a { background: #FEF2F2; border: 1px solid #FECACA; }
.crit-box.crit-b { background: #FFFBEB; border: 1px solid #FDE68A; }
.crit-box.crit-c { background: var(--gray-100); border: 1px solid var(--gray-300); }
.crit-label { font-size: 10px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; }
.crit-val   { font-size: 20px; font-weight: 800; color: var(--navy); }
.crit-pts   { font-size: 10px; color: var(--gray-400); }

/* ---- TABS ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--gray-700); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / .5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.96);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-weight: 700; font-size: 15px; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--gray-400); line-height: 1; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- ALERTS / NOTICES ---- */
.alert { padding: 12px 15px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid; }
.alert-info    { background: var(--blue-pale); border-color: var(--blue-border); color: #1E40AF; }
.alert-success { background: var(--programable-bg); border-color: var(--programable-border); color: #14532D; }
.alert-warning { background: var(--prioritaria-bg); border-color: var(--prioritaria-border); color: #92400E; }
.alert-error   { background: var(--critica-bg); border-color: var(--critica-border); color: #7F1D1D; }

/* ---- TOAST NOTIFICATIONS ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
  transition: all .25s;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--navy); color: white; }
.toast-error   { background: var(--critica); color: white; }

/* ---- LOADING & EMPTY ---- */
.loading { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-icon  { font-size: 36px; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--gray-600); margin-bottom: 5px; }
.empty-sub   { font-size: 13px; color: var(--gray-400); }

/* ---- SECTION TITLES ---- */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

/* ---- DYNAMIC FORM SECTION (agenda items, participants) ---- */
.dynamic-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 10px;
  background: var(--gray-50);
  position: relative;
}
.dynamic-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dynamic-item-num { font-weight: 700; color: var(--navy); font-size: 13px; }
.btn-remove { background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.btn-remove:hover { background: var(--critica-bg); color: var(--critica); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .page-container { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .nav-email { display: none; }
  .criteria-grid { grid-template-columns: repeat(2, 1fr); }
  .card-body { padding: 14px; }
}

/* ============================================================
   MÓDULO CONTROL INTERNO · Estilos adicionales
   ============================================================ */

/* ---- VARIABLES CI ---- */
:root {
  --ci-teal:        #0D9488;
  --ci-teal-mid:    #0F766E;
  --ci-teal-light:  #F0FDFA;
  --ci-teal-border: #99F6E4;

  --dir-dg:         #7C3AED;
  --dir-dg-light:   #F5F3FF;
  --dir-dg-border:  #DDD6FE;
  --dir-dc:         #0891B2;
  --dir-dc-light:   #ECFEFF;
  --dir-dc-border:  #A5F3FC;
  --dir-daf:        #059669;
  --dir-daf-light:  #ECFDF5;
  --dir-daf-border: #A7F3D0;
  --dir-do:         #D97706;
  --dir-do-light:   #FFFBEB;
  --dir-do-border:  #FDE68A;
}

/* ---- DIRECTOR ROLE BADGE ---- */
.badge-director { background: #FDE68A; color: #78350F; }

/* ---- CI STATUS BADGES ---- */
.badge-ci-cerrado    { background:#F0FDF4; color:#16A34A; border:1px solid #BBF7D0; }
.badge-ci-por_vencer { background:#EFF6FF; color:#1D4ED8; border:1px solid #BFDBFE; }
.badge-ci-vencido    { background:#FEF2F2; color:#DC2626; border:1px solid #FECACA; }
.badge-ci-sin_fecha  { background:#F8FAFC; color:#64748B; border:1px solid #CBD5E1; }

/* ---- CI AVANCE BADGES ---- */
.badge-ci-concluido { background:#F0FDF4; color:#15803D; border:1px solid #BBF7D0; }
.badge-ci-entregado { background:#F0FDFA; color:#0D9488; border:1px solid #99F6E4; }
.badge-ci-sin_plan  { background:#FFF7ED; color:#C2410C; border:1px solid #FED7AA; }

/* ---- SEVERIDAD BADGES ---- */
.badge-ci-alto  { background:#FEF2F2; color:#DC2626; border:1px solid #FECACA; }
.badge-ci-medio { background:#FFF7ED; color:#D97706; border:1px solid #FED7AA; }
.badge-ci-bajo  { background:#FEFCE8; color:#A16207; border:1px solid #FEF08A; }

/* ---- KPI GRID CI (5 cols) ---- */
.ci-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .ci-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .ci-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.ci-kpi-card {
  background: white;
  border-radius: 12px;
  padding: 18px 16px 14px;
  border-left: 4px solid var(--gray-300);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  transition: box-shadow .2s, transform .15s;
}
.ci-kpi-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.1); transform: translateY(-1px); }
.ci-kpi-num   { font-size: 34px; font-weight: 800; color: var(--gray-900); line-height: 1; margin-bottom: 5px; letter-spacing: -1px; }
.ci-kpi-label { font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.ci-kpi-sub   { font-size: 11px; color: var(--gray-400); }
.ci-kpi-cerrado    { border-color: #16A34A; }
.ci-kpi-vencido    { border-color: #DC2626; }
.ci-kpi-por_vencer { border-color: #1D4ED8; }
.ci-kpi-sin_fecha  { border-color: #94A3B8; }
.ci-kpi-total      { border-color: var(--navy); }

/* ---- DIRECTION CARDS (2×2 grid) ---- */
.dir-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px)  { .dir-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .dir-cards-grid { grid-template-columns: 1fr; } }

.dir-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  border: 1px solid var(--gray-200);
  transition: box-shadow .2s;
  cursor: pointer;
}
.dir-card:hover { box-shadow: var(--shadow-md); }

.dir-card-header {
  padding: 14px 16px 12px;
  color: white;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.dir-card-id    { font-size: 22px; font-weight: 900; opacity: .3; letter-spacing: -1px; }
.dir-card-name  { font-size: 12px; font-weight: 700; line-height: 1.3; }
.dir-card-total { font-size: 32px; font-weight: 900; line-height: 1; }

.dir-card-body  { padding: 14px 16px; }
.dir-stat-row   { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: 12px; color: var(--gray-600); border-bottom: 1px solid var(--gray-100); }
.dir-stat-row:last-child { border-bottom: none; }
.dir-stat-val   { font-weight: 700; }

.dir-progress   { margin: 10px 0 4px; background: var(--gray-200); border-radius: 9999px; height: 6px; overflow: hidden; }
.dir-progress-bar { height: 100%; transition: width .5s; }

/* ---- HALLAZGO TABLE ROWS ---- */
.hallazgo-row { cursor: pointer; }
.hallazgo-row:hover td { background: #FAFFFE !important; }

.dias-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.dias-positivo { background: #EFF6FF; color: #1D4ED8; }
.dias-negativo { background: #FEF2F2; color: #DC2626; }
.dias-cero     { background: #FFF7ED; color: #D97706; }
.dias-na       { color: var(--gray-300); }

/* ---- VENCIDOS ALERT LIST ---- */
.vencido-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-left: 3px solid #DC2626;
  background: #FEF2F2;
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
}
.vencido-dias {
  min-width: 44px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  color: #DC2626;
  line-height: 1;
}
.vencido-sub { font-size: 10px; color: #F87171; font-weight: 600; text-transform: uppercase; }

/* ---- DIRECTOR PAGE HERO ---- */
.director-hero {
  border-radius: 12px;
  padding: 24px 28px;
  color: white;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.director-hero::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.director-hero-id    { font-size: 48px; font-weight: 900; opacity: .15; position: absolute; right: 24px; bottom: 10px; letter-spacing: -3px; }
.director-hero-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; opacity: .6; margin-bottom: 4px; }
.director-hero-title { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.director-hero-sub   { font-size: 13px; opacity: .7; }

/* ---- RESPONDER CARD (director view) ---- */
.responder-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-left: 4px solid #D97706;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: box-shadow .15s;
}
.responder-card:hover { box-shadow: var(--shadow-md); }
.responder-card.respondido { border-left-color: var(--ci-teal); }
.responder-card.cerrado    { border-left-color: #16A34A; }

/* ---- CI PROGRESS BANNER ---- */
.ci-progress-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #1A4A9B 100%);
  border-radius: 12px;
  padding: 18px 24px;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(13,38,84,.2);
}
.ci-progress-bar-track {
  background: rgba(255,255,255,.15);
  border-radius: 9999px;
  height: 12px;
  overflow: hidden;
  margin: 12px 0 8px;
}
.ci-progress-bar-fill { height: 100%; border-radius: 9999px; transition: width .6s; }

/* ---- TABLE: dir chip inline ---- */
.dir-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  white-space: nowrap;
}

/* ---- ÁREA SECTION (director grouped) ---- */
.area-section { margin-bottom: 24px; }
.area-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---- OTHER DIRS SUMMARY (director page) ---- */
.other-dirs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 700px) { .other-dirs-grid { grid-template-columns: 1fr; } }

.other-dir-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 12px 14px;
  border-left: 4px solid var(--gray-300);
}

/* ── KPI card variants ──────────────────────────── */
.ci-kpi-success { border-left: 4px solid #059669; }
.ci-kpi-danger  { border-left: 4px solid #DC2626; background: #FFF5F5; }
.ci-kpi-warning { border-left: 4px solid #D97706; background: #FFFBEB; }

/* ── Loading skeleton ────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}
.loading-skeleton {
  background: var(--gray-200);
  border-radius: 12px;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

/* ── Error state ─────────────────────────────────── */
.ci-error-banner {
  background: #FFF5F5;
  border: 1px solid #FECACA;
  border-radius: 10px;
  padding: 20px 24px;
  color: #991B1B;
  font-size: 13px;
  line-height: 1.6;
}

