﻿/* wwwroot/css/site-theme.css */

:root {
    --sf-primary: #4361ee;
    --sf-primary-dark: #3730a3;
    --sf-radius: 1rem;
    --sf-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    --sf-shadow-hover: 0 8px 24px rgba(0, 0, 0, .10);

    /* Bootstrap/AdminLTE usan su azul por defecto (#0d6efd) en enlaces, .text-primary,
       .bg-primary, foco de formularios, etc. Se reemplaza por el índigo del portal para que
       todo el sitio hable el mismo color. */
    --bs-primary: #4361ee;
    --bs-primary-rgb: 67, 97, 238;
    --bs-primary-text-emphasis: #26389b;
    --bs-primary-bg-subtle: #e3e8fd;
    --bs-primary-border-subtle: #b4c0f8;
    --bs-link-color: #4361ee;
    --bs-link-color-rgb: 67, 97, 238;
    --bs-link-hover-color: #3730a3;
    --bs-link-hover-color-rgb: 55, 48, 163;
    --bs-focus-ring-color: rgba(67, 97, 238, .25);
}

/* Botones "outline" primarios (Mi QR, Ver detalle, Editar…) */
.btn-outline-primary {
    --bs-btn-color: #4361ee;
    --bs-btn-border-color: #4361ee;
    --bs-btn-hover-bg: #4361ee;
    --bs-btn-hover-border-color: #4361ee;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-color: #4361ee;
    --bs-btn-disabled-border-color: #4361ee;
    --bs-btn-focus-shadow-rgb: 67, 97, 238;
}

/* Foco de campos y casillas con el mismo color */
.form-control:focus, .form-select:focus {
    border-color: #a1b0f6;
    box-shadow: 0 0 0 .25rem rgba(67, 97, 238, .25);
}

.form-check-input:checked {
    background-color: #4361ee;
    border-color: #4361ee;
}

.form-check-input:focus {
    border-color: #a1b0f6;
    box-shadow: 0 0 0 .25rem rgba(67, 97, 238, .25);
}

.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    background-color: #4361ee;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6fb;
}

/* ---------- Sidebar: acento de color en el link activo ---------- */
.app-sidebar .nav-link.active {
    background-color: var(--sf-primary);
    border-radius: .5rem;
}

.sidebar-brand .brand-link {
    font-weight: 600;
    letter-spacing: .02em;
}

/* ---------- Tarjetas generales: más redondeadas y con sombra suave ---------- */
.card {
    border: none;
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow);
    background-color: #fff;
    color: #212529;
    transition: box-shadow .2s ease, transform .2s ease;
}

    .card.card-hover:hover {
        box-shadow: var(--sf-shadow-hover);
        transform: translateY(-2px);
    }

/* ---------- Stat cards (KPIs estilo Datix) ---------- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow);
    background: #fff;
}

    .stat-card .stat-icon {
        width: 56px;
        height: 56px;
        min-width: 56px;
        border-radius: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: #fff;
    }

.stat-icon.stat-blue {
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
}

.stat-icon.stat-amber {
    background: linear-gradient(135deg, #f9c74f, #f3722c);
}

.stat-icon.stat-green {
    background: linear-gradient(135deg, #43aa8b, #2d6a4f);
}

.stat-icon.stat-purple {
    background: linear-gradient(135deg, #7209b7, #560bad);
}

.stat-icon.stat-red {
    background: linear-gradient(135deg, #e5383b, #a4161a);
}

.stat-icon.stat-gray {
    background: linear-gradient(135deg, #adb5bd, #6c757d);
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: .15rem;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: .85rem;
}

/* ---------- Accesos rápidos: tarjetas clicables ---------- */
.quick-access-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

    .quick-access-card .card-body {
        text-align: center;
        padding: 1.75rem 1rem;
    }

    .quick-access-card i {
        font-size: 1.75rem;
        color: var(--sf-primary);
    }

    .quick-access-card.disabled {
        opacity: .55;
        pointer-events: none;
    }

    .quick-access-card .card {
        height: 100%;
    }

/* ---------- Celular: indicadores y accesos rápidos compactos, en fila ----------
   Antes cada tarjeta ocupaba todo el ancho y había que hacer mucho scroll. */
