/* ================================================================
   Licenciatura Economía – Asistencia Estudiantil
   ================================================================ */

:root {
    --licecon-page-gutter: max(clamp(20px, 4vw, 48px), calc((100vw - 1400px) / 2));
    --lce-red:      #dc2626;
    --lce-red-h:    #b91c1c;
    --lce-green:    #16a34a;
    --lce-amber:    #d97706;
    --lce-blue:     #1d4ed8;
    --lce-text:     #0f172a;
    --lce-muted:    #64748b;
    --lce-border:   #e2e8f0;
    --lce-bg:       #f4f7fb;
    --lce-card:     #ffffff;
    --lce-radius:   10px;
    --lce-shadow:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
}

.lce-wrap {
    background: var(--lce-bg);
    font-family: 'PT Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: none;
    margin: 0 calc(50% - 50vw);
    min-height: 100vh;
    padding: 40px var(--licecon-page-gutter) 64px;
    width: 100vw;
    color: var(--lce-text);
}

/* ── Material Icons ─────────────────────────────────────── */
.lce-wrap .material-icons-round {
    font-size: 1.1rem;
    vertical-align: middle;
    line-height: 1;
}
.lce-icon-sm { font-size: .95rem !important; }

/* ── Encabezado ─────────────────────────────────────────── */
.lce-header  { margin-bottom: 20px; }
.lce-title   { font-size: 1.45rem; font-weight: 700; margin: 0 0 4px; }
.lce-subtitle{ color: var(--lce-muted); font-size: .9rem; margin: 0; }

.lce-public-panel {
    align-items: flex-start;
    background: var(--lce-card);
    border: 1px solid var(--lce-border);
    border-radius: var(--lce-radius);
    box-shadow: var(--lce-shadow);
    display: flex;
    gap: 16px;
    max-width: 720px;
    padding: 20px;
}
.lce-public-panel__icon {
    align-items: center;
    background: #fef2f2;
    border-radius: 50%;
    color: var(--lce-red);
    display: flex;
    flex: 0 0 auto;
    height: 44px;
    justify-content: center;
    width: 44px;
}
.lce-public-panel__icon .material-icons-round {
    font-size: 1.45rem !important;
}
.lce-public-panel h3 {
    font-size: 1.05rem;
    line-height: 1.3;
    margin: 0 0 6px;
}
.lce-public-panel p {
    color: var(--lce-muted);
    font-size: .9rem;
    line-height: 1.45;
    margin: 0 0 14px;
}
.lce-public-panel__button {
    background: var(--lce-red);
    border-radius: 7px;
    color: #fff;
    display: inline-flex;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1;
    padding: 11px 16px;
    text-decoration: none;
}
.lce-public-panel__button:hover,
.lce-public-panel__button:focus {
    background: var(--lce-red-h);
    color: #fff;
}
@media (max-width: 600px) {
    .lce-public-panel {
        flex-direction: column;
    }
}

.lce-new-sessions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--lce-amber);
    border-radius: var(--lce-radius);
    color: var(--lce-text);
    box-shadow: var(--lce-shadow);
}
.lce-new-sessions strong {
    display: block;
    font-size: .9rem;
}
.lce-new-sessions span {
    display: block;
    margin-top: 2px;
    color: var(--lce-muted);
    font-size: .82rem;
}
.lce-new-sessions .lce-btn-reload {
    flex: 0 0 auto;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .lce-new-sessions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ── Stat cards ─────────────────────────────────────────── */
.lce-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 600px) { .lce-stats { grid-template-columns: repeat(2, 1fr); } }

