/* /home/tlearn/public_html/assets/css/learn.css
   Sistema de diseño canónico de Tudela Learn.
   Fork 1:1 de gestion.css (tokens matriz verbatim) con acento Learn.
   Acento de servicio: #FFB700 (ámbar). Light-only. Inter 300–600.
   Prefijo de clases: .l-  ·  Variables de servicio: --l-*
   Regla: los paneles NO definen estilos inline; consumen este archivo.
   ------------------------------------------------------------------ */

:root {
    /* ── Tokens matriz (verbatim) ── */
    --td-black: #050505;
    --td-text: #111111;
    --td-muted: #6f6f6f;
    --td-line: #e9e9e9;
    --td-soft: #f7f8fa;
    --td-white: #ffffff;
    --td-ease: cubic-bezier(.22, 1, .36, 1);

    --sa-bg: #f6f7f9;
    --sa-surface: #ffffff;
    --sa-line: #e7e8eb;
    --sa-line-2: #dcdee2;
    --sa-text-3: #9aa0a6;
    --sa-radius: 18px;
    --sa-radius-sm: 12px;
    --sa-maxw: 1120px;

    /* ── Extensiones Gestión ── */
    --l-accent: #FFB700;
    --l-accent-ink: #8a5b00;          /* texto sobre superficies lime claras */
    --l-accent-soft: rgba(255, 183, 0, .16);
    --l-accent-ring: rgba(255, 183, 0, .32);

    --l-ink-2: #374151;               /* texto secundario más fuerte que muted */
    --l-mute-bg: #f1f5f9;

    --ok: #16a34a;      --ok-bg: #f0fdf4;   --ok-line: #bbf7d0;
    --danger: #dc2626;  --danger-bg: #fef2f2; --danger-line: #fecaca;
    --warn: #d97706;    --warn-bg: #fffbeb; --warn-line: #fde68a;
    --info: #2563eb;    --info-bg: #eff6ff; --info-line: #bfdbfe;

    --radius-lg: 18px;
    --radius: 12px;
    --radius-sm: 9px;
    --radius-pill: 100px;

    --shadow-card: 0 1px 2px rgba(17, 17, 17, .04);
    --shadow-soft: 0 8px 22px rgba(17, 17, 17, .06);
    --shadow-pop: 0 18px 46px rgba(17, 17, 17, .10);
    --nav-h: 64px;
}

/* ── Reset / base ─────────────────────────────────── */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    color: var(--td-text);
    background: var(--sa-bg);
    -webkit-font-smoothing: antialiased;
    font-weight: 400;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; color: var(--td-black); }

/* ── App shell ────────────────────────────────────── */
.l-topbar {
    position: sticky; top: 0; z-index: 40;
    height: 60px;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--sa-line);
}
.l-topbar::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
    background: var(--l-accent); opacity: .9;
}
.l-topbar__inner {
    height: 100%; max-width: var(--sa-maxw); margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; gap: 16px;
}
.l-brand { display: inline-flex; align-items: center; }
.l-brand__logo { height: 30px; width: auto; display: block; }
.l-topbar__spacer { flex: 1; }

.l-user {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 5px 12px 5px 6px;
    background: var(--td-white); border: 1px solid var(--sa-line);
    border-radius: var(--radius-pill); font-size: 13px; color: var(--td-muted);
}
.l-user__avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--td-black); color: #fff;
    display: grid; place-items: center; font-size: 11px; font-weight: 600;
}
.l-user strong { color: var(--td-text); font-weight: 500; }

.l-logout {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--sa-text-3);
    padding: 7px 10px; border-radius: var(--radius-pill);
    transition: color .18s var(--td-ease), background .18s var(--td-ease);
}
.l-logout:hover { color: var(--danger); background: rgba(220, 38, 38, .06); }

.l-main { max-width: var(--sa-maxw); margin: 0 auto; padding: 30px 24px 64px; }
.l-main--narrow { max-width: 760px; }

.l-head { margin-bottom: 26px; }
.l-head__title { font-size: 24px; }
.l-head__sub { margin-top: 6px; font-size: 14px; color: var(--td-muted); }

