/* Sistema de Gestión Académica Ranquel - Colegio de la UNLPam, Facultad de Ciencias Humanas - Estilo Personalizado */
/* TODAS LAS MEDIDAS EN UNIDADES RELATIVAS - SIN PÍXELES */

:root {
    /* 🎨 PALETA DE COLORES ESTÉTICA - Colegio FCH UNLPam
       Basada en #fcdca9 - Tonos cálidos y acogedores */

    /* Colores Principales - Beige/Crema */
    --primary-beige: #fcdca9;
    --primary-beige-light: #fef6e9;
    --primary-beige-dark: #f5d19d;
    --primary-border: #d4a574;

    /* Colores Secundarios - Marrones */
    --brown-warm: #8b6f47;
    --brown-medium: #7a6a5a;
    --brown-dark: #5a4a3a;
    --brown-darker: #3d2f23;

    /* Colores de Acento - Paleta Armoniosa */
    --accent-sage: #9db17c;
    --accent-coral: #e8a598;
    --accent-terracota: #c17767;
    --accent-lavender: #b8a9c9;
    --accent-peach: #f5c6a5;

    /* Colores de Estado */
    --success-green: #9db17c;
    --success-light: #d4e5c7;
    --warning-peach: #f5c6a5;
    --warning-light: #ffecd1;
    --danger-coral: #e8a598;
    --danger-light: #f8ddd8;
    --info-lavender: #b8a9c9;
    --info-light: #e5dff0;

    /* Neutros Cálidos */
    --neutral-cream: #fffef9;
    --neutral-warm-50: #f5f2ed;
    --neutral-warm-100: #e5ddd5;
    --neutral-warm-200: #d4cdc3;
    --neutral-warm-300: #c3b8aa;
    --neutral-warm-600: #8a7f72;
    --neutral-warm-700: #6b6159;

    /* Sombras Cálidas */
    --shadow-soft: rgba(90, 74, 58, 0.08);
    --shadow-medium: rgba(90, 74, 58, 0.15);
    --shadow-strong: rgba(90, 74, 58, 0.25);
}

/* ==========================================================================
   BASE GLOBAL - 100% RELATIVO
   ========================================================================== */

html {
    font-size: 100%; /* 16px base en la mayoría de navegadores */
    box-sizing: border-box;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--primary-beige-light);
    color: var(--brown-dark);
    line-height: 1.6;
    font-size: 1rem;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ==========================================================================
   TIPOGRAFÍA RESPONSIVE CON REM
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--brown-darker);
    margin-top: 0;
}

h1 {
    font-size: clamp(1.75rem, 3vw, 3rem);
    margin-bottom: 1.25rem;
}

h2 {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    margin-bottom: 1rem;
}

h3 {
    font-size: clamp(1.25rem, 2vw, 2rem);
    margin-bottom: 0.875rem;
}

h4 {
    font-size: clamp(1.125rem, 1.75vw, 1.75rem);
    margin-bottom: 0.75rem;
}

h5 {
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    margin-bottom: 0.625rem;
}

