/* ── Payments Section Redesign — Premium & Corporate Style ── */

/* Force exact 36px top gap alignment with trainers section (2rem padding-top + 0.25rem navbar margin-bottom) */
#payments-section {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
#payments-section .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
#payments-section .payments-card {
    margin-top: 0 !important;
}

/* KPI and Stats Cards */
#payment-stats-cards {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important; /* Force exactly 6 columns in the first line on desktop */
    gap: 0.65rem !important;
    margin-bottom: var(--spacing-lg) !important;
}

#extra-payments-stats {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Force exactly 4 columns for extra payments on desktop */
    gap: 0.65rem !important;
    margin-bottom: var(--spacing-lg) !important;
}

@media (max-width: 1200px) {
    #payment-stats-cards {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    }
    #extra-payments-stats {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    }
}

/* Base style for stat cards in payment module */
#payments-section .stat-card {
    background: #1E3A5F !important; /* Professional Navy Blue */
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.65rem 0.8rem !important;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.08) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Keep icons perfectly on the far left */
    gap: 0.75rem !important;
    cursor: default;
    width: 100% !important;
    border: 1px solid transparent !important;
}

#payments-section .stat-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 16px rgba(30, 58, 95, 0.16) !important;
}

/* Clickable stat cards: stronger hover with white border accent + pointer cursor */
#payments-section .stat-card[onclick] {
    cursor: pointer !important;
}

#payments-section .stat-card[onclick]:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 10px 24px rgba(30, 58, 95, 0.28) !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

#payments-section .stat-card[onclick]:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.25) !important;
}


/* Stat card icon */
#payments-section .stat-card .stat-icon {
    font-size: 1.2rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
    margin-bottom: 0 !important;
}

/* Stat content wrapper */
#payments-section .stat-card .stat-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important; /* Centered in the remaining space of the card */
    flex-grow: 1 !important; /* Takes up all remaining card space to center perfectly */
    gap: 1px !important;
    overflow: hidden !important;
    text-align: center !important;
    padding-right: 0.5rem !important; /* Balance offset for the left icon to achieve perfect visual center */
}

/* Stat card values */
#payments-section .stat-card .stat-value {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* Stat card label */
#payments-section .stat-card .stat-label {
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Stat card subtext (used for extra payments e.g. "0 pago(s)") */
#payments-section .stat-card .stat-subtext {
    font-size: 0.65rem !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.65) !important;
    line-height: 1.2 !important;
}

/* Payments Filters Bar */
.payments-filter-bar {
    padding: 1.25rem !important;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 14px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.01) !important;
    margin-bottom: 1.5rem !important;
}

.payments-filter-bar h4 {
    color: #1E3A5F !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Styled Inputs */
#payments-section .form-input, 
#payments-section select.form-input {
    height: 42px !important;
    background: #ffffff !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 10px !important;
    padding: 0 0.85rem !important;
    font-size: 0.88rem !important;
    color: #1E293B !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

#payments-section .form-input:focus {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

/* Table Design Overhaul */
#payments-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    width: 100% !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    border: 1px solid #E2E8F0 !important;
}

#payments-table thead th {
    background: #F8FAFC !important;
    color: #475569 !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    padding: 1rem 1.25rem !important;
    border-bottom: 1.5px solid #E2E8F0 !important;
}

#payments-table tbody tr {
    transition: background-color 0.15s ease !important;
}

#payments-table tbody tr:hover {
    background-color: #F8FAFC !important;
}

#payments-table tbody td {
    padding: 0.95rem 1.25rem !important;
    border-bottom: 1px solid #F1F5F9 !important;
    vertical-align: middle !important;
    color: #1E293B !important;
    font-size: 0.88rem !important;
}

#payments-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Premium Pill Badges for Payment Status */
.payment-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0.35rem 0.75rem !important;
    border-radius: 30px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.payment-badge.badge-paid {
    background: rgba(16, 185, 129, 0.08) !important;
    color: #059669 !important;
    border: 1px solid rgba(16, 185, 129, 0.2) !important;
}

.payment-badge.badge-pending {
    background: rgba(245, 158, 11, 0.08) !important;
    color: #D97706 !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

.payment-badge.badge-becado {
    background: rgba(236, 72, 153, 0.08) !important;
    color: #DB2777 !important;
    border: 1px solid rgba(236, 72, 153, 0.2) !important;
}

/* Custom Table Dropdown/Select */
.table-plan-select {
    height: 34px !important;
    padding: 0 1.75rem 0 0.55rem !important;
    border: 1.5px solid #E2E8F0 !important;
    border-radius: 8px !important;
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    background: #ffffff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") no-repeat right 0.4rem center !important;
    background-size: 1.1rem !important;
    appearance: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    color: #334155 !important;
}

.table-plan-select:focus {
    border-color: #2563EB !important;
    box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.1) !important;
    outline: none !important;
}

/* Row Action Buttons styling */
.payments-actions {
    display: flex !important;
    gap: 0.35rem !important;
    align-items: center !important;
}

