/* HighEndProtection Accounting UI — approved visual language, 2026-09-06 */
@media (min-width: 960px) {
    .hep-entity-page .hep-entity-toolbar > .mud-grid { align-items: center; }
    .hep-entity-page .hep-entity-search .mud-input-control { margin-top: 0; }
    .hep-entity-page .hep-entity-search .mud-input-root { min-height: 42px; }
    .hep-entity-page .hep-entity-toolbar > .mud-grid > .mud-grid-item > .mud-button-root {
        min-height: 42px;
        border-radius: 9px;
    }
}
:root {
    --hep-fin-bg: #f7f9fc;
    --hep-fin-surface: #ffffff;
    --hep-fin-border: #dce5f0;
    --hep-fin-text: #12233f;
    --hep-fin-muted: #6f8099;
    --hep-fin-blue: #1169d8;
    --hep-fin-blue-soft: #eef6ff;
    --hep-fin-green: #14a46f;
    --hep-fin-green-soft: #eefbf5;
    --hep-fin-red: #e7334f;
    --hep-fin-red-soft: #fff1f4;
    --hep-fin-orange: #ef7c14;
    --hep-fin-orange-soft: #fff7ed;
    --hep-fin-purple: #7d35c5;
    --hep-fin-purple-soft: #f7f1ff;
    --hep-fin-shadow: 0 2px 12px rgba(23, 48, 82, .055);
    --hep-fin-radius: 10px;
}

/* ------------------------------ Accounting landing page ------------------------------ */
.hep-accounting-home {
    width: 100%;
    min-height: 100%;
    padding: 22px 26px 34px;
    background: linear-gradient(180deg, #fbfcff 0%, #f6f9fd 100%);
    color: var(--hep-fin-text);
}

.hep-accounting-home-hero {
    display: grid;
    grid-template-columns: minmax(300px, 1.05fr) minmax(680px, 2fr);
    align-items: center;
    gap: 28px;
    margin-bottom: 18px;
}

.hep-accounting-home-title-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.hep-accounting-home-title-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: #eaf3ff;
    color: #1976d2;
    flex: 0 0 auto;
}

