/* SynapLMS — capa de layout sobre bloque-ui-system (premium silencioso) */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--carbon);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
}

.shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--crema-oscura);
    border-right: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    padding: 28px 16px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand a {
    font-size: 19px;
    font-weight: 500;
    color: var(--tinta);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.sidebar-brand span { color: var(--cobalto); }

.pill-empresa {
    margin-top: 10px;
    font-size: 12px;
    background: var(--cobalto-soft);
    color: var(--cobalto);
    border: none;
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
    font-family: inherit;
}

.sidebar-nav { margin-top: 36px; display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-nav a {
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--carbon);
    text-decoration: none;
    font-size: 14px;
}

.sidebar-nav a:hover { background: rgba(0, 0, 0, 0.04); }
.sidebar-nav a.active { background: var(--surface); color: var(--tinta); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }

.sidebar-footer { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.sidebar-footer .user-name { font-size: 13px; font-weight: 500; color: var(--tinta); }
.sidebar-footer .user-role { font-size: 12px; color: var(--piedra); margin-bottom: 8px; text-transform: capitalize; }

/* ---- Main ---- */
.main { flex: 1; padding: 40px 48px 64px; max-width: 1120px; }

/* ---- Utilidades de página ---- */
.page-title { font-size: var(--text-h1, 26px); font-weight: 500; color: var(--tinta); margin: 0 0 4px; letter-spacing: -0.02em; }
.page-sub { color: var(--piedra); font-size: 14px; margin: 0 0 32px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px; }
.stat .num { font-size: 28px; font-weight: 500; color: var(--tinta); letter-spacing: -0.02em; }
.stat .lbl { font-size: 13px; color: var(--piedra); margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--piedra); text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.table tr:last-child td { border-bottom: none; }

.form-grid { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--tinta); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=password],
.field input[type=number], .field input[type=date], .field select, .field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: var(--tinta);
    background: var(--surface);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--cobalto);
    box-shadow: 0 0 0 3px var(--cobalto-ring);
}
.field .error { color: var(--vino); font-size: 12px; margin-top: 4px; }

.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--canvas); font-family: var(--font-sans); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 40px; }
.auth-brand { font-size: 22px; font-weight: 500; color: var(--tinta); letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-brand span { color: var(--cobalto); }

/* ---- Lección / ejercicios ---- */
.leccion-contenido { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 32px 36px; font-size: 15.5px; line-height: 1.75; color: var(--carbon); }
.leccion-contenido h2 { font-size: 20px; color: var(--tinta); font-weight: 500; }
.leccion-contenido h3 { font-size: 16px; color: var(--tinta); font-weight: 500; }
.leccion-contenido mark { background: var(--dorado-bg); color: var(--dorado-text); padding: 0 3px; border-radius: 3px; }

.ejercicio { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; padding: 24px; margin-top: 16px; }
.ejercicio .pregunta { font-weight: 500; color: var(--tinta); margin-bottom: 14px; }
.opcion { display: block; width: 100%; text-align: left; padding: 11px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-family: inherit; font-size: 14px; color: var(--carbon); cursor: pointer; }
.opcion:hover { border-color: var(--cobalto); }
.opcion.correcta { border-color: var(--oliva); background: var(--oliva-soft); color: var(--oliva); }
.opcion.incorrecta { border-color: var(--vino); background: var(--vino-soft); color: var(--vino); }
.feedback { font-size: 13px; margin-top: 8px; }
.feedback.ok { color: var(--oliva); }
.feedback.mal { color: var(--vino); }

.modulo-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 12px; margin-bottom: 16px; overflow: hidden; }
.modulo-head { padding: 16px 20px; background: var(--crema-oscura); display: flex; justify-content: space-between; align-items: center; }
.modulo-head h3 { margin: 0; font-size: 15px; font-weight: 500; color: var(--tinta); }
.leccion-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.leccion-row a { color: var(--cobalto); text-decoration: none; }
.leccion-row .done { color: var(--oliva); }

.inline-form { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.inline-form input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 13px; }

@media (max-width: 800px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px 16px; gap: 12px; }
    .sidebar-nav { flex-direction: row; margin-top: 0; overflow-x: auto; }
    .sidebar-footer { border: none; padding: 0; margin-left: auto; }
    .sidebar-footer .user-name, .sidebar-footer .user-role { display: none; }
    .main { padding: 24px 16px 48px; }
}

/* UX14: skip link accesible */
.skip-link{position:absolute;left:-9999px;top:0;z-index:100;background:#101828;color:#fff;padding:10px 16px;border-radius:0 0 8px 0;font-weight:600}
.skip-link:focus{left:0}
/* UX08: estado de carga en submit */
button.is-loading,input.is-loading{opacity:.7;pointer-events:none}
button.is-loading::after{content:'';display:inline-block;width:13px;height:13px;margin-left:8px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;vertical-align:-2px;animation:synap-spin .6s linear infinite}
@keyframes synap-spin{to{transform:rotate(360deg)}}
