/* 
   FUNDVISA - Admin Polish (Premium UI Edition)
   Glassmorphism, refined gradients, and modern layout enhancements.
*/

:root {
    --admin-glass: rgba(255, 255, 255, 0.75);
    --admin-glass-border: rgba(255, 255, 255, 0.3);
    --admin-accent-gradient: linear-gradient(135deg, #198754, #157347);
    --admin-card-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --admin-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background refinement */
body.admin-body {
    background:
        radial-gradient(900px 420px at 15% 0%, rgba(0, 91, 154, 0.08), transparent 60%),
        radial-gradient(700px 380px at 85% 10%, rgba(59, 181, 74, 0.1), transparent 60%),
        #f8fafc;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-shell {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.main-content {
    min-height: auto !important;
}

/* Glassmorphism Shell */
.admin-shell .fv-admin-card {
    background: var(--admin-glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--admin-glass-border);
    border-radius: 22px;
    box-shadow: var(--admin-card-shadow);
    transition: var(--admin-transition);
}

.admin-shell .fv-admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
}

@media (max-width: 991px) {
    .fv-admin-tabs {
        position: static;
        top: auto;
        width: 100%;
        margin-bottom: 1rem;
    }

    .fv-admin-tabs .nav-link {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }

    .fv-admin-topbar {
        padding: 1rem 1rem 1.25rem;
    }

    .admin-shell .fv-admin-card {
        padding: 1.25rem;
    }

    .admin-shell .card-body {
        overflow: visible;
    }

    /* ========== MOBILE SCROLL FIX ========== */
    /* Ensure main content and sections are fully scrollable on mobile */
    .main-content {
        min-height: auto !important;
        overflow: visible !important;
        padding-bottom: 3rem !important;
    }

    .tab-content,
    .tab-pane {
        overflow: visible !important;
        height: auto !important;
        min-height: auto !important;
    }

    .tab-pane .card {
        overflow: visible !important;
    }

    .tab-pane .card.overflow-hidden {
        overflow: visible !important;
    }

    /* Table responsive must scroll horizontally but not clip vertically */
    .tab-pane .table-responsive {
        overflow-x: auto !important;
        overflow-y: visible !important;
        border-radius: 0 !important;
    }

    /* Cards with row/column layout need to stack and not clip */
    .tab-pane .row {
        overflow: visible !important;
    }

    .tab-pane .card-body {
        overflow: visible !important;
    }

    /* Fix card h-100 causing clipping in column layouts */
    .tab-pane .h-100 {
        height: auto !important;
    }
}

/* Tabs: Floating Pill Style */
.fv-admin-tabs {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 90px;
    z-index: 1020;
    margin-bottom: 2rem;
}

.fv-admin-tabs .nav-link {
    border-radius: 999px;
    font-weight: 600;
    color: #4b5563;
    padding: 10px 24px;
    border: none;
    transition: var(--admin-transition);
}

.fv-admin-tabs .nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #111827;
}

.fv-admin-tabs .nav-link.active,
.nav-pills .nav-link.active,
.dropdown-item.active,
.dropdown-item:active {
    background: var(--admin-accent-gradient) !important;
    color: white !important;
    box-shadow: 0 10px 20px rgba(25, 135, 84, 0.15) !important;
}

/* Better Hero / Top Bar */
.fv-admin-topbar {
    background: white;
    border-radius: 24px;
    padding: 1.5rem 2rem;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

/* Table Enhancements */
.table-responsive {
    border-radius: 16px;
    overflow-x: auto;
    overflow-y: visible;
}

.table thead th {
    background: #f9fafb;
    border-bottom: 2px solid #f3f4f6;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

/* Custom Buttons */
.btn-verde {
    background: #198754;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(25, 135, 84, 0.15);
    transition: var(--admin-transition);
}

.btn-verde:hover {
    background: #157347;
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(25, 135, 84, 0.2);
}

/* Modal Polish */
.modal-content {
    border-radius: 24px;
    border: none;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.fv-modal-x {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--admin-transition);
}

.fv-modal-x:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

/* Animations */
.fade-in {
    animation: fadeInAdmin 0.6s ease-out forwards;
}

@keyframes fadeInAdmin {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Misc UI Helpers from original */
.transition-btn {
    transition: var(--admin-transition);
}

.transition-btn:hover {
    transform: translateY(-1px);
}

.hover-danger-bg:hover {
    background-color: #dc3545 !important;
    color: white !important;
}

.transition-all {
    transition: var(--admin-transition);
}

.accordion-item {
    border: none;
    border-bottom: 1px solid #f3f4f6;
}

.accordion-button:focus {
    box-shadow: none;
    background-color: #f8fafc;
}

.accordion-button:not(.collapsed) {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.05);
}

.table-active {
    background-color: rgba(25, 135, 84, 0.05) !important;
}

.border-primary {
    border-left: 5px solid #198754 !important;
}

#fvConfirmModal {
    z-index: 2000 !important;
}

.modal-backdrop.show:nth-of-type(2) {
    z-index: 1065 !important;
}


.fv-team-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

/* Badges */
.badge {
    padding: 0.5em 1em;
    border-radius: 8px;
    font-weight: 600;
}

/* Search bar / Inputs */
.form-control,
.form-select {
    border-radius: 12px;
    padding: 0.6rem 1rem;
    border: 1px solid #e5e7eb;
    transition: var(--admin-transition);
}

.form-control:focus {
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
    border-color: #198754;
}

/* ========================================
   PROFESSIONAL SPLIT-SCREEN LOGIN
   ======================================== */

/* Break out of the .container parent for full-width login */
#loginView.login-split-screen {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: -3rem;
    /* compensate py-5 */
    margin-bottom: -3rem;
}