.hep-accounting-home-title-icon .mud-icon-root { font-size: 31px; }
.hep-accounting-home-title { font-weight: 800 !important; font-size: 2rem !important; line-height: 1.1 !important; color: #142540; }
.hep-accounting-home-subtitle { margin-top: 7px !important; color: #7d8ca2 !important; font-size: .98rem !important; }

.hep-accounting-home-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.hep-accounting-home-kpi {
    min-height: 78px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e0e7f0;
    box-shadow: var(--hep-fin-shadow);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.hep-accounting-home-kpi-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hep-accounting-home-kpi-copy span { color: #74849b; font-size: .82rem; white-space: nowrap; }
.hep-accounting-home-kpi-copy strong { color: #142540; font-size: 1.15rem; font-weight: 800; }
.hep-accounting-home-kpi-icon { width: 43px; height: 43px; border-radius: 9px; display: grid; place-items: center; background: #edf5ff; color: #1976d2; }
.hep-accounting-home-kpi-success .hep-accounting-home-kpi-icon { background: #e9f9f1; color: #0da866; }
.hep-accounting-home-kpi-success .hep-accounting-home-kpi-copy strong { color: #0da866; }
.hep-accounting-home-kpi-danger .hep-accounting-home-kpi-icon { background: #fff0f3; color: #e7334f; }
.hep-accounting-home-kpi-danger .hep-accounting-home-kpi-copy strong { color: #e7334f; }

.hep-accounting-home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.hep-accounting-domain-card {
    min-width: 0;
    min-height: 190px;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--soft) 0%, #ffffff 165%);
    box-shadow: 0 1px 7px rgba(30, 52, 84, .025);
}
.hep-accounting-domain-heading { display: grid; grid-template-columns: 54px minmax(0, 1fr) 42px; align-items: center; gap: 12px; margin-bottom: 14px; }
.hep-accounting-domain-icon { width: 52px; height: 52px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, white); display: grid; place-items: center; color: var(--accent); }
.hep-accounting-domain-icon .mud-icon-root { font-size: 34px; }
.hep-accounting-domain-title { font-weight: 800 !important; color: #152641; font-size: 1.24rem !important; line-height: 1.25 !important; }
.hep-accounting-domain-description { margin-top: 4px !important; color: #728198 !important; }
.hep-accounting-domain-arrow { width: 40px !important; height: 40px !important; color: var(--accent) !important; background: rgba(255,255,255,.92) !important; border: 1px solid color-mix(in srgb, var(--accent) 11%, #fff) !important; }
.hep-accounting-domain-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.hep-accounting-domain-link { min-width: 0 !important; min-height: 40px !important; padding: 7px 10px !important; justify-content: flex-start !important; color: #263a58 !important; background: rgba(255,255,255,.55) !important; border: 1px solid color-mix(in srgb, var(--accent) 10%, #dde4ec) !important; border-radius: 6px !important; font-size: .84rem !important; box-shadow: 0 1px 3px rgba(24, 48, 80, .025); }
.hep-accounting-domain-link .mud-button-icon-start { color: var(--accent); margin-inline-end: 7px !important; }
.hep-accounting-domain-link:hover { background: #fff !important; border-color: color-mix(in srgb, var(--accent) 30%, #d9e1eb) !important; }

/* ------------------------------ Common accounting templates ------------------------------ */
.hep-accounting-template {
    --hep-accounting-gap: 14px;
    --hep-accounting-radius: 9px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    color: var(--hep-fin-text);
}
.hep-accounting-template .mud-paper { border-radius: var(--hep-accounting-radius) !important; border-color: var(--hep-fin-border) !important; box-shadow: var(--hep-fin-shadow); background: #fff; }
.hep-accounting-template .mud-button-root { min-height: 38px; border-radius: 6px !important; font-weight: 700; text-transform: none; box-shadow: none !important; }
.hep-accounting-template .mud-input-control, .hep-accounting-template .mud-select, .hep-accounting-template .mud-input-root { min-width: 0; }
.hep-accounting-template .mud-input-outlined-border { border-color: #dce4ee !important; }
.hep-accounting-template .mud-table-container { max-width: 100%; }
.hep-accounting-template .mud-table-head { background: #f5f8fc; }
.hep-accounting-template .mud-table-cell { border-color: #e4eaf2 !important; color: #253954; }
.hep-accounting-template .mud-table-head .mud-table-cell { font-weight: 750; color: #445773; }
.hep-accounting-template .mud-chip { border-radius: 999px !important; font-weight: 700; }
.hep-accounting-template-eyebrow { margin-bottom: 4px; color: var(--hep-fin-blue); font-size: .74rem; font-weight: 800; }
.hep-accounting-template-title { font-weight: 800 !important; color: #132641; }
.hep-accounting-template-alert { margin-top: var(--hep-accounting-gap); }

/* ------------------------------ Entity screen — approved list/detail language ------------------------------ */
.hep-accounting-entity-template { container-type: inline-size; }
.hep-accounting-entity-template .hep-entity-page { padding: 0 !important; }
.hep-accounting-entity-template .hep-entity-header { padding: 14px 16px !important; border-radius: 8px !important; background: #fff; }
.hep-accounting-entity-template .hep-entity-title { font-weight: 800 !important; color: #152641; }
.hep-accounting-entity-template .hep-entity-description { color: #7d8ba0 !important; }
.hep-accounting-entity-template .hep-entity-actions { margin-top: 0 !important; }
.hep-accounting-entity-template .hep-entity-add-button { background: #0667d8 !important; color: #fff !important; }
.hep-accounting-entity-template .hep-entity-toolbar { margin-top: 10px !important; padding: 10px 12px !important; background: #fff; }
.hep-accounting-entity-template .hep-entity-table-container { margin-top: 10px !important; padding: 0 !important; overflow: hidden; }
.hep-accounting-entity-template .hep-entity-table-scroll { overflow: auto; }
.hep-accounting-entity-template .hep-entity-table .mud-table-row:hover { background: #f4f8ff; }
.hep-accounting-entity-template .hep-row-actions-cell .mud-icon-button { color: #126bc8; }

/* ------------------------------ Document — approved journal/document layout ------------------------------ */
.hep-accounting-document-template { background: #f7f9fc; padding: 0; }
.hep-accounting-document-template .hep-document-header { background: #fff !important; padding: 14px 16px !important; }
.hep-accounting-document-template .hep-document-header-row { gap: 14px; }
.hep-accounting-document-template .hep-document-title { font-weight: 800 !important; color: #132641; }
.hep-accounting-document-template .hep-document-toolbar { position: sticky; top: 0; z-index: 6; padding: 10px 12px !important; background: rgba(255,255,255,.97) !important; backdrop-filter: blur(10px); border: 1px solid #dce5f0; }
.hep-accounting-document-template .hep-document-actions, .hep-accounting-document-template .hep-document-export { gap: 8px; }
.hep-accounting-document-template .hep-document-main, .hep-accounting-document-template .hep-document-section, .hep-accounting-document-template .hep-document-summary { border-radius: 8px !important; }
.hep-accounting-document-template .hep-document-section-header { background: #f5f8fc; border-bottom: 1px solid #e0e7f0; }
.hep-accounting-document-template .mud-button-filled-primary { background: #096bd8 !important; }
.hep-accounting-document-template .mud-button-filled-success { background: #10a46b !important; }
.hep-accounting-document-template .mud-button-filled-error { background: #e52445 !important; }

/* ------------------------------ Workspace — approved operational layout ------------------------------ */
.hep-accounting-workspace-template { display: grid; gap: 12px; background: #f7f9fc; }
.hep-accounting-workspace-template .hep-record-workspace-header { padding: 15px 17px !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
.hep-accounting-workspace-template .hep-record-workspace-heading-icon { width: 48px; height: 48px; border-radius: 10px; background: #eaf3ff; display: grid; place-items: center; }
.hep-accounting-workspace-template .hep-record-workspace-title { font-weight: 850 !important; color: #122640; font-size: 1.55rem !important; }
.hep-accounting-workspace-template .hep-record-workspace-description { color: #76869d !important; }
.hep-accounting-workspace-template .hep-record-workspace-toolbar { padding: 10px 12px !important; background: #fff; }
.hep-accounting-workspace-template .hep-record-workspace-primary-actions .mud-button-filled-primary { background: #086bd9 !important; color: #fff !important; }
.hep-accounting-workspace-template .hep-record-workspace-main-section, .hep-accounting-workspace-template .hep-record-workspace-sections, .hep-accounting-workspace-template .hep-record-workspace-bottom { overflow: hidden; background: #fff; }
.hep-accounting-workspace-template .hep-record-workspace-section-header { padding: 13px 15px !important; background: #f7f9fc; border-bottom: 1px solid #dfe7f0; }
.hep-accounting-workspace-template .hep-record-workspace-section-title { font-weight: 800 !important; color: #183251; }
.hep-accounting-workspace-template .hep-record-workspace-main-body { padding: 0 !important; }
.hep-accounting-workspace-template .hep-record-workspace-section-navigation { background: #f8fafd; border-bottom: 1px solid #e3e9f1; }
.hep-accounting-workspace-template .hep-record-workspace-section-nav-item { border-radius: 6px !important; }

/* Workspace primitives that dynamic/custom workspaces can use to match the approved closing screen */
.hep-workspace-period-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.hep-workspace-period-card, .hep-workspace-kpi-card { background: #fff; border: 1px solid var(--hep-fin-border); border-radius: 8px; padding: 13px 15px; box-shadow: var(--hep-fin-shadow); }
.hep-workspace-stepper { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 0; align-items: start; margin: 4px 0 2px; }
.hep-workspace-step { position: relative; text-align: center; color: #73839a; font-size: .8rem; padding-top: 34px; }
.hep-workspace-step::before { content: attr(data-step); position:absolute; top:0; left:50%; transform:translateX(-50%); width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:#e7edf5; color:#53667e; font-weight:800; z-index:2; }
.hep-workspace-step::after { content:""; position:absolute; height:3px; background:#e1e7ef; top:13px; inset-inline-start:50%; width:100%; z-index:1; }
.hep-workspace-step:last-child::after { display:none; }
.hep-workspace-step.active { color:#1268d0; font-weight:800; }
.hep-workspace-step.active::before { background:#0d6bdd; color:white; }
.hep-workspace-kpi-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; }
.hep-workspace-kpi-card strong { display:block; margin-top:5px; font-size:1.5rem; color:#132641; }
.hep-workspace-kpi-card.success strong { color:#0aa566; }.hep-workspace-kpi-card.danger strong { color:#df2645; }
.hep-workspace-two-column { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(280px,.8fr); gap:14px; }

/* ------------------------------ Matching — approved bank reconciliation layout ------------------------------ */
.hep-accounting-matching-template { display:grid; gap:12px; background:#f7f9fc; }
.hep-accounting-matching-header { padding:15px 17px; background:#fff; }
.hep-accounting-matching-title-row, .hep-accounting-matching-commandbar-row, .hep-accounting-matching-pane-header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.hep-accounting-matching-title-block { min-width:0; }
.hep-accounting-matching-filters { margin-top:14px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.hep-accounting-matching-commandbar { padding:10px 12px; background:#fff; }
.hep-accounting-matching-primary-actions, .hep-accounting-matching-secondary-actions, .hep-accounting-matching-pane-actions { display:flex; flex-wrap:wrap; gap:8px; }
.hep-accounting-matching-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.hep-accounting-matching-board { display:grid; grid-template-columns:1fr; gap:10px; align-items:stretch; }
.hep-accounting-matching-board-stacked { width:100%; }
.hep-accounting-matching-pane-full { width:100%; }
.hep-accounting-matching-pane { min-width:0; overflow:hidden; background:#fff; }
.hep-accounting-matching-pane-header { padding:12px 14px; background:#f5f8fc; border-bottom:1px solid #dde5ef; }
.hep-accounting-matching-pane-title { font-weight:800 !important; color:#173250; }
.hep-accounting-matching-pane-body { min-width:0; overflow:auto; }
.hep-accounting-matching-center-rail { display:flex; align-items:center; justify-content:center; color:#0e6cd8; min-height:38px; }
.hep-accounting-matching-center-rail-stacked { gap:10px; }
.hep-accounting-matching-center-rail .mud-icon-root { padding:8px; width:38px; height:38px; border-radius:50%; background:#eef5ff; }
.hep-accounting-matching-flow-line { height:1px; flex:1; max-width:220px; background:#d8e5f5; }
.hep-accounting-matching-details { padding:14px; background:#fff; }

/* Generated screen runtime */
.hep-accounting-generated-state { min-height:160px; display:grid; place-items:center; padding:24px; color:#667993; background:#fff; border:1px solid #dfe7f1; border-radius:9px; }
.hep-accounting-generated-error { color:#c6283f; background:#fff7f8; border-color:#f1cdd4; }

@media (max-width: 1280px) {
    .hep-accounting-home-hero { grid-template-columns:1fr; }
    .hep-accounting-home-grid { grid-template-columns:1fr; }
}
@media (max-width: 900px) {
    .hep-accounting-home { padding:14px; }
    .hep-accounting-home-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .hep-accounting-domain-links { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .hep-accounting-matching-filters, .hep-accounting-matching-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .hep-accounting-matching-board { grid-template-columns:1fr; }
    .hep-accounting-matching-center-rail { min-height:32px; transform:none; }
    .hep-workspace-period-grid, .hep-workspace-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .hep-workspace-two-column { grid-template-columns:1fr; }
}
@media (max-width: 600px) {
    .hep-accounting-home-kpis, .hep-accounting-domain-links, .hep-accounting-matching-filters, .hep-accounting-matching-summary, .hep-workspace-period-grid, .hep-workspace-kpi-grid { grid-template-columns:1fr; }
    .hep-accounting-domain-card { padding:14px; }
    .hep-accounting-domain-heading { grid-template-columns:46px minmax(0,1fr) 38px; }
    .hep-accounting-domain-icon { width:46px; height:46px; }
    .hep-accounting-template { --hep-accounting-gap:10px; }
    .hep-accounting-template .mud-button-root { min-height:42px; }
    .hep-accounting-document-template .hep-document-toolbar { position:static; }
    .hep-accounting-document-template .hep-document-toolbar-row, .hep-accounting-document-template .hep-document-header-row, .hep-accounting-workspace-template .hep-record-workspace-header-row, .hep-accounting-matching-title-row, .hep-accounting-matching-commandbar-row, .hep-accounting-matching-pane-header { align-items:stretch; flex-direction:column; }
    .hep-accounting-document-template .hep-document-actions, .hep-accounting-document-template .hep-document-export, .hep-accounting-matching-primary-actions, .hep-accounting-matching-secondary-actions, .hep-accounting-matching-pane-actions { display:grid; grid-template-columns:1fr; width:100%; }
}

/* Approved template identity: preserve the exact accounting visual language even when generic content is injected. */
.hep-accounting-approved-template { font-family: inherit; }
/* Extra record details are a desktop layout; the existing phone table is unchanged. */
@media (min-width: 960px) {
    .hep-entity-page .hep-layout-detail-row > td {
        background: var(--mud-palette-background-grey);
        padding: 16px 24px;
    }
    .hep-entity-page .hep-layout-detail-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px 24px;
        margin: 0;
        text-align: start;
    }
    .hep-entity-page .hep-layout-detail-grid dt {
        color: var(--mud-palette-text-secondary);
        font-size: 12px;
        margin-bottom: 4px;
    }
    .hep-entity-page .hep-layout-detail-grid dd {
        margin: 0;
        overflow-wrap: anywhere;
    }
}
@media (max-width: 959.98px) {
    .hep-entity-page .hep-layout-desktop-only { display: none !important; }
}
