/* ERES Selección — Design System v1.0 */
:root {
  --blue:        #1b8fc4;
  --blue-dark:   #1470a8;
  --blue-light:  #dff4fb;
  --teal:        #73cee2;
  --teal-light:  #e6f7fb;
  --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;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --yellow:      #d97706;
  --yellow-light:#fef3c7;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:   0 10px 30px rgba(27,143,196,.14);
  --sidebar-w:   240px;
  --font:        'Inter', system-ui, -apple-system, sans-serif;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

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

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #0a2540;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff; letter-spacing: .05em;
  flex-shrink: 0;
}
.sidebar-logo-name { display: block; font-weight: 800; font-size: 14px; color: #fff; line-height: 1; }
.sidebar-logo-sub  { display: block; font-size: 11px; color: var(--gray-400); }

.sidebar-nav { list-style: none; padding: 12px 8px; flex: 1; }
.sidebar-nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--gray-400);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav li a:hover  { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sidebar-nav li a.active { background: rgba(115,206,226,.18); color: var(--teal); }
.sidebar-nav li a svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gray-600);
  padding: 14px 10px 4px;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { display: block; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { display: block; font-size: 11px; color: var(--gray-500); }
.sidebar-logout { color: var(--gray-500); display: flex; align-items: center; }
.sidebar-logout:hover { color: var(--red); }
.sidebar-logout svg { width: 16px; height: 16px; }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-wrapper  { flex: 1; padding: 28px 32px; max-width: 1400px; width: 100%; }

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-header-left h1 { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.page-header-left p  { font-size: 13.5px; color: var(--gray-500); margin-top: 2px; }
.page-header-actions { display: flex; gap: 10px; flex-shrink: 0; }

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.card-body { padding: 20px 22px; }

/* ── STAT CARDS ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.stat-card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card-icon svg { width: 20px; height: 20px; }
.stat-card-icon.blue  { background: var(--blue-light);   color: var(--blue); }
.stat-card-icon.teal  { background: var(--teal-light);   color: #0891b2; }
.stat-card-icon.green { background: var(--green-light);  color: var(--green); }
.stat-card-icon.gray  { background: var(--gray-100);     color: var(--gray-600); }
.stat-card-value { font-size: 28px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-card-label { font-size: 12.5px; color: var(--gray-500); font-weight: 500; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); text-decoration: none; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; text-decoration: none; color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-outline { background: transparent; border: 1.5px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; text-decoration: none; }

/* ── TABLE ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
  text-align: left; padding: 10px 14px;
  background: var(--gray-50); color: var(--gray-600);
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  border-bottom: 1px solid var(--gray-200);
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: var(--gray-50); }
.table-actions { display: flex; gap: 6px; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 18px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--gray-700); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,90,171,.1);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group .hint { font-size: 11.5px; color: var(--gray-400); }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.badge-blue    { background: var(--blue-light);   color: var(--blue); }
.badge-green   { background: var(--green-light);  color: var(--green); }
.badge-yellow  { background: var(--yellow-light); color: var(--yellow); }
.badge-red     { background: var(--red-light);    color: var(--red); }
.badge-gray    { background: var(--gray-100);     color: var(--gray-600); }
.badge-teal    { background: var(--teal-light);   color: #0891b2; }

/* ── ALERTS ───────────────────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-radius: 10px; font-size: 13.5px;
  margin-bottom: 18px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-light); color: #14532d; }
.alert-error   { background: var(--red-light);   color: #7f1d1d; }
.alert-warning { background: var(--yellow-light); color: #78350f; }

/* ── SCORE BARS ───────────────────────────────────────────── */
.score-bar { background: var(--gray-200); border-radius: 999px; height: 8px; }
.score-bar-fill { height: 100%; border-radius: 999px; transition: width .5s; }
.score-bar-fill.high   { background: var(--green); }
.score-bar-fill.medium { background: var(--yellow); }
.score-bar-fill.low    { background: var(--red); }

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gray-900) 0%, #003b6f 100%);
  padding: 24px;
}
.login-card {
  background: #fff; border-radius: 20px;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  overflow: hidden;
}
.login-header {
  background: linear-gradient(135deg, #0a2540, var(--blue));
  padding: 32px 36px 28px;
  text-align: center;
}
.login-header-logo {
  width: 52px; height: 52px; background: rgba(255,255,255,.12);
  border-radius: 14px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px; color: #fff; letter-spacing: .05em;
}
.login-header h1 { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.login-header p  { font-size: 13px; color: rgba(255,255,255,.7); }
.login-body { padding: 28px 32px; }
.login-footer {
  padding: 16px 32px;
  background: var(--gray-50); border-top: 1px solid var(--gray-100);
  text-align: center; font-size: 12px; color: var(--gray-400);
}

/* ── LANDING ──────────────────────────────────────────────── */
.landing-page {
  min-height: 100vh;
  background: linear-gradient(160deg, #0a2540 0%, #0d4a7a 60%, var(--blue) 100%);
}
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px;
}
.landing-logo { display: flex; align-items: center; gap: 12px; }
.landing-logo-box {
  width: 40px; height: 40px; background: rgba(255,255,255,.12);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; color: #fff;
}
.landing-logo-text { font-size: 18px; font-weight: 800; color: #fff; }
.landing-logo-sub  { font-size: 12px; color: rgba(255,255,255,.6); display: block; }

.landing-hero { padding: 80px 48px 64px; max-width: 780px; }
.landing-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(115,206,226,.15); border: 1px solid rgba(115,206,226,.3);
  color: var(--teal); border-radius: 999px;
  padding: 5px 14px; font-size: 12.5px; font-weight: 600;
  margin-bottom: 24px;
}
.landing-hero h1 {
  font-size: clamp(32px, 5vw, 52px); font-weight: 900; color: #fff;
  line-height: 1.1; margin-bottom: 20px;
}
.landing-hero h1 span { color: var(--teal); }
.landing-hero p { font-size: 17px; color: rgba(255,255,255,.75); margin-bottom: 36px; line-height: 1.65; max-width: 540px; }

.landing-features {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; padding: 0 48px 64px;
}
.landing-feature {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 20px;
}
.landing-feature-icon {
  width: 40px; height: 40px; background: rgba(115,206,226,.15);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.landing-feature-icon svg { width: 20px; height: 20px; color: var(--teal); }
.landing-feature h3 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.landing-feature p  { font-size: 12.5px; color: rgba(255,255,255,.55); line-height: 1.5; }

/* ── DASHBOARD GRID ───────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }

/* ── SCORE TABLE ──────────────────────────────────────────── */
.score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.score-row-label { flex: 1; font-size: 13px; color: var(--gray-700); }
.score-row-value { font-size: 13px; font-weight: 700; color: var(--gray-900); width: 40px; text-align: right; }
.score-row-bar { width: 120px; }

/* ── COMPETENCY MATRIX ────────────────────────────────────── */
.comp-matrix { display: grid; gap: 10px; }
.comp-matrix-row { display: grid; grid-template-columns: 200px 80px 120px 1fr; gap: 12px; align-items: center; }
.level-dots { display: flex; gap: 4px; }
.level-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-200); }
.level-dot.filled { background: var(--blue); }

/* ── INFORME STYLES ───────────────────────────────────────── */
.report-page { max-width: 820px; margin: 0 auto; padding: 40px; background: #fff; }
.report-header { text-align: center; padding: 40px 0 32px; border-bottom: 2px solid var(--blue); margin-bottom: 32px; }
.report-header h1 { font-size: 28px; font-weight: 900; color: var(--blue); }
.report-header .report-meta { font-size: 13px; color: var(--gray-500); margin-top: 8px; }
.report-section { margin-bottom: 32px; }
.report-section h2 { font-size: 16px; font-weight: 800; color: var(--blue); border-bottom: 1px solid var(--blue-light); padding-bottom: 8px; margin-bottom: 16px; }
.report-disclaimer { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 14px 18px; font-size: 12px; color: var(--gray-500); line-height: 1.65; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .page-wrapper { padding: 20px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .page-header-actions, .btn { display: none !important; }
  .page-wrapper { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