h6 {
    font-size: clamp(0.95rem, 1.25vw, 1.25rem);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   LAYOUT CONTAINERS - ANCHOS RELATIVOS
   ========================================================================== */

.container {
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
}

.container-fluid {
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(0.75rem, 1.5vw, 2rem);
    padding-right: clamp(0.75rem, 1.5vw, 2rem);
    box-sizing: border-box;
}

@media (min-width: 75em) { /* 1200px */
    .container {
        max-width: 95%;
    }

    .container-fluid {
        max-width: 98%;
    }
}

@media (min-width: 90em) { /* 1440px */
    .container {
        max-width: 92%;
    }

    .container-fluid {
        max-width: 97%;
    }
}

@media (min-width: 120em) { /* 1920px */
    .container {
        max-width: 90%;
    }

    .container-fluid {
        max-width: 96%;
    }
}

/* Max-width para pantallas 4K — evitar layout excesivamente ancho */
@media (min-width: 160em) { /* 2560px */
    .container,
    .container-fluid {
        max-width: 1400px !important;
        margin-inline: auto !important;
    }

    .sistema-navbar .navbar-inner {
        max-width: 1400px !important;
        margin-inline: auto !important;
    }
}

/* ==========================================================================
   NAVBAR - COMPLETAMENTE RESPONSIVE
   ========================================================================== */

.sistema-header {
    background: linear-gradient(135deg, #fcdca9 0%, #f5d19d 100%);
    box-shadow: 0 0.125rem 0.5rem rgba(0,0,0,0.15);
    border-bottom: 0.1875rem solid #d4a574;
    padding: clamp(0.5rem, 1vw, 1rem) 0;
}

.sistema-brand {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: clamp(1.5rem, 2vw, 2.25rem);
    color: #5a4a3a !important;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: all 0.2s ease;
    text-shadow: 0 0.0625rem 0.125rem rgba(255,255,255,0.5);
}

.sistema-brand:hover {
    color: #3d2f23 !important;
    transform: translateY(-0.0625rem);
}

.sistema-logo,
.navbar-brand img {
    height: clamp(3.5rem, 5vw, 6rem);
    width: auto;
    margin-right: clamp(0.75rem, 1.25vw, 1.5rem);
}

.navbar {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    font-size: clamp(0.9rem, 1vw, 1.1rem);
    padding: 0.625rem 1rem !important;
    color: #5a4a3a !important;
    border-radius: 0.375rem;
    margin: 0 0.25rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    background-color: rgba(212, 165, 116, 0.3);
    color: #3d2f23 !important;
    transform: translateY(-0.125rem);
}

.navbar-nav .nav-link i {
    margin-right: 0.375rem;
    font-size: 0.9em;
}

/* ==========================================================================
   DROPDOWN MENUS
   ========================================================================== */

.dropdown-menu {
    border: 0.125rem solid #d4a574;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.12);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    background: #fffef9;
    font-size: clamp(0.9rem, 1vw, 1rem);
    min-width: clamp(12rem, 15vw, 17.5rem);
}

.dropdown-item {
    padding: 0.625rem 1.25rem;
    font-size: inherit;
    font-weight: 500;
    color: #5a4a3a;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: #fcdca9;
    color: #3d2f23;
}

.dropdown-item i {
    width: 1.25rem;
    margin-right: 0.625rem;
    text-align: center;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 0.0625rem solid var(--neutral-300);
}

.dropdown-header {
    padding: 0.5rem 1.5rem;
    font-size: 0.8em;
    font-weight: 700;
    color: #3d2f23;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f5d19d;
}

/* ==========================================================================
   CARDS - RESPONSIVE
   ========================================================================== */

.card {
    border: 0.125rem solid var(--neutral-warm-100);
    border-radius: 1rem;
    box-shadow: 0 0.125rem 0.5rem var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--neutral-cream);
    overflow: hidden;
    margin-bottom: clamp(1rem, 2vw, 1.5rem);
    max-width: 100%;
}

.card:hover {
    box-shadow: 0 0.5rem 1.5rem var(--shadow-medium);
    transform: translateY(-0.125rem);
    border-color: var(--primary-border);
}

.card-header {
    background: linear-gradient(135deg, #fcdca9 0%, #f5d19d 100%);
    color: #3d2f23 !important;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-bottom: 0.125rem solid #d4a574;
    padding: clamp(0.875rem, 1.5vw, 1.5rem) clamp(1rem, 2vw, 2rem);
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-size: clamp(1rem, 1.25vw, 1.35rem);
}

.card-header h5,
.card-header h6,
.card-header * {
    color: #3d2f23 !important;
}

.card-body {
    padding: clamp(1rem, 2vw, 1.5rem);
}

/* ==========================================================================
   BOTONES - TOTALMENTE RESPONSIVE
   ========================================================================== */

.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-radius: 0.625rem;
    padding: clamp(0.5rem, 1vw, 0.875rem) clamp(0.875rem, 1.5vw, 1.5rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    font-size: clamp(0.9rem, 1vw, 1.125rem);
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-sm {
    padding: clamp(0.375rem, 0.75vw, 0.5rem) clamp(0.625rem, 1vw, 0.875rem);
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    min-height: 2rem;
}

.btn-lg {
    padding: clamp(0.75rem, 1.25vw, 1rem) clamp(1.25rem, 2vw, 1.75rem);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    min-height: 3rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-beige) 0%, var(--primary-beige-dark) 100%);
    color: var(--brown-darker);
    border: 0.125rem solid var(--primary-border);
    box-shadow: 0 0.25rem 0.75rem var(--shadow-medium);
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-beige-dark) 0%, #ecc584 100%);
    color: var(--brown-darker);
    border-color: #c69563;
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.375rem 1.25rem var(--shadow-strong);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green) 0%, #b0c48f 100%);
    color: #fff;
    border: 0.125rem solid #8a9f6b;
    box-shadow: 0 0.25rem 0.75rem rgba(157, 177, 124, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #8a9f6b 0%, #9db17c 100%);
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.375rem 1.25rem rgba(157, 177, 124, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-peach) 0%, #f7d0b3 100%);
    color: var(--brown-darker);
    border: 0.125rem solid #e5b594;
    box-shadow: 0 0.25rem 0.75rem rgba(245, 198, 165, 0.3);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f7d0b3 0%, #e5b594 100%);
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.375rem 1.25rem rgba(245, 198, 165, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-coral) 0%, #edb5a9 100%);
    color: #fff;
    border: 0.125rem solid #d99387;
    box-shadow: 0 0.25rem 0.75rem rgba(232, 165, 152, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d99387 0%, #e8a598 100%);
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.375rem 1.25rem rgba(232, 165, 152, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--brown-warm) 0%, #9d8159 100%);
    color: #fff;
    border: 0.125rem solid #7a5f3b;
    box-shadow: 0 0.25rem 0.75rem rgba(139, 111, 71, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #7a5f3b 0%, #8b6f47 100%);
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.375rem 1.25rem rgba(139, 111, 71, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-lavender) 0%, #c5b8d4 100%);
    color: #fff;
    border: 0.125rem solid #a699b8;
    box-shadow: 0 0.25rem 0.75rem rgba(184, 169, 201, 0.3);
}

.btn-info:hover {
    background: linear-gradient(135deg, #a699b8 0%, #b8a9c9 100%);
    transform: translateY(-0.1875rem);
    box-shadow: 0 0.375rem 1.25rem rgba(184, 169, 201, 0.4);
}

.btn-outline-primary {
    border: 0.125rem solid #d4a574;
    color: #b8935d;
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #fcdca9 0%, #f5d19d 100%);
    color: #3d2f23;
    border-color: #d4a574;
}

/* ==========================================================================
   FORMULARIOS - RESPONSIVE
   ========================================================================== */

.form-control,
.form-select {
    border: 0.125rem solid var(--neutral-warm-200);
    border-radius: 0.625rem;
    padding: clamp(0.5rem, 1vw, 0.875rem) clamp(0.75rem, 1.25vw, 1.25rem);
    font-size: clamp(0.9rem, 1vw, 1.125rem);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--neutral-cream);
    color: var(--brown-dark);
    min-height: 2.75rem;
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-border);
    box-shadow: 0 0 0 0.25rem rgba(212, 165, 116, 0.15), 0 0.25rem 0.75rem var(--shadow-soft);
    background: #fff;
    transform: translateY(-0.125rem);
}

.form-label {
    font-weight: 600;
    color: var(--brown-darker);
    margin-bottom: 0.5rem;
    font-size: clamp(0.875rem, 1vw, 1rem);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   TABLAS - OPTIMIZADAS PARA NO SCROLL HORIZONTAL
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.table {
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.5rem var(--shadow-soft);
    font-size: clamp(0.8rem, 0.95vw, 1rem);
    margin-bottom: 0;
    table-layout: auto;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-beige) 0%, var(--primary-beige-dark) 100%);
    color: var(--brown-darker);
    font-weight: 600;
    text-transform: uppercase;
    font-size: clamp(0.75rem, 0.85vw, 0.9rem);
    letter-spacing: 0.05em;
    border: none;
    padding: clamp(0.625rem, 1vw, 1rem) clamp(0.5rem, 0.75vw, 0.875rem);
    border-bottom: 0.1875rem solid var(--primary-border);
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.3;
}

