/* ========================================
   Property Details Page
   Finance-like tab styling
   aligned with Leases / Portfolio
   ======================================== */

/* ========================================
   Property Details - simpler overview cards
   ======================================== */

.pd-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.pd-info-item {
    min-height: auto;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

    .pd-info-item:hover {
        transform: none;
        box-shadow: none;
    }

.pd-info-item-wide {
    grid-column: 1 / -1;
}

.pd-value {
    font-weight: 700;
}


@media (max-width: 760px) {
    .pd-info-grid {
        grid-template-columns: 1fr;
    }
}

.pd-page {
    position: relative;
    width: 100%;
    max-width: none;
    padding-bottom: 48px;
}

.fade-in-modern {
    animation: pdFadeUp 260ms ease-out;
}

@keyframes pdFadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.pd-detail-header {
    position: relative;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 24px 18px 34px;
    border-radius: var(--rr-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: radial-gradient(circle at top left, rgba(0, 0, 0, 0.10), transparent 32%), radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.08), transparent 30%), var(--rr-surface, #ffffff);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

    .pd-detail-header .htd-header-left {
        padding-left: 16px;
    }

.pd-detail-title {
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--rr-text-strong);
    margin-bottom: 2px;
}

.pd-detail-subtitle {
    color: var(--rr-text-secondary);
    line-height: 1.4;
}

.pd-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.pd-back-btn,
.pd-status-chip {
    border-radius: 12px;
}

.pd-back-btn {
    text-transform: none;
    font-weight: 600;
    min-height: 40px;
    box-shadow: none;
}

/* ---------- Typography ---------- */

.pd-muted {
    color: var(--rr-text-secondary);
    line-height: 1.4;
}

.pd-card-title,
.pd-section-title {
    font-weight: 800;
    color: var(--rr-text-strong);
    line-height: 1.25;
    letter-spacing: 0.25px;
}

.pd-value {
    font-weight: 800;
    color: var(--rr-text-strong);
    line-height: 1.35;
}

/* ---------- Finance-like Tabs ---------- */

.pd-tabs {
    width: 100%;
    max-width: none;
    border-radius: var(--rr-radius-lg);
}

.pd-page ::deep .pd-tabs,
.pd-page ::deep .mud-tabs,
.pd-page ::deep .mud-tabs-panels,
.pd-page ::deep .mud-tab-panel,
.pd-page ::deep .mud-tab-panel-content {
    width: 100%;
    max-width: none;
}

    .pd-page ::deep .pd-tabs > .mud-tabs-toolbar-wrapper {
        border-radius: var(--rr-radius-lg);
        border: 1px solid rgba(0, 0, 0, 0.08);
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.035), rgba(255, 255, 255, 0.92));
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
        padding: 6px;
        overflow: hidden;
    }

    .pd-page ::deep .pd-tabs .mud-tabs-toolbar {
        background: transparent;
        min-height: 52px;
    }

    .pd-page ::deep .pd-tabs .mud-tabs-toolbar-inner {
        gap: 4px;
    }

    .pd-page ::deep .pd-tabs .mud-tab {
        min-height: 42px;
        border-radius: 12px;
        text-transform: none;
        font-weight: 700;
        letter-spacing: 0.2px;
        color: var(--rr-text-secondary);
        transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    }

        .pd-page ::deep .pd-tabs .mud-tab:hover {
            color: var(--rr-text-strong);
            background: rgba(0, 0, 0, 0.06);
        }

        .pd-page ::deep .pd-tabs .mud-tab.mud-tab-active {
            font-weight: 800;
            color: var(--rr-text-strong);
            background: rgba(255, 255, 255, 0.78);
            box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
        }

        .pd-page ::deep .pd-tabs .mud-tab .mud-icon-root {
            color: inherit;
        }

    .pd-page ::deep .pd-tabs .mud-tabs-slider {
        height: 0;
        display: none;
    }

.pd-page ::deep .pd-tabs-panel {
    padding-top: 16px;
}

