/* REDAXO Buchhaltung – eigenständiges Verwaltungsportal 1.4.7 */
:root {
    color-scheme: light;
}

.bh-portal-body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: #f2f6f8;
    color: #14212b;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.bh-portal-body[style*="overflow: hidden"] {
    touch-action: none;
}

.bh-skip-link {
    position: fixed;
    z-index: 300;
    top: 10px;
    left: 10px;
    transform: translateY(-180%);
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    color: #123e4a;
    box-shadow: 0 12px 30px rgba(10, 36, 49, .24);
    font-weight: 800;
}

.bh-skip-link:focus {
    transform: none;
}

/* -------------------------------------------------------------------------
   Portal shell
   ------------------------------------------------------------------------- */

.bh-portal-app {
    --bh-portal-sidebar: 278px;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    background:
        radial-gradient(circle at 95% 0, rgba(57, 168, 187, .08), transparent 28rem),
        #f2f6f8;
}

.bh-portal-sidebar {
    position: fixed;
    z-index: 90;
    inset: 0 auto 0 0;
    width: var(--bh-portal-sidebar);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 18px 13px 15px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    background:
        radial-gradient(circle at 0 0, rgba(44, 175, 196, .17), transparent 19rem),
        linear-gradient(180deg, #0b3040 0%, #0d3543 55%, #092631 100%);
    color: #eaf4f6;
    box-shadow: 16px 0 44px rgba(8, 31, 42, .12);
}

.bh-portal-sidebar::-webkit-scrollbar {
    width: 8px;
}

.bh-portal-sidebar::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    background-clip: padding-box;
}

.bh-portal-stage {
    width: calc(100% - var(--bh-portal-sidebar));
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    margin-left: var(--bh-portal-sidebar);
    display: flex;
    flex-direction: column;
}

.bh-portal-sidebar .bh-brand {
    min-height: 48px;
    padding: 1px 8px 17px;
}

