:root {
    --hz-page: #f7faf6;
    --hz-surface: #ffffff;
    --hz-surface-soft: #eef8ec;
    --hz-surface-raised: #fbfdfb;
    --hz-text: #263322;
    --hz-muted: #667061;
    --hz-border: #cfe5ca;
    --hz-accent: #2d6a4f;
    --hz-accent-strong: #2e4d25;
    --hz-danger-soft: #fff1ef;
}

html[data-theme="dark"] {
    --hz-page: #101a13;
    --hz-surface: #18281e;
    --hz-surface-soft: #203427;
    --hz-surface-raised: #1c2e22;
    --hz-text: #edf5ea;
    --hz-muted: #b4c4af;
    --hz-border: #36533d;
    --hz-accent: #78b98a;
    --hz-accent-strong: #b9d9b4;
    --hz-danger-soft: #432621;
    --g: #78b98a;
    --d: #d7ead2;
    --b: #36533d;
    --s: #203427;
    --m: #b4c4af;
    --profile-green: #78b98a;
    --profile-dark: #d7ead2;
    --profile-soft: #203427;
    --profile-border: #36533d;
    --profile-muted: #b4c4af;
    --home-green: #78b98a;
    --home-dark: #d7ead2;
    --home-light: #36533d;
    --home-soft: #203427;
    --home-border: #36533d;
    --home-muted: #b4c4af;
    --home-text: #edf5ea;
    --chicken-green: #78b98a;
    --chicken-green-dark: #d7ead2;
    --chicken-green-light: #36533d;
    --chicken-green-soft: #203427;
    --chicken-border: #36533d;
    --chicken-muted: #b4c4af;
    --chicken-surface: #18281e;
    --chicken-text: #edf5ea;
    --admin-green: #78b98a;
    --admin-dark: #d7ead2;
    --admin-soft: #203427;
    --admin-border: #36533d;
    --admin-muted: #b4c4af;
    --info-green: #78b98a;
    --info-dark: #d7ead2;
    --info-soft: #203427;
    --info-border: #36533d;
    --info-muted: #b4c4af;
    --lay-green: #78b98a;
    --lay-dark: #d7ead2;
    --lay-soft: #203427;
    --lay-border: #36533d;
    --lay-muted: #b4c4af;
    --stats-green: #78b98a;
    --stats-dark: #d7ead2;
    --stats-soft: #203427;
    --stats-border: #36533d;
    --stats-muted: #b4c4af;
    --bg: #101a13;
    --card: #18281e;
    --ink: #edf5ea;
    --text: #edf5ea;
    --muted: #b4c4af;
    --border: #36533d;
    --line: #36533d;
    --soft: #203427;
    --tableRow: #18281e;
    --tableHover: #243a2b;
    --fg: #78b98a;
    --fd: #d7ead2;
    --fb: #36533d;
    --fs: #203427;
    --fm: #b4c4af;
    color-scheme: dark;
}

html[data-theme="dark"] body {
    background: var(--hz-page) !important;
    background-image: none !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] .hz-header {
    border-color: var(--hz-border) !important;
    background: rgba(18, 31, 22, .97) !important;
    box-shadow: 0 7px 24px rgba(0, 0, 0, .24) !important;
}

html[data-theme="dark"] .hz-main-nav,
html[data-theme="dark"] .hz-dropdown-menu,
html[data-theme="dark"] .hz-qr-content,
html[data-theme="dark"] .hz-pwa-offer {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] .hz-header-brand,
html[data-theme="dark"] .hz-nav-link,
html[data-theme="dark"] .hz-dropdown-toggle,
html[data-theme="dark"] .hz-dropdown-menu a,
html[data-theme="dark"] .hz-head-action,
html[data-theme="dark"] .hz-menu-toggle,
html[data-theme="dark"] .hz-qr-content strong,
html[data-theme="dark"] .hz-pwa-offer-copy strong {
    color: var(--hz-text) !important;
}

html[data-theme="dark"] .hz-header-brand small,
html[data-theme="dark"] .hz-qr-content p,
html[data-theme="dark"] .hz-pwa-offer-copy span {
    color: var(--hz-muted) !important;
}

html[data-theme="dark"] .hz-head-action,
html[data-theme="dark"] .hz-menu-toggle {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface-raised) !important;
}

html[data-theme="dark"] .hz-head-action:hover,
html[data-theme="dark"] .hz-head-action.is-active,
html[data-theme="dark"] .hz-nav-link:hover,
html[data-theme="dark"] .hz-dropdown-toggle:hover,
html[data-theme="dark"] .hz-nav-link.is-active,
html[data-theme="dark"] .hz-dropdown.is-active > .hz-dropdown-toggle,
html[data-theme="dark"] .hz-dropdown-menu a:hover {
    background: var(--hz-surface-soft) !important;
    color: #a7d6b1 !important;
}

