/* =========================================================
   Extrato do Jogador — Styles
   Bingão Dashboard
   ========================================================= */

.extrato-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 32px 48px;
}

/* Header */
.extrato-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #94a3b8);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-2px);
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-title .title-icon {
    font-size: 26px;
}

/* Filter Card */
.filter-card {
    background: var(--bg-surface, rgba(18, 26, 43, 0.7));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(280px, 2fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
    gap: 16px;
    align-items: flex-end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #64748b);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted, #64748b);
    font-size: 14px;
    pointer-events: none;
}

.extrato-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: var(--bg-input, rgba(0, 0, 0, 0.25));
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.extrato-input:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: var(--bg-input-focus, rgba(0, 0, 0, 0.35));
}

.extrato-input-date {
    padding-left: 14px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-search {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-search:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-search:active {
    transform: translateY(0);
}

.btn-export {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.12));
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-export:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.btn-export:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Quick Filter Pills */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    align-items: center;
}

.pills-label {
    font-size: 12px;
    color: var(--text-muted, #64748b);
    font-weight: 500;
    margin-right: 4px;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.pill-btn:hover, .pill-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

/* KPI Summary Cards */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface, rgba(18, 26, 43, 0.7));
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary, #3b82f6);
    opacity: 0.8;
}

.kpi-card.debit::after {
    background: #f43f5e;
}

.kpi-card.credit::after {
    background: #10b981;
}

.kpi-card.net-positive::after {
    background: #10b981;
}

.kpi-card.net-negative::after {
    background: #f43f5e;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
}

.kpi-icon {
    font-size: 16px;
    opacity: 0.8;
}

.kpi-value {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    color: var(--text-primary, #fff);
    line-height: 1.2;
}

.kpi-value.debit {
    color: #fb7185;
}

.kpi-value.credit {
    color: #34d399;
}

.kpi-value.positive {
    color: #34d399;
}

.kpi-value.negative {
    color: #fb7185;
}

.kpi-subtext {
    font-size: 12px;
    color: var(--text-muted, #64748b);
}

/* Alert / Info Banners */
.alert-banner {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Ledger Table Section */
.ledger-wrapper {
    background: var(--bg-surface, rgba(18, 26, 43, 0.7));
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.ledger-table-header {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-badge {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-family: var(--font-mono, monospace);
    color: var(--text-secondary, #94a3b8);
}

.ledger-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ledger-table thead tr {
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
}

.ledger-table th {
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.ledger-row {
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.05));
    transition: background 0.15s ease;
    cursor: pointer;
}

.ledger-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.ledger-row.expanded {
    background: rgba(59, 130, 246, 0.06);
    border-bottom-color: transparent;
}

.ledger-table td {
    padding: 14px 18px;
    font-size: 13px;
    color: var(--text-primary, #fff);
    vertical-align: middle;
}

/* Status Badges */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-status.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-room {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
    white-space: nowrap;
}

/* Values formatted */
.val-debit {
    color: #fb7185;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
}

.val-credit {
    color: #34d399;
    font-family: var(--font-mono, monospace);
    font-weight: 600;
}

.val-balance {
    font-family: var(--font-mono, monospace);
    font-weight: 500;
    color: var(--text-secondary, #cbd5e1);
}

.val-mono {
    font-family: var(--font-mono, monospace);
}

.btn-toggle-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary, #94a3b8);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-row:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.ledger-row.expanded .btn-toggle-row {
    transform: rotate(180deg);
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Details Accordion Drawer */
.drawer-row {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.drawer-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.drawer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.drawer-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    border-radius: 10px;
    padding: 16px;
}

.drawer-card-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Bingo Ball Balls List */
.balls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 160px;
    overflow-y: auto;
    padding: 4px;
}

.bingo-ball {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono, monospace);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bingo-ball.marked {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #fff;
    border-color: #60a5fa;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.bingo-ball.prized {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: #000;
    border-color: #fde047;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}

/* Player Cards Grid in Drawer */
.player-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.mini-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mini-card.mini-card-wide {
    min-width: 250px;
}

.mini-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted, #64748b);
}

.mini-card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.mini-ball-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    color: var(--text-secondary, #94a3b8);
}

.mini-ball-cell.daubed {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

.mini-ball-cell.prized {
    background: #eab308;
    color: #0f172a;
    font-weight: 800;
    box-shadow: 0 0 6px rgba(234, 179, 8, 0.4);
}

.mini-ball-cell.blank {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.08);
    color: transparent;
}

.card-award-tag {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pagination Bar */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #fff);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-page:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-page:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-page.current {
    background: var(--accent-primary, #3b82f6);
    border-color: var(--accent-primary, #3b82f6);
    color: #fff;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-muted, #64748b);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 14px;
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Skeleton Loading */
.skeleton-box {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    height: 16px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 1024px) {
    .filter-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .filter-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .extrato-container {
        padding: 16px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        grid-column: span 1;
    }
    
    .kpi-section {
        grid-template-columns: 1fr 1fr;
    }
    
    .pagination-bar {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}
