/* Shared data tables and status presentation. Domain-specific controls keep
   their existing behaviour; colour never replaces a written status. */
.status-badge { display:inline-block; max-width:100%; padding:var(--space-1) var(--space-2); border-radius:var(--radius-control); font-size:var(--font-small); font-weight:var(--weight-semibold); line-height:1.5; white-space:normal; vertical-align:baseline; color:var(--color-status-neutral); background:var(--color-status-neutral-bg); }
.status-badge[data-status-tone="success"] { color:var(--color-status-success); background:var(--color-status-success-bg); }
.status-badge[data-status-tone="warning"] { color:var(--color-status-warning); background:var(--color-status-warning-bg); }
.status-badge[data-status-tone="danger"] { color:var(--color-status-danger); background:var(--color-status-danger-bg); }
.status-badge[data-status-tone="info"] { color:var(--color-status-info); background:var(--color-status-info-bg); }
.status-badge[data-status-tone="neutral"] { color:var(--color-status-neutral); background:var(--color-status-neutral-bg); }
.status-badge[hidden],.status-badge:empty { display:none; }
.table-scroll,.table-wrap { max-width:100%; min-width:0; }
table.detail-table { display:table; width:100%; min-width:0; margin:0; border-collapse:collapse; table-layout:fixed; }
table.detail-table tbody { display:table-row-group; }
table.detail-table tr { display:table-row; }
table.detail-table[hidden],table.detail-table [hidden] { display:none; }
table.detail-table th,table.detail-table td { display:table-cell; padding:var(--space-2) var(--space-2); border-bottom:1px solid var(--color-border); text-align:left; vertical-align:top; white-space:normal; overflow-wrap:anywhere; }
table.detail-table th { width:34%; background:var(--color-surface-alt,var(--color-surface-subtle)); font-weight:var(--weight-medium); color:var(--color-muted); }
table.detail-table td { width:66%; }
table.detail-table tr:last-child > * { border-bottom:0; }
table.detail-table td.numeric { text-align:right; font-variant-numeric:tabular-nums; }
table.data-table { width:100%; border-collapse:collapse; }
.data-table th,.data-table td { padding:var(--space-2) var(--space-2); vertical-align:top; }
.data-table th { background:var(--color-surface-alt,var(--color-surface-subtle)); font-weight:var(--weight-semibold); }
.data-table .actions-cell { text-align:right; white-space:nowrap; }
.table-scroll td.empty,.table-wrap td.empty { text-align:left; padding:var(--space-4) var(--space-2); color:var(--color-muted); }
.contact-table { min-width:520px; }
.unit-choice-table { min-width:560px; }
.unit-choice-table .unit-choice-name { padding-left:var(--space-8); }
.unit-choice-table .unit-choice-group th { background:var(--color-surface-alt,var(--color-surface-subtle)); }
.unit-choice-table input[type="checkbox"] { width:18px; height:18px; vertical-align:middle; }
.unit-choice-table label { margin:0; cursor:pointer; }
.form-grid .field:has([data-unit-choice-table]) { grid-column:1 / -1; }
@media(max-width:600px) { table.detail-table th { width:42%; } table.detail-table td { width:58%; } table.detail-table th,table.detail-table td { padding:var(--space-2); } }
@media print { .status-badge { border:1px solid currentColor; } }
.notification-setting:has(input:checked) .notification-state-off,
.notification-setting:not(:has(input:checked)) .notification-state-on { display:none; }
.notification-setting label { margin:0; display:inline; }

.task-table a { display:inline; padding:0; }
[data-unit-choice-table] > details { margin:var(--space-2) 0; min-width:0; }
.page-heading > h1:has(+ .help-component),
.panel > h2:has(+ .help-component),
.nk-stweg-control > h2:has(+ .help-component),
.panel > h3:has(+ .help-component) { display:inline-block; vertical-align:middle; margin-right:var(--space-1); }
