/* ========================================
   Reports / Meldungen Page
   Skyblue / White Masterdata Stil
   Header links ausgerichtet wie Leases
   ======================================== */

.reports-page {
    position: relative;
    padding-bottom: 48px;
}

/* ---------- Header ---------- */

.reports-header {
    align-items: flex-start;
    gap: 16px;
}

.reports-page .htd-header,
.reports-page ::deep .htd-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.reports-page .htd-header-left,
.reports-page ::deep .htd-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 2px;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
    transform: none !important;
}

.reports-title,
.reports-page .reports-title,
.reports-page .htd-title,
.reports-page ::deep .reports-title,
.reports-page ::deep .htd-title {
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.25;
    margin: 0 0 2px 0 !important;
    padding: 0 !important;
    width: auto !important;
    max-width: none !important;
    text-align: left !important;
    align-self: flex-start !important;
    justify-self: flex-start !important;
    transform: none !important;
}

.reports-subtitle,
.reports-page .reports-subtitle,
.reports-page ::deep .reports-subtitle {
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    align-self: flex-start !important;
    transform: none !important;
}

.reports-subtitle,
.obj-muted {
    color: var(--rr-text-secondary, #64748b);
    line-height: 1.4;
}

.reports-action-btn,
.reports-page .htd-btn-primary {
    border-radius: 12px;
    text-transform: none;
    font-weight: 700;
    min-height: 40px;
    box-shadow: none;
    white-space: nowrap;
}

/* ---------- KPI Cards ---------- */

.reports-kpi-grid {
    margin-top: 0 !important;
}

.reports-kpi-card {
    height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: linear-gradient( 135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.86) );
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

    .reports-kpi-card:hover {
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
        transform: translateY(-3px);
        border-color: rgba(0, 0, 0, 0.34);
    }

.reports-kpi-value {
    font-weight: 900;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.15;
}

/* ---------- Filter ---------- */

.reports-filter-card {
    position: relative;
    border-radius: var(--rr-radius-lg, 18px);
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: linear-gradient( 135deg, rgba(250, 250, 250, 0.98), rgba(245, 245, 245, 0.78), rgba(255, 255, 255, 0.95) );
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

    .reports-filter-card > * {
        position: relative;
        z-index: 1;
    }

.reports-filter-stack {
    width: 100%;
}

.reports-search {
    min-width: 260px;
}

.reports-state-select {
    min-width: 220px;
}

.reports-page ::deep .reports-search .mud-input-root,
.reports-page ::deep .reports-state-select .mud-input-root,
.reports-page ::deep .reports-comment-input .mud-input-root {
    border-radius: var(--rr-radius-md, 14px);
    background: rgba(255, 255, 255, 0.9);
}

/* ---------- Tabs ---------- */

.reports-tabs {
    border-radius: var(--rr-radius-lg, 18px);
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: linear-gradient( 135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.80) );
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.reports-page ::deep .reports-tabs .mud-tabs-toolbar {
    background: rgba(250, 250, 250, 0.92);
    border-bottom: 1px solid rgba(0, 0, 0, 0.14);
}

.reports-page ::deep .reports-tabs .mud-tab {
    text-transform: none;
    font-weight: 800;
    color: #64748b;
}

    .reports-page ::deep .reports-tabs .mud-tab.mud-tab-active {
        color: #374151;
    }

.reports-page ::deep .reports-tabs .mud-tabs-panels {
    background: transparent;
}

/* ---------- Layout ---------- */

.reports-layout-grid {
    width: 100%;
    margin-top: 0 !important;
}

.reports-panel {
    height: 100%;
    border-radius: var(--rr-radius-lg, 18px);
    border: 1px solid rgba(0, 0, 0, 0.18);
    padding: 16px;
    background: linear-gradient( 135deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.82) );
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
}

.reports-list-panel {
    max-height: 720px;
    overflow: auto;
}

.reports-detail-panel {
    min-height: 420px;
}

.reports-list-simple {
    max-height: 520px;
    overflow: auto;
    padding-right: 4px;
}

/* ---------- Report Rows ---------- */

.report-row-simple {
    position: relative;
    padding: 12px 14px;
    border-radius: var(--rr-radius-md, 14px);
    border: 1px solid rgba(0, 0, 0, 0.16);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.88);
    overflow: hidden;
    transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

    .report-row-simple:hover {
        background: rgba(250, 250, 250, 0.95);
        border-color: rgba(0, 0, 0, 0.30);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
        transform: translateY(-2px);
    }

    .report-row-simple.selected {
        border-color: rgba(0, 0, 0, 0.45);
        background: linear-gradient( 135deg, rgba(250, 250, 250, 0.98), rgba(245, 245, 245, 0.86) );
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    }

.report-row-title {
    font-weight: 850;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}

.report-row-property {
    overflow-wrap: break-word;
    word-break: normal;
}

/* ---------- Detail ---------- */

.reports-empty-detail {
    min-height: 360px;
    justify-content: center;
}

.report-detail-header {
    gap: 16px;
}

.report-detail-title {
    font-weight: 900;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.25;
    overflow-wrap: break-word;
}

.report-meta {
    margin-top: 2px;
}

.report-detail-actions {
    flex-shrink: 0;
}

.report-section {
    min-width: 0;
}

.report-section-title {
    font-weight: 850;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.25;
}

.report-detail-desc {
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.55;
    overflow-wrap: break-word;
}

/* ---------- Comments ---------- */

.report-comment-card {
    border-radius: var(--rr-radius-md, 14px);
    border: 1px solid rgba(0, 0, 0, 0.16);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.report-comment-form {
    border-radius: var(--rr-radius-lg, 18px);
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: linear-gradient( 135deg, rgba(250, 250, 250, 0.96), rgba(255, 255, 255, 0.92) );
    padding: 16px;
}

.reports-send-btn {
    width: fit-content;
}

/* ---------- Chips / Buttons ---------- */

.report-chip,
.report-file-chip {
    width: fit-content;
    border-radius: var(--rr-radius-pill, 999px);
    font-weight: 700;
    border-color: rgba(0, 0, 0, 0.35) !important;
    color: #374151 !important;
    background: rgba(250, 250, 250, 0.78) !important;
}

.report-file-chip {
    cursor: pointer;
}

.report-secondary-btn {
    border-radius: 12px;
    text-transform: none;
    font-weight: 700;
    min-height: 38px;
    border-color: rgba(0, 0, 0, 0.35) !important;
    color: #374151 !important;
    background: rgba(250, 250, 250, 0.65);
}

    .report-secondary-btn:hover {
        background: rgba(245, 245, 245, 0.95);
    }

.reports-page .mud-button-root {
    text-transform: none;
}

.reports-page .mud-alert {
    border-radius: var(--rr-radius-md, 14px);
}

.reports-page .mud-progress-linear {
    border-radius: var(--rr-radius-pill, 999px);
}

.reports-page .mud-divider {
    border-color: rgba(0, 0, 0, 0.14);
}

/* ---------- Utilities ---------- */

.ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .reports-header,
    .reports-page .htd-header,
    .reports-page ::deep .htd-header {
        flex-direction: column;
        align-items: stretch;
    }

    .reports-page .htd-header-left,
    .reports-page ::deep .htd-header-left {
        width: 100% !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    .reports-action-btn,
    .reports-page .htd-btn-primary {
        width: 100%;
        justify-content: center;
    }

    .reports-filter-stack {
        flex-direction: column;
        align-items: stretch !important;
    }

    .reports-search,
    .reports-state-select {
        width: 100%;
        min-width: 0;
    }

    .report-detail-header {
        flex-direction: column;
    }

    .report-detail-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {
    .reports-page {
        padding-bottom: 32px;
    }

    .reports-kpi-card,
    .reports-filter-card,
    .reports-panel {
        border-radius: 16px;
    }

    .reports-panel {
        padding: 14px;
    }

    .report-comment-form {
        padding: 14px;
    }

    .reports-send-btn {
        width: 100%;
        justify-content: center;
    }

    .report-secondary-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 599.98px) {
    /* Relax fixed max-heights that clip list/detail areas on small phones */
    .reports-list-panel {
        max-height: none;
        overflow: visible;
    }

    .reports-list-simple {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    /* Remove min-width from search input that prevents full-width on 375px */
    .reports-search {
        min-width: 0;
        width: 100%;
    }
}
