/* ============================================================
   FEPA - GESTIÓN DE PAGOS Y DATOS MASIVOS
   Diseño SaaS - v10.1 (tu diseño + tutorial aislado)
   ============================================================ */

/* ========== VARIABLES ========== */
:root {
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --blue-light: #dbeafe;
    --blue-soft: #eff6ff;

    --indigo: #6366f1;
    --indigo-dark: #4f46e5;
    --indigo-light: #e0e7ff;

    --orange: #f59e0b;
    --orange-dark: #d97706;
    --orange-light: #fef3c7;

    --green: #10b981;
    --green-dark: #059669;
    --green-light: #d1fae5;

    --red: #ef4444;
    --red-dark: #dc2626;
    --red-light: #fee2e2;

    --cyan: #06b6d4;
    --cyan-light: #cffafe;

    --primary: #3b82f6;
    --primary-dark: #2563eb;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;

    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-hover: #f1f5f9;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-dark: #0f172a;
    --text-gray: #475569;

    --sidebar-bg: #0f172a;
    --sidebar-bg-2: #1e293b;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: linear-gradient(135deg, #3b82f6, #6366f1);

    --sidebar-width: 260px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 25px 60px rgba(15, 23, 42, 0.2);
    --shadow-blue: 0 8px 24px rgba(59, 130, 246, 0.3);

    --radius: 0.625rem;
    --radius-sm: 0.5rem;
    --radius-lg: 0.875rem;
    --radius-xl: 1.25rem;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }

html { font-size: 14.5px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'tnum' 1;
    font-weight: 450;
}

#wrapper { min-height: 100vh; display: flex; }

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar-wrapper {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    z-index: 1040;
    color: #fff;
}

.sidebar-heading {
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-heading h5 {
    font-weight: 700;
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
}

.sidebar-heading h5 i {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 1rem;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
    flex-shrink: 0;
    color: #fff;
}

.sidebar-heading h5 small {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 0.15rem;
    color: rgba(255, 255, 255, 0.55);
}

.btn-close-sidebar {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    cursor: pointer;
    flex-shrink: 0;
}
.btn-close-sidebar:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.sidebar-menu-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0 0.75rem 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-menu-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-menu-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-menu-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.sidebar-menu-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.menu-group { margin-bottom: 0.25rem; }

.menu-group-title {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.85rem 1.35rem 0.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
}

#sidebar-wrapper .list-group-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.82);
    padding: 0.7rem 0.9rem;
    margin: 0.1rem 0.75rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.18s ease;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
}

#sidebar-wrapper .list-group-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    border-radius: 0 3px 3px 0;
    transition: height 0.2s ease;
}

#sidebar-wrapper .list-group-item i {
    width: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

#sidebar-wrapper .list-group-item .menu-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar-wrapper .list-group-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    transform: translateX(3px);
}

#sidebar-wrapper .list-group-item:hover::before { height: 60%; }
#sidebar-wrapper .list-group-item:hover i {
    color: #60a5fa;
    transform: scale(1.08);
}

#sidebar-wrapper .list-group-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(99, 102, 241, 0.95));
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
}

#sidebar-wrapper .list-group-item.active::before { height: 0; }
#sidebar-wrapper .list-group-item.active i {
    color: #ffffff;
    transform: scale(1.05);
}

.sidebar-footer {
    padding: 0.85rem 0.85rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.18s ease;
    text-decoration: none;
}

.btn-logout:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

@media (max-width: 991.98px) {
    #sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        transform: translateX(-105%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        height: 100vh;
        box-shadow: none;
        z-index: 1060;
    }
    #sidebar-wrapper.open {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.5);
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1055;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .sidebar-overlay.show { opacity: 1; visibility: visible; }
    #sidebar-wrapper .list-group-item {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
    .sidebar-heading { padding: 1.1rem 1.15rem; }
    .menu-group-title { padding-top: 1rem; }
}

