:root {
  --ink: #16202c;
  --muted: #697586;
  --line: #e7ebf0;
  --surface: #ffffff;
  --canvas: #f6f8fb;
  --navy: #13243a;
  --teal: #147d82;
  --teal-soft: #e5f5f4;
  --gold: #d69f39;
  --gold-soft: #fff5de;
  --blue-soft: #e9f1ff;
  --danger: #c64747;
  --shadow: 0 14px 42px rgba(26, 43, 65, 0.07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: 'DM Sans', sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: 46% 54%; background: var(--surface); }
.login-visual { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 42px 8vw 46px 8vw; color: white; background: var(--navy); }
.login-visual::before, .login-visual::after { content: ''; position: absolute; border-radius: 999px; pointer-events: none; }
.login-visual::before { width: 430px; height: 430px; right: -160px; top: 10%; border: 1px solid rgba(120, 231, 220, .26); }
.login-visual::after { width: 620px; height: 620px; left: -390px; bottom: -320px; border: 1px solid rgba(120, 231, 220, .18); }
.brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-family: 'Manrope', sans-serif; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--teal); color: #fff; font-size: 16px; }
.visual-copy { position: relative; z-index: 1; max-width: 460px; }
.visual-copy .eyebrow { color: #76d9d4; }
.visual-copy h1 { max-width: 520px; margin: 18px 0; font-family: 'Manrope', sans-serif; font-size: clamp(32px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -.045em; }
.visual-copy p { max-width: 390px; color: #b6c4d3; font-size: 16px; line-height: 1.65; }
.visual-footer { position: relative; z-index: 1; color: #8ea1b7; font-size: 12px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 44px 8vw; }
.login-card { width: min(100%, 420px); }
.eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; }
.eyebrow { color: var(--teal); }
.login-card h2 { margin: 14px 0 9px; font-family: 'Manrope', sans-serif; font-size: 34px; letter-spacing: -.04em; }
.login-card .intro { margin: 0 0 32px; color: var(--muted); line-height: 1.55; }
.form-field { display: grid; gap: 8px; margin-bottom: 18px; }
.form-field label { color: #4d5968; font-size: 13px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid #dce2ea; border-radius: 10px; padding: 12px 13px; color: var(--ink); outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; }
.form-field textarea { min-height: 90px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 125, 130, .12); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px; }
.primary-button, .secondary-button, .ghost-button, .danger-button { border: 0; border-radius: 9px; padding: 11px 16px; font-weight: 700; transition: transform .15s, box-shadow .15s, background .15s; }
.primary-button { color: #fff; background: var(--teal); box-shadow: 0 5px 14px rgba(20, 125, 130, .22); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(20, 125, 130, .27); }
.secondary-button { color: var(--navy); background: var(--gold-soft); }
.ghost-button { color: var(--muted); background: transparent; }
.danger-button { color: var(--danger); background: #fff0f0; }
.full-width { width: 100%; }
.form-message { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar { display: flex; flex-direction: column; padding: 28px 18px; color: #c0ccda; background: var(--navy); }
.sidebar .brand { padding: 0 12px 40px; color: white; }
.nav-group { display: grid; gap: 5px; }
.nav-label { padding: 0 12px 9px; color: #6e8199; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 9px; color: #aab9ca; background: transparent; text-align: left; font-size: 13px; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255, 255, 255, .09); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--teal); }
.nav-icon { display: inline-grid; place-items: center; width: 18px; color: #7ed3cf; font-size: 16px; }
.sidebar-bottom { margin-top: auto; padding: 18px 12px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.user-mini { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; color: var(--navy); background: #8cd9d4; font-weight: 800; font-size: 12px; }
.user-mini strong { display: block; color: white; font-size: 12px; }
.user-mini span { display: block; margin-top: 3px; color: #7f92a8; font-size: 11px; }
.logout-button { width: 100%; padding: 8px 0; border: 0; color: #aab9ca; background: transparent; text-align: left; font-size: 12px; }
.main-area { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px 42px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar h1 { margin: 0; font-family: 'Manrope', sans-serif; font-size: 23px; letter-spacing: -.035em; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.notification { position: relative; padding: 8px; border: 0; color: var(--muted); background: transparent; font-size: 18px; }
.notification::after { content: ''; position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.content { max-width: 1500px; margin: 0 auto; padding: 36px 42px 56px; }
.page { display: none; }
.page.active { display: block; animation: appear .25s ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.section-head h2 { margin: 7px 0 0; font-family: 'Manrope', sans-serif; font-size: 27px; letter-spacing: -.04em; }
.section-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.section-kicker { color: var(--teal); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.stat-card .stat-icon { display: grid; place-items: center; width: 31px; height: 31px; margin-bottom: 18px; border-radius: 9px; color: var(--teal); background: var(--teal-soft); font-weight: 800; }
.stat-card:nth-child(2) .stat-icon { color: #718fc6; background: var(--blue-soft); }
.stat-card:nth-child(3) .stat-icon { color: #b68529; background: var(--gold-soft); }
.stat-card:nth-child(4) .stat-icon { color: #825db2; background: #f1eafa; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { margin-top: 3px; font-family: 'Manrope', sans-serif; font-size: 29px; letter-spacing: -.04em; }
.two-column { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel h3 { margin: 0; font-family: 'Manrope', sans-serif; font-size: 16px; letter-spacing: -.025em; }
.panel-link { border: 0; color: var(--teal); background: transparent; font-size: 12px; font-weight: 700; }
.empty-state { display: grid; place-items: center; min-height: 180px; padding: 28px; border: 1px dashed #d9e0e8; border-radius: 10px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 13px; color: var(--teal); background: var(--teal-soft); font-weight: 800; font-size: 18px; }
.empty-state h4 { margin: 0 0 6px; font-family: 'Manrope', sans-serif; font-size: 14px; }
.empty-state p { max-width: 370px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.progress-row:last-child { border-bottom: 0; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 7px; color: #4d5968; font-size: 12px; }
.progress-bar { height: 7px; overflow: hidden; border-radius: 99px; background: #eef1f4; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.progress-percent { color: var(--ink); font-size: 12px; font-weight: 700; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 650px; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
th { color: var(--muted); background: #fbfcfd; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.badge-neutral { color: #667382; background: #edf0f3; }
.badge-open { color: #21766e; background: var(--teal-soft); }
.badge-warning { color: #956c22; background: var(--gold-soft); }
.badge-sent { color: #4c6eaa; background: var(--blue-soft); }
.badge-success { color: #065f46; background: #d1fae5; }
.badge-danger { color: #991b1b; background: #fee2e2; }
.badge-info { color: #1e40af; background: #dbeafe; }

/* Subnavegación de Reportes */
.report-tabs { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.report-tab-btn { padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; white-space: nowrap; }
.report-tab-btn:hover { background: #f1f5f9; color: var(--ink); }
.report-tab-btn.active { background: #fff; border-color: var(--line); color: var(--teal); box-shadow: var(--shadow); }

/* Matriz 9 Box Corporativa */
.ninebox-wrapper { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.ninebox-axis-y-label { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-size: 11px; padding: 8px; }
.ninebox-axis-x-label { text-align: center; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-size: 11px; padding: 8px; }
.ninebox-layout { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: stretch; }
.ninebox-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, minmax(140px, auto)); gap: 12px; }
.ninebox-cell { border-radius: 10px; padding: 14px; border: 1px solid var(--line); background: #ffffff; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.ninebox-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ninebox-cell-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 8px; }
.ninebox-cell-title { font-size: 12px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.ninebox-cell-badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 99px; min-width: 20px; text-align: center; }
.ninebox-cell-action { font-size: 11px; color: var(--muted); font-style: italic; line-height: 1.3; margin-top: 6px; }
.ninebox-cell-people { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.ninebox-person-pill { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 8px; font-size: 11px; }
.ninebox-person-pill strong { color: var(--ink); display: block; }
.ninebox-person-pill span { color: var(--muted); font-size: 10px; }

/* Tarjetas Analíticas */
.talent-card { padding: 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); margin-bottom: 14px; }
.talent-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.talent-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 12px; }
.talent-action-box { padding: 12px; border-radius: 8px; background: #f8fafc; border-left: 4px solid var(--teal); font-size: 12px; margin-top: 10px; line-height: 1.5; }
.talent-action-box.danger { border-left-color: #ef4444; background: #fef2f2; }
.talent-action-box.warning { border-left-color: #f59e0b; background: #fffbeb; }

/* Estilo PDI 70-20-10 */
.pdi-card { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); margin-bottom: 16px; }
.pdi-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.pdi-pillar { padding: 12px; border-radius: 8px; background: #f8fafc; border: 1px solid #e2e8f0; font-size: 12px; }
.pdi-pillar-label { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.pdi-pillar-70 .pdi-pillar-label { color: #0d9488; }
.pdi-pillar-20 .pdi-pillar-label { color: #2563eb; }
.pdi-pillar-10 .pdi-pillar-label { color: #7c3aed; }
.data-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.admin-card { padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.admin-card h3 { margin: 0 0 16px; font-family: 'Manrope', sans-serif; font-size: 15px; }
.admin-form { display: grid; gap: 0; }
.admin-form .form-field { margin-bottom: 12px; }
.admin-form .primary-button { margin-top: 2px; }
.notice { margin-bottom: 18px; padding: 12px 14px; border-radius: 10px; color: #316777; background: #edf9f8; font-size: 12px; line-height: 1.5; }
.success-message { min-height: 18px; margin-top: 10px; color: #247a6e; font-size: 12px; }

.evaluation-form { display: grid; gap: 14px; }
.competency-card { display: grid; grid-template-columns: 1.4fr .8fr 1.2fr; align-items: start; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.competency-card h3 { margin: 2px 0 6px; font-family: 'Manrope', sans-serif; font-size: 15px; }
.competency-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.competency-card .form-field { margin: 0; }
.evaluation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 5px; }
.evaluation-actions .success-message { margin-right: auto; }

@media (max-width: 1050px) {
  .login-shell { grid-template-columns: 40% 60%; }
  .login-visual { padding-inline: 5vw; }
  .login-panel { padding-inline: 5vw; }
  .app-shell { grid-template-columns: 220px 1fr; }
  .content, .topbar { padding-inline: 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .data-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .login-shell { display: block; }
  .login-visual { min-height: 250px; padding: 26px 24px; }
  .visual-copy { margin-top: 38px; }
  .visual-copy h1 { margin: 10px 0; font-size: 32px; }
  .visual-copy p, .visual-footer { display: none; }
  .login-panel { padding: 38px 24px 56px; }
  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 5; display: block; padding: 13px 16px; }
  .sidebar .brand { padding: 0; }
  .sidebar .brand-mark { width: 32px; height: 32px; }
  .nav-group, .sidebar-bottom { display: none; }
  .topbar { padding: 20px 20px; }
  .topbar h1 { font-size: 19px; }
  .topbar-actions { gap: 8px; }
  .content { padding: 26px 20px 44px; }
  .stats-grid, .two-column, .data-grid { grid-template-columns: 1fr; }
  .section-head { display: block; }
  .section-head .primary-button { margin-top: 16px; }
  .panel { padding: 17px; }
  .competency-card { grid-template-columns: 1fr; gap: 12px; }
  .evaluation-actions { flex-wrap: wrap; justify-content: flex-start; }
  .evaluation-actions .success-message { width: 100%; order: -1; }
}
