* { box-sizing: border-box; }
:root {
    --portal-header-height: 60px;
    /* Table density (design rule in docs/ui-design.md): compact grid like Proxmox VE. Change it here only. */
    --table-font-size: 13px; --table-head-font-size: 12px; --table-pad-y: 3px; --table-pad-x: 8px;
    --table-line: #e5e9ef; --table-head-bg: #f1f4f7; --table-head-line: #cbd5e1; --table-head-color: #475569; --table-hover: #eef5fc;
}
html[data-theme=dark] { --table-line: #334155; --table-head-bg: #0f172a; --table-head-line: #475569; --table-head-color: #94a3b8; --table-hover: #26364f; }
body { margin: 0; font: 14px/1.4 system-ui, sans-serif; color: #1e293b; background: #f1f5f9; }
button, input, select, textarea { font: inherit; }
.hidden { display: none; }

.toast-container { position: fixed; top: 16px; right: 18px; z-index: 10000; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid #cbd5e1; border-left: 5px solid #3b82f6; border-radius: 8px; background: #fff; color: #1e293b; box-shadow: 0 8px 28px #0003; font-size: 14px; line-height: 1.5; pointer-events: auto; animation: toast-in .18s ease-out; }
.toast.success { border-left-color: #16a34a; }
.toast.error { border-left-color: #dc2626; }
.toast.info { border-left-color: #2563eb; }
.toast-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.toast-close { flex: 0 0 auto; border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: .7; }
.toast-close:hover { opacity: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.login { max-width: 340px; margin: 12vh auto; padding: 24px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px #0002; }
.login h1 { margin: 0 0 16px; font-size: 20px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.login-brand img { width: 44px; height: 44px; flex: 0 0 44px; }
.login-brand h1 { margin: 0; font-size: 20px; }
.login-brand p { margin: 2px 0 0; color: #64748b; font-size: 12px; }
.login-portal { margin: 0 0 18px; color: #64748b; font-size: 12px; }
html[data-theme=dark] .login-brand p, html[data-theme=dark] .login-portal { color: #94a3b8; }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: #0f172a; color: #cbd5e1; padding: 12px 0; }
.side h1 { margin: 0 16px 12px; font-size: 16px; color: #fff; }
.side .group { margin: 14px 16px 4px; font-size: 11px; text-transform: uppercase; color: #64748b; }
.side a { display: block; padding: 6px 16px; color: inherit; text-decoration: none; cursor: pointer; }
.side a:hover { background: #1e293b; }
.side a.active { background: #2563eb; color: #fff; }

.main { padding: 16px 24px; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.top h2 { margin: 0; }
.worker-status-widget { position: relative; margin-left: auto; margin-right: auto; }
.worker-status-button { padding: 7px 12px; border: 1px solid #cbd5e1; border-radius: 6px; background: #fff; color: #334155; cursor: pointer; white-space: nowrap; }
.worker-status-button.is-running { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; }
.worker-status-button.has-pending { border-color: #eab308; background: #fefce8; color: #854d0e; }
.worker-status-button.is-idle { border-color: #86efac; background: #f0fdf4; color: #166534; }
.worker-status-popover { position: absolute; z-index: 20; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(440px, 85vw); max-height: 60vh; overflow: auto; padding: 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1e293b; box-shadow: 0 8px 28px #0003; }
.worker-current-task { margin: 0 0 10px; font-weight: 600; }
.worker-active-heading { margin: 8px 0 10px; }
.worker-active-list { margin: 6px 0 12px; padding-left: 20px; display: grid; gap: 7px; }
.worker-active-list li { overflow-wrap: anywhere; }
.worker-dashboard-panel { margin-bottom: 18px; }
.worker-dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.worker-dashboard-heading h3 { margin: 0; }
.worker-dashboard-state { padding: 4px 8px; border-radius: 999px; background: #f0fdf4; color: #166534; font-size: 12px; font-weight: 700; }
.worker-dashboard-state.is-running { background: #eff6ff; color: #1d4ed8; }
.worker-dashboard-state.has-pending { background: #fefce8; color: #854d0e; }
.worker-dashboard-list { display: grid; gap: 8px; }
.worker-dashboard-task { display: grid; gap: 3px; padding: 8px 10px; border-left: 3px solid #3b82f6; background: #f8fafc; }
.worker-pending-heading { margin-top: 8px; font-size: 12px; font-weight: 700; color: #64748b; }
.worker-pending-list { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 7px; }
.worker-pending-list li { overflow-wrap: anywhere; }
.worker-pending-reason { display: block; margin-top: 3px; }
.worker-update-due { display: block; color: #64748b; font-size: 12px; }
.bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

.btn { padding: 6px 12px; border: 1px solid #cbd5e1; background: #fff; border-radius: 4px; cursor: pointer; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn.danger { color: #b91c1c; border-color: #fecaca; }
.btn.small { padding: 2px 8px; font-size: 12px; }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
    width: 100%; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff;
}
.bar input[type=search] { width: 260px; }
textarea { min-height: 90px; font-family: ui-monospace, monospace; }

.tablewrap { overflow-x: auto; background: #fff; border-radius: 4px; box-shadow: 0 1px 2px #0001; }
table { border-collapse: collapse; width: 100%; font-size: var(--table-font-size); line-height: 1.35; }
th, td { padding: var(--table-pad-y) var(--table-pad-x); text-align: left; border-bottom: 1px solid var(--table-line); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
th { background: var(--table-head-bg); color: var(--table-head-color); font-size: var(--table-head-font-size); font-weight: 600; border-bottom-color: var(--table-head-line); }
thead th + th { border-left: 1px solid var(--table-line); }
tbody tr:hover > td { background: var(--table-hover); }
/* Controls inside table cells stay as low as the row. */
td .btn, td .btn.small { padding: 0 7px; font-size: 12px; line-height: 18px; }
td input:not([type]), td input[type=text], td input[type=email], td input[type=password], td input[type=search], td input[type=number], td input[type=date], td select { padding: 2px 6px; }
td .badge { padding: 0 6px; font-size: 11px; line-height: 17px; }
td .actions { gap: 4px; }
.actions { display: flex; gap: 4px; }
.system-errors-panel { margin-bottom: 16px; }
.system-errors-panel.has-format-warning { border: 1px solid #eab308; box-shadow: 0 0 0 2px #eab30833; }
.system-errors-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.system-errors-heading h3 { margin: 0; }
.system-errors-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.system-error-item { padding: 10px 12px; border: 1px solid #e2e8f0; border-left: 4px solid #ef4444; border-radius: 6px; min-width: 0; }
.system-error-item.severity-warning { border-left-color: #eab308; }
.system-error-item.severity-info { border-left-color: #3b82f6; }
.system-error-item.resolved { opacity: .75; border-left-color: #94a3b8; }
.system-error-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 5px; }
.system-error-actions { flex-wrap: wrap; justify-content: flex-end; }
.system-error-status { margin: 6px 0 0; color: #64748b; font-size: 12px; }
.system-error-meta { color: #64748b; font-size: 12px; }
.system-error-item strong { display: block; overflow-wrap: anywhere; }
.system-error-item details { margin-top: 8px; }
.system-error-item pre { max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.45 ui-monospace, Consolas, monospace; }
.error-search input[type=search] { width: min(420px, 100%); }
.error-resolved-toggle { display: inline-flex; gap: 6px; align-items: center; }
.error-resolved-toggle input { width: auto; }
.error-result-count { margin: 4px 0 12px; }
.dns-zone-invalid td { background: #fffbeb; }
.dns-zone-invalid td:first-child { box-shadow: inset 3px 0 #eab308; }
.quota-unknown { color: #64748b; }
.quota-exceeded { display: inline-block; padding: 2px 6px; border: 1px solid #b91c1c; border-radius: 4px; background: #fee2e2; color: #991b1b; font-weight: 700; }
.quota-suspension-notice { margin: 0 0 16px; border: 1px solid #f59e0b; background: #fffbeb; }
.quota-suspension-notice p { margin: 6px 0 0; }
.quota-suspension { max-width: 260px; white-space: normal; }
html[data-theme=dark] .quota-unknown { color: #cbd5e1; }
html[data-theme=dark] .quota-exceeded { background: #7f1d1d; color: #fff; border-color: #fca5a5; }
html[data-theme=dark] .quota-suspension-notice { background: #422006; border-color: #a16207; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #e2e8f0; }
.badge.healthy { background: #bbf7d0; color: #166534; }
.badge.starting { background: #fef08a; color: #854d0e; }
.badge.error { background: #fecaca; color: #991b1b; }
.badge.off { background: #cbd5e1; color: #334155; }
.badge.warning { background: #fed7aa; color: #9a3412; }
.badge.yes { background: #bbf7d0; color: #166534; }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.msg { padding: 8px 12px; border-radius: 4px; margin-bottom: 10px; background: #fecaca; color: #7f1d1d; }
.msg.ok { background: #bbf7d0; color: #14532d; }
.view-as-label { padding: .3rem .6rem; border-radius: .3rem; background: #fef3c7; color: #78350f; font-weight: 700; min-width: 0; max-width: min(320px, 40vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lock-indicator { font-size: 1.15em; font-weight: 700; }
.lock-indicator.locked { color: #b91c1c; }
.lock-indicator.unlocked { color: #15803d; }
html[data-theme=dark] .lock-indicator.locked { color: #fca5a5; }
html[data-theme=dark] .lock-indicator.unlocked { color: #86efac; }
.admin-action-dropdown { position: fixed; inset: auto; margin: 0; padding: 6px; border: 1px solid; border-radius: 6px; box-shadow: 0 4px 12px #0003; max-height: 45vh; overflow: auto; }
.admin-action-dropdown:popover-open { display: grid; gap: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.card { background: #fff; padding: 14px; border-radius: 6px; box-shadow: 0 1px 3px #0001; }
.card .n { font-size: 26px; font-weight: 700; }
.card .l { color: #64748b; }

dialog { border: 0; border-radius: 8px; padding: 20px; width: min(640px, 94vw); box-shadow: 0 10px 40px #0005; }
dialog::backdrop { background: #0006; }
.cron-dialog { width: min(1050px, 96vw); max-height: 92vh; overflow: auto; }
.cron-output { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 500px; max-height: 250px; overflow: auto; }
dialog h3 { margin-top: 0; }
.record-dialog { max-height: 92dvh; overflow: auto; }
.record-dialog.has-json { width: min(900px, 96vw); }
.record-dialog > .dlgbtns { position: sticky; bottom: -20px; padding: 12px 0; background: inherit; }
.product-attributes-section { margin: 4px 0 14px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; }
.product-attributes-section h4 { margin: 0 0 6px; }
.product-attributes-section > .hint { margin: 0 0 10px; }
.product-attribute-list { display: grid; gap: 8px; margin-bottom: 10px; }
.product-attribute-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px; border: 1px solid #e2e8f0; border-radius: 5px; }
.product-attribute-field { min-width: 0; }
.product-attribute-field label { display: block; font-weight: 600; margin-bottom: 3px; }
.product-attribute-field label input, .product-attribute-field label select { margin-top: 3px; font-weight: 400; }
.product-attribute-description, .product-attribute-key { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.product-attribute-remove { margin-top: 23px; }
.product-attribute-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.product-attribute-add select { flex: 1 1 220px; }
.product-attribute-json, .product-attribute-create { margin-top: 12px; }
.product-attribute-json summary, .product-attribute-create summary { cursor: pointer; font-weight: 600; }
.product-attribute-json > .hint { margin: 8px 0; }
.product-attribute-create .field { margin-top: 10px; }
.product-attribute-create input, .product-attribute-create select { margin-top: 3px; font-weight: 400; }
.product-attribute-create textarea { min-height: 65px; margin-top: 3px; }
html[data-theme=dark] .product-attributes-section { border-color: #475569; }
html[data-theme=dark] .product-attribute-row { border-color: #475569; }
.json-editor { min-width: 0; }
.json-toolbar, .json-dialog-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.json-status { flex: 1 1 220px; font-size: 12px; color: #64748b; overflow-wrap: anywhere; }
.json-status.json-invalid { color: #dc2626; }
.json-area { display: block; line-height: 1.55; tab-size: 2; resize: vertical; }
.json-area[aria-invalid=true] { border-color: #dc2626; }
.json-code-tools { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.json-code-tools.hidden { display: none; }
.json-dialog { width: min(1120px, 96vw); height: min(820px, 90dvh); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); min-width: min(360px, calc(100vw - 24px)); min-height: min(420px, 85dvh); padding: 0; resize: both; overflow: auto; }
.json-dialog-layout { height: 100%; display: flex; flex-direction: column; padding: 20px; gap: 12px; }
.json-dialog-heading { flex-shrink: 0; margin: 0; }
.json-dialog-heading h3 { flex: 1; margin: 0; overflow-wrap: anywhere; }
.json-dialog-layout > .hint { margin: 0; }
.json-dialog-layout > .json-editor { flex: 1; min-height: 120px; display: flex; flex-direction: column; }
.json-dialog .json-area { flex: 1; min-height: 100px; resize: none; }
.json-dialog .dlgbtns { margin-top: 0; flex-wrap: wrap; }
.json-dialog.json-fullscreen { width: calc(100vw - 24px); height: calc(100dvh - 24px); }
html[data-theme=dark] .json-status { color: #94a3b8; }
html[data-theme=dark] .json-status.json-invalid { color: #fca5a5; }
.dns-dialog { width: min(1320px, 96vw); max-height: 92vh; overflow: hidden; padding: clamp(20px, 3vw, 34px); }
.dns-dialog[open] { display: flex; flex-direction: column; }
.dns-dialog > .dns-head, .dns-dialog > .dns-dialog-actions { flex: 0 0 auto; }
.dns-dialog > .dns-content { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dns-content > .dns-tabs { flex: 0 0 auto; }
.dns-content > .dns-panel, .dns-content > .dns-empty, .dns-content > p { flex: 1 1 auto; min-height: 0; overflow: auto; }
.dns-dialog > h3 { margin-bottom: 20px; font-size: 22px; }
.dns-section { padding: 22px; margin-bottom: 20px; }
.dns-section h3 { font-size: 17px; margin-bottom: 14px; }
.dns-section .hint { margin-bottom: 16px; line-height: 1.6; }
.dns-section .field { margin-bottom: 16px; }
.dns-section .field label { margin-bottom: 7px; }
.dns-section input:not([type=checkbox]), .dns-section select { min-height: 42px; }
.webspace-targets { display: grid; gap: 16px; }
.webspace-target { padding: 14px 0; border-top: 1px solid #cbd5e1; }
.webspace-target-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.webspace-target-fields label { display: grid; gap: 6px; font-weight: 600; }
.webspace-target-fields input, .webspace-target-fields select { width: 100%; min-width: 0; font-weight: normal; }
.webspace-target .bar { margin-top: 10px; }
.webspace-targets ~ .bar .btn, .webspace-target .btn { min-height: 40px; }
@media (max-width: 760px) {
    .webspace-target-fields { grid-template-columns: 1fr; }
}
.dns-import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); gap: 16px; align-items: end; }
.dns-import-grid .field { margin-bottom: 0; }
.dns-import-buttons { display: flex; gap: 10px; align-items: center; justify-content: flex-start; margin-top: 16px; flex-wrap: wrap; }
.dns-import-buttons .btn { min-height: 40px; white-space: nowrap; }
.dns-add-record { margin-top: 14px; margin-bottom: 0; }
.dns-dyndns-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 8px; align-items: center; min-width: 260px; }
.dns-dyndns-status { display: grid; gap: 3px; min-width: 190px; white-space: normal; font-size: 12px; line-height: 1.35; cursor: pointer; border-radius: 6px; }
.dns-dyndns-status:hover, .dns-dyndns-status:focus-visible { outline: 2px solid #94a3b8; outline-offset: 3px; }
.dns-dynamic-edit-dialog { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 24px; box-shadow: 0 20px 60px #0f172a55; }
.dns-dynamic-edit-dialog::backdrop { background: #0f172a88; }
.dns-dynamic-edit-dialog h3 { margin: 0 0 12px; overflow-wrap: anywhere; }
.dns-dynamic-edit-dialog .hint { margin-bottom: 16px; }
.dns-dynamic-edit-dialog .dlgbtns { margin-top: 20px; }
.dns-validation-field { display: grid; gap: 4px; min-width: 160px; }
.dns-validation-hint { display: block; color: #b91c1c; font-size: 11px; line-height: 1.3; white-space: normal; }
.dns-section input.dns-invalid, .dns-section select.dns-invalid { border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626; }
.dns-wildcard { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12px; }
.dns-wildcard input { width: auto; }
.dns-acl-add { margin-bottom: 12px; }
.dns-acl-actions { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.dns-acl-actions .btn { min-height: 36px; }
.dns-dialog .tablewrap { margin-top: 12px; margin-bottom: 8px; }
.dns-dialog-actions { padding: 16px 0 2px; margin-top: 12px; border-top: 1px solid #cbd5e1; }
.dns-dialog-actions .btn { min-height: 42px; padding-inline: 16px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-weight: 600; margin-bottom: 3px; }
.field-invalid input, .field-invalid select, .field-invalid textarea { border-color: #dc2626; outline-color: #dc2626; }
.field-error { display: block; margin-top: 3px; color: #b91c1c; font-size: 12px; }
html[data-theme=dark] .field-error { color: #fca5a5; }
.field-error.form-error { margin: 10px 0 4px; padding: 8px 10px; border: 1px solid #fecaca; border-radius: 6px; background: #fef2f2; font-size: 13px; }
html[data-theme=dark] .field-error.form-error { border-color: #7f1d1d; background: #2a1414; }
.server-config-toggle { display: flex !important; align-items: center; gap: 8px; }
.server-config-toggle input { width: auto; }
.dlgbtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 2px 10px; background: #dbeafe; border-radius: 12px; }

.tsection { margin-bottom: 14px; }
.tsection h3 { margin: 0 0 10px; }
.hint { color: #64748b; margin-top: 0; }
.code { font-family: ui-monospace, monospace; white-space: pre; min-height: 120px; }
.code.tall { min-height: 340px; }
.filesplit { display: grid; grid-template-columns: 240px 1fr; gap: 12px; margin-top: 8px; }
.filelist { border: 1px solid #e2e8f0; border-radius: 4px; max-height: 460px; overflow: auto; }
.fileitem { display: block; padding: 6px 10px; cursor: pointer; border-bottom: 1px solid #f1f5f9; word-break: break-all; }
.fileitem:hover { background: #f1f5f9; }
.fileitem.active { background: #dbeafe; }
.row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.phbox { line-height: 2; }
.btn.ph { margin: 0 3px 0 0; font-family: ui-monospace, monospace; }

/* Syntax-Highlighting: farbige Kopie (pre) unter transparenter Textarea */
.hl { position: relative; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; }
.hl-pre, .hl textarea.hl-area {
    margin: 0; padding: 8px; border: 0; border-radius: 4px; font: 13px/1.5 ui-monospace, Consolas, monospace;
    white-space: pre; tab-size: 4; letter-spacing: 0; word-spacing: 0;
}
.hl-pre { position: absolute; inset: 0; overflow: hidden; pointer-events: none; color: #1e293b; }
.hl textarea.hl-area { position: relative; display: block; width: 100%; min-height: 140px; overflow: auto; resize: vertical; background: transparent; color: transparent; caret-color: #1e293b; }
.hl textarea.hl-area.tall { min-height: 340px; }
.hl textarea.hl-area::selection { background: #2563eb55; color: transparent; }
.tok-c { color: #6b7280; font-style: italic; }
.tok-s { color: #047857; }
.tok-k { color: #1d4ed8; }
.tok-v { color: #b45309; }
.tok-n { color: #7c3aed; }
.tok-p { color: #be185d; font-weight: 600; }

/* Darkmode */
html[data-theme=dark] { color-scheme: dark; }
html[data-theme=dark] body { color: #e2e8f0; background: #0b1220; }
html[data-theme=dark] .worker-status-button { background: #1e293b; border-color: #475569; color: #e2e8f0; }
html[data-theme=dark] .worker-status-button.is-running { background: #172554; border-color: #3b82f6; color: #bfdbfe; }
html[data-theme=dark] .worker-status-button.has-pending { background: #422006; border-color: #eab308; color: #fde68a; }
html[data-theme=dark] .worker-status-button.is-idle { background: #052e16; border-color: #22c55e; color: #bbf7d0; }
html[data-theme=dark] .worker-status-popover { background: #1e293b; color: #e2e8f0; border-color: #475569; box-shadow: 0 8px 28px #0007; }
html[data-theme=dark] .worker-pending-heading, html[data-theme=dark] .worker-update-due { color: #94a3b8; }
html[data-theme=dark] .worker-dashboard-task { background: #0f172a; }
html[data-theme=dark] .toast { background: #1e293b; color: #e2e8f0; border-color: #475569; box-shadow: 0 8px 28px #0007; }
html[data-theme=dark] .toast.success { border-left-color: #22c55e; }
html[data-theme=dark] .toast.error { border-left-color: #f87171; }
html[data-theme=dark] .toast.info { border-left-color: #60a5fa; }
html[data-theme=dark] .login, html[data-theme=dark] .card, html[data-theme=dark] .tablewrap, html[data-theme=dark] dialog { background: #1e293b; color: #e2e8f0; }
html[data-theme=dark] .btn { background: #1e293b; border-color: #475569; color: #e2e8f0; }
html[data-theme=dark] .btn:hover { background: #334155; }
html[data-theme=dark] .btn.primary { background: #2563eb; border-color: #2563eb; }
html[data-theme=dark] .btn.danger { color: #fca5a5; border-color: #7f1d1d; }
html[data-theme=dark] input:not([type]), html[data-theme=dark] input[type=text], html[data-theme=dark] input[type=email], html[data-theme=dark] input[type=password], html[data-theme=dark] input[type=search],
html[data-theme=dark] input[type=date], html[data-theme=dark] input[type=datetime-local], html[data-theme=dark] input[type=number],
html[data-theme=dark] select, html[data-theme=dark] textarea { background: #0f172a; color: #e2e8f0; border-color: #475569; }
html[data-theme=dark] .system-error-item { border-color: #475569; }
html[data-theme=dark] .system-error-item.severity-error, html[data-theme=dark] .system-error-item.severity-critical { border-left-color: #f87171; }
html[data-theme=dark] .system-error-item.severity-warning { border-left-color: #facc15; }
html[data-theme=dark] .system-error-item.resolved { border-left-color: #64748b; }
html[data-theme=dark] .system-error-meta { color: #94a3b8; }
html[data-theme=dark] .dns-zone-invalid td { background: #302813; }
html[data-theme=dark] .dns-zone-invalid td:first-child { box-shadow: inset 3px 0 #eab308; }
html[data-theme=dark] .dns-validation-hint { color: #fca5a5; }
html[data-theme=dark] .dns-section input.dns-invalid, html[data-theme=dark] .dns-section select.dns-invalid { border-color: #f87171; box-shadow: 0 0 0 1px #f87171; }
html[data-theme=dark] .badge { background: #334155; color: #e2e8f0; }
.worker-name-link { border: 0; background: transparent; color: inherit; padding: 0; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.worker-list-row { border-left: 4px solid transparent; }
.worker-list-ok { border-left-color: #22c55e; }
.worker-list-warning { border-left-color: #eab308; }
.worker-list-error { border-left-color: #ef4444; }
.worker-list-row td:nth-child(2) { max-width: none; white-space: normal; overflow-wrap: anywhere; }
.worker-name-link { text-align: left; }
.worker-status-light { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.worker-status-ok { background: #22c55e; }
.worker-status-warning { background: #eab308; }
.worker-status-error { background: #ef4444; }
.worker-service-error { margin-top: 3px; color: #b91c1c; font-size: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
html[data-theme=dark] .worker-service-error { color: #fca5a5; }
/* Inline warning box (dialogs and pages): text plus an optional action button. */
.notice { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #cbd5e1; border-left: 4px solid #3b82f6; border-radius: 6px; background: #f8fafc; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notice[hidden] { display: none; }
.confirm-options { display: grid; gap: 6px; margin: 0 0 10px; }
.confirm-option { display: flex; gap: 6px; align-items: flex-start; overflow-wrap: anywhere; }
.notice p { margin: 0; flex: 1 1 240px; }
.notice.warning { border-left-color: #f59e0b; background: #fffbeb; }
.notice.error { border-left-color: #dc2626; background: #fef2f2; }
html[data-theme=dark] .notice { background: #1e293b; border-color: #334155; }
html[data-theme=dark] .notice.warning { border-left-color: #f59e0b; }
html[data-theme=dark] .notice.error { border-left-color: #ef4444; }
.worker-detail-subtitle { color: #64748b; margin-top: -8px; }
.worker-banner { border-bottom: 1px solid #e2e8f0; padding-bottom: 10px; margin-bottom: 14px; }
.worker-banner h3 { margin-bottom: 2px; }
.worker-banner .worker-banner-fqdn { margin: 0 0 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #334155; overflow-wrap: anywhere; }
.worker-banner .worker-detail-subtitle { margin: 0; }
.worker-fqdn { display: block; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.worker-detail-tabs { margin-top: 16px; }
.worker-section-title { margin: 18px 0 8px; font-size: 0.95rem; font-weight: 800; }
.worker-system-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.worker-system-card { min-height: 82px; display: flex; flex-direction: column; gap: 5px; padding: 12px; border: 1px solid #dbe2ea; border-radius: 10px; background: #f8fafc; }
.worker-system-card span { color: #64748b; font-size: 0.78rem; }
.worker-system-card strong { font-size: 1.05rem; }
.worker-system-card small { color: #64748b; }
.worker-system-wide { grid-column: span 2; }
.worker-container-list { display: flex; flex-wrap: wrap; gap: 5px; }
.worker-container-state { border-radius: 999px; background: #e2e8f0; color: #334155 !important; padding: 3px 7px; }
.worker-container-state.running { background: #dcfce7; color: #166534 !important; }
.worker-container-state.error { background: #fee2e2; color: #991b1b !important; }
.worker-chart { margin: 8px 0; padding: 10px 12px; border: 1px solid #dbe2ea; border-radius: 10px; background: #fff; }
.worker-chart-title { display: flex; justify-content: space-between; color: #64748b; }
.worker-sparkline { width: 100%; height: 72px; }
.worker-sparkline polyline { fill: none; stroke: #2563eb; stroke-width: 3; vector-effect: non-scaling-stroke; }
.worker-usage { grid-column: span 1; padding: 12px; border: 1px solid #dbe2ea; border-radius: 10px; background: #f8fafc; }
.worker-usage-head { display: flex; justify-content: space-between; }
.worker-usage-track { height: 8px; margin: 9px 0 6px; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.worker-usage-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #eab308 70%, #ef4444); }
.worker-usage small { color: #64748b; }
.worker-log-view, .worker-terminal-output { min-height: 180px; max-height: 280px; overflow: auto; white-space: pre-wrap; border-radius: 8px; background: #0f172a; color: #dbeafe; padding: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.78rem; }
.worker-terminal-output { min-height: 120px; max-height: 220px; }
.worker-terminal-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.worker-terminal-input { width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.worker-provision-options { display: grid; gap: 8px; margin: 12px 0; }
.worker-provision-option { display: flex; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid #dbe2ea; border-radius: 8px; cursor: pointer; }
.worker-provision-option input { margin-top: 3px; }
.worker-provision-option span { display: flex; flex-direction: column; gap: 2px; }
.worker-provision-option small { color: #64748b; }
.worker-resource-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.worker-resource-card { min-height: 110px; padding: 10px 12px; border: 1px solid #dbe2ea; border-radius: 8px; background: #f8fafc; overflow: hidden; }
.worker-resource-head { display: flex; justify-content: space-between; align-items: center; }
.worker-resource-head span { font-size: 0.82rem; color: #64748b; }
.worker-resource-card > small { display: block; min-height: 17px; margin-top: 2px; color: #64748b; }
.worker-resource-chart { height: 80px; margin-top: 2px; }
.worker-resource-chart .worker-sparkline { height: 80px; }
.worker-resource-chart .worker-sparkline polyline { stroke: #3b82f6; stroke-width: 2; }
.worker-resource-chart .worker-sparkline circle { fill: #3b82f6; }
.worker-metric-memory .worker-sparkline polyline { stroke: #22c55e; }
.worker-metric-memory .worker-sparkline circle { fill: #22c55e; }
.worker-metric-disk .worker-sparkline polyline { stroke: #eab308; }
.worker-metric-disk .worker-sparkline circle { fill: #eab308; }
.worker-chart-grid { stroke: #94a3b8; stroke-opacity: .3; stroke-width: .5; }
.worker-chart-label { fill: #64748b; font-size: 8px; }
.worker-chart-time { display: flex; justify-content: space-between; font-size: .65rem; color: #64748b; }
.worker-metric-ranges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.worker-metric-ranges .btn[aria-pressed=true] { background: #2563eb; color: #fff; border-color: #2563eb; }
html[data-theme=dark] .worker-chart-label { fill: #94a3b8; }
html[data-theme=dark] .worker-chart-time { color: #94a3b8; }
.worker-resource-info { display: flex; flex-direction: column; gap: 5px; }
.worker-resource-info-row { display: flex; justify-content: space-between; border-top: 1px solid #e2e8f0; padding-top: 4px; }
.worker-resource-info-row span { color: #64748b; }
.worker-container-groups { max-height: 260px; overflow: auto; border: 1px solid #dbe2ea; border-radius: 8px; }
.worker-stack { border-bottom: 1px solid #dbe2ea; }
.worker-stack:last-child { border-bottom: 0; }
.worker-stack-toggle { width: 100%; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 8px 10px; border: 0; background: #f8fafc; text-align: left; cursor: pointer; }
.worker-stack-toggle strong { overflow-wrap: anywhere; }
.worker-transfer-fingerprint { overflow-wrap: anywhere; }
.worker-stack-toggle.error { background: #fff1f2; }
.worker-stack-toggle.warning { background: #fffbeb; }
.worker-stack-chevron { font-size: 0.9rem; }
.worker-stack-count { color: #64748b; font-size: 0.78rem; }
.worker-stack-content { max-height: 170px; overflow: auto; }
.worker-container-table { width: 100%; border-collapse: collapse; }
.worker-detail-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.worker-tty-dialog { width: min(920px, calc(100vw - 32px)); }
.worker-terminal-page { margin: 0; height: 100vh; display: flex; flex-direction: column; background: #080d17; color: #d7e3f5; }
.worker-terminal-page header { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.worker-terminal-page main { min-height: 0; flex: 1; padding: 4px 10px 10px; }
.worker-tty { height: min(60vh, 480px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0; padding: 12px; border-radius: 8px; background: #080d17; color: #d7e3f5; font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; outline: none; }
@media (max-width: 800px) {
    .worker-system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .worker-system-wide { grid-column: span 2; }
    .worker-terminal-row { grid-template-columns: 1fr; }
}
html[data-theme=dark] .worker-banner .worker-banner-fqdn { color: #cbd5e1; }
html[data-theme=dark] .worker-banner { border-bottom-color: #334155; }
html[data-theme=dark] .worker-detail-subtitle,
html[data-theme=dark] .worker-system-card span,
html[data-theme=dark] .worker-system-card small,
html[data-theme=dark] .worker-usage small,
html[data-theme=dark] .worker-chart-title { color: #94a3b8; }
html[data-theme=dark] .worker-system-card,
html[data-theme=dark] .worker-usage,
html[data-theme=dark] .worker-chart { background: #0f172a; border-color: #334155; }
html[data-theme=dark] .worker-provision-option { border-color: #334155; background: #0f172a; }
html[data-theme=dark] .worker-provision-option small { color: #94a3b8; }
html[data-theme=dark] .worker-resource-card,
html[data-theme=dark] .worker-stack-toggle { background: #0f172a; border-color: #334155; }
html[data-theme=dark] .worker-resource-card,
html[data-theme=dark] .worker-container-groups { border-color: #334155; }
html[data-theme=dark] .worker-resource-head span,
html[data-theme=dark] .worker-resource-card > small,
html[data-theme=dark] .worker-resource-info-row span,
html[data-theme=dark] .worker-stack-count { color: #94a3b8; }
html[data-theme=dark] .worker-stack { border-color: #334155; }
html[data-theme=dark] .worker-container-table th,
html[data-theme=dark] .worker-container-table td,
html[data-theme=dark] .worker-resource-info-row { border-color: #334155; }
html[data-theme=dark] .badge.healthy, html[data-theme=dark] .badge.yes { background: #14532d; color: #bbf7d0; }
html[data-theme=dark] .badge.starting { background: #713f12; color: #fef08a; }
html[data-theme=dark] .badge.error { background: #7f1d1d; color: #fecaca; }
html[data-theme=dark] .badge.warning { background: #7c2d12; color: #fed7aa; }
html[data-theme=dark] .msg { background: #7f1d1d; color: #fecaca; }
html[data-theme=dark] .msg.ok { background: #14532d; color: #bbf7d0; }
html[data-theme=dark] .card .l, html[data-theme=dark] .hint { color: #94a3b8; }
html[data-theme=dark] .chip { background: #1e3a8a; }
html[data-theme=dark] .filelist { border-color: #334155; }
html[data-theme=dark] .fileitem { border-color: #334155; }
html[data-theme=dark] .fileitem:hover { background: #334155; }
html[data-theme=dark] .fileitem.active { background: #1e3a8a; }
html[data-theme=dark] .hl { background: #0f172a; border-color: #475569; }
html[data-theme=dark] .hl-pre { color: #e2e8f0; }
html[data-theme=dark] .hl textarea.hl-area { background: transparent; color: transparent; caret-color: #e2e8f0; }
html[data-theme=dark] .tok-c { color: #94a3b8; }
html[data-theme=dark] .tok-s { color: #6ee7b7; }
html[data-theme=dark] .tok-k { color: #93c5fd; }
html[data-theme=dark] .tok-v { color: #fcd34d; }
html[data-theme=dark] .tok-n { color: #c4b5fd; }
html[data-theme=dark] .tok-p { color: #f9a8d4; }

.bars { width: 100%; height: 100px; display: block; }
.bars rect { fill: #2563eb; }
html[data-theme=dark] .bars rect { fill: #60a5fa; }

/* Abstaende zwischen Karten, Tabellen und Ueberschriften */
.cards { margin-bottom: 14px; }
.tablewrap { margin-bottom: 14px; }
.main > h3 { margin: 18px 0 8px; }
.gap { height: 14px; }

.logbox { background: #0f172a; color: #e2e8f0; padding: 10px; border-radius: 6px; max-height: 60vh; overflow: auto; font: 12px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }

html[data-theme=dark] .dns-dialog-actions { border-color: #475569; }
html[data-theme=dark] .icon-btn { background: #1e293b; border-color: #475569; color: #e2e8f0; }
html[data-theme=dark] .icon-btn:hover { background: #334155; }
html[data-theme=dark] .icon-btn.danger { color: #fca5a5; }
html[data-theme=dark] .icon-btn.dns-auto, html[data-theme=dark] .dns-close { background: transparent; border-color: transparent; color: #93c5fd; }
html[data-theme=dark] .dns-toolbar { background: #1e293b; }

/* Reseller-Portal: eigenstaendige Navigation und kompakte Uebersicht */
.reseller-layout { grid-template-columns: 230px minmax(0, 1fr); }
.reseller-side { display: flex; flex-direction: column; padding: 26px 14px; }
.reseller-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 32px; color: #fff; }
.reseller-brand-mark { display: block; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; }
.reseller-brand strong, .reseller-brand small { display: block; }
.reseller-brand strong { font-size: 16px; letter-spacing: .05em; }
.reseller-brand small { color: #94a3b8; font-size: 12px; }
.reseller-nav-label { margin: 0 10px 10px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.reseller-nav-item { width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; background: transparent; color: #cbd5e1; text-align: left; cursor: pointer; }
.reseller-nav-item:hover { background: #1e293b; color: #fff; }
.reseller-nav-item.active { background: #2563eb; color: #fff; font-weight: 600; }
.reseller-nav-item:focus-visible, .reseller-stat:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.reseller-nav-footer { margin: auto 10px 0; padding-top: 30px; color: #64748b; font-size: 12px; }
.reseller-main { padding: 28px clamp(20px, 3vw, 44px); }
.reseller-top { align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.reseller-top h2 { font-size: 26px; letter-spacing: -.03em; }
.reseller-top .bar { align-items: center; margin: 0; }
.reseller-user { padding: 5px 10px; border-radius: 6px; background: #e2e8f0; font-weight: 600; }
.reseller-eyebrow { margin-bottom: 4px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.reseller-description { margin: 4px 0 0; }
.reseller-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px; margin-bottom: 18px; border-radius: 12px; background: linear-gradient(120deg, #172554, #1d4ed8); color: #fff; }
.reseller-hero h3 { margin: 0 0 6px; font-size: 20px; }
.reseller-hero p { margin: 0; color: #dbeafe; }
.reseller-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.reseller-hero .btn { border-color: #bfdbfe; background: #fff; color: #1e40af; }
.reseller-hero .btn.primary { border-color: #fff; background: #fff; color: #1e40af; }
.reseller-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.reseller-stat { display: grid; gap: 5px; padding: 18px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.reseller-stat:hover { border-color: #93c5fd; box-shadow: 0 6px 20px #1e40af0d; }
.reseller-stat strong { font-size: 28px; line-height: 1.2; }
.reseller-stat-label { font-weight: 600; }
.reseller-stat-note { color: #64748b; font-size: 12px; }
.reseller-stat-link { margin-top: 8px; color: #2563eb; font-size: 12px; font-weight: 600; }
.reseller-overview-note { padding: 18px; border: 1px solid #e2e8f0; border-radius: 10px; }
.reseller-overview-note p { margin: 6px 0 0; }
.reseller-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.reseller-section-heading h3 { margin: 0 0 2px; font-size: 17px; }
.reseller-section-heading .hint { font-size: 12px; }
.reseller-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.reseller-filters input[type=search] { flex: 1 1 240px; max-width: 420px; min-height: 38px; }
.reseller-filters select { flex: 0 1 220px; width: auto; min-height: 38px; }
.reseller-filter-count { margin: 0; font-size: 12px; }
.reseller-table { border: 1px solid #e2e8f0; border-radius: 4px; }
.reseller-table td.reseller-space-status { white-space: normal; min-width: 180px; }
.reseller-table .actions { align-items: center; flex-wrap: wrap; }
.reseller-table .reseller-empty { padding: 32px; color: #64748b; text-align: center; }
html[data-theme=dark] .reseller-user { background: #334155; }
html[data-theme=dark] .reseller-stat { background: #1e293b; border-color: #334155; }
html[data-theme=dark] .reseller-stat:hover { border-color: #60a5fa; }
html[data-theme=dark] .reseller-stat-note { color: #94a3b8; }
html[data-theme=dark] .reseller-stat-link { color: #93c5fd; }
html[data-theme=dark] .reseller-overview-note, html[data-theme=dark] .reseller-table { border-color: #334155; }
html[data-theme=dark] .reseller-hero .btn, html[data-theme=dark] .reseller-hero .btn.primary { background: #fff; border-color: #fff; color: #1e40af; }

/* Admin-Portal: dieselbe Gestaltung, bestehende Verwaltungsfunktionen bleiben unveraendert. */
.admin-layout { grid-template-columns: 230px minmax(0, 1fr); }
.admin-side { display: flex; flex-direction: column; padding: 26px 14px; }
.admin-side-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-version { margin-top: auto; padding: 16px 10px 0; color: #94a3b8; font-size: 11px; }
.admin-brand { padding-bottom: 24px; }
.admin-nav-toggle { display: none; padding: 8px 12px; border: 1px solid #475569; border-radius: 8px; background: #1e293b; color: #fff; cursor: pointer; }
.admin-nav-items .group { margin: 20px 10px 8px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .1em; }
.admin-group-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 12px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: #94a3b8; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-align: left; cursor: pointer; }
.admin-group-toggle:hover { background: #1e293b; color: #fff; }
.admin-group-toggle:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.admin-group-chevron { font-size: 16px; transition: transform .15s ease; }
.admin-group-toggle[aria-expanded=false] .admin-group-chevron { transform: rotate(-90deg); }
.admin-nav-item { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: #cbd5e1; text-align: left; cursor: pointer; }
.admin-nav-item:hover { background: #1e293b; color: #fff; }
.admin-nav-item.active { background: #2563eb; color: #fff; font-weight: 600; }
.admin-nav-item:focus-visible, .admin-nav-toggle:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.admin-main { padding: 28px clamp(20px, 3vw, 44px); }
.admin-top { align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-top h2 { font-size: 26px; letter-spacing: -.03em; }
.admin-top .bar { align-items: center; margin: 0; }
.admin-top .worker-status-widget { margin: 0 auto; }
.admin-hero { margin-bottom: 18px; }
.admin-dashboard-stats { gap: 14px; margin-bottom: 18px; }
.admin-stat { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 18px; border: 1px solid #e2e8f0; border-radius: 10px; }
.admin-stat .n { font-size: 26px; overflow-wrap: anywhere; }
.admin-stat-label { min-height: 20px; font-weight: 600; }
.sftpgo-stat-note { margin: 0; font-size: 12px; }
.sftpgo-content > h3 { margin: 18px 0 8px; }
.admin-main .tablewrap { border: 1px solid #e2e8f0; border-radius: 4px; }
.admin-main .admin-data-table { width: max-content; min-width: 100%; table-layout: auto; }
.admin-main .admin-data-table th, .admin-main .admin-data-table td { width: 1%; max-width: 320px; }
.admin-main .admin-data-table .admin-actions-heading, .admin-main .admin-data-table .admin-actions-cell { width: auto; min-width: max-content; max-width: none; }
.admin-main .admin-data-table .actions { flex-wrap: wrap; min-width: 0; }
.admin-sort-button { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.admin-sort-button:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.admin-sort-indicator { color: #64748b; }
.admin-list-bar input[type=search] { flex: 1 1 240px; width: auto; max-width: 420px; min-height: 38px; }
.admin-list-bar .admin-status-filter { flex: 0 1 220px; width: auto; min-height: 38px; }
.admin-list-count { margin: 0; font-size: 12px; }
html[data-theme=dark] .admin-stat, html[data-theme=dark] .admin-main .tablewrap { border-color: #334155; }

@media (max-width: 760px) {
    .admin-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .admin-side { padding: 14px; }
    .admin-brand { padding: 0; }
    .admin-nav-toggle { display: block; }
    .admin-nav-items { display: none; padding-top: 12px; }
    .admin-nav-items.is-open { display: block; }
    .admin-main { padding: 20px 16px; }
    .admin-top .worker-status-widget { margin: 0; }
    .admin-top .worker-status-popover { left: 0; transform: none; }
    .reseller-brand { width: 100%; padding: 0 0 8px; }
    .reseller-nav-label, .reseller-nav-footer { display: none; }
    .reseller-nav-item { width: auto; padding: 8px 10px; }
    .reseller-main { padding: 20px 16px; }
    .reseller-hero { padding: 20px; }
    .dns-dialog { width: 96vw; max-height: 94vh; padding: 16px; }
    .dns-section { padding: 16px; }
    .dns-import-grid { grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
    .dns-import-buttons { padding-bottom: 0; }
    .dns-import-buttons .btn { flex: 1; }
}

.ticket-layout { display: grid; grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.7fr); gap: 16px; align-items: start; }
.ticket-list, .ticket-detail { min-width: 0; padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.ticket-list { display: grid; gap: 8px; max-height: 72vh; overflow: auto; }
.ticket-list-item { display: grid; justify-items: start; gap: 5px; width: 100%; padding: 12px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; color: inherit; text-align: left; cursor: pointer; }
.ticket-list-item:hover, .ticket-list-item:focus-visible { border-color: #60a5fa; outline: none; }
.ticket-list-title { font-weight: 700; }
.ticket-list-meta, .ticket-message-meta { color: #64748b; font-size: 12px; }
.ticket-detail { min-height: 280px; }
.ticket-detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; }
.ticket-detail-heading h3 { margin: 0; }
.ticket-messages { display: grid; gap: 12px; max-height: 54vh; overflow: auto; padding: 16px 0; }
.ticket-message { max-width: 92%; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; overflow-wrap: anywhere; }
.ticket-message.mine { justify-self: end; border-color: #bfdbfe; background: #eff6ff; }
.ticket-message-meta { margin-bottom: 6px; }
.ticket-message-body { white-space: pre-wrap; }
.ticket-confirmation { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #334155; }
.ticket-confirmation.confirmed { border-color: #86efac; background: #f0fdf4; color: #166534; }
.ticket-confirm-button:disabled { opacity: .58; cursor: not-allowed; }
.ticket-reply { display: grid; gap: 10px; }
.ticket-reply textarea { width: 100%; resize: vertical; }
.ticket-confirm-check { display: flex; gap: 8px; align-items: center; }
.ticket-closed-toggle { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 13px; }
.admin-nav-item, .reseller-nav-item { display: flex; align-items: center; gap: 8px; }
.ticket-nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; }
.ticket-nav-badge.hidden { display: none; }
.ticket-dashboard-panel { margin: 0 0 18px; padding: 16px; }
.ticket-dashboard-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticket-dashboard-heading h3 { margin: 0; }
.ticket-dashboard-heading p { margin: 4px 0 0; }
.ticket-dashboard-list { display: grid; gap: 8px; margin-top: 12px; }
.ticket-dashboard-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: inherit; text-align: left; cursor: pointer; }
.ticket-dashboard-item:hover { border-color: #60a5fa; }
.ticket-dashboard-meta { color: #64748b; font-size: 12px; }
.dashboard-announcement { margin: 0 0 12px; padding: 16px; border-left: 4px solid #2563eb; }
.dashboard-announcement h3 { margin: 0 0 6px; }
.dashboard-announcement-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.dashboard-announcement-editor { margin-bottom: 20px; padding: 18px; }
.dashboard-announcement-editor h3 { margin-top: 0; }
.dashboard-announcement-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dashboard-announcement-active { display: flex; align-items: center; gap: 8px; }
html[data-theme=dark] .dashboard-announcement { border-color: #60a5fa; }
@media (max-width: 650px) { .dashboard-announcement-dates { grid-template-columns: minmax(0, 1fr); gap: 0; } }
html[data-theme=dark] .ticket-list, html[data-theme=dark] .ticket-detail { border-color: #334155; background: #1e293b; }
html[data-theme=dark] .ticket-list-item, html[data-theme=dark] .ticket-message { border-color: #334155; background: #0f172a; }
html[data-theme=dark] .ticket-message.mine { border-color: #1d4ed8; background: #172554; }
html[data-theme=dark] .ticket-confirmation { border-color: #475569; background: #1e293b; color: #e2e8f0; }
html[data-theme=dark] .ticket-confirmation.confirmed { border-color: #166534; background: #052e16; color: #bbf7d0; }
html[data-theme=dark] .ticket-dashboard-item { border-color: #334155; background: #0f172a; }
@media (max-width: 900px) { .ticket-layout { grid-template-columns: minmax(0, 1fr); } .ticket-list { max-height: 35vh; } }

/* Shared list and account controls across all portals. */
.compact-list .secondary-column { display: none; }
.compact-list tbody tr { border-left: 3px solid transparent; }
.compact-list tbody tr.row-good { border-left-color: #16a34a; }
.compact-list tbody tr.row-bad { border-left-color: #dc2626; }
.compact-list tbody tr.row-pending { border-left-color: #eab308; }
.compact-list tbody tr.row-warn { border-left-color: #ea580c; }
.compact-list tbody tr.row-neutral { border-left-color: #64748b; }
.compact-list .list-status { width: 1%; }
.server-status { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #d97706; border: 1px solid #92400e; vertical-align: middle; }
.server-status.healthy { background: #16a34a; border-color: #166534; }
.server-status.error, .server-status.off { background: #dc2626; border-color: #991b1b; }
.server-status.inactive { background: #94a3b8; border-color: #64748b; }
.compact-list td:has([popovertarget]) { overflow: visible; width: 1%; }
.list-expandable { cursor: pointer; }
.list-expandable:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }
.compact-list tbody .list-row-expanded, .compact-list tbody .list-detail-row { background: #eff6ff; }
.list-detail-row[hidden] { display: none; }
.list-detail-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px 16px; margin: 8px 0; white-space: normal; }
.list-detail-values dt { color: #64748b; font-size: 11px; }
.list-detail-values dd { margin: 0 0 7px; overflow-wrap: anywhere; }
.pki-dialog { width: min(680px, calc(100vw - 32px)); max-height: 90dvh; overflow-y: auto; }
.pki-dialog textarea { width: 100%; font-family: monospace; }
.pki-dialog pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.worker-container-log-dialog { resize: both; overflow: auto; min-width: min(360px, calc(100vw - 32px)); min-height: 350px; height: min(560px, 90dvh); max-width: calc(100vw - 32px); max-height: 90dvh; }
.worker-container-log-dialog[open] { display: flex; flex-direction: column; }
.worker-container-log-dialog > :not(.worker-log-view) { flex-shrink: 0; }
.worker-container-log-dialog .worker-log-view { flex: 1; min-height: 100px; max-height: none; }
.worker-log-view.worker-log-nowrap { white-space: pre; overflow-wrap: normal; }
.worker-log-wrap { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.worker-log-wrap input { width: auto; }
.worker-container-actions { display: flex; gap: 4px; }
.worker-action-icon { display: inline-block; width: 16px; height: 16px; position: relative; vertical-align: middle; }
.worker-action-log { border: 1.5px solid currentColor; border-radius: 2px; }
.worker-action-log::after { content: ""; position: absolute; inset: 3px; background: repeating-linear-gradient(to bottom, currentColor 0 1px, transparent 1px 4px); }
.worker-action-shell::before { content: ">_"; position: absolute; inset: 0; font: bold 14px/16px monospace; }
.icon-button, .compact-list button[popovertarget] { min-width: 32px; min-height: 30px; font-size: 19px; line-height: 1; }
.user-settings { flex-wrap: nowrap; margin-left: auto; }
.portal-shell { padding-top: var(--portal-header-height); }
.portal-shell > .layout { min-height: calc(100dvh - var(--portal-header-height)); }
.portal-header { position: fixed; inset: 0 0 auto; z-index: 1000; height: var(--portal-header-height); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #cbd5e1; box-shadow: 0 2px 8px #0f172a0a; }
.portal-brand { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.portal-brand img { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; }
.portal-brand-copy { min-width: 0; }
.portal-brand strong, .portal-brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-brand strong { font-size: 15px; }
.portal-brand small { font-size: 11px; color: #64748b; }
.portal-header > .user-settings { grid-column: 3; grid-row: 1; justify-self: end; margin: 0; min-width: 0; max-width: 100%; }
.portal-header .icon-button { flex-shrink: 0; }
.portal-header .worker-status-widget { grid-column: 2; grid-row: 1; justify-self: center; min-width: 0; max-width: 40vw; margin: 0; }
.portal-header .worker-status-button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.portal-header .worker-status-popover { left: 50%; transform: translateX(-50%); max-height: min(60vh, calc(100dvh - var(--portal-header-height) - 24px)); }
html:has(.portal-header) { scroll-padding-top: calc(var(--portal-header-height) + 12px); }
body:has(.portal-header) > .toast-container { top: calc(var(--portal-header-height) + 16px); }
html[data-theme=dark] .portal-header { background: #0f172a; border-color: #334155; }
html[data-theme=dark] .portal-brand small { color: #94a3b8; }
@media (max-width: 700px) {
    html:has(.portal-header .worker-status-widget) { --portal-header-height: 100px; }
    .portal-header { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 8px 12px; }
    .portal-brand { gap: 8px; }
    .portal-brand img { width: 30px; height: 30px; }
    .portal-brand strong { font-size: 13px; }
    .portal-header > .user-settings { grid-column: 2; }
    .portal-header .view-as-label { max-width: 20vw; }
    .portal-header .worker-status-widget { grid-column: 1 / -1; grid-row: 2; max-width: 100%; }
}
.user-icon { display: inline-block; width: 18px; height: 19px; position: relative; vertical-align: middle; }
.user-icon::before { content: ""; position: absolute; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; left: 5px; top: 0; }
.user-icon::after { content: ""; position: absolute; width: 15px; height: 8px; border: 1.5px solid currentColor; border-radius: 9px 9px 3px 3px; left: 1px; bottom: 0; }
.compact-card-list { padding: 0; list-style: none; }
.compact-card-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #cbd5e1; }
.compact-card-list > li:nth-child(even) { background: #64748b0b; }
.user-menu-identity { padding: 8px 10px; max-width: 260px; overflow-wrap: anywhere; border-bottom: 1px solid #cbd5e1; font-size: 12px; }
.admin-action-dropdown { min-width: 155px; max-width: calc(100vw - 16px); background: #fff; color: #1e293b; border-color: #cbd5e1; }
.admin-action-dropdown .btn { text-align: left; padding: 7px 10px; border: 0; text-decoration: none; }
.admin-action-dropdown .btn:focus-visible, .icon-button:focus-visible, summary:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }
.admin-top, .reseller-top { align-items: center; margin-bottom: 18px; }
.admin-top h2, .reseller-top h2 { font-size: 23px; }
.admin-side, .reseller-side { padding: 16px 10px; }
.admin-brand, .reseller-brand { margin-bottom: 16px; }
.admin-nav-item, .reseller-nav-item { padding: 6px 10px; font-size: 12px; }
.admin-group-toggle { margin-top: 6px; padding: 7px 10px; font-size: 9px; letter-spacing: .06em; }
.admin-group-items { padding-left: 7px; border-left: 1px solid #334155; margin-left: 10px; }
.reseller-nav-label { margin: 16px 10px 5px; font-size: 9px; }
.reseller-nav-footer { padding-top: 16px; font-size: 10px; }
html[data-theme=dark] .admin-action-dropdown { background: #1e293b; color: #e2e8f0; border-color: #475569; }
html[data-theme=dark] .compact-list tbody .list-row-expanded, html[data-theme=dark] .compact-list tbody .list-detail-row { background: #26364f; }
html[data-theme=dark] .list-detail-values dt { color: #94a3b8; }
@media (min-width: 901px) {
    .admin-side, .reseller-side { position: sticky; top: var(--portal-header-height); height: calc(100dvh - var(--portal-header-height)); overflow-y: auto; }
}
@media (max-width: 900px) {
    .admin-side, .reseller-side { padding: 10px; }
    .reseller-side .reseller-nav-label { display: none; }
    .admin-top, .reseller-top { gap: 10px; }
    .admin-top h2, .reseller-top h2 { font-size: 20px; }
    .reseller-description { display: none; }
}
/* Mail management */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.dns-origin { margin-left: 6px; white-space: nowrap; }
.dns-row-replaced td { opacity: .6; text-decoration: line-through; }
.dns-row-replaced td .dns-origin { text-decoration: none; }
.mail-dns-value { word-break: break-all; font-size: 12px; }
.mail-dns-check { list-style: none; margin: 6px 0; padding: 0; }
.mail-dns-check li { padding: 4px 0; border-bottom: 1px solid var(--table-line); }
.mail-dns-check li:last-child { border-bottom: 0; }

/* DNS editor (tabs, per-entry dialogs, publication status) */
.dns-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.dns-head h3 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.dns-status .badge { white-space: normal; line-height: 1.4; padding: 3px 10px; }
.dns-tabs { display: flex; gap: 4px; border-bottom: 1px solid #cbd5e1; margin-bottom: 16px; overflow-x: auto; }
.dns-tab { border: 0; background: none; padding: 10px 14px; font: inherit; color: inherit; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.dns-tab[aria-selected="true"] { border-bottom-color: #2563eb; font-weight: 600; }
.dns-tab:focus-visible, .dns-panel:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.dns-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dns-toolbar input[type=search] { flex: 1 1 220px; min-width: 0; }
.dns-toolbar select { flex: 0 1 160px; }
.dns-count { margin: 8px 0 0; }
.dns-dialog .tablewrap { overflow-x: visible; }
.dns-record-table { width: 100%; table-layout: auto; }
.dns-record-table .dns-actions-cell { width: 1%; white-space: nowrap; text-align: right; }
.dns-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.dns-toolbar { position: sticky; top: 0; z-index: 1; padding-bottom: 8px; background: #fff; }
.dns-head .dns-close { margin-left: auto; }
/* Icon buttons (pattern for parameter tables): square, tooltip = accessible name. */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid #cbd5e1; border-radius: 4px; background: #fff; color: #334155; cursor: pointer; font-size: 15px; line-height: 1; }
.icon-btn:hover { background: #f1f5f9; }
.icon-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.icon-btn:disabled { opacity: .5; cursor: default; }
.icon-btn.danger { color: #b91c1c; }
.icon-btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.icon-btn.dns-auto { border-color: transparent; background: transparent; color: #2563eb; }
span.icon-btn.dns-auto, .icon-btn-placeholder { cursor: help; color: #64748b; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; }
.dns-close { border-color: transparent; background: transparent; width: 34px; height: 34px; }
.dns-record-table th, .dns-record-table td { vertical-align: top; }
.dns-record-table .dns-name { font-weight: 600; white-space: nowrap; }
.dns-row-repeat .dns-name { color: transparent; }
.dns-row-managed td, .dns-row-managed th { background: #f8fafc; }
.dns-row-replaced .dns-value { text-decoration: line-through; color: #64748b; }
.dns-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; max-width: 560px; word-break: break-word; }
.dns-filter-empty { padding: 16px; text-align: center; }
.dns-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.dns-row-5 { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.dns-start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 12px; }
.dns-start { display: flex; flex-direction: column; gap: 4px; padding: 18px; }
.dns-start h4, .dns-subsection h4 { margin: 0 0 8px; font-size: 16px; }
.dns-start textarea, .dns-record-form textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.dns-subsection { padding: 16px 0; border-top: 1px solid #e2e8f0; }
.dns-subsection:first-child { border-top: 0; padding-top: 0; }
.dns-danger h4 { color: #b91c1c; }
.dns-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.dns-check input { width: auto; }
.dns-subdialog { width: min(560px, calc(100vw - 32px)); }
.dns-subdialog .msg { margin-bottom: 12px; }
.dns-preview { max-height: 260px; overflow: auto; }
.dns-zonefile { max-height: 60vh; overflow: auto; padding: 12px; background: #f1f5f9; border-radius: 6px; white-space: pre; font-size: 12px; }
html[data-theme=dark] .dns-tabs { border-bottom-color: #334155; }
html[data-theme=dark] .dns-tab[aria-selected="true"] { border-bottom-color: #60a5fa; }
html[data-theme=dark] .dns-row-managed td, html[data-theme=dark] .dns-row-managed th { background: #1e293b; }
html[data-theme=dark] .dns-subsection { border-top-color: #334155; }
html[data-theme=dark] .dns-zonefile { background: #0f172a; }
html[data-theme=dark] .dns-danger h4 { color: #fca5a5; }
@media (max-width: 640px) {
    .dns-record-table .dns-ttl { display: none; }
    .dns-toolbar .btn { flex: 1 1 auto; }
}

/* Server configuration: tabs, sections, list tables, sticky save bar */
.settings-form { display: grid; gap: 16px; }
.settings-tabs { display: flex; gap: 4px; border-bottom: 1px solid #cbd5e1; overflow-x: auto; }
.settings-tab { position: relative; border: 0; background: none; padding: 10px 16px; font: inherit; color: inherit; cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.settings-tab[aria-selected="true"] { border-bottom-color: #2563eb; font-weight: 600; }
.settings-tab.has-changes::after { content: ''; position: absolute; top: 8px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.settings-tab:focus-visible, .settings-panel:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.settings-panel { display: grid; gap: 16px; }
.settings-section { padding: 18px 20px; }
.settings-section h3 { margin: 0 0 14px; font-size: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 20px; }
.settings-toggles { display: grid; gap: 6px; margin-bottom: 8px; }
.settings-toggle label { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; }
.settings-toggle input { width: auto; margin-top: 3px; }
.settings-toggle .hint { display: block; margin-left: 28px; }
.settings-step { margin-left: 8px; font-weight: 400; }
.settings-unit { display: flex; align-items: center; gap: 8px; }
.settings-unit input { flex: 1 1 auto; min-width: 0; max-width: 220px; }
.settings-unit span { color: #64748b; }
.settings-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 24px; }
.settings-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.settings-label { font-weight: 600; }
.settings-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.settings-table td { vertical-align: top; }
.settings-table input { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.settings-table input.is-invalid { border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626; }
.settings-row-new input { border-style: dashed; }
.settings-row-error { display: block; color: #b91c1c; font-size: 12px; min-height: 0; }
.settings-row-error:empty { display: none; }
.settings-row-action { width: 40px; text-align: center; }
.settings-row-remove { width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px; background: none; color: #64748b; font-size: 20px; line-height: 1; cursor: pointer; }
.settings-row-remove:hover, .settings-row-remove:focus-visible { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.settings-row-spacer { display: inline-block; width: 32px; }
.settings-input-wrap { position: relative; }
.settings-input-wrap.has-clear input { padding-right: 26px; }
.settings-input-clear { position: absolute; top: 50%; right: 3px; transform: translateY(-50%); width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
    background: none; color: #dc2626; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; cursor: pointer; }
.settings-input-clear:hover, .settings-input-clear:focus-visible { background: #fee2e2; color: #b91c1c; }
.settings-input-clear:focus-visible { outline: 2px solid #dc2626; outline-offset: 1px; }
html[data-theme=dark] .settings-input-clear { color: #f87171; }
html[data-theme=dark] .settings-input-clear:hover, html[data-theme=dark] .settings-input-clear:focus-visible { background: #450a0a; color: #fca5a5; }
.field.has-error input { border-color: #dc2626; box-shadow: 0 0 0 1px #dc2626; }
.settings-restart { padding: 8px 12px; border-radius: 6px; background: #fef3c7; color: #78350f; }
.settings-footer { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; border-top: 1px solid #cbd5e1; background: #fff; box-shadow: 0 -4px 12px #0f172a14; }
.settings-footer-status { color: #475569; }
html[data-theme=dark] .settings-tabs { border-bottom-color: #334155; }
html[data-theme=dark] .settings-tab[aria-selected="true"] { border-bottom-color: #60a5fa; }
html[data-theme=dark] .settings-row-error { color: #fca5a5; }
html[data-theme=dark] .settings-row-remove:hover, html[data-theme=dark] .settings-row-remove:focus-visible { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
html[data-theme=dark] .settings-restart { background: #422006; color: #fde68a; }
html[data-theme=dark] .settings-footer { background: #0f172a; border-top-color: #334155; }
html[data-theme=dark] .settings-footer-status, html[data-theme=dark] .settings-unit span { color: #94a3b8; }
@media (max-width: 640px) {
    .settings-section { padding: 14px; }
    .settings-footer .actions { width: 100%; }
    .settings-footer .actions .btn { flex: 1 1 auto; }
}
.settings-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; border-bottom: 1px solid #cbd5e1; }
.settings-bar .settings-tabs { border-bottom: 0; flex: 1 1 auto; }
.settings-search { flex: 0 1 260px; margin-bottom: 6px; }
.settings-section-hint { margin: -6px 0 14px; }
.updater-services { grid-column: 1 / -1; }
.updater-services td small { display: block; margin-top: 2px; }
.updater-image { display: block; margin-top: 4px; font-size: 12px; word-break: break-all; }
.updater-interval { width: 260px; }
.updater-interval input { max-width: 110px; }
.updater-history { margin-top: 10px; }
.updater-history ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.settings-note { display: block; margin-top: 4px; font-weight: 600; color: #92400e; }
.settings-duration { color: #64748b; font-size: 13px; white-space: nowrap; }
.settings-changed { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12px; color: #92400e; }
.settings-reset { border: 0; background: none; padding: 0; color: #2563eb; text-decoration: underline; cursor: pointer; font: inherit; }
.settings-field-error { margin: 6px 0 0; color: #b91c1c; font-size: 13px; font-weight: 600; }
.config-export-dialog { width: min(520px, 94vw); }
.config-export-dialog .hint { font-size: 13px; }
.config-export-dialog .config-export-warning { font-size: 13px; margin: 8px 0; padding: 8px 10px; border: 1px solid #f59e0b; background: #fffbeb; }
html[data-theme=dark] .config-export-dialog .config-export-warning { background: #422006; border-color: #a16207; }
.settings-toggle.has-error label { color: #b91c1c; }
html[data-theme=dark] .settings-bar { border-bottom-color: #334155; }
html[data-theme=dark] .settings-note, html[data-theme=dark] .settings-changed { color: #fcd34d; }
html[data-theme=dark] .settings-reset { color: #93c5fd; }
html[data-theme=dark] .settings-field-error, html[data-theme=dark] .settings-toggle.has-error label { color: #fca5a5; }
@media (max-width: 640px) { .settings-search { flex: 1 1 100%; } }

/* Mail requirements (worker details and activation dialog). */
.mail-check-dialog { width: min(980px, calc(100vw - 32px)); }
.mail-check-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mail-check-table td { white-space: normal; max-width: none; vertical-align: top; }
.mail-check-table td:first-child { width: 1%; white-space: nowrap; }
.mail-check-table td:last-child { width: 1%; white-space: nowrap; color: #64748b; }
.mail-check-detail, .mail-check-hint { display: block; margin-top: 2px; }
.mail-check-detail { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; color: #475569; }
.mail-check-hint { color: #64748b; }
.mail-check-passed { margin: 4px 0 10px; }
.mail-check-passed summary { cursor: pointer; color: #475569; font-size: 13px; }
html[data-theme=dark] .mail-check-detail { color: #cbd5e1; }
html[data-theme=dark] .mail-check-hint, html[data-theme=dark] .mail-check-passed summary, html[data-theme=dark] .mail-check-table td:last-child { color: #94a3b8; }

/* Live view of a running mail check. */
.mail-live-status { margin: 4px 0 8px; }
.mail-live-steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--table-line); border-radius: 4px; max-height: 60vh; overflow: auto; }
.mail-live-step { display: flex; gap: 8px; padding: var(--table-pad-y) var(--table-pad-x); border-bottom: 1px solid var(--table-line); font-size: var(--table-font-size); }
.mail-live-step:last-child { border-bottom: 0; }
.mail-live-icon { flex: 0 0 18px; height: 18px; margin-top: 1px; border-radius: 50%; text-align: center; font-size: 12px; font-weight: 700; line-height: 18px; color: #fff; background: #cbd5e1; }
.mail-live-ok .mail-live-icon { background: #16a34a; }
.mail-live-warning .mail-live-icon { background: #d97706; }
.mail-live-error .mail-live-icon { background: #dc2626; }
.mail-live-pending .mail-live-icon, .mail-live-skipped .mail-live-icon { background: none; color: #94a3b8; border: 1px solid #cbd5e1; line-height: 16px; }
.mail-live-running .mail-live-icon { background: none; border: 2px solid #bfdbfe; border-top-color: #2563eb; animation: mail-live-spin .8s linear infinite; }
@keyframes mail-live-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mail-live-running .mail-live-icon { animation: none; border-color: #2563eb; } }
.mail-live-running { background: var(--table-hover); }
.mail-live-pending .mail-live-body { color: #94a3b8; }
.mail-live-body { flex: 1 1 auto; min-width: 0; }
.mail-live-body > small { display: block; }
.mail-live-head { display: flex; justify-content: space-between; gap: 8px; }
.mail-live-time { color: #64748b; font-variant-numeric: tabular-nums; }
.mail-live-findings { margin: 3px 0 0; padding: 0; list-style: none; }
.mail-live-findings li { margin: 2px 0; }
.mail-live-final p { margin: 10px 0 6px; }
html[data-theme=dark] .mail-live-pending .mail-live-icon, html[data-theme=dark] .mail-live-skipped .mail-live-icon { border-color: #475569; color: #64748b; }

/* Webspace detail, statistics and OLS worker views (docs/openlitespeed.md 7) */
td.wrap { white-space: normal; overflow-wrap: anywhere; max-width: 420px; }
.webspace-tabs { margin-top: 8px; }
.webspace-panel, .worker-hosting-panel { display: grid; gap: 10px; }
.webspace-tab-content { display: grid; gap: 10px; }
.webspace-tab-content h3, .webspace-tab-content h4, .worker-hosting-panel h4 { margin: 8px 0 0; }
.webspace-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 0; }
.webspace-facts > div { padding: 6px 8px; border: 1px solid var(--table-line); border-radius: 4px; }
.webspace-facts dt { font-size: 12px; color: var(--table-head-color); }
.webspace-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.webspace-switch { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.webspace-switch input { width: auto; margin-top: 3px; }
.webspace-switch span { display: grid; gap: 2px; }
.webspace-offsite { border-left: 3px solid #eab308; padding-left: 8px; }
.webspace-grants { display: grid; gap: 6px; }
.usage-meter-wrap { display: grid; gap: 4px; max-width: 640px; }
.usage-meter-label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.usage-meter { height: 8px; border-radius: 4px; background: var(--table-line); overflow: hidden; }
.usage-meter-fill { height: 100%; width: 0; background: #2563eb; }
.usage-meter-fill.is-warning { background: #dc2626; }
.stats-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.stats-month select { width: auto; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.chart { margin: 0; padding: 8px; border: 1px solid var(--table-line); border-radius: 4px; }
.chart figcaption { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: #64748b; }
.stats-report-frame { width: 100%; height: 75vh; border: 1px solid var(--table-line); border-radius: 4px; background: #fff; }
.certificate-dashboard-list { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.certificate-dashboard-panel.has-issues { border-left: 3px solid #dc2626; }
.password-once-value input { flex: 1 1 260px; font-family: ui-monospace, monospace; }
.worker-builder-warning { margin: 0; }
.worker-address-form { display: grid; gap: 6px; max-width: 520px; }
.product-attribute-unavailable { margin-left: 6px; }
html[data-theme=dark] .usage-meter-fill { background: #60a5fa; }
html[data-theme=dark] .usage-meter-fill.is-warning { background: #f87171; }
html[data-theme=dark] .chart-axis { color: #94a3b8; }

/* Dashboard: setup checklist (UX E-1), clickable key figures, webspace states. */
.setup-checklist { margin-bottom: 14px; }
.setup-checklist summary { cursor: pointer; font-size: 15px; }
.setup-progress { height: 6px; margin: 10px 0; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.setup-progress span { display: block; height: 100%; background: #22c55e; }
.setup-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.setup-item { display: grid; grid-template-columns: 22px 1fr auto; align-items: start; gap: 8px; padding: 6px 8px; border-radius: 6px; background: #fef2f2; }
.setup-item.is-optional { background: #f8fafc; }
.setup-item.is-done { background: transparent; color: #64748b; }
.setup-item .setup-text { display: grid; gap: 2px; }
.setup-mark { font-weight: 700; color: #dc2626; text-align: center; }
.setup-item.is-optional .setup-mark { color: #64748b; }
.setup-item.is-done .setup-mark { color: #16a34a; }
html[data-theme=dark] .setup-item { background: #3b1d24; }
html[data-theme=dark] .setup-item.is-optional { background: #1e293b; }
html[data-theme=dark] .setup-item.is-done { background: transparent; color: #94a3b8; }
html[data-theme=dark] .setup-progress { background: #334155; }
.admin-stat-link { text-align: left; cursor: pointer; font: inherit; color: inherit; background: inherit; }
.admin-stat-link:hover { border-color: #3b82f6; }
.admin-webspace-status { margin: 14px 0; }
.admin-webspace-states { display: flex; flex-wrap: wrap; gap: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

/* Product services grouped by topic in two columns (UX R-23). */
.product-attribute-group h5 { margin: 10px 0 6px; font-size: 13px; text-transform: none; color: #475569; }
html[data-theme=dark] .product-attribute-group h5 { color: #94a3b8; }
.product-attribute-group-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.input-short { max-width: 12em; }
td .num, .num { font-variant-numeric: tabular-nums; }
.lock-cell { white-space: nowrap; }

/* Customer detail page (UX K-1). */
.customer-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #cbd5e1; margin: 12px 0; }
.customer-tab { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; font: inherit; color: inherit; border-bottom: 2px solid transparent; }
.customer-tab.active { border-bottom-color: #2563eb; font-weight: 600; }
html[data-theme=dark] .customer-tabs { border-color: #334155; }
.customer-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin-bottom: 12px; }
.customer-fact { display: grid; gap: 2px; }
.customer-note-text { white-space: pre-wrap; margin: 6px 0 0; }
.admin-nav-badge { margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 11px; background: #f59e0b33; color: #fbbf24; white-space: nowrap; }
/* Address fields get the room they need (UX F-2). */
#server-setting-worker_public_url, #server-setting-acme_directory_url-url { width: 100%; max-width: 640px; box-sizing: border-box; }

/* ---------- Global look (UX O-1 … O-9, A-1, A-3; docs/ui-design.md "Schrift, Felder, Tabellen") ---------- */
/* O-1: readable sizes. Navigation 14px, group headings in normal case, help texts 13px, nothing below 12px. */
.admin-nav-item, .reseller-nav-item { padding: 7px 10px; font-size: 14px; }
.admin-group-toggle { margin-top: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #cbd5e1; }
.reseller-nav-label, .admin-nav-items .group, .side .group { font-size: 12px; letter-spacing: .02em; text-transform: none; }
.reseller-eyebrow { font-size: 11px; }
.admin-version, .reseller-nav-footer, .chart-axis, .list-detail-values dt, .dns-validation-hint, .portal-brand small { font-size: 12px; }
.hint { font-size: 13px; }
small.hint, .field > .hint { font-size: 12.5px; }
/* A-3: help text contrast >= 4.5:1 on white and on the page background, in both themes. */
.hint, .admin-list-count { color: #4b5768; }
html[data-theme=dark] .hint, html[data-theme=dark] .admin-list-count { color: #a7b4c6; }
/* O-2: one width grid for form fields: number 1/4, text 1/2, URL/e-mail/reference 2/3, textarea full width. */
.field .input-short { max-width: max(25%, 9em); }
.field .input-medium { max-width: max(35%, 14em); }
.field .input-half { max-width: max(50%, 18em); }
.field .input-wide { max-width: max(67%, 26em); }
.field textarea { width: 100%; }
/* O-3: data tables: the action column sits at the right edge, amounts right-aligned. */
.admin-main .admin-data-table .admin-actions-heading, .admin-main .admin-data-table .admin-actions-cell { text-align: right; }
td:has(> .num), th.num { text-align: right; }
/* O-8: the page's primary actions at the right of the title. */
.admin-top { gap: 12px; flex-wrap: wrap; }
.admin-top-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
/* O-9: buttons keep their size; no full-width "Senden" bar. */
.ticket-reply > .btn { justify-self: end; width: auto; }
/* O-5: no dark blocks in the light theme (the sidebar stays dark on purpose). */
html:not([data-theme=dark]) .reseller-hero { background: #eff6ff; color: #1e293b; border: 1px solid #bfdbfe; }
html:not([data-theme=dark]) .reseller-hero p { color: #334155; }
html:not([data-theme=dark]) .reseller-hero .btn { border-color: #93c5fd; color: #1e40af; }
html:not([data-theme=dark]) .reseller-hero .btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
/* K-5: monitoring tiles. */
.monitor-tiles { margin-bottom: 4px; }
.monitor-tile { text-align: left; cursor: pointer; font: inherit; color: inherit; border: 1px solid #cbd5e1; border-left: 4px solid #cbd5e1; }
.monitor-tile.active { outline: 2px solid #2563eb; outline-offset: -2px; }
.monitor-tile.tone-good { border-left-color: #16a34a; }
.monitor-tile.tone-bad { border-left-color: #dc2626; }
.monitor-tile:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
html[data-theme=dark] .monitor-tile { border-color: #334155; }
html[data-theme=dark] .monitor-tile.tone-good { border-left-color: #22c55e; }
html[data-theme=dark] .monitor-tile.tone-bad { border-left-color: #f87171; }
/* A-1: visible keyboard focus on every navigation control. */
.admin-group-toggle:focus-visible, .admin-nav-item:focus-visible, .customer-tab:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }

/* --- settings/images/dns --- */
/* Long help texts: first sentence plus "Mehr" (UX T-3). */
.hint-more[hidden] { display: none; }
.hint-toggle { background: none; border: 0; padding: 0; font: inherit; color: #1d4ed8; cursor: pointer; text-decoration: underline; }
.hint-toggle:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
html[data-theme=dark] .hint-toggle { color: #93c5fd; }
.settings-soa-form { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.image-builder-memory:empty { display: none; }
.image-builder-memory { margin: 4px 0 0; }
.image-series { margin-top: 8px; }
/* --- accounts --- */
.account-copy { display: flex; gap: 6px; align-items: center; }
.account-copy .account-secret { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.account-dialog { max-width: 560px; }
tr.row-muted td { opacity: .6; }
.login .invite-intro { margin: 0 0 12px; }

/* --- worker detail --- */
.worker-detail .worker-banner { margin-top: 8px; }
.worker-detail-panel { margin-top: 4px; }
.worker-detail .worker-detail-actions { justify-content: flex-start; margin: 0 0 4px; }
.worker-role-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.worker-role-block { display: flex; flex-direction: column; gap: 6px; }
.worker-role-card { height: 100%; }
.worker-role-card:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.worker-role-contains { font-style: italic; }
.worker-service-list { display: grid; gap: 8px; }
.worker-service-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; padding: 4px 0 0 28px; }
.worker-service-settings[hidden], .worker-required-note[hidden] { display: none; }
.worker-required-note { color: #1d4ed8; font-size: 12px; font-weight: 600; }
.worker-drift { color: #b45309; font-weight: 600; }
.worker-instant { margin-left: 4px; font-weight: 400; }
.link-button { border: 0; padding: 0; background: none; color: #2563eb; cursor: pointer; font: inherit; text-decoration: underline; }
html[data-theme=dark] .worker-role-card:has(input:checked) { border-color: #3b82f6; background: #172554; }
html[data-theme=dark] .worker-required-note, html[data-theme=dark] .link-button { color: #93c5fd; }
html[data-theme=dark] .worker-drift { color: #fbbf24; }

/* Registry-Zugriff (registry-access.js) */
.registry-group { margin-bottom: 18px; }
.registry-group h3 { margin: 0 0 4px; font-size: 14px; }
.registry-group > .hint { margin: 0 0 6px; }
.registry-facts td:first-child { width: 280px; color: #64748b; }
html[data-theme=dark] .registry-facts td:first-child { color: #94a3b8; }
.field .registry-option { font-weight: 400; }
.registry-option .hint { display: inline; }
.registry-check-form { max-width: 520px; margin-bottom: 16px; }
.registry-check-result h3 { margin: 0 0 4px; font-size: 14px; }
.registry-check-result td:last-child { white-space: normal; }
/* Reseller grant switch (admin and customer view of the grant matrix). */
.grant-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.grant-switch input { appearance: none; width: 34px; height: 20px; margin: 0; border-radius: 10px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .15s; }
.grant-switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.grant-switch input:checked { background: #16a34a; }
.grant-switch input:checked::after { left: 16px; }
.grant-switch input:disabled { opacity: .55; cursor: default; }
.grant-switch input:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
html[data-theme=dark] .grant-switch input { background: #475569; }
html[data-theme=dark] .grant-switch input:checked { background: #16a34a; }
.login-forgot { justify-self: center; margin-top: 4px; font-size: 14px; }
/* Admin sidebar: one line per main entry with icon, groups open as fly-out (report R2 "Gruppierungen und Menüs"). */
.admin-nav-item .admin-nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-nav-icon { display: inline-flex; flex: 0 0 18px; width: 18px; height: 18px; color: #94a3b8; }
.admin-nav-item.active .admin-nav-icon, .admin-nav-item:hover .admin-nav-icon { color: inherit; }
.admin-nav-group { margin-top: 2px; }
.admin-nav-group.active-group { background: #1e293b; color: #fff; font-weight: 600; }
.admin-nav-group[aria-expanded=true] { background: #334155; color: #fff; }
.admin-nav-chevron { color: #64748b; font-size: 16px; line-height: 1; }
.admin-flyout { position: fixed; z-index: 60; min-width: 230px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 8px;
    border: 1px solid #334155; border-radius: 10px; background: #0f172a; box-shadow: 0 12px 32px rgba(15, 23, 42, .45); }
.admin-flyout-title { padding: 6px 10px 8px; color: #94a3b8; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-flyout-heading { margin: 10px 10px 4px; padding-top: 8px; border-top: 1px solid #334155; color: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-flyout .admin-nav-item { white-space: nowrap; }
.admin-nav-collapse { align-self: flex-start; margin-top: 14px; padding: 4px 10px; border: 1px solid #334155; border-radius: 6px; background: transparent; color: #94a3b8; cursor: pointer; font-size: 14px; }
.admin-nav-collapse:hover { color: #fff; background: #1e293b; }
.admin-nav-collapse:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
@media (min-width: 761px) {
    .admin-layout.nav-collapsed { grid-template-columns: 64px minmax(0, 1fr); }
    .admin-layout.nav-collapsed .admin-side { padding-inline: 8px; }
    .admin-layout.nav-collapsed .admin-side > .admin-nav-items > .admin-nav-item { justify-content: center; padding-inline: 0; }
    .admin-layout.nav-collapsed .admin-side > .admin-nav-items > .admin-nav-item .admin-nav-label,
    .admin-layout.nav-collapsed .admin-side > .admin-nav-items > .admin-nav-item .admin-nav-chevron,
    .admin-layout.nav-collapsed .admin-side > .admin-nav-items > .admin-nav-item .ticket-nav-badge,
    .admin-layout.nav-collapsed .admin-version,
    .admin-layout.nav-collapsed .admin-nav-items > .group { display: none; }
    .admin-layout.nav-collapsed .admin-nav-collapse { align-self: center; }
}
@media (max-width: 760px) {
    /* Narrow screens: the fly-out opens below its entry inside the folded menu. */
    .admin-flyout { position: static; margin: 2px 0 6px 18px; box-shadow: none; max-height: none; }
    .admin-nav-collapse { display: none; }
}
/* Order wizard (order-wizard.js): one dialog with groups; sub-dialogs for customer and portal access. */
.order-wizard { width: min(760px, 96vw); }
.order-wizard-sub { width: min(620px, 96vw); }
.order-wizard-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.order-wizard-head h3 { margin: 0; }
.order-wizard-close { border-color: transparent; background: transparent; }
.order-wizard-group { border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 14px 2px; margin: 0 0 12px; min-width: 0; }
.order-wizard-group legend { font-weight: 600; padding: 0 6px; }
.order-wizard-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; }
.order-wizard-city { grid-template-columns: 110px minmax(0, 1fr) 90px; }
.order-wizard-pick { display: flex; flex-wrap: wrap; gap: 0 8px; align-items: flex-end; }
.order-wizard-pick .field { flex: 1 1 280px; min-width: 0; }
.order-wizard-pick > .btn { margin-bottom: 10px; }
.order-wizard-check label { display: flex; gap: 6px; align-items: center; font-weight: 400; }
.order-wizard-info p { margin: 0 0 10px; }
.order-wizard .dlgbtns { flex-wrap: wrap; }
.order-wizard .dlgbtns .order-wizard-full { margin-right: auto; }
html[data-theme=dark] .order-wizard-group { border-color: #334155; }
html[data-theme=dark] .order-wizard-close { background: transparent; border-color: transparent; }
@media (max-width: 760px) { .order-wizard-city { grid-template-columns: minmax(0, 1fr); } }
/* Parameter table (pattern of the DNS table): group header rows, name | value | icon actions, hints as ⓘ. */
.param-table { width: 100%; border-collapse: collapse; }
.param-table th, .param-table td { padding: 5px 8px; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: middle; }
.param-table thead th { font-size: 12px; color: #475569; }
.param-table .param-group th { padding-top: 10px; background: #f1f5f9; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #475569; }
.param-table .param-name { width: 45%; font-weight: 600; }
.param-table .param-value input, .param-table .param-value select { width: 100%; max-width: 280px; }
.param-table .param-value input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.param-table .param-actions { width: 1%; white-space: nowrap; text-align: right; }
.param-row-off th, .param-row-off td { opacity: .6; }
.param-info { display: inline-flex; align-items: center; vertical-align: middle; color: #64748b; cursor: help; border-radius: 50%; }
.param-info:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
html[data-theme=dark] .param-table th, html[data-theme=dark] .param-table td { border-color: #334155; }
html[data-theme=dark] .param-table .param-group th { background: #0f172a; color: #94a3b8; }
html[data-theme=dark] .param-table thead th, html[data-theme=dark] .param-info { color: #94a3b8; }
@media (max-width: 560px) { .param-table .param-name { width: auto; } }
/* Worker › Rollen & Dienste as parameter table; danger zone at the end of a detail page. */
.worker-role-table .worker-role-switch { width: 1%; white-space: nowrap; }

.worker-role-table .worker-role-params .worker-service-settings { margin: 0; padding: 0; }
.worker-role-table .worker-role-params .field { margin-bottom: 6px; }
.worker-role-wrap { overflow-x: visible; }
.danger-zone { margin-top: 24px; padding: 14px 16px; border: 1px solid #fecaca; border-radius: 6px; background: #fef2f2; }
.danger-zone h4 { margin: 0 0 6px; color: #b91c1c; }
.danger-zone .hint { margin: 0 0 10px; }
html[data-theme=dark] .danger-zone { border-color: #7f1d1d; background: #2a1414; }
html[data-theme=dark] .danger-zone h4 { color: #fca5a5; }
/* Delete refused (report F36) and reasons of locked buttons (report F30). */
.delete-blocked-list { margin: 0 0 10px; padding-left: 20px; }
.delete-blocked-list li { margin: 4px 0; }
.delete-blocked-list li .btn { margin-left: 4px; }
.button-reason { margin: -4px 0 10px; }
/* Customer portal start page "Übersicht" (UX report R2 "Übersichtlichkeit" 3). */
.overview-heading { margin: 8px 0 10px; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.overview-card { margin: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.overview-card h3 { margin: 0 0 2px; overflow-wrap: anywhere; }
.overview-card p { margin: 2px 0; }
.overview-card .actions { margin-top: auto; padding-top: 8px; }
.overview-meta { color: var(--muted, #64748b); font-size: .9em; }
.overview-list { margin: 4px 0; padding-left: 18px; }
/* Webspace-Archive: contents dialog. */
.record-dialog.archive-contents { width: min(900px, 96vw); }
.archive-contents-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.archive-contents-head h3 { margin: 0; overflow-wrap: anywhere; }
.archive-contents h4 { margin: 16px 0 6px; }
.archive-contents .tablewrap { max-height: 40dvh; overflow: auto; }
.archive-restore-modes { border: 1px solid var(--border, #cbd5e1); border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.archive-restore-mode { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; cursor: pointer; }
.archive-restore-mode input { margin-top: 3px; }
.archive-restore-confirm { display: flex; gap: 8px; align-items: center; margin: 6px 0; color: #b45309; }
.archive-restore-confirm.hidden { display: none; }
html[data-theme=dark] .archive-restore-confirm { color: #fbbf24; }

/* Second factor (mfa-ui.js) */
.btn.link { border: 0; background: none; padding: 2px 4px; color: #2563eb; text-decoration: underline; }
.login .btn.link { display: inline-block; margin-top: 8px; }
.mfa-qr { display: block; width: 200px; height: 200px; margin: 8px auto; background: #fff; border-radius: 4px; }
.mfa-secret { word-break: break-all; font-size: 13px; }
.recovery-codes { font-size: 15px; line-height: 1.6; column-count: 2; white-space: pre; }
.mfa-setup { max-width: 640px; margin: 8vh auto; padding: 24px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px #0002; }
.mfa-panel .bar { margin: 8px 0; }
@media (max-width: 480px) { .mfa-setup { margin: 0; border-radius: 0; padding: 16px; } .recovery-codes { column-count: 1; } }
html[data-theme=dark] .mfa-setup { background: #1e293b; }
html[data-theme=dark] .btn.link { color: #93c5fd; }