.bh-portal-sidebar .bh-brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    background: linear-gradient(135deg, #35b3c5, #11758e);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

.bh-portal-sidebar .bh-brand strong {
    letter-spacing: -.015em;
}

.bh-portal-sidebar .bh-brand span {
    font-size: 11px;
}

.bh-portal-sidebar .bh-company-card {
    margin: 0 3px 15px;
    padding: 14px 15px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 14px;
    background: rgba(255, 255, 255, .075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.bh-portal-sidebar .bh-company-card > span {
    color: #9db8c1;
    text-transform: uppercase;
    letter-spacing: .055em;
    font-size: 9px;
    font-weight: 800;
}

.bh-portal-sidebar .bh-company-card strong {
    margin: 5px 0 6px;
    color: #fff;
    font-size: 14px;
}

.bh-portal-sidebar .bh-company-card small {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #b6cad1;
    font-size: 11px;
}

.bh-portal-sidebar .bh-company-card .bh-form-actions {
    margin-top: 11px;
    padding-top: 0;
}

.bh-portal-sidebar a.bh-company-card__edit {
    width: 100%;
    min-height: 32px;
    padding: 5px 8px;
    border-color: rgba(255, 255, 255, .25);
    justify-content: flex-start;
    background: rgba(255, 255, 255, .1);
    color: #f7fcfd;
    white-space: normal;
    font-size: 11px;
    line-height: 1.25;
}

.bh-portal-sidebar a.bh-company-card__edit .bh-icon {
    width: 14px;
    height: 14px;
}

.bh-portal-sidebar a.bh-company-card__edit:hover,
.bh-portal-sidebar a.bh-company-card__edit:focus-visible {
    border-color: #fff;
    background: #f4fbfc;
    color: #0b4050;
    text-decoration: none;
}

.bh-company-status {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #92a6ad;
    box-shadow: 0 0 0 3px rgba(146, 166, 173, .12);
}

.bh-company-status.is-open {
    background: #56d095;
    box-shadow: 0 0 0 3px rgba(86, 208, 149, .14);
}

.bh-portal-nav-group {
    margin: 3px 0;
}

.bh-portal-nav-group__toggle {
    width: 100%;
    min-height: 34px;
    border: 0;
    border-radius: 9px;
    padding: 8px 11px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: transparent;
    color: #92adb6;
    text-transform: uppercase;
    letter-spacing: .075em;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.bh-portal-nav-group__toggle:hover,
.bh-portal-nav-group__toggle:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

.bh-portal-nav-group__toggle .bh-icon {
    width: 14px;
    height: 14px;
    transition: transform .18s ease;
}

.bh-portal-nav-group.is-open .bh-portal-nav-group__toggle .bh-icon {
    transform: rotate(90deg);
}

.bh-portal-nav-group .bh-nav {
    gap: 3px;
    padding: 2px 2px 8px;
}

.bh-portal-nav-group .bh-nav-link {
    position: relative;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #d1e0e4;
    font-size: 12px;
    font-weight: 680;
    transition: background .15s ease, color .15s ease, transform .15s ease, border-color .15s ease;
}

.bh-portal-nav-group .bh-nav-link .bh-icon {
    width: 18px;
    height: 18px;
    color: #93b5bf;
}

.bh-portal-nav-group .bh-nav-link:hover {
    transform: translateX(2px);
    background: rgba(255, 255, 255, .075);
    color: #fff;
    text-decoration: none;
}

.bh-portal-nav-group .bh-nav-link:hover .bh-icon {
    color: #d4f2f6;
}

.bh-portal-nav-group .bh-nav-link.is-active {
    border-color: rgba(255, 255, 255, .32);
    background: linear-gradient(135deg, #f7fcfd, #dff3f6);
    color: #123f4c;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
}

.bh-portal-nav-group .bh-nav-link.is-active .bh-icon {
    color: #126e82;
}

.bh-portal-nav-group .bh-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 4px;
    background: #47c1d1;
}

.bh-portal-sidebar .bh-sidebar-footer {
    margin: auto 3px 0;
    padding-top: 14px;
}

.bh-sidebar-logout {
    appearance: none;
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    gap: 11px;
    background: transparent;
    color: #d8e7eb;
    text-align: left;
    cursor: pointer;
}

.bh-sidebar-logout:hover,
.bh-sidebar-logout:focus-visible {
    outline: none;
    background: rgba(255, 255, 255, .07);
}

.bh-sidebar-logout span,
.bh-sidebar-logout small {
    display: block;
}

.bh-sidebar-logout span {
    font-size: 13px;
}

.bh-sidebar-logout small {
    color: #9fb8c1;
}

/* -------------------------------------------------------------------------
   Header, content and footer
   ------------------------------------------------------------------------- */

.bh-portal-app .bh-topbar {
    position: sticky;
    z-index: 70;
    top: 0;
    width: 100%;
    min-height: 82px;
    height: auto;
    padding: 13px clamp(18px, 2.8vw, 38px);
    border-bottom: 1px solid rgba(209, 221, 227, .88);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 5px 24px rgba(16, 48, 62, .035);
    backdrop-filter: blur(18px) saturate(145%);
}

.bh-topbar__primary,
.bh-topbar__actions {
    display: flex;
    align-items: center;
    min-width: 0;
}

.bh-topbar__primary {
    flex: 1 1 auto;
    gap: 12px;
}

.bh-topbar__actions {
    flex: 0 1 auto;
    justify-content: flex-end;
    gap: 14px;
}

.bh-topbar__context,
.bh-topbar__profile {
    display: flex;
    align-items: center;
    min-width: 0;
}

.bh-topbar__context {
    gap: 10px;
    padding: 6px;
    border: 1px solid #dfe9ed;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 251, 252, .98), rgba(242, 247, 249, .98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.bh-topbar__profile {
    flex: 0 0 auto;
}

.bh-portal-app .bh-page-heading {
    min-width: 0;
}

.bh-portal-app .bh-page-heading span {
    display: block;
    overflow: hidden;
    color: #6e818c;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 750;
}

.bh-portal-app .bh-page-heading h1 {
    margin: 2px 0 0;
    overflow: hidden;
    color: #132630;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(21px, 2.2vw, 27px);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.bh-topbar-help {
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid #d9e4e8;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    color: #264450;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}

.bh-topbar-help:hover,
.bh-topbar-help:focus-visible {
    outline: none;
    border-color: #95c8d3;
    background: #e9f7fa;
    color: #0f6a7d;
    text-decoration: none;
}

.bh-topbar-help .bh-icon {
    width: 17px;
    height: 17px;
}

.bh-portal-app .bh-year-switch {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 8px 10px 8px 12px;
    border: 1px solid #cfdfe5;
    border-radius: 12px;
    gap: 8px;
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}

.bh-portal-app .bh-year-switch label {
    color: #6d7f89;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.bh-portal-app .bh-year-switch select {
    width: auto;
    min-width: 170px;
    min-height: 30px;
    padding: 2px 30px 2px 4px;
    border: 0;
    background-color: transparent;
    box-shadow: none;
    color: #183642;
    font-size: 12px;
    font-weight: 800;
}

.bh-portal-user {
    position: relative;
}

.bh-portal-user__trigger {
    appearance: none;
    min-height: 54px;
    padding: 6px 11px 6px 8px;
    border: 1px solid #d9e4e8;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
    box-shadow: 0 6px 18px rgba(20, 50, 64, .06);
    cursor: pointer;
}

.bh-portal-user__trigger:hover,
.bh-portal-user__trigger:focus-visible {
    outline: none;
    border-color: #afd4dc;
    box-shadow: 0 7px 19px rgba(20, 50, 64, .08);
}

.bh-portal-user__trigger > span:nth-child(2) {
    display: block;
    max-width: 165px;
    text-align: left;
}

.bh-portal-user__trigger strong,
.bh-portal-user__trigger small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bh-portal-user__trigger strong {
    font-size: 12px;
}

.bh-portal-user__trigger small {
    color: #70808c;
    font-size: 10px;
}

.bh-portal-user__trigger > .bh-icon {
    width: 14px;
    height: 14px;
    color: #78909a;
    transition: transform .18s ease;
}

.bh-portal-user__trigger[aria-expanded="true"] > .bh-icon {
    transform: rotate(90deg);
}

.bh-portal-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #164e63, #0e7490);
    color: #fff;
    box-shadow: 0 7px 14px rgba(14, 116, 144, .22);
    font-size: 12px;
    font-weight: 850;
}

.bh-portal-user__menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + 9px);
    right: 0;
    width: min(330px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid #d7e2e7;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 22px 50px rgba(13, 42, 55, .2);
}

.bh-portal-user__menu[hidden] {
    display: none;
}

.bh-portal-user__menu > div {
    margin-bottom: 5px;
    padding: 10px 11px 12px;
    border-bottom: 1px solid #e6ecef;
}

.bh-portal-user__menu strong,
.bh-portal-user__menu small {
    display: block;
}

.bh-portal-user__menu small {
    margin-top: 3px;
    color: #6a7c88;
    font-size: 11px;
}

.bh-portal-user__menu a,
.bh-portal-user__menu button {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 9px;
    background: transparent;
    color: #263a45;
    text-align: left;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.bh-portal-user__menu a:hover,
.bh-portal-user__menu button:hover,
.bh-portal-user__menu a:focus-visible,
.bh-portal-user__menu button:focus-visible {
    outline: none;
    background: #eef7f8;
    color: #0e6478;
    text-decoration: none;
}

.bh-portal-app .bh-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px clamp(18px, 3vw, 42px) 48px;
}

.bh-content-inner {
    width: min(100%, 1580px);
    margin: 0 auto;
}

.bh-portal-app .bh-main {
    width: 100%;
    min-width: 0;
}

.bh-portal-app .bh-card,
.bh-portal-app .bh-kpi {
    border-color: #dbe5e9;
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(20, 50, 64, .05);
}

.bh-portal-app .bh-card:hover {
    box-shadow: 0 10px 30px rgba(20, 50, 64, .07);
}

.bh-portal-app .bh-alert {
    width: 100%;
    border-radius: 13px;
    padding: 13px 15px;
    box-shadow: 0 4px 16px rgba(20, 50, 64, .035);
}

.bh-portal-app .bh-table-wrap {
    max-width: 100%;
    border-radius: 0 0 16px 16px;
}

.bh-portal-app .bh-table th {
    background: #f5f8f9;
}

.bh-portal-app .bh-version-footer {
    flex: 0 0 auto;
    margin: 0;
    padding: 14px clamp(18px, 3vw, 42px);
    border-top: 1px solid #dce5e9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: rgba(255, 255, 255, .65);
    color: #7d8d97;
    font-size: 11px;
}

.bh-portal-overlay {
    position: fixed;
    z-index: 80;
    inset: 0;
    background: rgba(5, 20, 28, .54);
    backdrop-filter: blur(2px);
}

.bh-portal-overlay[hidden] {
    display: none;
}

.bh-portal-app .bh-menu-button,
.bh-portal-sidebar .bh-sidebar-close {
    display: none;
}

.bh-releasebar {
    margin: 0;
    padding: 10px clamp(18px, 3vw, 42px);
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
}

.bh-releasebar--maintenance {
    border-bottom: 1px solid #ecd09c;
    background: #fff1d6;
    color: #744608;
}

/* -------------------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------------------- */

.bh-dashboard-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: clamp(24px, 4vw, 38px);
    border-radius: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 28px;
    background:
        radial-gradient(circle at 100% 0, rgba(95, 216, 229, .28), transparent 19rem),
        linear-gradient(135deg, #0c3545 0%, #10586a 62%, #0b7286 100%);
    color: #fff;
    box-shadow: 0 18px 46px rgba(15, 76, 93, .18);
}

.bh-dashboard-hero::after {
    content: "";
    position: absolute;
    right: -75px;
    bottom: -115px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
}

.bh-dashboard-hero__copy,
.bh-dashboard-hero__aside {
    position: relative;
    z-index: 1;
}

.bh-dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #9de5ee;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: 10px;
    font-weight: 850;
}

.bh-dashboard-hero h2 {
    margin: 8px 0 10px;
    max-width: 820px;
    font-size: clamp(29px, 4vw, 44px);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.bh-dashboard-hero p {
    max-width: 780px;
    margin: 0;
    color: #d8e9ed;
    font-size: 14px;
}

.bh-dashboard-hero__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
}

.bh-dashboard-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 9px;
}

.bh-dashboard-hero .bh-button--primary {
    border-color: #0f6478;
    background: linear-gradient(180deg, #11758b 0%, #0d5d71 100%);
    color: #ffffff;
    box-shadow: 0 9px 24px rgba(0, 0, 0, .16);
}

.bh-dashboard-hero .bh-button--primary:hover,
.bh-dashboard-hero .bh-button--primary:focus-visible {
    color: #ffffff;
    background: linear-gradient(180deg, #13819a 0%, #0f667b 100%);
}

.bh-dashboard-hero .bh-button--ghost {
    border-color: rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
}

.bh-dashboard-hero .bh-button--ghost:hover,
.bh-dashboard-hero .bh-button--ghost:focus-visible {
    color: #ffffff;
    background: rgba(255, 255, 255, .16);
}

.bh-dashboard-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.bh-dashboard-status span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 999px;
    background: rgba(3, 36, 47, .28);
    color: #e7f4f6;
    font-size: 10px;
    font-weight: 750;
}

.bh-dashboard-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f4c45c;
}

.bh-dashboard-status .is-good i {
    background: #5bdda0;
}

.bh-dashboard-issues {
    margin-bottom: 20px;
}

.bh-dashboard-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bh-dashboard-panel {
    overflow: hidden;
    border: 1px solid #dbe5e9;
    border-radius: 18px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 7px 24px rgba(20, 50, 64, .05);
}

.bh-dashboard-panel__head {
    padding: 17px 19px 15px;
    border-bottom: 1px solid #e3eaed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.bh-dashboard-panel__title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bh-dashboard-panel__icon {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #e7f5f7;
    color: #126a7d;
}

.bh-dashboard-panel__icon .bh-icon {
    width: 19px;
    height: 19px;
}

.bh-dashboard-panel__head h2 {
    margin: 0;
    font-size: 16px;
    letter-spacing: -.015em;
}

.bh-dashboard-panel__head p {
    margin: 3px 0 0;
    color: #6c7d87;
    font-size: 11px;
}

.bh-dashboard-panel__head > a {
    flex: 0 0 auto;
    color: #526a76;
    font-size: 11px;
    font-weight: 800;
}

.bh-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.bh-stat-card {
    min-width: 0;
    min-height: 154px;
    padding: 18px 18px 16px;
    border: 1px solid #e4ecef;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdfe 100%);
    color: #152631;
    box-shadow: 0 6px 18px rgba(18, 42, 53, .045);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.bh-stat-card[href]:hover,
.bh-stat-card[href]:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: #cfe1e7;
    background: #f8fcfd;
    box-shadow: 0 10px 24px rgba(18, 42, 53, .08);
    text-decoration: none;
}

.bh-stat-card__top {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #687b86;
    font-size: 11px;
    font-weight: 750;
}

.bh-stat-card__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #edf3f5;
    color: #526a75;
}

