﻿/* ==========================================================
   REPORTS — Final Dense Layout
   Mevcut reports.css dosyasının tamamı ile değiştirilmelidir.
   ========================================================== */

.reports-page {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.reports-page--dense {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* ----------------------------------------------------------
   HEADER
   ---------------------------------------------------------- */

.reports-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.reports-page__header--dense {
    min-height: 30px;
    margin: 0;
}

.reports-page__heading {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.reports-page__heading h1 {
    flex: 0 0 auto;
    margin: 0;
    color: var(--color-text-primary);
    font-size: 19px;
    line-height: 22px;
    letter-spacing: -.015em;
}

.reports-page__status {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-tertiary);
    font-size: 10px;
    line-height: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-refresh-button {
    flex: 0 0 auto;
    min-height: 29px;
    height: 29px;
    padding: 0 8px;
    gap: 5px;
    font-size: 10px;
}

.reports-refresh-button svg {
    width: 13px;
    height: 13px;
}

/* ----------------------------------------------------------
   FILTER
   ---------------------------------------------------------- */

.reports-filter-card {
    padding: 7px 8px;
}

.reports-quick-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
}

.reports-quick-periods .chip {
    height: 24px;
    padding: 0 6px;
    font-size: 9px;
}

.reports-filter-grid {
    display: grid;
    grid-template-columns:
        minmax(118px, .65fr)
        minmax(118px, .65fr)
        minmax(170px, 1.25fr)
        minmax(140px, .8fr)
        auto;
    align-items: end;
    gap: 6px;
}

.reports-filter-grid .form-field {
    gap: 2px;
}

.reports-filter-grid .form-label {
    font-size: 9px;
    line-height: 11px;
}

.reports-filter-grid .form-control {
    width: 100%;
    height: 30px;
    min-height: 30px;
    padding: 0 7px;
    font-size: 10px;
}

.reports-filter-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 0;
}

.reports-filter-actions .btn {
    min-height: 29px;
    height: 29px;
    padding: 0 8px;
    font-size: 10px;
}

.reports-filter-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    padding: 5px 7px;
    border-left: 3px solid var(--color-warning);
    border-radius: var(--radius-sm);
    background: var(--color-warning-bg);
    color: var(--color-text-secondary);
    font-size: 9px;
}

.reports-filter-warning .btn {
    flex: 0 0 auto;
}

.reports-filter-grid select.form-control {
    cursor: pointer;
}

.reports-filter-grid select.form-control:disabled {
    cursor: default;
    opacity: .65;
}

/* ----------------------------------------------------------
   KPI
   ---------------------------------------------------------- */

.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(105px, 1fr));
    gap: 6px;
}

.reports-kpi {
    position: relative;
    min-width: 0;
    min-height: 56px;
    padding: 6px 8px 6px 10px;
    overflow: hidden;
}

.reports-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--color-primary);
}

.reports-kpi__label {
    display: block;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: 9px;
    font-weight: 600;
    line-height: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-kpi__value {
    display: block;
    margin-top: 1px;
    overflow: hidden;
    color: var(--color-text-primary);
    font-size: 16px;
    line-height: 18px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-kpi small {
    display: block;
    margin-top: 1px;
    overflow: hidden;
    color: var(--color-text-tertiary);
    font-size: 8px;
    line-height: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   LAYOUT / PANELS
   ---------------------------------------------------------- */

.reports-main-grid,
.reports-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 7px;
}

.reports-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.reports-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--color-divider);
}

.reports-panel__header h2 {
    margin: 0;
    color: var(--color-text-primary);
    font-size: 11px;
    line-height: 14px;
}

.reports-panel__header .app-content-card__eyebrow {
    display: block;
    margin-bottom: 0;
    font-size: 8px;
    line-height: 9px;
}

.reports-panel__count {
    padding: 1px 5px;
    border-radius: var(--radius-pill);
    background: var(--color-hover-bg);
    color: var(--color-text-tertiary);
    font-size: 8px;
    line-height: 14px;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   TABLES — Dense rows
   ---------------------------------------------------------- */

.reports-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.reports-table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 9px;
    line-height: 1;
}

.reports-table th {
    height: 23px;
    padding: 0 6px;
    text-align: left;
    color: var(--color-text-tertiary);
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-divider);
    font-size: 8px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.reports-table td {
    height: 27px;
    padding: 2px 6px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-divider);
    vertical-align: middle;
    line-height: 1;
    white-space: nowrap;
}

