/* ==========================================================
   SISTEMA DE POSTULACIONES E INSCRIPCIONES - POSGRADO UTM
   Línea Gráfica Institucional: posgradoutm.com
   ========================================================== */

:root {
    --primary-color: #139038;
    --primary-hover: #0e6e2b;
    --accent-color: #f7be16;
    --accent-hover: #dfa80e;
    --bg-color: #f4f6f5;
    --card-bg: #ffffff;
    --text-color: #1a2e22;
    --text-muted: #55606d;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-color);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Tipografía Institucional */
h1, h2, h3, h4, .header-title, .ui.header {
    font-family: 'Montserrat', sans-serif !important;
}

/* ==========================================
   ESTILOS GENERALES Y TARJETAS
   ========================================== */
.ui.segment.utm-card {
    border-top: 5px solid var(--primary-color) !important;
    position: relative;
    box-shadow: 0 8px 24px rgba(19, 144, 56, 0.08) !important;
    border-radius: 12px !important;
    border-left: 1px solid rgba(0,0,0,0.05);
    border-right: 1px solid rgba(0,0,0,0.05);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ui.segment.utm-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 12px 12px 0 0;
}

/* Botones Institucionales */
.ui.button.btn-utm {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}

.ui.button.btn-utm:hover {
    background-color: var(--primary-hover) !important;
    box-shadow: 0 4px 12px rgba(19, 144, 56, 0.3) !important;
}

.ui.button.btn-utm-accent {
    background-color: var(--accent-color) !important;
    color: #7a5c00 !important;
    font-weight: 700 !important;
}

.ui.button.btn-utm-accent:hover {
    background-color: var(--accent-hover) !important;
}

/* Badges y Etiquetas */
.badge-utm {
    background-color: #fff9e6 !important;
    color: #7a5c00 !important;
    border: 1px solid var(--accent-color) !important;
    font-weight: 600;
}

.badge-utm-green {
    background-color: #eaf6ee !important;
    color: #0e6e2b !important;
    border: 1px solid #a3d9b4 !important;
    font-weight: 600;
}

/* ==========================================
   ESTILOS DE LA PANTALLA DE LOGIN
   ========================================== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, rgba(19, 144, 56, 0.05) 0%, rgba(244, 246, 245, 0.95) 90%);
    padding: 1.5rem;
}

.login-wrapper {
    width: 100%;
    max-width: 480px;
}

.login-logo {
    max-height: 105px;
    width: auto;
    display: block;
    margin: 0 auto 1.2rem auto;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.04));
}

.login-card {
    padding: 2.2rem !important;
}

.demo-credentials-box {
    background-color: #f8faf9;
    border: 1px dashed #b5dbbf;
    border-radius: 8px;
    padding: 0.85rem;
    margin-top: 1.2rem;
    font-size: 0.88rem;
    color: #2b5735;
}

/* ==========================================
   LAYOUT DEL DASHBOARD (NAVBAR + SIDEBAR)
   ========================================== */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Barra Superior */
.top-navbar {
    background-color: #ffffff;
    border-bottom: 2px solid #eef2f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    height: 65px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
}

.navbar-logo {
    max-height: 48px;
    width: auto;
}

.sidebar-toggle-btn {
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-right: 0.8rem;
    display: none;
}

/* Menú Lateral */
.app-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 65px;
    left: 0;
    bottom: 0;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
    overflow-y: auto;
    z-index: 990;
    padding: 1.2rem 0;
    transition: transform 0.3s ease;
}

.sidebar-header-label {
    padding: 0.6rem 1.4rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #8c9ba5;
    letter-spacing: 0.05em;
}

.app-sidebar .ui.vertical.menu {
    width: 100%;
    border: none;
    box-shadow: none;
    background: transparent;
}

.app-sidebar .ui.vertical.menu .item {
    font-weight: 600;
    color: #4a5568;
    padding: 0.9rem 1.4rem;
    display: flex;
    align-items: center;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.app-sidebar .ui.vertical.menu .item i.icon {
    margin-right: 0.85rem;
    font-size: 1.15rem;
    color: #718096;
    transition: color 0.2s ease;
}

.app-sidebar .ui.vertical.menu .item:hover {
    background-color: #f4fbf6 !important;
    color: var(--primary-color) !important;
    border-left-color: var(--accent-color);
}

.app-sidebar .ui.vertical.menu .item:hover i.icon {
    color: var(--primary-color);
}

.app-sidebar .ui.vertical.menu .item.active {
    background-color: #eaf6ee !important;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color);
    font-weight: 700;
}

.app-sidebar .ui.vertical.menu .item.active i.icon {
    color: var(--primary-color);
}

/* Área de Contenido Principal */
.main-content-area {
    margin-left: var(--sidebar-width);
    margin-top: 65px;
    padding: 1.8rem;
    flex: 1;
    transition: margin-left 0.3s ease;
}

/* ==========================================
   TARJETAS KPI
   ========================================== */
.kpi-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.3rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(19, 144, 56, 0.12);
}

.kpi-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-green {
    background-color: #eaf6ee;
    color: var(--primary-color);
}

.kpi-yellow {
    background-color: #fff9e6;
    color: #926f00;
}

.kpi-blue {
    background-color: #ebf5ff;
    color: #2185d0;
}

.kpi-teal {
    background-color: #e6fffa;
    color: #00b5ad;
}

.kpi-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1a2e22;
    line-height: 1.1;
    font-family: 'Montserrat', sans-serif;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.3rem;
}

/* Tablas con diseño pulido */
.ui.table.utm-table {
    border-radius: 10px !important;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
}

.ui.table.utm-table thead th {
    background-color: #f7faf8 !important;
    color: #2d3748 !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #e2e8f0 !important;
}

.ui.table.utm-table tbody tr:hover {
    background-color: #f7fdf9 !important;
}

/* Footer Institucional */
.institutional-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 1.2rem 1.8rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: var(--sidebar-width);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Animaciones */
@keyframes pulseLogo {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.75; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-animation {
    animation: pulseLogo 1.6s infinite ease-in-out;
}

/* ==========================================
   RESPONSIVE DESIGN (< 992px)
   ========================================== */
@media (max-width: 991px) {
    .sidebar-toggle-btn {
        display: inline-block;
    }
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.sidebar-visible {
        transform: translateX(0);
    }
    .main-content-area {
        margin-left: 0 !important;
        padding: 1rem;
    }
    .institutional-footer {
        margin-left: 0 !important;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