body.sidebar-open { overflow: hidden; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar .container-fluid {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0f172a;
    margin: 0;
    padding: 0;
}

.navbar-brand i { color: var(--blue); font-size: 1.1rem; }

.btn-menu-toggle {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all 0.18s ease;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
    padding: 0;
}

.btn-menu-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.45);
    color: #fff;
}
.btn-menu-toggle:active { transform: scale(0.96); }
.btn-menu-toggle i { color: #fff; }

.navbar-user-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.85rem 0.3rem 0.3rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all 0.18s ease;
    max-width: 240px;
    overflow: hidden;
}

.user-chip:hover {
    background: #f1f5f9;
    border-color: var(--border-strong);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
    overflow: hidden;
}

.user-info strong {
    font-size: 0.82rem;
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info small {
    font-size: 0.68rem;
    color: #64748b;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.18s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.btn-logout-nav:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

@media (max-width: 575.98px) {
    .navbar { padding: 0.6rem 0.9rem; }
    .navbar-brand .brand-text { display: none; }
    .user-chip {
        padding: 0.25rem;
        border-radius: 50%;
        background: transparent;
        border-color: transparent;
        gap: 0;
    }
    .user-chip .user-info { display: none; }
    .user-chip:hover { background: transparent; border-color: transparent; }
    .btn-logout-nav { padding: 0.45rem 0.7rem; }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .user-chip { max-width: 180px; }
    .user-info strong { font-size: 0.78rem; }
    .user-info small { font-size: 0.65rem; }
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
#page-content-wrapper {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-body);
}

#page-content-wrapper > .container-fluid {
    flex: 1 0 auto;
    padding: 1.5rem 1.75rem;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    background: var(--bg-surface);
    transition: all 0.2s ease;
    margin-bottom: 1rem;
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card-header {
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.2rem;
    font-weight: 600;
    font-size: 0.925rem;
    letter-spacing: -0.01em;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #0f172a;
}

.card-header i { color: var(--blue); font-size: 0.95rem; }

.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-secondary,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger {
    border-bottom: none;
    color: #ffffff;
}

.card-header.bg-primary { background: linear-gradient(135deg, #3b82f6, #6366f1) !important; }
.card-header.bg-success { background: linear-gradient(135deg, #10b981, #059669) !important; }
.card-header.bg-secondary { background: linear-gradient(135deg, #475569, #334155) !important; }
.card-header.bg-info { background: linear-gradient(135deg, #06b6d4, #3b82f6) !important; }
.card-header.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.card-header.bg-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }

.card-header.bg-primary i,
.card-header.bg-success i,
.card-header.bg-secondary i,
.card-header.bg-info i,
.card-header.bg-warning i,
.card-header.bg-danger i {
    color: #ffffff;
}

.card-header.text-white :is(.form-label,.form-check-label) { color: inherit; }

.card-body { padding: 1.2rem; }

.card.text-white { border: none; position: relative; overflow: hidden; }

.card.text-white::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 180px;
    height: 180px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.card.text-white.bg-success { background: linear-gradient(135deg, #10b981, #059669) !important; }
.card.text-white.bg-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }
.card.text-white.bg-info { background: linear-gradient(135deg, #06b6d4, #3b82f6) !important; }
.card.text-white.bg-primary { background: linear-gradient(135deg, #3b82f6, #6366f1) !important; }
.card.text-white.bg-secondary { background: linear-gradient(135deg, #475569, #334155) !important; }
.card.text-white.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }

.card.text-white .card-body {
    padding: 1.15rem 1.25rem;
    position: relative;
    z-index: 1;
}

.card.text-white .card-body h2,
.card.text-white .card-body h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    font-size: 1.6rem;
    margin: 0;
}

.card.text-white .card-body h6 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.95;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.table { font-size: 0.875rem; margin-bottom: 0; }

.table thead th {
    background: #f1f5f9;
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #0f172a;
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody td {
    vertical-align: middle;
    padding: 0.75rem 0.9rem;
    border-color: var(--border);
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 450;
}

.table tbody tr { transition: background-color 0.12s ease; }
.table-hover tbody tr:hover { background: #eff6ff; }

.btn {
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.05rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    color: #ffffff;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: var(--shadow-blue);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-success { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #ffffff; }
.btn-success:hover { background: linear-gradient(135deg, #059669, #047857); transform: translateY(-1px); color: #ffffff; }

.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: transparent; color: #ffffff; }
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); transform: translateY(-1px); color: #ffffff; }

.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: transparent; color: #ffffff; }
.btn-warning:hover { background: linear-gradient(135deg, #d97706, #b45309); transform: translateY(-1px); color: #ffffff; }

.btn-info { background: linear-gradient(135deg, #06b6d4, #3b82f6); border-color: transparent; color: #ffffff; }
.btn-info:hover { background: linear-gradient(135deg, #0891b2, #2563eb); transform: translateY(-1px); color: #ffffff; }

.btn-secondary { background: #fff; border-color: var(--border-strong); color: #1e293b; font-weight: 500; }
.btn-secondary:hover { background: var(--bg-hover); color: #0f172a; border-color: #94a3b8; }

.btn-outline-primary { color: var(--blue); border-color: var(--blue); background: transparent; }
.btn-outline-primary:hover { background: var(--blue); color: #fff; }

.btn-outline-secondary { color: #475569; border-color: var(--border-strong); background: transparent; }
.btn-outline-secondary:hover { background: #f1f5f9; color: #0f172a; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }

.badge {
    padding: 0.4em 0.75em;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    padding: 0.55rem 0.8rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background-color: #fff;
    color: #0f172a;
    line-height: 1.4;
    font-weight: 450;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    outline: none;
    color: #0f172a;
}

.form-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-check-label { color: #1e293b; font-weight: 500; }

.pagination { gap: 0.2rem; }

.page-link {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border);
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
    background: #fff;
    min-width: 36px;
    text-align: center;
    color: #1e293b;
}

.page-link:hover { background: #eff6ff; border-color: var(--blue-light); color: var(--blue); }
.page-item.active .page-link {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--shadow-blue);
}
.page-item.disabled .page-link { background: #f8fafc; color: #94a3b8; }

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-bottom: none;
    padding: 1.05rem 1.4rem;
    color: #ffffff;
}

.modal-title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.modal-header .btn-close { filter: brightness(0) invert(1); opacity: 0.8; font-size: 0.8rem; }
.modal-header .btn-close:hover { opacity: 1; }

.modal-body {
    padding: 1.4rem;
    font-size: 0.9rem;
    background: #fff;
    color: #1e293b;
}

.modal-footer {
    background: #f8fafc;
    border-top: 1px solid var(--border);
    padding: 0.9rem 1.4rem;
}

.alert {
    border-radius: var(--radius-sm);
    border: 1px solid;
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, #1e293b 0%, #1e40af 50%, #4f46e5 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.login-card {
    width: 100%;
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.25rem;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #0f172a;
}

.login-header { text-align: center; margin-bottom: 2rem; }

.login-header i,
.login-header .fa-users,
.login-header [class*="fa-"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    color: #ffffff !important;
    font-size: 1.6rem !important;
    line-height: 1 !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35) !important;
}

.login-header h3 {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: #0f172a;
}

.login-header p { color: #64748b; font-size: 0.875rem; margin-bottom: 0; }

.login-card .form-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.8rem;
    letter-spacing: -0.01em;
}

.login-card .input-group-text {
    background: #f8fafc;
    border: 1px solid var(--border-strong);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: #64748b;
    font-size: 0.9rem;
}

.login-card .form-control {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-left: none;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.75rem 0.95rem;
    font-size: 0.9rem;
    color: #0f172a;
}

.login-card .form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.login-card .btn-outline-secondary {
    background: #f8fafc;
    border: 1px solid var(--border-strong);
    border-left: none;
    color: #475569;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.login-card .btn-outline-secondary:hover { background: #f1f5f9; color: #0f172a; }

.login-card .btn-primary {
    padding: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    font-size: 0.95rem;
    box-shadow: var(--shadow-blue);
    border: none;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(59, 130, 246, 0.5);
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: #fff;
    border-top: 1px solid var(--border);
    color: #475569;
    font-size: 0.82rem;
    padding: 1rem 0;
    width: 100%;
    flex-shrink: 0;
    margin-top: auto;
    text-align: center;
}

footer .footer-link {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

footer .footer-link:hover {
    color: var(--blue);
    text-decoration: underline;
}

footer .footer-sep { color: #cbd5e1; }

body.login-page footer {
    background: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.75) !important;
    margin-top: 0 !important;
}

body.login-page footer small,
body.login-page footer strong,
body.login-page footer div {
    color: rgba(255, 255, 255, 0.75) !important;
}

body.login-page footer .footer-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.login-page footer .footer-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    text-decoration: none;
}

body.login-page footer .footer-sep {
    color: rgba(255, 255, 255, 0.25) !important;
}

/* ============================================================
   FILTRO DE PAGOS - RESPONSIVE
   ============================================================ */
#btn-toggle-filtros {
    border-width: 1px;
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    line-height: 1;
    display: none;
}
#btn-toggle-filtros i { transition: transform 0.25s ease; display: inline-block; }

@media (max-width: 991.98px) {
    #btn-toggle-filtros { display: inline-flex; align-items: center; justify-content: center; }
    #fp-filtros-body { padding: 1rem 0.75rem; background: #fff; }
}

.fp-tabs-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.fp-tabs-wrapper::-webkit-scrollbar { display: none; }

.fp-tabs-wrapper .nav-tabs {
    flex-wrap: nowrap;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.fp-tabs-wrapper .nav-tabs .nav-item { flex-shrink: 0; }
.fp-tabs-wrapper .nav-tabs .nav-link {
    padding: 0.65rem 1.1rem;
    font-size: 0.875rem;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.15s;
    background: transparent;
    color: #475569;
}
.fp-tabs-wrapper .nav-tabs .nav-link:hover {
    border-bottom-color: var(--blue-light);
    background: transparent;
    color: var(--blue);
}
.fp-tabs-wrapper .nav-tabs .nav-link.active {
    border-bottom-color: var(--blue);
    background: transparent;
    font-weight: 700;
    color: var(--blue);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   UTILIDADES
   ============================================================ */
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
strong { font-weight: 700; }
hr { border-color: var(--border); opacity: 1; margin: 1rem 0; }
.text-muted { color: #475569 !important; }
.list-group-item-action { transition: all 0.15s; }
.list-group-item-action:hover { background: #eff6ff; }
.table-responsive { border-radius: 0; }

@media (max-width: 991.98px) {
    html { font-size: 13.5px; }
    .card-body { padding: 1rem; }
    .card-header { padding: 0.8rem 1rem; font-size: 0.875rem; }
    .table { font-size: 0.82rem; }
    .btn { font-size: 0.8rem; padding: 0.45rem 0.8rem; }
    .navbar { padding: 0.65rem 1rem; }
    .modal-body { padding: 1.1rem; }
    .modal-header { padding: 0.95rem 1.15rem; }
    .modal-footer { padding: 0.8rem 1.15rem; }
    #page-content-wrapper > .container-fluid { padding: 1rem; }
}

/* ============================================================
   ACCESIBILIDAD: FOCO VISIBLE
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--blue) !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--blue) !important;
    outline-offset: 2px !important;
}

:focus:not(:focus-visible) { outline: none; }

body.login-page .login-card input:focus-visible,
body.login-page .login-card button:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18) !important;
    border-color: var(--blue) !important;
}

body.login-page .login-card .btn-outline-secondary:focus-visible {
    outline: 2px solid var(--blue) !important;
    outline-offset: 2px !important;
}

/* ============================================================
   ANIMACIONES DEL LOGIN
   ============================================================ */
@keyframes loginCardIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card { animation: loginCardIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes iconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35); }
    50% { transform: scale(1.05); box-shadow: 0 12px 32px rgba(59, 130, 246, 0.55); }
}
.login-header i, .login-header .fa-users, .login-header [class*="fa-"] {
    animation: iconPulse 3s ease-in-out infinite;
}

.login-card .btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    transition: left 0.6s ease;
}
.login-card .btn-primary:hover::before { left: 100%; }

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
body.login-page footer { animation: fadeInUp 0.9s ease-out 0.4s both; }
body.login-page footer .footer-link { animation: fadeInUp 0.6s ease-out 0.6s both; }
body.login-page footer .footer-link:nth-child(1) { animation-delay: 0.6s; }
body.login-page footer .footer-link:nth-child(3) { animation-delay: 0.7s; }
body.login-page footer .footer-link:nth-child(5) { animation-delay: 0.8s; }

@keyframes fadeInInput {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}
.login-card .form-label, .login-card .input-group {
    animation: fadeInInput 0.5s ease-out both;
}
.login-card .mb-3:nth-child(1) .form-label { animation-delay: 0.3s; }
.login-card .mb-3:nth-child(1) .input-group { animation-delay: 0.35s; }
.login-card .mb-3:nth-child(2) .form-label { animation-delay: 0.4s; }
.login-card .mb-3:nth-child(2) .input-group { animation-delay: 0.45s; }
.login-card .btn-primary { animation: fadeInUp 0.5s ease-out 0.55s both; }

#btnIngresar { position: relative; transition: all 0.25s ease; }
#btnIngresar:disabled {
    opacity: 0.85;
    cursor: wait;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}
#btnIngresar .btn-text, #btnIngresar .btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
#btnIngresar .spinner-border { border-width: 2px; animation-duration: 0.65s; }
#btnIngresar:disabled::before { display: none; }

@media (prefers-reduced-motion: reduce) {
    .login-card, .login-header i, .login-header .fa-users, .login-header [class*="fa-"],
    body.login-page footer, body.login-page footer .footer-link,
    .login-card .form-label, .login-card .input-group, .login-card .btn-primary {
        animation: none !important;
        transition: none !important;
    }
    .login-card .btn-primary::before { display: none; }
}

/* ============================================================
   TUTORIAL — ESTILOS EXCLUSIVOS DE LAS ALERTAS
   ============================================================ */
.tut-tip {
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 14px;
    color: #78350f;
}
.tut-tip strong, .tut-tip i, .tut-tip ul, .tut-tip li {
    color: #78350f;
    font-weight: 500;
}
.tut-tip strong { font-weight: 700; display: block; margin-bottom: 8px; font-size: 0.95rem; }
.tut-tip ul { margin: 0; padding-left: 20px; list-style-type: disc; }
.tut-tip li { margin-bottom: 4px; line-height: 1.55; }

.tut-alerta {
    background-color: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    color: #7f1d1d;
}
.tut-alerta strong, .tut-alerta i, .tut-alerta ul, .tut-alerta li {
    color: #7f1d1d;
    font-weight: 500;
}
.tut-alerta strong { font-weight: 700; display: block; margin-bottom: 8px; font-size: 0.95rem; }
.tut-alerta ul { margin: 0; padding-left: 20px; list-style-type: disc; }
.tut-alerta li { margin-bottom: 4px; line-height: 1.55; }

.tut-ejemplo {
    background-color: #d1fae5;
    border-left: 4px solid #10b981;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    color: #064e3b;
}
.tut-ejemplo strong, .tut-ejemplo i, .tut-ejemplo span {
    color: #064e3b;
    font-weight: 500;
}
.tut-ejemplo strong { font-weight: 700; }

.tut-cuando {
    background-color: #e0f2fe;
    border-left: 4px solid #06b6d4;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    color: #0c4a6e;
}
.tut-cuando strong, .tut-cuando i, .tut-cuando span {
    color: #0c4a6e;
    font-weight: 500;
}
.tut-cuando strong { font-weight: 700; }