/* ---------- Tab Shells ---------- */

.pd-tab-shell {
    width: 100%;
    animation: pdFadeUp 220ms ease-out;
}

.pd-tab-host {
    width: 100%;
    border-radius: var(--rr-radius-lg);
    overflow: visible;
}

.pd-task-host,
.pd-lease-host,
.pd-finance-host,
.pd-documents-host,
.pd-reports-host {
    width: 100%;
}

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

.pd-state-card,
.pd-card,
.pd-image-card {
    border-radius: var(--rr-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: var(--rr-surface);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.pd-state-card {
    padding: 18px;
}

.pd-card {
    padding: 18px;
}

.pd-overview-card {
    min-height: 100%;
}

.pd-tab-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ---------- Overview Info Grid ---------- */

.pd-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pd-info-item {
    min-height: 86px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.045), rgba(0, 0, 0, 0.025), rgba(255, 255, 255, 0.82));
}

.pd-info-item-wide {
    grid-column: 1 / -1;
}

/* ---------- Image Card ---------- */

.pd-image-card {
    padding: 14px;
    height: 100%;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

    .pd-image-card:hover {
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
        transform: translateY(-3px);
    }

.pd-image-frame {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--rr-radius-lg) - 4px);
}

.pd-property-thumb,
.pd-property-thumb-placeholder {
    width: 100%;
    height: 250px;
    border-radius: calc(var(--rr-radius-lg) - 4px);
}

.pd-property-thumb {
    display: block;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f7f7f7;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.35s ease;
}

.pd-image-card:hover .pd-property-thumb {
    transform: scale(1.04);
}

.pd-property-thumb-placeholder {
    border: 1px dashed rgba(0, 0, 0, 0.16);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.78));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--rr-text-secondary);
    text-align: center;
    padding: 20px;
}

.pd-empty-title {
    font-weight: 800;
    color: var(--rr-text-strong);
}

.pd-image-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--rr-radius-pill);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: var(--rr-text-strong);
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pd-selected-file-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--rr-radius-md);
    background: rgba(0, 0, 0, 0.045);
    min-height: 62px;
}

    .pd-selected-file-box.is-selected {
        background: rgba(0, 0, 0, 0.08);
        border-color: rgba(0, 0, 0, 0.24);
    }

    .pd-selected-file-box .mud-icon-root {
        margin-top: 2px;
        color: var(--rr-primary);
        flex-shrink: 0;
    }

.pd-selected-file-text {
    min-width: 0;
    flex: 1;
}

.pd-selected-file-title {
    font-weight: 700;
    color: var(--rr-text-strong);
}

.pd-image-actions,
.pd-overview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pd-overview-actions {
    justify-content: flex-end;
    width: 100%;
}

    .pd-image-actions .mud-button-root,
    .pd-overview-actions .mud-button-root {
        border-radius: 12px;
        text-transform: none;
        font-weight: 600;
        min-height: 38px;
        box-shadow: none;
    }

.pd-image-actions .mud-button-root {
    flex: 1 1 160px;
}

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

.pd-page ::deep .mud-input-root {
    border-radius: var(--rr-radius-md);
}

.pd-page ::deep .mud-button-root,
.pd-page ::deep .mud-icon-button {
    border-radius: 12px;
    text-transform: none;
    font-weight: 600;
    box-shadow: none;
}

.pd-page ::deep .mud-chip {
    width: fit-content;
    border-radius: var(--rr-radius-pill);
    font-weight: 700;
}

.pd-page ::deep .mud-chip-content {
    font-weight: 700;
}

.pd-chipwrap {
    gap: 6px;
}

/* ========================================
   Child Tabs Styling
   These target the embedded tab components
   ======================================== */

/* ---------- Common child card look ---------- */

