/* ==========================================================================
   KENSHOTECH ECOSYSTEM - MODUL PUSAT LAPORAN & REKAPITULASI (REPORTS)
   ========================================================================== */

.reports-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Metric Summary Cards */
.reports-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.reports-stat-card {
    background: #ffffff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.reports-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.reports-stat-icon.icon-gold {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.reports-stat-icon.icon-classes {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.reports-stat-icon.icon-athletes {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.reports-stat-icon.icon-contingents {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.reports-stat-data {
    display: flex;
    flex-direction: column;
}

.reports-stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    font-family: inherit;
}

.reports-stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Tab Navigation for Reports */
.reports-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #f1f5f9;
    padding: 0.375rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.reports-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.reports-tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.reports-tab-btn.active {
    color: #0d5f53;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 700;
}

/* Toolbar & Filtering */
.reports-toolbar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.reports-filters-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.reports-search-box {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 200px;
    min-width: 140px;
    max-width: 320px;
}

.reports-search-box svg {
    position: absolute;
    left: 11px;
    color: #94a3b8;
    pointer-events: none;
}

.reports-search-box input {
    width: 100%;
    height: 36px;
    padding: 0 0.85rem 0 2.2rem;
    font-size: 0.825rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.reports-search-box input:focus {
    background: #ffffff;
    border-color: #0d5f53;
    box-shadow: 0 0 0 3px rgba(13, 95, 83, 0.12);
}

.reports-select-filter {
    height: 36px;
    padding: 0 0.8rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.reports-select-filter[hidden] {
    display: none !important;
}

.reports-select-filter:focus {
    background: #ffffff;
    border-color: #0d5f53;
    box-shadow: 0 0 0 3px rgba(13, 95, 83, 0.12);
}

.reports-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-report-action {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 0.85rem;
    font-size: 0.825rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.15s ease-in-out;
}

.btn-report-excel {
    background: #0f766e;
    color: #ffffff;
}

.btn-report-excel:hover {
    background: #115e59;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.25);
}

.btn-report-pdf {
    background: #be123c;
    color: #ffffff;
}

.btn-report-pdf:hover {
    background: #9f1239;
    box-shadow: 0 2px 6px rgba(190, 18, 60, 0.25);
}

.btn-report-print {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-report-print:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@media (max-width: 900px) {
    .reports-toolbar-card {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .reports-filters-group {
        width: 100%;
        flex-wrap: wrap;
    }
    .reports-search-box {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .reports-select-filter {
        flex: 1 1 auto;
    }
    .reports-actions-group {
        width: 100%;
        justify-content: stretch;
    }
    .reports-actions-group .btn-report-action {
        flex: 1;
    }
}

/* Table Enhancements */
.reports-table-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.02);
    width: 100%;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

#table-report-winners {
    min-width: 860px;
}

#table-report-standings {
    min-width: 620px;
}

#table-report-athletes {
    min-width: 700px;
}

#table-report-contingents {
    min-width: 580px;
}

.reports-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 0.75rem 0.85rem;
    border-bottom: 1.5px solid #e2e8f0;
    font-size: 0.775rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.reports-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

.reports-table tbody tr:hover {
    background: #f8fafc;
}

/* Rank & Medal Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
}

.rank-gold {
    background: #fef08a;
    color: #854d0e;
    border: 1.5px solid #eab308;
}

.rank-silver {
    background: #e2e8f0;
    color: #475569;
    border: 1.5px solid #94a3b8;
}

.rank-bronze {
    background: #fed7aa;
    color: #9a3412;
    border: 1.5px solid #f97316;
}

.rank-normal {
    background: transparent;
    color: #64748b;
    font-weight: 600;
}

.medal-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.825rem;
    font-weight: 800;
}

.chip-gold {
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fde047;
}

.chip-silver {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.chip-bronze {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.chip-total {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Contingent Participant Count Badges */
.count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.825rem;
    font-weight: 700;
}

.pill-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.pill-indigo {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.pill-teal {
    background: #ccfbf1;
    color: #0f766e;
    border: 1px solid #99f6e4;
}

.podium-athlete-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.podium-athlete-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.85rem;
    line-height: 1.25;
}

.podium-athlete-contingent {
    font-size: 0.75rem;
    color: #0284c7;
    font-weight: 600;
}

.podium-empty-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.btn-report-bracket-link,
.btn-report-quick-set {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-report-quick-set {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.btn-report-quick-set:hover {
    background: #0284c7;
    color: #ffffff;
}

.btn-report-bracket-link {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.btn-report-bracket-link:hover {
    background: #16a34a;
    color: #ffffff;
}

.status-badge-ready {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.725rem;
    font-weight: 700;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
    white-space: nowrap;
}

.status-badge-pending {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.725rem;
    font-weight: 700;
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
    white-space: nowrap;
}

/* Empty State */
.reports-empty-state {
    padding: 3.5rem 1rem;
    text-align: center;
    color: #64748b;
}

.reports-empty-state svg {
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

.reports-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.25rem;
}

.reports-empty-desc {
    font-size: 0.825rem;
    color: #94a3b8;
    margin: 0;
}