.bh-stat-card__icon .bh-icon {
    width: 15px;
    height: 15px;
}

.bh-stat-card strong {
    display: block;
    margin-top: 15px;
    overflow-wrap: anywhere;
    font-size: clamp(21px, 2.2vw, 29px);
    line-height: 1.05;
    letter-spacing: -.04em;
}

.bh-stat-card small {
    display: block;
    margin-top: auto;
    padding-top: 12px;
    color: #71828c;
    font-size: 11px;
    line-height: 1.45;
}

.bh-stat-card--positive strong {
    color: #16794b;
}

.bh-stat-card--positive .bh-stat-card__icon {
    background: #e6f6ed;
    color: #16794b;
}

.bh-stat-card--warning strong {
    color: #93600c;
}

.bh-stat-card--warning .bh-stat-card__icon {
    background: #fff2d8;
    color: #93600c;
}

.bh-stat-card--danger strong {
    color: #aa2d24;
}

.bh-stat-card--danger .bh-stat-card__icon {
    background: #fdebea;
    color: #aa2d24;
}

.bh-stat-card--info .bh-stat-card__icon {
    background: #e5f4f7;
    color: #126b80;
}

.bh-dashboard-card {
    border-radius: 18px;
}

.bh-dashboard-card .bh-card-head {
    padding: 18px 20px;
}

