/* ===================================================================
   COOPERATIVA ELÉCTRICA DE TRELEW - PERSONAS HOME
   Diseño inspirado en Camuzzi con identidad COPE
   =================================================================== */

/* Variables CSS - Paleta Institucional COPE */
:root {
    /* Colores Institucionales COPE */
    --cope-primary: #035684;
    --cope-secondary: #0474B4;
    --cope-accent: #0A8ECF;
    --cope-dark: #003B64;

    /* Fondos */
    --cope-bg-light: #F5F7FA;
    --cope-bg-lighter: #EEF2F5;
    --cope-white: #FFFFFF;

    /* Estados */
    --cope-success: #27ae60;
    --cope-danger: #e74c3c;
    --cope-warning: #f39c12;

    /* Textos */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-light: #6a6a6a;

    /* Sombras */
    --shadow-sm: 0 2px 12px rgba(3, 86, 132, 0.08);
    --shadow-md: 0 4px 20px rgba(3, 86, 132, 0.12);
    --shadow-lg: 0 8px 32px rgba(3, 86, 132, 0.16);

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================================
   OCULTAR NAVBAR
   =================================================================== */
/* ===================================================================
   NAVBAR SIMPLIFICADO (SOLO LOGO)
   =================================================================== */
/* Mostrar el contenedor del navbar */
body:has(.personas-home-container) [ui-view="navbar"],
body:has(.detail-grid) [ui-view="navbar"] {
    display: block !important;
}

/* Ocultar items del menú y botón toggle */
body:has(.personas-home-container) .navbar-collapse,
body:has(.personas-home-container) .navbar-toggle,
body:has(.detail-grid) .navbar-collapse,
body:has(.detail-grid) .navbar-toggle {
    display: none !important;
}

/* ===================================================================
   BLOQUE DE BIENVENIDA
   =================================================================== */
.welcome-section {
    background: linear-gradient(135deg, var(--cope-bg-lighter) 0%, var(--cope-bg-light) 100%);
    border-radius: var(--radius-lg);
    padding: 45px;
    margin-bottom: 35px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: var(--shadow-sm);
    border-left: 6px solid var(--cope-primary);
}

.welcome-icon {
    flex-shrink: 0;
}

.welcome-icon i {
    font-size: 90px;
    color: var(--cope-primary);
    background: white;
    border-radius: 50%;
    padding: 25px;
    box-shadow: var(--shadow-md);
}

.welcome-text h2 {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 15px 0;
}

.welcome-text p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================================================
   GRID DE TARJETAS DE SUMINISTROS
   =================================================================== */
/* ===================================================================
   GRID DE TARJETAS DE SUMINISTROS
   =================================================================== */
.suministros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

/* ===================================================================
   TARJETA DE SUMINISTRO
   =================================================================== */
.suministro-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(3, 86, 132, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.suministro-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--cope-accent);
}

/* Header de la tarjeta */
.suministro-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--cope-bg-lighter);
}

.suministro-header i {
    font-size: 42px;
    color: var(--cope-primary);
    background: var(--cope-bg-lighter);
    padding: 12px;
    border-radius: 50%;
}

.suministro-header h3 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Body de la tarjeta */
.suministro-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.suministro-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.suministro-info i {
    font-size: 28px;
    color: var(--cope-secondary);
    flex-shrink: 0;
}

.suministro-info span {
    line-height: 1.5;
}

/* Estado del suministro */
.suministro-status {
    padding: 15px 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 600;
}

.badge i {
    font-size: 26px;
}

.badge-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--cope-success);
    border: 2px solid var(--cope-success);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.1);
    color: var(--cope-danger);
    border: 2px solid var(--cope-danger);
}

/* Acciones de la tarjeta */
.suministro-actions {
    display: flex;
    gap: 15px;
    padding-top: 15px;
}

