/* Fachseiten des Backends: gleiche Komponenten, echte bestehende Formulare. */
.backend-shell .content { max-width: 1600px; width: 100%; margin-inline: auto; }
.backend-shell .backend-page-heading { margin-bottom: 1.5rem; }
.backend-shell .backend-page-heading :is(h1,h2) { margin: 0; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.035em; overflow-wrap: anywhere; hyphens: auto; }
.backend-shell .backend-page-heading p { margin: .6rem 0 0; color: var(--muted-text); max-width: 75ch; font-size: .9375rem; line-height: 1.5; }
.backend-shell .content > h3 { margin: 1.5rem 0 1rem; font-size: 1rem; }
.backend-shell :is(button,.button-link,summary) { min-height: 2.75rem; }
.backend-shell :is(button,.button-link) { font-family: inherit; font-size: .875rem; line-height: 1.4; padding: .65rem .9rem; border-radius: .5rem; }
.backend-shell button { font-weight: 600; }
.backend-shell button:disabled { cursor: default; opacity: .55; }
.backend-shell .button-link { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.backend-shell :is(input,select,textarea) { font-family: inherit; font-size: 1rem; min-width: 0; max-width: 100%; }
.backend-shell :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),select,textarea):not(.dx-texteditor-input) {
    min-height: 2.75rem; border: 1px solid var(--field-border); border-radius: .5rem; background: var(--field-bg); color: var(--field-text); padding: .55rem .65rem;
}
.backend-shell :is(input[type="checkbox"],input[type="radio"]) { accent-color: var(--primary); width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.backend-shell .inline-check { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; white-space: normal; font-size: .875rem; }
.backend-shell .inline-check input { margin: 0; }
.backend-shell .backend-field { display: flex; flex-direction: column; gap: .4rem; flex: 1 1 10rem; min-width: 0; }
.backend-shell .backend-field > label,.backend-shell .backend-input-label { font-size: .8125rem; font-weight: 600; color: var(--app-text); }
.backend-shell .backend-field :is(input,select,textarea) { width: 100%; }
.backend-shell .backend-field > .dx-select-host { min-width: 0; max-width: 100%; }
.backend-shell .backend-field:has(> .dx-select-host) { flex-basis: 20rem; }
.backend-shell.backend-editor-open { overflow: hidden; }
.backend-shell .backend-secondary { background: var(--panel-bg); color: var(--app-text); border: 1px solid var(--panel-border); }
.backend-shell .backend-secondary:hover { background: var(--panel-soft-bg); }
.backend-shell .backend-danger { color: #a32232; background: var(--panel-bg); border: 1px solid #d994a1; }
.backend-shell .backend-danger:hover { background: #fff0f2; }
.backend-shell .form-inline { display: flex; gap: .9rem; flex-wrap: wrap; align-items: flex-end; margin: 1rem 0; padding: 1.25rem; border: 1px solid var(--panel-border); background: var(--panel-bg); border-radius: .75rem; }
.backend-shell .row-editor { gap: .75rem; flex-wrap: wrap; }
.backend-shell .row-editor:not(.benutzer-edit-form) { align-items: flex-end; }
.backend-shell .row-editor > :is(input,select,textarea) { width: min(100%,22rem); }
.backend-shell .detail-box { background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: .75rem; box-shadow: none; padding: 1.25rem; margin-top: 1rem; }
.backend-shell :is(.hint-box,.error,.success) { border-radius: .5rem; padding: .9rem 1rem; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.backend-shell details.hint-box { padding: 0; }
.backend-shell details.hint-box > summary { padding: .75rem 1rem; }
.backend-shell .settings-accordion { border: 1px solid var(--panel-border); background: var(--panel-bg); border-radius: .75rem; margin-bottom: 1rem; overflow: hidden; }
.backend-shell .settings-accordion > summary { padding: 1rem 1.25rem; font-weight: 600; background: var(--panel-bg); }
.backend-shell .settings-panel { padding: 1rem 1.25rem; }
.backend-shell .backend-panel-launcher { display: flex; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; text-align: left; margin: .75rem 0; padding: 1.15rem 1.25rem; color: var(--app-text); background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: .75rem; }
.backend-panel-chevron { color: var(--primary); font-size: .8125rem; white-space: nowrap; font-weight: 600; }
.backend-shell .backend-panel-fields { display: grid; gap: 1rem; }
.backend-shell .backend-panel-fields .row-editor { display: flex; }
.backend-shell .backend-panel-fields > :is(input,select,textarea) { width: 100%; }
.backend-shell .backend-editor-dialog {
    margin: auto 0 0; padding: 0; border: 0; border-radius: 1rem 1rem 0 0;
    width: 100%; max-width: 100%; max-height: 94dvh; overflow-y: auto; overflow-x: hidden;
    color: var(--app-text); background: var(--panel-bg); box-shadow: 0 1rem 4rem #18203030;
}
.backend-editor-dialog::backdrop { background: #18202b66; }
.backend-shell .backend-editor-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--panel-bg); border-bottom: 1px solid var(--panel-border); }
.backend-shell .backend-editor-head h2 { margin: 0; font-size: 1.2rem; line-height: 1.3; }
.backend-shell .backend-editor-head button { flex-shrink: 0; }
.backend-shell .backend-editor-content { padding: 1.25rem; }
.backend-shell .backend-editor-content > .muted:first-child { margin-top: 0; margin-bottom: 1.5rem; }
.backend-shell .backend-editor-content .settings-panel { padding: 0; }
.backend-shell .backend-editor-content .form-inline { padding: 0; border: 0; margin: 0 0 1.5rem; }
.backend-shell .backend-editor-content .form-inline .backend-field { flex-basis: 100%; }
.backend-shell .backend-editor-content > .backend-panel-fields .row-editor { gap: 1rem; }
.backend-shell .backend-editor-content > .backend-panel-fields > form { width: 100%; }
.backend-shell .backend-editor-content .row-editor:not(.benutzer-edit-form) > :is(input,select,textarea) { width: 100%; }
.backend-shell .backend-editor-foot { position: sticky; bottom: 0; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); background: var(--panel-bg); border-top: 1px solid var(--panel-border); display: flex; gap: .75rem; justify-content: flex-end; }
.backend-shell .backend-editor-dialog .backend-panel-fields > .row-editor { display: grid; }
.backend-shell .backend-editor-dialog .benutzer-body { padding: 0; }
.backend-shell .backend-user-metadata { font-size: .875rem; color: var(--muted-text); line-height: 1.7; padding-bottom: 1rem; border-bottom: 1px solid var(--panel-border); }
.backend-shell .backend-table-scroll,.backend-shell .matrix-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--panel-border); border-radius: .75rem; margin: 1rem 0; background: var(--panel-bg); }
.backend-shell .backend-table-scroll .data-table { margin: 0; border: 0; }
.backend-shell .data-table { font-size: .875rem; }
.backend-shell .data-table :is(th,td) { padding: .9rem 1rem; border-color: var(--panel-border); overflow-wrap: anywhere; }
.backend-shell .data-table th { font-size: .8125rem; font-weight: 600; }
.backend-shell .data-table td { line-height: 1.5; }
.backend-shell .data-table td > .button-link { margin: .25rem .25rem .25rem 0; }
.backend-shell .data-table .backend-secondary { margin: .25rem 0; }
.backend-shell .data-table td .muted { font-size: .8125rem; }
.backend-shell .data-table .backend-input-label { display: block; margin: .4rem 0; }
.backend-shell .backend-page-hidden { display: none !important; }
.backend-shell .backend-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .75rem; margin: 1rem 0 1.5rem; padding: 1rem 0; border-top: 1px solid var(--panel-border); font-size: .8125rem; }
.backend-pager > span { margin-right: auto; }
.backend-pager label { display: inline-flex; align-items: center; gap: .5rem; }
.backend-shell .backend-pager select { width: auto; }
.backend-shell .backend-tabs { display: flex; gap: .5rem; border-bottom: 1px solid var(--panel-border); margin: 1.5rem 0 0; }
.backend-shell .backend-tabs button { color: var(--muted-text); border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; padding: .75rem 1rem; }
.backend-shell .backend-tabs [aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.backend-shell .dx-grid-host { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; margin-bottom: 1.5rem; background: var(--panel-bg); }
.backend-shell .dx-grid-host .dx-datagrid { max-width: 100%; }
.backend-shell .dx-widget { font-family: inherit; }
html[data-theme="sunshine"] .backend-shell .dx-widget { --dx-color-primary: #af0751; }
.backend-shell .dx-texteditor-input { min-height: 2.65rem; font-size: 1rem; }
.backend-shell .dx-select-host { min-width: 0; max-width: 100%; }
.backend-shell .dx-form { width: 100%; }
.backend-shell .dx-pager :is(.dx-page,.dx-page-size).dx-selection { background: var(--primary); color: #fff; }
.backend-shell .dx-checkbox-checked .dx-checkbox-icon { background: var(--primary); border-color: var(--primary); color: #fff; }
.backend-shell .benutzer-accordion { display: grid; gap: 0; border: 1px solid var(--panel-border); border-radius: .75rem; overflow: hidden; background: var(--panel-bg); }
.backend-shell .benutzer-item { border: 0; border-bottom: 1px solid var(--panel-border); border-radius: 0; background: var(--panel-bg); }
.backend-shell .benutzer-item:last-child { border-bottom: 0; }
.backend-shell .benutzer-summary { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .75rem; align-items: center; background: transparent; padding: 1.1rem 1.25rem; list-style: none; }
.backend-shell .benutzer-summary::-webkit-details-marker { display: none; }
.backend-shell .benutzer-main { display: flex; flex-wrap: wrap; gap: .25rem .5rem; min-width: 0; overflow-wrap: anywhere; }
.backend-shell .benutzer-meta { display: none; }
.backend-shell .search-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0 1.5rem; }
.backend-shell .search-inline .backend-field { flex: 0 1 36rem; }
.backend-shell .search-inline input { flex: none; width: 100%; }
.backend-shell .benutzer-edit-form { display: block; width: 100%; }
.backend-shell .benutzer-edit-form > button { margin-top: 1.5rem; }
.backend-shell .dashboard-hero { background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 1.5rem; }
.backend-shell .dashboard-hero h3 { font-size: 1rem; }
.backend-shell .dashboard-hero p { margin-bottom: 0; }
.backend-shell .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; overflow: hidden; border: 1px solid var(--panel-border); border-radius: .75rem; background: var(--panel-bg); margin-bottom: 1.5rem; }
.backend-shell .stats-grid article { border: 0; border-right: 1px solid var(--panel-border); border-bottom: 1px solid var(--panel-border); border-radius: 0; background: transparent; box-shadow: none; min-width: 0; padding: 1.1rem; }
.backend-shell .stats-grid h3 { font-size: .8125rem; font-weight: 500; color: var(--muted-text); }
.backend-shell .stats-grid strong { font-size: 1.8rem; color: var(--app-text); }
.backend-shell .stats-grid a { text-decoration: none; }
.backend-shell .backend-system-metrics { border: 1px solid var(--panel-border); border-radius: .75rem; background: var(--panel-bg); margin: 1.5rem 0; }
.backend-shell .backend-system-metrics > summary { padding: 1rem 1.25rem; font-weight: 600; }
.backend-shell .backend-system-metrics .stats-grid { margin: 0 1rem 1rem; }
.backend-shell .backend-system-metrics .stats-grid strong { font-size: 1.25rem; overflow-wrap: anywhere; }
.backend-shell .kunden-status-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.backend-shell .kunden-status-card { border: 0; border-top: 1px solid var(--panel-border); border-radius: 0; background: transparent; box-shadow: none; padding: 1.25rem 0; }
.backend-shell .kunden-status-meta { font-size: .8125rem; }
.backend-shell .kunden-status-card .muted { font-size: .875rem; }
.backend-shell .dashboard-progress { max-width: 18rem; }
.backend-shell .summary-grid { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.backend-shell .summary-card { flex: 1 1 8.5rem; min-width: 0; border: 1px solid var(--panel-border); border-radius: .65rem; background: var(--panel-bg); padding: .85rem 1rem; box-shadow: none; }
.backend-shell .summary-value { font-size: 1.65rem; color: var(--app-text); }
.backend-shell .summary-card.is-active { border-color: var(--primary); background: var(--accent-soft-bg); }
.backend-shell .summary-card-filter::after { content: none; }
.backend-shell .summary-label,.backend-shell .summary-filter-hint { font-size: .8125rem; }
.backend-shell .table-toolbar-structured { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; background: var(--panel-bg); border: 1px solid var(--panel-border); padding: 1.25rem; border-radius: .75rem; }
.backend-shell .table-toolbar-structured .toolbar-panel { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.backend-shell .table-toolbar-structured .toolbar-panel-filter { flex: 3 1 25rem; }
.backend-shell .table-toolbar-structured .toolbar-panel-actions { flex: 1 1 12rem; }
.backend-shell .table-toolbar-structured .toolbar-left { gap: .75rem; align-items: flex-end; }
.backend-shell .toolbar-panel-options { width: 100%; }
.backend-shell .backend-editor-dialog .toolbar-panel-options { padding: 0; border: 0; box-shadow: none; }
.backend-shell .backend-editor-dialog .toolbar-right { flex-direction: column; align-items: stretch; gap: .75rem; }
.backend-shell .backend-editor-dialog .toolbar-advanced { border: 0; }
.backend-shell .backend-editor-dialog .toolbar-advanced > div { padding: 0; }
.backend-shell .detail-day-card { margin: 0; border: 0; border-bottom: 1px solid var(--panel-border); border-radius: 0; box-shadow: none; background: var(--panel-bg); padding: 1.25rem; cursor: default; }
.backend-shell .detail-day-card.is-processed { background: var(--status-done-panel-bg); }
.backend-shell .detail-day-header { gap: 1rem; flex-wrap: wrap; }
.backend-shell .detail-day-header h3 { font-size: 1rem; }
.backend-shell .detail-day-card .detail-line-card { background: transparent; box-shadow: none; border: 0; padding: .75rem 0; }
.backend-shell .detail-menu-text,.backend-shell .menue-text,.backend-shell .meal-text,.backend-shell .detail-line-card { font-size: 1rem; line-height: 1.55; }
.backend-shell .compact-line { font-size: .9375rem; line-height: 1.55; }
.backend-shell .segment-klammer { font-size: .875em; }
.backend-shell .segment-klammer-bio { color: #17643c; font-weight: 600; }
.backend-shell .detail-line-grid { gap: 1.25rem; }
.backend-shell .detail-edit-option { grid-template-columns: 1.25rem 2rem minmax(0,1fr); padding: 1rem; align-items: start; }
.backend-shell .detail-edit-option-text { font-size: 1rem; line-height: 1.55; }
.backend-shell .backend-day-editor .detail-drawer { position: static; width: 100%; max-width: none; height: auto; box-shadow: none; background: var(--panel-bg); padding: 0; overflow: visible; }
.backend-shell .backend-day-editor .detail-drawer-head { position: sticky; top: 0; z-index: 5; padding: 1rem 1.25rem; background: var(--panel-bg); border-bottom: 1px solid var(--panel-border); }
.backend-shell .backend-day-editor .detail-drawer-body { padding: 1.25rem; overflow: visible; }
.backend-shell .backend-day-editor .detail-action-row { position: sticky; bottom: -1.25rem; background: var(--panel-bg); padding: 1rem 0; }
.backend-shell .detail-save-hint { color: var(--muted-text); font-size: .8125rem; }
.backend-shell .settings-grid { grid-template-columns: minmax(0,1fr); gap: 1rem; }
.backend-shell .settings-field { min-width: 0; }
.backend-shell .settings-field :is(input,textarea,select) { width: 100%; }
.backend-shell .settings-field span { font-size: .8125rem; }
.backend-shell .settings-checks { display: grid; gap: .5rem; }
.backend-shell .settings-checks label { justify-content: flex-start; }
.backend-shell .notification-settings-form > .settings-actions { position: sticky; bottom: 0; padding: 1rem; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: .75rem; }
.backend-shell .week-table { min-width: 48rem; }
.backend-shell .day-stack { gap: 1.5rem; }
.backend-shell .data-table .week-cell { line-height: 1.5; }
.backend-shell code { overflow-wrap: anywhere; }
.backend-shell.backend-login { min-height: 100dvh; display: grid; align-content: center; padding: 1.5rem; }
.backend-login .login-card { width: min(100%,28rem); margin: auto; padding: 2rem; border: 1px solid var(--panel-border); border-radius: 1rem; background: var(--panel-bg); box-shadow: 0 .75rem 2.5rem #1820300c; }
.backend-login .login-card h1 { font-size: 1.75rem; letter-spacing: -.035em; margin: 1rem 0 .5rem; }
.backend-login .login-card p { color: var(--muted-text); line-height: 1.5; }
.backend-login .login-card form { display: grid; gap: .6rem; margin-top: 1.5rem; }
.backend-login .login-card label { font-size: .875rem; font-weight: 600; }
.backend-login .login-card input { width: 100%; }
.backend-login .login-card button { margin-top: 1rem; }
.backend-login-logo { width: 9rem; height: 4rem; object-fit: contain; object-position: left center; }
@media (max-width: 700px) {
    .backend-shell .summary-card { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem .8rem; }
    .backend-shell .summary-value { font-size: 1.25rem; margin: 0; }
    .backend-shell .summary-label { font-size: .75rem; }
    .backend-shell .backend-responsive-table,.backend-shell .backend-responsive-table tbody { display: block; width: 100%; }
    .backend-shell .backend-responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; }
    .backend-shell .backend-responsive-table tbody > tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding: 1rem; gap: .8rem 1rem; border-bottom: 1px solid var(--panel-border); background: var(--panel-bg); }
    .backend-shell .backend-responsive-table td { display: block; min-width: 0; padding: 0; border: 0; position: static; white-space: normal; background: transparent; }
    .backend-shell .backend-responsive-table td:first-child,.backend-shell .backend-responsive-table td:last-child { grid-column: 1 / -1; }
    .backend-shell .backend-responsive-table td::before { content: attr(data-column-label); display: block; color: var(--muted-text); font-size: .75rem; font-weight: 500; margin-bottom: .25rem; }
    .backend-shell .backend-responsive-table td[colspan] { grid-column: 1 / -1; }
    .backend-shell .benutzer-summary { grid-template-columns: minmax(0,1fr); }
    .backend-shell .benutzer-summary button { justify-self: start; }
    .backend-shell .form-inline > :is(button,.button-link) { flex: 1 1 8rem; }
    .backend-shell .backend-editor-dialog .settings-grid { grid-template-columns: minmax(0,1fr); }
    .backend-shell .dx-grid-host .dx-datagrid-search-panel { max-width: 100%; }
    .backend-shell .detail-day-card { padding: 1rem; }
}
@media (min-width: 701px) {
    .backend-shell .stats-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .backend-shell .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .backend-shell .kunden-status-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .35rem 1.5rem; }
    .backend-shell .kunden-status-card > .kunden-status-head { grid-column: 1 / -1; }
    .backend-shell .kunden-status-card > .mt-2:last-child { grid-column: 2; grid-row: 2 / span 3; align-self: center; }
}
@media (min-width: 901px) {
    .backend-shell .backend-editor-dialog { width: min(44rem,85vw); height: 100dvh; max-height: 100dvh; max-width: 85vw; margin: 0 0 0 auto; border-radius: 0; }
    .backend-shell .backend-editor-dialog .backend-editor-content { padding: 1.5rem; }
    .backend-shell .backend-editor-dialog .benutzer-edit-dxform,.backend-shell .backend-editor-dialog #benutzerCreateDxForm { max-width: 100%; }
}
@media print {
    .backend-shell .backend-topbar,.backend-shell .backend-nav-dock,.backend-shell .backend-pager { display: none; }
    .backend-shell .shell { display: block; }
    .backend-shell .backend-page-hidden { display: revert !important; }
}