.payments-actions .btn-pay {
    background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 0.4rem 0.85rem !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 4px rgba(30, 58, 95, 0.12) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.payments-actions .btn-pay:hover {
    background: linear-gradient(135deg, #152B47 0%, #1E3A5F 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 8px rgba(30, 58, 95, 0.2) !important;
}

.payments-actions .btn-extra {
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #CBD5E1 !important;
    padding: 0.4rem 0.75rem !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    transition: all 0.18s ease !important;
    cursor: pointer !important;
}

.payments-actions .btn-extra:hover {
    background: #F8FAFC !important;
    border-color: #94A3B8 !important;
    color: #1E293B !important;
    transform: translateY(-1px) !important;
}

.payments-actions .btn-history {
    background: #F1F5F9 !important;
    color: #475569 !important;
    border: 1px solid transparent !important;
    padding: 0.4rem 0.75rem !important;
    border-radius: 8px !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    transition: all 0.18s ease !important;
    cursor: pointer !important;
}

.payments-actions .btn-history:hover {
    background: #E2E8F0 !important;
    color: #1E293B !important;
    transform: translateY(-1px) !important;
}

/* User avatar and info inside table row */
.payments-player-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.payments-player-card img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.2s ease;
}

.payments-player-card:hover img {
    border-color: #2563EB;
}

.payments-player-info {
    display: flex;
    flex-direction: column;
}

.payments-player-name {
    font-weight: 600;
    color: #0F172A;
    font-size: 0.85rem;
}

.payments-attendance-badge {
    background: rgba(30, 58, 95, 0.06);
    color: #1E3A5F;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    width: fit-content;
    margin-top: 0.15rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

/* ── Payments Custom Card & Banner ── */
#payments-section .payments-card {
    padding: 0 !important; /* overrides standard card padding */
    overflow: hidden !important;
}

.payments-header-banner {
    background: #1E3A5F !important; /* solid navy blue */
    color: #ffffff !important;
    padding: 0.9rem 1.5rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 3.5px solid #2563EB !important; /* solid electric blue accent bar */
}

.payments-header-banner h2 {
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 18.5px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.payments-header-month-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.65rem !important;
}

.payments-header-month-container label {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

.payments-card-body {
    padding: 1.5rem !important;
}

/* ── Payments Filter Panel Redesign ── */
.payments-filter-container {
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin-top: 1.5rem !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

.payments-filter-header {
    background: #1E3A5F !important; /* solid navy blue */
    color: #ffffff !important;
    padding: 0.65rem 1.25rem !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
}

.payments-filter-body {
    padding: 1.25rem !important;
    background: #F8FAFC !important; /* light grey content background */
}

/* ── Main Header Redesign — Premium Corporate Look ── */
.header {
    background: linear-gradient(135deg, #152B47 0%, #1E3A5F 100%) !important; /* Deep Premium Navy Blue */
    border: none !important;
    border-radius: 16px !important;
    padding: 0.95rem 1.75rem !important;
    color: #ffffff !important;
    box-shadow: 0 10px 25px -5px rgba(21, 43, 71, 0.15), 0 8px 10px -6px rgba(21, 43, 71, 0.1) !important;
    margin-bottom: 1.5rem !important;
    position: relative;
    overflow: hidden;
}

/* Subtle glowing light effect at the top of the header */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0) 100%);
}

.header h1 {
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1.45rem !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.header #app-title {
    color: #ffffff !important;
    letter-spacing: -0.01em;
}

#sport-club-name {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    margin-top: 0.15rem !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
}

/* User Info Box in Header */
.user-info {
    background: rgba(255, 255, 255, 0.08) !important; /* Elegant semi-transparent glass pill */
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 30px !important;
    padding: 0.45rem 0.95rem !important;
    color: #ffffff !important;
    gap: 0.65rem !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}

.user-avatar {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important; /* Premium Blue Avatar */
    color: #ffffff !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 700 !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.user-name {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.user-role {
    color: rgba(255, 255, 255, 0.65) !important;
    font-weight: 500 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}

/* Header Buttons styling */
#config-header-btn {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#config-header-btn:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: rotate(30deg) !important;
}

/* Ensure the config button remains hidden when explicitly hidden via inline styles */
#config-header-btn[style*="display: none"],
#config-header-btn[style*="display:none"] {
    display: none !important;
}

.header button.btn-secondary {
    background: #ffffff !important;
    color: #1E3A5F !important;
    border: none !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    padding: 0.45rem 1.15rem !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.header button.btn-secondary:hover {
    background: #F8FAFC !important;
    transform: translateY(-1.5px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ── Navigation Tabs Redesign — Sleek Segmented Capsule ── */
.nav-tabs {
    background: #ffffff !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 14px !important;
    padding: 0.35rem !important;
    display: flex !important;
    gap: 0.3rem !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02) !important;
    margin-bottom: 1.5rem !important;
    width: fit-content !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    max-width: 100% !important;
}

/* Hide scrollbar on nav tabs bar */
.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    border-radius: 10px !important;
    padding: 0.55rem 1.1rem !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    color: #64748B !important; /* slate grey */
    background: transparent !important;
    border: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    white-space: nowrap !important;
    user-select: none !important;
}

/* Ensure tabs that are explicitly hidden remain hidden even with important styles above */
.nav-tab[style*="display: none"],
.nav-tab[style*="display:none"] {
    display: none !important;
}

.nav-tab:hover {
    color: #1E3A5F !important;
    background: #F1F5F9 !important;
    transform: translateY(-1px) !important;
}

.nav-tab.active {
    background: #1E3A5F !important; /* Solid Navy Blue active state */
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.15) !important;
}

/* ── Sport selector pills ── */
.sport-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    text-align: left !important;
    padding: 0.45rem 1.15rem !important;
    border-radius: 20px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border: 2px solid #E2E8F0 !important;
    cursor: pointer !important;
    background: #ffffff !important;
    color: #64748b !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
}

.sport-pill:hover {
    border-color: #2563EB !important;
    color: #1E3A5F !important;
    background: #F8FAFC !important;
    transform: translateY(-1px) !important;
}

.sport-pill.active {
    background: linear-gradient(135deg, #1E3A5F 0%, #2563EB 100%) !important; /* Solid Navy to Electric Blue gradient! */
    border-color: #1E3A5F !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.2) !important;
}