@media (max-width: 767.98px) {
    .stat-row .stat-card {
        flex-direction: column;
        text-align: center;
        gap: .4rem;
        padding: .75rem .4rem;
        height: 100%;
    }

        .stat-row .stat-card .stat-icon {
            width: 40px;
            height: 40px;
            min-width: 40px;
            border-radius: .75rem;
            font-size: 1.1rem;
        }

        .stat-row .stat-card .stat-number {
            font-size: 1.35rem;
        }

        .stat-row .stat-card .stat-label {
            font-size: .72rem;
            line-height: 1.2;
        }

    .quick-access-row .quick-access-card .card-body {
        padding: .9rem .25rem;
    }

    .quick-access-row .quick-access-card i {
        font-size: 1.4rem;
        margin-bottom: .3rem !important;
    }

    .quick-access-row .quick-access-card h6 {
        font-size: .74rem;
        line-height: 1.2;
    }
}

/* ---------- Tarjetas de sesión (asistencia) ---------- */
.session-card {
    border-left: 4px solid transparent;
}

    .session-card.session-pending {
        border-left-color: #f3722c;
    }

    .session-card.session-ready {
        border-left-color: #43aa8b;
    }

    .session-card.session-expired {
        border-left-color: #adb5bd;
    }

/* ---------- Botones ---------- */
.btn {
    border-radius: .6rem;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #3730a3);
    border: none;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #3730a3, #4361ee);
    }

/* ---------- Forzar modo claro en componentes base, sin importar el sistema ---------- */
.app-content, .app-main {
    background-color: #f4f6fb;
}

/* Reemplazo del combo alert-primary + bg-white que quedó ambiguo */
.welcome-banner {
    background-color: #fff;
    border-left: 4px solid var(--sf-primary);
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow);
    padding: 1.25rem 1.5rem;
}

    .welcome-banner h5 {
        color: #212529;
    }

    .welcome-banner p {
        color: #6c757d;
        margin-bottom: 0;
    }

/* ---------- Mi Horario ---------- */
.horario-tarjeta {
    border-left: 3px solid var(--sf-primary);
    background: #fff;
    border-radius: .5rem;
    padding: .5rem .75rem;
}

.horario-especial {
    border: 1px dashed #adb5bd;
    background: #f8f9fa;
    border-radius: .5rem;
    padding: .5rem .75rem;
}

/* Estado de la sesión con ícono + texto (antes solo ícono, ilegible en celular) */
.estado-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .7rem;
    font-weight: 600;
    border-radius: .4rem;
    padding: .12rem .45rem;
    white-space: nowrap;
}

.chip-carrera {
    font-size: .68rem;
    background: #f1f3f9;
    border: 1px solid #e3e6ef;
    border-radius: .4rem;
    padding: .1rem .4rem;
    color: #6c757d;
}

/* ---------- Horario con escala de horas (Views/Shared/_HorarioCuadricula) ----------
   Columna de horas + 7 días en computadora; 1 día con pestañas en celular. Cada hora mide
   --hc-alto-hora y los bloques se posicionan en % según su hora real. */
.hc {
    --hc-alto-hora: 64px;
    --hc-ancho-horas: 52px;
    background: #fff;
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow);
    overflow: hidden;
}

.hc-fila {
    display: grid;
    grid-template-columns: var(--hc-ancho-horas) repeat(7, minmax(0, 1fr));
}

.hc-cabecera {
    border-bottom: 1px solid #e3e6ef;
}

