:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #eef1f8;
    --text: #141826;
    --muted: #5d6478;
    --border: #dfe3ee;
    --accent: #2f5bea;
    --accent-ink: #ffffff;
    --accent-soft: #e5ecff;
    --ok: #12805c;
    --ok-soft: #e2f5ed;
    --danger: #c23434;
    --danger-soft: #fdeaea;
    --hero-from: #0d1430;
    --hero-to: #1b2a6b;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(20, 24, 38, .05), 0 8px 24px rgba(20, 24, 38, .06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0c0f1a;
        --surface: #141a2b;
        --surface-2: #1b2237;
        --text: #e8ebf4;
        --muted: #98a0b6;
        --border: #262f48;
        --accent: #6d8cff;
        --accent-ink: #0c0f1a;
        --accent-soft: #1d2a55;
        --ok: #4fd1a1;
        --ok-soft: #12322a;
        --danger: #ff7b7b;
        --danger-soft: #3a1a1e;
        --hero-from: #070a14;
        --hero-to: #131c47;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); }
h1, h2 { line-height: 1.2; letter-spacing: -.02em; }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Barra superior */
.topbar { background: var(--hero-from); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; }
.marca-logo { font-family: "JetBrains Mono", monospace; background: #6d8cff; color: #0c0f1a; border-radius: 8px; padding: 2px 7px; font-size: 14px; font-weight: 700; }
.topbar-tag { font-size: 13px; color: rgba(255,255,255,.7); }

/* Hero */
.hero { background: linear-gradient(135deg, var(--hero-from), var(--hero-to)); color: #fff; padding: 48px 0 56px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); margin: 6px 0 10px; }
.hero .lead { color: rgba(255,255,255,.82); font-size: 18px; margin: 0 0 18px; max-width: 46ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: #9fb4ff; margin: 0; }
.eyebrow a { color: inherit; text-decoration: none; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 5px 12px; font-size: 14px; }

.terminal { background: #0a0d18; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.35); overflow: hidden; }
.terminal-bar { display: flex; gap: 6px; padding: 10px 12px; background: rgba(255,255,255,.04); }
.terminal-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal pre { margin: 0; padding: 14px 16px 18px; font: 13px/1.65 "JetBrains Mono", monospace; color: #d7dcf0; white-space: pre-wrap; word-break: break-word; }
.c-p { color: #6d8cff; } .c-m { color: #6b7391; } .c-u { color: #f7c66b; } .c-k { color: #c792ea; } .c-s { color: #8bd5a0; }
.cursor { animation: parpadeo 1s steps(1) infinite; color: #6d8cff; }
@keyframes parpadeo { 50% { opacity: 0; } }

/* Página de taller */
.columnas { display: grid; grid-template-columns: 1fr 420px; gap: 40px; padding-top: 0; padding-bottom: 56px; align-items: start; }
.info { padding-top: 36px; }
.info h2 { font-size: 22px; margin: 28px 0 10px; }
.info h2:first-child { margin-top: 0; }
.info p { margin: 0 0 12px; color: var(--text); }
.temario { padding-left: 0; list-style: none; counter-reset: t; margin: 0; }
.temario li { counter-increment: t; position: relative; padding: 12px 14px 12px 50px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.temario li::before { content: counter(t); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 700 13px/24px "JetBrains Mono", monospace; text-align: center; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { padding: 4px 0 4px 28px; position: relative; }
.check li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 700; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.columnas .panel { margin-top: -28px; position: sticky; top: 16px; }
.panel-titulo { font-size: 20px; margin: 18px 0 14px; }
.cupo-txt { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); }
.cupo-txt b { font-size: 22px; color: var(--text); }
.cupo-txt small { font-size: 14px; color: var(--muted); font-weight: 500; }
.barra { height: 8px; background: var(--surface-2); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.barra div { height: 100%; background: var(--accent); border-radius: 99px; }

/* Formularios */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 5px; }
.campo em { display: block; font-style: normal; color: var(--danger); font-size: 13px; margin-top: 4px; }
input, select, textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--bg);
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.fila { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fila-carrera { grid-template-columns: 1fr 96px; }
.check-campo { display: flex; align-items: center; gap: 10px; margin: 4px 0 18px; cursor: pointer; }
.check-campo input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }
.check-campo.alto { margin-top: 30px; }
.boton {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
    background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
    padding: 12px 18px; font: 600 16px Inter, sans-serif; cursor: pointer; text-decoration: none; min-height: 46px;
}
.boton:hover { filter: brightness(1.08); }
.boton-sec { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); width: auto; font-size: 14px; min-height: 40px; padding: 8px 14px; }
.nota { font-size: 13px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.aviso { border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-size: 15px; }
.aviso-error { background: var(--danger-soft); color: var(--danger); }
.aviso-ok { background: var(--ok-soft); color: var(--ok); }

/* Inicio */
.lista-talleres { padding-top: 0; padding-bottom: 56px; margin-top: -24px; display: grid; gap: 14px; }
.tarjeta-taller { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; color: var(--text); text-decoration: none; transition: transform .15s; }
.tarjeta-taller:hover { transform: translateY(-2px); border-color: var(--accent); }
.tarjeta-taller h2 { margin: 0 0 4px; font-size: 21px; }
.tarjeta-taller p { margin: 0; }
.meta { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.tarjeta-cupo { text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 10px 16px; min-width: 92px; }
.tarjeta-cupo b { display: block; font-size: 24px; line-height: 1.1; }
.tarjeta-cupo span { font-size: 12px; }
.tarjeta-cupo.lleno { background: var(--danger-soft); color: var(--danger); }
.vacio { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted); }

/* Confirmación */
.confirmacion { padding: 48px 16px; max-width: 560px; }
.panel-ok { text-align: center; }
.panel-ok h1 { margin: 10px 0 6px; }
.panel-ok .lead { margin: 0 0 18px; }
.ok-icono { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 28px; font-weight: 700; display: grid; place-items: center; margin: 0 auto; }
.folio { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 14px; margin-bottom: 8px; }
.folio span { display: block; font-size: 13px; color: var(--muted); }
.folio b { font-size: 28px; letter-spacing: .06em; color: var(--accent); }
.resumen { text-align: left; margin: 18px 0 22px; border-top: 1px solid var(--border); }
.resumen div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.resumen dt { color: var(--muted); }
.resumen dd { margin: 0; text-align: right; font-weight: 500; }
.panel-login h1 { font-size: 24px; margin-top: 0; }

/* Admin */
.admin .hero { display: none; }
.admin-cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 28px; padding-bottom: 16px; flex-wrap: wrap; }
.admin-cab h1 { margin: 4px 0 0; }
.admin-cab .eyebrow { color: var(--accent); }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.acciones form { margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a.activo { color: var(--text); border-color: var(--accent); }
.pill { font-size: 12px; background: var(--surface-2); border-radius: 99px; padding: 2px 8px; margin-left: 4px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stats span { display: block; font-size: 13px; color: var(--muted); }
.stats b { font-size: 26px; }
.barra-herr { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.buscar { display: flex; gap: 8px; flex: 1; min-width: 260px; max-width: 520px; }
.barra-herr .boton { width: auto; font-size: 14px; min-height: 40px; padding: 8px 14px; }
.tabla-cont { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 48px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); padding: 10px 12px; white-space: nowrap; }
.tabla td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.tabla form { margin: 0; }
.tabla td.mono { white-space: nowrap; }
.toggle { font: 500 13px Inter, sans-serif; border: 1px solid var(--border); background: var(--bg); color: var(--muted); border-radius: 99px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.toggle.on { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.enlace-peligro { background: none; border: 0; color: var(--danger); cursor: pointer; font: inherit; font-size: 13px; padding: 4px; }
.vacio-celda { text-align: center; color: var(--muted); padding: 32px !important; }
.form-taller { margin-bottom: 48px; max-width: 760px; }

.pie { padding: 22px 0; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); text-align: center; }

@media (max-width: 900px) {
    .hero-grid, .columnas { grid-template-columns: 1fr; }
    .terminal { display: none; }
    .columnas .panel { margin-top: -28px; position: static; }
    .info { padding-top: 8px; order: 2; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .topbar-tag { display: none; }
    .hero { padding: 32px 0 48px; }
    .fila { grid-template-columns: 1fr; gap: 0; }
    .fila-carrera { grid-template-columns: 1fr 90px; gap: 10px; }
    .panel { padding: 18px; }
    .tarjeta-taller { flex-direction: column; align-items: flex-start; }
}