.suministro-actions button {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.suministro-actions button i {
    font-size: 26px;
}

.btn-primary {
    background: var(--cope-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--cope-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--cope-primary);
    border: 2px solid var(--cope-primary);
}

.btn-secondary:hover {
    background: var(--cope-primary);
    color: white;
    transform: translateY(-2px);
}

/* ===================================================================
   SIDEBAR MODERNIZADO
   =================================================================== */
/* ===================================================================
   SIDEBAR MODERNIZADO (ROLE_USER)
   =================================================================== */
.cope-sidebar {
    background: var(--cope-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    color: white;
    height: 100%;
    min-height: 600px;
}

/* Encabezado de Usuario */
.sidebar-user-header {
    background: rgba(255, 255, 255, 0.12);
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
}

.user-avatar {
    margin-bottom: 15px;
}

.user-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.user-avatar i {
    font-size: 80px;
    color: rgba(255, 255, 255, 0.9);
}

.user-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: white;
}

.user-email {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    display: block;
}

/* Menú */
.sidebar-menu {
    padding: 10px 0;
}

.menu-section-label {
    padding: 15px 25px 5px;
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 4px solid transparent;
    font-size: 1.6rem;
    font-weight: 300;
    font-family: 'Roboto', sans-serif;
}

.menu-item i {
    font-size: 24px;
    width: 24px;
    text-align: center;
    transition: all 0.25s ease;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #2ECC71;
    /* Verde hover */
    text-decoration: none;
}

.menu-item:hover i {
    color: #2ECC71;
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #2ECC71;
    /* Borde activo verde */
    color: white;
    font-weight: 600;
}

.menu-item.active i {
    color: #2ECC71;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 25px;
}

.menu-item.logout-item {
    margin-top: 5px;
}

.menu-item.logout-item:hover {
    background: rgba(231, 76, 60, 0.15);
    /* Rojo suave al salir */
    color: #ff6b6b;
}

.menu-item.logout-item:hover i {
    color: #ff6b6b;
}

/* ===================================================================
   SECCIÓN DE TÍTULO
   =================================================================== */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 40px 0 25px 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.section-title i {
    color: var(--cope-primary);
    font-size: 36px;
}

/* ===================================================================
   MENSAJE SIN SUMINISTROS
   =================================================================== */
.no-suministros {
    text-align: center;
    padding: 70px 50px;
    background: var(--cope-bg-lighter);
    border-radius: var(--radius-lg);
    margin: 50px 0;
}

.no-suministros i {
    font-size: 90px;
    color: var(--cope-secondary);
    margin-bottom: 25px;
    display: block;
}

.no-suministros h2 {
    font-size: 2.2rem;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

.no-suministros p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 0 30px 0;
}

.no-suministros .btn-primary {
    display: inline-flex;
    padding: 15px 35px;
}

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

/* Tablets */
@media (max-width: 992px) {
    .suministros-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .welcome-section {
        padding: 30px;
    }

    .welcome-icon i {
        font-size: 60px;
    }

    .welcome-text h2 {
        font-size: 2rem;
    }

    .welcome-text p {
        font-size: 1.1rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .suministros-grid {
        grid-template-columns: 1fr;
    }

    .welcome-section {
        flex-direction: column;
        text-align: center;
        padding: 25px;
    }

    .welcome-text h2 {
        font-size: 1.8rem;
    }

    .welcome-text p {
        font-size: 1rem;
    }

    .suministro-card {
        padding: 20px;
    }

    .suministro-actions {
        flex-direction: column;
    }

    .suministro-actions button {
        width: 100%;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

/* ===================================================================
   DETALLE DE SUMINISTRO
   =================================================================== */

/* Layout de Detalle */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 40px;
}

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

/* Tarjetas de Detalle */
.detail-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    height: 100%;
    border: 1px solid rgba(3, 86, 132, 0.08);
}

.detail-card-header {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--cope-bg-lighter);
    display: flex;
    align-items: center;
    gap: 15px;
}

.detail-card-header i {
    color: var(--cope-primary);
    font-size: 28px;
}

/* Sección 1: Estado */
.status-card {
    border-left: 6px solid var(--cope-success);
    margin-bottom: 30px;
}

.status-card.has-debt {
    border-left-color: var(--cope-danger);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 25px;
}

.status-icon {
    font-size: 48px;
    color: var(--cope-success);
    background: rgba(39, 174, 96, 0.1);
    padding: 20px;
    border-radius: 50%;
}

.status-card.has-debt .status-icon {
    color: var(--cope-danger);
    background: rgba(231, 76, 60, 0.1);
}

.status-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.status-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.3rem;
}

/* Sección 2: Datos */
.data-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.data-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.data-label {
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.data-value {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.data-value i {
    font-size: 22px;
    color: var(--cope-secondary);
}

.payment-warning {
    grid-column: 1 / -1;
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

/* Sección 3: Gráfico */
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}

/* Sección 4: Tabla de Facturas */
.table-modern-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 40px;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern th {
    background: var(--cope-bg-lighter);
    padding: 18px 25px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.table-modern td {
    padding: 18px 25px;
    border-bottom: 1px solid var(--cope-bg-lighter);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.table-modern tr:last-child td {
    border-bottom: none;
}

.table-modern tr:hover {
    background-color: var(--cope-bg-light);
}

.btn-download {
    background: transparent;
    border: 1px solid var(--cope-secondary);
    color: var(--cope-secondary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--cope-secondary);
    color: white;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 35px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--cope-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.2rem;
    background: white;
    padding: 12px 25px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn-back:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--cope-primary);
}

/* ===================================================================
   BOTÓN FLOTANTE DE AYUDA
   =================================================================== */
.floating-help-cope {
    position: fixed;
    bottom: 35px;
    right: 35px;
    background: var(--cope-primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 22px 38px;
    font-size: 1.7rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    z-index: 1000;
    animation: pulse-cope 2.5s infinite;
}

.floating-help-cope:hover {
    background: var(--cope-dark);
    transform: scale(1.08);
    box-shadow: var(--shadow-xl);
    animation: none;
    color: white;
    text-decoration: none;
}

.floating-help-cope i {
    font-size: 32px;
}

.help-label {
    font-family: 'Roboto', sans-serif;
}

@keyframes pulse-cope {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

@media (max-width: 768px) {
    .floating-help-cope {
        bottom: 20px;
        right: 20px;
        padding: 15px 25px;
        font-size: 1.4rem;
    }

    .floating-help-cope i {
        font-size: 24px;
    }
}