@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ─── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #070b14;
  --surface:    rgba(255, 255, 255, 0.03);
  --card:       rgba(255, 255, 255, 0.02);
  --card2:      rgba(255, 255, 255, 0.05);
  --border:     rgba(255, 255, 255, 0.06);
  --border2:    rgba(255, 255, 255, 0.1);
  --primary:    #003B5C;
  --accent:     #39A900;
  --accent2:    #4ae000;
  --text:       #e8edf5;
  --muted:      #8b9cbd;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --info:       #3b82f6;
  --sidebar-w:  260px;
  --radius:     16px;
  --shadow:     0 8px 32px rgba(0,0,0,0.4);
}

html, body { height: 100%; }
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; top: -20%; left: -10%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(57,169,0,0.15) 0%, transparent 60%);
  z-index: -1; pointer-events: none;
}
.bg-glow-2 {
  top: auto; bottom: -20%; left: auto; right: -10%;
  background: radial-gradient(circle, rgba(0,166,81,0.1) 0%, transparent 60%);
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Sidebar ───────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; transition: transform .3s ease;
}

.sidebar-brand {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand .logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), #246d00);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
  box-shadow: 0 4px 12px rgba(57, 169, 0, 0.4);
  flex-shrink: 0;
}
.sidebar-brand .brand-text { display: flex; flex-direction: column; }
.sidebar-brand .brand-name { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0.5px; }
.sidebar-brand .brand-sub  { font-size: 11px; color: var(--muted); }

.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  color: var(--muted); font-weight: 500; font-size: 14px;
  transition: all .2s; margin-bottom: 4px;
}
.nav-item:hover { background: var(--card2); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(57,169,0,0.15) 0%, transparent 100%);
  color: var(--accent2); border-left: 3px solid var(--accent);
}
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted); text-align: center;
}

/* ─── Main Layout ───────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}

.topbar {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; }
.topbar-sub   { font-size: 13px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.content { padding: 32px; flex: 1; }

/* ─── Cards ─────────────────────────────────────────────────────── */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px; margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; display: flex; align-items: flex-start; gap: 16px;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(255,255,255,0.15); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.stat-icon.green  { background: rgba(57,169,0,0.15);  color: var(--accent); box-shadow: inset 0 0 0 1px rgba(57,169,0,0.3); }
.stat-icon.blue   { background: rgba(59,130,246,.15); color: var(--info); box-shadow: inset 0 0 0 1px rgba(59,130,246,.3); }
.stat-icon.red    { background: rgba(239,68,68,.15);  color: var(--danger); box-shadow: inset 0 0 0 1px rgba(239,68,68,.3); }
.stat-icon.orange { background: rgba(245,158,11,.15); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(245,158,11,.3); }
.stat-icon.teal   { background: rgba(0,200,200,.15);  color: #00c8c8; box-shadow: inset 0 0 0 1px rgba(0,200,200,.3); }

.stat-body {}
.stat-value { font-size: 32px; font-weight: 800; line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 13px; color: var(--muted); }

/* ─── Panel / Section ───────────────────────────────────────────── */
.panel {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.panel-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; background: rgba(255,255,255,0.01);
}
.panel-title { font-size: 16px; font-weight: 700; display:flex; align-items:center; gap:8px; }
.panel-body  { padding: 24px; }

/* ─── Grid Charts ───────────────────────────────────────────────── */
.charts-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px; margin-bottom: 32px;
}
.chart-wrap { position: relative; height: 280px; }

/* ─── Filters Bar ───────────────────────────────────────────────── */
.filters-bar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 14px; flex: 1; min-width: 200px; max-width: 320px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--text); width: 100%; padding: 11px 0; font-size: 14px;
}
.search-box span { color: var(--muted); font-size: 18px; }

.filter-select {
  background: var(--card2); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; outline: none; cursor: pointer;
  transition: all .2s;
}
.filter-select:focus, .filter-select:hover { border-color: var(--accent); background: rgba(255,255,255,0.08); }
.filter-select option { background: var(--bg); color: var(--text); }

.search-input {
  background: var(--card2); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px;
  padding: 12px 16px; font-size: 14px; outline: none;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57,169,0,0.15); }
.search-input::placeholder { color: var(--muted); }

