/* ==========================================================
   ESTILOS ADMINISTRATIVOS - SISTEMA INNOVASOFT 2026
   Plantilla Clásica con Sidebar Oscuro, Tarjetas Totalizadas y Alertas
   ========================================================== */

:root {
    --sidebar-width: 265px;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-active: #2563eb;
    --body-bg: #f1f5f9;
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    overflow-x: hidden;
}

/* Layout Principal */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Clásico Administrativo */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #e2e8f0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.12);
    z-index: 1000;
}

.sidebar-brand {
    padding: 20px 18px;
    background: #0b0f19;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: linear-gradient(135deg, #2563eb, #0d9488);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.sidebar-nav {
    padding: 16px 12px;
    list-style: none;
    margin: 0;
    flex: 1;
}

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
    padding: 10px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.18s ease;
}

.sidebar-link i.nav-icon {
    width: 24px;
    font-size: 15px;
    margin-right: 8px;
    text-align: center;
}

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

.sidebar-link.active {
    background-color: var(--sidebar-active);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

/* Contenido Principal */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 13px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.admin-content {
    padding: 24px 26px;
    flex: 1;
}

/* Tarjetas KPI Totalizadas */
.stat-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.stat-card.border-left-primary { border-left: 5px solid #2563eb; }
.stat-card.border-left-success { border-left: 5px solid #10b981; }
.stat-card.border-left-indigo  { border-left: 5px solid #6366f1; }
.stat-card.border-left-warning { border-left: 5px solid #f59e0b; }
.stat-card.border-left-danger  { border-left: 5px solid #ef4444; }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #64748b;
}

.stat-value {
    font-size: 23px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 3px;
}

/* Tarjetas de Paneles y Tablas */
.card-panel {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    margin-bottom: 24px;
}

.card-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background-color: #f8fafc;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.card-panel-body {
    padding: 20px;
}

/* Filas resaltadas según estado de vencimiento */
tr.fila-vencida td {
    background-color: #fef2f2 !important;
}

tr.fila-por-vencer td {
    background-color: #fffbeb !important;
}

/* Animación sutil para vencimientos de hoy */
@keyframes pulseAlert {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.pulse-badge {
    animation: pulseAlert 1.5s infinite;
}

/* Botones de filtro en Membresías */
.filter-pill {
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 14px;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 12px;
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 5px 32px 5px 12px !important;
    min-width: 72px;
    display: inline-block;
}

/* Garantizar que los modales grandes con formulario interno hagan scroll limpio y siempre muestren el botón Guardar */
.modal-dialog-scrollable {
    max-height: calc(100vh - 2rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.modal-dialog-scrollable .modal-content > form > .modal-header,
.modal-dialog-scrollable .modal-content > form > .modal-footer {
    flex-shrink: 0;
}

.modal-dialog-scrollable .modal-content > form > .modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
}

@media (max-width: 991.98px) {
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
}

