﻿/* ===== VARIABLES ===== */
:root {
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 66px;
    --sidebar-bg: #fd5800;
    --primary: #fd5800;
    --primary-hover: #e14d00;
    --text-dark: #374151;
    --text-light: #ffffff;
    --content-bg: #f8fafc;
    --topbar-height: 60px;
    --transition-speed: 0.25s;
    --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.10);
    --border-light: #e5e7eb;
}

/* ===== RESET ===== */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--content-bg);
}

/* ===== LAYOUT ===== */
.sgic-admin {
    min-height: 100vh;
    background: var(--content-bg);
}

/* ===== SIDEBAR ===== */
.sgic-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--sidebar-bg);
    color: var(--text-light);
    z-index: 2000;
    transition: width var(--transition-speed) ease, left var(--transition-speed) ease;
    overflow: hidden;
}

    .sgic-sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

/* ===== HEADER SIDEBAR ===== */
.sidebar-top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 52px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 6px;
    margin: 0;
    flex-shrink: 0;
}

/* ===== USER ===== */
.brand-user {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    margin: 0;
    font-size: 13px;
    min-height: 36px;
    box-sizing: border-box;
    flex: 1;
    overflow: hidden;
}

.user-photo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-photo {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.user-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
    color: #fff;
}

/* ===== NAV / SCROLL ===== */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 7px;
    box-sizing: border-box;
    scroll-behavior: auto;
}

    .sidebar-nav::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-nav::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 10px;
    }

    .sidebar-nav ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

/* ===== MENU ===== */
.menu-item {
    margin-bottom: 3px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    box-sizing: border-box;
    color: #fff;
    text-decoration: none;
    padding: 9px 10px;
    min-height: 40px;
    border-radius: 8px;
    font-size: 13.5px;
    transition: background 0.2s ease, color 0.2s ease;
}

    .menu-link:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
    }

    .menu-link.active {
        background: #ffffff;
        color: var(--primary);
        font-weight: 600;
    }

    .menu-link i {
        font-size: 15px;
        min-width: 18px;
        text-align: center;
        flex-shrink: 0;
    }

.menu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SUBMENU ===== */
.sidebar-nav .nav-link {
    display: block;
    color: #fff;
    opacity: 0.88;
    text-decoration: none;
    border-radius: 8px;
    padding: 7px 10px;
    margin: 2px 0;
    font-size: 13px;
    transition: background 0.2s ease, opacity 0.2s ease;
}

    .sidebar-nav .nav-link:hover {
        opacity: 1;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .sidebar-nav .nav-link.active {
        opacity: 1;
        background: rgba(255, 255, 255, 0.18);
        font-weight: 600;
        color: #fff;
    }

/* ===== SEPARADOR ===== */
.menu-separator {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 8px 0;
}

/* ===== MAIN ===== */
.sgic-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-speed) ease;
}

.sgic-sidebar.collapsed + .sidebar-overlay + .sgic-main,
.sgic-sidebar.collapsed ~ .sgic-main {
    margin-left: var(--sidebar-collapsed-width);
}

/* ===== TOPBAR ===== */
.sgic-topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-sizing: border-box;
}

