/* The header is shared by authenticated routes. Dashboard surfaces stay inside Home. */
.app-shell .app-topbar {
    padding: 0;
    background: white;
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 2px 8px rgb(20 51 75 / 4%);
}
.app-shell .app-topbar-inner, .app-shell .app-nav-shell, .app-shell-home .app-content {
    width: min(100%, 1520px);
    padding-inline: clamp(16px, 3.2vw, 48px);
    margin-inline: auto;
}
.app-shell .app-topbar-inner {
    min-height: 65px;
    align-items: center;
    gap: 10px 24px;
    padding-block: 9px;
    border: 0;
    border-radius: 0;
    background: white;
    box-shadow: none;
}
.app-shell .app-brand-block { gap: 8px; align-items: center; }
.portal-brand-mark { display: block; position: relative; overflow: hidden; width: 33px; height: 45px; flex: none; }
.portal-brand-mark img { position: absolute; width: 96px; max-width: none; inset: -15px auto auto -32px; }
.portal-brand-name { color: #103c79; text-transform: uppercase; font-size: 1.14rem; font-weight: 750; letter-spacing: .015em; }
.app-shell .app-topbar-actions { width: auto; margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.app-topbar .app-topbar-actions > a.k-button:not(.document-processing-highlight), .portal-inbox-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 4px;
    font-size: .94rem;
    font-weight: 600;
    color: var(--app-ink) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    text-decoration: none;
}
.app-topbar .app-topbar-actions > a:hover { text-decoration: underline; }
.app-topbar .app-topbar-actions > a .oi { color: #44617b; margin-right: 2px; }
.portal-account { position: relative; }
.portal-account summary { list-style: none; display: flex; gap: 7px; align-items: center; cursor: pointer; min-height: 40px; font-weight: 650; }
.portal-account summary::-webkit-details-marker { display: none; }
.portal-avatar { display: grid; place-items: center; border-radius: 50%; width: 34px; height: 34px; background: #e4eff6; color: #385a74; }
.portal-account .app-access-shell {
    position: absolute;
    z-index: 2;
    top: calc(100% + 5px);
    right: 0;
    display: grid;
    justify-content: stretch;
    gap: 12px;
    width: min(285px, calc(100vw - 32px));
    padding: 16px;
    background: white;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: var(--app-shadow);
}
.portal-account .app-access-copy { text-align: left; overflow-wrap: anywhere; }
.portal-account .app-access-switcher .k-combobox { width: 100% !important; }
.app-shell .app-nav-shell { margin-top: 0; }
.app-shell .app-menu-wrap { padding: 0; border: 0; border-top: 1px solid #e8eef2; border-radius: 0; box-shadow: none; background: #fff; }
.app-shell .app-menu { display: flex; flex-wrap: wrap; gap: 0 clamp(6px, 1.5vw, 24px); }
.app-shell .app-menu > .k-item { margin: 0; }
.app-shell .app-menu > .k-item > .k-link { min-height: 42px; padding: 8px 12px; border-radius: 0; background: transparent; }
.portal-menu-label { color: #24364d; font-weight: 600; font-size: .96rem; }
.portal-menu-active { color: #005ca8; }
.app-menu > .k-item:has(> .k-link .portal-menu-active) { box-shadow: inset 0 -3px #087ab9; }
.app-shell .app-menu > .k-item:hover > .k-link { background: #eff7fc; }
@media (min-width: 901px) {
    .app-shell .app-menu { justify-content: space-between; }
}
.app-topbar :is(summary, a, [role=menuitem]):focus-visible { outline: 3px solid #087ab9; outline-offset: -2px; }

.app-shell-home { min-height: 100vh; background: var(--app-bg); }
.app-shell-home .app-content { padding-block: 22px 32px; }
.home-dashboard { display: grid; gap: 18px; color: var(--app-ink); }
.dashboard-heading h1 { margin: 0; font-size: clamp(26px, 2.2vw, 30px); font-weight: 750; letter-spacing: -.025em; line-height: 1.18; }
.home-dashboard .dashboard-heading p { margin: 4px 0 0; font-size: 16px; color: var(--app-muted); }
.dashboard-metrics, .dashboard-grid, .dashboard-context { display: grid; gap: 16px; }
.dashboard-primary-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-supporting-metrics, .dashboard-context { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-metric-card, .dashboard-panel, .dashboard-context {
    min-width: 0;
    border: 1px solid var(--app-border);
    border-radius: 15px;
    background: white;
    box-shadow: 0 3px 10px rgb(15 40 60 / 4%);
}
.dashboard-metric-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; }
.dashboard-metric-icon, .dashboard-panel-title .oi { color: #436079; font-size: 1.16rem; }
.dashboard-metric-label, .dashboard-panel-title { margin: 0; font-size: 1.02rem; line-height: 1.4; font-weight: 700; }
.dashboard-metric-value { margin: 5px 0 3px; font-size: clamp(23px, 2vw, 29px); font-weight: 750; line-height: 1.15; overflow-wrap: anywhere; }
.dashboard-metric-note, .home-dashboard .dashboard-panel-copy, .dashboard-list-meta { color: var(--app-muted); font-size: .9rem; line-height: 1.4; }
.dashboard-panel { padding: 20px; }
.dashboard-panel-heading { margin-bottom: 14px; }
.dashboard-panel-title { display: flex; align-items: center; gap: 12px; }
.dashboard-panel-copy { margin: 5px 0 0; }
.home-dashboard .dashboard-chart.k-chart { width: 100%; height: 270px; border: 0; box-shadow: none; border-radius: 0; }
.home-dashboard .dashboard-chart-compact.k-chart { height: 180px; }
.dashboard-context { margin: 0; padding: 14px 20px; }
.dashboard-context dt, .dashboard-snapshot-label { color: var(--app-muted); font-size: .85rem; font-weight: 500; }
.dashboard-context dd { margin: 2px 0 0; font-weight: 650; }
.dashboard-snapshot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin-top: 12px; }
.dashboard-snapshot-row, .dashboard-list-row { padding-top: 8px; border-top: 1px solid #e5edf2; }
.dashboard-snapshot-value, .dashboard-list-title, .dashboard-list-value { font-weight: 650; }
.dashboard-list { display: grid; gap: 10px; }
.dashboard-list-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.dashboard-list-row:first-child { border: 0; }
.dashboard-list-main, .dashboard-list-side { min-width: 0; overflow-wrap: anywhere; }
.dashboard-list-side { text-align: right; }
.home-dashboard .dashboard-badge { display: inline-block; padding: 3px 9px; border-radius: 30px; background: #ddf4ed; color: #125c51; font-size: .8rem; font-weight: 650; }
.home-dashboard .dashboard-badge.info { background: #e6effc; color: #174f91; }
.home-dashboard .dashboard-badge.warning { background: #fff2da; color: #854d09; }
.home-dashboard .dashboard-badge.danger { background: #fbe3e1; color: #982e29; }
.dashboard-empty { padding: 18px 0; color: var(--app-muted); }

@media (max-width: 900px) {
    .app-shell .app-topbar-actions { gap: 6px 12px; }
    .portal-account-name { display: none; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .dashboard-context, .dashboard-supporting-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .app-shell .app-topbar { position: relative; }
    .app-shell .app-topbar-inner { display: grid; gap: 4px; padding-block: 8px; }
    .app-shell .app-topbar-actions { margin: 0; gap: 4px 10px; }
    .app-topbar .app-topbar-actions > a.k-button:not(.document-processing-highlight), .portal-inbox-link { font-size: .88rem; padding: 0; }
    .portal-account { position: absolute; top: 10px; right: 16px; }
    .app-shell .app-menu { gap: 0; }
    .app-shell .app-menu > .k-item > .k-link { min-height: 36px; padding: 6px 9px; }
    .dashboard-primary-metrics, .dashboard-supporting-metrics { grid-template-columns: minmax(0, 1fr); }
    .home-dashboard { gap: 14px; }
    .dashboard-metrics, .dashboard-grid { gap: 10px; }
    .dashboard-metric-card, .dashboard-panel { padding: 16px; }
}