.l-sectlabel {
    display: flex; align-items: center; gap: 14px;
    font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
    color: var(--sa-text-3); margin: 32px 0 16px;
}
.l-sectlabel::after { content: ""; flex: 1; height: 1px; background: var(--sa-line); }

/* ── Cards ────────────────────────────────────────── */
.l-card {
    background: var(--sa-surface); border: 1px solid var(--sa-line);
    border-radius: var(--radius-lg); padding: 22px;
    box-shadow: var(--shadow-card);
}
.l-card--accent { position: relative; overflow: hidden; }
.l-card--accent::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--l-accent); opacity: .95;
}
.l-card--link { display: block; transition: transform .18s var(--td-ease), box-shadow .18s var(--td-ease), border-color .18s var(--td-ease); }
.l-card--link:hover { transform: translateY(-2px); border-color: var(--sa-line-2); box-shadow: var(--shadow-soft); }

/* ── Botones ──────────────────────────────────────── */
.l-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1;
    padding: 11px 16px; border-radius: var(--radius);
    background: var(--td-white); color: var(--td-text);
    border: 1px solid var(--sa-line-2); cursor: pointer;
    transition: background .15s var(--td-ease), border-color .15s var(--td-ease), opacity .15s var(--td-ease), transform .15s var(--td-ease);
    text-decoration: none;
}
.l-btn:hover { background: var(--td-soft); }
.l-btn:active { transform: scale(.98); }
.l-btn svg, .l-btn .ti { font-size: 17px; }

.l-btn--primary { background: var(--td-black); color: #fff; border-color: var(--td-black); font-weight: 600; }
.l-btn--primary:hover { background: #000; opacity: .92; }

.l-btn--accent { background: var(--l-accent); color: var(--td-black); border-color: var(--l-accent); font-weight: 600; }
.l-btn--accent:hover { opacity: .9; background: var(--l-accent); }

.l-btn--danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.l-btn--ghost { background: transparent; border-color: transparent; color: var(--td-muted); }
.l-btn--ghost:hover { background: var(--td-soft); color: var(--td-text); }

.l-btn--sm { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.l-btn--block { width: 100%; }
.l-btn svg { transition: transform .15s var(--td-ease); }
.l-btn--primary:hover svg, .l-btn--accent:hover svg { transform: translateX(2px); }
.l-btn:disabled, .l-btn[disabled] { opacity: .5; cursor: not-allowed; }

.l-iconbtn {
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--td-white); border: 1px solid var(--sa-line-2);
    color: var(--td-muted); cursor: pointer;
    transition: background .15s var(--td-ease), color .15s var(--td-ease);
}
.l-iconbtn:hover { background: var(--td-soft); color: var(--td-text); }

/* ── Formularios ──────────────────────────────────── */
.l-field { margin-bottom: 16px; }
.l-field > label {
    display: block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--td-muted); margin-bottom: 7px;
}
.l-input, .l-field input, .l-field select, .l-field textarea {
    width: 100%; font-family: inherit; font-size: 14px; color: var(--td-text);
    background: var(--td-white); border: 1px solid var(--sa-line-2); border-radius: var(--radius);
    padding: 11px 13px; outline: none;
    transition: border-color .15s var(--td-ease), box-shadow .15s var(--td-ease);
}
.l-field textarea { resize: vertical; min-height: 96px; }
.l-input:focus,
.l-field input:focus, .l-field select:focus, .l-field textarea:focus {
    border-color: var(--l-accent);
    box-shadow: 0 0 0 3px var(--l-accent-ring);
}
.l-field__hint { margin-top: 6px; font-size: 12px; color: var(--sa-text-3); }
.l-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .l-grid-2 { grid-template-columns: 1fr; } }
.l-col-full { grid-column: 1 / -1; }
.l-label-opt { font-weight: 400; color: var(--td-muted); }