.table tbody tr {
    transition: all 0.2s ease;
    background: var(--neutral-cream);
}

.table tbody tr:nth-child(even) {
    background: var(--neutral-warm-50);
}

.table tbody tr:hover {
    background: linear-gradient(90deg, var(--primary-beige-light) 0%, var(--neutral-warm-50) 100%);
    transform: scale(1.002);
    box-shadow: 0 0.125rem 0.5rem var(--shadow-soft);
}

.table td {
    padding: clamp(0.5rem, 0.85vw, 0.875rem) clamp(0.5rem, 0.75vw, 0.75rem);
    vertical-align: middle;
    border-top: 0.0625rem solid var(--neutral-warm-100);
    color: var(--brown-dark);
    line-height: 1.4;
}

/* Optimización específica para tabla de estudiantes */
.admin-students-page .table {
    table-layout: auto;
    width: 100%;
    max-width: 100%;
}

.admin-students-page .table thead th {
    font-size: clamp(0.75rem, 0.9vw, 1rem);
    padding: clamp(0.4rem, 0.7vw, 0.8rem) clamp(0.2rem, 0.35vw, 0.45rem);
    white-space: nowrap;
}

.admin-students-page .table tbody td {
    font-size: clamp(0.8rem, 0.95vw, 1.05rem);
    padding: clamp(0.4rem, 0.7vw, 0.8rem) clamp(0.2rem, 0.35vw, 0.45rem);
}

