/* ==========================================================
   PORTAL INSTITUCIONAL
   Autor: René Guevara
   Framework: Laravel + Bootstrap 5
========================================================== */

/* ==========================
   VARIABLES
========================== */

:root {

    /* Colores principales */
    --primary: #2554EA;
    --primary-dark: #0F2D96;
    --primary-light: #DCE6FF;

    /* Fondos */
    --bg-main: #F5F6FA;
    --bg-card: #FFFFFF;

    /* Textos */
    --text-dark: #1F2937;
    --text-medium: #6B7280;
    --text-light: #9CA3AF;

    /* Bordes */
    --border-color: #E5E7EB;

    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0,0,0,.05);
    --shadow-md: 0 8px 20px rgba(0,0,0,.08);

    /* Radios */
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;

    /* Sidebar */
    --sidebar-width: 260px;

}

/* ==========================
   RESET GENERAL
========================== */

body {
    background: var(--bg-main);
    color: var(--text-dark);
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ==========================
   UTILIDADES
========================== */

.portal-card {

    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);

}

.portal-title {

    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);

}

.portal-subtitle {

    color: var(--text-medium);
    font-size: 1rem;

}

.portal-btn-primary {

    background: var(--primary);
    border: none;
    color: white;
    border-radius: 12px;
    font-weight: 600;
    transition: .3s;

}

.portal-btn-primary:hover {

    background: var(--primary-dark);
    color: white;

}

/* ==========================
   LOGIN
========================== */

.login-wrapper {

    min-height: 100vh;
    display: flex;

}

.login-left {

    width: 40%;
    background: linear-gradient(
        180deg,
        #2554EA 0%,
        #0F2D96 100%
    );

    color: white;
    position: relative;
    overflow: hidden;

}

.login-right {

    width: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #F5F6FA;

}

.login-content {

    padding: 70px;
    position: relative;
    z-index: 2;

}

.login-logo {

    width: 90%;
    height: 90%;

    /* background: rgba(255,255,255,.15); */

    border-radius: 24px;

    display: flex;
    align-items: center;
    justify-content: left;

    margin-bottom: 40px;
}

.login-title {

    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;

}

.login-description {

    margin-top: 20px;
    font-size: 1.3rem;
    color: rgba(255,255,255,.85);

}

/* Decoraciones */

.login-circle-top {

    width: 400px;
    height: 400px;

    border-radius: 50%;

    background: rgba(255,255,255,.05);

    position: absolute;

    top: -150px;
    left: -150px;

}

.login-circle-bottom {

    width: 300px;
    height: 300px;

    border-radius: 50%;

    border: 10px solid rgba(255,255,255,.05);

    position: absolute;

    bottom: -150px;
    right: -100px;

}

/* ==========================
   FORM LOGIN
========================== */

.login-card {

    width: 100%;
    max-width: 450px;

    background: white;

    border-radius: 22px;

    border-top: 4px solid var(--primary);

    padding: 35px;

    box-shadow: var(--shadow-md);

}

.login-card h2 {

    font-weight: 700;
    margin-bottom: 30px;

}

.form-control {

    border-radius: 12px;
    min-height: 50px;

}

.form-control:focus {

    box-shadow: none;
    border-color: var(--primary);

}

.input-icon {

    position: relative;

}

.input-icon > i {

    position: absolute;
    left: 15px;
    top: 15px;
    color: #6B7280;

}

.input-icon .form-control {

    padding-left: 45px;

}

.password-input {
    padding-right: 48px !important;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 15px;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* .login-logo-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
} */

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 992px) {

    .login-left {
        display: none;
    }

    .login-right {
        width: 100%;
    }

}

/* ==========================
   LAYOUT INTERNO
========================== */

.portal-layout {
    min-height: 100vh;
    display: flex;
    background: var(--bg-main);
}

.portal-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.portal-content {
    padding: 32px;
}

/* ==========================
   SIDEBAR
========================== */

.portal-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: #F3F4F8;
    border-right: 1px solid #DDE2F0;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 32px 18px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand h5 {
    margin: 0;
    color: var(--primary);
    font-weight: 800;
}

.sidebar-brand span {
    color: var(--text-medium);
    font-size: 14px;
}

.sidebar-menu {
    flex: 1;
}

.sidebar-link {
    height: 48px;
    padding: 0 20px;
    color: #4B5563;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    border-right: 4px solid transparent;
    transition: .2s ease;
}

.sidebar-link i {
    font-size: 18px;
}

.sidebar-link:hover {
    background: #E9EDFF;
    color: var(--primary);
}

