/* /admin/reports page styles. Lives global so PackA/B/C components (.razor.css scoped)
   can share without rewiring. */

/* Card title row — заглавје со текст лево + CSV button десно. Се користи во сите
   report cards со table или chart. Од Batch 2. */
.rep-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.rep-card-header > * {
    margin: 0;
}

/* Batch 3: team filter + auto-refresh контроли. Group-ирани со presets/dates
   преку flex wrap. */
.rep-team-filter,
.rep-autorefresh {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Batch 4: print stylesheet. Кога корисник кликне „Печати" (или Ctrl+P), сакаме
   само report-cards да се покажат — без navigation, header controls, button-и.
   Page-break-inside: avoid за да не се скрши кart по средина при print. */
@media print {
    /* Hide layout chrome */
    .rz-navigation,
    .rz-side-content,
    nav,
    .rep-header-controls,
    .rep-card-header > .rep-csv-btn-wrap,
    button,
    .rz-button,
    [class*="rz-tabs-nav"] {
        display: none !important;
    }
    /* Тhe report container takes full page width */
    .rep-header,
    .rz-card,
    .rep-kpi-grid,
    .rep-two-col {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
    /* DataGrid bordered cells читливо на печатена страна */
    .rz-data-grid {
        border: 1px solid #999 !important;
    }
    .rz-data-grid td, .rz-data-grid th {
        border-bottom: 1px solid #ddd !important;
    }
}

/* Batch 4: Unified chart color palette (синхрон CSS variable-и + chart series).
   Споделувано преку --rep-chart-* CSS variables за future Razor бабajot pass-нувa
   во RadzenChart Стил. */
:root {
    --rep-color-1: #0078d4;
    --rep-color-2: #10b981;
    --rep-color-3: #f59e0b;
    --rep-color-4: #ef4444;
    --rep-color-5: #8b5cf6;
    --rep-color-6: #06b6d4;
}

.rep-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.rep-kpi {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    background: #fff;
    border: 1px solid #e4e4e7;
    border-left: 4px solid var(--rep-accent, #4f46e5);
    border-radius: 8px;
    padding: 1rem 1.1rem;
}
.rep-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--rep-accent, #4f46e5) 12%, white);
    color: var(--rep-accent, #4f46e5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.rep-kpi-icon .material-icons { font-size: 22px; }
.rep-kpi-body { flex: 1; min-width: 0; }
.rep-kpi-title {
    font-size: 0.78rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rep-kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #18181b;
    line-height: 1.2;
}
.rep-kpi-delta {
    font-size: 0.75rem;
    margin-top: 0.2rem;
}
.rep-kpi-delta.good { color: #047857; }
.rep-kpi-delta.bad { color: #b91c1c; }

.rep-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 1rem;
    align-items: start;
}

.rep-empty {
    color: #a1a1aa;
    font-style: italic;
    padding: 1.5rem;
    text-align: center;
}

/* Heatmap (PackB) */
.rep-heatmap {
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    font-size: 0.72rem;
}
.rep-heatmap-row {
    display: grid;
    grid-template-columns: 48px repeat(24, 1fr);
    gap: 1px;
}
.rep-heatmap-header { font-weight: 600; color: #71717a; }
.rep-heatmap-corner { }
.rep-heatmap-h {
    text-align: center;
    padding: 4px 0;
}
.rep-heatmap-dow {
    text-align: right;
    padding: 0 6px;
    align-self: center;
    color: #52525b;
    font-weight: 600;
}
.rep-heatmap-cell {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #18181b;
    border-radius: 2px;
}

/* Deflection KPI block (PackC) */
.rep-deflection {
    text-align: center;
    padding: 1rem;
}
.rep-deflection-big {
    font-size: 3.2rem;
    font-weight: 800;
    color: #4f46e5;
    line-height: 1;
}
.rep-deflection-sub {
    margin-top: 0.5rem;
    color: #52525b;
}
.rep-deflection-detail {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #71717a;
}

/* ────────────────────────────────────────────────────
   ReportHeader — context bar над tabs
   ──────────────────────────────────────────────────── */
.rep-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f9fafb 0%, #f4f4f5 100%);
    border-radius: 10px;
    border: 1px solid #e4e4e7;
}
.rep-header-title { display: flex; flex-direction: column; gap: 0.3rem; }
.rep-header-context {
    font-size: 0.85rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.rep-header-context b { color: #18181b; font-weight: 600; }
.rep-warn { color: #dc2626; font-weight: 600; }
.rep-header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}
.rep-presets {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.rep-preset {
    padding: 0.3rem 0.7rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s;
}
.rep-preset:hover { background: #f3f4f6; border-color: #9ca3af; }
.rep-preset.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
    font-weight: 600;
}
.rep-dates {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ────────────────────────────────────────────────────
   ReportEmptyState — friendly empty карточка
   ──────────────────────────────────────────────────── */
.rep-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    background: #fafafa;
    border: 2px dashed #e4e4e7;
    border-radius: 12px;
    color: #6b7280;
}
.rep-empty-icon .material-icons {
    font-size: 3.5rem;
    color: #d1d5db;
}
.rep-empty-text { display: flex; flex-direction: column; gap: 0.35rem; }
.rep-empty-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}
.rep-empty-hint {
    font-size: 0.9rem;
    max-width: 420px;
    color: #6b7280;
}
.rep-empty-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
