﻿/* ========================================
   Masterdata Pages im hellen Skyblue / White Stil
   Companies / CostTypes / Allocations / LeaseSamples
   ======================================== */

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

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

.rr-entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.rr-entity-header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rr-entity-header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
}

.rr-entity-title {
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--rr-text-strong, #0f172a);
    margin-bottom: 2px;
}

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

/* ---------- Search Card ---------- */

.rr-entity-page .objects-search {
    width: 100%;
    position: relative;
    padding: 16px;
    margin-bottom: 12px !important;
    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;
}

    .rr-entity-page .objects-search .mud-input-control {
        position: relative;
        z-index: 1;
    }

    .rr-entity-page .objects-search .mud-input-root {
        border-radius: var(--rr-radius-md, 14px);
        background: rgba(255, 255, 255, 0.9);
    }

/* ---------- Loading / Alerts ---------- */

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

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

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

.rr-entity-page .rr-entity-stats-grid {
    width: 100%;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

.rr-entity-page .rr-entity-stat-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;
}

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

    .rr-entity-page .rr-entity-stat-card .mud-typography-h5 {
        font-weight: 800;
        color: var(--rr-text-strong, #0f172a);
        line-height: 1.2;
    }

.rr-entity-action-column {
    height: 100%;
}

/* ---------- Create Button ---------- */

.rr-entity-page .rr-entity-create-btn {
    border-radius: 12px;
    text-transform: none;
    font-weight: 700;
    min-height: 40px;
    box-shadow: none;
    width: auto;
    white-space: nowrap;
    padding-left: 18px;
    padding-right: 18px;
}

/* ---------- List ---------- */

.rr-entity-list {
    width: 100%;
    margin-top: 4px;
}

.rr-entity-page .rr-entity-list-item {
    position: relative;
    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.82) );
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

    .rr-entity-page .rr-entity-list-item:hover {
        box-shadow: 0 22px 52px rgba(0, 0, 0, 0.20);
        transform: translateY(-4px) scale(1.005);
        border-color: rgba(0, 0, 0, 0.34);
        background: linear-gradient( 135deg, rgba(255, 255, 255, 1), rgba(245, 245, 245, 0.9) );
    }

    .rr-entity-page .rr-entity-list-item::before {
        content: "";
        position: absolute;
        left: 0;
        top: 14px;
        bottom: 14px;
        width: 5px;
        border-radius: 999px;
        background: linear-gradient(180deg, #111111, #cbd5e1);
    }

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

.rr-entity-list-row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(180px, auto) minmax(280px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding-left: 4px;
}

.rr-entity-main {
    min-width: 0;
}

.rr-entity-item-title {
    font-weight: 800;
    font-size: 1rem;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.25;
    margin-bottom: 2px;
    word-break: break-word;
}

.rr-entity-item-subtitle {
    color: var(--rr-text-secondary, #64748b);
    line-height: 1.4;
    word-break: break-word;
}

.rr-entity-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rr-entity-page .rr-entity-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;
}

.rr-entity-details {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.rr-entity-detail-block {
    min-width: 130px;
}

.rr-entity-detail-value {
    font-weight: 700;
    color: var(--rr-text-strong, #0f172a);
    line-height: 1.3;
    word-break: break-word;
}

.rr-entity-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.rr-entity-page .rr-entity-actions .mud-icon-button {
    border-radius: 10px;
    color: #374151;
    background: rgba(250, 250, 250, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.18);
}

    .rr-entity-page .rr-entity-actions .mud-icon-button:hover {
        background: rgba(245, 245, 245, 0.95);
    }

.rr-entity-page .rr-entity-actions .mud-button-root {
    border-radius: 10px;
    text-transform: none;
}

/* ---------- MudBlazor Polish ---------- */

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

.rr-entity-page .mud-menu .mud-list-item {
    font-weight: 600;
}

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

@media (max-width: 1100px) {
    .rr-entity-list-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "main actions"
            "meta actions"
            "details details";
        align-items: flex-start;
    }

    .rr-entity-main {
        grid-area: main;
    }

    .rr-entity-meta {
        grid-area: meta;
    }

    .rr-entity-details {
        grid-area: details;
        padding-top: 6px;
    }

    .rr-entity-actions {
        grid-area: actions;
    }
}

@media (max-width: 960px) {
    .rr-entity-page {
        padding-bottom: 36px;
    }

    .rr-entity-header {
        flex-direction: column;
        align-items: stretch;
    }

    .rr-entity-header-actions {
        width: 100%;
    }

    .rr-entity-page .objects-search {
        padding: 14px;
    }

    .rr-entity-page .rr-entity-create-btn {
        width: 100%;
        justify-content: center;
    }
}

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

        .rr-entity-page .rr-entity-stat-card {
            padding: 14px !important;
        }

        .rr-entity-page .rr-entity-list-item {
            padding: 14px !important;
        }

    .rr-entity-list-row {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "meta"
            "details"
            "actions";
        gap: 12px;
    }

    .rr-entity-details {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .rr-entity-actions {
        justify-content: flex-start;
    }
}
