/* =========================
   VARIABLES GENERALES
========================= */
:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --secondary-dark: #0f172a;
    --accent: #00c2ff;
    --success: #198754;
    --warning: #f59e0b;
    --danger: #dc3545;
    --light-bg: #f4f7fb;
    --card-bg: rgba(255, 255, 255, 0.92);
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-soft: rgba(255, 255, 255, 0.15);
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.18);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

/* =========================
   GENERALES
========================= */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
}

a {
    text-decoration: none;
}

.page-title {
    font-weight: 700;
    margin-bottom: 0;
}

.page-subtitle {
    color: var(--text-muted);
    margin-bottom: 0;
}

.btn-soft {
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 18px;
}

.content-wrapper {
    padding: 30px 0;
}

/* =========================
   NAVBAR
========================= */
.navbar-custom {
    background: linear-gradient(90deg, var(--secondary-dark), var(--primary-dark));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link,
.navbar-custom .navbar-text {
    color: #fff !important;
}

/* =========================
   LOGIN IMPACTANTE
========================= */
.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(0, 194, 255, 0.25), transparent 30%),
        radial-gradient(circle at bottom right, rgba(13, 110, 253, 0.25), transparent 35%),
        linear-gradient(135deg, #081a3a 0%, #0d47a1 45%, #0d6efd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 1150px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.login-brand-panel {
    position: relative;
    padding: 55px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.login-brand-panel::before,
.login-brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.login-brand-panel::before {
    width: 220px;
    height: 220px;
    top: -70px;
    right: -70px;
}

.login-brand-panel::after {
    width: 160px;
    height: 160px;
    bottom: -50px;
    left: -50px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 14px;
    margin-bottom: 18px;
}

.login-brand-title {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 14px;
}

.login-brand-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
    line-height: 1.7;
}

.login-feature-list {
    margin-top: 28px;
    padding-left: 0;
    list-style: none;
}