.admin-students-page .table tbody td strong {
    font-size: 1.05em;
}

.admin-students-page .table tbody td small {
    font-size: 0.9em;
}

/* Anchos relativos para columnas de tabla de estudiantes - RESPONSIVE */
.admin-students-page .table tbody td:nth-child(1) { /* Foto */
    width: 3.5%;
    padding: 0.2rem !important;
}

.admin-students-page .table tbody td:nth-child(2) { /* Info Personal */
    width: 12%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-students-page .table tbody td:nth-child(3) { /* Email */
    width: 10%;
    word-break: break-all;
    overflow-wrap: break-word;
}

.admin-students-page .table tbody td:nth-child(4) { /* Datos Académicos */
    width: 10.5%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-students-page .table tbody td:nth-child(5) { /* Info Nacimiento */
    width: 9.5%;
    word-break: break-word;
}

.admin-students-page .table tbody td:nth-child(6) { /* Dirección */
    width: 9.5%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-students-page .table tbody td:nth-child(7) { /* Escuela Origen */
    width: 8.5%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-students-page .table tbody td:nth-child(8) { /* Tutores */
    width: 11%;
    word-break: break-word;
    overflow-wrap: break-word;
}

.admin-students-page .table tbody td:nth-child(9) { /* Estado */
    width: 7.5%;
}

.admin-students-page .table tbody td:nth-child(10) { /* Acciones */
    width: 5.5%;
}

/* Imágenes de perfil en tablas - RESPONSIVE */
.table img.rounded-circle,
.table .bg-primary.rounded-circle {
    width: clamp(2rem, 3vw, 3.5rem) !important;
    height: clamp(2rem, 3vw, 3.5rem) !important;
    object-fit: cover;
    flex-shrink: 0;
}

/* ==========================================================================
   BADGES - RESPONSIVE
   ========================================================================== */

.badge {
    font-weight: 500;
    padding: clamp(0.3rem, 0.5vw, 0.5rem) clamp(0.5rem, 0.75vw, 0.85rem);
    border-radius: 0.375rem;
    font-size: clamp(0.85rem, 0.95vw, 1.05rem);
    letter-spacing: 0.02em;
    display: inline-block;
}

.admin-students-page .badge {
    font-size: clamp(0.8rem, 0.9vw, 1rem);
    padding: clamp(0.25rem, 0.4vw, 0.45rem) clamp(0.4rem, 0.55vw, 0.65rem);
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-beige) 0%, var(--primary-beige-dark) 100%) !important;
    color: var(--brown-darker) !important;
    border: 0.0625rem solid var(--primary-border);
    box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--info-lavender) 0%, #c5b8d4 100%) !important;
    color: #fff !important;
    border: 0.0625rem solid #a699b8;
    box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-green) 0%, #b0c48f 100%) !important;
    color: #fff !important;
    border: 0.0625rem solid #8a9f6b;
    box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--warning-peach) 0%, #f7d0b3 100%) !important;
    color: var(--brown-darker) !important;
    border: 0.0625rem solid #e5b594;
    box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-coral) 0%, #edb5a9 100%) !important;
    color: #fff !important;
    border: 0.0625rem solid #d99387;
    box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

