:root {
    --hp-green: #0f6b3b;
    --hp-green-dark: #0a4c2a;
    --hp-green-soft: #eaf4ec;
    --hp-yellow: #f4d000;
    --hp-yellow-soft: #fff8cc;
    --hp-sidebar: #ffffff;
    --hp-bg: #f5f7f3;
    --hp-border: #d9dfd8;
    --hp-text: #1d1d1d;
    --hp-muted: #6b726c;
    --hp-red: #c62828;
    --hp-blue: #2b7bbb;
}

body.hp-shell {
    margin: 0;
    background: var(--hp-bg);
    color: var(--hp-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hp-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background: var(--hp-sidebar);
    border-right: 1px solid var(--hp-border);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.hp-logo {
    height: 64px;
    background: linear-gradient(135deg, var(--hp-green-dark), var(--hp-green));
    color: white;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 0 1rem;
}

.hp-logo-icon {
    width: 34px;
    height: 34px;
    border: 2px solid var(--hp-yellow);
    color: var(--hp-yellow);
    display: grid;
    place-items: center;
    border-radius: .3rem;
    font-size: 1.3rem;
}

.hp-logo strong {
    display: block;
    font-size: 1rem;
}

.hp-logo span {
    display: block;
    font-size: .8rem;
    opacity: .9;
}

.hp-side-nav {
    padding: 1rem .8rem;
    display: grid;
    gap: .25rem;
    overflow-y: auto;
}

.hp-side-nav a {
    color: #303632;
    text-decoration: none;
    padding: .78rem .9rem;
    border-radius: .55rem;
    font-weight: 600;
}

.hp-side-nav a:hover,
.hp-side-nav a.active {
    background: var(--hp-yellow-soft);
    color: var(--hp-green-dark);
}

.hp-sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--hp-border);
    padding: 1rem;
    display: flex;
    gap: .75rem;
    align-items: center;
}

.hp-sidebar-footer strong,
.hp-sidebar-footer span {
    display: block;
}

.hp-sidebar-footer span {
    font-size: .8rem;
    color: var(--hp-muted);
}