.login-split-screen {
    display: flex;
    min-height: 100vh;
    background: #f0f2f5;
}

/* Left panel - Hero Image */
.login-hero-panel {
    flex: 1;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
    min-height: 100vh;
}

.login-hero-panel img.login-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.login-hero-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg,
            rgba(0, 91, 154, 0.3) 0%,
            rgba(25, 135, 84, 0.6) 100%);
    z-index: 1;
}

.login-hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem;
    color: white;
    max-width: 520px;
}

.login-hero-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.login-hero-content p {
    font-size: 1.05rem;
    font-weight: 300;
    opacity: 0.95;
    line-height: 1.6;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

/* Right panel - Login Form */
.login-form-panel {
    flex: 0 0 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: white;
    position: relative;
    overflow-y: auto;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.login-logo img {
    max-height: 80px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
    transition: transform 0.3s ease;
}

.login-logo img:hover {
    transform: scale(1.05);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.login-divider span {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.login-form-wrapper .form-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.login-form-wrapper .input-group {
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f9fafb;
}

.login-form-wrapper .input-group:focus-within {
    border-color: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
    background: white;
}

.login-form-wrapper .input-group .input-group-text {
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: #9ca3af;
}

.login-form-wrapper .input-group:focus-within .input-group-text {
    color: #198754;
}

.login-form-wrapper .input-group .form-control {
    border: none;
    background: transparent;
    padding: 0.75rem 1rem 0.75rem 0;
    font-size: 0.95rem;
    box-shadow: none;
    border-radius: 0;
}

.login-form-wrapper .input-group .form-control:focus {
    box-shadow: none;
}

.login-submit-btn {
    background: linear-gradient(135deg, #198754, #157347);
    border: none;
    border-radius: 14px;
    padding: 0.9rem 1.5rem;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    letter-spacing: 0.3px;
    box-shadow: 0 8px 24px rgba(25, 135, 84, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, #0d6efd, #198754);
    transition: width 0.4s ease;
    z-index: 0;
    border-radius: 14px;
}

.login-submit-btn:hover::before {
    width: 100%;
}

.login-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(25, 135, 84, 0.35);
    color: white;
}

.login-submit-btn span,
.login-submit-btn i {
    position: relative;
    z-index: 1;
}

.login-security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(25, 135, 84, 0.06);
    border: 1px solid rgba(25, 135, 84, 0.15);
    border-radius: 50px;
    padding: 0.5rem 1rem;
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: #198754;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.login-security-badge i {
    font-size: 0.85rem;
}

/* Login Responsive */
@media (max-width: 991px) {
    .login-split-screen {
        flex-direction: column;
    }

    .login-hero-panel {
        min-height: 280px;
        flex: 0 0 280px;
    }

    .login-hero-content {
        padding: 2rem;
    }

    .login-hero-content h2 {
        font-size: 1.5rem;
    }

    .login-hero-content p {
        font-size: 0.9rem;
    }

    .login-form-panel {
        flex: 1;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .login-hero-panel {
        min-height: 220px;
        flex: 0 0 220px;
    }

    .login-hero-content {
        padding: 1.5rem;
    }

    .login-hero-content h2 {
        font-size: 1.25rem;
    }

    .login-hero-content p {
        display: none;
    }

    .login-form-panel {
        padding: 1.5rem 1.25rem;
    }

    .login-title {
        font-size: 1.4rem;
    }

    .login-logo img {
        max-height: 60px;
    }
}