:root {
    --ink: #29363e;
    --ink-soft: #52616a;
    --gold: #be9d5c;
    --gold-dark: #8a6d35;
    --sage: #b2c7c6;
    --mist: #eef2f2;
    --cream: #f4eee2;
    --line: #d9dfdf;
    --white: #fff;
    --success: #25745d;
    --danger: #b33a3a;
    --shadow: 0 10px 30px rgba(41, 54, 62, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--mist); color: var(--ink); font: 16px/1.5 Arial, Helvetica, sans-serif; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--ink) 0 164px, var(--mist) 164px); }
a { color: var(--gold-dark); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid rgba(190, 157, 92, .5); outline-offset: 2px; }
.wrap { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.site-top { background: var(--ink); }
.site-header { display: flex; align-items: center; gap: 40px; min-height: 132px; color: var(--white); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 210px; color: var(--white); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid var(--gold); color: var(--gold); font-size: 18px; font-weight: 700; letter-spacing: .08em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 20px; line-height: 1.15; }
.brand small { color: var(--sage); font-size: 14px; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; }
.main-nav a { padding: 10px 14px; color: var(--white); text-decoration: none; font-weight: 700; }
.main-nav a:hover, .main-nav a:focus-visible { background: rgba(255,255,255,.1); }
.account { display: flex; align-items: center; gap: 12px; color: var(--sage); font-size: 14px; }
.logout { border: 1px solid var(--sage); background: transparent; color: var(--white); padding: 8px 12px; cursor: pointer; }
.page { padding: 42px 0 72px; }
.page-heading { margin-bottom: 28px; }
.page-heading.with-action, .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.page-heading h1 { margin: 4px 0 6px; font-size: clamp(28px, 3vw, 38px); line-height: 1.2; }
.page-heading p { margin: 0; color: var(--ink-soft); }
.eyebrow { display: block; color: var(--gold-dark); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 18px; font-weight: 700; text-decoration: none; }
.button { display: inline-block; border: 1px solid var(--gold); background: var(--gold); color: var(--ink); padding: 10px 16px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: #d2b778; }
.button.danger { border-color: var(--danger); background: var(--danger); color: var(--white); }
.button.danger:hover { background: #902d2d; }
.button.secondary { border-color: #bdc9c9; background: var(--white); }
.panel, .area-card { background: var(--white); box-shadow: var(--shadow); border: 1px solid var(--line); }
.panel { padding: 28px; }
.panel.narrow { max-width: 650px; }
.login-panel { width: min(480px, 100%); margin: 16px auto; padding: 36px; }
.login-panel h1 { margin: 4px 0 8px; font-size: 28px; }
.login-panel p { color: var(--ink-soft); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.area-card { display: block; padding: 28px; color: var(--ink); text-decoration: none; border-top: 4px solid var(--gold); transition: transform .15s, box-shadow .15s; }
.area-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(41,54,62,.12); }
.area-card h2 { margin: 18px 0 6px; }
.area-card p { margin: 0 0 20px; color: var(--ink-soft); }
.card-icon { display: grid; place-items: center; width: 48px; height: 48px; background: var(--cream); color: var(--gold-dark); font-weight: 700; font-size: 22px; }
.card-link { color: var(--gold-dark); font-weight: 700; }
.table-panel { padding: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { padding: 16px 20px; background: #f6f8f8; color: var(--ink-soft); font-size: 13px; text-align: left; text-transform: uppercase; letter-spacing: .04em; }
td { border-top: 1px solid var(--line); padding: 16px 20px; }
td:last-child { text-align: right; }
td a { font-weight: 700; }
.empty { padding: 36px 20px; text-align: center !important; color: var(--ink-soft); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 24px 0; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; column-gap: 32px; }
.details div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--ink-soft); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.details dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.section-heading { margin: 32px 0 18px; }
.section-heading h2 { margin: 0; }
.badge { display: inline-block; padding: 4px 10px; background: var(--cream); font-size: 13px; }
.data-form { max-width: 900px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.form-grid > div { min-width: 0; }
.data-form label { display: block; margin-bottom: 6px; font-weight: 700; }
.data-form input, .data-form select, .data-form textarea { width: 100%; border: 1px solid #bec9c9; border-radius: 2px; padding: 10px 12px; background: var(--white); color: var(--ink); }
.data-form input[type="checkbox"] { width: auto; margin-right: 8px; }
.data-form .ts-wrapper { width: 100%; }
.data-form .ts-control { min-height: 46px; border: 1px solid #bec9c9; border-radius: 2px; padding: 10px 12px; box-shadow: none; }
.data-form .ts-wrapper.focus .ts-control { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(190, 157, 92, .25); }
.data-form .ts-control input { width: auto; min-width: 0; border: 0; padding: 0; box-shadow: none; }
.data-form .ts-dropdown { border-color: var(--line); box-shadow: var(--shadow); }
.data-form .ts-dropdown .active { background: var(--cream); color: var(--ink); }
.data-form textarea { min-height: 110px; resize: vertical; }
.data-form ul { margin: 6px 0; padding-left: 20px; color: var(--danger); }
.form-actions { display: flex; gap: 10px; margin-top: 28px; }
.search-panel { margin-bottom: 24px; }
.inline-form { display: inline-block; margin-left: 12px; }
.text-button { border: 0; background: transparent; color: var(--danger); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.login-panel .data-form > div { margin-bottom: 16px; }
.login-panel .data-form button { width: 100%; margin-top: 8px; }
.notice { padding: 14px 18px; margin-bottom: 24px; border-left: 4px solid; }
.notice.success { border-color: var(--success); background: #e6f3ed; }
.notice.danger { border-color: var(--danger); background: #fbeaea; }
.hint { margin-top: 0; color: var(--ink-soft); }
.product-prefill-error:empty { display: none; }
.product-prefill-error:not(:empty) { color: var(--danger); }

/* Kompakte Arbeitsansicht für die Eigentümerabrechnung. */
.owner-billing-page .page.wrap { width: calc(100% - 32px); max-width: 1800px; }
.owner-billing-page .page-heading h1 { font-size: clamp(24px, 2.5vw, 34px); }
.billing-steps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.billing-steps li { padding: 6px 12px; border: 1px solid var(--line); background: var(--white); }
.billing-steps .current { border-color: var(--gold); background: var(--cream); font-weight: 700; }
.billing-step-form h2 { margin-top: 0; }
.billing-step-form > .button { margin-bottom: 16px; }
.billing-step-form input[type="checkbox"] { width: auto; }
.billing-step-form #owner_billing_selection_selection label { display: inline; margin: 0 0 0 4px; font-weight: 400; }
.billing-step-form #owner_billing_selection_selection { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.billing-review-actions { margin-bottom: 12px; }
.billing-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; padding: 10px 12px; font-size: 13px; }
.billing-toolbar input[type="search"] { width: min(340px, 60vw); padding: 5px 8px; border: 1px solid var(--line); }
.billing-toolbar > span { color: var(--ink-soft); }
.billing-table-scroll { max-height: 70vh; overflow: auto; }
.billing-table { --billing-header-height: 34px; --billing-owner-height: 32px; min-width: 1120px; border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 1.25; table-layout: auto; }
.billing-table thead { position: sticky; top: 0; z-index: 4; }
.billing-table thead th { height: var(--billing-header-height); padding: 9px 7px; font-size: 11px; white-space: nowrap; letter-spacing: 0; }
.billing-table td { height: 38px; padding: 3px 7px; white-space: nowrap; }
.billing-table .billing-title { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.billing-table .billing-booker { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.billing-table .billing-group th { position: sticky; max-width: 0; padding: 0; font-size: 12px; text-transform: none; letter-spacing: 0; box-shadow: inset 0 -1px var(--line); }
.billing-table .billing-owner-group th { top: var(--billing-header-height); z-index: 3; background: var(--cream); }
.billing-group-label { position: sticky; left: 0; display: block; width: max-content; max-width: min(100%, calc(100vw - 36px)); height: var(--billing-owner-height); padding: 7px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.billing-table .billing-accommodation-group th { top: calc(var(--billing-header-height) + var(--billing-owner-height)); z-index: 2; background: var(--mist); }
.billing-accommodation-group .billing-group-label { height: 30px; padding: 6px 7px 6px 24px; }
.billing-accommodation-name { font-weight: 400; color: var(--ink-soft); }
.billing-table [data-owner-billing-target="row"] { --billing-row-background: #edf6ef; --billing-row-hover: #e1efe4; background: var(--billing-row-background); }
.billing-table [data-type="ownerbooking"] { --billing-row-background: #fbeeee; --billing-row-hover: #f5e2e2; }
.billing-table [data-type="blocking"] { --billing-row-background: #edf3fb; --billing-row-hover: #e0eaf7; }
.billing-table tbody tr:not(.billing-group):hover { background: var(--billing-row-hover, #f6f8f8); }
.billing-number, .billing-money { text-align: right; font-variant-numeric: tabular-nums; }
.billing-table .billing-rate { width: 300px; max-width: 380px; }
.billing-rate [data-rate-display] { display: flex; gap: 5px; align-items: center; justify-content: space-between; }
.billing-rate [data-rate-display][hidden], .billing-rate [data-rate-editor][hidden] { display: none; }
.billing-rate [data-rate-label] { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.billing-rate [data-row-message] { display: block; max-width: 340px; white-space: normal; color: var(--danger); }
.billing-rate [data-row-message]:empty { display: none; }
.billing-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 4px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.billing-icon:hover { border-color: var(--gold); background: var(--cream); }
.billing-icon:disabled { opacity: .5; cursor: default; }
.billing-table .is-excluded { color: var(--ink-soft); }
.billing-table .is-excluded > td:not(:last-child) { opacity: .6; }
.billing-table .is-excluded [data-exclude] { color: var(--success); border-color: var(--success); }
.billing-table .is-missing-rate:not(.is-excluded) .billing-rate { background: #fff2d8; }
.billing-rate-form { display: flex; gap: 3px; align-items: center; }
.billing-rate-form .ts-wrapper { flex: 1; min-width: 140px; }
.billing-rate-form .ts-control { min-height: 28px; padding: 4px 6px; font-size: 12px; }
.billing-rate-form .ts-dropdown { font-size: 13px; }
.billing-footer { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 16px; align-items: center; justify-content: space-between; background: var(--white); border-top: 2px solid var(--gold); padding: 12px; box-shadow: 0 -4px 16px #29363e12; }
.billing-footer small, .billing-blockers { display: block; font-size: 12px; }
.billing-blockers { color: var(--danger); }
.billing-footer button:disabled { opacity: .5; cursor: default; }
.billing-modal { width: min(680px, calc(100% - 32px)); max-height: 85vh; padding: 24px; border: 1px solid var(--line); color: var(--ink); }
.billing-modal::backdrop { background: #29363ea6; }
.billing-modal h2 { margin-top: 0; font-size: 21px; }
.billing-modal progress { width: 100%; height: 20px; accent-color: var(--gold-dark); }
.billing-modal [hidden] { display: none; }
.billing-results { max-height: 30vh; overflow-y: auto; font-size: 13px; overflow-wrap: anywhere; }
.billing-results p { margin: 6px 0; }
.billing-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 600px) { .billing-footer { align-items: stretch; flex-direction: column; } }
@media (max-width: 780px) {
    .site-header { flex-wrap: wrap; gap: 14px; padding-block: 20px; }
    .main-nav { order: 3; width: 100%; flex: none; }
    .account { margin-left: auto; }
    .cards { grid-template-columns: 1fr; }
    .page-heading.with-action, .section-heading { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
    .wrap { width: min(100% - 24px, 1280px); }
    .page { padding-top: 28px; }
    .panel { padding: 20px; }
    .form-grid, .details { grid-template-columns: 1fr; }
    .form-actions { flex-wrap: wrap; }
    .account { width: 100%; margin: 0; justify-content: space-between; }
}

.tax-allocation-form { grid-column: 1 / -1; border: 1px solid var(--line); padding: 16px; }
.tax-allocation-form [data-tax-allocation-row] { margin-bottom: 16px; }
