/* ============================================================
   REPORT PAGES - Shared Styles
   Used by: Project360, Finances/Report, Workdays/Summary,
            WorkersReport, Equipment, WorkDiaries/Index
   ============================================================ */

/* ========== PAGE CONTAINER ========== */
.report-container {
    width: 100%;
    padding: 1rem;
}

/* ========== CARD STYLING ========== */
.report-card {
    border: solid 1px #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    background: #ffffff !important;
    min-height: 120px;
    transition: all 0.2s ease;
}

.report-card:hover {
    border-color: #ED880E !important;
    box-shadow: 0 4px 16px rgba(237, 136, 14, 0.15) !important;
}

/* Card titles */
.report-card h4,
.report-card .h4 {
    color: #2c3e50 !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

/* ========== FILTER SECTION ========== */
.report-filter-card {
    border: solid 1px #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    background: #ffffff !important;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Filter group headings - no border/extra spacing */
.filter-group h4,
.filter-group .h4 {
    margin-bottom: 0 !important;
    padding-bottom: 0;
    border-bottom: none;
}

@media (max-width: 992px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== KPI CARDS ========== */
.kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border: solid 1px #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-width: 220px;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    border-color: #ED880E;
    box-shadow: 0 4px 16px rgba(237, 136, 14, 0.15);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.kpi-content h4 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    border-bottom: none;
    padding-bottom: 0;
}

/* KPI Variants */
.kpi-revenue .kpi-icon,
.kpi-income .kpi-icon {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.kpi-expense .kpi-icon {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.kpi-profit .kpi-icon {
    background: linear-gradient(135deg, #cce5ff 0%, #b8daff 100%);
    color: #004085;
}

.kpi-labor .kpi-icon,
.kpi-neutral .kpi-icon {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    color: #383d41;
}

/* Profit/Loss indicators */
.kpi-positive {
    border-left: 4px solid #28a745;
}

.kpi-positive .kpi-value {
    color: #28a745;
}

.kpi-negative {
    border-left: 4px solid #dc3545;
}

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

/* ========== KPI GRID ========== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
    align-items: stretch;
}

.kpi-grid .kpi-card {
    min-height: 180px;
    flex-direction: column;
    align-items: flex-start;
}

.kpi-grid .kpi-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.kpi-grid .kpi-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #e3e7eb;
}

.kpi-grid .kpi-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-grid .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.kpi-grid .kpi-subtext {
    color: #6c757d;
    font-size: 0.8rem;
    line-height: 1.6;
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== SUMMARY ITEMS ========== */
.summary-items-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex: 1 1 calc(33.333% - 1rem);
    min-width: 180px;
}

.summary-item .summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e3e7eb;
    flex-shrink: 0;
}

.summary-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2c3e50;
}

.summary-subtext {
    color: #868e96;
    font-size: 0.8rem;
    margin-top: 0.75rem;
    font-weight: 500;
}

/* ========== GRID LAYOUTS ========== */
.report-grid,
.report-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
    align-items: start;
}

.report-grid > .report-card {
    min-height: 280px;
}

@media (max-width: 992px) {
    .report-grid,
    .report-two-column {
        grid-template-columns: 1fr;
    }
}

/* ========== CHART CONTAINERS ========== */
.chart-container {
    height: 300px;
    max-height: 300px;
    overflow: hidden;
    position: relative;
}

.chart-container canvas {
    max-height: 100% !important;
}

.chart-wrapper {
    padding: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Chart summary row */
.chart-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chart-summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    flex: 1;
    min-width: 150px;
}

.chart-summary-item.income {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.chart-summary-item.expense {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.chart-summary-item.profit {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
}

.chart-summary-item.loss {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

.chart-summary-label {
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.chart-summary-value {
    font-size: 1rem;
    font-weight: 700;
}

/* ========== DATA GRID STYLING ========== */
.report-card .table {
    font-size: 0.85rem;
}

.report-card .table th {
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.report-card .table td {
    color: #495057;
    vertical-align: middle;
}

/* Blazorise DataGrid - restore proper header styling */
.report-card .b-datagrid thead th,
.report-card .table-responsive thead th {
    background-color: #003951 !important;
    color: white !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-bottom: none;
}

/* Radzen DataGrid styling */
.report-datagrid {
    font-size: 0.875rem;
    border-radius: 8px;
    overflow: hidden;
}

.report-datagrid .rz-datatable-thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    padding: 0.75rem;
}

.report-datagrid .rz-datatable-tbody td {
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
    border-color: #e9ecef;
}

.report-datagrid .rz-datatable-tbody tr:hover {
    background-color: #f8f9fa;
}

/* Clickable rows */
.clickable-rows tbody tr,
.clickable-rows tbody tr td {
    cursor: pointer !important;
    transition: background-color 0.15s ease;
}

.clickable-rows tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.12) !important;
}

/* ========== EMPTY STATE ========== */
.report-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    color: #6c757d;
}

.report-empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-icon {
    background: linear-gradient(135deg, rgba(0, 57, 81, 0.1) 0%, rgba(237, 136, 14, 0.1) 100%);
    border-radius: 50%;
    padding: 24px;
    margin-bottom: 8px;
}

/* ========== BADGES ========== */
.report-badge {
    padding: 0.5rem !important;
    font-size: 0.8rem !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
}

/* ========== SELECT STYLING ========== */
.report-select {
    width: auto !important;
    min-width: 180px !important;
    max-width: 250px !important;
    border-radius: 6px !important;
}

.report-select.narrow {
    min-width: 120px !important;
    max-width: 160px !important;
}

/* ========== HEADER STYLING ========== */
.report-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.report-header h3,
.report-header .h3 {
    font-weight: 700;
    color: #2c3e50;
}

/* ========== STATUS TAGS ========== */
.report-status-tags .badge {
    font-weight: 600;
}
