/**
 * peh.css - Portal Web PEH
 * @version 1.0.0
 */

.peh-page {
    min-height: 100vh;
    background: #eef5f7;
    color: #14213d;
}

.peh-standalone {
    min-height: 100vh;
    margin: 0;
    background: #eef5f7;
    overflow-x: hidden;
}

.peh-hero {
    position: relative;
    min-height: 240px;
    overflow: hidden;
    background-image: var(--peh-hero-image);
    background-position: center;
    background-size: cover;
}

.peh-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(6, 25, 40, 0.92) 0%, rgba(8, 58, 74, 0.74) 48%, rgba(12, 108, 135, 0.48) 100%);
}

.peh-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 240px;
    padding: 24px clamp(18px, 4vw, 54px);
}

.peh-brand {
    display: flex;
    align-items: center;
    gap: 22px;
    max-width: 920px;
}

.peh-brand img {
    width: clamp(180px, 22vw, 320px);
    height: auto;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

.peh-brand h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 3.45vw, 3.55rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: 0;
}

.peh-title-line {
    display: block;
    white-space: nowrap;
}

.peh-brand p {
    margin: 12px 0 0;
    color: #c8f7ff;
    font-size: 1.05rem;
    font-weight: 500;
}

.peh-user-panel {
    min-width: 180px;
    padding: 14px 16px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    background: rgba(8, 32, 48, 0.46);
}

.peh-user-panel span,
.peh-user-panel strong {
    display: block;
    overflow-wrap: anywhere;
}

.peh-user-panel span {
    color: #b8eef7;
    font-size: 0.84rem;
}

.peh-user-panel strong {
    margin-top: 4px;
    font-size: 1.1rem;
}

.peh-client-logo {
    display: block;
    max-width: 120px;
    max-height: 58px;
    margin-top: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 6px;
    padding: 5px;
}

.peh-content {
    padding: 24px 0 34px;
}

.peh-toolbar {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(170px, 220px) minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #d9e6ea;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(16, 57, 72, 0.08);
}

.peh-filter label {
    display: block;
    margin-bottom: 6px;
    color: #315366;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.peh-filter .form-control {
    min-height: 42px;
    border-color: #c7dce3;
    border-radius: 6px;
}

.peh-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    white-space: nowrap;
}

.peh-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.peh-kpi,
.peh-analysis-kpis > div {
    min-height: 96px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f5fbfc 100%);
    border: 1px solid #d9e6ea;
    border-left: 5px solid #1ca9c9;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(16, 57, 72, 0.08);
}

.peh-kpi span,
.peh-analysis-kpis span {
    display: block;
    color: #526b78;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.peh-kpi strong,
.peh-analysis-kpis strong {
    display: block;
    margin-top: 6px;
    color: #0f6f84;
    font-size: 2.2rem;
    line-height: 1;
}

.peh-panel {
    min-height: 460px;
    background: #ffffff;
    border: 1px solid #d9e6ea;
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(16, 57, 72, 0.09);
    overflow: hidden;
}

.peh-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #ffffff;
    background: linear-gradient(90deg, #0b4f62 0%, #1488b2 52%, #67a90e 100%);
}

.peh-panel h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0;
}

.peh-panel header span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
}

.peh-table {
    margin: 0;
}

.peh-table thead th {
    color: #24495b;
    background: #f4fafb;
    border-bottom: 1px solid #d9e6ea;
    font-size: 0.78rem;
    text-transform: uppercase;
}

.peh-table td {
    vertical-align: middle;
}

.peh-report-code {
    display: block;
    color: #18344a;
    font-weight: 800;
}

.peh-report-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e7f8ed;
    color: #237245;
    font-size: 0.72rem;
    font-weight: 800;
}

.peh-report-status.is-draft {
    background: #fff4d8;
    color: #8a5a00;
}

.peh-empty {
    padding: 36px 14px;
    color: #64808f;
    text-align: center;
}

.peh-modal .modal-content {
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 72px rgba(3, 21, 31, 0.28);
}

.peh-modal .modal-xl {
    max-width: min(1320px, calc(100vw - 32px));
}

.peh-modal .modal-header {
    color: #ffffff;
    background: linear-gradient(90deg, #083344 0%, #1488b2 55%, #67a90e 100%);
}

.peh-modal .modal-title {
    font-weight: 900;
    letter-spacing: 0;
}

.peh-modal .modal-header span {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.85rem;
}

.peh-analysis-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.peh-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.peh-analysis-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid #d9e6ea;
    border-left: 5px solid #67a90e;
    border-radius: 8px;
    background: #f7fbfc;
}

.peh-analysis-toolbar strong,
.peh-analysis-toolbar span {
    display: block;
}

.peh-analysis-toolbar strong {
    color: #173f52;
    font-size: 0.95rem;
    font-weight: 900;
}

.peh-analysis-toolbar span {
    color: #64808f;
    font-size: 0.82rem;
}

.peh-analysis-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.peh-bi-shell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.peh-history-shell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.peh-bi-board {
    border: 1px solid #ccdbe3;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.peh-bi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: #ffffff;
    background: linear-gradient(90deg, #083344 0%, #1488b2 55%, #67a90e 100%);
}

.peh-bi-head strong {
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0;
}

.peh-bi-head span {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.74rem;
    font-weight: 700;
}

.peh-bi-table {
    margin: 0;
    font-size: 0.76rem;
}

.peh-bi-table thead th {
    border-top: 0;
    color: #173f52;
    background: #f4f9fb;
    font-size: 0.68rem;
    font-weight: 900;
    white-space: nowrap;
}

.peh-bi-table td {
    vertical-align: middle;
}

.peh-bi-table td:first-child {
    min-width: 180px;
}

.peh-bi-table td strong,
.peh-bi-table td small {
    display: block;
}

.peh-bi-table td strong {
    color: #173f52;
    font-size: 0.76rem;
    line-height: 1.2;
}

.peh-bi-table td small {
    color: #6f8794;
    font-size: 0.66rem;
    line-height: 1.2;
}

.peh-bi-ejec {
    color: #083344;
    font-weight: 900;
}

.peh-bi-progress {
    position: relative;
    min-width: 110px;
    height: 22px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef3f6;
}

.peh-bi-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.35s ease;
}

.peh-bi-progress strong {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #173f52;
    font-size: 0.68rem;
    font-weight: 900;
}

.peh-bi-progress.is-low span {
    background: #f04438;
}

.peh-bi-progress.is-warn span {
    background: #f0aa28;
}

.peh-bi-progress.is-good span {
    background: #2fb47c;
}

.peh-history-table td:first-child {
    min-width: 112px;
}

.peh-history-total td {
    border-top: 2px solid #173f52;
    background: #f4f9fb;
    font-weight: 900;
}

.peh-chart {
    min-height: 320px;
    border: 1px solid #d9e6ea;
    border-radius: 8px;
    background: #ffffff;
}

.peh-chart-grid {
    margin-bottom: 14px;
}

.peh-chart-wide {
    min-height: 360px;
}

@media (max-width: 1199px) {
    .peh-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .peh-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .peh-hero-inner,
    .peh-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .peh-title-line {
        white-space: normal;
    }

    .peh-toolbar,
    .peh-kpi-grid,
    .peh-analysis-kpis,
    .peh-bi-shell,
    .peh-history-shell,
    .peh-chart-grid {
        grid-template-columns: 1fr;
    }

    .peh-actions {
        flex-wrap: wrap;
    }

    .peh-analysis-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .peh-analysis-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .peh-actions .btn {
        flex: 1 1 120px;
    }
}
