/* assets/style.css — Sistema Cursos Cortos · Golden Brain */

/* ── Google Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --navy:   #272252;
  --navy2:  #1a1739;
  --purple: #4C4797;
  --gold:   #EEBA2A;
  --gold2:  #d4a520;
  --cream:  #FFFBF3;
  --white:  #ffffff;
  --gray50: #f8f7f2;
  --gray100:#eeecea;
  --gray200:#d8d6d0;
  --gray400:#9a9890;
  --gray600:#5e5d58;
  --gray800:#2e2d2a;
  --green:  #1e8a5e;
  --red:    #c0392b;
  --orange: #d4620a;
  --info:   #1a6fc4;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(39,34,82,.08);
  --shadow:    0 4px 16px rgba(39,34,82,.12);
  --shadow-lg: 0 8px 32px rgba(39,34,82,.18);

  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --sidebar-w: 220px;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--gray50);
  color: var(--gray800);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--navy); }
img { max-width: 100%; }

/* ── Layout shell ──────────────────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.sidebar-brand .brand-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.sidebar-brand .brand-sub {
  font-size: .65rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .04em;
}
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 16px 20px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,.06); }
.nav-link.active {
  color: var(--gold);
  background: rgba(238,186,42,.08);
  border-left-color: var(--gold);
}
.nav-link .nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: .75rem;
  color: rgba(255,255,255,.35);
}
.sidebar-footer strong { color: rgba(255,255,255,.6); display: block; margin-bottom: 2px; }

/* ── Contenido principal ────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray100);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.topbar-title small { font-size: .75rem; font-weight: 400; color: var(--gray400); margin-left: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-body { padding: 28px; flex: 1; }

/* ── Tarjetas ────────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray100);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
}
.card-body { padding: 22px; }

/* ── KPI cards ─────────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray100);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
}
.kpi-card.kpi-purple::before { background: var(--purple); }
.kpi-card.kpi-green::before  { background: var(--green); }
.kpi-card.kpi-orange::before { background: var(--orange); }
.kpi-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--gray400); margin-bottom: 6px; }
.kpi-value { font-size: 1.65rem; font-weight: 700; color: var(--navy); line-height: 1; }
.kpi-sub   { font-size: .72rem; color: var(--gray400); margin-top: 4px; }

/* ── Formularios ─────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gray600);
  letter-spacing: .02em;
}
label .req { color: var(--red); margin-left: 2px; }
label .opt { color: var(--gray400); font-weight: 400; font-size: .72rem; }
input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="password"],
select, textarea {
  border: 1.5px solid var(--gray200);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font);
  font-size: .88rem;
  color: var(--gray800);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(76,71,151,.12);
}
select { cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .72rem; color: var(--gray400); }
.form-section {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--purple);
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--gray100);
  margin-top: 4px;
}

/* ── Botones ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy2); color: var(--white); }
.btn-gold    { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold2); color: var(--navy); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray200);
  color: var(--gray600);
}
.btn-outline:hover { border-color: var(--purple); color: var(--purple); }
.btn-danger  { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #a93226; color: var(--white); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-icon { padding: 7px; }

/* ── Badges / Pills ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-gold    { background: #fef3c7; color: #92670a; }
.badge-green   { background: #d1fae5; color: #065f46; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: var(--gray100); color: var(--gray600); }
.badge-purple  { background: #ede9fe; color: #4c1d95; }
.badge-orange  { background: #ffedd5; color: #9a3412; }

/* ── Tabla ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead th {
  background: var(--gray50);
  padding: 10px 14px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray400);
  border-bottom: 1px solid var(--gray100);
  white-space: nowrap;
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray100);
  vertical-align: middle;
}
tbody tr:hover { background: var(--gray50); }
tbody tr:last-child td { border-bottom: none; }
.td-mono { font-family: var(--mono); font-size: .8rem; }

/* ── Alertas ─────────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .84rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.alert-warn    { background: #fef3c7; color: #92670a; border: 1px solid #fcd34d; }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--gray100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: .95rem; font-weight: 700; color: var(--navy); }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: var(--gray400);
  line-height: 1; padding: 4px;
  transition: color .1s;
}
.modal-close:hover { color: var(--gray800); }
.modal-body  { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gray100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Upload zona ─────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray200);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--purple); background: rgba(76,71,151,.03); }
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon { font-size: 2rem; margin-bottom: 8px; display: block; }
.upload-label { font-size: .84rem; color: var(--gray600); }
.upload-hint  { font-size: .72rem; color: var(--gray400); margin-top: 4px; }
.upload-preview {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--gray50);
  border-radius: var(--radius-sm);
  font-size: .8rem;
  color: var(--gray600);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Tipo curso selector ─────────────────────────────────────────────────────── */