.sidebar-link.active {
    background: #DEE5FF;
    color: var(--primary);
    border-right-color: var(--primary);
}

.sidebar-footer {
    border-top: 1px solid #DDE2F0;
    padding: 16px 0;
}

.logout-button {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

/* ==========================
   TOPBAR
========================== */

.portal-topbar {
    height: 48px;
    background: #FFFFFF;
    border-bottom: 1px solid #DDE2F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-icon {
    border: 0;
    background: transparent;
    color: #4B5563;
    font-size: 18px;
    padding: 0;
}

.topbar-icon:hover {
    color: var(--primary);
}

.topbar-user {
    display: flex;
    align-items: center;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
}

.topbar-avatar:hover {
    background: var(--primary-dark);
}

/* ==========================
   PAGE HEADER
========================== */

.portal-page-header {
    padding: 20px 32px 0;
}

/* ==========================
   DASHBOARD
========================== */

.dashboard-date {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--primary);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.dashboard-right .dashboard-date {
    width: 100%;
    justify-content: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: flex-start;
}

.user-summary-card {
    background: linear-gradient(135deg, #2554EA, #0F2D96);
    color: #FFFFFF;
    border-radius: 22px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-md);
    margin-bottom: 32px;
}

.user-avatar {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
}

.user-summary-card h5 {
    margin: 0;
    font-weight: 800;
}

.user-summary-card p {
    margin: 4px 0;
    color: rgba(255,255,255,.82);
}

.user-summary-card span {
    font-size: 13px;
    background: rgba(255,255,255,.18);
    padding: 5px 12px;
    border-radius: 999px;
}

.section-title {
    margin-bottom: 18px;
}

.section-title h4 {
    font-weight: 800;
    margin-bottom: 4px;
}

.section-title p {
    color: var(--text-medium);
    margin: 0;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.quick-action-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    box-shadow: var(--shadow-sm);
    transition: .2s ease;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-action-icon {
    min-width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.quick-action-card h5 {
    margin: 0 0 6px;
    font-weight: 800;
}

.quick-action-card p {
    margin: 0;
    color: var(--text-medium);
    font-size: 14px;
}

.dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-panel {
    padding: 22px;
}

.dashboard-left .dashboard-panel {
    padding: 10px 22px;
}

.dashboard-panel h5 {
    font-weight: 800;
    margin-bottom: 18px;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.event-card:last-child {
    border-bottom: 0;
}

.event-date {
    width: 56px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.event-card h6 {
    margin: 0;
    font-weight: 800;
}

.event-card p {
    margin: 3px 0 0;
    color: var(--text-medium);
    font-size: 14px;
}

.notice-card {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.notice-icon {
    min-width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.notice-card:last-child {
    border-bottom: 0;
}

.notice-card h6 {
    font-weight: 800;
    margin-bottom: 4px;
}

.notice-card p {
    margin: 0;
    color: var(--text-medium);
    font-size: 14px;
}

.birthday-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}

.birthday-card:last-child {
    border-bottom: 0;
}

.birthday-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #FFEFD6;
    color: #B45309;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.birthday-card h6 {
    margin: 0;
    font-weight: 800;
}

.birthday-card p {
    margin: 3px 0 0;
    color: var(--text-medium);
    font-size: 14px;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .portal-main {
        margin-left: 0;
    }

    .portal-sidebar {
        display: none;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================
   MODULES
========================== */

.modules-header {
    margin-bottom: 24px;
}

.modules-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.modules-header p {
    color: var(--text-medium);
    margin: 0;
}

.modules-toolbar {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 26px;
}

.modules-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.modules-search i {
    position: absolute;
    left: 16px;
    top: 13px;
    color: var(--text-medium);
}

.modules-search input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0 16px 0 44px;
    outline: none;
    color: var(--text-dark);
}

.modules-search input:focus {
    border-color: var(--primary);
}

.modules-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modules-filters button {
    border: 1px solid var(--border-color);
    background: #FFFFFF;
    color: var(--text-medium);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    font-size: 14px;
}

.modules-filters button.active,
.modules-filters button:hover {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.module-card {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 24px;
    min-height: 230px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: .2s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.module-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.module-card-body {
    flex: 1;
}

.module-card-body h5 {
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.module-card-body p {
    color: var(--text-medium);
    font-size: 14px;
    margin: 0;
}

.module-card-link {
    margin-top: 20px;
    color: var(--primary);
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.module-card-link:hover {
    color: var(--primary-dark);
}

@media (max-width: 1200px) {
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modules-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .modules-search {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .modules-grid {
        grid-template-columns: 1fr;
    }
}