/* ── Alertas / flash ──────────────────────────────── */
.l-alert {
    font-size: 13px; border-radius: var(--radius); padding: 11px 14px; margin-bottom: 18px;
    display: flex; align-items: center; gap: 9px;
}
.l-alert--ok   { background: var(--ok-bg);     border: 1px solid var(--ok-line);     color: #15803d; }
.l-alert--err  { background: var(--danger-bg); border: 1px solid var(--danger-line); color: #b91c1c; }
.l-alert--warn { background: var(--warn-bg);   border: 1px solid var(--warn-line);   color: #b45309; }
.l-alert--info { background: var(--info-bg);   border: 1px solid var(--info-line);   color: #1d4ed8; }

/* ── Chips / badges ───────────────────────────────── */
.l-chip {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 500; line-height: 1;
    padding: 5px 10px; border-radius: var(--radius-pill);
    background: var(--l-mute-bg); color: var(--l-ink-2);
    border: 1px solid var(--sa-line);
}
.l-chip--ok     { background: var(--ok-bg);     color: #15803d; border-color: var(--ok-line); }
.l-chip--danger { background: var(--danger-bg); color: #b91c1c; border-color: var(--danger-line); }
.l-chip--warn   { background: var(--warn-bg);   color: #b45309; border-color: var(--warn-line); }
.l-chip--accent { background: var(--l-accent-soft); color: var(--l-accent-ink); border-color: transparent; }

/* ── Tablas ───────────────────────────────────────── */
.l-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.l-table th {
    text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--sa-text-3); padding: 10px 12px; border-bottom: 1px solid var(--sa-line);
}
.l-table td { padding: 12px; border-bottom: 1px solid var(--sa-line); color: var(--td-text); vertical-align: middle; }
.l-table tr:last-child td { border-bottom: none; }
.l-table tbody tr:hover td, .l-table tbody tr:hover td { background: var(--td-soft); }

/* ── KPIs / stats ─────────────────────────────────── */
.l-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.l-kpi {
    background: var(--sa-surface); border: 1px solid var(--sa-line);
    border-radius: var(--radius); padding: 18px 20px;
}
.l-kpi__l { font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--sa-text-3); margin-bottom: 10px; }
.l-kpi__n { font-size: 28px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--td-black); }
@media (max-width: 600px) { .l-kpis { grid-template-columns: 1fr; } }

/* ── Estado vacío ─────────────────────────────────── */
.l-empty { text-align: center; padding: 46px 20px; color: var(--td-muted); }
.l-empty__t { font-size: 16px; font-weight: 600; color: var(--td-text); margin-bottom: 6px; }
.l-empty__s { font-size: 13.5px; line-height: 1.55; max-width: 360px; margin: 0 auto; }

/* ── Modal ────────────────────────────────────────── */
.l-modal-bg {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(8, 10, 14, .5);
    display: flex; align-items: center; justify-content: center; padding: 24px;
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.l-modal {
    background: var(--sa-surface); border-radius: var(--radius-lg);
    padding: 28px 26px; max-width: 440px; width: 100%;
    box-shadow: var(--shadow-pop);
}
.l-modal__t { font-size: 18px; margin-bottom: 6px; }
.l-modal__s { font-size: 13.5px; color: var(--td-muted); line-height: 1.55; margin-bottom: 20px; }
.l-modal__act { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Nav inferior (móvil) ─────────────────────────── */
.l-bottomnav {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--nav-h); z-index: 40;
    background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--sa-line); display: flex;
}
.l-bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; color: var(--sa-text-3);
}
.l-bottomnav a .ti { font-size: 21px; }
.l-bottomnav a.is-active { color: var(--td-black); }
.l-bottomnav a.is-active .ti { color: var(--l-accent-ink); }
@media (min-width: 760px) { .l-bottomnav { display: none; } }
.l-has-bottomnav { padding-bottom: calc(var(--nav-h) + 12px); }
@media (min-width: 760px) { .l-has-bottomnav { padding-bottom: 64px; } }

/* ── Utilidades ───────────────────────────────────── */
.l-stack > * + * { margin-top: 14px; }
.l-row { display: flex; align-items: center; gap: 10px; }
.l-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.l-muted { color: var(--td-muted); }
.l-hide-mobile { }
@media (max-width: 600px) { .l-hide-mobile { display: none !important; } }