.topbar-menu-btn {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

/* ===== CONTENT ===== */
.sgic-content {
    flex: 1;
    padding: 18px;
    box-sizing: border-box;
}

/* ===== OVERLAY ===== */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* ===== DASHBOARD ===== */
.dashboard-header {
    margin-bottom: 24px;
}

.dashboard-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.dashboard-kpis {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.dashboard-card,
.dashboard-panel,
.kpi-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.dashboard-card {
    padding: 20px;
}

    .dashboard-card h4 {
        margin: 0 0 10px;
        color: var(--text-dark);
    }

    .dashboard-card .value {
        font-size: 28px;
        font-weight: bold;
    }

.kpi-card {
    padding: 20px;
    border-left: 5px solid #0d6efd;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-hover);
    }

.kpi-success {
    border-left-color: #198754;
}

.kpi-title {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.dashboard-row,
.dashboard-row-charts,
.dashboard-row-dual,
.dashboard-row-single {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (min-width: 992px) {
    .dashboard-row-charts {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-row-dual {
        grid-template-columns: 1.3fr 1fr;
    }
}

.dashboard-panel {
    padding: 22px;
}

.panel-header {
    margin-bottom: 16px;
}

    .panel-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #111827;
    }

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    padding: 14px;
}

.empty-state {
    color: #6b7280;
    padding: 16px 0;
}

.table-responsive table {
    margin-bottom: 0;
}

/* ===== COLLAPSED VISUAL ===== */
.sgic-sidebar.collapsed .menu-text,
.sgic-sidebar.collapsed .user-text {
    display: none;
}

.sgic-sidebar.collapsed .brand-user {
    justify-content: center;
    flex: 0;
}

.sgic-sidebar.collapsed .sidebar-top {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

.sgic-sidebar.collapsed .menu-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
    min-height: 38px;
}

    .sgic-sidebar.collapsed .menu-link i {
        min-width: auto;
        font-size: 15px;
    }

.sgic-sidebar.collapsed .sidebar-nav .nav {
    display: none;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 200px;
        --sidebar-collapsed-width: 60px;
        --topbar-height: 56px;
    }

    .sgic-sidebar {
        left: calc(-1 * var(--sidebar-width));
        width: var(--sidebar-width);
    }

        .sgic-sidebar.open {
            left: 0;
        }

        .sgic-sidebar.collapsed {
            width: var(--sidebar-width);
        }

            .sgic-main,
            .sgic-sidebar.collapsed + .sidebar-overlay + .sgic-main,
            .sgic-sidebar.collapsed ~ .sgic-main {
                margin-left: 0;
            }

    .sidebar-top {
        min-height: 50px;
        padding: 7px 9px;
    }

    .sidebar-toggle {
        font-size: 19px;
    }

    .sidebar-nav {
        padding: 7px 6px;
    }

    .menu-item {
        margin-bottom: 2px;
    }

    .menu-link {
        min-height: 38px;
        padding: 8px 9px;
        gap: 8px;
        font-size: 12.8px;
        border-radius: 7px;
    }

        .menu-link i {
            font-size: 14px;
            min-width: 17px;
        }

    .sidebar-nav .nav-link {
        padding: 6px 9px;
        font-size: 12.5px;
    }

    .sgic-content {
        padding: 14px;
    }

    .sgic-topbar {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 190px;
    }

    .menu-link {
        min-height: 36px;
        padding: 7px 8px;
        font-size: 12.4px;
    }

        .menu-link i {
            font-size: 13px;
            min-width: 16px;
        }

    .sidebar-nav .nav-link {
        font-size: 12px;
    }
}

.config-table .btn {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .config-table td[data-label="Acción"] .btn {
        width: 100%;
    }
}

.hero-portada-pas {
    width: 100%;
    height: auto; /* Cambiado: permite que crezca con la imagen */
    margin: 0;
    overflow: hidden;
    border-top: 4px solid #ff5a00;
    background: #f5f5f5;
}

.hero-portada-pas picture {
    width: 100%;
    height: auto;
    display: block;
}

.hero-portada-pas img {
    width: 100%;
    height: auto; /* Cambiado: mantiene la proporción original */
    display: block;
    object-fit: contain; /* Cambiado: asegura que la imagen quepa entera */
}

@media (max-width: 768px) {
    .hero-portada-pas {
        height: auto; /* Cambiado: evita forzar los 320px */
    }
}

.caption-comunidad {
  text-align: center; /* Centra el texto */
  color: #ffffff;     /* Color blanco */
  display: block;     /* Asegura que ocupe todo el ancho */
  padding: 20px;      /* Espaciado opcional */
}

.caption-comunidad h2 {
  margin: 0;          /* Quita márgenes por defecto del h2 */
}