.badge.bg-secondary {
    background: linear-gradient(135deg, var(--brown-warm) 0%, #9d8159 100%) !important;
    color: #fff !important;
    border: 0.0625rem solid #7a5f3b;
    box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

/* ==========================================================================
   ALERTS - RESPONSIVE
   ========================================================================== */

.alert {
    border: none;
    border-radius: 0.75rem;
    padding: clamp(0.875rem, 1.25vw, 1.25rem) clamp(1rem, 1.5vw, 1.5rem);
    border-left: 0.3125rem solid;
    box-shadow: 0 0.125rem 0.5rem var(--shadow-soft);
    font-weight: 500;
    font-size: clamp(0.9rem, 1vw, 1rem);
}

.alert-success {
    background: linear-gradient(135deg, var(--success-light) 0%, #e0efd6 100%);
    border-left-color: var(--success-green);
    color: #4a6b3a;
}

.alert-danger {
    background: linear-gradient(135deg, var(--danger-light) 0%, #fce8e4 100%);
    border-left-color: var(--danger-coral);
    color: #8b4a42;
}

.alert-info {
    background: linear-gradient(135deg, var(--info-light) 0%, #ece7f3 100%);
    border-left-color: var(--info-lavender);
    color: #5d4f73;
}

.alert-warning {
    background: linear-gradient(135deg, var(--warning-light) 0%, #fff5dc 100%);
    border-left-color: var(--warning-peach);
    color: #8b6d3f;
}

/* ==========================================================================
   MODALES - RESPONSIVE
   ========================================================================== */

.modal-body {
    padding: clamp(1rem, 2vw, 2rem);
    font-size: clamp(0.9rem, 1vw, 1rem);
}

.modal-header {
    padding: clamp(0.875rem, 1.5vw, 1.5rem) clamp(1rem, 2vw, 2rem);
}

.modal-footer {
    padding: clamp(0.875rem, 1.25vw, 1.25rem) clamp(1rem, 2vw, 2rem);
}

.modal-title {
    font-size: clamp(1.25rem, 1.75vw, 1.75rem);
}

/* ==========================================================================
   STAT CARDS - RESPONSIVE
   ========================================================================== */

.stat-card {
    padding: clamp(1rem, 2vw, 1.5rem);
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--neutral-cream) 0%, var(--neutral-warm-50) 100%);
    border: 0.125rem solid var(--neutral-warm-100);
    box-shadow: 0 0.25rem 0.75rem var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--primary-beige) 0%, var(--primary-border) 100%);
}

.stat-card:hover {
    transform: translateY(-0.375rem);
    box-shadow: 0 0.75rem 1.75rem var(--shadow-medium);
    border-color: var(--primary-border);
}

.stat-card .stat-icon {
    --icon-size: clamp(3.5rem, 5.5vw, 5.5rem);
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--icon-size) * 0.52);
    margin-bottom: 0.75rem;
    box-shadow: 0 0.25rem 0.75rem var(--shadow-soft);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.stat-card:hover .stat-icon {
    transform: scale(1.05) rotate(3deg);
}

.stat-card .stat-value {
    font-size: clamp(1.85rem, 3.5vw, 3rem);
    font-weight: 800;
    color: var(--brown-darker);
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    color: var(--brown-warm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

/* Colores de stat cards */
.stat-card.students .stat-icon {
    background: linear-gradient(135deg, var(--success-green) 0%, #b0c48f 100%);
    color: #fff;
}

.stat-card.teachers .stat-icon {
    background: linear-gradient(135deg, var(--info-lavender) 0%, #c5b8d4 100%);
    color: #fff;
}

.stat-card.courses .stat-icon {
    background: linear-gradient(135deg, var(--warning-peach) 0%, #f7d0b3 100%);
    color: var(--brown-darker);
}

.stat-card.attendance .stat-icon {
    background: linear-gradient(135deg, var(--accent-terracota) 0%, #cd8878 100%);
    color: #fff;
}

.stat-card.pending .stat-icon {
    background: linear-gradient(135deg, #f4c430 0%, #f0ad4e 100%);
    color: #fff;
}

/* ==========================================================================
   FOOTER - RESPONSIVE
   ========================================================================== */

.footer,
.footer-modern {
    background: linear-gradient(135deg, #fcdca9 0%, #f5d19d 100%);
    color: #3d2f23;
    margin-top: clamp(2rem, 4vw, 4rem);
    border-top: 0.25rem solid #d4a574;
    font-family: 'Poppins', sans-serif;
    padding: clamp(1.5rem, 2.5vw, 2.5rem) 0;
}

.footer-logo-main {
    height: clamp(4rem, 6vw, 6rem);
    max-height: 6rem;
    filter: drop-shadow(0 0.375rem 0.75rem var(--shadow-medium));
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.footer-logo-main:hover {
    transform: scale(1.05);
}

.footer-title-main {
    font-size: clamp(1.1rem, 1.4vw, 1.35rem);
    font-weight: 800;
    color: var(--brown-darker);
    margin-bottom: 0.5rem;
}

.footer-subtitle-main {
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    font-weight: 600;
    color: var(--brown-warm);
}

.footer-system-text {
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: var(--neutral-warm-600);
}

.footer-heading {
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    font-weight: 600;
    color: var(--brown-darker);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 0.125rem solid var(--accent-terracota);
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.footer-text {
    font-size: clamp(0.875rem, 1vw, 1rem);
    color: var(--brown-dark);
    line-height: 1.7;
}

.footer-copyright {
    font-size: clamp(0.875rem, 1vw, 1rem);
    color: var(--brown-darker);
    font-weight: 600;
}

.footer-tech {
    font-size: clamp(0.8rem, 0.9vw, 0.9rem);
    color: var(--neutral-warm-600);
}

.btn-footer-email,
.btn-footer-link {
    padding: clamp(0.5rem, 0.85vw, 0.75rem) clamp(0.75rem, 1.15vw, 1rem);
    font-size: clamp(0.875rem, 1vw, 1rem);
    margin-bottom: 0.75rem;
}

/* ==========================================================================
   LOGIN PAGE - RESPONSIVE
   ========================================================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-beige) 0%, var(--primary-beige-dark) 30%, var(--primary-border) 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem 1rem;
}

.login-card {
    background: var(--neutral-cream);
    border-radius: 1.25rem;
    box-shadow: 0 1.25rem 3.75rem var(--shadow-strong);
    overflow: hidden;
    border: 0.1875rem solid var(--primary-border);
    position: relative;
    z-index: 1;
    max-width: 90%;
    margin: 0 auto;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-beige) 0%, var(--primary-beige-dark) 100%);
    color: var(--brown-darker);
    text-align: center;
    padding: clamp(2rem, 3vw, 3rem) clamp(1.5rem, 2vw, 2rem);
    border-bottom: 0.1875rem solid var(--primary-border);
}

.login-header .sistema-logo {
    height: clamp(3.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0.25rem 0.5rem var(--shadow-soft));
}

/* ==========================================================================
   UTILIDADES DE SPACING - RESPONSIVE
   ========================================================================== */

.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 0.75rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }

.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 0.75rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 2rem !important; }

.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 0.75rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 2rem !important; }

/* ==========================================================================
   MEDIA QUERIES - OPTIMIZACIÓN POR TAMAÑO
   ========================================================================== */

/* Tablets y pantallas medianas */
@media (max-width: 62em) { /* 992px */
    .admin-students-page .table {
        font-size: 0.8rem;
    }

    .admin-students-page .table thead th,
    .admin-students-page .table tbody td {
        padding: 0.4rem 0.25rem;
    }
}

/* Tablets pequeñas */
@media (max-width: 48em) { /* 768px */
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }

    .card-body {
        padding: 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
        padding: 1rem 0.75rem;
    }

    /* En tablet, el ícono usa tamaño fijo para no depender de vw estrecho */
    .stat-card .stat-icon {
        --icon-size: 3.5rem;
    }
}

/* Móviles */
@media (max-width: 36em) { /* 576px */
    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }

    /* Stat-cards en mobile: ícono fijo, layout horizontal para mejor uso del espacio */
    .stat-card {
        padding: 0.75rem;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 0.75rem;
    }

    .stat-card .stat-icon {
        --icon-size: 2.75rem;
        margin-bottom: 0;
        flex-shrink: 0;
        border-radius: 0.75rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem !important;
        margin-bottom: 0.1rem;
    }

    .stat-card .stat-label {
        font-size: 0.68rem !important;
        letter-spacing: 0.03em;
    }

    .table {
        font-size: 0.8rem;
    }

    /* Solo botones de formularios y acciones principales — NO botones de tabla/inline */
    .form-submit-btn,
    .btn-mobile-full {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .brand-tagline {
        display: none !important;
    }
    .sistema-header {
        padding: 0.5rem 0 !important;
    }

    /* Botones en tablas: nunca full-width */
    .table .btn,
    .btn-group .btn,
    .btn-inline {
        width: auto !important;
        margin-bottom: 0 !important;
    }
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(0.625rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-0.625rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu {
    animation: fadeInDown 0.2s ease-out;
}

/* ==========================================================================
   ICONOS - TAMAÑOS RELATIVOS
   ========================================================================== */

i.fas, i.far, i.fab, i.bi {
    font-size: 1em;
}

.btn i {
    margin-right: 0.375em;
}

/* ==========================================================================
   MEJORAS DE ACCESIBILIDAD
   ========================================================================== */

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 0.125rem solid #d4a574;
    outline-offset: 0.125rem;
}

/* ==========================================================================
   TEXTO Y CONTRASTE
   ========================================================================== */

.text-muted {
    color: #495057 !important;
}

small {
    font-size: 0.875em;
}

/* ==========================================================================
   SMALL TEXT EN TABLAS
   ========================================================================== */

.table small {
    font-size: 0.875em;
    line-height: 1.3;
}

/* ==========================================================================
   GRUPOS DE BOTONES VERTICALES
   ========================================================================== */

.btn-group-vertical .btn-sm {
    font-size: clamp(0.8rem, 0.9vw, 0.875rem);
    padding: clamp(0.35rem, 0.5vw, 0.45rem) clamp(0.5rem, 0.75vw, 0.65rem);
}