.hp-avatar {
    width: 42px;
    height: 42px;
    background: var(--hp-yellow);
    color: var(--hp-green-dark);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.hp-avatar.small {
    width: 34px;
    height: 34px;
}

.hp-main-shell {
    margin-left: 248px;
    min-height: 100vh;
}

.hp-topbar {
    height: 64px;
    background: linear-gradient(135deg, var(--hp-green-dark), var(--hp-green));
    border-bottom: 4px solid var(--hp-yellow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.4rem;
    color: white;
    position: sticky;
    top: 0;
    z-index: 40;
}

.hp-topbar a {
    color: white;
}

.hp-topbar-right {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.hp-pill {
    background: var(--hp-yellow);
    color: var(--hp-green-dark);
    padding: .35rem .7rem;
    border-radius: 999px;
    font-weight: 700;
}

.hp-content {
    padding: 1.1rem 1.4rem 2rem;
}

.hp-page-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hp-page-head h1 {
    margin: 0;
    font-size: 1.45rem;
}

.hp-breadcrumb {
    color: var(--hp-muted);
    margin-top: .25rem;
    font-size: .9rem;
}

.hp-actions-top {
    display: flex;
    gap: .7rem;
    flex-wrap: wrap;
}

.hp-btn {
    border: 1px solid var(--hp-border);
    background: white;
    color: var(--hp-green-dark);
    padding: .68rem 1.2rem;
    border-radius: .35rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.hp-btn.primary {
    background: var(--hp-yellow);
    color: #222;
    border-color: var(--hp-yellow);
}

.hp-btn.success {
    background: var(--hp-green);
    color: white;
    border-color: var(--hp-green);
}

.hp-card {
    background: white;
    border: 1px solid var(--hp-border);
    border-radius: .45rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

@media (max-width: 1100px) {
    .hp-sidebar {
        position: static;
        width: auto;
    }

    .hp-main-shell {
        margin-left: 0;
    }

    .hp-side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


.details {
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: .45rem .9rem;
    margin: 0;
}

.details dt {
    font-weight: 700;
    color: #335;
}

.details dd {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}


.btn.danger {
    color: #c62828;
    border-color: #ef9a9a;
    background: #fff5f5;
}

.alert.alert-success {
    background: #edf8ef;
    border: 1px solid #b8e0c2;
    color: #0b6b3a;
    padding: .75rem 1rem;
    border-radius: .5rem;
    margin: .75rem 0;
}


.stack {
    display: grid;
    gap: .75rem;
}

.stack label {
    display: grid;
    gap: .25rem;
    font-weight: 600;
}

.stack input,
.stack select {
    width: 100%;
    padding: .55rem .65rem;
    border: 1px solid #d8dfd4;
    border-radius: .45rem;
    background: #fff;
}

hr {
    border: 0;
    border-top: 1px solid #e2e8de;
    margin: 1rem 0;
}


.nav-group { margin: .35rem 0 .8rem; }
.nav-heading { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #6f7b68; padding: .55rem .75rem .25rem; font-weight: 700; }
.hp-side-nav a.active { background: #eaf4df; border-left: 4px solid #6a9f2f; font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.tabs a { display: inline-flex; align-items: center; padding: .6rem .9rem; border: 1px solid #d8dfd4; border-radius: .75rem; background: #fff; text-decoration: none; color: inherit; font-weight: 600; }
.tabs a.active { background: #eaf4df; border-color: #9fbe79; }
.action-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 1rem 0; }
.action-card { display: grid; gap: .35rem; padding: 1rem; border: 1px solid #d8dfd4; border-radius: .9rem; background: #fff; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.action-card:hover { border-color: #9fbe79; background: #fbfff7; }
.action-card strong { font-size: 1.05rem; }
.action-card span { color: #5f6b58; line-height: 1.35; }
.inline-form { display: flex; align-items: end; gap: .5rem; flex-wrap: wrap; }
.compact-form { display: inline-flex; align-items: center; }
.icon-btn { border: 1px solid #d8dfd4; border-radius: .45rem; background: #fff; padding: .4rem .55rem; cursor: pointer; }
.grid.compact { gap: .5rem; }
.stack.narrow { max-width: 480px; }


/* rev0044 navigation repair */
.hp-sidebar { width: 260px; overflow: hidden; }
.hp-main-shell { margin-left: 260px; }
.hp-logo-icon { font-size: .78rem; font-weight: 800; }
.hp-side-nav { padding: .9rem .7rem 1rem; display: block; overflow-y: auto; }
.nav-group { margin: 0 0 .75rem; }
.nav-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .055em; color: #6f7b68; padding: .45rem .65rem .22rem; font-weight: 800; }
.hp-side-nav a { display: block; width: 100%; box-sizing: border-box; padding: .52rem .7rem; margin: .08rem 0; border-radius: .55rem; line-height: 1.25; font-size: .93rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 4px solid transparent; }
.hp-side-nav a span { display: block; min-width: 0; }
.hp-side-nav a:hover { background: #fff8cc; color: #0a4c2a; }
.hp-side-nav a.active { background: #eaf4df; color: #0a4c2a; border-left-color: #6a9f2f; font-weight: 800; }
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.tabs a { display: inline-flex; align-items: center; padding: .6rem .9rem; border: 1px solid #d8dfd4; border-radius: .75rem; background: #fff; text-decoration: none; color: inherit; font-weight: 700; }
.tabs a.active { background: #eaf4df; border-color: #9fbe79; }
.action-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 1rem 0; }
.action-card { display: grid; gap: .35rem; padding: 1rem; border: 1px solid #d8dfd4; border-radius: .9rem; background: #fff; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.action-card:hover { border-color: #9fbe79; background: #fbfff7; }
.action-card strong { font-size: 1.05rem; }
.action-card span { color: #5f6b58; line-height: 1.35; }
.stack { display: grid; gap: .75rem; }
.stack.narrow { max-width: 560px; }
.stack label { display: grid; gap: .25rem; font-weight: 650; }
.stack input, .stack select, .inline-form input, .inline-form select { padding: .55rem .65rem; border: 1px solid #d8dfd4; border-radius: .45rem; background: #fff; }
.inline-form { display: flex; align-items: end; gap: .5rem; flex-wrap: wrap; }
.compact-form { display: inline-flex; align-items: center; }
.btn.small { padding: .35rem .55rem; font-size: .85rem; }
.group-row td, .group-row th { background: #fff5c2; font-weight: 800; color: #b00000; }
.table-wrap.wide { overflow-x: auto; }
.finance-table th, .finance-table td { white-space: nowrap; text-align: right; }
.finance-table th:first-child, .finance-table td:first-child, .finance-table th:nth-child(2), .finance-table td:nth-child(2) { text-align: left; }
.alert.alert-success { background: #edf8ef; border: 1px solid #b8e0c2; color: #0b6b3a; padding: .75rem 1rem; border-radius: .5rem; margin: .75rem 0; }
@media (max-width: 900px) { .hp-sidebar { position: static; width: auto; } .hp-main-shell { margin-left: 0; } .hp-side-nav a { white-space: normal; } }


/* rev0045: saubere Formular-/Mobil-/Kontenrahmen-Darstellung */
.checkbox-row {
    display: inline-flex !important;
    align-items: center;
    gap: .5rem;
    line-height: 1.25;
    font-weight: 600;
}
.checkbox-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    flex: 0 0 auto;
}
.filter-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.filter-bar input[type="text"],
.filter-bar input[name="q"] {
    min-width: 220px;
}
.mobile-capture {
    max-width: 680px;
    margin: 0 auto;
}
.mobile-card {
    background: #fff;
    border: 1px solid #d8dfd4;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.mobile-card input,
.mobile-card select,
.mobile-card textarea {
    font-size: 1rem;
    padding: .75rem;
}
.btn.big {
    justify-content: center;
    padding: .9rem 1rem;
    font-size: 1.05rem;
}
.tax-detail {
    opacity: .7;
    max-width: 4.5rem;
}
.group-row td {
    background: #f5f8ef;
    font-weight: 700;
    color: #38522a;
}
.btn.small {
    padding: .35rem .55rem;
    font-size: .85rem;
}


details.card > summary {
    cursor: pointer;
    list-style: none;
}

details.card > summary::-webkit-details-marker {
    display: none;
}

.btn.small {
    padding: .35rem .55rem;
    font-size: .85rem;
}

.btn.large {
    width: 100%;
    justify-content: center;
    padding: .85rem 1rem;
}


.source-badge {
    display: inline-block;
    padding: .2rem .45rem;
    border-radius: .5rem;
    background: #edf6e7;
    border: 1px solid #cfe3c2;
    font-weight: 700;
    font-size: .85rem;
}

td small {
    color: #66715f;
}


.info-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    margin-left: .35rem;
    border-radius: 999px;
    border: 1px solid #8aa77d;
    background: #f4fbef;
    color: #315727;
    font-size: .75rem;
    font-weight: 800;
    cursor: help;
}

/* rev0064: sichere Aktionsbuttons und kleine Zähler */
.hp-btn.danger {
    background: #fff5f5;
    border-color: #e0b4b4;
    color: #9f1d1d;
}
.hp-side-nav .hp-nav-count {
    font-weight: 700;
}