.hc-dia-titulo {
    text-align: center;
    padding: .5rem .25rem;
    font-size: .8rem;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

    .hc-dia-titulo.hoy {
        background: rgba(67, 97, 238, .10);
        color: var(--sf-primary-dark);
        border-bottom: 3px solid var(--sf-primary);
    }

.hc-cuerpo {
    height: calc(var(--hc-horas) * var(--hc-alto-hora));
    /* deja ver la etiqueta de la primera hora */
    padding-top: 0;
}

.hc-horas {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e3e6ef;
}

.hc-hora {
    height: var(--hc-alto-hora);
    position: relative;
    font-size: .72rem;
    color: #6c757d;
    text-align: right;
    padding-right: .4rem;
}

    .hc-hora span {
        position: relative;
        top: 2px;
    }

.hc-col {
    position: relative;
    border-right: 1px solid #eef0f5;
    /* línea fuerte cada hora y suave cada media hora */
    background-image:
        linear-gradient(to bottom, #e3e6ef 1px, transparent 1px),
        linear-gradient(to bottom, #f1f3f8 1px, transparent 1px);
    background-size: 100% var(--hc-alto-hora), 100% calc(var(--hc-alto-hora) / 2);
}

    .hc-col:last-child {
        border-right: none;
    }

    .hc-col.hoy {
        background-color: rgba(67, 97, 238, .035);
    }

.hc-vacio {
    position: absolute;
    top: .75rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: .72rem;
    color: #adb5bd;
}

.hc-bloque {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    text-align: left;
    border: none;
    border-left: 4px solid var(--hc-color, #6c757d);
    border-radius: .5rem;
    background: var(--hc-fondo, #f1f3f5);
    padding: .25rem .4rem;
    font-size: .72rem;
    line-height: 1.2;
    color: #212529;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    transition: box-shadow .15s ease, transform .15s ease;
}

    .hc-bloque:hover, .hc-bloque:focus-visible {
        box-shadow: var(--sf-shadow-hover);
        z-index: 2;
    }

.hc-bloque-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem;
    margin-bottom: .1rem;
}

.hc-bloque-hora {
    font-weight: 600;
    color: #6c757d;
    white-space: nowrap;
    margin-right: .1rem;
}

/* Indicador de estado: en computadora solo el ícono de color; en celular ícono + texto */
.hc-ind {
    display: inline-flex;
    align-items: center;
    gap: .2rem;
    border-radius: .35rem;
    padding: .05rem .3rem;
    font-size: .68rem;
    font-weight: 600;
    white-space: nowrap;
}

.hc-ind-texto {
    display: none;
}

/* Clase virtual: contorno punteado además del borde de estado */
.hc-bloque.hc-virtual {
    outline: 1px dashed var(--hc-color, #6c757d);
    outline-offset: -1px;
}

.hc-leyenda {
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin-top: .75rem;
    font-size: .78rem;
}

    .hc-leyenda .hc-ind {
        font-size: .75rem;
    }

.hc-leyenda-muestra {
    display: inline-block;
    width: 22px;
    height: 14px;
    border-radius: .25rem;
    margin-right: -.4rem;
}

.hc-virtual-muestra {
    border: 1px dashed #6c757d;
    border-left: 4px solid #6c757d;
}

.hc-especial-muestra {
    background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 4px, #dee2e6 4px, #dee2e6 8px);
}

.hc-bloque-titulo {
    font-weight: 700;
    text-transform: uppercase;
    font-size: .7rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hc-bloque-detalle {
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Color del borde/fondo según el estado (mismos colores que las etiquetas de estado) */
.hc-success { --hc-color: #198754; --hc-fondo: #e8f5ee; }
.hc-warning { --hc-color: #e0a800; --hc-fondo: #fff7e0; }
.hc-danger { --hc-color: #dc3545; --hc-fondo: #fdecee; }
.hc-info { --hc-color: #0aa2c0; --hc-fondo: #e6f7fb; }
.hc-primary { --hc-color: #4361ee; --hc-fondo: #eaeefd; }
.hc-secondary { --hc-color: #6c757d; --hc-fondo: #f1f3f5; }

.hc-bloque.hc-especial {
    background: repeating-linear-gradient(45deg, #f1f3f5, #f1f3f5 6px, #e9ecef 6px, #e9ecef 12px);
    color: #6c757d;
}

/* Línea de la hora actual */
.hc-ahora {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5383b;
    z-index: 3;
    pointer-events: none;
}

    .hc-ahora::before {
        content: "";
        position: absolute;
        left: -4px;
        top: -4px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #e5383b;
    }

/* Computadora: los 7 días; las pestañas no hacen falta */
@media (min-width: 992px) {
    .hc-tabs {
        display: none !important;
    }
}

/* Celular / tablet: columna de horas + 1 día (el elegido en las pestañas) */
@media (max-width: 991.98px) {
    .hc {
        --hc-alto-hora: 72px;
        --hc-ancho-horas: 46px;
    }

    .hc-fila {
        grid-template-columns: var(--hc-ancho-horas) minmax(0, 1fr);
    }

    .hc-oculto-movil {
        display: none !important;
    }

    .hc-bloque {
        font-size: .8rem;
        padding: .35rem .55rem;
    }

    .hc-bloque-titulo {
        font-size: .78rem;
    }

    /* En celular el bloque es ancho: se muestran los estados con texto, como en las tarjetas */
    .hc-ind-texto {
        display: inline;
    }

    .hc-ind {
        font-size: .72rem;
    }
}

/* ---------- Libreta de notas: en celular, solo 1 columna de nota visible a la vez ---------- */
@media (max-width: 991.98px) {
    .libreta-notas .col-nota {
        display: none;
    }

    .libreta-notas[data-tipo-activo="N1"] .col-nota[data-tipo="N1"],
    .libreta-notas[data-tipo-activo="N2"] .col-nota[data-tipo="N2"],
    .libreta-notas[data-tipo-activo="N3"] .col-nota[data-tipo="N3"],
    .libreta-notas[data-tipo-activo="N4"] .col-nota[data-tipo="N4"],
    .libreta-notas[data-tipo-activo="N5"] .col-nota[data-tipo="N5"],
    .libreta-notas[data-tipo-activo="N6"] .col-nota[data-tipo="N6"],
    .libreta-notas[data-tipo-activo="N7"] .col-nota[data-tipo="N7"],
    .libreta-notas[data-tipo-activo="N8"] .col-nota[data-tipo="N8"],
    .libreta-notas[data-tipo-activo="N9"] .col-nota[data-tipo="N9"],
    .libreta-notas[data-tipo-activo="N10"] .col-nota[data-tipo="N10"] {
        display: table-cell;
    }
}

.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4361ee, #3730a3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: .8rem;
}


/* ---------- Tabs del dashboard admin ---------- */
.dashboard-tabs .nav-link {
    border: none;
    border-radius: .75rem;
    padding: .6rem 1.25rem;
    font-weight: 500;
    color: var(--bs-secondary-color);
    background: transparent;
    display: flex;
    align-items: center;
    gap: .5rem;
}

    .dashboard-tabs .nav-link:hover {
        background: rgba(67, 97, 238, .06);
    }

    .dashboard-tabs .nav-link.active {
        background: var(--sf-primary);
        color: #fff;
        box-shadow: 0 4px 10px rgba(67, 97, 238, .25);
    }

    .dashboard-tabs .nav-link i {
        font-size: 1.1rem;
    }

.tab-pane-card {
    background: #fff;
    border-radius: var(--sf-radius);
    box-shadow: var(--sf-shadow);
    padding: 1.25rem;
}

/* ---------- Calendario de asistencia (alumno) — colores sólidos y notorios ---------- */
.bloque-calendario {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.grid-calendario {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    position: relative;
    transition: opacity .15s ease;
}

    .grid-calendario.cargando {
        opacity: .35;
        pointer-events: none;
    }

.encabezado-calendario {
    font-size: .7rem;
    color: #6c757d;
    text-align: center;
    padding-bottom: 2px;
    font-weight: 600;
}

.celda {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: .5rem;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
}

    .celda.relleno {
        opacity: .45;
    }

    .celda.bloqueado {
        background: #f1f2f5;
        color: #adb5bd;
        cursor: default;
    }

    /* Feriado en morado: antes compartía el ámbar de "tardanza" y no se distinguían */
    .celda.feriado {
        background: #7b1fa2;
        color: #fff;
    }

    .celda.futuro {
        background: #1565c0;
    }

    .celda.pendiente {
        background: #9e9e9e;
    }

    .celda.presente {
        background: #2e7d32;
    }

    .celda.tardanza {
        background: #f9a825;
        color: #4a3300;
    }

    .celda.ausente {
        background: #c62828;
    }

.punto {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}

.punto-presente {
    background: #2e7d32;
}

.punto-tardanza {
    background: #f9a825;
}

.punto-ausente {
    background: #c62828;
}

.punto-futuro {
    background: #1565c0;
}

.punto-pendiente {
    background: #9e9e9e;
}

.punto-feriado {
    background: #7b1fa2;
}

/* Spinner central mientras carga el mes */
.spinner-calendario {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

    .spinner-calendario.visible {
        display: block;
    }