.login-feature-list li {
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-form-panel {
    background: rgba(255, 255, 255, 0.96);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-logo {
    width: 78px;
    height: 78px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 2rem;
    box-shadow: 0 12px 30px rgba(13, 110, 253, 0.28);
    margin-bottom: 18px;
}

.login-title {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--secondary-dark);
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-label.custom-label {
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.input-group.login-input-group {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.input-group.login-input-group .input-group-text {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: var(--primary-dark);
    min-width: 52px;
    justify-content: center;
}

.input-group.login-input-group .form-control {
    border: 1px solid #dbeafe;
    padding: 14px 14px;
    font-size: 15px;
}

.input-group.login-input-group .form-control:focus {
    box-shadow: none;
    border-color: var(--primary);
}

.login-btn {
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.28);
    transition: all 0.3s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px rgba(13, 110, 253, 0.34);
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* =========================
   DASHBOARD / TARJETAS
========================= */
.dashboard-card {
    border: none;
    border-radius: var(--radius-lg);
    transition: 0.3s ease;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 30px rgba(15, 23, 42, 0.14);
}

.dashboard-icon {
    font-size: 42px;
}

/* =========================
   CABECERAS DE MÓDULOS
========================= */
.module-header {
    background: linear-gradient(135deg, #ffffff, #eef4ff);
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    margin-bottom: 25px;
}

.module-header .icon-box {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 28px;
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.2);
}

/* =========================
   TARJETAS DE RESUMEN
========================= 
.stat-card {
    border: none;
    border-radius: 20px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
    height: 100%;
}

.stat-card .stat-title {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0;
}

.stat-card .stat-icon {
    font-size: 34px;
}*/

/* =========================
   TABLAS MODERNAS
========================= */
.table-card {
    border: none;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.table-modern {
    margin-bottom: 0;
}

.table-modern thead th {
    background: linear-gradient(90deg, var(--secondary-dark), #1d4ed8);
    color: #fff;
    border: none;
    font-size: 14px;
    vertical-align: middle;
    padding: 16px 12px;
}

.table-modern tbody td {
    vertical-align: middle;
    padding: 14px 12px;
    border-color: #edf2f7;
}

.table-modern tbody tr:hover {
    background: #f8fbff;
}

/*
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.2);
}

.user-name {
    font-weight: 700;
    color: var(--text-dark);
}

.user-email {
    font-size: 13px;
    color: var(--text-muted);
}
*/
.badge-status {
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
}

.badge-active {
    background: rgba(25, 135, 84, 0.12);
    color: #157347;
}

.badge-inactive {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}

.badge-role {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary-dark);
}

.badge-group {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.table-actions .btn {
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 600;
}

/* =========================
   ALERTAS
========================= */
.alert-custom {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 991px) {
    .login-wrapper {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 38px 28px;
    }
}

@media (max-width: 768px) {
    .module-header {
        padding: 18px;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .table-actions .btn {
        margin-bottom: 5px;
    }
}

/* =========================
   FORMULARIOS DE MÓDULOS
========================= */
.form-control,
.form-select {
    border-radius: 12px;
    min-height: 46px;
    border: 1px solid #dbe4f0;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
}

.input-group-text {
    border-radius: 12px 0 0 12px;
    background: #eef4ff;
    border: 1px solid #dbe4f0;
    color: var(--primary-dark);
    font-weight: 600;
}

.input-group .form-control,
.input-group .form-select {
    border-left: 0;
}

.form-check-input {
    width: 2.8rem;
    height: 1.4rem;
    cursor: pointer;
}

.form-check-label {
    margin-left: 8px;
}

/* =========================
   TABLA USUARIOS RESPONSIVE
========================= */
.users-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    min-width: 980px;
}

.users-table th,
.users-table td {
    white-space: nowrap;
}

.col-nombre {
    min-width: 220px;
}

.table-actions {
    min-width: 190px;
}

.table-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 2px;
}

/* =========================
   AJUSTES EN MÓVIL
========================= */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 16px 0;
    }

    .module-header {
        padding: 16px;
        border-radius: 18px;
    }

    .module-header .icon-box {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-subtitle {
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .btn-soft {
        padding: 8px 14px;
        font-size: 14px;
    }

    .table-modern thead th {
        font-size: 12px;
        padding: 12px 10px;
    }

    .table-modern tbody td {
        font-size: 13px;
        padding: 12px 10px;
    }

    .badge-role,
    .badge-group,
    .badge-status {
        font-size: 11px;
        padding: 6px 10px;
    }

    .table-actions .btn {
        padding: 6px 8px;
        font-size: 12px;
    }

    .action-text {
        display: none;
    }

    .table-actions {
        min-width: 110px;
    }

    .users-table {
        min-width: 900px;
    }
}

/* =========================
   BADGES ESTADO ASISTENCIAS
========================= */
.estado-badge {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.estado-exito {
    background-color: #198754;
    color: #fff;
}

.estado-alerta {
    background-color: #ffc107;
    color: #212529;
}

.estado-peligro {
    background-color: #dc3545;
    color: #fff;
}

.estado-secundario {
    background-color: #6c757d;
    color: #fff;
}

/* DASHBOARD RECTOR MINI CARDS */
.rector-mini-card{
    background:#fff;
    border-radius:20px;
    padding:20px;
    box-shadow:0 12px 28px rgba(15,23,42,.08);
    border:1px solid #eef2f7;
    height:100%;
    transition:all .3s ease;
}
.rector-mini-card:hover{
    transform:translateY(-4px);
    box-shadow:0 18px 30px rgba(15,23,42,.12);
}
.rector-mini-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:14px;
}
.rector-mini-label{
    font-size:13px;
    font-weight:600;
    color:#94a3b8;
}
.rector-mini-value{
    font-size:2rem;
    font-weight:800;
    color:#0f172a;
    margin:0 0 8px 0;
}
.rector-mini-desc{
    font-size:13px;
    color:#94a3b8;
    margin-bottom:12px;
}
.rector-mini-icon{
    width:48px;
    height:48px;
    border-radius:15px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    box-shadow:0 10px 20px rgba(15,23,42,.08);
}
.rector-mini-line{
    height:5px;
    border-radius:999px;
    width:100%;
}

.line-primary{background:linear-gradient(90deg,#2563eb,#60a5fa);}
.line-success{background:linear-gradient(90deg,#16a34a,#4ade80);}
.line-info{background:linear-gradient(90deg,#0ea5e9,#38bdf8);}
.line-warning{background:linear-gradient(90deg,#f59e0b,#facc15);}
.line-danger{background:linear-gradient(90deg,#ef4444,#fb7185);}
.line-danger-soft{background:linear-gradient(90deg,#f43f5e,#fda4af);}
.line-orange{background:linear-gradient(90deg,#f97316,#fdba74);}

.bg-primary-soft{background:rgba(37,99,235,.12);}
.bg-success-soft{background:rgba(22,163,74,.12);}
.bg-info-soft{background:rgba(14,165,233,.12);}
.bg-warning-soft{background:rgba(245,158,11,.15);}
.bg-danger-soft{background:rgba(239,68,68,.12);}
.bg-pink-soft{background:rgba(244,63,94,.12);}
.bg-orange-soft{background:rgba(249,115,22,.12);}
.text-orange{color:#ea580c !important;}

@media (max-width:768px){
    .rector-mini-card{
        padding:18px;
        border-radius:18px;
    }
    .rector-mini-value{
        font-size:1.7rem;
    }
    .rector-mini-icon{
        width:44px;
        height:44px;
        font-size:20px;
        border-radius:13px;
    }
}

/* GRID PROPIO PARA DASHBOARD DEL RECTOR */
.rector-grid{
    display:grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.rector-grid-item{
    min-width: 0;
}

@media (max-width: 991px){
    .rector-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px){
    .rector-grid{
        grid-template-columns: 1fr;
    }
}