:root {
  --navy: #071d63;
  --navy-2: #0c2f89;
  --yellow: #ffd500;
  --red: #e31b2d;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e8f0;
  --surface: #ffffff;
  --canvas: #f4f6fb;
  --success: #16804b;
  --danger: #b42318;
  --shadow: 0 14px 40px rgba(7, 29, 99, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
.is-hidden { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.app-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .22s ease; }
.sidebar { position: sticky; top: 0; width: 268px; height: 100vh; display: flex; flex-direction: column; overflow: hidden; color: white; background: linear-gradient(180deg, #06174f 0%, #0b2d87 72%, #071b5b 100%); box-shadow: 8px 0 30px rgba(7, 29, 99, .14); z-index: 120; transition: width .22s ease, transform .22s ease, box-shadow .22s ease; }
.app-shell.is-sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.app-shell.is-sidebar-collapsed .sidebar { width: 0; box-shadow: none; }
.sidebar-brand { display: flex; gap: 13px; align-items: center; padding: 23px 20px 21px; color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.13); }
.sidebar-brand img { flex: 0 0 auto; width: 50px; height: 58px; object-fit: contain; }
.sidebar-brand-copy { min-width: 158px; display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 17px; }
.sidebar-brand small { color: #d9e3ff; font-size: 12px; }
.sidebar-nav { padding: 18px 12px; display: grid; gap: 5px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; min-width: 244px; min-height: 46px; padding: 9px 12px; border-radius: 11px; color: #e6ebff; text-decoration: none; font-weight: 650; }
.nav-item .nav-icon { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--navy); background: rgba(255,255,255,.9); font-size: 13px; font-weight: 900; }
.nav-item .nav-label { white-space: nowrap; }
.nav-item:hover { background: rgba(255,255,255,.09); }
.nav-item.is-active { color: #07164b; background: var(--yellow); }
.nav-item.is-active .nav-icon { background: var(--navy); color: white; }
.sidebar-user { margin-top: auto; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; padding: 17px; border-top: 1px solid rgba(255,255,255,.13); }
.sidebar-user .avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: var(--navy); font-weight: 900; }
.sidebar-user-copy { display: grid; min-width: 0; }
.sidebar-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sidebar-user small { color: #cdd8fa; font-size: 11px; }
.sidebar-logout { color: white; font-size: 12px; }
.sidebar-backdrop { display: none; }

.app-main { min-width: 0; display: flex; min-height: 100vh; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 90; min-height: 88px; display: flex; align-items: center; gap: 18px; padding: 15px clamp(20px, 4vw, 48px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: 0 8px 24px rgba(7,29,99,.045); backdrop-filter: blur(12px); }
.topbar p, .topbar h1 { margin: 0; }
.topbar p { color: var(--muted); font-size: 12px; }
.topbar h1 { color: var(--navy); font-size: clamp(21px, 2vw, 29px); }
.menu-toggle { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; padding: 0; border: 1px solid #d7deee; border-radius: 11px; color: var(--navy); background: white; cursor: pointer; font-size: 23px; line-height: 1; }
.menu-toggle:hover { background: #f1f4fb; border-color: #b8c5e2; }
.menu-toggle:focus-visible { outline: 3px solid rgba(12,47,137,.17); outline-offset: 2px; }
.database-status { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--success); font-size: 12px; font-weight: 750; }
.database-status i { width: 9px; height: 9px; border-radius: 50%; background: #24bb70; box-shadow: 0 0 0 4px #d9f7e8; }
.database-status.has-error { color: var(--danger); }
.content { width: min(1480px, 100%); margin: 0 auto; padding: 34px clamp(20px, 4vw, 48px) 50px; flex: 1; }
.footer { padding: 18px 35px; color: var(--muted); text-align: center; font-size: 12px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h2, .page-heading p { margin: 0; }
.page-heading h2 { color: var(--navy); font-size: 25px; }
.page-heading p { margin-top: 6px; color: var(--muted); }
.eyebrow { color: var(--navy-2); text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 850; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; padding: 22px; box-shadow: 0 5px 20px rgba(7,29,99,.045); }
.card h3 { margin: 0 0 7px; color: var(--navy); }
.card p { color: var(--muted); }
.stat { position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; width: 90px; height: 90px; right: -28px; top: -30px; border-radius: 50%; background: rgba(255,213,0,.22); }
.stat small { color: var(--muted); font-weight: 700; }
.stat strong { display: block; margin-top: 9px; color: var(--navy); font-size: 32px; }
.stat > span { position: relative; z-index: 1; display: block; max-width: 88%; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.stat-featured { color: white; border-color: var(--navy); background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.stat-featured::after { background: rgba(255,213,0,.3); }
.stat-featured small, .stat-featured > span { color: #dbe4ff; }
.stat-featured strong { color: var(--yellow); }
.module-card { display: grid; grid-template-columns: 58px 1fr; gap: 17px; align-items: center; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.module-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 16px; background: var(--navy); color: var(--yellow); font-size: 22px; font-weight: 900; }
.data-module-card .module-icon { font-size: 15px; letter-spacing: -.02em; }
.module-card p { margin: 6px 0 0; }
.module-last-run { display: block; width: fit-content; margin-top: 13px; padding: 6px 9px; border-radius: 8px; color: #40506b; background: #f0f3fa; font-size: 11px; }
.module-last-run b { color: var(--navy); }
.stat .stat-date { font-size: 21px; line-height: 1.2; }
.stat .stat-date small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.data-file-field { margin-top: 20px; padding: 18px; border: 1px dashed #9eacc8; border-radius: 12px; background: #f7f9fd; }
.data-file-field input { margin-top: 9px; padding: 8px; background: white; }
.data-rule-card { background: linear-gradient(145deg, #fff, #f7f9ff); }
.import-preview { margin-top: 18px; padding: 18px; border-radius: 12px; color: var(--muted); background: #eef2fa; }
.import-preview p { margin: 13px 0 0; }
.preview-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.preview-metrics span { padding: 10px; border-radius: 9px; color: #40506b; background: white; font-size: 12px; }
.preview-metrics b { display: block; color: var(--navy); font-size: 20px; }
.table-card-heading { padding: 20px 22px 12px; }
.table-card-heading h3, .table-card-heading p { margin: 0; }
.table-card-heading p { margin-top: 5px; color: var(--muted); }
.range-card { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 20px; border: 1px solid #cdd6e8; border-radius: 14px; background: #f7f9fd; }
.range-card > div { grid-column: 1 / -1; }
.range-card h3, .range-card p { margin: 0; }
.range-card p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.stored-source-status { padding: 14px 16px; border-radius: 11px; color: #0b633d; background: #e8f7ef; border: 1px solid #bce4ce; font-size: 13px; }
.stored-source-status.is-missing { color: #8b3a12; background: #fff4e8; border-color: #f3cfaa; }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; cursor: pointer; text-decoration: none; font-weight: 750; }
.button.primary { background: var(--navy); color: white; }
.button.secondary { background: white; color: var(--navy); border-color: #bac6e3; }
.button.danger { background: #fff1f0; color: var(--danger); border-color: #ffd0cc; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { min-width: min(360px, 100%); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-stack { display: grid; gap: 15px; }
label { display: grid; gap: 6px; color: #344054; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 450; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #ccd4e2; border-radius: 9px; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(12,47,137,.12); border-color: var(--navy-2); }
.filter-inline { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.filter-inline select { min-width: 145px; padding: 10px 34px 10px 11px; }
.check-label { display: flex; align-items: center; gap: 9px; }
.check-label input { width: 17px; min-height: auto; }

.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; }
.table-wrap tr[id] { scroll-margin-top: 18px; }
.table-wrap tr[id]:target td { background: #fff8c9; transition: background-color 1.4s ease; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f0f3fb; color: #344054; white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: #fbfcff; }
.status { display: inline-flex; align-items: center; border-radius: 20px; padding: 4px 8px; font-size: 11px; font-weight: 800; }
.status.active { background: #dcfae6; color: #087443; }
.status.inactive { background: #f2f4f7; color: #667085; }
.status.warning { background: #fff2cc; color: #7a5100; }
.status.danger { background: #ffe2e0; color: #9c1c14; }
.empty { padding: 35px; color: var(--muted); text-align: center; }

.alert { margin-bottom: 18px; padding: 13px 15px; border-radius: 10px; font-size: 13px; }
.alert-success { color: #086a3f; background: #e4f8ed; border: 1px solid #b5e8cc; }
.alert-error { color: #991b1b; background: #fff0ef; border: 1px solid #ffc9c5; }
.alert-warning { color: #7a5100; background: #fff7d9; border: 1px solid #f5df86; }

.geovictoria-heading { align-items: center; }
.gv-automatic-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 20px; border-color: #b9dcca; background: linear-gradient(135deg, #f7fffa, #eef8f3); }
.gv-automatic-card h3, .gv-automatic-card p { margin: 0; }
.gv-automatic-card p:last-child { margin-top: 5px; }
.gv-automatic-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--success); font-size: 23px; font-weight: 900; box-shadow: 0 8px 20px rgba(22,128,75,.18); }
.gv-loading-card { display: flex; align-items: center; gap: 14px; color: #40506b; }
.gv-loading-card p { margin: 3px 0 0; font-size: 12px; }
.gv-loading-dot { width: 14px; height: 14px; flex: 0 0 auto; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 7px rgba(255,213,0,.22); animation: gvPulse 1.1s ease-in-out infinite alternate; }
@keyframes gvPulse { to { transform: scale(.78); opacity: .55; } }
.geovictoria-source-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.geovictoria-setup > .card { min-width: 0; }
.gv-upload-card > p, .gv-period-card > p { margin: 6px 0 0; }
.gv-upload-card .data-file-field { margin-top: 18px; }
.gv-upload-card .toolbar, .gv-period-card .toolbar { margin-top: 16px; }
.gv-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.gv-calendar-note { display: grid; gap: 4px; margin-top: 17px; padding: 14px; border: 1px solid #cbd7ef; border-radius: 11px; color: #40506b; background: #f4f7fd; font-size: 12px; }
.gv-calendar-note strong { color: var(--navy); font-size: 13px; }
.gv-calendar-note a { width: fit-content; margin-top: 3px; color: var(--navy-2); font-weight: 800; }
.gv-limit-form { display: grid; grid-template-columns: minmax(150px, 1fr) auto; align-items: end; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.gv-limit-form small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.gv-alert { display: grid; gap: 6px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #efc44c; border-left: 5px solid #dc8c00; border-radius: 12px; color: #6f4700; background: #fff7d8; font-size: 13px; }
.gv-alert span { line-height: 1.5; }
.gv-result-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gv-report-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.gv-report-heading label { width: min(320px, 100%); }
.segment-tabs { display: flex; gap: 8px; margin-top: 14px; }
.segment-tab { border: 1px solid #cbd7ef; border-radius: 10px; padding: 9px 13px; color: var(--navy); background: #f4f7fd; font: inherit; font-weight: 800; cursor: pointer; }
.segment-tab b { display: inline-grid; min-width: 24px; margin-left: 5px; padding: 2px 5px; place-items: center; border-radius: 99px; background: #e2e8f6; font-size: 11px; }
.segment-tab.is-active { color: white; border-color: var(--navy); background: var(--navy); }
.segment-tab.is-active b { color: var(--navy); background: var(--yellow); }
.gv-report-table td:first-child { min-width: 260px; }
.gv-report-table td:first-child small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.gv-percent { display: inline-flex; min-width: 67px; justify-content: center; padding: 5px 8px; border-radius: 8px; }
.gv-percent.is-high { color: #087443; background: #dcfae6; }
.gv-percent.is-medium { color: #7a5100; background: #fff2cc; }
.gv-percent.is-low { color: #9c1c14; background: #ffe2e0; }
.gv-download-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr); gap: 26px; align-items: center; }
.gv-download-card p { margin: 5px 0 0; }
.gv-download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gv-legend h3 { margin-bottom: 14px; }
.gv-legend > div { display: flex; flex-wrap: wrap; gap: 9px; }
.gv-legend span { padding: 8px 10px; border-radius: 9px; color: #40506b; background: #f2f5fb; font-size: 12px; }
.gv-legend b { color: var(--navy); }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at top right, #163ba0, #06174f 55%, #030c2c); }
.auth-card { width: min(440px, 100%); padding: 34px; border-radius: 22px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.auth-card > img { display: block; width: 105px; height: 120px; object-fit: contain; margin: -5px auto 15px; }
.auth-card h1, .auth-card p { text-align: center; }
.auth-card h1 { margin: 4px 0 8px; color: var(--navy); }
.auth-card .form-stack { margin-top: 22px; }
.install-card { width: min(560px, 100%); }
.dashboard-modules .module-card { display: block; }
.dashboard-modules .module-card > span { display: inline-block; margin-top: 14px; color: var(--navy-2); font-weight: 900; }
.personnel-table input[type="date"], .personnel-table select { min-width: 145px; }
.personnel-sep-table td { vertical-align: top; }
.personnel-sep-table input, .personnel-sep-table select { min-width: 160px; margin-bottom: 6px; }
.personnel-sep-table .date-pair { display: flex; gap: 6px; }
.personnel-sep-table .date-pair input { min-width: 132px; }
.sep-rules { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-left: 5px solid var(--yellow); }
.sep-rules h3 { margin: 3px 0 7px; color: var(--navy); }
.sep-rules p { margin: 0; max-width: 930px; color: var(--muted); }
.sep-table th, .sep-table td { white-space: nowrap; }
.sep-tier, .sep-pending, .sep-state { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.sep-tier { color: #075f3c; background: #dff5e8; }
.sep-tier.tier-no-accede, .sep-pending { color: #9c2b23; background: #ffe4e0; }
.sep-amount { color: #087443; font-size: 15px; }
.sep-zero { color: #9c2b23; }
.sep-state { cursor: help; }
.sep-state-accede { color: #075f3c; background: #dff5e8; }
.sep-state-no-accede { color: #9c2b23; background: #ffe4e0; }
.sep-state-pago-suspendido { color: #8a1610; background: #ffd9d4; }
.sep-state-pendiente { color: #5b6b8c; background: #e8eefb; }
.sep-state-sin-periodo-evaluable { color: #5b6b8c; background: #e8eefb; }
.sep-state-revision-administrativa { color: #8a5200; background: #fff4dc; }
.sep-participation { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 11px; font-weight: 800; color: var(--muted); }
.sep-participation-participa { color: #075f3c; }
.sep-participation-renuncia { color: #9c2b23; }
.sep-participation-obligado { color: #4b5563; }
.sep-participation-pendiente { color: #5b6b8c; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.badge-nueva, .badge-actualizar { color: #075f3c; background: #dff5e8; }
.badge-sin-cambios, .badge-sin-datos, .badge-sin-cambios { color: #5b6b8c; background: #e8eefb; }
.badge-conflicto, .badge-pauta-incompatible, .badge-persona-no-encontrada { color: #9c2b23; background: #ffe4e0; }
.badge-consolidar { color: #075f3c; background: #dff5e8; }
.badge-active { color: #075f3c; background: #dff5e8; }
.badge-inactive { color: #5b6b8c; background: #e8eefb; }
.sep-table td small { display: block; margin-top: 4px; white-space: normal; max-width: 240px; color: var(--muted); font-weight: 600; }
/* Aviso de causal por licencias: es una advertencia para la Comisión, no una
   exclusión aplicada, así que se distingue del rojo de "No accede". */
.sep-table td small.sep-review { display: block; margin-top: 4px; white-space: normal; max-width: 260px; color: #8a5200; background: #fff4dc; border-radius: 8px; padding: 5px 8px; font-weight: 700; cursor: help; }
.inline-check { display: inline-flex; flex-direction: row; align-items: center; gap: 7px; white-space: nowrap; }
.inline-check input { width: auto; }
/* Checkbox/radio dentro de etiquetas inline: tamaño fijo normal. Sin esto
   heredan el min-height:42px y min-width de los inputs de texto y se ven
   gigantes (p. ej. "Proporcional 44 h" en personal.php). Solo afecta a
   checkbox/radio dentro de .inline-check; el resto de formularios intacto. */
.inline-check input[type="checkbox"], .inline-check input[type="radio"] { flex: 0 0 20px; width: 20px; height: 20px; min-width: 20px; max-width: 20px; min-height: 20px; max-height: 20px; margin: 0; padding: 0; box-sizing: border-box; cursor: pointer; }
.inline-check.multiline-check { white-space: normal; align-items: flex-start; }
.inline-check.multiline-check small { display: block; color: var(--muted); font-weight: 600; }
.monthly-controls { display: grid; grid-template-columns: minmax(250px,1.2fr) minmax(170px,.55fr) minmax(220px,.8fr) auto auto; gap: 16px; align-items: end; }
.monthly-controls .segment-tabs { margin-top: 7px; }
.monthly-only-missing { align-self: center; margin-top: 22px; }
.monthly-table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; overflow-y: auto; border-top: 1px solid var(--line); }
.monthly-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.monthly-table th, .monthly-table td { min-width: 0; width: auto; height: 35px; padding: 4px 1px; border-right: 1px solid #c9d2e4; border-bottom: 1px solid #c9d2e4; text-align: center; font-size: clamp(7px,.55vw,10px); overflow: hidden; }
.monthly-table thead th { position: sticky; top: 0; z-index: 4; color: #fff; background: var(--navy); }
.monthly-table thead tr:nth-child(2) th { top: 37px; }
.monthly-table .month-index { position: sticky; left: 0; z-index: 3; width: 32px; background: #f5f7fc; }
.monthly-table .month-person { position: sticky; left: 32px; z-index: 3; width: clamp(170px,15vw,245px); padding: 4px 7px; text-align: left; background: #fff; box-shadow: 3px 0 7px rgba(14,31,72,.08); white-space: normal; overflow-wrap: anywhere; line-height: 1.12; }
.monthly-table thead .month-index, .monthly-table thead .month-person { z-index: 7; color: #fff; background: var(--navy); }
.monthly-table .month-person strong { display: block; font-size: clamp(8px,.63vw,11px); }
.monthly-table .month-person small { display: block; margin-top: 2px; color: var(--muted); font-size: clamp(7px,.52vw,9px); }
.monthly-table .month-day-head.is-weekend { color: #34415a; background: #b8cce4; }
.monthly-table .month-day { font-weight: 900; }
.monthly-table .is-present { color: #087443; background: #e6f7ed; }
.monthly-table .is-missing { color: #991b1b; background: #ffc9c5; }
.monthly-table .is-medical { color: #765000; background: #fff0ae; }
.monthly-table .is-protected { color: #552b78; background: #eadcf8; font-size: 9px; }
.monthly-table .is-strike { color: #8f1717; background: #f4cccc; }
.monthly-table .is-administrative, .monthly-table .is-admin { color: #16633e; background: #d9ead3; }
.monthly-table .is-director, .monthly-table .is-regulated { color: #25457f; background: #d9e6f7; }
.monthly-table .is-training { color: #075a68; background: #d9f1f3; }
.monthly-table .is-unpaid, .monthly-table .is-birthday, .monthly-table .is-bereavement, .monthly-table .is-force-majeure, .monthly-table .is-compensatory, .monthly-table .is-commission, .monthly-table .is-union, .monthly-table .is-preventive, .monthly-table .is-investigation { color: #4c3975; background: #ebe5f5; font-size: 9px; }
.monthly-table .is-suspension, .monthly-table .is-weekend, .monthly-table .is-inactive { color: #687388; background: #e7e6e6; }
.monthly-table .is-no-shift { color: #38506f; background: #dfe8f3; font-size: 8px; }
.monthly-table .is-nodata { color: #6d7585; background: #eef1f6; font-size: 9px; }
.monthly-table tr.is-no-month-data .month-person { background: #f7f8fb; }
.monthly-table .month-total, .monthly-table .month-summary-head { width: clamp(34px,3.2vw,54px); font-weight: 900; }
.monthly-hover-tooltip { position: fixed; z-index: 1000; max-width: min(360px,calc(100vw - 20px)); padding: 9px 12px; border: 1px solid rgba(255,213,0,.75); border-radius: 9px; color: #fff; background: #001b63; box-shadow: 0 10px 28px rgba(0,27,99,.24); font-size: 12px; font-weight: 750; line-height: 1.35; white-space: pre-line; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s ease,transform .12s ease; }
.monthly-hover-tooltip.is-visible { opacity: 1; transform: translateY(0); }
.monthly-legend > div { display: flex; flex-wrap: wrap; gap: 9px; }
.month-code { display: inline-flex; padding: 8px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; }
.month-code.is-present { color: #087443; background: #e6f7ed; }
.month-code.is-missing { color: #991b1b; background: #ffc9c5; }
.month-code.is-medical { color: #765000; background: #fff0ae; }
.month-code.is-no-shift { color: #38506f; background: #dfe8f3; }
.month-code.is-protected { color: #552b78; background: #eadcf8; }
.month-code.is-strike { color: #8f1717; background: #f4cccc; }
.month-code.is-admin { color: #16633e; background: #d9ead3; }
.month-code.is-regulated { color: #25457f; background: #d9e6f7; }
.month-code.is-directive { color: #25457f; background: #d9e6f7; }
.month-code.is-training { color: #075a68; background: #d9f1f3; }
.month-code.is-excluded, .month-code.is-inactive { color: #596375; background: #e7e6e6; }

/* Carga de certificados y edición Bono SEP */
.antecedent-upload-grid { margin-top: 20px; align-items: stretch; }
.antecedent-upload-grid .card, .antecedent-history { padding: 24px; }
.upload-zone { display: grid; gap: 8px; margin: 18px 0; padding: 18px; border: 2px dashed #c7d2e8; border-radius: 14px; background: #f6f8fd; }
.upload-zone span { color: var(--navy); font-weight: 900; }
.upload-zone input { width: 100%; }
.upload-zone small, .import-people-table small { display: block; color: var(--muted); }
.compact-list { display: grid; gap: 10px; padding-left: 20px; color: var(--muted); }
.antecedent-results, .antecedent-history { margin-top: 20px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.import-people-table { min-width: 1420px; }
.import-people-table td { vertical-align: top; }
.import-people-table textarea, .import-people-table input, .import-people-table select { min-width: 118px; width: 100%; font: inherit; }
.import-people-table textarea { resize: vertical; }
.import-people-table th:first-child, .import-people-table td:first-child { width: 52px; text-align: center; }
.performance-form { display: grid; grid-template-columns: minmax(84px,1fr) auto; gap: 6px; min-width: 180px; }
.performance-form input { min-width: 80px; }
.evaluation-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.evaluation-form { display: grid; gap: 20px; margin-top: 20px; }
.evaluation-guide { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-left: 5px solid var(--yellow); }
.evaluation-guide h3, .evaluation-guide p { margin: 0; }
.evaluation-guide p { margin-top: 6px; }
.evaluation-context { border-left: 5px solid var(--navy); }
.context-heading h3, .context-heading p { margin: 0; }
.context-heading p { margin-top: 6px; }
.context-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; margin-top: 18px; }
.context-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 750; color: var(--ink); font-size: 12px; }
.context-grid select, .context-grid input[type=text] { font-weight: 500; }
.commission-member-picker { grid-column: 1 / -1; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; min-width: 0; }
.commission-member-picker legend { padding: 0 6px; font-size: 12px; font-weight: 800; color: var(--ink); }
.context-grid .commission-member-option { display: flex; flex-direction: row; align-items: center; gap: 8px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); cursor: pointer; }
.context-grid .commission-member-option input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; min-width: 20px; min-height: 20px; margin: 0; padding: 0; accent-color: var(--navy-2); cursor: pointer; }
.context-grid .commission-member-option > span { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; line-height: 1.3; overflow-wrap: anywhere; }
.context-grid .commission-member-option small { display: block; color: var(--muted); font-weight: 500; }
.commission-member-form { grid-template-columns: minmax(220px,2fr) minmax(200px,1.5fr) minmax(90px,.5fr) auto auto; }
/* Jefatura directa: un solo componente buscable. El select nativo queda como
   respaldo sin JS y se oculta solo cuando el buscador lo reemplaza. */
.supervisor-field { display: grid; gap: 8px; }
.supervisor-native-select.is-enhanced { display: none; }
.supervisor-selection { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface, #fff); }
.supervisor-selection > span { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.supervisor-selection strong { color: var(--ink); font-size: 13px; }
.supervisor-selection small { color: var(--muted); font-size: 11px; }
.supervisor-selection button { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.supervisor-selection button:hover { color: var(--danger); border-color: var(--danger); }
.supervisor-search-select { display: grid; gap: 6px; }
.supervisor-search-select[hidden], .supervisor-selection[hidden], .supervisor-search-results[hidden] { display: none; }
.supervisor-search-row { display: flex; align-items: center; gap: 8px; }
.supervisor-search-icon { flex: 0 0 auto; color: var(--muted); }
.supervisor-search-row input { flex: 1 1 auto; min-width: 0; }
.supervisor-search-results { display: grid; gap: 4px; }
.supervisor-search-results button { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.supervisor-search-results button strong { color: var(--ink); font-size: 13px; }
.supervisor-search-results button small { color: var(--muted); font-size: 11px; }
.supervisor-search-results button.is-active, .supervisor-search-results button:hover { border-color: var(--navy-2); }
.supervisor-search-empty { margin: 0; color: var(--muted); font-size: 12px; }
.supervisor-search-status { margin: 0; color: var(--muted); font-size: 11px; }
.supervisor-field > small { color: var(--muted); font-size: 11px; font-weight: 500; }
/* Comisión Evaluadora multiselección: la lista de checkboxes queda como
   respaldo sin JS y se oculta solo cuando el buscador la reemplaza. */
.commission-checklist.is-enhanced { display: none; }
.commission-search-select { display: grid; gap: 6px; }
.commission-search-select[hidden], .commission-search-results[hidden] { display: none; }
.commission-search-row { display: flex; align-items: center; gap: 8px; }
.commission-search-icon { flex: 0 0 auto; color: var(--muted); }
.commission-search-row input { flex: 1 1 auto; min-width: 0; }
.commission-search-results { display: grid; gap: 4px; }
.commission-search-results button { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.commission-search-results button strong { color: var(--ink); font-size: 13px; }
.commission-search-results button small { color: var(--muted); font-size: 11px; }
.commission-search-results button.is-active, .commission-search-results button:hover { border-color: var(--navy-2); }
.commission-search-empty { margin: 0; color: var(--muted); font-size: 12px; }
.commission-search-status { margin: 0; color: var(--muted); font-size: 11px; }
.commission-selected-label { margin: 6px 0 0; color: var(--ink); font-size: 12px; font-weight: 800; }
.commission-chips { display: grid; gap: 6px; }
.commission-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface, #fff); }
.commission-chip > span { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.commission-chip strong { color: var(--ink); font-size: 13px; }
.commission-chip small { color: var(--muted); font-size: 11px; }
.commission-chip.is-historical strong { color: var(--navy); }
.commission-chip button { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.commission-chip button:hover { color: var(--danger); border-color: var(--danger); }
.commission-empty { margin: 0; color: var(--muted); font-size: 12px; }
/* Cursos de la evaluación: chips compactos desde la Carga Horaria. */
.course-display { display: grid; gap: 6px; align-content: start; }
.course-display__label { color: #344054; font-size: 13px; font-weight: 700; }
.course-display__hint { color: var(--muted); font-size: 11px; }
.course-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.course-chip { display: inline-flex; align-items: center; padding: 5px 10px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface, #fff); color: var(--ink); font-size: 12px; font-weight: 700; }
.course-display small { color: var(--muted); font-size: 11px; font-weight: 500; }
/* Carga horaria: lista compacta (una fila por funcionario) y editor. */
.carga-list { display: grid; gap: 8px; margin-top: 14px; }
.carga-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); }
.carga-row__main { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.carga-row__main strong { color: var(--ink); font-size: 13px; }
.carga-row__main small { color: var(--muted); font-size: 11px; }
.carga-row__meta { flex: 0 0 auto; min-width: 110px; text-align: right; display: grid; gap: 1px; }
.carga-row__meta strong { color: var(--ink); font-size: 12px; }
.carga-row__meta small { color: var(--muted); font-size: 11px; }
.carga-row__action { flex: 0 0 auto; }
.course-pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 6px 0 10px; }
.course-pick { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface, #fff); cursor: pointer; font-size: 13px; }
.course-pick input[type="checkbox"] { flex: 0 0 auto; width: 18px; height: 18px; min-width: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--navy-2); cursor: pointer; }
.course-pick > span { flex: 1 1 auto; min-width: 0; display: grid; gap: 0; }
.course-pick strong { color: var(--ink); font-size: 13px; }
.course-pick small { color: var(--muted); font-size: 10px; }
@media (max-width: 700px) {
  .carga-row { flex-wrap: wrap; }
  .carga-row__meta { min-width: 0; text-align: left; }
  .carga-row__action { flex-basis: 100%; }
  .carga-row__action .button { width: 100%; }
}
/* Contexto de la evaluación: comisión (60%) y jefatura (40%) lado a lado en
   escritorio, apiladas en móvil. Solo maquetación: sin :has() el navegador
   conserva el apilado anterior como repliegue natural. */
@media (min-width: 901px) {
  .context-grid:has(> .supervisor-field) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
  .context-grid:has(> .supervisor-field) > .commission-member-picker { grid-column: 1; }
  .context-grid:has(> .supervisor-field) > .supervisor-field { grid-column: 2; grid-row: 1; align-self: start; min-width: 0; }
}
@media (max-width: 900px) {
  .context-grid { grid-template-columns: 1fr; }
  .context-grid > * { grid-column: 1 / -1; min-width: 0; }
}
.ctx-required { color: #b23b3b; }
.score-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.score-legend span { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 10px; color: #40506b; background: #f2f5fb; font-size: 11px; font-weight: 750; }
.score-legend b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--navy); background: var(--yellow); }
.evaluation-dimension { padding: 0; overflow: hidden; }
.dimension-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 19px 22px; color: white; background: linear-gradient(100deg,var(--navy),var(--navy-2)); }
.dimension-heading h3, .dimension-heading p { margin: 0; color: white; }
.dimension-heading .eyebrow { color: #dbe4ff; }
.dimension-heading > strong { padding: 7px 10px; border-radius: 9px; color: var(--navy); background: var(--yellow); font-size: 12px; }
.evaluation-list { display: grid; }
.evaluation-indicator { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.evaluation-indicator:last-child { border-bottom: 0; }
.indicator-number { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--navy); background: #edf1fa; font-size: 12px; font-weight: 900; }
.indicator-copy h4, .indicator-copy p { margin: 0; }
.indicator-copy h4 { color: var(--ink); font-size: 14px; line-height: 1.4; }
.indicator-copy p { margin-top: 7px; font-size: 12px; line-height: 1.45; }
.indicator-copy > span { display: inline-block; margin-top: 8px; padding: 4px 7px; border-radius: 7px; color: #735000; background: #fff4be; font-size: 10px; font-weight: 850; }
.evaluation-indicator.is-custom-indicator { background: #fffdf1; box-shadow: inset 5px 0 0 var(--yellow); }
.custom-indicator-field { color: var(--navy); font-size: 12px; font-weight: 850; }
.custom-indicator-field input { margin-top: 2px; border-color: #dfbd24; background: white; font-size: 14px; font-weight: 650; }
.custom-indicator-field input::placeholder { color: #8790a2; font-weight: 500; }
.score-picker { display: grid; grid-template-columns: repeat(4,42px); gap: 7px; margin: 0; padding: 0; border: 0; }
.score-picker legend { margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.score-picker label { display: block; cursor: pointer; }
.score-picker input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.score-picker span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #c5cee0; border-radius: 10px; color: #40506b; background: white; font-weight: 900; transition: .15s ease; }
.score-picker input:checked + span { color: white; border-color: var(--navy); background: var(--navy); box-shadow: inset 0 -4px 0 var(--yellow); transform: translateY(-1px); }
.score-picker input:focus-visible + span { outline: 3px solid rgba(12,47,137,.18); outline-offset: 2px; }
.evaluation-savebar { position: sticky; bottom: 15px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 18px; border: 1px solid #bdc9e1; border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 12px 35px rgba(7,29,99,.18); backdrop-filter: blur(10px); }
.evaluation-savebar div { display: grid; gap: 3px; }
.evaluation-savebar strong { color: var(--navy); }
.evaluation-savebar span { color: var(--muted); font-size: 11px; }
.evaluation-actions { display: flex; align-items: center; gap: 8px; }
.evaluation-actions .button[disabled], .evaluation-actions .button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; box-shadow: none; transform: none; }
.evaluation-actions .button[disabled]::after { content: " · pendiente"; color: var(--muted); font-size: 10px; font-weight: 650; }
.reader-status { margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 750; }
.reader-status.is-ready { color: #087443; }
.reader-status.is-error { color: #a61b1b; }
@media(max-width:820px){.result-actions{width:100%}.result-actions .button{flex:1}.performance-form{min-width:150px}}
.month-code.is-nodata { color: #596375; background: #eef1f6; }
.totals-controls { display: grid; grid-template-columns: minmax(250px,1.1fr) repeat(3,minmax(170px,.65fr)) auto; gap: 16px; align-items: end; }
.totals-controls .segment-tabs { margin-top: 7px; }
.totals-table td:nth-child(2) { min-width: 290px; }
.totals-table td:nth-child(2) small, .totals-table td:nth-child(4) small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.totals-table td.is-admin { color: #16633e; background: #d9ead3; font-weight: 900; }
.totals-table td.is-medical { color: #765000; background: #fff0ae; font-weight: 900; }
.totals-table td.is-strike, .totals-table td.is-missing { color: #991b1b; background: #f4cccc; font-weight: 900; }

@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .geovictoria-source-stats, .gv-result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gv-download-card { grid-template-columns: 1fr; }
  .monthly-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .totals-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .app-shell.is-sidebar-collapsed { display: block; }
  .sidebar, .app-shell.is-sidebar-collapsed .sidebar { position: fixed; left: 0; width: 268px; transform: translateX(-105%); box-shadow: 8px 0 30px rgba(7, 29, 99, .2); }
  .app-shell.is-sidebar-open .sidebar, .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 110; display: block; border: 0; background: rgba(2, 10, 36, .48); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
  .app-shell.is-sidebar-open .sidebar-backdrop { opacity: 1; visibility: visible; }
  .database-status { display: none; }
  .grid.two, .grid.four, .form-grid, .dashboard-stats { grid-template-columns: 1fr; }
  .gv-filter-grid, .geovictoria-source-stats, .gv-result-stats, .gv-download-grid { grid-template-columns: 1fr; }
  .gv-limit-form { grid-template-columns: 1fr; }
  .gv-limit-form small { grid-column: auto; }
  .gv-report-heading { align-items: stretch; flex-direction: column; }
  .gv-automatic-card { grid-template-columns: auto minmax(0, 1fr); }
  .gv-automatic-card > .status { grid-column: 1 / -1; width: fit-content; }
  .range-card { grid-template-columns: 1fr; }
  .range-card > div { grid-column: auto; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .monthly-controls { grid-template-columns: 1fr; }
  .totals-controls { grid-template-columns: 1fr; }
  .evaluation-summary { grid-template-columns: 1fr; }
  .evaluation-guide, .evaluation-savebar { align-items: stretch; flex-direction: column; }
  .evaluation-indicator { grid-template-columns: 34px minmax(0,1fr); }
  .score-picker { grid-column: 1 / -1; justify-self: end; }
  .monthly-only-missing { margin-top: 0; }
}

/* Pestañas del ingreso diferenciado (administradores / funcionarios). */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 4px; }
.auth-tabs a { text-align: center; text-decoration: none; font-weight: 700; font-size: 14px;
  color: var(--navy); background: #eef2ff; border-radius: 10px; padding: 10px 6px; min-height: 44px;
  display: flex; align-items: center; justify-content: center; }
.auth-tabs a.is-active { background: var(--navy); color: #fff; }