/* ─── Table ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 14px 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .2s; cursor: pointer; }
tbody tr:hover { background: var(--card2); }
tbody td { padding: 16px 18px; font-size: 14px; vertical-align: middle; }

/* ─── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-green   { background: rgba(57,169,0,0.15);  color: var(--accent2); border: 1px solid rgba(57,169,0,0.3); }
.badge-red     { background: rgba(239,68,68,0.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.badge-orange  { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.badge-blue    { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }
.badge-gray    { background: rgba(255,255,255,0.08); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.1); }

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.btn:hover  { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.btn:active { transform: scale(0.97); }
.btn-primary { 
  background: var(--accent); color: #000; 
  box-shadow: 0 0 15px rgba(57,169,0,0.4);
}
.btn-primary:hover { background: var(--accent2); box-shadow: 0 0 20px rgba(57,169,0,0.6); }
.btn-outline {
  background: rgba(255,255,255,0.03); color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); }
.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.3); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ─── Pagination ────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-top: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.pag-info { font-size: 13px; color: var(--muted); }
.pag-btns { display: flex; gap: 8px; }
.pag-btn {
  padding: 6px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card2); color: var(--text);
  font-size: 13px; font-weight: 600; transition: all .2s;
}
.pag-btn:hover:not(:disabled)  { background: var(--accent); border-color: var(--accent); color: #000; }
.pag-btn:disabled               { opacity: .4; cursor: not-allowed; }
.pag-btn.active                 { background: var(--accent); border-color: var(--accent); color: #000; }

/* ─── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 20px; width: 100%; max-width: 800px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 32px 100px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.05);
  transform: translateY(30px) scale(0.95); transition: all .3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 24px 28px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.modal-close {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border); color: var(--text);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: all .2s; font-size: 16px;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--accent); transform: rotate(90deg); }
.modal-body { padding: 24px 28px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 20px 28px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 12px; background: rgba(255,255,255,0.01);
}

/* ─── Form ──────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.form-control {
  background: var(--card2); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px;
  padding: 11px 14px; font-size: 14px; outline: none;
  transition: all .2s;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(57,169,0,0.15); }
.form-control::placeholder { color: var(--muted); }
select.form-control option { background: var(--bg); color: var(--text); }

/* ─── Competencia Item ──────────────────────────────────────────── */
.comp-list { display: flex; flex-direction: column; gap: 12px; }
.comp-item {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 20px;
  display: flex; gap: 16px; align-items: flex-start;
}
.comp-item-dot {
  width: 12px; height: 12px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.comp-item-dot.green  { background: var(--accent2); box-shadow: 0 0 10px var(--accent); }
.comp-item-dot.red    { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,0.6); }
.comp-item-dot.orange { background: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.6); }

.comp-item-body { flex: 1; }
.comp-item-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.comp-item-res  { font-size: 13px; color: var(--muted); line-height: 1.5; }
.comp-item-meta { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; gap: 16px; flex-wrap: wrap; }
.comp-item-meta span { display:flex; align-items:center; gap:4px; }

/* ─── Progress Bar ──────────────────────────────────────────────── */
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-bar-wrap {
  flex: 1; background: rgba(255,255,255,0.05); border-radius: 6px; height: 8px; overflow: hidden;
}
.progress-bar { height: 100%; border-radius: 6px; transition: width .6s cubic-bezier(0.4, 0, 0.2, 1); }
.progress-bar.green  { background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 8px rgba(57,169,0,0.5); }
.progress-bar.red    { background: linear-gradient(90deg, #dc2626, #ef4444); }
.progress-bar.orange { background: linear-gradient(90deg, #d97706, #f59e0b); }

/* ─── Upload Area ───────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 56px 24px; text-align: center; cursor: pointer;
  transition: all .3s ease; background: rgba(255,255,255,0.01);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: rgba(57,169,0,0.05);
  transform: scale(1.02);
}
.upload-icon { font-size: 56px; margin-bottom: 16px; color: var(--accent); }
.upload-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.upload-sub   { font-size: 14px; color: var(--muted); }
.upload-zone input { display: none; }

/* ─── Meta Grid ─────────────────────────────────────────────────── */
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.meta-item {
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.meta-key   { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; display:flex; align-items:center; gap:6px; }
.meta-value { font-size: 15px; font-weight: 700; margin-top: 6px; }

/* ─── Alert ─────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: 12px;
  font-size: 14px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px;
}
.alert-success { background: rgba(57,169,0,0.1); border: 1px solid rgba(57,169,0,0.3); color: var(--accent2); }
.alert-error   { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,0.1);  border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }

/* ─── Empty State ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); }
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state p           { font-size: 15px; }

/* ─── Aprendiz Info Block ───────────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.info-item .info-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing:0.05em; }
.info-item .info-value { font-size: 15px; font-weight: 600; margin-top: 4px; }

/* ─── Scroll ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 20px; }
  .topbar { padding: 0 20px; }
}

/* ─── Loader ─────────────────────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
