/* Estilos personalizados para la plataforma */

:root {
    --cinvestav-primary: #093833;
    --cinvestav-secondary: #0d5247;
    --primary-color: #093833;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

/* Encabezado institucional de reportes (también al imprimir) */
.reporte-titulo-cinvestav {
    color: #093833 !important;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.reporte-logo {
    display: block;
    margin: 0 auto 0.5rem auto;
    max-height: 72px;
    width: auto;
}
@media print {
    .reporte-encabezado,
    .reporte-logo,
    .reporte-titulo-cinvestav {
        display: block !important;
        visibility: visible !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .reporte-titulo-cinvestav {
        color: #093833 !important;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: 600;
}

.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: none;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.table {
    background-color: #fff;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.btn {
    border-radius: 0.375rem;
}

.stat-card {
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.dashboard-project-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(9, 56, 51, 0.12);
}

.badge-status {
    padding: 0.5em 0.75em;
    font-size: 0.875em;
}

.page-header {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required::after {
    content: " *";
    color: var(--danger-color);
}

@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Layout con menú vertical */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--cinvestav-primary);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
}

.sidebar-brand {
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-brand i {
    font-size: 1.35rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: 0.4rem;
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.sidebar-link:hover,
.sidebar-sublink:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-link.active,
.sidebar-sublink.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 600;
}

.sidebar-menu {
    margin-bottom: 0.15rem;
}

.sidebar-menu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.92);
    padding: 0.55rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.sidebar-menu-toggle span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sidebar-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-chevron {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.sidebar-menu.open .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    margin: 0;
    padding: 0.15rem 0 0.35rem 0.35rem;
    display: none;
}

.sidebar-menu.open .sidebar-submenu {
    display: block;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    padding: 0.45rem 0.75rem 0.45rem 1.85rem;
    border-radius: 0.35rem;
    font-size: 0.86rem;
    transition: background 0.15s;
}

.sidebar-user {
    padding: 0.85rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.12);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.sidebar-user-info strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.84rem;
}

.sidebar-user-info small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.72rem;
}

.sidebar-logout {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.35rem;
    border-radius: 0.3rem;
}

.sidebar-logout:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.app-main {
    flex: 1;
    margin-left: 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.sidebar-toggle {
    color: var(--cinvestav-primary);
    font-size: 1.5rem;
    padding: 0;
    text-decoration: none;
}

.app-topbar-title {
    font-weight: 600;
    color: var(--cinvestav-primary);
}

.app-content {
    flex: 1;
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
}

.app-footer {
    padding: 0.85rem 1rem;
    text-align: center;
    background: #fff;
    border-top: 1px solid #dee2e6;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .app-topbar {
        display: flex;
    }
}

@media (min-width: 992px) {
    .sidebar-menu:not(.open) .sidebar-submenu {
        display: none;
    }
}

#gantt .bar-wrapper .bar.gantt-atrasado { fill: #dc3545; }
#gantt .bar-wrapper .bar.gantt-en_riesgo { fill: #ffc107; }
#gantt .bar-wrapper .bar.gantt-en_tiempo { fill: #198754; }
#gantt .bar-wrapper .bar.gantt-pendiente { fill: #6c757d; }
#gantt .bar-wrapper .bar.gantt-completada { fill: #093833; }
#gantt .bar-wrapper .bar.gantt-cancelada { fill: #adb5bd; }