.pd-page ::deep .pd-card,
.pd-page ::deep .finances-card,
.pd-page ::deep .finance-data-card,
.pd-page ::deep .finance-info-card,
.pd-page ::deep .finance-result-card,
.pd-page ::deep .finance-status-card,
.pd-page ::deep .documents-card,
.pd-page ::deep .reports-tab,
.pd-page ::deep .reports-panel,
.pd-page ::deep .htd-column {
    border-radius: var(--rr-radius-lg) !important;
    border: 1px solid rgba(0, 0, 0, 0.10) !important;
    background: var(--rr-surface) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.10) !important;
    overflow: hidden;
}

.pd-page ::deep .finances-card-content,
.pd-page ::deep .reports-tab,
.pd-page ::deep .reports-panel {
    padding: 18px !important;
}

/* ---------- Child section titles ---------- */

.pd-page ::deep .finances-section-title,
.pd-page ::deep .finance-card-title,
.pd-page ::deep .documents-title,
.pd-page ::deep .reports-title,
.pd-page ::deep .htd-card-title,
.pd-page ::deep .htd-lane-title {
    font-weight: 800 !important;
    color: var(--rr-text-strong) !important;
    line-height: 1.25;
}

.pd-page ::deep .finances-muted,
.pd-page ::deep .finance-muted,
.pd-page ::deep .documents-muted,
.pd-page ::deep .reports-muted,
.pd-page ::deep .htd-muted {
    color: var(--rr-text-secondary) !important;
    line-height: 1.4;
}

/* ---------- Filter / Action bars like Finance ---------- */

.pd-page ::deep .htd-filters,
.pd-page ::deep .reports-filter-bar,
.pd-page ::deep .documents-filter-bar,
.pd-page ::deep .finance-filter-card {
    position: relative;
    margin-top: 12px;
    padding: 16px;
    border-radius: var(--rr-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.78));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ---------- Aufgaben / Kanban ---------- */

.pd-page ::deep .htd-root {
    width: 100%;
}

.pd-page ::deep .htd-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-radius: var(--rr-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.86));
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.pd-page ::deep .htd-header-left,
.pd-page ::deep .htd-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pd-page ::deep .htd-header-right {
    margin-left: auto;
}

.pd-page ::deep .htd-btn-primary {
    border-radius: 12px;
    text-transform: none;
    font-weight: 600;
    min-height: 40px;
    box-shadow: none;
}

.pd-page ::deep .htd-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 28px;
    border-radius: var(--rr-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--rr-surface);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.pd-page ::deep .htd-task-tabs .mud-tabs-toolbar-wrapper {
    border-radius: var(--rr-radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--rr-surface);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.pd-page ::deep .htd-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    width: 100%;
    align-items: start;
}

.pd-page ::deep .htd-column {
    min-height: 360px;
    padding: 12px;
}

.pd-page ::deep .htd-lanehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.06);
}

.pd-page ::deep .htd-lane-sub {
    min-width: 28px;
    height: 28px;
    border-radius: var(--rr-radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--rr-primary);
    background: rgba(0, 0, 0, 0.12);
}