.reports-table tbody tr {
    height: 27px;
}

.reports-table tbody tr:last-child td {
    border-bottom: 0;
}

.reports-table tbody tr:hover {
    background: var(--color-hover-bg);
}

.reports-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.reports-table td > strong {
    font-size: 9px;
    line-height: 1;
}

.reports-primary-cell {
    display: grid;
    align-content: center;
    gap: 0;
    min-width: 0;
    height: 23px;
    line-height: 1;
}

.reports-primary-cell strong {
    display: block;
    max-width: 205px;
    overflow: hidden;
    color: var(--color-text-primary);
    font-size: 9px;
    line-height: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-primary-cell small {
    display: block;
    margin: 0;
    overflow: hidden;
    color: var(--color-text-tertiary);
    font-size: 7px;
    line-height: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-person-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    min-height: 23px;
}

.reports-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background: var(--color-selection-bg);
    color: var(--color-primary);
    font-size: 8px;
    font-weight: 700;
    flex: 0 0 auto;
}

/* ----------------------------------------------------------
   TREND / WORK TYPE LISTS
   ---------------------------------------------------------- */

.reports-trend-list,
.reports-work-type-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 295px;
    padding: 6px 8px;
    overflow-y: auto;
}

.reports-trend-item,
.reports-work-type-item {
    min-width: 0;
    padding: 2px 0;
}

.reports-trend-item + .reports-trend-item,
.reports-work-type-item + .reports-work-type-item {
    border-top: 1px solid var(--color-divider);
    padding-top: 5px;
}

.reports-trend-item__top,
.reports-work-type-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 9px;
    line-height: 11px;
}

.reports-trend-item__top strong,
.reports-work-type-item__header span {
    color: var(--color-text-primary);
}

.reports-trend-item__top span,
.reports-work-type-item__header strong {
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.reports-progress {
    height: 2px;
    margin-top: 2px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: var(--color-hover-bg);
}

.reports-progress span {
    display: block;
    height: 100%;
    min-width: 2px;
    border-radius: inherit;
    background: var(--color-primary);
}

.reports-trend-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
    color: var(--color-text-tertiary);
    font-size: 7px;
    line-height: 9px;
}

.reports-work-type-item small {
    display: block;
    margin-top: 2px;
    color: var(--color-text-tertiary);
    font-size: 7px;
    line-height: 9px;
}

/* ----------------------------------------------------------
   STATES
   ---------------------------------------------------------- */

.reports-error,
.reports-access-denied {
    padding: 11px;
}

.reports-error strong,
.reports-access-denied strong {
    color: var(--color-text-primary);
}

.reports-error p,
.reports-access-denied p {
    margin: 3px 0 7px;
    color: var(--color-text-secondary);
}

.reports-empty {
    padding: 12px 10px;
    color: var(--color-text-tertiary);
    text-align: center;
    font-size: 9px;
}

/* ----------------------------------------------------------
   KPI VARIANTS
   ---------------------------------------------------------- */

.reports-kpi--default::before { background: var(--color-text-tertiary); }
.reports-kpi--primary::before { background: var(--color-primary); }
.reports-kpi--development::before { background: var(--color-info); }
.reports-kpi--work::before { background: var(--color-secondary); }
.reports-kpi--open::before { background: var(--color-warning); }
.reports-kpi--success::before { background: var(--color-success); }
.reports-kpi--company::before { background: var(--color-primary); }
.reports-kpi--danger::before { background: var(--color-danger); }

/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 1500px) {
    .reports-kpi-grid {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
    }
}

@media (max-width: 1100px) {
    .reports-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-filter-actions {
        grid-column: 1 / -1;
    }

    .reports-main-grid,
    .reports-secondary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .reports-page {
        gap: 6px;
    }

    .reports-page__status {
        display: none;
    }

    .reports-refresh-button {
        width: 29px;
        padding: 0;
    }

    .reports-refresh-button span {
        display: none;
    }

    .reports-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .reports-filter-actions {
        grid-column: auto;
    }

    .reports-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .reports-kpi {
        min-height: 52px;
        padding: 5px 7px 5px 9px;
    }

    .reports-kpi__value {
        font-size: 15px;
        line-height: 17px;
    }

    .reports-filter-warning {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .reports-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .reports-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