.lce-stat {
    background: var(--lce-card);
    border: 1px solid var(--lce-border);
    border-radius: var(--lce-radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--lce-shadow);
}
.lce-stat-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; flex-shrink: 0;
}
.lce-stat-icon .material-icons-round { font-size: 1.3rem !important; }
.lce-stat-icon--red   { background: #fef2f2; }
.lce-stat-icon--green { background: #f0fdf4; }
.lce-stat-icon--blue  { background: #eff6ff; }
.lce-stat-icon--amber { background: #fffbeb; }

.lce-stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.lce-stat-label { font-size: .72rem; color: var(--lce-muted); margin-top: 2px; }

/* ── Tabs ───────────────────────────────────────────────── */
.lce-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--lce-border);
    margin-bottom: 20px;
}
.lce-tab {
    /* reset cualquier estilo de botón del tema */
    appearance: none; -webkit-appearance: none;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    box-shadow: none !important;
    outline: none;
    border-radius: 0 !important;
    cursor: pointer;
    /* tipografía */
    font-family: 'PT Sans', sans-serif;
    font-size: .78rem; font-weight: 700; letter-spacing: .06em;
    color: var(--lce-muted);
    padding: 10px 18px;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}
.lce-tab:hover,
.lce-tab:focus  { background: none !important; box-shadow: none !important; color: var(--lce-text); }
.lce-tab--active,
.lce-tab--active:hover,
.lce-tab--active:focus {
    background: none !important;
    box-shadow: none !important;
    color: var(--lce-red) !important;
    border-bottom-color: var(--lce-red) !important;
}

/* ── Clases: grid de cards ──────────────────────────────── */
.lce-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.lce-card-session {
    background: var(--lce-card);
    border: 1px solid var(--lce-border);
    border-radius: var(--lce-radius);
    padding: 16px;
    box-shadow: var(--lce-shadow);
    display: flex; flex-direction: column; gap: 12px;
}

.lce-card-session__head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
}
.lce-card-session__nombre { font-weight: 700; font-size: .95rem; }
.lce-card-session__grupo  { font-size: .78rem; color: var(--lce-muted); margin-top: 2px; }

.lce-card-session__meta { display: flex; flex-direction: column; gap: 5px; }
.lce-meta-row  { font-size: .82rem; color: var(--lce-muted); display: flex; align-items: center; gap: 6px; }
.lce-meta-icon { font-size: .85rem; width: 20px; text-align: center; display: flex; align-items: center; justify-content: center; }
.lce-meta-icon .material-icons-round { font-size: 1rem !important; color: var(--lce-muted); }

.lce-card-session__action { margin-top: auto; }

.lce-token-field {
    display: block;
    margin-bottom: 8px;
}
.lce-token-field span {
    display: block;
    color: var(--lce-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.lce-token-input {
    background: #fff;
    border: 1.5px solid var(--lce-border);
    border-radius: 7px;
    color: var(--lce-text);
    font-family: 'PT Sans', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: .16em;
    padding: 9px 12px;
    text-align: center;
    width: 100%;
}
.lce-token-input:focus {
    border-color: var(--lce-red);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .12);
    outline: none;
}

/* ── Pills / badges ─────────────────────────────────────── */
.lce-pill {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}
.lce-pill--green { background: #dcfce7; color: #15803d; }
.lce-pill--red   { background: #fee2e2; color: #b91c1c; }
.lce-pill--gray  { background: #f1f5f9; color: #475569; }
.lce-pill--amber { background: #fef9c3; color: #92400e; }

/* ── Botones ────────────────────────────────────────────── */
.lce-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; text-align: center;
    padding: 10px 16px;
    border-radius: 7px;
    font-family: 'PT Sans', sans-serif;
    font-size: .88rem; font-weight: 700;
    border: none; cursor: pointer;
    transition: background .2s, opacity .2s;
}
.lce-btn--primary  { background: var(--lce-red);   color: #fff; }
.lce-btn--primary:hover { background: var(--lce-red-h); }
.lce-btn--success  { background: #dcfce7; color: #15803d; }
.lce-btn--disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.lce-btn:disabled  { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }

/* ── Status / errores inline ────────────────────────────── */
.lce-status {
    display: block; margin-top: 6px;
    font-size: .8rem; text-align: center;
}
.lce-status.error { color: #b91c1c; }
.lce-status.ok    { color: #15803d; }

/* ── Geolocation help ───────────────────────────────────── */
.lce-geo-help {
    margin-top: 10px; padding: 12px 14px;
    background: #fffbeb; border: 1px solid #fde68a;
    border-left: 4px solid var(--lce-amber);
    border-radius: 7px; font-size: .82rem; color: #4a3800;
}
.lce-geo-help-title { font-weight: 700; margin: 0 0 6px; color: #92400e; display: flex; align-items: center; gap: 5px; }
.lce-geo-help p  { margin: 0 0 6px; }
.lce-geo-help ol { margin: 0 0 10px; padding-left: 18px; }
.lce-geo-help li { margin-bottom: 3px; line-height: 1.5; }

.lce-btn-reload {
    padding: 6px 14px; background: var(--lce-amber); color: #fff;
    border: none; border-radius: 5px; font-size: .8rem; font-weight: 600;
    cursor: pointer;
}
.lce-btn-reload:hover { background: #b45309; }
.lce-btn-bloqueado    { opacity: .5; cursor: not-allowed !important; }

/* ── Historial ──────────────────────────────────────────── */
.lce-hist-card {
    background: var(--lce-card);
    border: 1px solid var(--lce-border);
    border-radius: var(--lce-radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--lce-shadow);
}
.lce-hist-card__head {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 12px;
}
.lce-hist-card__nombre { font-weight: 700; font-size: .95rem; }
.lce-hist-card__periodo{ font-size: .75rem; color: var(--lce-muted); margin-top: 2px; }
.lce-hist-card__pct    { font-size: 1.5rem; font-weight: 700; color: var(--lce-red); }

.lce-progress {
    background: #e2e8f0; border-radius: 99px; height: 7px;
    overflow: hidden; margin-bottom: 4px;
}
.lce-progress__bar {
    background: var(--lce-green); height: 100%;
    border-radius: 99px; transition: width .4s;
    min-width: 2px;
}
.lce-progress__label { font-size: .75rem; color: var(--lce-muted); margin-bottom: 14px; }

.lce-table {
    width: 100%; border-collapse: collapse; font-size: .85rem;
}
.lce-table th {
    text-align: left; padding: 6px 8px;
    border-bottom: 2px solid var(--lce-border);
    color: var(--lce-muted); font-weight: 700;
    font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
}
.lce-table td {
    padding: 7px 8px; border-bottom: 1px solid var(--lce-border);
    vertical-align: middle;
}
.lce-table tr:last-child td { border-bottom: none; }

/* ── Panel docente frontend ─────────────────────────────── */
.lce-docente-layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
.lce-docente-sidebar {
    position: sticky;
    top: 18px;
}
.lce-docente-group-list {
    display: grid;
    gap: 8px;
}
.lce-docente-group {
    border: 1px solid var(--lce-border);
    border-radius: 8px;
    color: var(--lce-text);
    display: block;
    padding: 10px 12px;
    text-decoration: none;
}
.lce-docente-group:hover,
.lce-docente-group.is-active {
    background: #fef2f2;
    border-color: rgba(220, 38, 38, .35);
    color: var(--lce-text);
}
.lce-docente-group strong,
.lce-docente-group span {
    display: block;
}
.lce-docente-group span,
.lce-docente-muted {
    color: var(--lce-muted);
    font-size: .82rem;
}
.lce-docente-form {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lce-docente-form label,
.lce-docente-inline {
    min-width: 0;
}
.lce-docente-form label span {
    color: var(--lce-muted);
    display: block;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 4px;
    text-transform: uppercase;
}
.lce-docente-form input[type="text"],
.lce-docente-form select,
.lce-docente-inline input,
.lce-docente-inline select {
    background: #fff;
    border: 1.5px solid var(--lce-border);
    border-radius: 7px;
    color: var(--lce-text);
    font-family: 'PT Sans', sans-serif;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}
.lce-docente-check {
    align-items: center;
    display: flex;
    gap: 8px;
}
.lce-docente-check input {
    width: auto;
}
.lce-docente-check span {
    margin: 0;
}
.lce-docente-actions,
.lce-docente-check {
    align-self: end;
}
.lce-docente-section-head {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.lce-docente-section-head h2 {
    margin-bottom: 0;
}
.lce-docente-table-wrap {
    border: 1px solid var(--lce-border);
    border-radius: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
}
.lce-docente-table-wrap table {
    margin: 0;
}
.lce-docente-inline {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 1.1fr .8fr .8fr 1.4fr .8fr auto;
}
.lce-docente-alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 10px 12px;
}
.lce-docente-alert--ok {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}
.lce-docente-realtime-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 14px;
}
.lce-docente-realtime-head strong {
    color: var(--lce-text);
    font-size: 1.4rem;
}
.lce-docente-realtime-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
#lrt-token {
    letter-spacing: .16em;
}
@media (max-width: 900px) {
    .lce-docente-layout {
        grid-template-columns: 1fr;
    }
    .lce-docente-sidebar {
        position: static;
    }
    .lce-docente-form,
    .lce-docente-inline {
        grid-template-columns: 1fr;
    }
}

/* ── Estado vacío ───────────────────────────────────────── */
.lce-empty {
    text-align: center; padding: 48px 20px;
    color: var(--lce-muted); font-size: .9rem;
    background: var(--lce-card); border: 1px solid var(--lce-border);
    border-radius: var(--lce-radius); box-shadow: var(--lce-shadow);
}

/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 500px) {
    .lce-btn { font-size: .82rem; padding: 9px; }
    .lce-tab { padding: 8px 12px; font-size: .72rem; }
}