.pd-page ::deep .htd-dropzone {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pd-page ::deep .htd-card {
    padding: 12px;
    cursor: pointer;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: var(--rr-surface);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

    .pd-page ::deep .htd-card:hover {
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
        transform: translateY(-3px);
    }

.pd-page ::deep .htd-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.pd-page ::deep .htd-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pd-page ::deep .htd-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.pd-page ::deep .htd-card-desc {
    margin-top: 8px;
    color: var(--rr-text-strong);
    line-height: 1.4;
}

/* ---------- Mietvertrag / Tables ---------- */

.pd-page ::deep .pd-table,
.pd-page ::deep .pd-rent-history,
.pd-page ::deep .pd-graduated-table,
.pd-page ::deep .mud-table {
    border-radius: var(--rr-radius-md);
    overflow: hidden;
}

.pd-page ::deep .mud-table-head {
    background: rgba(0, 0, 0, 0.05);
}

    .pd-page ::deep .mud-table-head .mud-table-cell {
        font-weight: 800;
        color: var(--rr-text-strong);
        white-space: nowrap;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    }

.pd-page ::deep .mud-table-body .mud-table-row {
    transition: background 0.2s ease;
}

    .pd-page ::deep .mud-table-body .mud-table-row:hover {
        background: rgba(0, 0, 0, 0.045);
    }

.pd-page ::deep .mud-table-cell {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

/* ---------- Finance Tab ---------- */

.pd-page ::deep .finance-result-card {
    position: relative;
    padding: 22px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.86)) !important;
}

.pd-page ::deep .finance-overview-actions,
.pd-page ::deep .finances-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.finance-amount-positive {
    color: var(--mud-palette-success);
}

.finance-amount-negative {
    color: var(--mud-palette-error);
}

.finance-amount-neutral {
    color: var(--mud-palette-text-primary);
}

/* ---------- Documents ---------- */

.pd-page ::deep .documents-card {
    height: 100%;
    padding: 16px;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

    .pd-page ::deep .documents-card:hover {
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16) !important;
        transform: translateY(-3px);
    }

.pd-page ::deep .documents-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pd-page ::deep .documents-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rr-primary);
    background: rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.pd-page ::deep .documents-meta-box {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.045);
    box-shadow: none;
}

/* ---------- Reports ---------- */

.pd-page ::deep .reports-tab {
    padding: 18px !important;
}

.pd-page ::deep .reports-panel {
    min-height: 100%;
}

.pd-page ::deep .reports-kpi-card {
    height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: var(--rr-surface);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.10);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

    .pd-page ::deep .reports-kpi-card:hover {
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
        transform: translateY(-3px);
    }

    .pd-page ::deep .reports-kpi-card .mud-typography-h5 {
        font-weight: 800;
        color: var(--rr-text-strong);
    }

.pd-page ::deep .report-row-simple {
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: var(--rr-surface);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

    .pd-page ::deep .report-row-simple:hover {
        box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
        transform: translateY(-3px);
    }

    .pd-page ::deep .report-row-simple.selected {
        border-color: rgba(0, 0, 0, 0.34);
        background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.82));
    }

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

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

    .pd-header-actions,
    .pd-page ::deep .htd-header-right {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .pd-back-btn,
    .pd-page ::deep .htd-btn-primary {
        flex: 1;
        justify-content: center;
    }

    .pd-info-grid {
        grid-template-columns: 1fr;
    }

    .pd-property-thumb,
    .pd-property-thumb-placeholder {
        height: 220px;
    }

    .pd-image-actions {
        flex-direction: column;
    }

        .pd-image-actions .mud-button-root {
            width: 100%;
            flex: 1 1 auto;
        }

    .pd-overview-actions {
        justify-content: stretch;
    }

        .pd-overview-actions .mud-button-root {
            flex: 1 1 100%;
        }

    .pd-page ::deep .mud-table {
        min-width: 760px;
    }

    .pd-page ::deep .mud-table-container {
        overflow-x: auto;
    }
}

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

        .pd-card,
        .pd-state-card,
        .pd-image-card,
        .pd-detail-header,
        .pd-info-item,
        .pd-page ::deep .finances-card-content,
        .pd-page ::deep .reports-tab,
        .pd-page ::deep .reports-panel,
        .pd-page ::deep .documents-card,
        .pd-page ::deep .htd-column,
        .pd-page ::deep .htd-filters,
        .pd-page ::deep .reports-filter-bar,
        .pd-page ::deep .documents-filter-bar,
        .pd-page ::deep .finance-filter-card {
            padding: 14px !important;
        }

    .pd-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .pd-back-btn {
        width: 100%;
    }

    .pd-property-thumb,
    .pd-property-thumb-placeholder {
        height: 200px;
    }

    .pd-selected-file-box {
        padding: 10px 12px;
    }

    .pd-page ::deep .htd-board {
        grid-template-columns: 1fr;
    }

    .pd-page ::deep .pd-tabs .mud-tab {
        min-height: 40px;
        font-size: 0.82rem;
    }
}
