/* ======================================================
   INDEX.CSS - Dashboard del Constructor de Horarios UEB
   ====================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background: #f4f7fb;
    color: #1f2a2e;
    min-height: 100vh;
}

/* ======================================================
   LOGIN OVERLAY
   ====================================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #007680 0%, #005f68 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.login-overlay.hidden { display: none; }

.login-box {
    background: white;
    border-radius: 28px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    text-align: center;
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.login-box .logo { margin-bottom: 20px; }
.login-box .logo img { height: 56px; }

.login-box h2 {
    font-size: 1.6rem;
    color: #1f2a2e;
    font-weight: 800;
    margin-bottom: 6px;
}
.login-box .subtitle {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 28px;
}

.login-box .form-group {
    text-align: left;
    margin-bottom: 16px;
}
.login-box .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.login-box .form-group label i {
    color: #007680;
    margin-right: 4px;
}
.login-box .form-group input {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    background: #f9fbfd;
    transition: 0.15s;
}
.login-box .form-group input:focus {
    outline: none;
    border-color: #007680;
    box-shadow: 0 0 0 3px rgba(0,118,128,0.1);
    background: white;
}

.login-error {
    display: none;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    text-align: left;
}
.login-error.show { display: block; }

.btn-login {
    width: 100%;
    background: #007680;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
    margin-top: 8px;
}
.btn-login:hover:not(:disabled) {
    background: #005f68;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,118,128,0.35);
}
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================
   DASHBOARD
   ====================================================== */
.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.header {
    background: #007680;
    border-radius: 24px;
    padding: 18px 28px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.logo-area { display: flex; align-items: center; gap: 16px; }
.logo-area img { height: 44px; }
.logo-area span {
    font-weight: 700;
    font-size: 1.15rem;
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 40px;
}

.user-info { display: flex; align-items: center; gap: 14px; }
.user-name { font-weight: 600; font-size: 0.9rem; }
.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
}
.btn-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 10px 18px;
    border-radius: 40px;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    transition: 0.2s;
}
.btn-logout:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-2px);
}

/* ======================================================
   ESTADÍSTICAS
   Iconos alineados al color de los encabezados (#007680)
   con matices sutiles para mantener jerarquía visual.
   ====================================================== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    border-radius: 20px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    transition: 0.2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.stat-card .icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
    background: #007680;                              /* color base */
    box-shadow: 0 4px 10px rgba(0,118,128,0.25);
}

/* Matices del mismo tono del encabezado */
.stat-card .icon.blue   { background: #007680; box-shadow: 0 4px 10px rgba(0,118,128,0.25); }
.stat-card .icon.green  { background: #008e9b; box-shadow: 0 4px 10px rgba(0,142,155,0.25); }
.stat-card .icon.purple { background: #006a73; box-shadow: 0 4px 10px rgba(0,106,115,0.30); }
.stat-card .icon.orange { background: #00a2b0; box-shadow: 0 4px 10px rgba(0,162,176,0.25); }
.stat-card .icon.red    { background: #005f68; box-shadow: 0 4px 10px rgba(0,95,104,0.30); }

.stat-card .info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.stat-card .number {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2a2e;
    line-height: 1.1;
}
.stat-card .label {
    font-size: 0.72rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ======================================================
   TÍTULO DE SECCIÓN
   ====================================================== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    color: #007680;
    font-weight: 800;
    padding: 0 4px;
}

/* ======================================================
   GRID DE MÓDULOS
   ====================================================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.module-card {
    background: white;
    border-radius: 20px;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}
.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,118,128,0.15);
    border-color: #007680;
}
.module-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: #007680;
    opacity: 0.9;
}
.module-card .module-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #007680;                              /* también verde UEB */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(0,118,128,0.25);
}
.module-card .module-title {
    font-weight: 800;
    font-size: 1rem;
    color: #1f2a2e;
}
.module-card .module-desc {
    font-size: 0.8rem;
    color: #718096;
    line-height: 1.4;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 900px) {
    .dashboard { padding: 16px; gap: 18px; }
    .header { flex-direction: column; align-items: stretch; }
    .user-info { justify-content: space-between; }
    .logo-area span { font-size: 1rem; }
    .stats-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .stat-card { padding: 14px 16px; }
    .stat-card .icon { width: 42px; height: 42px; font-size: 1.05rem; }
    .stat-card .number { font-size: 1.25rem; }
    .modules-grid { grid-template-columns: 1fr; }
}