.tipo-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; grid-column: 1/-1; }
.tipo-option   { position: relative; }
.tipo-option input { position: absolute; opacity: 0; }
.tipo-option label {
  display: block;
  border: 2px solid var(--gray200);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
  font-weight: 600;
  font-size: .82rem;
  color: var(--gray600);
  letter-spacing: 0;
  text-transform: none;
}
.tipo-option input:checked + label {
  border-color: var(--purple);
  background: rgba(76,71,151,.06);
  color: var(--navy);
}
.tipo-option label .tipo-icon { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.tipo-option label .tipo-name { display: block; margin-bottom: 3px; }
.tipo-option label .tipo-price { font-size: .72rem; color: var(--gray400); font-weight: 400; }

/* ── Pago modo selector ─────────────────────────────────────────────────────── */
.pago-modos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pago-modo input { position: absolute; opacity: 0; }
.pago-modo {
  position: relative;
}
.pago-modo label {
  display: block;
  border: 2px solid var(--gray200);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  transition: all .15s;
  font-weight: 500;
  font-size: .82rem;
  color: var(--gray600);
  text-transform: none;
  letter-spacing: 0;
}
.pago-modo input:checked + label { border-color: var(--gold); background: rgba(238,186,42,.07); color: var(--navy); }

/* ── Panel info alumno ───────────────────────────────────────────────────────── */
.alumno-info-panel {
  background: linear-gradient(135deg, var(--navy) 0%, var(--purple) 100%);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  color: var(--white);
  margin-bottom: 20px;
}
.alumno-info-panel .ai-nombre { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.alumno-info-panel .ai-meta   { font-size: .78rem; color: rgba(255,255,255,.65); }
.alumno-info-panel .ai-badge  { margin-top: 10px; }

/* ── Línea de tiempo de pagos ────────────────────────────────────────────────── */
.pago-timeline { list-style: none; position: relative; padding-left: 20px; }
.pago-timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--gray100);
}
.pago-timeline li {
  position: relative;
  padding: 0 0 16px 18px;
}
.pago-timeline li::before {
  content: '';
  position: absolute;
  left: -14px; top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gray200);
  border: 2px solid var(--white);
}
.pago-timeline li.pagado::before  { background: var(--green); }
.pago-timeline li.pendiente::before { background: var(--orange); }

/* ── Login page ─────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}
.login-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 380px;
  overflow: hidden;
}
.login-header {
  background: var(--gold);
  padding: 22px;
  text-align: center;
}
.login-header .lh-logo { font-size: 2.2rem; }
.login-header .lh-title { font-weight: 800; color: var(--navy); font-size: 1.05rem; margin-top: 6px; }
.login-header .lh-sub   { font-size: .75rem; color: rgba(39,34,82,.65); }
.login-body { padding: 28px; }
.login-body .form-group { margin-bottom: 14px; }

/* ── Responsive básico ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .tipo-selector { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Utilidades ─────────────────────────────────────────────────────────────── */
.text-muted { color: var(--gray400); }
.text-sm    { font-size: .8rem; }
.text-center{ text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--gray100); margin: 20px 0; }