.bh-dashboard-card .bh-card-head h2 {
    font-size: 17px;
}

.bh-dashboard-empty {
    padding: 44px 24px;
}

/* -------------------------------------------------------------------------
   Personal dashboard settings
   ------------------------------------------------------------------------- */

.bh-dashboard-settings .bh-card-head {
    align-items: center;
    padding: 21px 24px;
}

.bh-dashboard-settings .bh-card-body {
    padding: 24px;
}

.bh-dashboard-settings__form {
    gap: 22px;
}

.bh-dashboard-settings__intro {
    display: grid;
    grid-template-columns: minmax(240px, 420px) minmax(300px, 1fr);
    align-items: end;
    gap: 18px 28px;
}

.bh-dashboard-settings__hint {
    min-height: 42px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid #d6e5e9;
    border-radius: 11px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    background: #f3f9fa;
    color: #526873;
    font-size: 12px;
    line-height: 1.45;
}

.bh-dashboard-settings__hint .bh-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: #0e7085;
}

.bh-dashboard-settings .bh-sort-list {
    gap: 8px;
}

.bh-dashboard-settings .bh-sort-item {
    min-height: 72px;
    padding: 12px 14px;
    border-color: #dce6ea;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 76px auto;
    grid-template-areas: "handle copy moves visibility";
    align-items: center;
    gap: 13px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(20, 50, 64, .025);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.bh-dashboard-settings .bh-sort-item:hover {
    border-color: #bfd4db;
    background: #fcfefe;
    box-shadow: 0 5px 14px rgba(20, 50, 64, .055);
}

.bh-dashboard-settings .bh-sort-item.is-dragging {
    opacity: .55;
}

.bh-dashboard-settings .bh-sort-item.is-drag-over {
    outline: 2px solid #14798e;
    outline-offset: 2px;
}

.bh-dashboard-settings .bh-sort-handle {
    grid-area: handle;
    width: 36px;
    height: 40px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #607681;
    cursor: grab;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -4px;
}

.bh-dashboard-settings .bh-sort-handle:hover {
    border-color: #d6e4e8;
    background: #eef6f8;
    color: #0d687c;
}

.bh-dashboard-settings .bh-sort-handle:active {
    cursor: grabbing;
}

.bh-sort-copy {
    grid-area: copy;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.bh-sort-copy strong {
    color: #1a2d37;
    font-size: 14px;
    line-height: 1.25;
}

.bh-sort-copy small {
    overflow: hidden;
    color: #5c6975;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 400;
}

.bh-sort-move-actions {
    grid-area: moves;
    display: inline-flex;
    gap: 4px;
}

.bh-sort-move {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #b8cbd2;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #234b59;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.bh-sort-move:hover,
.bh-sort-move:focus-visible {
    border-color: #75aab6;
    background: #e7f3f6;
    color: #0b5d70;
}

.bh-sort-move:disabled {
    border-color: #d8e1e5;
    background: #f4f7f8;
    color: #87979f;
    cursor: not-allowed;
}

.bh-sort-visibility {
    grid-area: visibility;
    position: relative;
    min-width: 92px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #405661;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}

.bh-sort-visibility input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.bh-sort-switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    border: 1px solid #536873;
    border-radius: 999px;
    background: #71838c;
    transition: border-color .16s ease, background .16s ease;
}

.bh-sort-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(10, 36, 49, .28);
    transition: transform .16s ease;
}

.bh-sort-visibility input:checked + .bh-sort-switch {
    border-color: #0b6579;
    background: #0d7186;
}

.bh-sort-visibility input:checked + .bh-sort-switch::after {
    transform: translateX(16px);
}

.bh-sort-visibility input:focus-visible + .bh-sort-switch {
    outline: 3px solid #0b6579;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #fff;
}

.bh-sort-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

@media (forced-colors: active) {
    .bh-sort-switch {
        forced-color-adjust: none;
        border-color: ButtonText;
        background: Canvas;
    }

    .bh-sort-switch::after {
        background: ButtonText;
    }

    .bh-sort-visibility input:checked + .bh-sort-switch {
        border-color: Highlight;
        background: Highlight;
    }

    .bh-sort-visibility input:checked + .bh-sort-switch::after {
        background: HighlightText;
    }

    .bh-sort-visibility input:focus-visible + .bh-sort-switch {
        outline-color: Highlight;
        box-shadow: 0 0 0 5px Canvas;
    }
}

.bh-dashboard-settings__actions {
    padding-top: 2px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.bh-dashboard-settings__actions .bh-button--primary {
    border-color: #0a5d70;
    background: #0b6579;
    color: #fff;
}

.bh-dashboard-settings__actions .bh-button--ghost,
.bh-dashboard-settings .bh-card-actions .bh-button--ghost {
    border-color: #b9cbd2;
    background: #fff;
    color: #1d4452;
}

/* -------------------------------------------------------------------------
   Login and standalone states
   ------------------------------------------------------------------------- */

.bh-portal-login-layout {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(360px, 560px) minmax(0, 1fr);
    background: #eef3f6;
}

.bh-portal-login-card {
    align-self: center;
    width: min(440px, calc(100vw - 36px));
    margin: 44px auto;
    padding: clamp(28px, 5vw, 46px);
    border: 1px solid #d9e3e7;
    border-radius: 24px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 30px 80px rgba(12, 42, 55, .13);
}

.bh-portal-login-brand {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bh-portal-login-brand strong,
.bh-portal-login-brand small {
    display: block;
}

.bh-portal-login-brand strong {
    font-size: 16px;
}

.bh-portal-login-brand small {
    color: #71818c;
    font-size: 11px;
}

.bh-portal-login-copy {
    margin-bottom: 22px;
}

.bh-portal-login-copy h1,
.bh-portal-login-card > h1 {
    margin: 5px 0 8px;
    font-size: clamp(28px, 4vw, 38px);
    letter-spacing: -.04em;
}

.bh-portal-login-copy p,
.bh-portal-login-card > p {
    margin: 0;
    color: #61727d;
}

.bh-help-eyebrow {
    color: #0d758a;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: 10px;
    font-weight: 850;
}

.bh-portal-login-form {
    margin-top: 18px;
}

.bh-portal-login-form .bh-portal-login-stay {
    width: fit-content;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #344752;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.bh-portal-login-form .bh-portal-login-stay input[type="checkbox"] {
    appearance: auto;
    width: 18px;
    height: 18px;
    min-height: 18px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    accent-color: #0d7186;
    box-shadow: none;
}

.bh-portal-login-form .bh-portal-login-stay input[type="checkbox"]:focus-visible {
    outline: 3px solid #0b6579;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px #fff;
}

.bh-portal-login-form label {
    display: block;
    margin-bottom: 6px;
    color: #344752;
    font-size: 12px;
    font-weight: 750;
}

.bh-portal-login-form input[type="text"],
.bh-portal-login-form input[type="password"] {
    width: 100%;
    min-height: 50px;
    padding: 11px 13px;
    border: 1px solid #cbd7dc;
    border-radius: 12px;
    background: #fff;
}

.bh-portal-login-form input:focus {
    outline: none;
    border-color: #278da1;
    box-shadow: 0 0 0 4px rgba(39, 141, 161, .12);
}

.bh-portal-login-form button,
.bh-portal-login-form input[type="submit"] {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #164e63, #0e7490);
    color: #fff;
    box-shadow: 0 11px 22px rgba(14, 116, 144, .19);
    font-weight: 800;
    cursor: pointer;
}

.bh-portal-login-aside {
    position: relative;
    overflow: hidden;
    padding: clamp(40px, 7vw, 90px);
    display: flex;
    align-items: flex-end;
    background:
        radial-gradient(circle at 25% 25%, rgba(72, 189, 205, .24), transparent 34%),
        radial-gradient(circle at 80% 75%, rgba(35, 126, 149, .32), transparent 34%),
        linear-gradient(145deg, #0c2c3a 0%, #103c4a 53%, #081f2a 100%);
    color: #fff;
}

.bh-portal-login-aside::before,
.bh-portal-login-aside::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
}

.bh-portal-login-aside::before {
    width: 44vw;
    height: 44vw;
    top: -20vw;
    right: -10vw;
}

.bh-portal-login-aside::after {
    width: 30vw;
    height: 30vw;
    bottom: -17vw;
    left: -7vw;
}

.bh-portal-login-aside > div {
    position: relative;
    z-index: 1;
    max-width: 650px;
}

.bh-portal-login-aside h2 {
    margin: 12px 0 28px;
    font-size: clamp(32px, 5vw, 62px);
    line-height: 1.03;
    letter-spacing: -.05em;
}

.bh-portal-login-aside ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 13px;
}

.bh-portal-login-aside li {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    color: #d9e8eb;
}

.bh-portal-login-aside li::before {
    content: "✓";
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 7px;
    display: grid;
    place-items: center;
    background: rgba(61, 193, 208, .16);
    color: #70d7e2;
    font-weight: 900;
}

/* -------------------------------------------------------------------------
   REDAXO system pages belonging to the portal setup
   ------------------------------------------------------------------------- */

.bh-control-hero {
    padding: clamp(22px, 4vw, 38px);
    border-radius: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
    gap: 22px;
    background: linear-gradient(135deg, #0d3544, #155769 64%, #0d7185);
    color: #fff;
    box-shadow: 0 18px 45px rgba(15, 67, 83, .16);
}

.bh-control-hero h2 {
    margin: 5px 0 10px;
    font-size: clamp(27px, 4vw, 42px);
    letter-spacing: -.04em;
}

.bh-control-hero p {
    max-width: 800px;
    margin: 0;
    color: #d7e8ec;
}

.bh-control-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-end;
    gap: 10px;
}

.bh-control-hero .bh-button--primary {
    border-color: #0f6478;
    background: linear-gradient(180deg, #11758b 0%, #0d5d71 100%);
    color: #ffffff;
}

.bh-control-hero .bh-button--ghost {
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .10);
    color: #ffffff;
}

.bh-admin-link-list {
    display: grid;
    gap: 9px;
}

.bh-admin-link-list a {
    padding: 13px 14px;
    border: 1px solid #dce5e9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: #253944;
}

.bh-admin-link-list a:hover {
    border-color: #b6d6de;
    background: #f4fafb;
    text-decoration: none;
}

.bh-admin-link-list a > span,
.bh-admin-link-list strong,
.bh-admin-link-list small {
    display: block;
}

.bh-admin-link-list small {
    margin-top: 2px;
    color: #6e7e88;
}

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

.bh-module-card {
    position: relative;
    padding: 16px;
    border: 1px solid #dbe4e8;
    border-radius: 14px;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    background: #fff;
    cursor: pointer;
    transition: border .15s ease, box-shadow .15s ease, transform .15s ease;
}

.bh-module-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 22px rgba(20, 50, 64, .07);
}

.bh-module-card.is-active {
    border-color: #86c8d3;
    background: #f3fbfc;
}

.bh-module-card input[type="checkbox"] {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 18px;
    height: 18px;
    min-height: 0;
}

.bh-module-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: #e8f5f7;
    color: #12677b;
}

.bh-module-card > span:last-child {
    padding-right: 24px;
}

.bh-module-card strong,
.bh-module-card small,
.bh-module-card em {
    display: block;
}

.bh-module-card small {
    margin-top: 4px;
    color: #687984;
    font-size: 11px;
}

.bh-module-card em {
    margin-top: 7px;
    color: #0f7185;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
}

.bh-portal-mapping-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.bh-check--compact {
    white-space: nowrap;
}

.bh-process-list {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: process;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.bh-process-list li {
    position: relative;
    padding: 15px;
    border: 1px solid #dce5e9;
    border-radius: 13px;
    background: #f9fbfc;
    counter-increment: process;
}

.bh-process-list li::before {
    content: counter(process);
    width: 25px;
    height: 25px;
    margin-bottom: 9px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #dff1f4;
    color: #12667a;
    font-size: 11px;
    font-weight: 900;
}

.bh-process-list strong,
.bh-process-list span {
    display: block;
}

.bh-process-list span {
    margin-top: 4px;
    color: #687984;
    font-size: 11px;
}

.bh-table-sub {
    display: block;
    margin-top: 3px;
    color: #71818b;
}

.bh-note {
    padding: 12px 14px;
    border: 1px solid #dde7eb;
    border-radius: 10px;
    background: #f4f8fa;
    color: #536873;
    font-size: 12px;
}

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

@media (max-width: 1240px) {
    .bh-portal-app {
        --bh-portal-sidebar: 258px;
    }

    .bh-portal-user__trigger > span:nth-child(2),
    .bh-topbar-help span {
        display: none;
    }

    .bh-topbar-help {
        width: 42px;
        padding-inline: 0;
        justify-content: center;
    }

    .bh-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bh-process-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bh-control-hero,
    .bh-dashboard-hero {
        grid-template-columns: 1fr;
    }

    .bh-control-hero__actions,
    .bh-dashboard-hero__aside,
    .bh-dashboard-hero__actions,
    .bh-dashboard-status {
        align-items: flex-start;
        justify-content: flex-start;
    }
}

@media (max-width: 930px) {
    .bh-portal-stage {
        width: 100%;
        margin-left: 0;
    }

    .bh-portal-sidebar {
        width: min(304px, calc(100vw - 48px));
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 20px 0 45px rgba(0, 0, 0, .25);
    }

    .bh-portal-sidebar.is-open {
        transform: none;
    }

    .bh-portal-app .bh-menu-button,
    .bh-portal-sidebar .bh-sidebar-close {
        display: grid;
    }

    .bh-portal-app .bh-topbar {
        padding-inline: 16px;
    }

    .bh-portal-app .bh-content {
        padding-inline: 15px;
    }

    .bh-portal-login-layout {
        grid-template-columns: 1fr;
    }

    .bh-portal-login-aside {
        display: none;
    }

    .bh-portal-login-card {
        margin: 26px auto;
    }

    .bh-module-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .bh-dashboard-settings .bh-card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .bh-dashboard-settings__intro {
        grid-template-columns: 1fr;
    }

    .bh-dashboard-settings .bh-sort-item {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        grid-template-areas:
            "handle copy copy"
            ". moves visibility";
        gap: 9px 11px;
    }

    .bh-sort-copy small {
        overflow: visible;
        white-space: normal;
    }

    .bh-sort-visibility {
        min-width: 0;
        justify-content: flex-end;
    }

    .bh-portal-app .bh-topbar {
        min-height: 70px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .bh-topbar__primary {
        flex: 1 1 calc(100% - 70px);
    }

    .bh-topbar__actions {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .bh-topbar__context {
        flex: 1 1 auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    .bh-topbar__profile {
        flex: 0 0 auto;
        margin-left: auto;
    }

    .bh-portal-app .bh-year-switch {
        order: 1;
        flex: 1 1 220px;
        width: auto;
    }

    .bh-portal-app .bh-year-switch label {
        display: block;
    }

    .bh-portal-app .bh-year-switch select {
        flex: 1;
        width: 100%;
    }

    .bh-page-heading h1 {
        max-width: 52vw;
    }

    .bh-topbar-help {
        flex: 0 0 auto;
    }

    .bh-dashboard-hero {
        padding: 22px;
    }

    .bh-dashboard-panel__head {
        align-items: flex-start;
    }

    .bh-stat-grid {
        grid-template-columns: 1fr;
    }

    .bh-stat-card,
    .bh-stat-card:nth-child(2n),
    .bh-stat-card:nth-child(4n) {
        min-height: 132px;
        border-right: 1px solid #e4ecef;
        border-top: 1px solid #e4ecef;
    }

    .bh-stat-card:first-child {
        border-top: 1px solid #e4ecef;
    }

    .bh-module-grid,
    .bh-process-list,
    .bh-portal-mapping-form {
        grid-template-columns: 1fr;
    }

    .bh-portal-login-card {
        padding: 26px 22px;
    }

    .bh-portal-app .bh-version-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .bh-portal-app .bh-grid--2,
    .bh-portal-app .bh-grid--3,
    .bh-portal-app .bh-grid--4,
    .bh-portal-app .bh-form-grid,
    .bh-portal-app .bh-form-grid--3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .bh-dashboard-settings .bh-card-head,
    .bh-dashboard-settings .bh-card-body {
        padding: 16px;
    }

    .bh-dashboard-settings__actions .bh-button,
    .bh-dashboard-settings .bh-card-actions .bh-button {
        width: 100%;
    }

    .bh-dashboard-settings .bh-sort-item {
        grid-template-columns: 36px minmax(0, 1fr);
        grid-template-areas:
            "handle copy"
            ". moves"
            ". visibility";
    }

    .bh-sort-move-actions,
    .bh-sort-visibility {
        justify-content: flex-start;
    }

    .bh-topbar-help {
        display: none;
    }

    .bh-portal-user__trigger {
        min-height: 43px;
        padding: 5px;
    }

    .bh-portal-avatar {
        width: 32px;
        height: 32px;
    }

    .bh-dashboard-hero__actions .bh-button {
        width: 100%;
    }

    .bh-dashboard-panel__head {
        flex-direction: column;
    }
}

/* A two-tone focus ring remains visible on both white content and the dark sidebar. */
.bh-portal-body .bh-addon :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid #0b6579;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .96);
}

@media (prefers-reduced-motion: reduce) {
    .bh-portal-body * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