html[data-theme="dark"] .hz-dropdown-menu,
html[data-theme="dark"] .hz-dropdown-menu-wide {
    box-shadow: 0 15px 38px rgba(0, 0, 0, .38) !important;
}

html[data-theme="dark"] .hz-menu-divider {
    background: var(--hz-border) !important;
}

html[data-theme="dark"] :is(
    .card, .profile-card, .feed-card, .feed-panel, .f-stat, .f-panel, .f-item,
    .kpi, .chart-card,
    .panel, .stat-card, .summary-card, .dashboard-card, .content-card,
    .form-card, .table-card, .info-card, .detail-card, .chicken-card,
    .egg-card, .finance-card, .modal-content, .popup-content, .box
) {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface) !important;
    color: var(--hz-text) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22) !important;
}

html[data-theme="dark"] :is(.tile, .startbox, .guest-features li, .survey-alert, .f-help, .f-metric, .f-stock, .f-open, .f-stock-note, .f-calc, .f-pagination a, .f-pagination span) {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface) !important;
    background-image: none !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] .topline {
    border-color: var(--hz-border) !important;
    background: linear-gradient(135deg, #244f36, #1f6046) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] :is(form.form-box, form.year-filter) {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

html[data-theme="dark"] .main-feed-card {
    border-color: #78b98a !important;
    background: linear-gradient(135deg, #18281e, #203427) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] :is(.btn, .theme-option label) {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface-raised) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] .theme-option input:checked + label {
    border-color: #78b98a !important;
    background: #294331 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] :is(
    h1, h2, h3, h4, h5, h6, legend, label, strong,
    .title, .heading, .card-title, .chart-title, .profile-heading h1
) {
    color: var(--hz-text) !important;
}

html[data-theme="dark"] :is(
    p, small, .muted, .subtitle, .description, .help-text, .meta,
    .profile-heading p, .stats-note
) {
    color: var(--hz-muted) !important;
}

html[data-theme="dark"] :is(input, select, textarea) {
    border-color: #4a684f !important;
    background: #122019 !important;
    color: var(--hz-text) !important;
    box-shadow: none;
}

html[data-theme="dark"] :is(input, select, textarea)::placeholder {
    color: #8fa08b !important;
    opacity: 1;
}

html[data-theme="dark"] :is(input, select, textarea):focus {
    border-color: #78b98a !important;
    box-shadow: 0 0 0 3px rgba(120, 185, 138, .2) !important;
    outline: none;
}

html[data-theme="dark"] select option {
    background: #122019;
    color: var(--hz-text);
}

html[data-theme="dark"] table {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] :is(th, thead td) {
    border-color: var(--hz-border) !important;
    background: #22362a !important;
    color: #edf5ea !important;
}

html[data-theme="dark"] td {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] tbody tr:nth-child(even) td {
    background: #1b2c21 !important;
}

html[data-theme="dark"] tbody tr:hover td {
    background: #243a2b !important;
}

html[data-theme="dark"] :is(.notice, .meldung, .alert, .message, .hint, .info-box, .checkbox-row) {
    border-color: var(--hz-border) !important;
    background: var(--hz-surface-soft) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] :is(.error, .danger, .danger-card, .feed-card.warn, .f-range.warn, .f-range-alert) {
    border-color: #805147 !important;
    background: var(--hz-danger-soft) !important;
}

html[data-theme="dark"] :is(details, summary) {
    border-color: var(--hz-border) !important;
    color: var(--hz-text) !important;
}

html[data-theme="dark"] a:not(.profile-button):not(.feed-button):not(.button):not(.btn) {
    color: #96cfa3;
}

html[data-theme="dark"] hr {
    border-color: var(--hz-border) !important;
}

html[data-theme="dark"] ::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #101a13;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    border: 2px solid #101a13;
    border-radius: 8px;
    background: #496951;
}

@media (max-width: 900px) {
    html[data-theme="dark"] :is(.hz-dropdown-menu, .hz-dropdown-menu-wide, .hz-dropdown-menu-right) {
        border-left-color: var(--hz-border) !important;
        background: #142219 !important;
    }
}

@media print {
    html,
    html[data-theme="dark"] {
        color-scheme: light !important;
    }

    html body,
    html[data-theme="dark"] body,
    html[data-theme="dark"] :is(
        main, section, article, div, form, table, thead, tbody, tr, th, td,
        .card, .profile-card, .feed-card, .feed-panel, .kpi, .chart-card,
        .panel, .stat-card, .summary-card, .dashboard-card, .content-card
    ) {
        border-color: #c9c9c9 !important;
        background: #ffffff !important;
        background-image: none !important;
        color: #111111 !important;
        box-shadow: none !important;
    }

    html[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6, p, span, small, strong, label, a) {
        color: #111111 !important;
    }

    html[data-theme="dark"] :is(input, select, textarea) {
        border-color: #999999 !important;
        background: #ffffff !important;
        color: #111111 !important;
    }

    .hz-theme-toggle {
        display: none !important;
    }
}
