:root {
    color-scheme: dark;
    --bg: #101214;
    --panel: #1b1e22;
    --panel-alt: #23272d;
    --panel-muted: #2b3037;
    --input: #15181c;
    --text: #f2f4f7;
    --muted: #aeb6c2;
    --line: #3b424c;
    --accent: #f9be20;
    --accent-ink: #f9be20;
    --accent-contrast: #17191c;
    --accent-soft: #3a3117;
    --danger: #ff7568;
    --timer-running: #d92d20;
    --timer-running-hover: #a1160a;
    --success: #43cf9b;
}

* {
    box-sizing: border-box;
}

.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;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-box {
    width: min(380px, 100%);
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 45px rgba(26, 31, 40, 0.08);
}

.login-box h1 {
    margin: 0 0 24px;
    font-size: 24px;
    text-align: center;
}

.login-logo {
    display: block;
    max-width: 100%;
    max-height: 130px;
    margin: 0 auto 18px;
    object-fit: contain;
}

.login-actions {
    display: flex;
    gap: 10px;
}

.login-actions button {
    flex: 1;
}

.login-secret-field {
    position: relative;
    margin-bottom: 16px;
}

.login-secret-field input {
    margin-bottom: 0;
    padding-right: 48px;
}

.login-password-toggle {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0 5px 5px 0;
    background: transparent;
    color: var(--muted);
}

.login-password-toggle:hover,
.login-password-toggle[aria-pressed="true"] {
    color: var(--accent);
}

.login-password-toggle svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

label,
legend {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="tel"],
select {
    width: 100%;
    height: 42px;
    margin-bottom: 16px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    width: 100%;
    min-height: 130px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
    resize: vertical;
}

input[type="checkbox"] {
    accent-color: #087f5b;
}

select {
    min-width: 190px;
}

button,
.primary-button,
.secondary-button,
.icon-button,
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-contrast);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.offers-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.offers-header,
.offer-row {
    display: grid;
    grid-template-columns: 130px 155px minmax(260px, 1.7fr) minmax(180px, 1fr) 150px 125px;
    gap: 14px;
    align-items: center;
    min-height: 50px;
    padding: 0 14px;
}

.offers-header {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.offer-row {
    row-gap: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: background-color 120ms ease;
}

.offer-row.has-meta {
    min-height: 74px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.offer-row .offer-row-tag-meta {
    grid-column: 3 / 4;
}

.offer-row:last-child {
    border-bottom: 0;
}

.offer-row.is-alternate {
    background: var(--panel-alt);
}

.offer-row:hover {
    background: var(--accent-soft);
}

.offer-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.offer-row.is-urgent {
    box-shadow: inset 12px 0 0 var(--danger);
}

.offer-conversion-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.offer-conversion-actions form {
    margin: 0;
}

.secondary-button {
    border-color: var(--line);
    background: #fff;
    color: var(--text);
}

.settings-config-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.settings-config-actions form {
    margin: 0;
}

.settings-config-actions button {
    width: auto;
    margin: 0;
}

.settings-config-section {
    width: 100%;
}

.settings-config-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.settings-config-tabs button {
    width: auto;
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
}

.settings-config-tabs button:hover,
.settings-config-tabs button.is-active {
    border-bottom-color: var(--accent);
    background: transparent;
    color: var(--text);
}

.settings-config-panel {
    width: 100%;
}

.settings-config-panel[hidden] {
    display: none;
}

.settings-config-general-layout,
.settings-config-material-layout {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 3fr);
    gap: 24px;
    width: 100%;
}

.settings-config-stack,
.settings-config-checkboxes {
    display: grid;
    align-content: start;
    gap: 14px;
    width: 100%;
}

.settings-config-selects,
.settings-config-material-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
    gap: 14px 18px;
    width: 100%;
}

.settings-config-material-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-config-panel label:not(.checkbox-field) {
    display: block;
    margin-bottom: 7px;
}

.settings-config-panel input:not([type="checkbox"]),
.settings-config-panel select,
.settings-config-panel textarea {
    width: 100%;
    margin: 0;
}

.settings-config-checkboxes .checkbox-field {
    width: 100%;
    min-height: 42px;
    margin: 0;
}

@media (max-width: 1050px) {
    .settings-config-general-layout,
    .settings-config-material-layout {
        grid-template-columns: 1fr;
    }

    .settings-config-selects,
    .settings-config-material-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .settings-config-selects,
    .settings-config-material-fields {
        grid-template-columns: 1fr;
    }
}

.alert {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid #f1b5ad;
    border-radius: 6px;
    background: #fff0ee;
    color: var(--danger);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 24px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.topbar span {
    margin-left: 12px;
    color: var(--muted);
}

.topbar nav {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-ink);
    font-weight: 700;
}

.active-timer {
    display: inline-flex;
    align-items: center;
    height: 38px;
    overflow: hidden;
    border: 1px solid #d92d20;
    border-radius: 6px;
    background: #fff0ee;
    color: #a1160a;
}

.active-timer[hidden] {
    display: none;
}

.topbar .active-timer-slot {
    margin-left: 0;
}

.active-timer-slot[hidden] {
    display: none;
}

.active-timer-form {
    height: 100%;
    margin: 0;
}

.active-timer-stop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 100%;
    padding: 0 11px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
}

.active-timer-stop:hover,
.active-timer-arrow:hover {
    background: #ffe2de;
}

.active-timer-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 100%;
    border-left: 1px solid #d92d20;
    color: inherit;
    font-size: 22px;
}

.topbar .active-timer span {
    margin-left: 0;
    color: inherit;
}

.active-timer-time {
    min-width: 70px;
    font-variant-numeric: tabular-nums;
}

.time-dialog {
    width: min(560px, calc(100vw - 32px));
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(26, 31, 40, 0.24);
}

.time-dialog::backdrop {
    background: rgba(24, 29, 36, 0.48);
}

.time-dialog h2 {
    margin: 0 44px 18px 0;
    font-size: 22px;
}

.time-dialog-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--text);
    font-size: 22px;
}

.time-dialog-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}

.time-dialog-details div {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.time-dialog-details dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.time-dialog-details dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.time-note-form textarea {
    min-height: 110px;
}

.time-dialog-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.time-dialog-dates input {
    margin-bottom: 0;
}

.time-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
}

.time-dialog-actions .time-delete-button {
    border-color: color-mix(in srgb, var(--danger) 65%, var(--line));
    background: transparent;
    color: var(--danger);
}

.time-dialog-actions .time-delete-button:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.time-dialog-actions .time-delete-button[hidden] {
    display: none;
}

.time-tab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.time-tab-head h2 {
    margin: 0;
}

.manual-time-dialog,
.time-dialog[data-mode="edit"] {
    width: min(1040px, calc(100vw - 32px));
}

.time-dialog[data-mode="edit"] .time-dialog-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manual-time-dialog .time-input-group,
.time-dialog[data-mode="edit"] .time-input-group {
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: end;
}

.manual-time-dialog-form,
.time-note-form {
    display: grid;
    gap: 14px;
}

.manual-time-dialog .time-input-group,
.time-dialog[data-mode="edit"] .time-input-group,
.manual-time-dialog .manual-time-dialog-meta,
.time-dialog .time-dialog-meta {
    margin-bottom: 0;
}

.manual-time-dialog-meta,
.time-dialog-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.manual-time-dialog :is(.form-field, .time-dialog-meta label),
.time-dialog-meta label,
.time-dialog-note {
    display: grid;
    gap: 7px;
    margin: 0;
}

.time-project-transfer {
    display: grid;
    gap: 7px;
    margin: 0;
}

.time-project-transfer[hidden] {
    display: none;
}

.time-project-search-field {
    position: relative;
    display: block;
}

.time-project-search-field > input[type="text"] {
    width: 100%;
    height: var(--form-control-height, 38px);
    min-height: var(--form-control-height, 38px);
    margin: 0;
}

.time-project-suggestions {
    position: absolute;
    z-index: 40;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

.time-project-suggestions[hidden] {
    display: none;
}

.time-project-suggestions button {
    display: grid;
    justify-items: start;
    gap: 2px;
    width: 100%;
    min-height: 50px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    color: var(--text);
    text-align: left;
}

.time-project-suggestions button:last-child {
    border-bottom: 0;
}

.time-project-suggestions button:hover,
.time-project-suggestions button:focus-visible {
    background: var(--panel-muted);
}

.time-project-suggestions small {
    color: var(--muted);
}

.time-dialog-meta [hidden] {
    display: none;
}

.manual-time-dialog :is(input, select),
.time-dialog-meta select {
    height: var(--form-control-height, 38px);
    min-height: var(--form-control-height, 38px);
    margin: 0;
}

.manual-time-dialog-note textarea,
.time-dialog-note textarea {
    width: 100%;
    margin: 0;
}

.client-detail-heading-link {
    color: inherit;
    text-decoration: none;
}

.client-detail-heading-link:hover,
.client-detail-heading-link:focus-visible {
    color: var(--accent);
}

@media (max-width: 900px) {
    .manual-time-dialog .time-input-group,
    .time-dialog[data-mode="edit"] .time-input-group,
    .manual-time-dialog-meta,
    .time-dialog-meta,
    .time-dialog[data-mode="edit"] .time-dialog-details {
        grid-template-columns: 1fr;
    }

    .time-duration-inputs,
    .time-clock-inputs {
        flex-wrap: wrap;
    }
}

.status-mail-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 22px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.status-mail-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.status-mail-dialog h2 {
    margin: 0 44px 6px 0;
    font-size: 22px;
}

.status-mail-dialog > p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.6;
}

.status-mail-recipients {
    display: grid;
    gap: 8px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.status-mail-recipients legend {
    padding: 0 6px;
    font-weight: 700;
}

.status-mail-recipients .checkbox-field,
.status-mail-recipients p {
    margin: 0;
}

.status-mail-hint {
    display: block;
    margin: -8px 0 14px;
    color: var(--muted);
}

.status-mail-dialog textarea {
    min-height: 260px;
    resize: vertical;
}

.order-status-mail-option {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.nav-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: #fff;
    font-size: 20px;
}

.nav-icon.nav-create-trigger {
    border-color: #f9be20;
    background: #f9be20;
    color: #17191d;
    font-size: 25px;
}

.nav-icon.nav-create-trigger:hover,
.nav-icon.nav-create-trigger[aria-expanded="true"] {
    border-color: #ffd35d;
    background: #ffd35d;
    color: #17191d;
}

.nav-create-menu {
    position: relative;
    display: flex;
}

.nav-create-dropdown {
    position: absolute;
    z-index: 80;
    top: calc(100% + 9px);
    left: 0;
    width: 205px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);
}

.nav-create-dropdown[hidden] {
    display: none;
}

.nav-create-dropdown a {
    display: block;
    padding: 10px 11px;
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}

.nav-create-dropdown a:hover,
.nav-create-dropdown a:focus-visible {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.nav-icon:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.nav-icon.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.nav-icon.is-active:hover,
.nav-icon.is-active:focus-visible {
    border-color: var(--accent);
    background: #25282e;
    color: #fff;
}

.topbar .dashboard-home-icon,
.topbar .order-list-icon,
.topbar .order-list-icon > span,
.topbar .offer-list-icon,
.topbar .offer-list-icon > span,
.topbar .logout-icon,
.topbar .profile-user-icon {
    margin-left: 0;
    color: inherit;
}

.dashboard-home-icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.profile-user-icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.order-list-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 16px;
}

.order-list-icon::before {
    position: absolute;
    left: 6px;
    width: 14px;
    height: 2px;
    background: currentColor;
    content: '';
}

.order-list-icon::before {
    top: 2px;
    box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.order-list-icon::after {
    position: absolute;
    top: 1px;
    left: 0;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
    content: '';
}

.offer-list-icon {
    position: relative;
    display: block;
    width: 17px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.offer-list-icon::before {
    position: absolute;
    top: 4px;
    left: 3px;
    width: 7px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 5px 0 currentColor;
    content: '';
}

.offer-list-icon::after {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    background: var(--panel);
    content: '';
}

.offer-nav-icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.nav-icon.is-active .offer-list-icon::after {
    background: var(--accent);
}

.logout-icon {
    position: relative;
    display: block;
    width: 21px;
    height: 18px;
}

.logout-icon::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 18px;
    border: 2px solid currentColor;
    border-right: 0;
    content: '';
}

.logout-icon::after {
    position: absolute;
    top: 5px;
    right: 0;
    width: 13px;
    height: 9px;
    background: currentColor;
    clip-path: polygon(0 38%, 58% 38%, 58% 0, 100% 50%, 58% 100%, 58% 62%, 0 62%);
    content: '';
}

.purchase-nav-link {
    position: relative;
}

.topbar .purchase-nav-link span {
    margin-left: 0;
    color: inherit;
}

.purchase-nav-icon {
    position: relative;
    display: block;
    width: 19px;
    height: 15px;
    border: 2px solid currentColor;
    border-top: 0;
    transform: skew(-7deg);
}

.purchase-nav-icon::before {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 7px;
    height: 6px;
    border-top: 2px solid currentColor;
    content: '';
}

.purchase-nav-icon::after,
.purchase-nav-icon > span::after {
    position: absolute;
    bottom: -6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    content: '';
}

.purchase-nav-icon::after {
    left: 1px;
}

.purchase-nav-icon > span::after {
    right: 1px;
}

.purchase-nav-link small {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid var(--panel);
    border-radius: 9px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}

.purchase-nav-link.has-open-purchases:not(.is-active) {
    border-color: var(--accent);
    color: #fff;
    animation: purchase-alert 1.35s ease-in-out infinite;
}

.mail-import-nav-link {
    position: relative;
}

.topbar .mail-import-nav-link span {
    margin-left: 0;
    color: inherit;
}

.mail-envelope-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.mail-envelope-icon::before,
.mail-envelope-icon::after {
    position: absolute;
    top: 2px;
    width: 11px;
    height: 2px;
    background: currentColor;
    content: '';
}

.mail-envelope-icon::before {
    left: 0;
    transform: rotate(35deg);
}

.mail-envelope-icon::after {
    right: 0;
    transform: rotate(-35deg);
}

.topbar .newsletter-nav-link .mail-envelope-icon {
    margin: 0;
    color: inherit;
}

.mail-import-nav-link small {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid var(--panel);
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
}

.mail-import-nav-link.has-open-mail:not(.is-active) {
    border-color: var(--danger);
    color: #fff;
}

.knowledge-nav-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes purchase-alert {
    50% {
        background: var(--accent-soft);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .purchase-nav-link.has-open-purchases {
        animation: none;
    }
}

.mail-import-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.mail-import-header,
.mail-import-row {
    display: grid;
    grid-template-columns: 150px 220px minmax(360px, 1fr) 175px;
    gap: 14px;
    align-items: center;
    min-width: 920px;
    padding: 10px 14px;
}

.mail-import-header {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.mail-import-row {
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.mail-import-row.is-alternate {
    background: var(--panel-alt);
}

.mail-import-row.has-error {
    box-shadow: inset 6px 0 0 var(--danger);
}

.mail-import-row-error {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 700;
}

.mail-import-client {
    min-width: 0;
}

.mail-import-client.is-unknown {
    padding: 8px 10px;
    border-left: 5px solid var(--danger);
    border-radius: 4px;
    background: color-mix(in srgb, var(--danger) 13%, var(--panel));
}

.mail-import-client-warning,
.mail-import-client-similar {
    display: block;
    margin-top: 4px;
    line-height: 1.3;
}

.mail-import-client-warning {
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.mail-import-client-similar {
    color: var(--text);
    font-size: 11px;
}

.mail-import-content {
    min-width: 0;
}

.mail-import-content a:hover {
    color: var(--accent);
}

.mail-import-content > p {
    margin: 5px 0 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.mail-import-attachments,
.imported-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 9px;
}

.imported-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.imported-attachment-item form {
    margin: 0;
}

.imported-attachment-item .settings-delete-button {
    width: 28px;
    height: 28px;
    padding: 0;
}

.imported-attachments {
    margin: 18px 0;
}

.imported-attachments h3 {
    flex-basis: 100%;
    margin: 0;
}

.mail-import-attachments a,
.imported-attachments a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-ink);
    font-size: 12px;
}

.paperclip-icon {
    display: inline-block;
    width: 8px;
    height: 15px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    transform: rotate(38deg);
}

.mail-import-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    border-color: var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.mail-import-row .settings-delete-button {
    width: 34px;
    height: 34px;
    margin: 0;
}

.mail-import-action .offer-list-icon,
.mail-import-action .order-list-icon,
.mail-import-action .archive-box-icon,
.mail-import-action .archive-box-icon > span {
    margin-left: 0;
    color: inherit;
}

.mail-refresh-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 7px;
    border: 2px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
}

.mail-import-detail-page {
    max-width: 1120px;
    margin: 0 auto;
}

.mail-import-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.mail-import-detail-meta > div {
    min-width: 0;
    padding: 14px 16px;
    background: var(--panel);
}

.mail-import-detail-meta span,
.mail-import-detail-meta strong,
.mail-import-detail-meta small {
    display: block;
}

.mail-import-detail-meta span {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.mail-import-detail-meta small {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: var(--muted);
}

.mail-import-detail-warning {
    display: grid;
    gap: 5px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-left: 6px solid var(--danger);
    border-radius: 6px;
    background: color-mix(in srgb, var(--danger) 13%, var(--panel));
}

.mail-import-detail-warning strong {
    color: var(--danger);
}

.mail-import-message,
.mail-import-detail-attachments {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.mail-import-message h2,
.mail-import-detail-attachments h2 {
    margin: 0 0 16px;
    font-size: 19px;
}

.mail-import-message-body {
    overflow-wrap: anywhere;
    color: var(--text);
    line-height: 1.6;
    white-space: normal;
}

.mail-import-detail-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mail-import-attachment-head {
    display: flex;
    flex: 1 0 100%;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.mail-import-attachment-head h2,
.mail-import-attachment-head form {
    margin: 0;
}

.mail-import-detail-attachments h2 {
    flex-basis: 100%;
}

.mail-import-detail-attachments > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
}

.mail-import-detail-attachments > a:hover {
    border-color: var(--accent);
}

.mail-import-detail-attachments small {
    color: var(--muted);
}

.mail-import-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mail-import-detail-actions form {
    margin: 0;
}

.mail-import-detail-actions button {
    gap: 9px;
}

.mail-import-detail-actions .primary-button {
    gap: 9px;
}

.mail-import-detail-actions .offer-list-icon,
.mail-import-detail-actions .order-list-icon,
.mail-import-detail-actions .archive-box-icon,
.mail-import-detail-actions .archive-box-icon > span {
    margin-left: 0;
    color: inherit;
}

.mail-import-project-assignment {
    display: grid;
    grid-template-columns: minmax(230px, .7fr) minmax(420px, 1.3fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}
.mail-import-project-assignment h2 { margin: 0 0 7px; font-size: 19px; }
.mail-import-project-assignment p { margin: 0; color: var(--muted); }
.mail-import-project-assignment form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin: 0;
}
.mail-import-project-assignment input,
.mail-import-project-assignment button { height: 38px; margin: 0; }
.mail-import-project-assignment .text-reference-suggestions { width: 100%; }
.mail-import-project-assignment .text-reference-option {
    height: auto;
    min-height: 52px;
}

@media (max-width: 760px) {
    .mail-import-detail-meta {
        grid-template-columns: 1fr;
    }
    .mail-import-project-assignment,
    .mail-import-project-assignment form { grid-template-columns: 1fr; }
}

/* Eisstock-Spielplanung */
.eisstock-schedule-head,
.eisstock-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.eisstock-schedule-head h2,
.eisstock-block-head h3 {
    margin: 0;
}

.eisstock-schedule-head p,
.eisstock-block-head p {
    margin: 5px 0 0;
    color: var(--muted);
}

.eisstock-plan-event-filter {
    margin: 20px 0;
}

.eisstock-plan-event-filter .filter-group {
    min-width: min(100%, 430px);
}

.eisstock-plan-block {
    margin-top: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
}

details.eisstock-plan-block > summary {
    padding: 15px 18px;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

details.eisstock-plan-block[open] > summary {
    border-bottom: 1px solid var(--line);
}

.eisstock-plan-block:not(details),
.eisstock-plan-form {
    padding: 18px;
}

.eisstock-plan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.eisstock-plan-grid .span-2 {
    grid-column: span 2;
}

.eisstock-plan-checkbox {
    min-height: var(--form-control-height, 38px);
    margin-top: 24px;
}

.eisstock-ranking-settings,
.eisstock-game-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.eisstock-plan-form h3 {
    margin: 24px 0 12px;
    font-size: 16px;
}

.eisstock-plan-form > .form-field {
    margin-top: 18px;
}

.eisstock-team-actions,
.eisstock-flow-actions {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.eisstock-team-actions form,
.eisstock-flow-actions form {
    margin: 0;
}

.eisstock-team-actions .ui-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eisstock-team-actions input {
    width: min(360px, 60vw);
}

.eisstock-team-list {
    margin-top: 18px;
    overflow: visible;
}

.eisstock-team-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 70px;
    align-items: center;
    gap: var(--list-cell-gap, 12px);
    min-height: var(--list-row-height, 54px);
    padding: 0 var(--list-inline-padding, 12px);
    border-bottom: 1px solid var(--line);
}

.eisstock-team-row.ui-list-header {
    min-height: var(--list-header-height, 42px);
}

.eisstock-team-row select {
    width: 100%;
}

.eisstock-standing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
    gap: 16px;
    margin-top: 18px;
}

.eisstock-standing-table {
    overflow-x: auto;
    border: 1px solid var(--line);
}

.eisstock-standing-table h4,
.eisstock-game-section-title {
    margin: 0;
    padding: 13px 14px;
    color: var(--accent);
    font-size: 15px;
}

.eisstock-standing-row {
    display: grid;
    grid-template-columns: 35px minmax(150px, 1fr) repeat(4, 35px) 82px 48px 40px;
    align-items: center;
    min-width: 560px;
    min-height: 40px;
    padding: 0 10px;
    border-top: 1px solid var(--line);
    font-size: 13px;
}

.eisstock-standing-row:nth-child(odd) {
    background: var(--panel-alt);
}

.eisstock-standing-row.is-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.eisstock-standing-row > :not(:nth-child(2)) {
    text-align: center;
}

.eisstock-game-list {
    display: grid;
    gap: 8px;
}

.eisstock-game {
    border: 1px solid var(--line);
    border-left: 4px solid var(--muted);
    background: var(--panel-alt);
}

.eisstock-game.is-complete {
    border-left-color: var(--success, #31b76a);
}

.eisstock-game > summary {
    display: grid;
    grid-template-columns: 48px minmax(260px, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 8px 14px;
    cursor: pointer;
}

.eisstock-game > summary small,
.eisstock-game > summary strong {
    display: block;
}

.eisstock-game > summary small,
.eisstock-game > summary time,
.eisstock-bye {
    color: var(--muted);
}

.eisstock-game > summary strong b,
.eisstock-live-total {
    color: var(--accent);
}

.eisstock-game-number {
    color: var(--muted);
    font-size: 12px;
}

.eisstock-result-form {
    padding: 16px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.eisstock-innings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 9px;
    margin: 17px 0;
}

.eisstock-inning {
    display: grid;
    grid-template-columns: 1fr 48px 12px 48px;
    align-items: center;
    gap: 5px;
}

.eisstock-inning span {
    color: var(--muted);
    font-size: 12px;
}

.eisstock-inning input {
    width: 48px;
    padding-inline: 5px;
    text-align: center;
}

.eisstock-live-total {
    margin: 0 0 14px;
    text-align: right;
}

.eisstock-bye {
    margin: 0;
    padding: 14px 18px;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .eisstock-plan-grid,
    .eisstock-ranking-settings,
    .eisstock-game-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .eisstock-schedule-head,
    .eisstock-block-head {
        align-items: stretch;
        flex-direction: column;
    }

    .eisstock-plan-grid,
    .eisstock-ranking-settings,
    .eisstock-game-meta {
        grid-template-columns: 1fr;
    }

    .eisstock-plan-grid .span-2 {
        grid-column: auto;
    }

    .eisstock-team-row {
        grid-template-columns: minmax(130px, 1fr) 130px 48px;
    }

    .eisstock-game > summary {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .eisstock-game > summary time {
        grid-column: 2;
    }
}

.calendar-nav-icon,
.calendar-nav-icon * {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calendar-nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.appointment-planning {
    grid-column: 1 / -1;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.appointment-planning-summary {
    display: flex;
    align-items: center;
    min-height: 48px;
    cursor: pointer;
    list-style-position: outside;
}

.appointment-planning-summary span {
    display: grid;
    gap: 3px;
}

.appointment-planning-summary strong {
    font-size: 18px;
}

.appointment-planning-summary small {
    color: var(--muted);
    font-size: 13px;
}

.appointment-planning-toolbar {
    margin-top: 12px;
}

.appointment-planning-head,
.appointment-entry-head,
.calendar-toolbar,
.calendar-period-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.appointment-planning-head h2,
.appointment-planning-head p {
    margin: 0;
}

.appointment-planning-head p {
    margin-top: 4px;
    color: var(--muted);
}

.appointment-entry-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.appointment-entry {
    padding: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.appointment-entry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.appointment-entry-grid label,
.appointment-entry-grid legend {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
}

.appointment-entry-grid input,
.appointment-entry-grid select,
.appointment-entry-grid textarea,
.profile-appointment-form input,
.profile-appointment-form select,
.profile-appointment-form textarea {
    width: 100%;
}

.appointment-participants {
    display: flex;
    grid-column: span 2;
    flex-wrap: wrap;
    gap: 8px 14px;
    min-width: 0;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
}

.appointment-participants .checkbox-field {
    margin: 0;
}

.appointment-info {
    grid-column: span 2;
}

.appointment-range-choice {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.appointment-range-choice .checkbox-field {
    margin: 0;
}

.appointment-mail-option {
    margin-top: 16px;
}

.appointment-empty {
    margin-top: 12px;
}

.appointment-read-list,
.profile-appointment-list {
    display: grid;
    gap: 8px;
}

.appointment-read-list article,
.profile-appointment-list > article {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-left: 5px solid var(--appointment-color);
    background: var(--panel-alt);
}

.appointment-read-list article {
    align-items: flex-start;
    flex-direction: column;
}

.profile-appointment-list > article > div {
    display: grid;
    flex: 1;
    gap: 3px;
}

.profile-appointment-list span,
.profile-appointment-list small {
    color: var(--muted);
}

.profile-appointment-list > article > .icon-button,
.profile-appointment-list > article > form .settings-delete-button {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
}

.profile-appointment-list > article > form {
    display: flex;
    align-items: center;
    margin: 0;
}

.profile-appointment-subtabs {
    display: flex;
    gap: 6px;
    margin: 22px 0 12px;
    border-bottom: 1px solid var(--line);
}

.profile-appointment-subtabs button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 -1px;
    padding: 9px 13px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
}

.profile-appointment-subtabs button:hover,
.profile-appointment-subtabs button.is-active {
    border-bottom-color: var(--accent);
    background: transparent;
    color: var(--text);
}

.profile-appointment-subtabs button span {
    display: inline-flex;
    min-width: 21px;
    min-height: 21px;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 11px;
}

.profile-appointment-subpanel[hidden] {
    display: none;
}

.profile-appointment-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
}

.profile-appointment-label,
.profile-appointment-info {
    grid-column: span 2;
}

.profile-appointment-dialog {
    width: min(680px, calc(100vw - 32px));
}

.profile-appointment-dialog form,
.profile-appointment-dialog label {
    display: grid;
    gap: 6px;
}

.profile-appointment-dialog form {
    gap: 12px;
}

.profile-appointment-dialog-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.appointment-category-form {
    grid-template-columns: minmax(240px, 1fr) 100px auto auto;
}

.appointment-category-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
}

.appointment-category-row > form:first-of-type {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 80px auto auto auto;
    align-items: center;
    gap: 10px;
}

.planning-list-section + .planning-list-section {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.planning-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.planning-section-head h2,
.planning-section-head p {
    margin: 0;
}

.planning-section-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.planning-list-empty {
    margin: 0;
}

.planning-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.planning-table-head,
.planning-table-row {
    display: grid;
    align-items: center;
    gap: 14px;
    min-width: 900px;
    padding: 10px 12px;
}

.planning-reminder-table .planning-table-head,
.planning-reminder-table .planning-table-row {
    grid-template-columns: 150px 90px minmax(180px, 1.2fr) minmax(160px, 1fr) 120px 46px;
}

.planning-reminder-table.planning-table-no-action .planning-table-head,
.planning-reminder-table.planning-table-no-action .planning-table-row {
    grid-template-columns: 150px 90px minmax(180px, 1.2fr) minmax(160px, 1fr) 120px;
}

.planning-appointment-table .planning-table-head,
.planning-appointment-table .planning-table-row {
    grid-template-columns: 175px 120px minmax(180px, 1fr) minmax(150px, .9fr) minmax(160px, 1fr) 46px;
}

.planning-appointment-table.planning-table-no-action .planning-table-head,
.planning-appointment-table.planning-table-no-action .planning-table-row {
    grid-template-columns: 175px 120px minmax(180px, 1fr) minmax(150px, .9fr) minmax(160px, 1fr);
}

.planning-table-head {
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.planning-table-row {
    border-top: 1px solid var(--line);
}

.planning-table-row:nth-child(odd) {
    background: var(--panel-alt);
}

.planning-appointment-table .planning-table-row {
    border-left: 5px solid var(--appointment-color);
}

.planning-table-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.planning-table-row strong,
.planning-table-row small {
    display: block;
}

.planning-appointment-table .planning-table-row > span:nth-child(5) {
    white-space: pre-line;
}

.planning-dialog > .alert {
    margin: 16px 20px 0;
}

.planning-dialog > .alert small {
    display: block;
    margin-top: 5px;
}

.planning-table-row small {
    margin-top: 3px;
    color: var(--muted);
}

.planning-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 26px;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
    overflow-wrap: normal;
    white-space: nowrap;
}

.planning-reminder-table .planning-table-head > span:nth-child(5),
.planning-reminder-table .planning-table-row > span:nth-child(5) {
    overflow-wrap: normal;
    text-align: center;
    white-space: nowrap;
}

.planning-status-versendet {
    border: 0;
    color: #61c981;
}

.planning-status-fehler {
    border-color: #b84b4b;
    color: #ef7777;
}

.planning-dialog {
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: auto;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
}

.planning-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
}

.planning-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.planning-dialog-head > div {
    display: grid;
    gap: 4px;
}

.planning-dialog-head strong {
    font-size: 18px;
}

.planning-dialog-head small {
    color: var(--muted);
}

.planning-dialog-form {
    padding: 20px;
}

.planning-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.planning-dialog-grid > label:not(.checkbox-field) {
    display: grid;
    gap: 7px;
}

.planning-dialog-grid input,
.planning-dialog-grid select,
.planning-dialog-grid textarea {
    width: 100%;
}

.planning-dialog-wide {
    grid-column: 1 / -1;
}

.planning-recipient-field {
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
}

.planning-recipient-field legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 13px;
}

.planning-recipient-field > div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.planning-recipient-field .checkbox-field {
    margin: 0;
}

.planning-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.planning-dialog-delete {
    margin: 0 20px 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.planning-dialog-delete .settings-delete-button {
    width: auto;
}

.planning-dialog-delete-form {
    display: none;
}

.calendar-event-dialog-actions .calendar-event-delete-button {
    width: auto;
    margin: 0;
    font-size: inherit;
}

@media (max-width: 760px) {
    .planning-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .planning-table {
        overflow-x: auto;
    }

    .planning-dialog-grid {
        grid-template-columns: 1fr;
    }

    .planning-dialog-wide {
        grid-column: auto;
    }
}

.calendar-page {
    overflow-x: auto;
}

.calendar-toolbar {
    margin-bottom: 16px;
}

.calendar-period-navigation h1 {
    margin: 0 0 0 8px;
    font-size: 22px;
}

.calendar-period-navigation h1 small {
    color: var(--muted);
    font-size: 14px;
}

.calendar-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-user-filter {
    width: 240px;
}

.calendar-filters .filter-multi-select summary,
.calendar-filters select,
.calendar-filters .segmented-control,
.calendar-filter-submit {
    box-sizing: border-box;
    height: 42px;
    min-height: 42px;
    margin: 0;
}

.calendar-filters .segmented-control button {
    height: 40px;
    margin: 0;
}

.calendar-user-filter .filter-check-options {
    right: 0;
    left: auto;
    width: max-content;
    min-width: 240px;
    max-width: min(360px, calc(100vw - 32px));
}

.calendar-create-button {
    flex: 0 0 auto;
}

.calendar-create-dialog {
    width: min(680px, calc(100vw - 32px));
}

.calendar-appointment-users {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 7px;
}

.calendar-appointment-users legend {
    padding: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.calendar-appointment-users .filter-check-options {
    width: 100%;
}

.calendar-range-toggle {
    margin: 0;
}

.segmented-control {
    display: flex;
    height: 38px;
    border: 1px solid var(--line);
}

.segmented-control button {
    min-width: 70px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    color: var(--text);
}

.segmented-control button:last-child {
    border-right: 0;
}

.segmented-control button.is-active {
    background: var(--accent);
    color: var(--accent-contrast);
}

.calendar-month {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    min-width: 1050px;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.calendar-weekday {
    padding: 10px;
    background: var(--panel-alt);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.calendar-month-day {
    min-height: 150px;
    padding: 8px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.calendar-month-day.is-holiday {
    background: var(--calendar-holiday-background);
    box-shadow: inset 0 4px 0 var(--calendar-holiday-color);
}

.calendar-month-day.is-outside {
    background: var(--bg);
    color: var(--muted);
}

.calendar-month-day.is-holiday.is-outside {
    background: var(--calendar-holiday-background);
}

.calendar-month-day.is-today > header {
    padding: 4px 7px;
    border-radius: 4px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 700;
}

.calendar-month-day header {
    margin-bottom: 6px;
    text-align: right;
}

.calendar-all-day-stack {
    display: grid;
    grid-template-rows: repeat(var(--calendar-all-day-lanes, 1), minmax(31px, auto));
    grid-template-columns: minmax(0, 1fr);
}

.calendar-all-day-slot {
    grid-row: var(--calendar-all-day-lane, 1);
    grid-column: 1;
    min-width: 0;
}

.calendar-event {
    display: grid;
    gap: 1px;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    align-items: stretch;
    justify-content: stretch;
    margin-bottom: 4px;
    padding: 5px 7px;
    overflow: hidden;
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: 0;
    background: color-mix(in srgb, var(--calendar-event-color) 22%, var(--panel));
    border-left: 4px solid var(--calendar-event-color);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    text-align: left;
}

.calendar-event:hover {
    background: color-mix(in srgb, var(--calendar-event-color) 35%, var(--panel));
}

.calendar-event.is-all-day-range {
    position: relative;
    z-index: 2;
    min-height: 27px;
    box-shadow:
        inset 0 1px color-mix(in srgb, var(--calendar-event-color) 55%, var(--line)),
        inset 0 -1px color-mix(in srgb, var(--calendar-event-color) 55%, var(--line));
}

.calendar-event.is-all-day-range.continues-before {
    width: calc(100% + 9px);
    margin-left: -9px;
    padding-left: 9px;
    border-left: 0;
}

.calendar-event.is-all-day-range.continues-after {
    width: calc(100% + 9px);
    margin-right: -9px;
}

.calendar-event.is-all-day-range.continues-before.continues-after {
    width: calc(100% + 18px);
}

.calendar-event-continuation {
    min-height: 15px;
}

.calendar-event time,
.calendar-event small {
    color: var(--muted);
    font-size: 11px;
}

.calendar-event-title,
.calendar-event small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event-title {
    display: block;
}

.calendar-event-title strong {
    font-weight: 800;
}

.calendar-event-users {
    color: var(--muted);
    font-weight: 400;
}

.calendar-event-dialog {
    width: min(620px, calc(100vw - 32px));
    background: var(--panel);
    color: var(--text);
}

.calendar-event-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
}

.calendar-event-details div {
    padding: 10px 12px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
}

.calendar-event-details dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.calendar-event-details dd {
    margin: 0;
}

.calendar-event-info {
    margin-top: 18px;
}

.calendar-event-info h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.calendar-event-info p {
    margin: 0;
    white-space: normal;
}

.calendar-event-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.calendar-event-edit[hidden],
[data-calendar-event-details][hidden] {
    display: none;
}

.calendar-event-edit > h2 {
    margin: 0 0 18px;
}

.calendar-event-edit form {
    display: grid;
    gap: 14px;
}

.calendar-event-edit form > label {
    display: grid;
    gap: 7px;
    margin: 0;
}

.calendar-event-edit form > .checkbox-field {
    display: flex;
}

.calendar-event-edit textarea {
    min-height: 108px;
    resize: vertical;
}

@media (max-width: 560px) {
    .calendar-event-details {
        grid-template-columns: 1fr;
    }
}

.calendar-time-view {
    display: grid;
    grid-template-columns: 72px repeat(var(--calendar-days), minmax(180px, 1fr));
    min-width: calc(72px + var(--calendar-days) * 180px);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.calendar-time-corner,
.calendar-day-heading,
.calendar-all-day-label,
.calendar-all-day-cell,
.calendar-hour-label,
.calendar-hour-cell {
    padding: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.calendar-day-heading,
.calendar-time-corner,
.calendar-all-day-label {
    background: var(--panel-alt);
}

.calendar-day-heading {
    text-align: center;
}

.calendar-day-heading.is-holiday,
.calendar-all-day-cell.is-holiday,
.calendar-hour-cell.is-holiday {
    background: var(--calendar-holiday-background);
}

.calendar-day-heading.is-holiday {
    box-shadow: inset 0 4px 0 var(--calendar-holiday-color);
}

.calendar-day-heading.is-today {
    background: var(--accent);
    color: var(--accent-contrast);
}

.calendar-all-day-label,
.calendar-hour-label {
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.calendar-all-day-cell {
    min-height: 54px;
    background: var(--panel);
}

.calendar-hour-cell {
    position: relative;
    height: var(--calendar-slot-height, 30px);
    min-height: var(--calendar-slot-height, 30px);
    padding: 3px;
    background: var(--panel);
}

.calendar-hour-cell .calendar-event.is-timed-block {
    position: absolute;
    z-index: 3;
    top: var(--calendar-event-top, 3px);
    right: auto;
    left: calc(var(--calendar-event-left, 0%) + 3px);
    width: calc(var(--calendar-event-width, 100%) - 6px);
    height: var(--calendar-event-height, 32px);
    margin: 0;
    align-content: start;
    border-top: 1px solid color-mix(in srgb, var(--calendar-event-color) 65%, var(--line));
    border-right: 1px solid color-mix(in srgb, var(--calendar-event-color) 65%, var(--line));
    border-bottom: 1px solid color-mix(in srgb, var(--calendar-event-color) 65%, var(--line));
}

.calendar-hour-label.is-half-hour,
.calendar-hour-cell.is-half-hour {
    border-bottom-color: color-mix(in srgb, var(--line) 55%, transparent);
}

.calendar-hour-label.is-half-hour {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
    font-size: 11px;
}

@media (max-width: 900px) {
    .time-duration-inputs,
    .time-clock-inputs {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .time-clock-inputs label {
        flex: 0 0 112px;
        min-width: 112px;
    }

    .time-clock-inputs label:first-child {
        flex: 1 1 180px;
        min-width: min(180px, 100%);
    }

    .internal-task-selector-row {
        grid-template-columns: 1fr;
    }

    .calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .appointment-entry-grid,
    .profile-appointment-form {
        grid-template-columns: repeat(2, minmax(150px, 1fr));
    }
}

/* Interne Aufgaben und Zeiterfassungsstatistiken */
.internal-task-table .orders-header,
.internal-task-table .order-row {
    grid-template-columns: 105px 150px minmax(260px, 1.6fr) minmax(160px, 1fr) 150px 90px;
    min-width: 980px;
}

.internal-task-table .order-row {
    min-height: 56px;
    color: var(--text);
    text-decoration: none;
}

.internal-task-head .primary-button {
    flex: 0 0 auto;
}

.internal-task-table mark {
    justify-self: start;
    max-width: 100%;
}

.internal-task-name,
.internal-task-table .order-row > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.internal-task-due {
    color: var(--danger);
    font-weight: 700;
}

.internal-task-title-cell {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 7px 0;
}

.internal-task-row-tags {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 5px;
}

.internal-task-row-tags .tag-badge {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
}

.internal-task-detail-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--status-color);
}

.internal-task-filters .filter-search {
    flex: 1 1 340px;
}

.internal-task-filters input[type="search"] {
    width: 100%;
    height: 42px;
    margin-bottom: 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
    font: inherit;
}

.internal-task-filters button {
    height: 42px;
}

.restricted-order-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--line);
}

.restricted-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--panel);
}

.restricted-order-row.is-alternate {
    background: var(--panel-alt);
}

.restricted-order-row > a {
    display: grid;
    grid-template-columns: 110px minmax(180px, 0.55fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.restricted-order-row p {
    overflow: hidden;
    margin: 0;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.internal-task-nav-icon,
.routine-nav-icon,
.statistics-nav-icon,
.eisstock-nav-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.routines-page {
    max-width: 1500px;
    margin: 0 auto;
}

.routine-list-head,
.routine-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) 150px 170px 170px 140px 90px 58px;
    gap: 14px;
    align-items: center;
    padding: 0 14px;
}

.routine-list-head {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.routine-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.routine-row {
    min-height: 58px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: background-color 120ms ease;
}

.routine-row.is-alternate {
    background: var(--panel-alt);
}

.routine-row:hover {
    background: var(--accent-soft);
}

.routine-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.routine-row:last-child {
    border-bottom: 0;
}

.routine-row > span:first-child {
    display: grid;
    gap: 3px;
}

.routine-row-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.routine-row small,
.routine-open-row small {
    color: var(--muted);
}

.routine-state {
    font-weight: 700;
}

.routine-state.is-active {
    color: var(--success);
}

.routine-state.is-inactive {
    color: var(--muted);
}

.routine-open-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.routine-open-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 1fr) max-content;
    gap: 12px;
    align-items: end;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-alt);
}

.routine-open-row > a {
    display: grid;
    gap: 4px;
    color: var(--text);
    text-decoration: none;
}

.routine-open-row input,
.routine-open-row button {
    margin: 0;
}

.routine-core-grid label,
.routine-info-field {
    display: grid;
    gap: 8px;
    margin: 0;
}

.routine-core-grid {
    display: grid;
    gap: 16px;
    width: 100%;
}

.routine-form-row {
    display: grid;
    gap: 14px;
    align-items: end;
    width: 100%;
}

.routine-form-row-main {
    grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
}

.routine-form-row-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.routine-form-row-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.routine-schedule-help {
    margin: -5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.routine-schedule-row label.is-inactive {
    opacity: .48;
}

.routine-core-grid input,
.routine-core-grid select {
    margin: 0;
}

.routine-info-field {
    margin-top: 18px;
}

.routine-relations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.routine-relations .tag-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.routine-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.routine-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.routine-detail-page > .routine-form {
    padding-top: 8px;
}

.routine-detail-grid {
    margin-bottom: 22px;
}

.routine-detail-history article > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.routine-history-head,
.routine-history-list article {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) 150px 150px 110px minmax(170px, 1fr) 110px;
    gap: 14px;
    align-items: center;
    min-height: 46px;
    padding: 0 14px;
}

.routine-history-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.routine-history-list article {
    border-bottom: 1px solid var(--line);
}

.routine-history-list article:nth-child(even) {
    background: var(--panel-alt);
}

.dashboard-routine-list {
    display: grid;
}

.dashboard-routine-list form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.dashboard-routine-list form:last-child {
    border-bottom: 0;
}

.dashboard-routine-list form > div {
    display: grid;
    gap: 3px;
}

.dashboard-routine-list form > div small {
    color: var(--muted);
}

.dashboard-routine-list form p {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard-routine-list input {
    grid-column: 1;
    height: var(--quick-control-height, 34px);
    margin: 0;
}

.dashboard-routine-list .routine-complete-button {
    grid-column: 2;
    grid-row: 1;
}

@media (max-width: 1050px) {
    .routine-list-head,
    .routine-history-head {
        display: none;
    }

    .routine-row,
    .routine-history-list article {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 12px 14px;
    }

    .routine-relations {
        grid-template-columns: 1fr;
    }

    .routine-form-row-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .routine-form-row-main,
    .routine-form-row-four,
    .routine-form-row-two {
        grid-template-columns: 1fr;
    }
}

.statistics-form {
    margin-bottom: 22px;
}

.statistics-tab-panel {
    padding-top: 18px;
}

.work-statistics-filter { display: grid; grid-template-columns: minmax(180px,1fr) 170px 170px max-content max-content max-content; margin-bottom: 20px; }
.admin-work-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.admin-work-row { display: grid; grid-template-columns: 42px 100px minmax(135px,1fr) 65px 65px 96px 90px 96px minmax(220px,auto); gap: 10px; align-items: center; min-width: 1040px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin-work-row:last-child { border-bottom: 0; }
.admin-work-row > span:not(.work-time-actions), .admin-work-row > strong { text-align: center; }
.admin-work-row.is-weekend { background: color-mix(in srgb, var(--panel-muted) 72%, var(--panel)); }
.work-time-entry-grid { display: grid; grid-template-columns: 1fr 180px; gap: 14px; margin-bottom: 14px; }
.work-time-confirmation-status.is-confirmed { border-color: #58b96d; background: #58b96d; color: #fff; font-size: 19px; font-weight: 800; }
.work-time-confirmation-status.is-unconfirmed { border-color: #d85f67; background: #d85f67; color: #fff; font-size: 22px; font-weight: 500; }
@media (max-width: 800px) { .work-statistics-filter { grid-template-columns: 1fr 1fr; } .work-time-date-grid { grid-template-columns: 1fr; } }

.statistics-form .form-grid > label,
.statistics-form .statistics-client-filter {
    display: grid;
    align-content: start;
    gap: 12px;
    margin: 0;
}

.statistics-form .form-grid > label > select,
.statistics-form .form-grid > label > input,
.statistics-form .statistics-client-filter > input {
    margin: 0;
}

.statistics-form .statistics-client-filter > label {
    margin: 0;
}

.statistics-form .form-grid small {
    display: block;
    min-height: 18px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
}

.statistics-form-actions {
    margin-top: 22px;
}

.statistics-client-filter {
    width: 100%;
}

.statistics-client-filter .suggestions {
    top: 72px;
}

.eisstock-page,
.eisstock-form-page {
    max-width: 1700px;
    margin: 0 auto;
}

.eisstock-section {
    padding: 18px;
}

.eisstock-filters .eisstock-search-field {
    flex: 1 1 320px;
}

.eisstock-filters input[type="search"] {
    width: 100%;
    margin: 0;
}

.eisstock-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.eisstock-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.15fr) minmax(170px, 1fr) minmax(150px, .9fr) minmax(210px, 1.15fr) 130px 105px 54px;
    gap: 12px;
    align-items: center;
    min-width: 1180px;
    min-height: 58px;
    padding: 9px 13px;
    border-bottom: 1px solid var(--line);
}

.eisstock-row:last-child {
    border-bottom: 0;
}

.eisstock-row.is-alternate {
    background: var(--panel-alt);
}

.eisstock-row.is-pending {
    box-shadow: inset 6px 0 0 var(--danger);
}

.eisstock-head {
    min-height: 44px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.eisstock-contact {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.eisstock-contact a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eisstock-state {
    display: grid;
    gap: 2px;
    font-size: 13px;
    font-weight: 700;
}

.eisstock-state.is-pending {
    color: var(--danger);
}

.eisstock-state.is-released {
    color: var(--success);
}

.eisstock-state small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.eisstock-event-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 170px 170px max-content;
    gap: 14px;
    align-items: end;
    margin-bottom: 24px;
}

.eisstock-event-form > div {
    display: grid;
    gap: 7px;
}

.eisstock-event-form input,
.eisstock-event-form button {
    margin: 0;
}

.eisstock-event-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.eisstock-event-list-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: end;
    padding: 10px 0 8px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.eisstock-event-head-fields {
    grid-template-columns: minmax(260px, 1fr) 170px 170px 70px max-content;
    margin: 0;
}

.eisstock-event-head-fields span:nth-child(4),
.eisstock-event-head-fields span:nth-child(5) {
    text-align: center;
}

.eisstock-event-row .eisstock-event-form {
    grid-template-columns: minmax(260px, 1fr) 170px 170px 70px max-content;
    margin: 0;
}

.eisstock-event-count {
    align-self: end;
    justify-self: center;
    color: var(--text);
    font-size: 22px;
    font-weight: 700;
    line-height: 42px;
}

.eisstock-event-row > form:last-child {
    align-self: end;
    margin: 0;
}

.eisstock-event-row > form:last-child .settings-delete-button {
    margin: 0;
}

.eisstock-import-notice {
    color: var(--danger);
    font-weight: 700;
}

.eisstock-registration-form > .form-grid,
.eisstock-invoice-section {
    margin-bottom: 20px;
}

.eisstock-invoice-section h2 {
    margin: 0 0 12px;
}

.eisstock-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.eisstock-delete-registration {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

@media (max-width: 1000px) {
    .eisstock-event-list-head {
        display: none;
    }

    .eisstock-event-form,
    .eisstock-event-row .eisstock-event-form {
        grid-template-columns: 1fr;
    }
}

.statistics-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.statistics-table .data-row {
    display: grid;
    grid-template-columns: 180px minmax(220px, 1fr) minmax(160px, 1fr) 150px;
    gap: 14px;
    align-items: center;
    min-height: 48px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.statistics-table .data-row:last-child {
    border-bottom: 0;
}

.statistics-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.statistics-delete-form {
    margin: 0;
}

.statistics-actions .settings-delete-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    color: var(--danger);
    font-size: 20px;
    line-height: 1;
}

.ui-icon-button.ui-pdf-icon {
    padding: 0;
    border-color: #d6d6d6;
    background: #fff;
    color: #d93636;
    font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
}

.ui-icon-button.ui-pdf-icon:hover,
.ui-icon-button.ui-pdf-icon:focus-visible {
    border-color: #d93636;
    background: #fff;
    color: #b42323;
}

.statistics-table .data-head {
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.weekly-hours-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.weekly-hours-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.15fr) repeat(7, minmax(145px, 1fr));
    gap: 0;
    align-items: stretch;
    min-width: 1240px;
    border-bottom: 1px solid var(--line);
}

.weekly-hours-row:last-child {
    border-bottom: 0;
}

.weekly-hours-row:nth-child(odd):not(.weekly-hours-head) {
    background: var(--panel-alt);
}

.weekly-hours-row > span,
.weekly-hours-row > strong {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 10px 12px;
    border-right: 1px solid var(--line);
}

.weekly-hours-row > :last-child {
    border-right: 0;
}

.weekly-hours-row > strong {
    flex-wrap: wrap;
    gap: 4px 8px;
}

.weekly-hours-row > strong small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.weekly-hours-head {
    background: var(--panel-alt);
    color: var(--muted);
}

.weekly-hours-head > span {
    display: grid;
    align-content: center;
    gap: 3px;
    font-size: 11px;
    text-transform: uppercase;
}

.weekly-hours-head strong {
    color: var(--text);
    font-size: 12px;
}

.weekly-hours-head small {
    font-size: 10px;
    font-weight: 500;
    line-height: 1.35;
    text-transform: none;
}

.statistics-total,
.statistics-group header,
.statistics-group > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.statistics-total {
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid var(--accent);
    background: var(--accent-soft);
}

.statistics-total strong {
    font-size: 22px;
}

.statistics-group {
    border-top: 1px solid var(--line);
}

.statistics-group header {
    padding: 14px 0;
}

.statistics-group header h2 {
    margin: 0;
    font-size: 17px;
}

.statistics-group > div {
    display: grid;
    grid-template-columns: 210px 1fr 90px;
    padding: 9px 12px;
    background: var(--panel);
}

.statistics-group > div:nth-child(odd) {
    background: var(--panel-alt);
}

.checklist-card > header,
.internal-checklist-point {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checklist-card > header {
    justify-content: space-between;
}

.internal-checklist-point {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}

.internal-checklist-point .inline-form {
    flex: 1;
}

.internal-checklist-point input[type="text"] {
    width: 100%;
    margin: 0;
}

/* Customer assignment in orders and offers */
.client-assignment {
    gap: 10px;
}

.client-contact-picker {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    max-width: 720px;
}

.client-contact-picker > input {
    min-width: 0;
}

.client-contact-picker > button {
    width: 42px;
    padding: 0;
    font-size: 23px;
}

.client-contact-picker > .client-contact-suggestions {
    top: calc(100% + 4px);
    right: 50px;
    left: 0;
}

.client-inline-summary {
    padding: 12px 14px;
    border-left: 4px solid var(--accent);
    background: var(--panel-alt);
}

.client-inline-summary > strong {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
}

.client-inline-summary > div {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
}

.client-inline-summary span {
    min-width: 150px;
}

.client-inline-summary small {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.client-inline-summary a[href]:hover {
    color: var(--accent);
}

.client-selected-contact {
    border-left-color: var(--success);
}

.client-contact-create-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 22px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.client-contact-create-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.client-contact-create-dialog h2 {
    margin: 0 38px 5px 0;
    font-size: 21px;
}

.client-contact-create-dialog > p {
    margin: 0 0 18px;
    color: var(--muted);
}

.client-contact-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
}

.client-contact-dialog-result {
    margin-top: 4px;
    padding: 9px 11px;
    border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--line));
    background: color-mix(in srgb, var(--danger) 12%, var(--panel));
    color: var(--danger);
}

.client-detail-contacts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
    background: transparent;
}

.client-detail-contacts > section {
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
}

.client-detail-contacts > section + section {
    border-left: 1px solid var(--line);
}

.client-detail-contacts h2 {
    margin: 0 0 10px;
    color: var(--accent);
    font-size: 14px;
}

.client-detail-contacts > section > strong {
    display: block;
    margin-bottom: 9px;
}

.client-detail-contacts > section > p {
    margin: 0;
    color: var(--muted);
}

.client-detail-contacts dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
    margin: 0;
}

.client-detail-contacts dt {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.client-detail-contacts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.client-detail-contacts a:hover {
    color: var(--accent);
}

@media (max-width: 760px) {
    .client-contact-dialog-grid,
    .client-detail-contacts,
    .client-detail-contacts dl {
        grid-template-columns: 1fr;
    }

    .client-detail-contacts > section + section {
        border-top: 1px solid var(--line);
        border-left: 1px solid var(--line);
    }
}

.mail-import-form-notice {
    margin-bottom: 14px;
    padding: 16px 18px;
    border: 1px solid var(--success);
    border-left-width: 6px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--success) 10%, var(--panel));
}

.mail-import-form-notice.has-unknown-client {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 11%, var(--panel));
}

.mail-import-form-notice.has-selected-client {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 10%, var(--panel));
}

.mail-import-form-notice-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.mail-import-form-notice-head > div,
.mail-import-form-customer-warning {
    display: grid;
    gap: 5px;
}

.mail-import-form-notice-head span,
.mail-import-form-attachments > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.mail-import-form-notice-head > a {
    color: var(--accent);
    font-weight: 700;
}

.mail-import-form-customer-warning,
.mail-import-form-customer-ok {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.mail-import-form-customer-warning > strong {
    color: var(--danger);
}

.mail-import-form-customer-ok {
    color: var(--success);
    font-weight: 700;
}

.mail-import-client-choices,
.mail-import-form-attachments {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.mail-import-client-choices {
    margin-top: 7px;
}

.mail-import-client-choices .secondary-button {
    height: 32px;
    padding: 0 10px;
}

.mail-import-form-attachments {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.mail-import-form-attachments a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
    font-size: 12px;
}

.page {
    padding: 20px 24px 32px;
}

.filters {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.filters input[type="text"],
.filters select {
    margin-bottom: 0;
}

.segmented {
    margin: 0;
    padding: 0;
    border: 0;
}

.segmented-options {
    display: flex;
    gap: 0;
}

.segmented label {
    margin: 0;
    text-transform: none;
}

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented span {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.segmented label:first-of-type span {
    border-radius: 6px 0 0 6px;
}

.segmented label:last-of-type span {
    border-left: 0;
    border-radius: 0 6px 6px 0;
}

.segmented input:checked + span {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.client-filter {
    position: relative;
    width: min(420px, 38vw);
}

.status-filter {
    width: 240px;
}

.suggestions {
    position: absolute;
    z-index: 10;
    right: 0;
    left: 0;
    top: calc(100% - 10px);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(26, 31, 40, 0.12);
}

.suggestions button {
    display: block;
    width: 100%;
    height: auto;
    padding: 10px 12px;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.suggestions button:hover {
    background: var(--accent-soft);
}

.orders-table {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.orders-header,
.order-row {
    display: grid;
    grid-template-columns: 120px 160px minmax(260px, 1.6fr) minmax(180px, 1.1fr) 150px 280px;
    gap: 14px;
    align-items: center;
    min-height: 48px;
    padding: 0 14px;
}

.orders-header {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    background: #edf0f4;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-row {
    row-gap: 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.order-row.is-alternate {
    background: #f3f5f8;
}

.order-row:hover {
    background: var(--accent-soft);
}

.order-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.order-row.has-meta {
    min-height: 74px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.order-row-meta {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    padding-top: 7px;
    color: var(--muted);
    font-size: 12px;
}

.order-row-meta strong {
    color: var(--text);
}

.contract-orders-table .orders-header,
.contract-orders-table .order-row {
    grid-template-columns: 120px 160px minmax(240px, 1.5fr) minmax(170px, 1fr) minmax(170px, .9fr) 220px;
}

.contract-summary {
    display: grid;
    align-content: center;
    gap: 5px;
}

.contract-summary > span {
    display: block;
    line-height: 1.35;
}

button.contract-maintenance-button,
.contract-maintenance-button.is-complete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 6px;
}

.contract-maintenance-dialog {
    width: min(580px, calc(100vw - 32px));
}

.contract-maintenance-dialog p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.65;
}

.contract-maintenance-dialog label {
    display: flex;
    align-items: baseline;
    gap: 7px;
}

.contract-maintenance-dialog label small {
    color: var(--muted);
    font-weight: 400;
    text-transform: none;
}

.contract-maintenance-dialog textarea {
    width: 100%;
    min-height: 130px;
    margin-bottom: 18px;
}

.restricted-contract-link {
    justify-content: flex-end;
    margin-bottom: 12px;
}

.contract-maintenance-button.is-complete {
    border: 1px solid color-mix(in srgb, #2ca45c 60%, var(--line));
    background: color-mix(in srgb, #2ca45c 18%, var(--panel));
    color: #39c875;
    font-size: 20px;
    font-weight: 800;
}

.order-meta-separator {
    color: #a0a7b0;
}

.order-row-tags {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.order-row-tags .tag-badge {
    min-height: 22px;
    padding: 2px 7px;
    font-size: 11px;
}

.order-row:last-child {
    border-bottom: 0;
}

.order-row.is-urgent {
    box-shadow: inset 12px 0 0 var(--danger);
}

.order-row.is-accounting-released {
    min-height: 66px;
    box-shadow: inset 5px 0 0 var(--success);
}

.order-row.is-accounting-released.is-urgent {
    box-shadow: inset 12px 0 0 var(--danger), inset 17px 0 0 var(--success);
}

.order-row.is-accounting-released > span:nth-child(2) {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
}

.accounting-list-state {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-left: 0;
    padding: 2px 7px;
    border: 1px solid color-mix(in srgb, var(--success) 55%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 14%, var(--panel));
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.accounting-list-state.is-paid {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    background: var(--accent-soft);
    color: var(--accent);
}

mark {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--status-color) 35%, var(--panel));
    color: var(--text);
}

.dashboard-order-link > mark {
    justify-self: center;
    justify-content: center;
    text-align: center;
}

i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--user-color);
}

.rich-area i,
.html-content i,
.rich-output i,
.formatted-copy i,
.rich-text-output i {
    display: inline;
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 0;
    background: none;
    font-style: italic;
}

.assignee-color-dot {
    display: block;
    width: 19px;
    height: 19px;
    margin: 0 auto;
    border: 2px solid color-mix(in srgb, var(--user-color) 72%, #fff);
    border-radius: 50%;
    background: var(--user-color);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--user-color) 58%, var(--line));
}

.list-status-form {
    width: 100%;
    margin: 0;
}

.list-status-select {
    width: 100%;
    min-width: 0;
    height: 34px;
    margin: 0;
    border-left: 5px solid var(--status-color);
    background: var(--input);
    color: var(--text);
    font-size: 13px;
}

.icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 25px;
    line-height: 1;
}

.edit-icon-button .edit-icon-glyph {
    display: block;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-1px);
}

.view-icon-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.row-actions > .assignee-color-dot {
    flex: 0 0 19px;
    margin: 0;
}

.assignee-picker {
    position: relative;
    display: flex;
    flex: 0 0 25px;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 32px;
    margin: 0;
}

.assignee-picker[open] {
    z-index: 100;
}

.assignee-picker > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    list-style: none;
}

.assignee-picker > summary::-webkit-details-marker {
    display: none;
}

.assignee-picker > summary:hover,
.assignee-picker > summary:focus-visible,
.assignee-picker[open] > summary {
    background: var(--panel-muted);
    outline: none;
}

.assignee-picker-menu {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 101;
    display: grid;
    width: max-content;
    min-width: 180px;
    max-height: 280px;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    isolation: isolate;
    box-shadow: 0 10px 28px rgb(0 0 0 / 35%);
}

.assignee-picker-menu form {
    margin: 0;
}

.assignee-picker-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    width: 100%;
    min-height: 34px;
    padding: 5px 8px;
    border: 0;
    border-radius: 4px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.assignee-picker-option:hover,
.assignee-picker-option:focus-visible {
    color: var(--text);
    background: var(--panel-muted);
    outline: none;
}

.assignee-picker-option .assignee-color-dot {
    width: 18px;
    height: 18px;
    margin: 0;
}

.list-number-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.list-drag-handle {
    flex: 0 0 28px;
    width: 28px;
    height: 30px;
    margin: 0;
}

.list-drag-placeholder {
    flex: 0 0 28px;
    width: 28px;
}

.favorite-form {
    margin: 0;
}

.favorite-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: var(--muted);
}

.favorite-button svg,
.dashboard-favorite-indicator svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.favorite-button.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.favorite-button.is-active svg,
.dashboard-order-row.is-favorite .dashboard-favorite-indicator svg {
    fill: currentColor;
}

.favorite-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

.timer-form {
    margin: 0;
}

.quick-action-form {
    margin: 0;
}

.quick-confirm-dialog {
    width: min(480px, calc(100vw - 32px));
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 24px 70px rgba(26, 31, 40, 0.24);
}

.quick-confirm-dialog::backdrop {
    background: rgba(24, 29, 36, 0.48);
}

.quick-confirm-dialog h2 {
    margin: 0 0 12px;
    font-size: 21px;
}

.quick-confirm-dialog p {
    margin: 0 0 22px;
    line-height: 1.5;
}

.quick-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.accounting-action-button,
.archive-action-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    font-size: 18px;
}

.accounting-action-button {
    color: #087f5b;
}

.accounting-action-button:hover {
    border-color: #087f5b;
    background: #e9f8f2;
}

.archive-action-button {
    color: #59636f;
}

.archive-action-button:hover {
    border-color: #59636f;
    background: #eef0f3;
}

.timer-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: #aeb5bf;
    background: #f1f3f5;
    color: #69717d;
}

.timer-button:hover {
    border-color: #69717d;
    background: #e5e8ec;
}

.timer-button.is-active {
    border-color: #d92d20;
    background: #d92d20;
    color: #fff;
}

.timer-button.is-active:hover {
    border-color: #a1160a;
    background: #a1160a;
}

.stopwatch-icon {
    position: relative;
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.stopwatch-icon::before {
    position: absolute;
    top: -6px;
    left: 4px;
    width: 6px;
    height: 4px;
    border-radius: 2px 2px 0 0;
    background: currentColor;
    content: '';
}

.stopwatch-icon::after {
    position: absolute;
    top: 3px;
    left: 7px;
    width: 2px;
    height: 6px;
    border-radius: 1px;
    background: currentColor;
    content: '';
    transform: rotate(-28deg);
    transform-origin: 50% 5px;
}

.archive-box-icon {
    position: relative;
    display: block;
    flex: 0 0 18px;
    width: 18px;
    height: 16px;
}

.topbar .nav-icon .archive-box-icon,
.topbar .nav-icon .archive-box-icon > span {
    margin-left: 0;
    color: inherit;
}

.archive-box-icon::before {
    position: absolute;
    bottom: 0;
    left: 1px;
    width: 16px;
    height: 11px;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 2px;
    content: '';
}

.archive-box-icon::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 5px;
    border-radius: 2px 2px 1px 1px;
    background: currentColor;
    content: '';
}

.archive-box-icon > span {
    position: absolute;
    z-index: 1;
    top: 8px;
    left: 6px;
    width: 6px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

.empty-state {
    padding: 24px;
    color: var(--muted);
}

.order-form {
    max-width: 1120px;
}

.order-edit-form {
    width: 100%;
    max-width: none;
}

.order-edit-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
    width: 100%;
}

.order-edit-column {
    display: grid;
    align-content: start;
    gap: 16px;
    min-width: 0;
}

.order-edit-column-main,
.order-edit-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.order-edit-column-main {
    gap: 18px;
}

.order-edit-column-main .client-contact-picker {
    max-width: none;
}

.order-edit-column-main .client-filter {
    width: 100%;
}

.order-edit-client-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.order-edit-settings {
    display: grid;
    gap: 18px;
}

.order-edit-option-grid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.order-edit-option-grid .checkbox-field {
    margin: 0;
}

.order-edit-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.order-edit-settings-grid > .form-field,
.order-contract-grid-edit .form-field {
    gap: 7px;
    margin-bottom: 0;
}

.order-edit-settings-grid > .order-edit-field-wide {
    grid-column: 1 / -1;
}

.order-edit-column-side .order-contract-fields {
    margin: 0;
}

.order-contract-grid-edit {
    display: grid;
    gap: 18px;
}

.order-contract-type-row,
.order-contract-edit-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 16px;
}

.order-contract-type-row > .checkbox-field,
.order-contract-hours-option > .checkbox-field {
    margin: 0;
}

.order-contract-type-row > .checkbox-field {
    align-self: start;
}

.order-contract-hours-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, .7fr);
    align-items: start;
    gap: 12px;
}

.order-contract-type-row {
    align-items: start;
}

.order-edit-tags h2 {
    margin: 0 0 14px;
    font-size: 16px;
}

.order-edit-tags .tag-selector {
    margin: 0;
}

.order-edit-tags .tag-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.order-edit-client-summary {
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 6px;
}

.order-edit-client-summary.client-selected-contact {
    border-left-color: var(--success);
}

.order-edit-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 1100px) {
    .order-edit-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .order-edit-settings-grid,
    .order-edit-client-fields,
    .order-contract-type-row,
    .order-contract-edit-row,
    .order-contract-hours-option {
        grid-template-columns: 1fr;
    }

}

.form-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.form-head h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.form-head p {
    margin: 0;
    color: var(--muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.form-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 14px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.form-options .order-parent-field {
    min-width: min(420px, 100%);
    margin-left: auto;
}

.form-options .order-parent-field select {
    margin: 5px 0 0;
}

.suborder-overview {
    margin-top: 24px;
}

.suborder-overview h2 {
    margin-bottom: 10px;
    font-size: 16px;
}

.suborder-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.suborder-list > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}

.suborder-list > a:first-child {
    border-top: 0;
}

.suborder-list > a:hover {
    background: var(--accent-soft);
}

.suborder-list > a > span {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.suborder-list .suborder-list-meta {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
}

.suborder-list-meta > span {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.order-contract-fields {
    margin-bottom: 16px;
    padding: 16px 18px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.order-contract-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.order-contract-heading h2 {
    margin: 0;
    font-size: 16px;
}

.order-contract-heading span {
    color: var(--muted);
    font-size: 12px;
}

.order-contract-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    align-items: end;
    gap: 18px;
}

.order-contract-grid .checkbox-field {
    min-height: 42px;
    margin: 0;
}

@media (max-width: 900px) {
    .order-contract-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field input,
.form-field select {
    margin-bottom: 0;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 42px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.tag-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    margin: 0;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--tag-color) 60%, var(--panel));
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-color) 28%, var(--panel));
    color: var(--text);
    font-size: 13px;
    text-transform: none;
    cursor: pointer;
}

.tag-option:has(input:checked) {
    border-color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 45%, var(--panel));
}

.tag-option input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.tag-color-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tag-color);
}

.form-empty-hint {
    margin: 0;
    color: var(--muted);
}

.filter-multi-select {
    position: relative;
    min-width: 180px;
    margin: 0;
    padding: 0;
    border: 0;
}

.filter-multi-select details {
    position: relative;
}

.filter-multi-select summary {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.filter-multi-select summary::after {
    position: absolute;
    right: 12px;
    content: "▾";
}

.filter-check-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    display: grid;
    gap: 4px;
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

.filter-check-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    margin: 0;
    padding: 5px 7px;
    border-radius: 4px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
}

.filter-check-options label:hover {
    background: var(--panel-alt);
}

.filter-check-options input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.filter-check-options span::before {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--filter-color, var(--muted));
    content: "";
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    text-transform: none;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

.rich-editor {
    overflow: hidden;
    border: 1px solid #b8c0cc;
    border-radius: 6px;
    background: #fff;
}

.rich-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    background: #f7f8fa;
}

.rich-toolbar button {
    height: 32px;
    padding: 0 10px;
    border-color: var(--line);
    background: #fff;
    color: var(--text);
}

.separator-icon {
    display: block;
    width: 22px;
    height: 0;
    border-top: 2px solid currentColor;
}

.rich-toolbar input[type="color"] {
    width: 38px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.rich-area {
    display: block;
    width: 100%;
    min-height: 220px;
    padding: 12px;
    border-top: 1px solid #d9dee6;
    background: #fff;
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    white-space: normal;
    outline: none;
    overflow-y: auto;
}

.rich-area:focus {
    box-shadow: inset 0 0 0 2px rgba(249, 190, 32, 0.24);
}

.rich-area.is-invalid {
    box-shadow: inset 0 0 0 2px var(--danger);
}

.rich-area hr,
.html-content hr {
    display: block;
    width: 100%;
    height: 0;
    margin: 20px 0;
    border: 0;
    border-top: 1px solid #9ca6b4;
}

.text-normal {
    font-size: 15px;
}

.text-large {
    font-size: 20px;
}

.text-xlarge {
    font-size: 26px;
}

.detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.detail-head h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.detail-head p {
    margin: 0;
    color: var(--muted);
}

.detail-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-timer-button {
    width: 38px;
    height: 38px;
    padding: 0;
    border-color: #aeb5bf;
    background: #f1f3f5;
    color: #69717d;
}

.detail-timer-button:hover {
    border-color: #69717d;
    background: #e5e8ec;
}

.detail-favorite-button {
    width: 38px;
    height: 38px;
}

.detail-timer-button.timer-button.is-active,
.detail-timer-button.timer-button.is-active:hover {
    border-color: #d92d20;
    background: #d92d20;
    color: #fff;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 100%;
    margin-bottom: 14px;
}

.tabs a {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--accent-ink);
    font-weight: 700;
}

.tabs a[hidden] {
    display: none;
}

.tab-panel {
    display: none;
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.tab-panel.is-active {
    display: block;
}

.tabs a.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.tabs .detail-edit-tab {
    margin-left: auto;
}

.settings-page {
    max-width: 1500px;
    margin: 0 auto;
}

.settings-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.settings-head h1 {
    margin: 0 0 6px;
    font-size: 26px;
}

.settings-head p {
    margin: 0;
    color: var(--muted);
}

.alert-success {
    border-color: #9fd6c2;
    background: #edf9f4;
    color: #087f5b;
}

.settings-section h2 {
    margin: 0 0 16px;
    font-size: 19px;
}

.settings-section h2:not(:first-child) {
    margin-top: 30px;
}

.provision-user-settings {
    display: grid;
    gap: 8px;
}

.provision-user-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) 120px repeat(6, minmax(135px, .8fr)) auto;
    align-items: end;
    gap: 12px;
}

.provision-user-row > strong {
    align-self: center;
}

.provision-user-row > div label {
    display: block;
    margin-bottom: 6px;
}

.provision-user-row input[type="number"],
.provision-user-row input[type="month"] {
    width: 100%;
    margin: 0;
}

.provision-version-history {
    display: grid;
    gap: 6px;
    margin: -8px 0 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-top: 0;
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 12px;
}

.provision-version-history span {
    line-height: 1.5;
}

.provision-access-form {
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}

.provision-access-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 16px 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 2px;
    max-width: 980px;
}

.settings-field-wide {
    grid-column: 1 / -1;
}

.settings-grid input,
.settings-grid select,
.settings-user-grid input,
.settings-user-grid select,
.settings-status-grid input,
.settings-status-grid select {
    margin-bottom: 14px;
}

.settings-create-form {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.settings-list {
    border-top: 1px solid var(--line);
}

.settings-edit-row {
    padding: 14px 0 0;
    border-bottom: 1px solid var(--line);
}

.settings-user-grid {
    display: grid;
    gap: 0;
    width: 100%;
}

.settings-user-main {
    display: grid;
    grid-template-columns: minmax(120px, .8fr) minmax(170px, 1.2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, .8fr) max-content;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.settings-user-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    align-items: center;
    width: 100%;
    padding: 0 0 14px;
}

.settings-user-number {
    display: grid;
    gap: 6px;
    min-width: 145px;
}

.settings-user-number label {
    color: var(--muted);
    font-size: 12px;
}

.settings-user-number input {
    width: 145px;
}

.settings-vacation-planning {
    margin-top: 30px;
}

.settings-vacation-planning > header {
    margin-bottom: 12px;
}

.settings-vacation-planning > header h2,
.settings-vacation-planning > header p {
    margin: 0;
}

.settings-vacation-planning > header p {
    margin-top: 4px;
    color: var(--muted);
}

.settings-vacation-list {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.settings-vacation-head,
.settings-vacation-row {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) 110px minmax(160px, .8fr) minmax(220px, 1.2fr);
    gap: 14px;
    align-items: center;
    padding: 10px 14px;
    min-width: 760px;
}

.settings-vacation-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-vacation-row {
    min-height: 48px;
    border-top: 1px solid var(--line);
    border-left: 4px solid var(--vacation-color);
    background: var(--panel);
}

.settings-vacation-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.settings-vacation-user {
    display: inline-flex;
    align-items: center;
}

.settings-holiday-planning {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.settings-holiday-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.settings-holiday-header h2,
.settings-holiday-header p {
    margin: 0;
}

.settings-holiday-header p {
    margin-top: 4px;
    color: var(--muted);
}

.settings-holiday-color,
.settings-holiday-create {
    display: grid;
    grid-template-columns: minmax(170px, 220px) minmax(240px, 1fr) max-content;
    gap: 12px;
    align-items: end;
}

.settings-holiday-color {
    grid-template-columns: minmax(210px, 250px) max-content;
    flex: 0 0 auto;
}

.settings-holiday-color label,
.settings-holiday-create label,
.settings-holiday-dialog-form label {
    display: block;
    margin-bottom: 7px;
}

.settings-holiday-color input,
.settings-holiday-create input,
.settings-holiday-dialog-form input {
    width: 100%;
    margin: 0;
}

.settings-holiday-color .list-save-button,
.settings-holiday-create .list-save-button {
    margin: 0;
}

.settings-holiday-create {
    margin-bottom: 20px;
}

.settings-holiday-list {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.settings-holiday-list-head,
.settings-holiday-row {
    display: grid;
    grid-template-columns: minmax(145px, .35fr) minmax(260px, 1fr) 92px;
    gap: 16px;
    align-items: center;
    min-width: 620px;
    padding: 10px 14px;
}

.settings-holiday-list-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-holiday-row {
    min-height: 50px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.settings-holiday-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.settings-holiday-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.settings-holiday-actions form {
    display: contents;
}

.settings-holiday-actions button {
    margin: 0;
}

.settings-holiday-dialog-form {
    display: grid;
    gap: 16px;
}

@media (max-width: 760px) {
    .settings-holiday-header {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-holiday-color,
    .settings-holiday-create {
        grid-template-columns: 1fr;
    }
}

.settings-status-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(165px, .6fr) auto;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.internal-category-form-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(165px, .6fr) 110px max-content;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.internal-category-form-grid input,
.internal-category-form-grid button {
    margin-bottom: 14px;
}

.internal-category-form-grid button {
    height: 42px;
    white-space: nowrap;
}

.internal-category-form-grid .checkbox-field {
    min-height: 42px;
    margin: 0 0 14px;
}

.internal-category-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px;
    gap: 10px;
    align-items: center;
    min-height: 56px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.internal-category-row > form {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.internal-category-row .settings-delete-button {
    width: 34px;
    height: 34px;
    margin: 0;
}

.internal-category-private {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.internal-category-dialog-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(165px, .6fr);
    gap: 14px;
    align-items: end;
}

.internal-category-dialog-grid .checkbox-field {
    grid-column: 1 / -1;
    margin: 0;
}

.settings-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.settings-material-art-grid,
.settings-material-grid {
    display: grid;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.settings-material-art-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(170px, .55fr) minmax(220px, .8fr) max-content;
}

.settings-material-grid {
    grid-template-columns: minmax(210px, 0.8fr) minmax(280px, 1.4fr) 90px max-content;
}

.settings-material-art-grid input,
.settings-material-art-grid select,
.settings-material-grid input,
.settings-material-grid select,
.settings-material-art-grid button,
.settings-material-grid button {
    margin-bottom: 14px;
}

.settings-material-art-grid button,
.settings-material-grid button {
    height: 42px;
    white-space: nowrap;
}

.material-settings-list {
    border-top: 1px solid var(--line);
}

.material-settings-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) max-content;
    align-items: end;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.material-edit-form {
    grid-template-columns: minmax(210px, 0.8fr) minmax(280px, 1.4fr) 90px;
}

.material-settings-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.material-settings-actions form {
    display: flex;
    align-items: center;
    margin: 0;
}

.material-settings-actions .secondary-button,
.material-settings-actions .settings-delete-button,
.material-settings-actions .list-save-button {
    margin: 0;
}

.material-settings-actions .secondary-button {
    height: 34px;
    padding: 0 10px;
    white-space: nowrap;
}

.material-settings-actions .settings-delete-button {
    height: 34px;
}

.material-settings-category-heading {
    margin: 0;
    padding: 14px 12px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--text);
    font-size: 14px;
}

.settings-status-sort-row,
.material-art-settings-row {
    display: grid;
    align-items: start;
    gap: 10px;
    padding-top: 14px;
    border-bottom: 1px solid var(--line);
}

.settings-status-sort-row {
    grid-template-columns: 38px minmax(0, 1fr);
}

.settings-status-sort-row.settings-compact-sort-row {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: center;
    padding: 10px 0;
}

.settings-list-summary {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.settings-list-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-color-swatch {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 1px solid color-mix(in srgb, var(--item-color) 65%, var(--line));
    border-radius: 3px;
    background: var(--item-color);
}

.settings-dialog-open-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: var(--text);
}

.settings-dialog-open-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.material-art-settings-row {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    align-items: end;
}

.material-art-settings-row > form:last-child {
    display: flex;
    align-items: flex-end;
    margin: 0;
}

.settings-status-sort-row .settings-edit-row {
    padding-top: 0;
    border-bottom: 0;
}

.material-active {
    align-self: end;
    justify-content: center;
    height: 42px;
    margin-bottom: 14px;
}

.material-width-open,
.material-relation-open {
    height: 42px;
    margin-bottom: 14px;
    white-space: nowrap;
}

.material-relation-dialog {
    width: min(620px, calc(100vw - 32px));
}

.material-relation-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    max-height: 45vh;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--line);
}

.material-relation-options .checkbox-field {
    justify-content: flex-start;
    margin: 0;
}

.settings-delete-button {
    width: 34px;
    height: 42px;
    margin-bottom: 14px;
    padding: 0;
    border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
    background: transparent;
    color: var(--danger);
    font-size: 21px;
}

.material-width-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 24px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.material-width-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.material-width-dialog h2 {
    margin: 0 44px 20px 0;
}

.settings-dialog {
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 24px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.settings-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.settings-dialog h2 {
    margin: 0 44px 20px 0;
}

.settings-dialog h3 {
    margin: 24px 0 10px;
}

.settings-dialog .settings-edit-row {
    padding: 0;
    border: 0;
}

.material-widths {
    display: grid;
    gap: 8px;
    padding-top: 4px;
}

.material-widths > strong {
    margin-right: 4px;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.material-width-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--input);
}

.material-width-edit,
.material-width-add {
    display: grid;
    grid-template-columns: 140px 140px 140px max-content;
    gap: 8px;
    align-items: end;
}

.material-width-entry > form:last-child {
    align-self: end;
}

.material-widths label {
    margin-bottom: 4px;
    font-size: 11px;
}

.material-widths .icon-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.material-width-save {
    color: var(--success) !important;
    font-size: 18px;
}

.material-width-delete:hover {
    color: var(--danger) !important;
}

.material-width-edit input,
.material-width-add input,
.material-width-edit button,
.material-width-add button {
    height: 34px;
    margin: 0;
}

.material-width-add button {
    padding: 0 12px;
}

.settings-status-mailtext {
    grid-column: 1 / -1;
}

.settings-status-mailtext textarea,
.settings-grid textarea {
    margin-bottom: 14px;
}

.settings-user-grid button,
.settings-status-grid button {
    height: 42px;
    margin-bottom: 14px;
    white-space: nowrap;
}

.settings-active,
.settings-production,
.settings-mobile,
.settings-eisstock {
    height: 42px;
    margin-bottom: 14px;
}

.settings-user-options .checkbox-field {
    width: auto;
    height: auto;
    min-height: 28px;
    margin: 0;
}

.settings-user-options input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.settings-user-grid input[type="color"],
.settings-status-grid input[type="color"] {
    width: 54px;
    height: 42px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.tag-create-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(165px, .6fr) max-content;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.tag-create-form input,
.tag-create-form button {
    margin-bottom: 0;
}

.tag-create-form button,
.checklist-create button {
    width: auto;
    justify-self: start;
    white-space: nowrap;
}

.tag-create-form input[type="color"],
.tag-edit-form input[type="color"] {
    width: 54px;
    height: 42px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.tag-settings-list {
    border-top: 1px solid var(--line);
}

.tag-settings-row {
    display: grid;
    grid-template-columns: 38px minmax(120px, 220px) minmax(300px, 1fr) 38px;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.tag-settings-row > form,
.tag-edit-form {
    width: 100%;
    margin: 0;
}

.tag-edit-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) 34px;
    gap: 10px;
    align-items: center;
}

.tag-edit-form input,
.tag-edit-form button {
    margin-bottom: 0;
}

.tag-settings-row > form:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-preview,
.tag-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--tag-color) 65%, var(--panel));
    border-radius: 999px;
    background: color-mix(in srgb, var(--tag-color) 35%, var(--panel));
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.tag-delete-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: #f1b5ad;
    background: #fff0ee;
    color: var(--danger);
    font-size: 21px;
}

.tag-settings-row .settings-delete-button {
    height: 34px;
    margin: 0;
}

.checklist-create {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) max-content;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.checklist-create input,
.checklist-create button {
    margin-bottom: 0;
}

.checklist-template {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px 38px;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.checklist-template:last-child {
    border-bottom: 1px solid var(--line);
}

.checklist-template > form {
    margin: 0;
}

.checklist-copy-button {
    position: relative;
    display: inline-grid;
    width: 34px;
    min-width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    place-items: center;
}

.copy-icon {
    position: relative;
    display: block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.copy-icon::before {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: var(--panel);
    content: '';
}

.checklist-list-summary small {
    color: var(--muted);
}

.settings-state {
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.settings-state.is-active {
    border-color: color-mix(in srgb, var(--success) 55%, var(--line));
    background: color-mix(in srgb, var(--success) 12%, var(--panel));
    color: var(--success);
}

.checklist-template-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}

.checklist-template-edit-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 90px auto;
    gap: 12px;
    align-items: end;
}

.checklist-template-edit-form input,
.checklist-template-edit-form button,
.checklist-template-edit-form .checkbox-field,
.checklist-template-head > form > .checklist-delete-button {
    margin-bottom: 0;
}

.checklist-point-list,
.order-checklist-points {
    border-top: 1px solid var(--line);
}

.checklist-edit-point {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.checklist-point-edit-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.checklist-point-edit-form input,
.checklist-point-edit-form button {
    margin-bottom: 0;
}

.drag-handle,
.checklist-delete-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--muted);
}

.drag-handle {
    display: inline-flex;
    align-self: center;
    justify-self: center;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    cursor: grab;
    font-size: 18px;
    letter-spacing: 0;
}

.drag-handle:active {
    cursor: grabbing;
}

.checklist-delete-button {
    color: var(--danger);
    font-size: 22px;
}

[data-sort-item].is-dragging {
    opacity: 0.42;
}

[data-sortable-list].is-saving {
    cursor: progress;
}

.checklist-add-point {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-top: 14px;
}

.checklist-add-point input,
.checklist-add-point button {
    margin-bottom: 0;
}

.checklist-tab-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.checklist-tab-head h2 {
    margin: 0;
}

.checklist-attach-form {
    display: flex;
    gap: 8px;
}

.checklist-attach-form select,
.checklist-attach-form button {
    margin-bottom: 0;
}

.order-checklist {
    padding: 18px 0 24px;
    border-top: 1px solid var(--line);
}

.order-checklist > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.checklist-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checklist-header-actions form {
    margin: 0;
}

.checklist-share-button {
    min-height: 36px;
    padding: 7px 13px;
}

.checklist-share-dialog {
    width: min(620px, calc(100vw - 32px));
}

.checklist-rename-dialog {
    width: min(560px, calc(100vw - 32px));
}

.checklist-rename-dialog > form {
    display: grid;
    gap: 10px;
}

.checklist-rename-dialog input {
    width: 100%;
    margin: 0;
}

.checklist-share-dialog > form {
    display: grid;
    gap: 10px;
}

.checklist-share-dialog select,
.checklist-share-dialog input,
.checklist-share-dialog textarea {
    width: 100%;
    margin: 0;
}

.checklist-share-dialog textarea {
    min-height: 180px;
    resize: vertical;
}

.checklist-share-note {
    margin: 2px 0 8px;
    color: var(--muted);
    font-size: 13px;
}

.order-checklist h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.checklist-progress {
    color: var(--muted);
    font-size: 13px;
}

.checklist-share-state {
    display: block;
    margin-top: 5px;
    color: #f9be20;
    font-size: 12px;
}

.checklist-public-link {
    display: inline-block;
    margin-top: 5px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.checklist-public-link:hover {
    color: #ffd45f;
}

.checklist-progress-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: min(340px, 38%);
}

.checklist-progress-bar {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 5px;
    background: #dfe4ea;
}

.checklist-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #087f5b;
    transition: width 160ms ease;
}

.checklist-progress-display > strong {
    min-width: 42px;
    color: #087f5b;
    font-size: 13px;
    text-align: right;
}

.checklist-no-points {
    color: var(--muted);
    font-size: 13px;
}

.order-checklist-point {
    display: grid;
    grid-template-columns: 38px 34px minmax(0, 1fr) 76px;
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.order-checklist-point:not([draggable]) {
    grid-template-columns: 34px minmax(0, 1fr);
}

.checklist-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.checklist-toggle input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: #087f5b;
}

.checklist-point-content strong {
    display: block;
}

.checklist-point-content p {
    margin: 4px 0;
    color: var(--muted);
    line-height: 1.4;
}

.checklist-point-content small {
    color: #087f5b;
}

.order-checklist-point.is-completed .checklist-point-content > strong,
.order-checklist-point.is-completed .checklist-point-content > p {
    color: #77808c;
    text-decoration: line-through;
}

.checklist-point-actions {
    position: relative;
}

.checklist-point-commands {
    display: grid;
    grid-template-columns: 34px 34px;
    gap: 8px;
    align-items: center;
}

.checklist-point-commands > form {
    display: flex;
    margin: 0;
}

.checklist-point-delete {
    width: 34px;
    height: 34px;
    margin: 0;
}

.checklist-point-actions summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--accent-ink);
    cursor: pointer;
    list-style: none;
}

.checklist-point-actions summary::-webkit-details-marker {
    display: none;
}

.checklist-point-menu {
    position: absolute;
    z-index: 15;
    top: 40px;
    right: 0;
    width: min(460px, calc(100vw - 64px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(26, 31, 40, 0.18);
}

.checklist-point-menu input,
.checklist-point-menu textarea {
    margin-bottom: 10px;
}

.checklist-point-menu textarea {
    min-height: 80px;
}

.checklist-point-menu form + form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.checklist-remove-command {
    border-color: #f1b5ad;
    background: #fff0ee;
    color: var(--danger);
}

.order-checklist-add {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.order-checklist-add input,
.order-checklist-add button {
    margin-bottom: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.detail-grid div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.detail-grid strong,
.detail-grid dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-grid dt,
.detail-grid dd {
    margin: 0;
}

.detail-grid dd {
    overflow-wrap: anywhere;
}

.detail-grid div.is-fixtermin {
    border-color: #d92d20;
    background: #fff0ee;
    box-shadow: inset 5px 0 0 #d92d20;
}

.detail-grid div.is-fixtermin strong,
.detail-grid div.is-fixtermin span,
.detail-grid div.is-fixtermin dt,
.detail-grid div.is-fixtermin dd {
    color: #a1160a;
    font-weight: 800;
}

.order-info-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
    width: 100%;
}

.order-info-column {
    display: grid;
    align-content: start;
    gap: 18px;
    min-width: 0;
}

.order-info-quick-grid,
.order-info-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

.detail-tags.order-info-tags,
.order-info-parent,
.order-info-suborders,
.project-description.order-info-description,
.note-block.order-info-payment,
.order-info-contacts {
    margin: 0;
}

.order-info-disclosure {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
}

.order-info-disclosure summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.order-info-disclosure summary::-webkit-details-marker {
    display: none;
}

.order-info-disclosure summary::after {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 20px;
    line-height: 1;
    content: '+';
}

.order-info-disclosure[open] summary {
    border-bottom: 1px solid var(--line);
}

.order-info-disclosure[open] summary::after {
    content: '\2212';
}

.order-info-meta-grid {
    padding: 14px;
}

.client-detail-contacts.order-info-contacts {
    grid-template-columns: 1fr;
    gap: 16px;
}

.client-detail-contacts.order-info-contacts > section + section {
    border-left: 1px solid var(--line);
}

@media (max-width: 1100px) {
    .order-info-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .order-info-quick-grid,
    .order-info-meta-grid {
        grid-template-columns: 1fr;
    }
}

.detail-value-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 14px 0 22px;
}

.detail-value-text {
    overflow-wrap: anywhere;
}

.copy-button {
    position: relative;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-left: auto;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--accent-ink);
}

.copy-button.is-copied {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.copy-symbol,
.copy-symbol::before {
    position: absolute;
    width: 10px;
    height: 12px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    content: '';
}

.copy-symbol {
    top: 50%;
    left: 50%;
    transform: translate(-30%, -30%);
}

.copy-symbol::before {
    top: 0;
    left: 0;
    transform: translate(-5px, -5px);
}

.detail-link {
    color: var(--accent-ink);
    font-weight: 700;
    text-decoration: underline;
}

.project-description {
    margin-top: 34px;
}

.detail-text-section > h2 {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-left: 5px solid var(--accent);
    border-radius: 0 6px 6px 0;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 18px;
    line-height: 1.25;
}

.project-description.order-info-description,
.note-block.order-info-payment {
    overflow: hidden;
    padding: 0 16px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.project-description.order-info-description > h2,
.note-block.order-info-payment > h2 {
    margin: 0 -16px 16px;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel-alt);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.note-block.order-info-payment > p:last-child {
    margin-bottom: 0;
}

.html-content,
.note-block {
    margin-bottom: 18px;
    line-height: 1.5;
}

.html-content ul,
.html-content ol {
    padding-left: 24px;
}

.note-form {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.note-form textarea {
    min-height: 90px;
}

.note-form button {
    width: max-content;
}

.mention-input {
    position: relative;
}

.mention-suggestions {
    position: absolute;
    z-index: 12;
    right: 0;
    left: 0;
    top: calc(100% - 1px);
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(26, 31, 40, 0.14);
}

.mention-suggestions button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.mention-suggestions button:last-child {
    border-bottom: 0;
}

.mention-suggestions button:hover {
    background: var(--accent-soft);
}

.mention-suggestions button[hidden] {
    display: none;
}

.note-reply-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    color: var(--text);
}

.note-reply-context[hidden] {
    display: none;
}

.note-reply-context button {
    width: 30px;
    height: 30px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: var(--text);
    font-size: 20px;
}

.log-list {
    display: grid;
    gap: 10px;
}

.log-list h2 {
    margin: 0;
}

.log-list article {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.log-list p {
    margin: 0 0 8px;
}

.log-list footer {
    color: var(--muted);
    font-size: 13px;
}

.note-entry.is-reply {
    margin-left: var(--reply-indent);
    border-left: 4px solid var(--accent);
}

.note-entry footer {
    line-height: 1.5;
}

.note-author-actions {
    white-space: nowrap;
}

.note-entry .note-reply-button,
.log-list .note-reply-button {
    display: inline;
    width: auto;
    height: auto;
    margin: 0 0 0 7px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f9be20;
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    vertical-align: baseline;
}

.note-entry .note-edit-button,
.log-list .note-edit-button {
    display: inline;
    width: auto;
    height: auto;
    margin: 0 0 0 7px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    line-height: inherit;
    vertical-align: baseline;
}

.note-entry .note-edit-button:hover,
.note-entry .note-edit-button:focus-visible,
.log-list .note-edit-button:hover,
.log-list .note-edit-button:focus-visible {
    border: 0;
    background: transparent;
    color: #ffd35d;
    text-decoration: underline;
}

.note-edit-dialog {
    width: min(640px, calc(100vw - 32px));
}

.note-edit-dialog form,
.note-edit-dialog label {
    display: grid;
    gap: 9px;
}

.note-edit-dialog textarea {
    min-height: 140px;
    resize: vertical;
}

.note-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.note-entry .note-reply-button:hover,
.note-entry .note-reply-button:focus-visible,
.log-list .note-reply-button:hover,
.log-list .note-reply-button:focus-visible {
    border: 0;
    background: transparent;
    color: #ffd35d;
    text-decoration: underline;
}

.time-entries {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.time-summary {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(320px, 1fr);
    gap: 14px;
    margin: 16px 0 24px;
}

.time-summary-total,
.time-summary-users {
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.time-summary-total {
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.time-summary-label {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.time-summary-value {
    font-size: 28px;
    font-variant-numeric: tabular-nums;
}

.time-summary-order-breakdown {
    display: grid;
    gap: 7px;
    margin: 2px 0 0;
}

.time-summary-order-breakdown > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.time-summary-order-breakdown dt,
.time-summary-order-breakdown dd {
    margin: 0;
}

.time-summary-order-breakdown dt {
    min-width: 0;
    color: var(--muted);
}

.time-summary-order-breakdown a {
    color: var(--accent);
    text-decoration: none;
}

.time-summary-order-breakdown dd {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
}

.time-summary-order-breakdown .is-total {
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
}

.time-summary-order-breakdown .is-total dt {
    color: inherit;
}

.time-summary-sub-label {
    margin-top: 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.time-summary-users {
    overflow: hidden;
}

.time-summary-user {
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
}

.time-summary-user > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.time-summary-user:last-child {
    border-bottom: 0;
}

.time-summary-categories {
    display: grid;
    gap: 5px;
    margin: 12px 0 0;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.time-summary-categories > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.time-summary-categories dt,
.time-summary-categories dd {
    margin: 0;
    font-size: 13px;
}

.time-summary-categories dt {
    color: var(--muted);
}

.time-summary-categories dd {
    font-variant-numeric: tabular-nums;
}

.time-summary-users p {
    margin: 0;
    padding: 18px;
    color: var(--muted);
}

.time-summary-users strong {
    font-variant-numeric: tabular-nums;
}

.contract-year-summary {
    margin: 0 0 28px;
}

.contract-year-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.contract-year-row {
    display: grid;
    grid-template-columns: 110px minmax(240px, 1fr) 150px 150px;
    align-items: center;
    gap: 16px;
    min-width: 720px;
    padding: 11px 14px;
    border-top: 1px solid var(--line);
}

.contract-year-row:first-child {
    border-top: 0;
}

.contract-year-head {
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.contract-year-row.is-current {
    box-shadow: inset 5px 0 0 var(--accent);
    background: var(--accent-soft);
}

.contract-year-group {
    border-top: 1px solid var(--line);
}

.contract-year-group > summary.contract-year-row {
    position: relative;
    padding-right: 42px;
    border-top: 0;
    cursor: pointer;
    list-style: none;
}

.contract-year-group > summary::-webkit-details-marker {
    display: none;
}

.contract-year-group > summary::after {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--accent);
    font-size: 18px;
    line-height: 1;
    content: '\203A';
    transform: translateY(-50%) rotate(90deg);
    transition: transform 140ms ease;
}

.contract-year-group[open] > summary::after {
    transform: translateY(-50%) rotate(-90deg);
}

.contract-year-group > summary:hover,
.contract-year-group[open] > summary {
    background: var(--panel-alt);
}

.contract-year-group > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.contract-year-group.is-current > summary {
    box-shadow: inset 5px 0 0 var(--accent);
    background: var(--accent-soft);
}

.contract-year-entry-list {
    min-width: 720px;
    padding: 14px;
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.suborder-time-sections {
    margin-top: 30px;
}

.suborder-time-section {
    margin-top: 18px;
}

.suborder-time-section > h4 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 9px;
}

.suborder-time-section > h4 a {
    color: var(--accent);
    text-decoration: none;
}

.suborder-time-section > h4 span {
    flex: 0 0 auto;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.contract-year-row strong,
.contract-year-row span:nth-child(3),
.contract-year-row span:nth-child(4) {
    font-variant-numeric: tabular-nums;
}

.manual-time-entry {
    margin-bottom: 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.time-input-group {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.time-duration-inputs,
.time-clock-inputs {
    display: flex;
    align-items: end;
    gap: 12px;
}

.time-duration-inputs label {
    display: inline-grid;
    grid-template-columns: 68px auto;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.time-duration-inputs input {
    width: 68px;
    margin: 0;
    text-align: center;
}

.time-duration-inputs b {
    color: var(--muted);
    font-size: 14px;
}

.time-clock-inputs label {
    display: grid;
    flex: 0 0 112px;
    min-width: 112px;
    gap: 6px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.time-clock-inputs input {
    width: 100%;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.time-clock-inputs label:first-child {
    flex-basis: 180px;
    min-width: 180px;
}

.time-clock-inputs input[type="time"] {
    width: 112px;
    padding-right: 8px;
    padding-left: 8px;
}

.manual-time-meta-grid {
    margin-bottom: 14px;
}

.internal-task-selector-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.internal-task-selector-row .tag-selector {
    height: 100%;
    margin: 0;
}

.internal-task-selector-row .tag-options {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    width: 100%;
}

.internal-purchase-form .form-grid > label {
    display: grid;
    align-content: start;
    gap: 9px;
    margin: 0;
}

.internal-purchase-form .form-grid input,
.internal-purchase-form .form-grid select {
    width: 100%;
    margin: 0;
}

.internal-purchase-form > button {
    margin-top: 18px;
}

.internal-task-description {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.internal-task-description textarea {
    width: 100%;
    min-height: 220px;
    margin: 0;
    resize: vertical;
}

.internal-task-details-grid {
    margin-top: 16px;
}

.settings-section-divider {
    margin: 34px 0 28px;
    border: 0;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .time-duration-inputs,
    .time-clock-inputs {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .time-clock-inputs label {
        flex: 0 0 112px;
        min-width: 112px;
    }

    .time-clock-inputs label:first-child {
        flex: 1 1 180px;
        min-width: min(180px, 100%);
    }

    .internal-task-selector-row {
        grid-template-columns: 1fr;
    }
}

.production-panel h2 {
    margin: 0 0 18px;
}

.production-nav-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.production-category-list {
    display: grid;
    gap: 28px;
}

.production-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr)) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.production-filter-form select {
    margin-bottom: 0;
}

.production-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.production-tabs span {
    display: inline-flex;
    min-width: 22px;
    min-height: 22px;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--panel-muted);
    color: var(--text);
    font-size: 12px;
}

.production-tabs a.is-active span {
    background: var(--panel);
}

.production-overview-page > .tab-panel {
    padding: 0;
    border: 0;
    background: transparent;
}

.production-category {
    min-width: 0;
}

.production-category-heading {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 14px;
    border-left: 6px solid var(--production-category-color);
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
}

.production-category-heading h2 {
    margin: 0;
    font-size: 18px;
}

.production-category-heading span {
    color: var(--muted);
    font-size: 13px;
}

.production-category-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-top: 0;
}

.production-category-header,
.production-category-row {
    display: grid;
    grid-template-columns: 38px 105px 155px minmax(190px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(145px, 0.9fr) 432px;
    min-width: 1382px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}

.production-category-header {
    min-height: 40px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.production-category-row {
    min-height: 58px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.production-category-row:nth-child(even) {
    background: var(--panel-alt);
}

.production-category-row:last-child {
    border-bottom: 0;
}

.production-category-row:hover {
    background: var(--accent-soft);
}

.production-category-row.is-urgent {
    box-shadow: inset 7px 0 0 var(--danger);
}

.production-category-row.is-marked {
    background: color-mix(in srgb, var(--accent) 16%, var(--panel));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
}

.production-category-row.is-marked.is-urgent {
    box-shadow: inset 7px 0 0 var(--danger), inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
}

.production-category-row > span,
.production-category-row > strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.production-user {
    display: flex;
    align-items: center;
}

.production-user i {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--user-color);
}

.production-overview-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.production-overview-actions form {
    margin: 0;
}

.production-overview-actions .icon-button,
.production-overview-actions .timer-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.production-overview-actions svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.production-inventory-link {
    border-color: var(--line);
    background: var(--input);
    color: var(--accent);
}

.production-inventory-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.production-status-form {
    margin: 0;
}

.production-status-form select {
    width: 100%;
    margin: 0;
}

.production-progress-button,
.production-info-button {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--input);
    color: #78818c;
}

.production-progress-button.is-active {
    border-color: #2f9e44;
    background: color-mix(in srgb, #2f9e44 16%, var(--input));
    color: #35b552;
}

.production-progress-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.production-info-button {
    width: 30px;
    color: var(--accent);
}

.production-info-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inventory-nav-icon {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.inventory-head-actions,
.inventory-head-actions a {
    display: flex;
    align-items: center;
}

.inventory-head-actions {
    gap: 10px;
}

.inventory-head-actions .primary-button span {
    margin-right: 7px;
    font-size: 20px;
}

.inventory-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 0.9fr) minmax(250px, 1.2fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.inventory-filter-form > div {
    min-width: 0;
}

.inventory-filter-form label {
    margin-bottom: 7px;
}

.inventory-filter-form select,
.inventory-filter-form input {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.inventory-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inventory-filter-actions button,
.inventory-filter-actions a {
    margin: 0;
    white-space: nowrap;
}

.inventory-category-row,
.order-inventory-category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    border-left: 5px solid var(--accent);
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
}

.inventory-category-row > strong,
.order-inventory-category-row > strong {
    font-size: 15px;
}

.inventory-category-row > span,
.order-inventory-category-row > span {
    color: var(--muted);
    font-size: 12px;
}

.inventory-table,
.inventory-history-table,
.order-inventory-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-top: 0;
}

.inventory-table {
    margin-top: 20px;
    border-top: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.inventory-row {
    display: grid;
    grid-template-columns: 105px minmax(190px, 1.4fr) 90px 115px 115px 105px minmax(110px, .8fr) 82px;
    gap: 14px;
    min-width: 1040px;
    min-height: 48px;
    align-items: center;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: background-color 120ms ease;
}

.inventory-row.is-alternate {
    background: var(--panel-alt);
}

.inventory-row:not(.inventory-row-head):hover {
    background: var(--accent-soft);
}

.inventory-row:last-child {
    border-bottom: 0;
}

.inventory-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.inventory-row-head,
.inventory-history-head,
.order-inventory-head {
    min-height: 40px;
    background: var(--panel-muted) !important;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.inventory-row-head {
    min-height: 42px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    cursor: default;
}

.inventory-row > span,
.inventory-row > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inventory-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
}

.inventory-deplete-button {
    border-color: var(--line);
    background: var(--input);
    color: var(--muted);
}

.inventory-deplete-button:hover {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--input));
    color: var(--danger);
}

.inventory-deplete-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.inventory-deplete-dialog {
    width: min(620px, calc(100vw - 32px));
}

.inventory-deplete-dialog h2 {
    margin: 0 44px 18px 0;
}

.inventory-deplete-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0 0 20px;
    background: var(--line);
}

.inventory-deplete-summary div {
    padding: 11px 12px;
    background: var(--panel-alt);
}

.inventory-deplete-summary dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.inventory-deplete-summary dd {
    margin: 5px 0 0;
}

.inventory-deplete-dialog textarea {
    width: 100%;
    margin: 0;
}

.inventory-deplete-dialog .time-dialog-actions {
    margin-top: 18px;
}

.inventory-stock {
    color: var(--success);
    font-size: 16px;
}

.inventory-row.is-archived .inventory-stock,
.inventory-summary .is-empty-stock dd {
    color: var(--danger);
}

.inventory-roll-form,
.inventory-withdraw-form {
    padding: 20px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.inventory-roll-form-grid,
.inventory-withdraw-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 18px;
}

.inventory-roll-form-grid > div,
.inventory-withdraw-grid > div {
    min-width: 0;
}

.inventory-roll-form-grid label,
.inventory-withdraw-grid label {
    display: block;
    margin-bottom: 6px;
}

.inventory-roll-form-grid input,
.inventory-roll-form-grid select,
.inventory-withdraw-grid input,
.inventory-withdraw-grid select,
.inventory-withdraw-grid textarea {
    width: 100%;
    margin: 0;
}

.inventory-roll-form-grid small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.inventory-roll-form .form-actions,
.inventory-withdraw-form .form-actions {
    margin-top: 22px;
}

.inventory-order-assignment,
.inventory-withdraw-note {
    grid-column: 1 / -1;
}

.inventory-order-assignment {
    position: relative;
}

.inventory-order-assignment input[type="search"] {
    width: 100%;
    margin: 0;
    border-color: var(--line);
    background: var(--input);
    color: var(--text);
}

.inventory-order-suggestions {
    top: 68px;
}

.inventory-order-suggestions button strong,
.inventory-order-suggestions button span {
    display: block;
}

.inventory-order-suggestions button span {
    color: var(--muted);
    font-size: 12px;
}

.inventory-selected-orders {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.inventory-selected-order {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 4px 5px 4px 9px;
    border-left: 4px solid var(--accent);
    background: var(--panel-alt);
}

.inventory-selected-order button {
    width: 22px;
    min-width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--danger);
    font-size: 18px;
}

.inventory-history-row {
    display: grid;
    grid-template-columns: 135px 125px 90px minmax(150px, .8fr) minmax(220px, 1.4fr) 140px;
    gap: 12px;
    min-width: 900px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.inventory-history-row:nth-child(odd) {
    background: var(--panel-alt);
}

.inventory-history-orders {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 9px;
}

.inventory-history-orders a {
    color: var(--accent);
    font-weight: 700;
}

.order-inventory-usage {
    margin-top: 30px;
}

.order-inventory-usage h3 {
    margin: 0;
    padding: 10px 12px;
    border-left: 5px solid var(--accent);
    background: var(--panel-muted);
    font-size: 16px;
}

.order-inventory-row {
    display: grid;
    grid-template-columns: 115px minmax(190px, 1.2fr) 90px 130px minmax(220px, 1fr) 44px;
    gap: 12px;
    min-width: 800px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
}

.order-inventory-row:nth-child(odd) {
    background: var(--panel-alt);
}

.order-inventory-row:not(.order-inventory-head):hover {
    background: var(--accent-soft);
}

@media (max-width: 760px) {
    .inventory-filter-form {
        grid-template-columns: 1fr;
    }

    .inventory-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .inventory-filter-actions button,
    .inventory-filter-actions a {
        width: 100%;
    }

    .inventory-roll-form-grid,
    .inventory-withdraw-grid {
        grid-template-columns: 1fr;
    }

    .inventory-order-assignment,
    .inventory-withdraw-note {
        grid-column: auto;
    }

    .inventory-deplete-summary {
        grid-template-columns: 1fr;
    }
}

.production-note-copy {
    min-height: 80px;
    margin: 12px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    white-space: normal;
}

.production-note-field {
    display: grid;
    gap: 7px;
    margin-top: 18px;
}

.production-note-field textarea {
    width: 100%;
    margin: 0;
    resize: vertical;
}

.accounting-additional-revenue dd {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.accounting-additional-revenue input {
    width: 150px;
    margin: 0;
    text-align: right;
}

.accounting-released-section {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.accounting-released-header,
.accounting-released-row {
    display: grid;
    grid-template-columns: 110px 150px minmax(210px, 1.3fr) minmax(170px, 1fr) 155px 120px 58px;
    min-width: 1080px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
}

.accounting-released-header {
    color: var(--muted);
    background: var(--panel-alt);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.accounting-released-row {
    border-top: 1px solid var(--line);
}

.accounting-released-row:nth-child(odd) {
    background: var(--panel-alt);
}

.accounting-released-row form {
    margin: 0;
}

.production-mark-button.is-active {
    border-color: var(--accent);
    background: var(--panel);
    color: var(--accent);
}

.production-mark-button.is-active svg {
    fill: currentColor;
}

.production-empty {
    padding: 18px;
    border-left: 5px solid var(--accent);
    background: var(--accent-soft);
}

.production-empty p {
    margin: 0 0 14px;
}

.production-variant-list {
    margin-bottom: 18px;
    overflow-x: auto;
    border: 1px solid var(--line);
}

.production-variant-header,
.production-variant-row {
    display: grid;
    grid-template-columns: minmax(145px, 0.9fr) minmax(130px, 0.8fr) minmax(190px, 1.2fr) minmax(180px, 1.1fr) 130px 120px 100px 132px;
    min-width: 1150px;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
}

.production-variant-header {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.production-variant-row {
    min-height: 54px;
    border-bottom: 1px solid var(--line);
}

.production-variant-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.production-variant-row:last-child {
    border-bottom: 0;
}

.production-variant-row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.production-variant-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.production-variant-actions form {
    margin: 0;
}

.production-variant-actions .icon-button {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.production-variant-actions svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.production-delete-button {
    border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
    color: var(--danger);
    font-size: 21px;
}

.production-add-button {
    display: inline-flex;
    margin-bottom: 22px;
}

.production-status-list {
    margin: 0;
    border-top: 1px solid var(--line);
}

.production-status-list > div {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.7fr);
    gap: 18px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.production-status-list dt {
    color: var(--muted);
    font-weight: 700;
}

.production-status-list dd {
    margin: 0;
    text-align: right;
}

.production-status-value {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.production-status-value.is-yes {
    color: var(--success);
}

.production-status-value.is-no {
    color: var(--danger);
}

.production-status-dialog {
    width: min(520px, calc(100vw - 32px));
}

.production-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.production-form-actions > * {
    margin: 0;
}

.production-edit-dialog {
    width: min(920px, calc(100vw - 32px));
}

.production-form fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.production-form fieldset:disabled {
    opacity: 0.72;
}

.production-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.production-grid select {
    margin-bottom: 0;
}

.production-options {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 22px;
}

.production-cut,
.production-mirrored,
.production-white-print {
    width: max-content;
}

@media (max-width: 1180px) {
    .production-filter-form {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

.production-form h3 {
    margin: 28px 0 12px;
    font-size: 17px;
}

.production-checks {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 8px 18px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
}

.material-requirement-nav-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-subsection-heading {
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.settings-subsection-heading h3 {
    margin: 0;
}

.settings-inline-options {
    display: grid;
    gap: 8px;
    align-content: end;
}

.material-requirement-project {
    margin: 0 0 30px;
    padding: 18px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--accent);
    border-radius: 6px;
    background: var(--panel);
}

.material-requirement-project > header,
.material-result-head,
.material-roll-result > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.material-requirement-project > header h3,
.material-result-head h2,
.material-roll-result h3 {
    margin: 0 0 4px;
}

.material-requirement-project > header p,
.material-result-head p {
    margin: 0;
    color: var(--muted);
}

.material-project-settings {
    margin: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.material-project-settings summary {
    padding: 12px 0;
    color: var(--accent-ink);
    font-weight: 700;
    cursor: pointer;
}

.material-project-settings form {
    padding: 4px 0 16px;
}

.material-settings-grid,
.material-position-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
}

.material-position-list,
.material-planning-history,
.material-cut-list {
    margin: 16px 0;
    overflow-x: auto;
    border: 1px solid var(--line);
}

.material-position-head,
.material-position-list > article {
    display: grid;
    grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) 125px 155px 75px minmax(180px, 1.2fr) 100px;
    min-width: 1050px;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
}

.material-position-head,
.material-planning-history-head,
.material-cut-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.material-position-list > article,
.material-planning-history > article,
.material-cut-list > div:not(.material-cut-head) {
    border-top: 1px solid var(--line);
}

.material-position-list > article:nth-child(odd),
.material-planning-history > article:nth-child(odd),
.material-cut-list > div:nth-child(odd) {
    background: var(--panel-alt);
}

.material-position-dialog {
    width: min(920px, calc(100vw - 32px));
}

.material-position-create-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.material-bulk-dimensions textarea {
    min-height: 240px;
    margin: 0;
    font-variant-numeric: tabular-nums;
    line-height: 1.55;
}

.material-project-documents {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.material-project-documents > span {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.material-project-documents a {
    color: var(--accent-ink);
    font-weight: 700;
}

.material-position-form-grid .settings-field-wide {
    grid-column: 1 / -1;
}

.material-requirements-page {
    max-width: 1700px;
}

.material-planning-panel {
    padding: 0;
    border: 0;
    background: transparent;
}

.material-pool-list {
    display: grid;
    gap: 0;
    margin-bottom: 18px;
}

.material-pool-list h2 {
    margin: 22px 0 0;
    padding: 10px 12px;
    border-left: 5px solid var(--accent);
    background: var(--panel-muted);
    font-size: 17px;
}

.material-pool-head,
.material-pool-row {
    display: grid;
    grid-template-columns: 28px 120px minmax(190px, 1.3fr) minmax(140px, 1fr) 70px 150px 145px minmax(150px, 1fr) 110px;
    align-items: center;
    gap: 10px;
}

.material-pool-head {
    min-width: 1280px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.material-pool-row {
    min-width: 1280px;
    min-height: 50px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-top: 0;
    background: var(--panel);
}

.material-pool-row:hover {
    background: var(--accent-soft);
}

.material-pool-reference {
    color: var(--accent);
    font-weight: 700;
}

.material-pool-row.is-planned {
    color: var(--muted);
}

.material-pool-row.is-ordered {
    opacity: .65;
    cursor: default;
}

.material-pool-row small {
    color: var(--success);
    font-weight: 700;
}

.material-stock-input {
    margin: 22px 0;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.material-stock-input > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.material-stock-input h2,
.material-stock-input p {
    margin: 0;
}

.material-stock-input p {
    margin-top: 4px;
    color: var(--muted);
}

.material-stock-list {
    display: grid;
    gap: 8px;
}

.material-stock-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(160px, 240px) 42px;
    align-items: end;
    gap: 10px;
}

.material-stock-row label {
    display: grid;
    gap: 5px;
}

.material-stock-row select,
.material-stock-row input {
    margin: 0;
}

.material-planning-history-head,
.material-planning-history > article {
    display: grid;
    grid-template-columns: 150px 180px 100px 90px 150px 60px;
    min-width: 760px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.material-result-head > div:last-child {
    display: flex;
    gap: 8px;
}

.material-planning-status {
    display: grid;
    grid-template-columns: minmax(180px, 280px) auto;
    gap: 8px 12px;
    align-items: end;
    width: max-content;
    margin: 18px 0;
}

.material-planning-status label {
    grid-column: 1 / -1;
}

.material-planning-status select {
    margin: 0;
}

.material-cost-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    margin: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.material-cost-summary > div {
    display: grid;
    gap: 5px;
    padding: 14px;
    border-right: 1px solid var(--line);
}

.material-cost-summary > div:last-child {
    border-right: 0;
    background: var(--accent-soft);
}

.material-cost-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.material-cost-summary strong {
    font-size: 20px;
}

.material-roll-result {
    margin-top: 24px;
}

.material-roll-result > header {
    align-items: center;
    padding: 12px 14px;
    border-left: 5px solid var(--accent);
    background: var(--panel-muted);
}

.material-cut-head,
.material-cut-list > div {
    display: grid;
    grid-template-columns: 60px 110px minmax(150px, 1fr) 150px 175px 190px 130px;
    min-width: 1060px;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
}

@media (max-width: 980px) {
    .material-settings-grid,
    .material-position-form-grid,
    .material-cost-summary {
        grid-template-columns: 1fr;
    }

    .material-pool-list {
        overflow-x: auto;
    }
}

.manual-time-entry h3,
#times > h3 {
    margin: 0 0 14px;
}

.manual-time-grid {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr);
    gap: 12px;
    align-items: end;
}

.manual-time-grid input,
.manual-time-grid select {
    margin-bottom: 0;
}

.manual-time-grid button {
    height: 42px;
}

.manual-time-entry textarea {
    margin-bottom: 12px;
}

.settings-time-category-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) max-content;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.time-category-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.time-category-row .drag-handle {
    margin-bottom: 0;
}

.settings-time-category-grid input {
    margin-bottom: 0;
}

.settings-time-category-grid button {
    height: 42px;
}

.purchase-create {
    margin: 16px 0 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
}

.purchase-create h3,
.purchase-panel > h3 {
    margin: 0 0 14px;
}

.purchase-form-grid {
    display: grid;
    grid-template-columns: minmax(190px, 0.7fr) minmax(280px, 1.3fr);
    gap: 12px;
}

.purchase-form-grid input,
.purchase-form-grid select {
    margin-bottom: 0;
}

.purchase-article-field {
    position: relative;
}

.purchase-article-suggestions {
    top: calc(100% + 4px);
    z-index: 30;
}

.purchase-article-suggestions button {
    display: grid;
    gap: 3px;
}

.purchase-article-suggestions strong,
.purchase-article-suggestions span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-article-suggestions span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.purchase-info-field {
    grid-column: 1 / -1;
}

.purchase-info-field textarea {
    min-height: 78px;
}

.purchase-create form > button,
.purchase-create-actions {
    margin-top: 12px;
}

.purchase-create-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.purchase-create-actions button {
    margin: 0;
}

.purchase-edit-list {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.purchase-standard-articles {
    margin-top: 26px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
}

.purchase-standard-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.purchase-standard-head h3 {
    margin: 0;
}

.purchase-standard-head > div > span {
    color: var(--muted);
    font-size: 12px;
}

.purchase-standard-filter {
    width: min(360px, 100%);
}

.purchase-standard-filter span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
}

.purchase-standard-filter input {
    width: 100%;
    margin: 0;
}

.purchase-standard-table {
    overflow-x: auto;
}

.purchase-standard-header,
.purchase-standard-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) minmax(140px, .8fr) minmax(120px, .7fr) minmax(170px, 1fr) 100px 54px;
    gap: 12px;
    align-items: center;
    min-width: 850px;
    padding: 9px 14px;
}

.purchase-standard-header {
    color: var(--muted);
    background: var(--panel-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.purchase-standard-row {
    min-height: 48px;
    border-top: 1px solid var(--line);
}

.purchase-standard-row[hidden] {
    display: none;
}

.purchase-standard-row:nth-child(even) {
    background: var(--panel-alt);
}

.purchase-standard-row:hover {
    background: var(--accent-soft);
}

.purchase-standard-row strong,
.purchase-standard-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-standard-select {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    color: var(--accent-contrast);
    background: var(--accent);
    font-size: 20px;
    line-height: 1;
}

.purchase-standard-no-results,
.purchase-standard-articles > .empty-state {
    margin: 0;
    padding: 14px 16px;
}

.client-page > .purchase-standard-articles {
    margin-top: 24px;
}

.client-page .purchase-standard-header,
.client-page .purchase-standard-row {
    grid-template-columns: minmax(220px, 1.5fr) minmax(140px, .8fr) minmax(120px, .7fr) minmax(170px, 1fr) 100px;
}

.purchase-edit-item {
    display: grid;
    grid-template-columns: 130px minmax(210px, 1fr) 210px 150px 155px 122px;
    gap: 12px;
    align-items: center;
    min-width: 980px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-left: 5px solid var(--danger);
    background: var(--panel);
}

.purchase-quantity-progress {
    display: grid;
    grid-template-columns: 52px 64px 64px;
    gap: 6px;
    align-items: center;
}

.purchase-quantity-progress::before {
    content: "Menge    WE    Fertig";
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 10px;
    white-space: pre;
}

.purchase-quantity-progress input {
    width: 64px;
    height: 32px;
    margin: 0;
    padding: 5px;
}

.purchase-quantity-progress small {
    grid-column: 1 / -1;
    min-height: 12px;
    color: var(--success);
    font-size: 10px;
}

.purchase-quantity-progress small.is-error {
    color: var(--danger);
}

.purchase-open-warning {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid var(--danger);
    border-radius: 50%;
    color: var(--danger);
    font-weight: 900;
}

.purchase-row-product,
.purchase-row-responsible {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.purchase-row-product small,
.purchase-row-responsible small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-edit-item:last-child {
    border-bottom: 0;
}

.purchase-edit-item.is-ordered {
    border-left-color: var(--line);
    background: var(--panel-alt);
}

.purchase-edit-item.is-stock {
    border-left-color: var(--success);
}

.purchase-row-category,
.purchase-row-name,
.purchase-row-info,
.purchase-open-note,
.purchase-ordered-note {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-row-category,
.purchase-row-info {
    color: var(--muted);
}

.purchase-open-note {
    color: var(--danger);
}

.purchase-ordered-note {
    color: var(--success);
}

.purchase-stock-note {
    color: var(--success);
    font-weight: 700;
}

.purchase-item-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
}

.purchase-overview-row form {
    margin: 0;
}

.purchase-list-action-form {
    display: none;
}

.danger-button {
    border-color: #713a35;
    background: #351d1b;
    color: var(--danger);
}

.purchase-row-action {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: 19px;
    line-height: 1;
}

.purchase-order-action {
    color: var(--success);
}

.purchase-edit-action {
    color: var(--accent-ink);
}

.purchase-delete-action {
    color: var(--danger);
    font-size: 24px;
}

.purchase-row-action:hover {
    border-color: currentColor;
    background: var(--panel-muted);
}

.purchase-edit-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.purchase-edit-dialog::backdrop {
    background: rgba(0, 0, 0, 0.68);
}

.purchase-edit-dialog h2 {
    margin: 0 40px 20px 0;
}

.purchase-edit-dialog textarea {
    min-height: 120px;
    margin-bottom: 0;
}

.purchase-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.purchase-category-heading {
    margin: 24px 0 8px;
    padding: 9px 12px;
    border-left: 5px solid var(--accent);
    background: var(--panel-muted);
    font-size: 16px;
}

.purchase-category-heading:first-child {
    margin-top: 0;
}

.purchase-overview-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) 190px auto;
    gap: 18px;
    align-items: center;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.purchase-overview-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.purchase-overview-main p {
    margin: 6px 0 0;
    color: var(--muted);
}

.purchase-overview-category {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.purchase-order-reference,
.purchase-overview-status {
    display: grid;
    gap: 5px;
}

.purchase-order-reference span,
.purchase-overview-status small {
    color: var(--muted);
    font-size: 13px;
}

.purchase-order-reference a {
    color: var(--accent-ink);
    font-weight: 700;
}

.purchase-overview-row:not(.is-ordered) .purchase-overview-status span {
    color: var(--danger);
    font-weight: 700;
}

.purchase-overview-row.is-ordered .purchase-overview-status span {
    color: var(--success);
}

.purchase-page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.purchase-page-actions button span {
    margin-right: 7px;
    font-size: 20px;
    line-height: 1;
}

.purchase-list-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.purchase-list-row {
    display: grid;
    grid-template-columns: 125px minmax(190px, 1fr) 110px 70px 105px minmax(170px, .8fr) 82px;
    gap: 14px;
    align-items: center;
    min-width: 920px;
    min-height: 54px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    border-left: 5px solid var(--danger);
    background: var(--panel);
}

.purchase-list-category {
    padding: 9px 14px;
    border-top: 1px solid var(--line);
    border-left: 5px solid var(--accent);
    background: var(--panel-muted);
    color: var(--text);
    font-weight: 800;
}

.purchase-list-name {
    display: flex;
    align-items: center;
    gap: 7px;
}

.purchase-order-client {
    display: grid;
    gap: 2px;
}

.purchase-order-client small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-list-actions {
    display: flex;
    gap: 6px;
}

.purchase-list-actions form {
    margin: 0;
}

.purchase-due-icon {
    position: relative;
    flex: 0 0 16px;
    width: 16px;
    height: 15px;
    border: 2px solid var(--danger);
    border-radius: 2px;
}

.purchase-due-icon::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 0;
    width: 100%;
    border-top: 2px solid var(--danger);
}

.purchase-list-row:last-child {
    border-bottom: 0;
}

.purchase-list-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.purchase-list-row.is-ordered {
    border-left-color: var(--line);
}

.purchase-list-head {
    min-height: 42px;
    border-left-color: var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.purchase-list-row > span,
.purchase-list-row > strong,
.purchase-list-info {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-list-row a {
    color: var(--accent-ink);
    font-weight: 700;
}

.purchase-list-info small {
    flex: 0 0 auto;
    margin-left: 8px;
    color: var(--success);
    font-size: 12px;
}

.purchase-list-info {
    display: flex;
    align-items: center;
}

.purchase-list-info > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.purchase-list-row form {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.purchase-list-table > .empty-state {
    margin: 0;
    padding: 18px;
}

.knowledge-create {
    margin: 16px 0 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
}

.knowledge-create h3,
.knowledge-panel > h3 {
    margin: 0 0 14px;
}

.knowledge-title-field {
    position: relative;
}

.knowledge-title-field .suggestions {
    top: 65px;
}

.knowledge-create textarea,
.knowledge-edit-item textarea {
    min-height: 110px;
    margin-bottom: 12px;
}

.knowledge-edit-list {
    display: grid;
    gap: 12px;
}

.knowledge-edit-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--accent);
    border-radius: 6px;
    background: var(--panel-alt);
}

.knowledge-edit-item h3 {
    margin: 0 0 10px;
}

.knowledge-edit-item p {
    white-space: normal;
}

.knowledge-edit-item footer,
.knowledge-result footer {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

.knowledge-delete-form {
    display: inline-flex;
    margin: 10px 0 0;
}

.knowledge-query-filter {
    width: min(520px, 45vw);
}

.knowledge-results > h2 {
    margin: 26px 0 8px;
    padding: 9px 12px;
    border-left: 5px solid var(--accent);
    background: var(--panel-muted);
    font-size: 17px;
}

.knowledge-results > h2:first-child {
    margin-top: 0;
}

.knowledge-result {
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.knowledge-result:nth-of-type(even) {
    background: var(--panel-alt);
}

.knowledge-result header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.knowledge-result h3,
.knowledge-result p {
    margin: 0;
}

.knowledge-category-form {
    grid-template-columns: minmax(260px, 1fr) 100px auto;
}

.knowledge-category-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
}

.knowledge-category-row > form:first-of-type {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 80px auto auto;
    align-items: center;
    gap: 10px;
}

.appointment-category-row,
.knowledge-category-row {
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.appointment-category-form,
.knowledge-category-form {
    display: grid;
    align-items: end;
    gap: 12px;
    width: 100%;
}

.appointment-category-form {
    grid-template-columns: minmax(240px, 1fr) minmax(170px, .55fr) minmax(210px, auto) max-content;
}

.knowledge-category-form {
    grid-template-columns: minmax(260px, 1fr) minmax(170px, .55fr) max-content;
}

.appointment-category-form input,
.appointment-category-form button,
.knowledge-category-form input,
.knowledge-category-form button,
.appointment-category-form .checkbox-field {
    margin-bottom: 14px;
}

.appointment-category-row > form:first-of-type {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, .55fr) auto auto max-content;
}

.knowledge-category-row > form:first-of-type {
    grid-template-columns: minmax(240px, 1fr) minmax(160px, .55fr) auto max-content;
}

.appointment-category-row > form:first-of-type > *,
.knowledge-category-row > form:first-of-type > *,
.appointment-category-row > form:last-of-type,
.knowledge-category-row > form:last-of-type,
.appointment-category-row .settings-delete-button,
.knowledge-category-row .settings-delete-button {
    margin-top: 0;
    margin-bottom: 0;
}

.appointment-category-row > form:last-of-type,
.knowledge-category-row > form:last-of-type {
    display: flex;
    align-items: center;
}

.appointment-category-row button,
.knowledge-category-row button {
    height: 38px;
}

.color-input-controls {
    display: grid;
    grid-template-columns: 48px minmax(96px, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 150px;
}

.settings-page .color-input-controls {
    margin-bottom: 14px;
}

.settings-page .color-input-controls input {
    width: 100%;
    min-width: 0;
    margin: 0 !important;
}

.settings-page .color-input-controls input[type="color"] {
    width: 48px;
}

.appointment-category-row .color-input-controls,
.knowledge-category-row .color-input-controls {
    margin-bottom: 0;
}

.tag-create-form .color-input-controls,
.tag-edit-form .color-input-controls {
    grid-template-columns: 42px minmax(92px, 1fr);
    width: 100%;
    min-width: 0;
    height: 42px;
    margin-bottom: 0;
}

.settings-page .tag-create-form .color-input-controls input,
.settings-page .tag-edit-form .color-input-controls input,
.settings-page .tag-create-form .color-input-controls input[type="color"],
.settings-page .tag-edit-form .color-input-controls input[type="color"] {
    width: 100%;
    min-width: 0;
    height: 42px;
    min-height: 42px;
    margin: 0 !important;
}

.knowledge-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

.knowledge-filter-form {
    width: 100%;
    min-width: 0;
    margin-bottom: 22px;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-sizing: border-box;
}

.knowledge-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.knowledge-filter-grid > .knowledge-query-filter {
    grid-column: span 3;
}

.knowledge-filter-grid > .knowledge-category-filter-field {
    grid-column: span 2;
}

.knowledge-filter-grid > .knowledge-type-filter-field {
    grid-column: span 1;
}

.knowledge-filter-grid > .client-filter,
.knowledge-filter-grid > .knowledge-purchase-filter {
    grid-column: span 3;
    width: 100%;
    max-width: 100%;
}

.knowledge-filter-field {
    position: relative;
    display: grid;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    gap: 7px;
    box-sizing: border-box;
}

.knowledge-filter-field label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.knowledge-filter-field input,
.knowledge-filter-field select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 42px;
    margin: 0;
    box-sizing: border-box;
}

.knowledge-filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.knowledge-filter-actions button,
.knowledge-filter-actions .secondary-button {
    min-height: 40px;
    margin: 0;
}

.mail-history {
    display: grid;
    gap: 18px;
}

.mail-history-entry {
    border: 1px solid var(--line);
    background: var(--panel);
}

.mail-history-entry > summary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(140px, .8fr) 132px 34px;
    align-items: center;
    gap: 14px;
    min-height: 48px;
    padding: 7px 12px;
    background: var(--panel-alt);
    cursor: pointer;
    list-style: none;
}

.mail-history-entry > summary::-webkit-details-marker {
    display: none;
}

.mail-history-entry > summary > strong,
.mail-history-entry > summary > span:not(.mail-history-detail-icon) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-history-entry > summary time,
.mail-history-entry > summary > span:not(.mail-history-detail-icon) {
    color: var(--muted);
    font-size: 13px;
}

.mail-history-entry h3,
.mail-history-entry p {
    margin: 0;
}

.mail-history-detail-icon {
    position: relative;
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--input);
}

.mail-history-detail-icon::before {
    position: absolute;
    top: 8px;
    left: 10px;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 120ms ease, top 120ms ease;
    content: '';
}

.mail-history-entry[open] .mail-history-detail-icon::before {
    top: 11px;
    transform: rotate(225deg);
}

.mail-history-content {
    border-top: 1px solid var(--line);
}

.mail-history-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px 0;
}

.mail-history-attachments h3 {
    color: var(--muted);
    font-size: 13px;
}

.mail-history-content-head .settings-delete-button {
    width: 34px;
    height: 34px;
    margin: 0;
}

.mail-history-body {
    padding: 20px 18px;
    line-height: 1.6;
    white-space: normal;
}

.mail-history-attachments {
    display: grid;
    gap: 8px;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
}

.settings-status-mailtext > small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    line-height: 1.5;
}

.knowledge-purchase-filter {
    position: relative;
}

.knowledge-library-results {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    box-sizing: border-box;
}

.knowledge-library-header,
.knowledge-library-row {
    display: grid;
    grid-template-columns: 124px minmax(0, 1.5fr) minmax(0, 1.15fr) minmax(0, .95fr) 132px 76px;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.knowledge-library-header > *,
.knowledge-library-row > * {
    min-width: 0;
}

.knowledge-library-header {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.knowledge-library-row {
    min-height: 78px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.knowledge-library-row[data-dialog-row] {
    cursor: pointer;
}

.knowledge-library-row[data-dialog-row]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.knowledge-library-row:nth-child(odd) {
    background: var(--panel-alt);
}

.knowledge-library-row:hover {
    background: var(--accent-soft);
}

.knowledge-library-type,
.knowledge-library-content,
.knowledge-library-assignment,
.knowledge-library-date,
.knowledge-download-link {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.knowledge-library-content small,
.knowledge-library-assignment small,
.knowledge-library-date small,
.knowledge-download-link small {
    color: var(--muted);
}

.knowledge-library-content strong,
.knowledge-library-content small,
.knowledge-library-assignment strong,
.knowledge-library-assignment > span,
.knowledge-download-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-library-assignment a,
.knowledge-download-link {
    color: var(--accent);
}

.knowledge-library-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.knowledge-library-actions form {
    display: flex;
    align-items: center;
    margin: 0;
}

.knowledge-library-actions .settings-delete-button {
    width: 34px;
    height: 34px;
    margin: 0;
}

.knowledge-category-badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 3px 7px;
    overflow: hidden;
    border-left: 4px solid var(--knowledge-color);
    background: color-mix(in srgb, var(--knowledge-color) 18%, var(--panel));
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-download-link {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
}

.knowledge-download-link small {
    grid-column: 2;
}

.knowledge-file-icon {
    grid-row: span 2;
    width: 17px;
    height: 21px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.knowledge-create-dialog {
    width: min(900px, calc(100vw - 32px));
}

.knowledge-detail-dialog {
    width: min(760px, calc(100vw - 32px));
}

.knowledge-edit-dialog {
    width: min(900px, calc(100vw - 32px));
}

.knowledge-detail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.knowledge-detail-info {
    margin: 18px 0;
    padding: 16px;
    background: var(--panel-alt);
    border-left: 5px solid var(--accent);
    line-height: 1.55;
    white-space: normal;
}

.knowledge-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.knowledge-detail-meta div {
    padding: 10px;
    background: var(--panel-alt);
}

.knowledge-detail-meta dt {
    color: var(--muted);
    font-size: 12px;
}

.knowledge-detail-meta dd {
    margin: 4px 0 0;
}

.knowledge-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 18px;
}

.knowledge-create-grid > div {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.knowledge-create-grid .client-filter,
.knowledge-create-grid .knowledge-purchase-filter {
    width: 100%;
    max-width: 100%;
}

.knowledge-create-grid label {
    display: block;
    margin-bottom: 6px;
}

.knowledge-create-grid input,
.knowledge-create-grid select,
.knowledge-create-grid textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.knowledge-rich-editor .rich-area {
    min-height: 190px;
}

.knowledge-create-wide {
    grid-column: 1 / -1;
}

.knowledge-file-field {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    padding: 20px;
    border: 1px dashed var(--line-strong, var(--line));
    border-radius: 6px;
    background: var(--panel-alt);
}

.knowledge-file-field label {
    margin: 0;
    font-weight: 700;
}

.knowledge-file-field input[type="file"] {
    min-height: 48px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
}

.knowledge-file-field input[type="file"]::file-selector-button {
    min-height: 34px;
    margin-right: 12px;
    padding: 0 14px;
    border: 0;
    border-radius: 5px;
    background: var(--accent);
    color: var(--accent-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.knowledge-file-field small {
    color: var(--muted);
    line-height: 1.45;
}

.knowledge-current-file {
    width: max-content;
    max-width: 100%;
    color: var(--accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-linked-order {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    background: var(--panel-alt);
}

.knowledge-linked-order span {
    color: var(--muted);
}

.knowledge-linked-order a {
    color: var(--accent);
    font-weight: 700;
}

@media (max-width: 1250px) {
    .knowledge-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .knowledge-filter-grid > .knowledge-filter-field {
        grid-column: auto;
    }

    .knowledge-filter-grid > .knowledge-query-filter {
        grid-column: 1 / -1;
    }

    .knowledge-library-header,
    .knowledge-library-row {
        grid-template-columns: 110px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) 118px 76px;
        gap: 9px;
    }
}

@media (max-width: 760px) {
    .knowledge-filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .knowledge-filter-grid > .knowledge-query-filter {
        grid-column: auto;
    }

    .knowledge-filter-actions {
        justify-content: flex-start;
    }
}

.knowledge-result header a {
    color: var(--accent-ink);
    font-weight: 700;
}

.knowledge-result p {
    margin-top: 12px;
    line-height: 1.55;
}

.time-entry {
    display: grid;
    grid-template-columns: 135px 130px 150px 150px 100px minmax(200px, 1fr) 54px;
    gap: 12px;
    align-items: start;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    min-width: 1050px;
}

.time-entry-actions {
    display: flex;
    justify-content: flex-end;
}

.time-edit-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-color: var(--line);
    background: #fff;
    color: var(--accent-ink);
    font-size: 19px;
}

.time-edit-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.time-entry:last-child {
    border-bottom: 0;
}

.time-entry-head {
    background: #edf0f4;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.time-entry.is-running {
    background: #fff0ee;
    color: #a1160a;
    font-weight: 700;
}

@media (max-width: 900px) {
    .time-dialog-details,
    .time-dialog-dates {
        grid-template-columns: 1fr;
    }

    .time-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .time-dialog-actions button {
        width: 100%;
    }

    .filters {
        align-items: stretch;
        flex-direction: column;
    }

    .client-filter {
        width: 100%;
    }

    .status-filter {
        width: 100%;
    }

    .orders-table {
        overflow-x: auto;
    }

    .orders-header,
    .order-row {
        min-width: 1400px;
    }

    .form-head {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .detail-head {
        flex-direction: column;
    }

    .settings-head {
        flex-direction: column;
    }

    .tabs {
        overflow-x: auto;
    }

    .tabs a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .settings-grid,
    .settings-user-grid,
    .settings-user-main,
    .settings-status-grid,
    .settings-material-art-grid,
    .settings-material-grid,
    .settings-time-category-grid,
    .appointment-category-form,
    .knowledge-category-form {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .material-width-edit,
    .material-width-add {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .material-width-edit button,
    .material-width-add button {
        grid-column: 1 / -1;
    }

    .tag-create-form,
    .tag-settings-row,
    .tag-edit-form {
        grid-template-columns: 1fr;
    }

    .tag-settings-row {
        align-items: stretch;
    }

    .checklist-create,
    .checklist-template-head,
    .checklist-template-edit-form,
    .checklist-point-edit-form,
    .checklist-add-point,
    .order-checklist-add {
        grid-template-columns: 1fr;
    }

    .checklist-tab-head,
    .order-checklist > header {
        align-items: stretch;
        flex-direction: column;
    }

    .checklist-attach-form {
        align-items: stretch;
        flex-direction: column;
    }

    .checklist-progress-display {
        width: 100%;
        justify-content: flex-start;
    }

    .production-grid,
    .production-checks,
    .purchase-form-grid,
    .purchase-overview-row {
        grid-template-columns: 1fr;
    }

    .purchase-info-field {
        grid-column: auto;
    }

    .purchase-edit-item > header,
    .knowledge-result header {
        align-items: stretch;
        flex-direction: column;
    }

    .knowledge-query-filter {
        width: 100%;
    }

    .settings-field-wide {
        grid-column: auto;
    }

    .settings-user-grid input[type="color"],
    .settings-status-grid input[type="color"] {
        width: 100%;
    }

    .settings-user-grid button,
    .settings-status-grid button,
    .settings-time-category-grid button {
        width: 100%;
    }

    .time-summary,
    .manual-time-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Fixed dark theme */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="tel"],
select,
textarea,
option {
    border-color: var(--line);
    background: var(--input);
    color: var(--text);
}

input[type="color"] {
    border-color: var(--line) !important;
    background: var(--input) !important;
}

input[type="checkbox"] {
    accent-color: var(--success);
}

.secondary-button,
.time-dialog,
.time-dialog-close,
.nav-icon,
.segmented span,
.suggestions,
.suggestions button,
.quick-confirm-dialog,
.accounting-action-button,
.archive-action-button,
.timer-button,
.detail-timer-button,
.tabs a,
.rich-toolbar button,
.checklist-edit-point,
.drag-handle,
.checklist-delete-button,
.order-checklist-point,
.checklist-point-actions summary,
.checklist-point-menu,
.copy-button,
.mention-suggestions,
.mention-suggestions button,
.note-reply-button,
.time-edit-button {
    background: var(--panel);
}

.orders-header,
.time-entry-head {
    background: var(--panel-muted);
    color: var(--muted);
}

.order-row {
    background: var(--panel);
}

.order-row.is-alternate {
    background: var(--panel-alt);
}

.order-row:hover,
.suggestions button:hover,
.nav-icon:hover,
.mention-suggestions button:hover,
.copy-button.is-copied,
.time-edit-button:hover {
    background: var(--accent-soft);
}

.time-dialog-details div,
.tag-selector,
.detail-grid div,
.log-list article,
.manual-time-entry,
.time-summary,
.time-summary-total,
.time-summary-users,
.time-entries,
.production-checks {
    background: transparent;
}

.rich-editor,
.rich-area,
.checklist-point-list,
.order-checklist-points {
    background: var(--input);
}

.rich-editor,
.rich-area {
    border-color: var(--line);
}

.rich-toolbar {
    background: var(--panel-muted);
}

.alert,
.active-timer,
.detail-grid div.is-fixtermin,
.checklist-remove-command,
.tag-delete-button,
.time-entry.is-running {
    border-color: #713a35;
    background: #351d1b;
    color: var(--danger);
}

.active-timer-stop:hover,
.active-timer-arrow:hover {
    background: #472421;
}

.active-timer {
    border-color: #d92d20;
    background: #d92d20;
    color: #fff;
}

.active-timer-stop,
.active-timer-arrow,
.topbar .active-timer span,
.topbar .active-timer strong {
    color: #fff;
}

.active-timer-arrow {
    border-left-color: rgba(255, 255, 255, 0.4);
}

.active-timer-stop:hover,
.active-timer-arrow:hover {
    background: #a1160a;
}

.detail-grid div.is-fixtermin {
    box-shadow: inset 5px 0 0 var(--danger);
}

.detail-grid div.is-fixtermin strong,
.detail-grid div.is-fixtermin span,
.time-entry.is-running {
    color: var(--danger);
}

.alert-success {
    border-color: #2c745b;
    background: #17372d;
    color: var(--success);
}

.accounting-action-button,
.checklist-point-content small,
.checklist-progress-display > strong {
    color: var(--success);
}

.accounting-action-button:hover {
    border-color: var(--success);
    background: #17372d;
}

.archive-action-button,
.timer-button,
.detail-timer-button {
    border-color: var(--line);
    color: var(--muted);
}

.archive-action-button:hover,
.timer-button:hover,
.detail-timer-button:hover {
    border-color: var(--muted);
    background: var(--panel-muted);
}

.timer-button.is-active,
.timer-button.is-active:hover {
    color: #fff;
}

.checklist-progress-bar {
    background: var(--panel-muted);
}

.checklist-progress-bar span {
    background: var(--success);
}

.checklist-toggle input {
    accent-color: var(--success);
}

.order-checklist-point.is-completed .checklist-point-content > strong,
.order-checklist-point.is-completed .checklist-point-content > p {
    color: var(--muted);
}

.production-empty {
    background: var(--accent-soft);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

::selection {
    background: #6b5318;
    color: var(--text);
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    box-shadow: 0 0 0 1000px var(--input) inset;
    caret-color: var(--text);
}

* {
    scrollbar-color: var(--panel-muted) var(--bg);
}

.profile-page {
    max-width: 1280px;
    margin: 0 auto;
}

.profile-work-head { margin-bottom: 16px; }
.profile-work-head h2, .profile-work-head p { margin: 0; }
.profile-work-head p { margin-top: 4px; color: var(--muted); }
.work-time-table, .work-month-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.work-time-row { display: grid; grid-template-columns: 110px 68px 68px 105px 95px 105px 105px minmax(120px,auto); gap: 12px; align-items: center; min-width: 920px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.work-time-row:last-child { border-bottom: 0; }
.work-time-row.has-mismatch { border-left: 6px solid #d55; background: color-mix(in srgb, #d55 8%, var(--panel)); }
.work-time-row.is-vacation,
.admin-work-row.is-vacation,
.work-month-day.is-vacation { background: color-mix(in srgb, #58b96d 12%, var(--panel)); }
.work-time-head { background: var(--panel-alt); color: var(--muted); font-size: 12px; text-transform: uppercase; }
.work-time-actions { display: flex; gap: 7px; align-items: center; justify-content: flex-end; }
.work-time-actions form { margin: 0; }
.vacation-day-button { color: var(--muted); font-size: 19px; }
.vacation-day-button.is-active { border-color: #58b96d; background: #58b96d; color: #fff; }
.work-time-difference.is-positive { color: #58b96d; }
.work-time-difference.is-negative { color: #df7373; }
.work-time-confirmed { display: grid; place-items: center; width: 32px; height: 32px; color: #54b86a; font-size: 20px; }
.profile-work-time > h3 { margin: 28px 0 12px; }
.work-month-row { display: grid; grid-template-columns: 110px repeat(4, minmax(105px,1fr)) 38px; gap: 12px; align-items: center; min-width: 720px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.work-month-row:last-child { border-bottom: 0; }
.work-time-dialog { width: min(620px, calc(100vw - 32px)); }
.work-time-date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.work-time-dialog label { display: grid; gap: 7px; }
.work-time-dialog fieldset { margin: 16px 0 0; padding: 12px; border: 1px solid var(--line); }
.work-time-absence-options > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.work-time-dialog .work-time-absence-options .ui-radio-field { display: inline-flex; min-height: 30px; }
.work-time-dialog [data-work-time-field-group] { transition: opacity 120ms ease; }
.work-time-dialog [data-work-time-field-group].is-disabled { opacity: .42; }
.work-time-duration-inputs { display: grid; grid-template-columns: 70px auto 70px auto 70px auto; gap: 7px; align-items: center; }
.work-time-duration-inputs input { min-width: 0; }
.work-time-duration-inputs input[readonly] { background: var(--panel-alt); color: var(--text); }
.work-time-timeline { display: grid; gap: 7px; margin: 0 0 18px; }
.work-time-timeline-row { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 12px; padding: 9px 11px; border-left: 5px solid #58b96d; background: var(--panel-alt); }
.work-time-timeline-row.is-pause { border-left-color: var(--accent); }
.work-time-calculation-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.work-time-log-button { color: var(--text); font-size: 20px; }
.work-time-log-dialog { width: min(760px, calc(100vw - 32px)); }
.work-time-log-dialog > h2 { margin-bottom: 3px; }
.work-time-log-user { margin: 0 0 18px; color: var(--muted); }
.work-time-log-list { display: grid; gap: 12px; max-height: min(620px, 70vh); overflow-y: auto; }
.work-time-log-entry { padding: 13px 14px; border: 1px solid var(--line); background: var(--panel-alt); }
.work-time-log-entry > header { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.work-time-log-entry > header time, .work-time-log-entry > p { color: var(--muted); font-size: 12px; }
.work-time-log-entry > p { margin: 5px 0 0; }
.work-time-log-changes { display: grid; gap: 6px; margin-top: 12px; }
.work-time-log-changes > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(125px, auto) 18px minmax(125px, auto); gap: 8px; align-items: center; }
.work-time-log-changes > div > span:nth-last-child(1) { color: var(--accent); }
.work-month-dialog { width: min(800px, calc(100vw - 32px)); }
.work-month-day { display: grid; grid-template-columns: 110px repeat(5, 1fr); gap: 10px; padding: 9px; border-bottom: 1px solid var(--line); }
.work-month-day.is-head { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.profile-tabs {
    margin-bottom: 18px;
}

.profile-tab-panel {
    padding: 0;
    border: 0;
    background: transparent;
}

.profile-form {
    display: grid;
    gap: 18px;
    margin-bottom: 28px;
}

.profile-section {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.profile-section h2 {
    margin: 0 0 18px;
    font-size: 19px;
}

.profile-color-field {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-color-field input[type="color"] {
    width: 120px;
    height: 42px;
    margin: 0;
}

.profile-color-preview {
    width: 18px;
    height: 18px;
    border: 2px solid var(--text);
    border-radius: 50%;
    background: var(--profile-color);
}

.profile-password-hint {
    margin: -8px 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.profile-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.profile-password-grid input {
    margin-bottom: 0;
}

.profile-form > button {
    justify-self: start;
}

.profile-logout-form {
    margin: 0;
}

.profile-logout-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.profile-logout-button .logout-icon {
    width: 18px;
    height: 16px;
}

.profile-logout-button .logout-icon::before {
    width: 9px;
    height: 16px;
}

.profile-logout-button .logout-icon::after {
    top: 4px;
    width: 12px;
}

.personal-checklist-management {
    margin-top: 18px;
}

.profile-page .personal-checklist-management {
    margin-top: 0;
}

.personal-checklist-section-head p {
    margin: -10px 0 18px;
    color: var(--muted);
}

.personal-checklist-create-list {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.personal-checklist-create-list > div,
.personal-checklist-profile-head > form:first-child > div {
    flex: 1;
}

.personal-checklist-create-list input,
.personal-checklist-profile-head input,
.personal-checklist-add-point input,
.personal-checklist-profile-point input {
    margin-bottom: 0;
}

.personal-checklist-create-list .checkbox-field,
.personal-checklist-profile-head .checkbox-field {
    min-height: 42px;
    margin: 0;
}

.personal-checklist-profile-card {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.personal-checklist-profile-card:last-child {
    border-bottom: 0;
}

.personal-checklist-profile-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 12px;
}

.personal-checklist-profile-head > form:last-child,
.personal-checklist-profile-point > form:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
}

.personal-checklist-profile-head .settings-delete-button,
.personal-checklist-profile-point .settings-delete-button {
    width: var(--icon-button-size, 38px);
    min-width: var(--icon-button-size, 38px);
    height: var(--icon-button-size, 38px);
    min-height: var(--icon-button-size, 38px);
    margin: 0;
}

.personal-checklist-profile-points {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

.personal-checklist-profile-point {
    display: grid;
    grid-template-columns: var(--list-columns, var(--form-control-height) 28px minmax(0, 1fr) var(--form-control-height));
    gap: 8px;
    align-items: center;
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    background: var(--input);
}

.personal-checklist-profile-point > form[data-personal-point-complete] {
    display: flex;
    justify-content: center;
}

.personal-checklist-profile-point:last-child {
    border-bottom: 0;
}

.personal-checklist-point-edit input {
    flex: 1;
}

.personal-checklist-add-point {
    margin-top: 10px;
}

.personal-checklist-add-point input {
    flex: 1;
}

.profile-private-messages {
    margin-top: 0;
}

.profile-message-compose {
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-alt);
}

.profile-message-compose > summary,
.profile-message-reply > summary {
    padding: 12px 14px;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.profile-message-compose > form {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.3fr) max-content;
    gap: 14px;
    align-items: end;
    padding: 4px 14px 16px;
}

.profile-message-compose > form > div {
    display: grid;
    gap: 7px;
}

.profile-message-compose > form > .ui-form-field:not(.profile-message-compose-info) {
    align-self: end;
    grid-template-rows: minmax(17px, auto) var(--form-control-height);
}

.profile-message-compose > form > .ui-form-field:not(.profile-message-compose-info) > :is(.ui-input, .ui-select) {
    align-self: end;
    height: var(--form-control-height);
    min-height: var(--form-control-height);
    margin: 0;
}

.profile-message-compose-info {
    grid-column: 1 / -1;
}

.profile-message-compose textarea,
.profile-message-reply textarea {
    resize: vertical;
}

.profile-message-compose > form > button {
    align-self: end;
    grid-column: 3;
    grid-row: 1;
    height: var(--form-control-height);
    min-height: var(--form-control-height);
    margin: 0;
}

.profile-message-conversations {
    display: grid;
    gap: 16px;
}

.profile-message-conversation {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-alt);
}

.profile-message-conversation > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
}

.profile-message-conversation > header span {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.profile-message-conversation > header strong small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.profile-message-thread {
    display: grid;
}

.profile-message-entry {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    box-shadow: inset 4px 0 0 var(--line-strong);
}

.profile-message-entry:last-child {
    border-bottom: 0;
}

.profile-message-entry.is-own {
    box-shadow: inset 4px 0 0 var(--accent);
}

.profile-message-entry.is-reply {
    margin-left: 24px;
    background: color-mix(in srgb, var(--panel) 75%, var(--panel-alt));
}

.profile-message-entry > header,
.profile-message-entry footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
}

.profile-message-entry > header {
    font-size: 13px;
}

.profile-message-entry mark {
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 11px;
    font-weight: 700;
}

.profile-message-entry p {
    margin: 12px 0;
    line-height: 1.55;
}

.profile-message-entry footer {
    color: var(--muted);
    font-size: 12px;
}

.profile-message-reply {
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.profile-message-reply > form {
    display: grid;
    gap: 12px;
    padding: 0 14px 16px;
}

.profile-message-reply label {
    display: grid;
    gap: 7px;
}

.profile-message-reply button {
    justify-self: end;
}

@media (max-width: 760px) {
    .profile-message-compose > form {
        grid-template-columns: 1fr;
    }

    .profile-message-compose-info,
    .profile-message-compose > form > button {
        grid-column: 1;
        grid-row: auto;
    }

    .profile-message-entry.is-reply {
        margin-left: 12px;
    }
}

.dashboard-page {
    max-width: 1700px;
    margin: 0 auto;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(340px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.dashboard-main-column {
    display: grid;
    gap: 18px;
}

.dashboard-side-column {
    display: grid;
    gap: 18px;
    align-items: start;
}

.dashboard-title-head {
    align-items: center;
}

.dashboard-unread-total {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    min-width: 48px;
    height: 42px;
    min-height: 42px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--danger) 78%, #fff 22%);
    border-radius: 6px;
    background: var(--danger);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 42%, transparent);
    animation: dashboard-unread-alert 1.65s ease-in-out infinite;
}

.dashboard-unread-total[hidden] {
    display: none;
}

@keyframes dashboard-unread-alert {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 42%, transparent);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 0%, transparent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-unread-total {
        animation: none;
    }
}

.dashboard-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
}

.dashboard-panel-head > a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-panel-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.dashboard-panel-head-actions > a {
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.dashboard-block-drag {
    cursor: grab;
    letter-spacing: -5px;
    padding-right: 4px;
}

.dashboard-block-drag:active {
    cursor: grabbing;
}

.dashboard-side-column > [data-sort-item].is-dragging {
    opacity: .55;
}

.dashboard-personal-list {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.dashboard-personal-list:last-child {
    border-bottom: 0;
}

.dashboard-personal-list h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.dashboard-personal-points {
    display: grid;
    gap: 6px;
}

.dashboard-personal-points > .empty-state.is-compact {
    min-height: 0;
    margin: 0;
    padding: 3px 0;
}

.dashboard-personal-points > article {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
}

.dashboard-personal-points .drag-handle {
    height: 38px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 5px 0 0 5px;
}

.dashboard-personal-points form,
.dashboard-personal-points label {
    margin: 0;
}

.dashboard-personal-points label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 0 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    cursor: pointer;
}

.dashboard-panel-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.dashboard-panel-head h2:only-child {
    margin-bottom: 0;
}

.dashboard-panel-head span {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-week-time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 20px 17px 22px;
}

.dashboard-week-duration {
    display: block;
    padding: 0;
    color: var(--text);
    font-size: 34px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.dashboard-week-navigation {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    align-items: center;
}

.dashboard-week-navigation a,
.dashboard-week-navigation span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.dashboard-work-warning {
    display: block;
    margin: 0 14px 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    text-align: center;
    text-decoration: none;
}

.dashboard-work-controls {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    justify-content: end;
    gap: 10px;
    padding: 0;
}

.dashboard-work-controls form { margin: 0; }
.work-control {
    margin: 0;
}
.work-control.is-enabled { border-color: var(--accent); background: var(--accent); color: #191919; cursor: pointer; }
.work-control:disabled { opacity: .55; cursor: default; }
.work-control.is-play span { width: 0; height: 0; margin-left: 3px; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid currentColor; }
.work-control.is-pause span { width: 13px; height: 16px; border-left: 5px solid currentColor; border-right: 5px solid currentColor; }
.work-control.is-stop span { width: 14px; height: 14px; background: currentColor; }
.dashboard-work-message { margin: 0 14px 10px; color: #5fbd72; font-size: 12px; }
.dashboard-work-message.is-error { color: #e16b6b; }

.dashboard-week-navigation a {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.dashboard-week-navigation a:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
    filter: brightness(1.08);
}

.dashboard-week-navigation span {
    background: var(--panel-alt);
    color: var(--muted);
    cursor: default;
    opacity: .6;
}

.dashboard-order-row {
    display: grid;
    grid-template-columns: 34px minmax(250px, 1fr) 34px 38px minmax(130px, 170px);
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.dashboard-order-link {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.dashboard-order-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.dashboard-order-favorite,
.dashboard-order-status,
.dashboard-order-assignee {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 0;
}

.dashboard-order-status .list-status-form,
.dashboard-order-status mark {
    width: 100%;
}

.dashboard-order-status mark {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-order-timer .timer-button {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
}

.dashboard-calendar-week-divider {
    border-top: 7px solid var(--bg);
}

.dashboard-calendar-week-title h2 {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin: 0;
}

.dashboard-calendar-week-title .dashboard-calendar-week-number {
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-calendar-week-title .dashboard-calendar-week-range {
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.dashboard-calendar-days > .empty-state.is-compact {
    min-height: 52px;
    margin: 0;
    padding: 16px;
}

.dashboard-calendar-day {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    border-bottom: 1px solid var(--line);
}

.dashboard-calendar-day:last-child {
    border-bottom: 0;
}

.dashboard-calendar-day > header {
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 12px 10px 12px 14px;
    border-right: 1px solid var(--line);
    background: var(--panel-alt);
}

.dashboard-calendar-day > header strong {
    font-size: 16px;
}

.dashboard-calendar-day > header span {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-calendar-day > div {
    display: grid;
    grid-auto-rows: minmax(50px, 1fr);
    min-width: 0;
}

.dashboard-calendar-entry {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr) 34px;
    gap: 10px;
    align-items: center;
    min-height: 50px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--line);
    border-left: 4px solid var(--calendar-entry-color);
}

.dashboard-calendar-entry:last-child {
    border-bottom: 0;
}

.dashboard-calendar-entry > time {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.dashboard-calendar-entry > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.dashboard-calendar-entry strong,
.dashboard-calendar-entry small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-calendar-entry small {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-calendar-entry > .icon-button {
    justify-self: end;
}

.dashboard-calendar-entry.is-clickable {
    cursor: pointer;
}

.dashboard-calendar-entry:hover {
    background: var(--panel-muted);
}

.dashboard-calendar-timer {
    justify-self: end;
    margin: 0;
}

.dashboard-calendar-timer .timer-button {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
}

.dashboard-order-row:nth-child(even),
.dashboard-time-row:nth-child(even) {
    background: var(--panel-alt);
}

.dashboard-order-row:last-child,
.dashboard-time-row:last-child,
.dashboard-notification:last-child {
    border-bottom: 0;
}

.dashboard-order-row:hover,
.dashboard-time-row:hover,
.dashboard-notification:hover {
    background: var(--panel-muted);
}

.dashboard-order-row.is-urgent {
    box-shadow: inset 6px 0 0 var(--danger);
}

.dashboard-favorite-indicator {
    display: inline-flex;
    color: var(--muted);
}

.dashboard-order-row.is-favorite .dashboard-favorite-indicator {
    color: var(--accent);
}

.dashboard-order-title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dashboard-order-title strong,
.dashboard-order-title small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-order-title small,
.dashboard-time-row time {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-order-fixtermin {
    margin-left: 5px;
    color: var(--danger);
    font-weight: 700;
}

.dashboard-time-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px 38px;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.dashboard-time-link {
    display: grid;
    grid-template-columns: 88px minmax(220px, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.dashboard-worked-time {
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.dashboard-time-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.dashboard-notifications {
    position: sticky;
    top: 76px;
}

.dashboard-side-column[data-dashboard-side-sort] .dashboard-notifications {
    position: static;
    top: auto;
}

.dashboard-notification-list {
    max-height: calc(100vh - 175px);
    overflow-y: auto;
}

.dashboard-notification-tabs {
    position: sticky;
    z-index: 2;
    top: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.dashboard-notification-tabs button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 48px;
    height: auto;
    padding: 7px 5px;
    border: 0;
    border-right: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.dashboard-notification-tabs button:last-child {
    border-right: 0;
}

.dashboard-notification-tabs button[aria-selected="true"] {
    box-shadow: inset 0 -3px 0 var(--accent);
    color: var(--text);
}

.dashboard-notification-tabs button span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-notification-tabs button strong {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    min-height: 19px;
    padding: 1px 5px;
    border-radius: 9px;
    background: var(--panel-alt);
    color: var(--accent);
    font-size: 10px;
}

.dashboard-notification-panel[hidden],
.dashboard-notification-dialog form[hidden] {
    display: none;
}

.dashboard-notification {
    display: block;
    width: 100%;
    height: auto;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-weight: 400;
    text-align: left;
}

.dashboard-notification.is-unread {
    background: transparent;
    box-shadow: inset 4px 0 0 var(--accent);
}

.dashboard-notification.is-unread:hover {
    background: var(--panel-muted);
}

.dashboard-notification.is-read {
    color: color-mix(in srgb, var(--text) 76%, var(--muted));
}

.dashboard-notification > header,
.dashboard-notification > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-notification > header span {
    display: inline-flex;
    align-items: center;
    font-weight: 700;
}

.dashboard-notification > header time,
.dashboard-notification > footer {
    color: var(--muted);
    font-size: 11px;
}

.dashboard-notification p {
    margin: 11px 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.dashboard-notification-kind {
    display: block;
    margin-top: 8px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-notification > footer span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-notification > footer strong {
    flex: 0 0 auto;
    color: var(--accent);
}

.dashboard-message-result {
    padding: 10px 15px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
}

.dashboard-message-result.is-success {
    background: color-mix(in srgb, var(--success) 12%, var(--panel));
    color: var(--success);
}

.dashboard-message-result.is-error {
    background: color-mix(in srgb, var(--danger) 12%, var(--panel));
    color: var(--danger);
}

.dashboard-message-compose {
    border-bottom: 1px solid var(--line);
    background: var(--panel-alt);
}

.dashboard-message-compose > summary {
    padding: 12px 16px;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.dashboard-message-compose > form {
    padding: 2px 16px 16px;
}

.dashboard-message-compose select,
.dashboard-message-compose input,
.dashboard-message-compose textarea {
    margin-bottom: 12px;
}

.dashboard-notification-subject {
    display: block;
    margin-top: 7px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-direct-message {
    border-left: 5px solid var(--accent);
}

.dashboard-message-parent {
    display: block;
    margin-top: 7px;
    padding-left: 9px;
    border-left: 2px solid var(--line);
    color: var(--muted);
    line-height: 1.4;
}

.dashboard-message-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.dashboard-message-actions > form {
    margin: 0;
}

.dashboard-message-actions > details {
    flex: 1;
}

.dashboard-message-actions > details > summary {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.dashboard-message-actions > details form {
    margin-top: 9px;
}

.dashboard-message-actions textarea {
    min-height: 78px;
    margin-bottom: 8px;
}

.dashboard-message-actions button {
    min-height: 34px;
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 11px;
}

.dashboard-notification-dialog {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.dashboard-notification-dialog h2 {
    margin: 0 38px 18px 0;
    font-size: 21px;
}

.dashboard-notification-history {
    display: grid;
    gap: 10px;
    max-height: min(48vh, 520px);
    margin-bottom: 18px;
    padding-right: 4px;
    overflow-y: auto;
}

.dashboard-notification-history article {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--message-color, var(--accent));
    border-radius: 6px;
    background: var(--panel-alt);
}

.dashboard-notification-history header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
}

.dashboard-notification-history header strong {
    color: var(--text);
}

.dashboard-notification-history p {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 1.5;
    white-space: pre-wrap;
}

.dashboard-notification-dialog textarea {
    min-height: 100px;
    margin-bottom: 10px;
}

.dashboard-notification-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-notification-target-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.dashboard-notification-target-actions[hidden] {
    display: none;
}

.dashboard-notification-target-actions .primary-button {
    margin: 0;
}

@media (max-width: 1120px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-notifications {
        position: static;
    }

    .dashboard-notification-list {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .dashboard-panel {
        overflow-x: auto;
    }

    .dashboard-order-list,
    .dashboard-time-list {
        min-width: 760px;
    }

    .dashboard-calendar-days {
        min-width: 520px;
    }
}

@media (max-width: 760px) {
    .profile-password-grid {
        grid-template-columns: 1fr;
    }
}

/* Customers */
.client-nav-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.clients-table {
    min-width: 1120px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.client-list-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 18px;
}

.client-search-form {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
}

.client-search-form > label {
    display: grid;
    gap: var(--filter-label-gap, 7px);
    margin: 0;
}

.client-search-form > .client-search-query {
    flex: 1 1 520px;
    max-width: 720px;
}

.client-search-form > .client-category-filter {
    flex: 0 0 190px;
}

.client-search-form input[type="search"] {
    width: 100%;
    height: var(--filter-control-height, 38px);
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
    font: inherit;
}

.client-search-form button,
.client-search-form .secondary-button {
    height: var(--filter-control-height, 38px);
    margin: 0;
    align-self: end;
}

.client-list-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-bottom: 10px;
}

.client-list-meta p {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    color: var(--text);
}

.client-list-meta p span {
    color: var(--muted);
}

.client-page-size-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-page-size-form label {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.client-list-head {
    align-items: center;
}

.client-list-head h1 {
    margin: 0;
}

.client-page-size-form select {
    width: 88px;
    height: 38px;
    margin: 0;
}

.client-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.client-pagination .secondary-button {
    min-width: 92px;
    text-align: center;
}

.client-pagination .is-disabled {
    cursor: default;
    opacity: .45;
    pointer-events: none;
}

.clients-header,
.client-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.35fr) minmax(170px, 1.15fr) 120px minmax(190px, 1.15fr) minmax(160px, 1fr) 88px 88px 130px 62px;
    gap: 14px;
    align-items: center;
    min-height: 58px;
    padding: 0 14px;
}

.clients-header {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.clients-header > :nth-child(6),
.clients-header > :nth-child(7),
.clients-header > :nth-child(8) {
    text-align: center;
}

.client-row {
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: background-color 120ms ease;
}

.client-row:last-child {
    border-bottom: 0;
}

.client-row.is-alternate {
    background: var(--panel-alt);
}

.client-row:hover {
    background: var(--accent-soft);
}

.client-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.client-row > :nth-child(6),
.client-row > :nth-child(7),
.client-row > :nth-child(8) {
    justify-self: center;
    text-align: center;
}

.client-row > span,
.client-row > strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.client-row a:not(.client-metric):not(.client-edit-button):hover,
.client-contact-quick-list a:hover {
    color: var(--accent);
}

.client-phone-summary {
    display: grid;
    gap: 3px;
}

.client-metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 30px;
    min-height: 30px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
    font: inherit;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.client-metric:hover,
.client-metric:focus-visible {
    border-color: var(--muted);
    background: var(--panel-muted);
    color: var(--text);
}

.client-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 42px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--text);
}

.client-edit-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.client-detail-icon {
    position: relative;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.client-detail-icon::after {
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: rotate(45deg);
    content: '';
}

.client-contact-dialog {
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 22px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.client-contact-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
}

.client-contact-dialog h2 {
    margin: 0 38px 4px 0;
    font-size: 21px;
}

.client-dialog-subtitle {
    margin: 0 0 18px;
    color: var(--muted);
}

.client-contact-quick-list {
    display: grid;
    gap: 10px;
}

.client-contact-quick-list article {
    padding: 13px 14px;
    border-left: 4px solid var(--accent);
    background: var(--panel-alt);
}

.client-contact-quick-list article > strong {
    display: block;
    margin-bottom: 10px;
}

.client-contact-quick-list dl,
.client-contact-readonly,
.client-readonly-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 0;
}

.client-contact-quick-list dl div,
.client-contact-readonly div,
.client-readonly-grid div {
    min-width: 0;
}

.client-contact-quick-list dt,
.client-contact-readonly dt,
.client-readonly-grid dt {
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.client-contact-quick-list dd,
.client-contact-readonly dd,
.client-readonly-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.client-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.client-edit-section,
.client-contact-section,
.client-danger-zone {
    margin-top: 22px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}

.client-detail-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
    width: 100%;
    margin-top: 22px;
}

.client-detail-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.client-detail-panel-head {
    position: relative;
    margin: -18px -18px 18px;
}

.client-detail-panel-title {
    margin: -18px -18px 18px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
}

.client-detail-panel-head > .client-detail-panel-title {
    margin: 0;
    padding-right: 48px;
}

.client-contact-add-button {
    position: absolute;
    top: 5px;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: var(--accent);
    color: #17191c;
    font-size: 23px;
    line-height: 1;
}

.client-detail-master .client-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
}

.client-detail-master .client-name-field {
    grid-column: span 1;
}

.client-detail-master .client-address-wide {
    grid-column: 1 / -1;
}

.client-note-field {
    display: grid;
    gap: 7px;
    margin-bottom: 20px;
}

.client-note-field > label,
.client-note-field > span {
    color: var(--text);
    font-weight: 700;
}

.client-note-field textarea {
    width: 100%;
    min-height: 120px;
    margin: 0;
    resize: vertical;
}

.client-note-readonly {
    min-height: 78px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
    color: var(--text);
    line-height: 1.55;
}

.client-contact-subhead {
    margin: 20px -18px 18px;
    border-top: 1px solid var(--line);
}

.client-new-form {
    width: 100%;
}

.client-new-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.client-panel-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.client-newsletter-lists {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.client-newsletter-lists h3 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 14px;
}

.client-newsletter-hint {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 12px;
}

.client-newsletter-add {
    align-items: flex-end;
    margin-bottom: 14px;
}

.client-newsletter-memberships {
    display: grid;
}

.client-newsletter-membership {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 50px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
}

.client-newsletter-membership:last-child {
    border-bottom: 0;
}

.client-newsletter-membership > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.client-newsletter-membership small {
    color: var(--muted);
    font-size: 12px;
}

.client-newsletter-membership form {
    flex: 0 0 auto;
    margin: 0;
}

.client-detail-contact-list {
    display: grid;
}

.client-detail-contact-row {
    display: grid;
    grid-template-columns: minmax(150px, .9fr) minmax(180px, 1.1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.client-detail-contact-row:last-child {
    border-bottom: 0;
}

.client-detail-contact-identity,
.client-detail-contact-data {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.client-detail-contact-identity span,
.client-detail-contact-data {
    color: var(--muted);
    font-size: 12px;
}

.client-detail-contact-data a {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-detail-contact-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.client-detail-contact-actions form {
    margin: 0;
}

.client-detail-contact-actions .client-contact-delete {
    height: 34px;
    margin: 0;
}

.client-purchase-history {
    width: 100%;
    margin-top: 22px;
}

.client-contact-editor-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 22px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.client-contact-editor-dialog::backdrop {
    background: rgb(0 0 0 / 72%);
}

.client-contact-editor-dialog h2 {
    margin: 0 0 20px;
    font-size: 21px;
}

.client-contact-create-dialog.client-contact-editor-dialog h2 {
    margin: 0 38px 4px 0;
}

.client-contact-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.client-contact-editor-grid label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.client-contact-editor-grid .client-contact-editor-wide {
    grid-column: 1 / -1;
}

.client-contact-editor-grid input,
.client-contact-editor-grid select {
    min-width: 0;
    margin: 0;
}

.client-edit-section h2,
.client-contact-section h2,
.client-danger-zone h2 {
    margin: 0 0 16px;
    font-size: 19px;
}

.client-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px 14px;
    max-width: 1120px;
}

.client-form-grid .form-field label,
.client-contact-form > div > label {
    margin: 0 0 7px;
}

.client-edit-section > form > button {
    margin-top: 18px;
}

.client-name-field {
    grid-column: span 2;
}

.client-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.client-section-head h2 {
    margin-bottom: 3px;
}

.client-section-head span {
    color: var(--muted);
    font-size: 12px;
}

.client-contact-edit-list {
    display: grid;
    gap: 10px;
}

.client-contact-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel-alt);
}

.client-contact-card > strong {
    align-self: start;
    margin-bottom: 10px;
}

.client-contact-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(140px, 1fr) 150px max-content;
    gap: 16px 12px;
    align-items: end;
}

.client-contact-form > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.client-contact-form input,
.client-contact-form select,
.client-contact-form button {
    margin-bottom: 0;
}

.client-contact-form input,
.client-contact-form select {
    min-width: 0;
}

.client-contact-delete {
    width: 38px;
    padding: 0;
    border-color: var(--danger);
    background: transparent;
    color: var(--danger);
    font-size: 21px;
}

.client-contact-create {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.client-contact-create h3 {
    margin: 0 0 14px;
    font-size: 16px;
}

.client-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top-color: color-mix(in srgb, var(--danger) 55%, var(--line));
}

.client-danger-zone h2 {
    margin-bottom: 4px;
    color: var(--danger);
}

.client-danger-zone p {
    margin: 0;
    color: var(--muted);
}

.danger-button {
    border-color: var(--danger);
    background: var(--danger);
    color: #17191c;
}

@media (max-width: 1180px) {
    .client-page {
        overflow-x: auto;
    }

    .client-contact-form {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
        gap: 12px;
    }

    .client-contact-form input {
        margin-bottom: 0;
    }
}

@media (max-width: 1050px) {
    .client-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .client-form-grid,
    .client-contact-form,
    .client-contact-editor-grid,
    .client-contact-quick-list dl,
    .client-contact-readonly,
    .client-readonly-grid {
        grid-template-columns: 1fr;
    }

    .client-name-field {
        grid-column: auto;
    }

    .client-contact-card {
        min-width: 0;
    }

    .client-detail-master .client-form-grid,
    .client-detail-contact-row {
        grid-template-columns: 1fr;
    }

    .client-detail-master .client-name-field {
        grid-column: auto;
    }

    .client-detail-master .client-address-wide {
        grid-column: auto;
    }

    .client-contact-editor-grid .client-contact-editor-wide {
        grid-column: auto;
    }

    .client-detail-contact-actions {
        justify-content: flex-end;
    }

    .client-danger-zone {
        align-items: flex-start;
        flex-direction: column;
    }
}
/* Reduzierte Bedienoberfläche für Handy und Tablet */
.mobile-app-body {
    min-width: 0;
    padding: 0 0 78px;
    background: #111315;
    color: #f4f4f2;
}

.mobile-topbar {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 8px max(16px, env(safe-area-inset-left));
    border-bottom: 1px solid #34383b;
    background: #191c1f;
}

.mobile-brand {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-topbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.mobile-work-controls {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    align-items: center;
    gap: 5px;
}

.mobile-work-controls form {
    display: flex;
    margin: 0;
}

.mobile-work-controls .work-control {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
}

.mobile-logout {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
}

.mobile-active-timer {
    position: sticky;
    z-index: 39;
    top: 58px;
    padding: 8px 12px;
    background: #111315;
}

.mobile-active-timer .active-timer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    width: 100%;
    min-height: 54px;
    overflow: hidden;
    border: 1px solid #ff6b6b;
    background: #c92a2a;
}

.mobile-active-timer form,
.mobile-active-timer .active-timer-stop {
    width: 100%;
    min-width: 0;
}

.mobile-active-timer .active-timer-stop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    border: 0;
    color: #fff;
    background: transparent;
}

.mobile-active-timer .active-timer-arrow {
    display: grid;
    place-items: center;
    border-left: 1px solid rgb(255 255 255 / 35%);
    color: #fff;
    font-size: 24px;
    text-decoration: none;
}

.mobile-bottom-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    min-height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #34383b;
    background: #191c1f;
}

.mobile-bottom-nav a {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    color: #d5d7d8;
    font-size: 11px;
    text-decoration: none;
}

.mobile-bottom-nav a.is-active {
    color: #f9be20;
}

.mobile-bottom-nav svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.mobile-page {
    width: min(100%, 900px);
    margin: 0 auto;
    padding: 20px 14px 32px;
}

.mobile-page > h1 {
    margin: 0 0 18px;
    font-size: 24px;
}

.mobile-section {
    margin: 0 0 16px;
    border: 1px solid #34383b;
    background: #1b1e21;
}

.mobile-section > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px;
    border-bottom: 1px solid #34383b;
}

.mobile-section h2,
.mobile-section h3 {
    margin: 0;
    font-size: 16px;
}

.mobile-section > h2,
.mobile-section > h3 {
    padding: 14px;
}

.mobile-section header span {
    color: #9ca1a5;
    font-size: 12px;
}

.mobile-list {
    display: grid;
}

.mobile-list-row {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 10px 12px;
    border-bottom: 1px solid #303438;
    color: #f4f4f2;
    text-decoration: none;
}

.mobile-list-row:last-child {
    border-bottom: 0;
}

.mobile-list-row.is-urgent {
    border-left: 7px solid #e03131;
}

.mobile-list-row > span,
.mobile-list-row > a > span {
    display: grid;
    min-width: 0;
}

.mobile-list-row b,
.mobile-list-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-list-row small {
    margin-top: 3px;
    color: #aeb2b5;
}

.mobile-list-row time {
    color: #f9be20;
    font-weight: 700;
}

.mobile-time-row {
    grid-template-columns: minmax(0, 1fr) auto 44px;
}

.mobile-time-row > a {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.mobile-worked-time {
    color: #c8cccf;
    font-variant-numeric: tabular-nums;
}

.mobile-timer-button,
.mobile-detail-timer {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid #51565a;
    background: #24282b;
    color: #f4f4f2;
}

.mobile-timer-button.is-active,
.mobile-detail-timer.is-active {
    border-color: #ff6b6b;
    background: #c92a2a;
    color: #fff;
}

.mobile-calendar-week-divider {
    border-top: 3px solid #4b5054;
}

.mobile-calendar-days {
    display: grid;
}

.mobile-calendar-day {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    border-bottom: 1px solid #303438;
}

.mobile-calendar-day:last-child {
    border-bottom: 0;
}

.mobile-calendar-day > header {
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 11px 8px;
    border-right: 1px solid #303438;
    text-align: center;
}

.mobile-calendar-day > header strong {
    color: #f9be20;
}

.mobile-calendar-day > header span {
    color: #aeb2b5;
    font-size: 11px;
}

.mobile-calendar-entry {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 7px 9px;
    border-bottom: 1px solid #303438;
    border-left: 4px solid var(--calendar-entry-color);
}

.mobile-calendar-entry:last-child {
    border-bottom: 0;
}

.mobile-calendar-entry time {
    color: #c8cccf;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.mobile-calendar-entry > span {
    display: grid;
    min-width: 0;
}

.mobile-calendar-entry strong,
.mobile-calendar-entry small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-calendar-entry small {
    color: #9ca1a5;
}

.mobile-calendar-link {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #f9be20;
    font-size: 26px;
    text-decoration: none;
}

.mobile-app-body .time-dialog .time-input-group {
    margin: 12px 0;
}

.mobile-messages-section > header {
    border-bottom: 0;
}

.mobile-notification-list {
    max-height: none;
    overflow: visible;
    border-top: 1px solid #34383b;
}

.mobile-notification-list .dashboard-notification.is-unread {
    background: rgb(249 190 32 / 14%);
    box-shadow: inset 4px 0 0 #f9be20;
}

.mobile-notification-list .dashboard-notification.is-read {
    background: #191c1f;
    color: #b7bbbe;
}

.mobile-notification-list .dashboard-notification.is-read .dashboard-notification-kind,
.mobile-notification-list .dashboard-notification.is-read > footer strong {
    color: #8f9498;
}

.mobile-notification-dialog {
    width: min(calc(100% - 20px), 560px);
    max-height: calc(100dvh - 20px);
}

.mobile-checklist article {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    min-height: 48px;
    padding: 4px 10px;
    border-top: 1px solid #303438;
}

.mobile-checklist form,
.mobile-checklist label {
    width: 100%;
}

.mobile-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-section .personal-checklist-add-point {
    padding: 10px;
}

.mobile-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px;
    gap: 8px;
    margin-bottom: 14px;
}

.mobile-search-form input,
.mobile-search-form button {
    min-height: 48px;
}

.mobile-search-form button {
    display: grid;
    padding: 0;
    place-items: center;
}

.mobile-search-form svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.mobile-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.mobile-detail-head h1 {
    margin: 2px 0 0;
    font-size: 26px;
}

.mobile-detail-head small {
    color: #aeb2b5;
}

.mobile-detail-timer {
    width: 56px;
    height: 56px;
}

.mobile-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0 0 12px;
    text-decoration: none;
}

.mobile-edit-form {
    padding: 14px;
    border: 1px solid #34383b;
    background: #1b1e21;
}

.mobile-edit-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    text-decoration: none;
}

.mobile-detail-data {
    display: grid;
    margin: 0;
}

.mobile-detail-data > div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid #303438;
}

.mobile-detail-data dt {
    color: #aeb2b5;
}

.mobile-detail-data dd {
    margin: 0;
}

.mobile-detail .rich-text-output {
    padding: 0 14px 16px;
}

.mobile-contact-section > h3 {
    margin: 18px 14px 8px;
    color: #d7d9da;
    font-size: 15px;
}

.mobile-contact-card {
    display: grid;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid #303438;
}

.mobile-contact-card strong {
    font-size: 16px;
}

.mobile-contact-card small {
    color: #aeb2b5;
}

.mobile-contact-card a,
.mobile-detail-data a {
    color: #f9be20;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.mobile-phone-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #4a4f53;
    background: #202428;
}

.mobile-phone-link span {
    color: #aeb2b5;
    font-size: 12px;
}

.mobile-client-open {
    margin-top: 4px;
    font-weight: 700;
}

.mobile-contact-list .mobile-contact-card:first-child {
    border-top: 0;
}

.mobile-contact-list .mobile-contact-card + .mobile-contact-card {
    border-top: 1px solid #3a3e42;
}

.mobile-client-back {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    text-decoration: none;
}

.mobile-order-checklist-list {
    padding: 0 14px 14px;
}

.mobile-order-checklist {
    padding: 14px 0 4px;
}

.mobile-order-checklist:first-child {
    border-top: 0;
}

.mobile-order-checklist > header {
    display: grid;
    gap: 10px;
    margin-bottom: 8px;
}

.mobile-order-checklist .checklist-progress-display {
    width: 100%;
    justify-content: flex-start;
}

.mobile-order-checklist .order-checklist-point {
    grid-template-columns: 34px minmax(0, 1fr);
    min-height: 54px;
    padding: 8px 2px;
}

.mobile-order-checklist .checklist-point-content {
    min-width: 0;
}

.mobile-order-checklist .checklist-point-content > strong {
    overflow-wrap: anywhere;
}

.mobile-create-form {
    display: grid;
    gap: 8px;
}

.mobile-create-form input,
.mobile-create-form select,
.mobile-create-form textarea,
.mobile-search-form input {
    width: 100%;
    min-width: 0;
    border-color: #4b5054;
    color: #fff;
    background: #202428;
}

.mobile-create-form label {
    margin-top: 8px;
    color: #d7d9da;
    font-weight: 700;
}

.mobile-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-form-grid > div {
    min-width: 0;
}

.mobile-quick-material {
    margin-top: 10px;
    padding: 0 12px 12px;
    border: 1px solid #44494d;
    background: #181b1e;
}

.mobile-quick-material summary {
    padding: 14px 0;
    color: #f9be20;
    font-weight: 700;
    cursor: pointer;
}

.mobile-quick-material label {
    display: block;
}

.mobile-price-result {
    display: grid;
    gap: 5px;
    margin-top: 10px;
    padding: 12px;
    border-left: 4px solid #f9be20;
    background: #25292c;
}

.mobile-price-result strong {
    color: #f9be20;
    font-size: 18px;
}

.mobile-price-result span {
    color: #c6c9cb;
    font-size: 12px;
    line-height: 1.5;
}

.mobile-price-result.is-error {
    border-left-color: #e03131;
    color: #ff8787;
}

.mobile-start-time {
    margin: 14px 0 4px;
}

.mobile-primary-action {
    min-height: 50px;
    background: #f9be20;
    color: #171717;
    font-weight: 800;
}

.mobile-app-body .time-dialog {
    width: min(calc(100% - 20px), 560px);
    max-height: calc(100dvh - 20px);
}

@media (max-width: 520px) {
    .mobile-app-body .time-duration-inputs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .mobile-app-body .time-duration-inputs label {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px;
    }

    .mobile-app-body .time-duration-inputs input {
        width: 100%;
        min-width: 0;
    }

    .mobile-app-body .time-clock-inputs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .mobile-app-body .time-clock-inputs label,
    .mobile-app-body .time-clock-inputs input[type="time"] {
        width: 100%;
        min-width: 0;
    }

    .mobile-app-body .time-clock-inputs label:first-child {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .mobile-form-grid {
        grid-template-columns: 1fr;
    }

    .mobile-list-row {
        grid-template-columns: 72px minmax(0, 1fr) auto;
    }

    .mobile-time-row {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .mobile-time-row > a {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .mobile-worked-time {
        display: none !important;
    }
}

/* Accounting and commission */
.accounting-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.accounting-toolbar form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.accounting-toolbar label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.accounting-toolbar input {
    margin: 0;
}

.accounting-view-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.accounting-view-tabs a {
    padding: 10px 16px;
    color: var(--muted);
    font-weight: 700;
}

.accounting-view-tabs a.is-active {
    color: var(--accent);
    border-bottom: 3px solid var(--accent);
}

.provision-toolbar {
    justify-content: space-between;
}

.provision-toolbar form {
    align-items: flex-end;
}

.provision-toolbar label {
    margin: 0;
}

.provision-toolbar input,
.provision-toolbar button {
    height: 42px;
    margin: 0;
}

.provision-toolbar select {
    min-width: 260px;
    margin: 0;
}

.provision-overview h2 {
    margin: 26px 0 8px;
    font-size: 18px;
}

.provision-overview-row {
    display: grid;
    grid-template-columns: 110px minmax(160px, 1fr) minmax(220px, 1.3fr) minmax(180px, 1fr) 110px 120px 120px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.provision-overview-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
}

.provision-overview-row a {
    color: var(--accent);
    font-weight: 700;
}

.provision-report-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.provision-report-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) 210px 190px 140px 70px;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.provision-report-row:nth-child(odd):not(.provision-report-head) {
    background: var(--panel-alt);
}

.provision-report-row:last-child {
    border-bottom: 0;
}

.provision-report-head {
    min-height: 42px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.provision-report-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.settings-file-present,
.settings-file-missing {
    display: block;
    margin-top: -9px;
    font-size: 12px;
    font-weight: 700;
}

.settings-file-present {
    color: var(--success);
}

.settings-file-missing {
    color: var(--danger);
}

.accounting-detail-button {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--text);
}

.accounting-paid-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--success);
    background: color-mix(in srgb, var(--success) 15%, var(--panel));
    color: var(--success);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

.accounting-paid-button:hover {
    background: var(--success);
    color: #fff;
}

.search-icon {
    position: absolute;
    left: 9px;
    top: 8px;
    width: 11px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.search-icon::after {
    content: "";
    position: absolute;
    left: 9px;
    top: 9px;
    width: 7px;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
}

.accounting-dialog {
    width: min(1380px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding: 24px;
    border: 0;
    outline: 0;
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .44);
}

.accounting-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
}

.accounting-dialog-head,
.accounting-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.accounting-dialog-head {
    padding-right: 38px;
    margin-bottom: 20px;
}

.accounting-dialog-head span,
.accounting-dialog-head p {
    margin: 0;
    color: var(--muted);
}

.accounting-dialog-head h2 {
    margin: 4px 0;
}

.accounting-locked,
.accounting-paid,
.accounting-draft {
    padding: 7px 10px;
    border-left: 4px solid #2ca36c;
    background: color-mix(in srgb, #2ca36c 18%, var(--panel));
}

.accounting-paid {
    border-color: var(--success);
    background: rgba(67, 207, 155, .14);
}

.accounting-draft {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.accounting-dialog section {
    margin-top: 24px;
}

.accounting-dialog h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.accounting-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.accounting-summary-grid article {
    border: 1px solid var(--line);
    background: var(--panel-alt);
}

.accounting-summary-grid article header,
.accounting-summary-grid article div,
.accounting-category-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
}

.accounting-summary-grid article header {
    border-bottom: 1px solid var(--line);
}

.accounting-category-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    border: 1px solid var(--line);
}

.accounting-category-summary div {
    border-right: 1px solid var(--line);
}

.accounting-category-summary .is-total {
    background: var(--accent-soft);
}

.accounting-time-entries {
    margin-top: 14px;
}

.accounting-time-entries summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 700;
}

.accounting-time-entry {
    display: grid;
    grid-template-columns: 140px 150px 145px 145px 90px minmax(180px, 1fr);
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.accounting-time-entry-head {
    margin-top: 10px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
}

.accounting-user-table-wrap {
    overflow-x: auto;
}

.accounting-user-table {
    width: 100%;
    min-width: 1120px;
    border-collapse: collapse;
    border: 1px solid var(--line);
    table-layout: fixed;
}

.accounting-user-table th,
.accounting-user-table td {
    padding: 9px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.accounting-user-table thead {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
}

.accounting-user-table col.is-user {
    width: 160px;
}

.accounting-user-table col.is-time {
    width: 90px;
}

.accounting-user-table col.is-type {
    width: 105px;
}

.accounting-user-table tbody tr.is-individual {
    background: var(--panel-alt);
}

.accounting-user-table tbody + tbody tr:first-child > * {
    border-top: 2px solid var(--line);
}

.accounting-user-table input {
    width: 100%;
    min-width: 90px;
    margin: 0;
}

.accounting-user-table tfoot {
    background: var(--accent-soft);
}

.accounting-paid-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.accounting-cost-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.accounting-cost-row {
    display: grid;
    grid-template-columns: 170px minmax(240px, 1fr) 150px 70px 36px;
    align-items: center;
    gap: 10px 16px;
}

.accounting-cost-row input,
.accounting-cost-row select {
    width: 100%;
    margin: 0;
}

.accounting-dialog .dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.accounting-profit-section {
    display: block;
}

.accounting-profit-section > label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.accounting-profit-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 8px;
    margin: 0;
}

.accounting-profit-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 11px;
    background: var(--panel-alt);
}

.accounting-profit-summary dt,
.accounting-profit-summary dd {
    margin: 0;
}

.accounting-profit-summary .is-profit {
    border-left: 5px solid var(--accent);
    font-size: 17px;
    font-weight: 800;
}

.accounting-release-meta {
    margin-top: 18px;
    padding: 12px;
    border-left: 5px solid #2ca36c;
    background: color-mix(in srgb, #2ca36c 14%, var(--panel));
}

@media (max-width: 1200px) {
    .provision-user-row {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }

    .accounting-dialog {
        overflow-x: auto;
    }
}
.mobile-logout-form {
    margin: 0;
}

.mobile-logout-form .mobile-logout {
    border: 0;
    font: inherit;
    cursor: pointer;
}

/* Interne Kalkulation und versionierte Kundendokumente */
.calculation-workspace {
    min-width: 0;
}

.calculation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.calculation-head h2,
.calculation-head p {
    margin: 0;
}

.material-requirement-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.material-requirement-head-actions form {
    margin: 0;
}

.calculation-head p {
    margin-top: 4px;
    color: var(--muted);
}

.calculation-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--panel);
}

.calculation-row {
    display: grid;
    grid-template-columns: minmax(300px, 1.8fr) 82px 82px 120px 130px 120px 125px 78px;
    align-items: center;
    gap: 10px;
    min-width: 1160px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.calculation-row:last-child {
    border-bottom: 0;
}

.calculation-row-head {
    min-height: 42px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.calculation-row input,
.calculation-row textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.calculation-description {
    display: grid;
    gap: 7px;
}

.calculation-row output {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.calculation-row-actions {
    display: flex;
    gap: 6px;
}

.calculation-row-actions .icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
}

.calculation-add-last {
    margin: 12px 0 18px;
}

.calculation-summary {
    display: grid;
    grid-template-columns: minmax(220px, .65fr) minmax(360px, 1fr);
    align-items: end;
    gap: 24px;
    margin: 20px 0;
}

.calculation-summary > label {
    display: grid;
    grid-template-columns: 1fr 110px 20px;
    align-items: center;
    gap: 8px;
}

.calculation-summary > label input {
    margin: 0;
}

.calculation-summary dl {
    margin: 0;
    border: 1px solid var(--line);
}

.calculation-summary dl div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.calculation-summary dl div:last-child {
    border-bottom: 0;
}

.calculation-summary dt,
.calculation-summary dd {
    margin: 0;
}

.calculation-summary dd,
.calculation-summary .is-total,
.calculation-summary .is-result {
    font-weight: 800;
}

.calculation-summary .is-total {
    background: var(--accent-soft);
}

.calculation-summary .is-result {
    border-left: 5px solid var(--success);
}

.calculation-document,
.calculation-versions {
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.calculation-document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.calculation-document-grid label {
    display: grid;
    gap: 6px;
}

.calculation-document-grid .is-wide {
    grid-column: 1 / -1;
}

.calculation-document-grid input,
.calculation-document-grid select,
.calculation-document-grid textarea {
    width: 100%;
    margin: 0;
}

.calculation-version-row {
    display: grid;
    grid-template-columns: 75px minmax(190px, 1.2fr) 155px 130px 170px 90px;
    align-items: center;
    gap: 12px;
    min-width: 900px;
    min-height: 50px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.calculation-version-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 12px;
}

.calculation-versions {
    overflow-x: auto;
}

.calculation-version-row .icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 9px;
}

.calculation-mail-dialog {
    width: min(720px, calc(100vw - 32px));
}

.calculation-mail-dialog form {
    display: grid;
    gap: 14px;
}

.calculation-mail-dialog fieldset {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
}

.calculation-config-form,
.calculation-extra-form {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    align-items: end;
    margin-bottom: 28px;
}

.calculation-config-form .settings-field-wide,
.calculation-extra-form .settings-field-wide {
    grid-column: 1 / -1;
}

.calculation-extra-row {
    grid-template-columns: 36px minmax(190px, 1fr) minmax(220px, 1.4fr) 130px 130px 105px auto 36px;
    align-items: center;
}

.accounting-calculation-note {
    margin: 0 0 14px;
    padding: 11px 13px;
    border-left: 5px solid var(--accent);
    background: var(--accent-soft);
}

@media (max-width: 900px) {
    .calculation-summary,
    .calculation-document-grid {
        grid-template-columns: 1fr;
    }

    .calculation-document-grid .is-wide {
        grid-column: auto;
    }

    .calculation-config-form,
    .calculation-extra-form,
    .calculation-extra-row {
        grid-template-columns: 1fr;
    }
}

button.list-save-button {
    display: inline-flex;
    width: var(--icon-button-size, 34px);
    min-width: var(--icon-button-size, 34px);
    height: var(--icon-button-size, 34px);
    min-height: var(--icon-button-size, 34px);
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: var(--success);
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
}

button.list-save-button:hover,
button.list-save-button:focus-visible {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, var(--panel));
    color: var(--success);
}

/* Newsletter */
.newsletter-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: calc(100vh - 82px);
    border-top: 1px solid var(--line);
}

.newsletter-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    min-height: calc(100vh - 82px);
    padding: 26px 16px;
    border-right: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-sidebar > strong {
    display: block;
    padding: 0 10px 16px;
    font-size: 18px;
}

.newsletter-sidebar nav {
    display: grid;
    gap: 4px;
}

.newsletter-sidebar a {
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.newsletter-sidebar a:hover,
.newsletter-sidebar a.is-active {
    border-left-color: var(--accent);
    background: var(--panel-muted);
}

.newsletter-content {
    min-width: 0;
    padding: 28px;
}

.newsletter-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.newsletter-section-head h1,
.newsletter-panel h2 {
    margin: 0 0 5px;
}

.newsletter-section-head p,
.newsletter-panel > p {
    margin: 0;
    color: var(--muted);
}

.newsletter-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.newsletter-dashboard-grid > section,
.newsletter-panel {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-dashboard-grid h2 {
    margin: 0 0 15px;
    font-size: 16px;
}

.newsletter-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.newsletter-summary-link {
    color: inherit;
    text-decoration: none;
}

.newsletter-summary-link:hover {
    background: var(--row-hover, #34383d);
}

.newsletter-send-run {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.newsletter-send-run button {
    width: 100%;
}

.newsletter-send-run > small {
    color: var(--muted);
    text-align: center;
}

.newsletter-row:target {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.newsletter-summary-row > span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.newsletter-summary-row small,
.newsletter-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.newsletter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    align-items: end;
    gap: 16px;
    margin-bottom: 24px;
}

.newsletter-form .form-field,
.newsletter-inline-form .form-field {
    display: grid;
    gap: 7px;
}

.newsletter-form .is-wide {
    grid-column: 1 / -1;
}

.newsletter-form textarea,
.newsletter-form input,
.newsletter-form select,
.newsletter-inline-form input,
.newsletter-inline-form select,
.newsletter-inline-form textarea {
    width: 100%;
}

.newsletter-inline-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    align-items: end;
    gap: 12px;
    margin: 0 0 16px;
}

.newsletter-inline-form label,
.newsletter-form label {
    display: grid;
    gap: 7px;
}

.newsletter-inline-form label:has(input[type="checkbox"]),
.newsletter-form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    min-height: 42px;
}

.newsletter-inline-form input[type="checkbox"],
.newsletter-form input[type="checkbox"] {
    width: auto;
}

/* Newsletter-Verwaltung: dieselben Formularsteuerungen wie in der restlichen WebApp. */
.newsletter-standard-form :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
) {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--form-control-radius, 6px);
    background: var(--input);
    color: var(--text);
    font: inherit;
}

.newsletter-standard-form :is(
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select
) {
    height: var(--form-control-height, 38px);
    min-height: var(--form-control-height, 38px);
    padding: 0 var(--form-control-padding, 12px);
}

.newsletter-standard-form textarea {
    min-height: 130px;
    padding: 10px var(--form-control-padding, 12px);
    line-height: 1.5;
    resize: vertical;
}

.newsletter-standard-form input[type="file"] {
    padding: 5px 6px;
}

.newsletter-standard-form input[type="file"]::file-selector-button {
    height: 30px;
    margin-right: 10px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-muted);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.newsletter-standard-form :is(input, select, textarea):focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
    outline-offset: 1px;
}

.newsletter-deliverability ul {
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

.newsletter-sender-create {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.newsletter-sender-create > summary {
    padding: 14px 0;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.newsletter-sender-list {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.newsletter-sender-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
}

.newsletter-sender-form .form-field {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.newsletter-sender-form input,
.newsletter-sender-form select {
    width: 100%;
    min-width: 0;
}

.newsletter-sender-head {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.newsletter-sender-head span {
    color: var(--muted);
    font-size: 12px;
}

.newsletter-sender-head span.is-configured {
    color: var(--success);
}

.newsletter-sender-head span.is-incomplete {
    color: var(--danger);
}

.newsletter-sender-options {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.newsletter-sender-options label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.newsletter-sender-options input[type="checkbox"] {
    width: auto;
}

.newsletter-tabs,
.newsletter-folder-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
}

.newsletter-tabs a,
.newsletter-folder-filter a {
    padding: 8px 11px;
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}

.newsletter-tabs a.is-active,
.newsletter-folder-filter a:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #111;
}

.newsletter-folder-filter > span {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
}

.newsletter-folder-filter > span > a {
    border: 0;
}

.newsletter-folder-filter details > summary {
    padding: 8px;
    list-style: none;
    cursor: pointer;
}

.newsletter-folder-filter details[open] {
    position: absolute;
    z-index: 20;
    top: calc(100% + 5px);
    right: 0;
    display: flex;
    gap: 8px;
    width: 330px;
    padding: 12px 52px 12px 12px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 10px 30px #0006;
}

.newsletter-folder-filter details[open] > .newsletter-popup-close {
    top: 8px;
    right: 8px;
}

.newsletter-folder-filter details form {
    display: flex;
    gap: 7px;
}

.newsletter-table {
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.4fr) minmax(210px, 1.5fr) 120px 100px 110px;
    align-items: center;
    gap: 12px;
    min-width: 780px;
    min-height: 54px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.newsletter-row:nth-child(odd):not(.is-head) {
    background: var(--panel-muted);
}

.newsletter-row.is-head {
    min-height: 42px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.newsletter-row.campaign-row,
.newsletter-row.delivery-row {
    grid-template-columns: minmax(210px, 1.7fr) 100px 90px 120px 100px 90px;
}

.newsletter-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
}

.client-icon-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.newsletter-prospect-edit[open] > .newsletter-form {
    position: fixed;
    z-index: 120;
    inset: 18vh 16vw auto;
    padding: 22px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 18px 60px #0008;
}

.newsletter-prospect-edit[open] > .newsletter-form > .newsletter-popup-close {
    top: 8px;
    right: 8px;
}

.newsletter-layout-readonly .newsletter-layout-editor {
    margin-bottom: 0;
}

.newsletter-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.newsletter-media-grid article {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-media-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    background: #fff;
}

.newsletter-media-grid form {
    position: absolute;
    top: 14px;
    right: 14px;
}

.newsletter-media-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.newsletter-media-tabs a {
    padding: 10px 15px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    text-decoration: none;
}

.newsletter-media-tabs a.is-active {
    border-bottom-color: var(--accent);
    color: var(--text);
}

.newsletter-media-panel {
    width: 100%;
}

.newsletter-standard-form {
    display: grid;
    align-items: end;
    gap: 14px;
    margin: 0;
}

.newsletter-standard-form .ui-form-field {
    display: grid;
    min-width: 0;
    gap: 7px;
}

.newsletter-standard-form :is(.ui-input, .ui-select, .ui-form-button) {
    box-sizing: border-box;
    width: 100%;
    height: var(--form-control-height, 38px);
    min-height: var(--form-control-height, 38px);
    margin: 0;
}

.newsletter-media-folder-create {
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) max-content;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.newsletter-folder-tree {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.newsletter-folder-tree-head,
.newsletter-folder-tree-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 90px 100px;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
}

.newsletter-folder-tree-head {
    background: var(--table-head-bg, var(--panel-alt));
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.newsletter-folder-tree-row {
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-folder-tree-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.newsletter-folder-tree-row:hover {
    background: var(--table-row-hover, #363a3f);
}

.newsletter-folder-name {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding-left: calc(var(--folder-depth) * 24px);
}

.newsletter-folder-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.newsletter-folder-glyph {
    position: relative;
    flex: 0 0 23px;
    width: 23px;
    height: 16px;
    border: 1px solid #e2ad1e;
    border-radius: 2px;
    background: #f9be20;
}

.newsletter-folder-glyph::before {
    position: absolute;
    top: -5px;
    left: 1px;
    width: 10px;
    height: 5px;
    border: 1px solid #e2ad1e;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
    background: #f9be20;
    content: '';
}

.newsletter-folder-tree-row .row-actions {
    justify-content: flex-end;
}

.newsletter-folder-dialog {
    width: min(680px, calc(100vw - 32px));
}

.newsletter-folder-edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.newsletter-folder-dialog-actions {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.newsletter-folder-dialog-actions button,
.newsletter-folder-delete-form button {
    width: auto;
}

.newsletter-folder-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.newsletter-media-browser-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.newsletter-media-filter {
    flex: 1 1 auto;
    grid-template-columns: minmax(240px, 420px) max-content;
}

.newsletter-media-view-switch {
    display: flex;
    gap: 6px;
}

.newsletter-media-view-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    color: var(--muted);
    text-decoration: none;
}

.newsletter-media-view-switch a.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #111;
}

.newsletter-media-panel .newsletter-media-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.newsletter-media-panel .newsletter-media-grid article {
    grid-template-rows: 150px auto auto 38px;
    min-width: 0;
    border-radius: 4px;
}

.newsletter-media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    background: #fff;
}

.newsletter-media-panel .newsletter-media-grid img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: contain;
}

.newsletter-file-type,
.newsletter-media-list-preview span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 82px;
    border: 2px solid #9da3aa;
    background: #f1f2f4;
    color: #33373b;
    font-size: 13px;
    font-weight: 900;
}

.newsletter-media-panel .newsletter-media-grid article > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.newsletter-media-panel .newsletter-media-grid form {
    top: 14px;
    right: 14px;
}

.newsletter-media-list {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
}

.newsletter-media-list-row {
    display: grid;
    grid-template-columns: 72px minmax(180px, 1.3fr) minmax(150px, .8fr) minmax(150px, .8fr) 90px 130px 90px;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    min-width: 900px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
}

.newsletter-media-list-row:last-child { border-bottom: 0; }
.newsletter-media-list-row.is-head { min-height: 44px; background: var(--panel-alt); color: var(--muted); font-size: 12px; font-weight: 800; }
.newsletter-media-list-row:not(.is-head):nth-child(odd) { background: var(--panel-alt); }
.newsletter-media-list-row:not(.is-head):hover { background: var(--table-row-hover, #363a3f); }

.newsletter-media-list-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 42px;
    overflow: hidden;
    background: #fff;
}

.newsletter-media-list-preview img { width: 100%; height: 100%; object-fit: contain; }
.newsletter-media-list-preview span { width: 36px; height: 38px; border-width: 1px; font-size: 9px; }
.newsletter-media-list-row > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newsletter-media-list-row .row-actions { justify-content: flex-end; }

.newsletter-upload {
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1fr) max-content;
    max-width: 980px;
}

@media (max-width: 850px) {
    .newsletter-media-folder-create,
    .newsletter-upload,
    .newsletter-folder-edit-form {
        grid-template-columns: 1fr;
    }

    .newsletter-folder-dialog-actions {
        grid-column: 1;
    }

    .newsletter-media-browser-head {
        align-items: stretch;
        flex-direction: column;
    }
}

.newsletter-panel > summary {
    cursor: pointer;
    font-weight: 700;
}

.newsletter-panel[open] > summary {
    margin-bottom: 18px;
}

.inline-edit-details {
    position: relative;
}

.inline-edit-details > summary {
    list-style: none;
    cursor: pointer;
}

.inline-edit-details[open] {
    grid-column: 1 / -1;
}

.inline-edit-details[open] > .newsletter-form {
    position: fixed;
    z-index: 120;
    inset: 10vh 10vw auto;
    max-height: 80vh;
    overflow: auto;
    padding: 22px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 18px 60px #0008;
}

.newsletter-editor-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.newsletter-editor-tabs button {
    width: auto;
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
}

.newsletter-editor-tabs button.is-active {
    border-bottom-color: var(--accent);
    color: var(--text);
}

.newsletter-template-tab[hidden],
.newsletter-campaign-tab[hidden] { display: none !important; }
.newsletter-campaign-tab.newsletter-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    align-items: end;
    margin: 0;
}
.newsletter-campaign-tab:not(.newsletter-form) { display: grid; gap: 14px; }
.newsletter-campaign-editor-form > .newsletter-editor-tabs { margin-bottom: 0; }
.newsletter-template-settings { margin: 0; }
.newsletter-template-active { display: inline-flex; align-items: center; gap: 8px; }
.newsletter-template-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.newsletter-template-actions button,
.newsletter-template-delete button { width: auto; }
.newsletter-template-delete { display: flex; justify-content: flex-end; margin-top: 10px; }

.newsletter-layout-editor {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-builder-topbar {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-builder-topbar > strong { font-size: 15px; }
.newsletter-mode-switch { justify-self: end; }
.newsletter-device-switch,
.newsletter-mode-switch {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line);
    background: var(--panel-muted);
}

.newsletter-device-switch button,
.newsletter-mode-switch button,
.newsletter-builder-library-tabs button {
    width: auto;
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.newsletter-device-switch button.is-active,
.newsletter-mode-switch button.is-active,
.newsletter-builder-library-tabs button.is-active {
    background: var(--accent);
    color: #111;
}

.newsletter-builder-workspace {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    min-height: 680px;
}

.newsletter-builder-library {
    min-width: 0;
    padding: 14px;
    border-right: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-builder-library-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 16px;
}

.newsletter-builder-library-tabs button { padding-inline: 5px; font-size: 12px; }
.newsletter-library-panel[hidden] { display: none; }
.newsletter-library-panel > p { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.newsletter-element-palette {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.newsletter-palette-item {
    display: grid;
    place-items: center;
    gap: 7px;
    min-height: 92px;
    padding: 10px 5px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--text);
    font-size: 11px;
}

.newsletter-palette-item:hover { border-color: var(--accent); background: var(--panel-muted); }
.newsletter-palette-item > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--accent); font-size: 25px; font-weight: 700; }
.newsletter-palette-item--heading > span::before { content: 'T'; font-size: 30px; }
.newsletter-palette-item--text > span::before { content: '≡'; font-size: 34px; font-weight: 400; }
.newsletter-palette-item--image > span::before { content: '▧'; }
.newsletter-palette-item--button > span::before { content: '▰'; font-size: 22px; }
.newsletter-palette-item--divider > span::before { content: '━'; }
.newsletter-palette-item--logo > span::before { content: 'LOGO'; font-size: 11px; }
.newsletter-palette-item--social > span::before { content: '◎'; }
.newsletter-palette-item--html > span::before { content: '</>'; font-size: 14px; }
.newsletter-palette-item--navigation > span::before { content: '☰'; }
.newsletter-palette-item--spacer > span::before { content: '↕'; }
.newsletter-palette-item--browser_link > span::before { content: '↗'; }
.newsletter-palette-item--unsubscribe_link > span::before { content: '×'; }

.newsletter-section-presets { display: grid; gap: 9px; }
.newsletter-section-presets > button {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    padding: 9px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--text);
    text-align: left;
}
.newsletter-section-presets > button:hover { border-color: var(--accent); }
.newsletter-section-preset { display: flex; gap: 3px; height: 34px; }
.newsletter-section-preset::before,
.newsletter-section-preset::after { flex: 1; border: 1px solid #8e949b; background: #fff; content: ''; }
.newsletter-section-preset[data-layout="1"]::after { display: none; }
.newsletter-section-preset[data-layout="1-1-1"] { background: linear-gradient(90deg, #fff 0 31%, transparent 31% 34%, #fff 34% 65%, transparent 65% 68%, #fff 68%); border: 1px solid #8e949b; }
.newsletter-section-preset[data-layout="1-1-1"]::before,
.newsletter-section-preset[data-layout="1-1-1"]::after,
.newsletter-section-preset[data-layout="1-1-1-1"]::before,
.newsletter-section-preset[data-layout="1-1-1-1"]::after { display: none; }
.newsletter-section-preset[data-layout="1-1-1-1"] { background: repeating-linear-gradient(90deg, #fff 0 21px, transparent 21px 24px); border: 1px solid #8e949b; }
.newsletter-section-preset[data-layout="1-2"]::before,
.newsletter-section-preset[data-layout="1-3"]::before { flex: 1; }
.newsletter-section-preset[data-layout="1-2"]::after { flex: 2; }
.newsletter-section-preset[data-layout="1-3"]::after { flex: 3; }
.newsletter-section-preset[data-layout="2-1"]::before { flex: 2; }
.newsletter-section-preset[data-layout="3-1"]::before { flex: 3; }

.newsletter-global-style { display: grid; gap: 15px; }
.newsletter-global-style label { display: grid; gap: 7px; color: var(--text); font-size: 12px; }
.newsletter-global-style :is(input, select) { width: 100%; height: 38px; }
.newsletter-global-style input[type="color"] { padding: 3px; }
.newsletter-font-size-settings,
.newsletter-mobile-style-settings { display: grid; gap: 12px; margin: 0; padding: 12px; border: 1px solid var(--line); }
.newsletter-font-size-settings legend { padding: 0 5px; color: var(--muted); font-size: 12px; }
.newsletter-mobile-style-toggle { display: flex !important; grid-template-columns: 18px minmax(0, 1fr); align-items: center; }
.newsletter-mobile-style-toggle input { width: 18px; height: 18px; }
.newsletter-unit-field { display: grid; grid-template-columns: minmax(0, 1fr) 34px; align-items: center; }
.newsletter-unit-field small { display: grid; place-items: center; height: 38px; border: 1px solid var(--line); border-left: 0; color: var(--muted); }

.newsletter-layout-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--panel-muted);
}

.newsletter-element-palette,
.newsletter-section-add { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.newsletter-palette-item,
.newsletter-section-add button { width: auto; }
.newsletter-section-add select { width: 170px; height: 38px; }

.newsletter-layout-stage {
    padding: var(--newsletter-content-margin, 24px);
    overflow: auto;
    background: var(--newsletter-body-background, #f2f2f2);
    transition: background-color .18s ease;
}
.newsletter-layout-canvas {
    display: grid;
    gap: 12px;
    width: min(100%, var(--newsletter-content-width, 680px));
    min-width: 480px;
    margin: 0 auto;
    padding: var(--newsletter-content-padding, 28px);
    background: var(--newsletter-content-background, #fff);
    box-shadow: 0 9px 34px rgb(0 0 0 / 18%);
    transition: width .18s ease;
}
.newsletter-layout-editor[data-device="mobile"] .newsletter-layout-canvas { width: min(100%, 390px); min-width: 320px; }
.newsletter-layout-editor[data-device="mobile"] .newsletter-layout-columns { display: grid; }
.newsletter-layout-editor[data-device="mobile"] .newsletter-layout-column { width: 100%; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-builder-workspace { grid-template-columns: minmax(0, 1fr); }
.newsletter-layout-editor[data-mode="preview"] .newsletter-layout-canvas { gap: 0; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-builder-library,
.newsletter-layout-editor[data-mode="preview"] :is(.newsletter-layout-section-head, .newsletter-element-head, .newsletter-element-controls, .newsletter-special-controls, .newsletter-inline-toolbar, .newsletter-image-select-button, .newsletter-column-empty, .newsletter-repeat-list, .newsletter-add-item, .newsletter-spacer-control) { display: none !important; }
.newsletter-layout-editor[data-mode="preview"] :is(.newsletter-layout-section, .newsletter-layout-column, .newsletter-layout-element) { border-color: transparent; box-shadow: none; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-layout-column { min-height: 0; padding: 0; background: transparent; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-layout-element { padding: 0; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-layout-element > :is(input, textarea) { display: none; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-element-rich-content { min-height: 0; padding: 0; border-color: transparent; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-element-image-preview { max-height: none; }
.newsletter-layout-section { border: 1px solid #d3d6da; background: #fff; color: #202124; }
.newsletter-layout-section.is-dragging,
.newsletter-layout-element.is-dragging { opacity: .55; }

.newsletter-layout-section-head {
    display: grid;
    grid-template-columns: 34px minmax(80px, 1fr) 150px 125px 42px 34px;
    align-items: center;
    gap: 7px;
    min-height: 48px;
    padding: 7px;
    border-bottom: 1px solid #d3d6da;
    background: #eceef1;
    color: #202124;
}

.newsletter-layout-section-head select { height: 34px; border-color: #c5c9ce; background: #fff; color: #202124; }
.newsletter-layout-section-head input[type="color"] { width: 42px; height: 34px; padding: 2px; border-color: #c5c9ce; }

.newsletter-layout-columns { display: flex; align-items: stretch; gap: 1.5%; padding: 2.5%; background: #fff; }
.newsletter-layout-columns[data-spacing="compact"] { padding: 1.2%; }
.newsletter-layout-columns[data-spacing="wide"] { padding: 4%; }
.newsletter-layout-column {
    position: relative;
    display: grid;
    align-content: start;
    flex: var(--column-weight) 1 0;
    gap: 10px;
    min-width: 0;
    min-height: 100px;
    padding: 10px;
    border: 1px dashed #aeb4bb;
    background: #f7f8f9;
}

.newsletter-column-empty { display: none; align-items: center; justify-content: center; min-height: 76px; color: #7a8087; font-size: 12px; text-align: center; }
.newsletter-layout-column > .newsletter-column-empty:first-child,
.newsletter-layout-column > .newsletter-column-empty:last-child:nth-child(1) { display: flex; }

.newsletter-layout-element {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 9px;
    border: 1px solid #ccd0d5;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 8%);
}

.newsletter-element-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px 28px; align-items: center; gap: 6px; }
.newsletter-element-head .drag-handle,
.newsletter-element-head .ui-icon-button,
.newsletter-layout-section-head .drag-handle,
.newsletter-layout-section-head .ui-icon-button { width: 28px; height: 28px; min-height: 28px; }

.newsletter-element-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: 5px; }
.newsletter-element-controls select { grid-column: span 2; min-width: 0; }
.newsletter-element-controls select,
.newsletter-element-controls input[type="color"] { height: 32px; min-height: 32px; padding: 3px 5px; border-color: #c5c9ce; background: #fff; color: #202124; font-size: 12px; }
.newsletter-element-controls input[type="color"] { width: 100%; min-width: 0; padding: 2px; }
.newsletter-element-controls--media { grid-template-columns: minmax(0, 1fr) 78px 78px; }
.newsletter-element-controls--links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.newsletter-element-controls--links select { grid-column: auto; }
.newsletter-element-controls--links input[type="number"] { width: 100%; min-width: 0; height: 32px; min-height: 32px; }
.newsletter-element-controls--media select { grid-column: auto; }
.newsletter-element-controls--media input[type="number"],
.newsletter-special-controls :is(input, select),
.newsletter-spacer-control input { width: 100%; height: 32px; min-height: 32px; border-color: #c5c9ce; background: #fff; color: #202124; }

.newsletter-format-toggle { display: inline-flex; position: relative; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid #c5c9ce; background: #f5f6f7; color: #202124; font-size: 12px; font-weight: 700; }
.newsletter-form .newsletter-layout-editor .newsletter-format-toggle { display: inline-flex; min-height: 30px; }
.newsletter-format-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.newsletter-format-toggle:has(input:checked) { border-color: #c28d00; background: #f9be20; }

.newsletter-layout-element :is(input[type="text"], input[type="url"], textarea) { width: 100%; border-color: #c5c9ce; background: #fff; color: #202124; }
.newsletter-element-content { min-height: 58px; resize: vertical; line-height: 1.45; }
.newsletter-system-link-input { min-height: 38px; resize: none; }
.newsletter-element-content[data-size="small"] { font-size: var(--newsletter-font-small, 14px); }
.newsletter-element-content[data-size="normal"] { font-size: var(--newsletter-font-normal, 16px); }
.newsletter-element-content[data-size="large"] { font-size: var(--newsletter-font-large, 20px); }
.newsletter-element-content[data-size="xlarge"] { font-size: var(--newsletter-font-xlarge, 26px); }
.newsletter-text-small { font-size: var(--newsletter-font-small, 14px); }
.newsletter-text-normal { font-size: var(--newsletter-font-normal, 16px); }
.newsletter-text-large { font-size: var(--newsletter-font-large, 20px); }
.newsletter-text-xlarge { font-size: var(--newsletter-font-xlarge, 26px); }
.newsletter-inline-editor { min-width: 0; }
.newsletter-inline-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid #c5c9ce;
    border-bottom: 0;
    background: #eceef1;
    white-space: nowrap;
}
.newsletter-inline-toolbar button {
    flex: 0 0 auto;
    width: auto;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 3px 7px;
    border: 1px solid #c5c9ce;
    background: #fff;
    color: #202124;
    font-size: 12px;
}
.newsletter-inline-toolbar input[type="color"] { flex: 0 0 36px; width: 36px; height: 30px; min-height: 30px; padding: 2px; }
.newsletter-element-rich-content {
    min-height: 90px;
    padding: 10px;
    overflow-wrap: anywhere;
    border: 1px solid #c5c9ce;
    background: #fff;
    color: #202124;
    outline: 0;
    white-space: normal;
}
.newsletter-element-rich-content:focus { border-color: #c28d00; box-shadow: 0 0 0 2px rgb(249 190 32 / 22%); }
.newsletter-live-preview { display: none; min-width: 0; }
.newsletter-layout-editor[data-mode="preview"] .newsletter-live-preview { display: block; }
.newsletter-live-button { display: block; box-sizing: border-box; padding: 12px 18px; font-weight: 700; text-align: center; }
.newsletter-live-system-link { display: inline-block; padding: 4px 0; line-height: 1.4; }
.newsletter-live-navigation { display: inline-block; margin: 0 6px; text-decoration: underline; }
.newsletter-live-social { display: inline-block; margin: 0 4px; padding: 7px 10px; border-radius: 999px; background: #30343a; color: #fff !important; font-size: 12px; }
.newsletter-live-social.has-image { padding: 0; border-radius: 0; background: transparent; }
.newsletter-live-social img { display: block; object-fit: contain; }
.newsletter-live-html { overflow: hidden; }
.newsletter-live-html img { max-width: 100%; height: auto; }
.newsletter-element-image-preview { display: block; width: 100%; height: auto; max-height: 260px; object-fit: contain; background: #f1f2f3; }
.newsletter-element-image-preview[hidden] { display: none; }
.newsletter-element-image-preview:not([hidden]) { cursor: pointer; }
.newsletter-image-select-button {
    width: 100%;
    min-height: 42px;
    border: 1px dashed #8f969e;
    background: #f3f4f5;
    color: #34383d;
}
.newsletter-image-select-button:hover { border-color: #c28d00; background: #fff7dc; }
.newsletter-repeat-list { display: grid; gap: 7px; }
.newsletter-repeat-row {
    display: grid;
    grid-template-columns: minmax(105px, .7fr) 42px minmax(110px, 1fr) minmax(170px, 1.5fr) 30px;
    align-items: center;
    gap: 7px;
}
.newsletter-repeat-list[data-newsletter-items="navigation"] .newsletter-repeat-row { grid-template-columns: minmax(110px, .8fr) minmax(180px, 1.6fr) 30px; }
.newsletter-repeat-row :is(input, select) { width: 100%; height: 34px; min-height: 34px; border-color: #c5c9ce; background: #fff; color: #202124; }
.newsletter-social-icon-select { display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px; padding: 3px; overflow: hidden; border: 1px solid #c5c9ce; background: #f5f6f7; color: #454a50; font-size: 10px; }
.newsletter-social-icon-select:hover { border-color: var(--accent); background: #fff7dc; }
.newsletter-social-icon-select img { width: 100%; height: 100%; object-fit: contain; }
.newsletter-add-item { justify-self: start; min-height: 34px; padding: 6px 10px; }
.newsletter-html-source { min-height: 180px; font-family: Consolas, "Courier New", monospace; font-size: 12px; white-space: pre; }
.newsletter-special-controls { display: grid; grid-template-columns: minmax(130px, 1fr) 90px 54px; align-items: center; gap: 7px; }
.newsletter-special-controls--button { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.newsletter-special-controls input[type="color"] { padding: 2px; }
.newsletter-divider-preview { width: 100%; margin: 13px 0; }
.newsletter-spacer-control { display: grid; grid-template-columns: minmax(0, 1fr) 100px; align-items: center; gap: 10px; font-size: 12px; }
.newsletter-spacer-preview { min-height: 4px; border: 1px dashed #aeb4bb; background: repeating-linear-gradient(135deg,#f7f8f9 0 7px,#eceef1 7px 14px); }

.newsletter-editor-media-dialog {
    width: min(1440px, calc(100vw - 24px));
    max-width: none;
    height: min(920px, calc(100vh - 24px));
    max-height: calc(100vh - 24px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    box-shadow: 0 24px 80px rgb(0 0 0 / 55%);
}
.newsletter-editor-media-dialog::backdrop { background: rgb(0 0 0 / 62%); }
.newsletter-editor-media-dialog[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.newsletter-editor-media-dialog > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}
.newsletter-editor-media-dialog > header h2 { margin: 0 0 3px; font-size: 19px; }
.newsletter-editor-media-dialog > header p { margin: 0; color: var(--muted); font-size: 12px; }
.newsletter-editor-media-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, .65fr) minmax(170px, .65fr) max-content;
    align-items: end;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.newsletter-editor-media-tools label { display: grid; gap: 7px; font-size: 12px; }
.newsletter-editor-media-tools :is(input, select, a) { height: 38px; }
.newsletter-editor-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 13px;
    max-height: none;
    padding: 20px;
    overflow: auto;
}
.newsletter-editor-media-grid > button {
    display: grid;
    grid-template-rows: 190px auto auto;
    gap: 6px;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--text);
    text-align: left;
}
.newsletter-editor-media-grid > button:hover,
.newsletter-editor-media-grid > button:focus-visible { border-color: var(--accent); background: var(--panel-muted); }
.newsletter-editor-media-grid > button > span { display: grid; place-items: center; overflow: hidden; background: #fff; }
.newsletter-editor-media-grid img { width: 100%; height: 100%; object-fit: contain; }
.newsletter-editor-media-grid strong,
.newsletter-editor-media-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newsletter-editor-media-grid small { color: var(--muted); }
.newsletter-editor-media-grid .empty-state { grid-column: 1 / -1; }

.newsletter-form-actions,
.newsletter-send-actions,
.newsletter-send-actions > form,
.newsletter-recipient-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.newsletter-variables {
    padding: 11px;
    border-left: 4px solid var(--accent);
    background: var(--panel-muted);
}

.newsletter-variables code {
    margin-left: 7px;
}

.newsletter-send-actions {
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.newsletter-send-actions label {
    display: grid;
    gap: 6px;
}

@media (max-width: 1050px) {
    .newsletter-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .newsletter-sender-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .newsletter-layout-section-head {
        grid-template-columns: 34px minmax(80px, 1fr) 135px 115px 42px 34px;
    }

    .newsletter-builder-workspace { grid-template-columns: 210px minmax(0, 1fr); }
    .newsletter-element-palette { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .newsletter-shell {
        grid-template-columns: 1fr;
    }

    .newsletter-sidebar {
        position: static;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .newsletter-sidebar nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .newsletter-content {
        padding: 18px 12px;
    }

    .newsletter-form,
    .newsletter-inline-form,
    .newsletter-sender-form {
        grid-template-columns: 1fr;
    }

    .newsletter-builder-topbar { grid-template-columns: 1fr; }
    .newsletter-device-switch,
    .newsletter-mode-switch { justify-self: start; }
    .newsletter-builder-workspace { grid-template-columns: 1fr; }
    .newsletter-builder-library { border-right: 0; border-bottom: 1px solid var(--line); }
    .newsletter-element-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .newsletter-layout-stage { padding: 14px; }
    .newsletter-editor-media-tools { grid-template-columns: 1fr; }
    .newsletter-editor-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
}

.settings-user-main > button.list-save-button,
.settings-status-grid > button.list-save-button,
.settings-material-art-grid > button.list-save-button,
.settings-material-grid > button.list-save-button {
    margin-bottom: 14px;
}

/* Benutzerverwaltung */
.settings-user-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.settings-user-tabs a {
    padding: 10px 14px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
}

.settings-user-tabs a:hover,
.settings-user-tabs a.is-active {
    border-bottom-color: var(--accent);
    color: var(--text);
}

.settings-user-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.settings-user-list-header h2,
.settings-user-list-header p {
    margin: 0;
}

.settings-user-list-header p {
    margin-top: 3px;
    color: var(--muted);
}

.settings-user-list-header button {
    width: auto;
}

.settings-user-list {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.settings-user-list-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) 135px minmax(150px, .8fr) 90px 72px 54px;
    gap: 14px;
    align-items: center;
    min-width: 980px;
    min-height: 52px;
    padding: 9px 14px;
    border-top: 1px solid var(--line);
}

.settings-user-list-row.is-head {
    min-height: 40px;
    border-top: 0;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-user-list-row:not(.is-head):nth-child(odd) {
    background: var(--panel-alt);
}

.settings-user-list-row.is-clickable {
    cursor: pointer;
}

.settings-user-list-row.is-clickable:hover,
.settings-user-list-row.is-clickable:focus-visible {
    background: var(--row-hover, #34383d);
    outline: none;
}

.settings-user-list-row > strong {
    display: flex;
    align-items: center;
    gap: 9px;
}

.settings-user-list-row > strong i,
.settings-vacation-user i {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--user-color);
}

.settings-user-list-actions {
    display: flex;
    justify-content: flex-end;
}

.settings-user-dialog {
    width: min(980px, calc(100vw - 32px));
}

.settings-user-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.settings-user-dialog-grid > div,
.settings-user-contract-grid > div,
.settings-user-vacation-pair,
.settings-user-vacation-pair > div {
    min-width: 0;
}

.settings-user-dialog label,
.settings-user-contract-grid label {
    display: block;
    margin-bottom: 7px;
}

.settings-user-dialog input,
.settings-user-dialog select {
    width: 100%;
    margin: 0;
}

.settings-user-contract-grid {
    display: grid;
    grid-template-columns: minmax(150px, .85fr) minmax(145px, .7fr) minmax(150px, .75fr) minmax(250px, 1.35fr) minmax(150px, .8fr);
    gap: 14px 18px;
    align-items: end;
    margin-top: 16px;
}

.settings-week-hours-history-head,
.settings-week-hours-history-row {
    display: grid;
    grid-template-columns: 110px 130px minmax(220px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.settings-week-hours-history-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-user-contract-grid .color-input-controls {
    margin: 0;
}

.settings-user-vacation-pair > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-user-dialog-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 28px;
    margin-top: 20px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.settings-user-dialog-options .checkbox-field {
    margin: 0;
}

.settings-user-vacation-history {
    margin-top: 22px;
}

.settings-user-vacation-history h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.settings-user-history-head,
.settings-user-history-row {
    display: grid;
    grid-template-columns: 70px 70px 90px 90px minmax(220px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
}

.settings-user-history-head {
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.settings-vacation-planning,
.settings-holiday-planning {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.work-time-row.is-sick,
.admin-work-row.is-sick,
.work-month-day.is-sick {
    background: color-mix(in srgb, #d85f67 13%, var(--panel));
}

.sick-day-button {
    color: var(--muted);
    font-size: 22px;
    font-weight: 800;
}

.sick-day-button.is-active {
    border-color: #d85f67;
    background: #d85f67;
    color: #fff;
}

@media (max-width: 850px) {
    .settings-user-dialog-grid,
    .settings-user-contract-grid {
        grid-template-columns: 1fr;
    }
}

/* Arbeitszeitprofil */
.work-absence-overview {
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.work-absence-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(115px, 1fr));
    align-items: center;
    min-width: 805px;
    min-height: 48px;
    text-align: center;
}

.work-absence-row > * {
    padding: 9px 12px;
    border-right: 1px solid var(--line);
}

.work-absence-row > *:last-child {
    border-right: 0;
}

.work-absence-row.is-head {
    min-height: 40px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.work-time-row {
    grid-template-columns: 44px 100px 68px 68px 105px 95px 105px 105px minmax(175px, auto);
    min-width: 1000px;
}

.work-time-row > span,
.work-time-row > strong,
.work-time-head > span,
.work-month-day > span,
.work-month-day > strong {
    text-align: center;
}

.work-time-row.is-weekend,
.work-month-day.is-weekend {
    background: color-mix(in srgb, var(--panel-muted) 72%, var(--panel));
}

.work-time-row.is-vacation,
.work-time-row.is-sick,
.work-month-day.is-vacation,
.work-month-day.is-sick {
    background: inherit;
}

.work-time-row.is-weekend.is-vacation,
.work-time-row.is-weekend.is-sick,
.work-month-day.is-weekend.is-vacation,
.work-month-day.is-weekend.is-sick {
    background: color-mix(in srgb, var(--panel-muted) 72%, var(--panel));
}

.work-time-actions {
    min-height: 34px;
}

.work-time-actions .icon-button,
.work-time-actions .icon-button.is-static {
    display: inline-grid;
    place-items: center;
    width: var(--icon-button-size, 34px);
    min-width: var(--icon-button-size, 34px);
    height: var(--icon-button-size, 34px);
    min-height: var(--icon-button-size, 34px);
    margin: 0;
    padding: 0;
}

.work-time-actions .icon-button.is-static {
    cursor: default;
    pointer-events: none;
}

.vacation-day-button.is-planned {
    border-color: var(--accent);
    color: var(--accent);
}

.vacation-day-button:not(.is-active):not(.is-planned),
.sick-day-button:not(.is-active) {
    border-color: color-mix(in srgb, var(--muted) 62%, transparent);
    color: color-mix(in srgb, var(--muted) 78%, var(--text));
}

.work-time-row.is-weekend .vacation-day-button:not(.is-active):not(.is-planned),
.work-time-row.is-weekend .sick-day-button:not(.is-active) {
    color: color-mix(in srgb, var(--muted) 58%, var(--text));
}

.work-month-day {
    grid-template-columns: 110px repeat(5, minmax(90px, 1fr)) 70px;
}

.work-month-day form {
    display: flex;
    justify-content: center;
    margin: 0;
}

/* Einheitliches Icon-Button-System */
.ui-icon-button {
    --icon-button-size: 34px;
    --icon-glyph-size: 18px;
    --icon-content-scale: 1;
    --icon-stroke-width: 2;
    display: inline-grid;
    place-items: center;
    flex: 0 0 var(--icon-button-size);
    box-sizing: border-box;
    width: var(--icon-button-size);
    min-width: var(--icon-button-size);
    height: var(--icon-button-size);
    min-height: var(--icon-button-size);
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font-size: var(--icon-glyph-size);
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
}

.ui-icon-button--large {
    --icon-button-size: 38px;
    --icon-glyph-size: 20px;
    --icon-content-scale: 1;
}

.ui-icon-button--medium {
    --icon-button-size: 34px;
    --icon-glyph-size: 18px;
    --icon-content-scale: .9;
}

.ui-icon-button--small {
    --icon-button-size: 30px;
    --icon-glyph-size: 16px;
    --icon-content-scale: .72;
}

.ui-icon-button.ui-icon-button--bare,
.ui-icon-button.ui-icon-button--bare:hover,
.ui-icon-button.ui-icon-button--bare:focus-visible {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.ui-icon-button--delete {
    --icon-glyph-size: 26px;
    border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
    background: transparent;
    color: var(--danger);
    font-size: var(--icon-glyph-size);
    font-weight: 500;
}

.ui-icon-button.ui-icon-button--delete:hover,
.ui-icon-button.ui-icon-button--delete:focus-visible {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--panel));
    color: var(--danger);
}

.ui-icon-button > .ui-icon-glyph {
    display: block;
    transform: scale(var(--icon-content-scale));
    transform-origin: center;
}

.ui-icon-button > svg {
    display: block;
    width: var(--icon-glyph-size);
    height: var(--icon-glyph-size);
    fill: none;
    stroke: currentColor;
    stroke-width: var(--icon-stroke-width);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ui-icon-button:hover,
.ui-icon-button:focus-visible {
    border-color: var(--muted);
    background: var(--panel-muted);
    color: var(--text);
}

.ui-icon-button.is-active,
.ui-icon-button--active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.ui-icon-button.is-active:hover,
.ui-icon-button.is-active:focus-visible,
.ui-icon-button--active:hover,
.ui-icon-button--active:focus-visible {
    border-color: var(--accent);
    background: var(--panel-muted);
    color: #fff;
}

.ui-icon-button--accent,
.ui-icon-button--accent:hover,
.ui-icon-button--accent:focus-visible {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.ui-icon-button.ui-icon-button--success,
.ui-icon-button.ui-icon-button--success:hover,
.ui-icon-button.ui-icon-button--success:focus-visible {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.ui-icon-button.ui-icon-button--danger,
.ui-icon-button.ui-icon-button--danger:hover,
.ui-icon-button.ui-icon-button--danger:focus-visible {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.ui-icon-button--running,
.ui-icon-button--running:focus-visible {
    border-color: var(--timer-running);
    background: var(--timer-running);
    color: #fff;
}

.ui-icon-button--running:hover,
.ui-icon-button--running:focus-visible:hover {
    border-color: var(--timer-running-hover);
    background: var(--timer-running-hover);
    color: #fff;
}

.ui-icon-button:disabled,
.ui-icon-button[aria-disabled="true"] {
    opacity: .48;
    cursor: not-allowed;
    pointer-events: none;
}

/* Anruferliste */
.call-page-head {
    margin-bottom: 18px;
}

.call-page-head-actions,
.call-page-size-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.call-page-size-form select,
.call-page-head-actions .secondary-button {
    height: 38px;
    min-height: 38px;
    margin: 0;
}

.dashboard-call-list {
    margin-top: 20px;
    overflow-x: auto;
}

.dashboard-call-list > .dashboard-panel-head {
    position: sticky;
    left: 0;
}

.call-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, .65fr)) repeat(2, minmax(170px, .9fr)) minmax(220px, 1.2fr) auto auto;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
}

.call-filter label,
.call-edit-grid label {
    display: grid;
    gap: 7px;
    margin: 0;
}

.call-filter :is(input, select, button, .secondary-button) {
    height: 38px;
    min-height: 38px;
    margin: 0;
}

.call-table {
    --list-columns: 110px 78px 82px 148px 112px 150px minmax(180px, 1.15fr) minmax(160px, .85fr) 184px;
    --list-min-width: 1220px;
    overflow: visible;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.call-list-header,
.call-list-row {
    display: grid;
    grid-template-columns: var(--list-columns);
    gap: 10px;
    align-items: center;
    min-width: var(--list-min-width);
    min-height: 48px;
    padding: 0 12px;
}

.call-list-header {
    border-bottom: 1px solid var(--line);
}

.call-list-row {
    border-bottom: 1px solid var(--line);
}

.call-list-row:hover,
.call-list-row.is-alternate:hover,
.call-list-row:focus-within {
    background: var(--panel-muted);
}

.call-list-row:last-of-type {
    border-bottom: 0;
}

.call-list-header > :nth-child(-n + 5),
.call-list-row > :nth-child(-n + 5) {
    text-align: center;
}

.call-list-header > :last-child {
    text-align: right;
}

.call-contact-heading {
    grid-column: span 2;
    text-align: left;
}

.call-direction {
    display: inline-flex;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--muted);
    font-size: 22px;
    font-style: normal;
    line-height: 20px;
    transform: translateY(-1px);
}

.call-direction.is-outgoing {
    color: var(--accent);
}

.call-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
}

.call-status-dot {
    display: block;
    flex: 0 0 11px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--muted);
}

.call-status-dot.is-answered { background: var(--success); }
.call-status-dot.is-missed { background: var(--danger); }
.call-assignee { display: grid; place-items: center; }
.call-actions {
    justify-content: flex-end;
    white-space: nowrap;
}
.call-actions form { display: inline-flex; margin: 0; }

.call-phone-cell,
.call-contact-name-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    text-align: left;
}

.call-phone-link {
    flex: 0 0 auto;
    color: var(--text);
    white-space: nowrap;
}

.call-phone-link:hover,
.call-phone-link:focus-visible {
    color: var(--accent);
}

.call-customer-link {
    display: grid;
    gap: 2px;
    width: auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-customer-link small {
    color: var(--muted);
    font-size: 0.82em;
}

.call-manual-contact {
    min-width: 0;
    overflow: hidden;
    color: var(--accent);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-customer-link:hover,
.call-customer-link:focus-visible,
.call-project-link:hover { color: var(--accent); }

.call-project-link {
    display: grid;
    gap: 2px;
    color: var(--text);
    text-decoration: none;
}

.call-project-link small { color: var(--muted); }
.call-captured-button:not(.ui-icon-button--success) { color: var(--muted); }

.call-edit-dialog {
    width: min(760px, calc(100vw - 32px));
}

.call-edit-dialog > p {
    margin: -8px 0 18px;
    color: var(--muted);
}

.call-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.call-edit-wide { grid-column: 1 / -1; }
.call-edit-grid :is(input, select) { height: 38px; margin: 0; }
.call-edit-grid textarea { width: 100%; margin: 0; resize: vertical; }
.call-note-field > label { display: block; margin-bottom: 7px; }
.call-edit-grid .checkbox-field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 38px;
}
.call-edit-grid .checkbox-field input[type="checkbox"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}
.call-edit-dialog .dialog-actions { margin-top: 18px; }

.call-manual-dialog { width: min(760px, calc(100vw - 32px)); }
.call-manual-form { display: grid; gap: 18px; }
.call-manual-fields {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(130px, .65fr) minmax(300px, 1.55fr);
    gap: 16px;
    align-items: end;
}
.call-manual-fields > label { display: grid; gap: 7px; }
.call-manual-fields input { height: 38px; margin: 0; }
.call-manual-duration {
    display: grid;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    gap: 9px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.call-manual-duration legend { margin-bottom: 7px; }
.call-manual-duration label {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}
.call-manual-form > label { display: grid; gap: 7px; }
.call-manual-form textarea { width: 100%; margin: 0; resize: vertical; }
.call-manual-form .dialog-actions { margin-top: 0; }

.call-search-field { position: relative; }
.call-suggestions {
    position: absolute;
    z-index: 30;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    display: grid;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

.call-suggestions[hidden] { display: none; }
.call-suggestions button {
    display: grid;
    justify-items: start;
    gap: 2px;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--panel);
    color: var(--text);
    text-align: left;
}
.call-suggestions button > * { text-align: left; }
.call-edit-dialog .call-search-field .call-suggestions,
.call-edit-dialog .call-search-field .call-suggestions > button {
    text-align: left !important;
}
.call-edit-dialog .call-search-field .call-suggestions > button {
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: center;
}
.call-edit-dialog .call-search-field .call-suggestions > button > strong,
.call-edit-dialog .call-search-field .call-suggestions > button > small {
    align-self: stretch;
    width: 100%;
    text-align: left !important;
}

.call-callback-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 2px 0 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.call-callback-fields legend {
    padding: 0 6px;
    color: var(--muted);
    font-weight: 700;
}
.call-suggestions button:last-child { border-bottom: 0; }
.call-suggestions button:hover { background: var(--panel-muted); }
.call-suggestions small { color: var(--muted); }

.call-customer-details {
    display: grid;
    gap: 10px;
}
.call-customer-details div {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
}
.call-customer-details dt { color: var(--muted); font-weight: 700; }
.call-customer-details dd { margin: 0; }

@media (max-width: 900px) {
    .call-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .call-edit-grid { grid-template-columns: 1fr; }
    .call-edit-wide { grid-column: auto; }
    .call-callback-fields { grid-template-columns: 1fr; }
    .call-manual-fields { grid-template-columns: 1fr; }
}

.icon-button-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.icon-button-group--large {
    gap: 8px;
}

.form-control-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.form-control-row > :is(input, select, button, .primary-button, .secondary-button, .ui-icon-button) {
    min-height: 38px;
    margin-bottom: 0;
}

/* Erste Umstellung: Hauptnavigation */
.topbar nav.icon-button-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar .nav-icon.ui-icon-button {
    width: var(--icon-button-size);
    height: var(--icon-button-size);
    padding: 0;
    border-color: var(--line);
    background: var(--panel);
    color: var(--muted);
}

.topbar .nav-icon.ui-icon-button:hover,
.topbar .nav-icon.ui-icon-button:focus-visible {
    border-color: var(--muted);
    background: var(--panel-muted);
    color: #fff;
}

.topbar .nav-icon.ui-icon-button.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.topbar .nav-icon.ui-icon-button.is-active:hover,
.topbar .nav-icon.ui-icon-button.is-active:focus-visible {
    border-color: var(--accent);
    background: var(--panel-muted);
    color: #fff;
}

.topbar .nav-icon.ui-icon-button.ui-icon-button--accent,
.topbar .nav-icon.ui-icon-button.ui-icon-button--accent:hover,
.topbar .nav-icon.ui-icon-button.ui-icon-button--accent:focus-visible {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
    font-size: 25px;
}

.topbar .nav-icon.ui-icon-button.purchase-nav-link.has-open-purchases:not(.is-active) {
    border-color: var(--accent);
    color: #fff;
    animation: purchase-alert 1.35s ease-in-out infinite;
}

.topbar .nav-icon.ui-icon-button > svg {
    width: var(--icon-glyph-size);
    height: var(--icon-glyph-size);
    stroke-width: var(--icon-stroke-width);
}

/* Einheitliches Formularsystem, Basis: Auftragserstellung */
:root {
    --form-control-height: 42px;
    --form-control-radius: 6px;
    --form-control-padding: 12px;
    --form-field-gap: 7px;
    --form-grid-gap: 16px;
    --quick-control-height: 34px;
    --quick-control-radius: 6px;
}

.ui-form {
    width: 100%;
    margin: 0;
}

.ui-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--form-grid-gap);
    width: 100%;
}

.ui-form-grid--single {
    grid-template-columns: minmax(0, 1fr);
}

.ui-form-grid--four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ui-form-surface {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.ui-form-field {
    display: grid;
    align-content: start;
    gap: var(--form-field-gap);
    min-width: 0;
    margin: 0;
}

.ui-form-field--wide {
    grid-column: 1 / -1;
}

.ui-form-label,
.ui-form-field > label,
.ui-form-field > legend {
    display: block;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.ui-input,
.ui-select,
.ui-textarea,
.ui-file-input,
.ui-color-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--form-control-radius);
    background: var(--input);
    color: var(--text);
    font: inherit;
}

.ui-input,
.ui-select,
.ui-file-input {
    height: var(--form-control-height);
    min-height: var(--form-control-height);
    padding: 0 var(--form-control-padding);
}

.ui-select {
    min-width: 0;
    padding-right: 34px;
}

.ui-textarea {
    min-height: 130px;
    padding: 10px var(--form-control-padding);
    line-height: 1.5;
    resize: vertical;
}

.ui-color-input {
    width: var(--form-control-height);
    min-width: var(--form-control-height);
    height: var(--form-control-height);
    padding: 4px;
    cursor: pointer;
}

.ui-file-input {
    padding: 5px 6px;
}

.ui-file-input::file-selector-button {
    height: 30px;
    margin-right: 10px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel-muted);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.ui-input::placeholder,
.ui-textarea::placeholder {
    color: color-mix(in srgb, var(--muted) 76%, transparent);
    opacity: 1;
}

.ui-input:hover,
.ui-select:hover,
.ui-textarea:hover,
.ui-file-input:hover,
.ui-color-input:hover {
    border-color: color-mix(in srgb, var(--muted) 78%, var(--line));
}

.ui-input:focus,
.ui-select:focus,
.ui-textarea:focus,
.ui-file-input:focus,
.ui-color-input:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
    outline-offset: 1px;
}

.ui-input:disabled,
.ui-select:disabled,
.ui-textarea:disabled,
.ui-file-input:disabled,
.ui-color-input:disabled,
.ui-input[readonly],
.ui-textarea[readonly] {
    background: var(--panel-alt);
    color: var(--muted);
    cursor: not-allowed;
    opacity: .72;
}

.ui-form-field.is-invalid :is(.ui-input, .ui-select, .ui-textarea, .ui-file-input),
:is(.ui-input, .ui-select, .ui-textarea, .ui-file-input)[aria-invalid="true"] {
    border-color: var(--danger);
}

.ui-form-hint,
.ui-form-error {
    display: block;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.ui-form-hint {
    color: var(--muted);
}

.ui-form-error {
    color: var(--danger);
}

.ui-checkbox-field,
.ui-radio-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--form-control-height);
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: none;
    cursor: pointer;
}

.ui-checkbox,
.ui-radio {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--success);
    cursor: pointer;
}

.ui-checkbox:disabled,
.ui-radio:disabled,
.ui-checkbox-field:has(.ui-checkbox:disabled),
.ui-radio-field:has(.ui-radio:disabled) {
    cursor: not-allowed;
    opacity: .55;
}

.ui-form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: var(--form-grid-gap);
}

.ui-control-row,
.form-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--form-control-height);
}

.ui-control-row > :is(.ui-input, .ui-select, .ui-textarea),
.form-control-row > :is(.ui-input, .ui-select, .ui-textarea) {
    flex: 1 1 auto;
}

.ui-control-row > .ui-icon-button,
.form-control-row > .ui-icon-button {
    flex: 0 0 var(--icon-button-size);
}

/* Formularaktionen neben Inputs und Selects: immer exakt so hoch wie das Feld */
.ui-icon-button--control {
    --icon-button-size: var(--form-control-height);
    --icon-glyph-size: 20px;
    --icon-content-scale: 1;
}

.ui-inline-control-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.ui-inline-control-form > .ui-form-field,
.ui-inline-control-form > :is(.ui-input, .ui-select) {
    flex: 1 1 auto;
    min-width: 0;
}

.ui-inline-control-form > .ui-icon-button--control {
    align-self: flex-end;
    flex: 0 0 var(--form-control-height);
    margin: 0;
}

.ui-form-button {
    box-sizing: border-box;
    height: var(--form-control-height);
    min-height: var(--form-control-height);
    margin: 0;
}

.personal-checklist-add-point.ui-inline-control-form {
    margin-top: var(--form-grid-gap);
}

.text-reference-field {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.text-reference-field > input[type="text"] {
    width: 100%;
    min-width: 0;
}

.text-reference-suggestions {
    position: absolute;
    z-index: 80;
    top: calc(100% + 5px);
    left: 0;
    width: min(460px, 100%);
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
}

.text-reference-suggestions[hidden] {
    display: none;
}

.text-reference-suggestions > button.text-reference-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    gap: 3px;
    padding: 8px 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    color: var(--text);
    text-align: left;
    background: var(--panel);
}

.text-reference-option:last-child {
    border-bottom: 0;
}

.text-reference-option:hover,
.text-reference-option.is-active {
    color: var(--text);
    background: var(--panel-muted);
}

.text-reference-suggestions > button.text-reference-option strong {
    display: block;
    width: 100%;
    color: var(--accent);
    font-size: 14px;
    text-align: left;
}

.text-reference-suggestions > button.text-reference-option small {
    display: block;
    width: 100%;
    color: var(--muted);
    font-size: 11px;
    text-align: left;
}

.rich-editor[data-rich-reference-autocomplete] {
    position: relative;
    overflow: visible;
}

.rich-editor[data-rich-reference-autocomplete] .text-reference-suggestions {
    top: calc(100% + 5px);
    width: 100%;
}

.rich-area .text-reference-link {
    color: var(--accent);
    cursor: pointer;
}

.text-reference-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.text-reference-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.dashboard-panel.dashboard-personal-checklists,
.personal-checklist-profile-points {
    overflow: visible;
}

.ui-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/* Kompakte Schnelländerungen in Tabellen und Listen */
.ui-quick-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
}

.ui-quick-control,
.ui-quick-input,
.ui-quick-select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: var(--quick-control-height);
    min-height: var(--quick-control-height);
    margin: 0;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: var(--quick-control-radius);
    background: var(--input);
    color: var(--text);
    font: inherit;
    font-size: 13px;
    line-height: 1;
}

.ui-quick-select {
    padding-right: 28px;
}

.ui-quick-control--status {
    border-left: 5px solid var(--status-color, var(--muted));
}

.ui-quick-control:hover,
.ui-quick-input:hover,
.ui-quick-select:hover {
    border-color: var(--muted);
}

.ui-quick-control:focus,
.ui-quick-input:focus,
.ui-quick-select:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 20%, transparent);
    outline-offset: 1px;
}

.ui-quick-checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: var(--quick-control-height);
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}

.ui-quick-checkbox {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--success);
}

.ui-quick-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-height: var(--quick-control-height);
}

/* Einheitliche Filter- und Suchfunktionen */
:root {
    --filter-control-height: 38px;
    --filter-control-radius: 6px;
    --filter-control-gap: 12px;
    --filter-label-height: 18px;
    --filter-label-gap: 7px;
}

.ui-filter-form {
    align-items: start;
    gap: var(--filter-control-gap);
}

.ui-filter-form > label {
    display: grid;
    grid-template-rows: var(--filter-label-height) var(--filter-control-height);
    align-self: start;
    gap: var(--filter-label-gap);
    margin: 0;
}

.ui-filter-form :is(
    input[type="text"],
    input[type="search"],
    input[type="date"],
    input[type="month"],
    select,
    button,
    .primary-button,
    .secondary-button
) {
    box-sizing: border-box;
    height: var(--filter-control-height);
    min-height: var(--filter-control-height);
    margin-bottom: 0;
    border-radius: var(--filter-control-radius);
}

.ui-filter-form .segmented span,
.ui-filter-form .filter-multi-select summary {
    height: var(--filter-control-height);
    min-height: var(--filter-control-height);
}

.ui-filter-form > :is(button, .primary-button, .secondary-button) {
    align-self: start;
    margin-top: calc(var(--filter-label-height) + var(--filter-label-gap));
}

/* Standard für das direkte Hinzufügen von Checklistenpunkten */
:root {
    --checklist-control-height: 38px;
    --checklist-add-gap: 8px;
    --checklist-add-margin: 12px;
}

.ui-checklist-add-form {
    align-items: center;
    gap: var(--checklist-add-gap);
    margin-top: var(--checklist-add-margin);
}

.ui-checklist-add-form .ui-checklist-input {
    height: var(--checklist-control-height);
    min-height: var(--checklist-control-height);
}

.ui-checklist-add-form .ui-icon-button {
    --icon-button-size: var(--checklist-control-height);
}

@media (max-width: 900px) {
    .ui-form-grid--four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .ui-form-grid,
    .ui-form-grid--four,
    .ui-form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Einheitliches System für tabellarische Listen */
:root {
    --list-header-height: 42px;
    --list-row-height: 50px;
    --list-cell-gap: 14px;
    --list-inline-padding: 14px;
    --list-font-size: 14px;
    --list-header-font-size: 12px;
    --list-secondary-font-size: 12px;
}

.ui-list-table {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.ui-list-header,
.ui-list-row {
    display: grid;
    grid-template-columns: var(--list-columns, minmax(0, 1fr));
    align-items: center;
    gap: var(--list-cell-gap);
    min-width: var(--list-min-width, 0);
    padding-inline: var(--list-inline-padding);
}

.ui-list-header {
    min-height: var(--list-header-height);
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: uppercase;
}

.ui-list-body {
    min-width: var(--list-min-width, 0);
}

.ui-list-row {
    min-height: var(--list-row-height);
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: var(--list-font-size);
    line-height: 1.4;
    transition: background-color 120ms ease, box-shadow 120ms ease;
}

.ui-list-body > .ui-list-row:nth-child(even),
.ui-list-row.is-alternate {
    background: var(--panel-alt);
}

.ui-list-body > .ui-list-row:last-child,
.ui-list-row.is-last {
    border-bottom: 0;
}

.ui-list-row.is-clickable {
    cursor: pointer;
}

.ui-list-body > .ui-list-row:hover,
.ui-list-row.is-clickable:hover,
.ui-list-row.is-clickable:focus-within,
.ui-list-row.is-hovered {
    background: var(--panel-muted);
}

.ui-list-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.ui-list-row.is-urgent {
    box-shadow: inset 12px 0 0 var(--danger);
}

.ui-list-row--compact {
    --list-row-height: 42px;
}

.ui-list-row--expanded {
    --list-row-height: 74px;
    padding-block: 8px;
}

.ui-list-cell {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ui-list-cell--center {
    justify-self: stretch;
    text-align: center;
}

.ui-list-cell--right {
    justify-self: stretch;
    text-align: right;
}

.ui-list-cell--nowrap {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-list-primary {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.ui-list-secondary {
    color: var(--muted);
    font-size: var(--list-secondary-font-size);
    font-weight: 400;
    line-height: 1.35;
}

.ui-list-meta {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
    padding-top: 7px;
    color: var(--muted);
    font-size: var(--list-secondary-font-size);
}

.ui-list-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: stretch;
    gap: 6px;
    width: 100%;
    min-width: 0;
    min-height: 34px;
}

.ui-list-actions > form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.ui-list-category {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px var(--list-inline-padding);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-muted) 78%, var(--panel));
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.ui-list-empty {
    margin: 0;
    padding: 24px var(--list-inline-padding);
    color: var(--muted);
    font-size: var(--list-font-size);
    text-align: center;
}

@media (max-width: 760px) {
    .ui-list-header,
    .ui-list-row,
    .ui-list-body {
        min-width: var(--list-mobile-min-width, var(--list-min-width, 760px));
    }
}

/* Dashboard auf den gemeinsamen Icon-, Formular- und Listenstandards */
.dashboard-page .dashboard-order-list,
.dashboard-page .dashboard-time-list,
.dashboard-page .dashboard-routine-list {
    --list-mobile-min-width: 0;
}

.dashboard-page .dashboard-order-row.ui-list-row {
    --list-columns: 34px minmax(250px, 1fr) 34px 34px minmax(130px, 170px);
    --list-cell-gap: 6px;
    --list-row-height: 58px;
}

.dashboard-page .dashboard-time-row.ui-list-row {
    --list-columns: minmax(0, 1fr) 92px 38px;
    --list-row-height: 58px;
}

.dashboard-page .dashboard-routine-list form.ui-list-row {
    --list-columns: minmax(0, 1fr) 34px;
    --list-cell-gap: 8px;
    padding: 12px 14px;
}

.dashboard-page .dashboard-work-controls.icon-button-group {
    display: grid;
    grid-template-columns: repeat(3, 30px);
    gap: 6px;
}

.dashboard-page .dashboard-order-assignee .assignee-picker,
.dashboard-page .dashboard-order-assignee .assignee-picker > summary {
    width: 34px;
    height: 34px;
}

.dashboard-page .dashboard-order-assignee .assignee-picker {
    flex-basis: 34px;
}

.dashboard-page .dashboard-order-row.ui-list-row.is-urgent {
    box-shadow: inset 6px 0 0 var(--danger);
}

.dashboard-page .timer-button.ui-icon-button.is-active,
.dashboard-page .timer-button.ui-icon-button.is-active:focus-visible {
    border-color: var(--timer-running);
    background: var(--timer-running);
    color: #fff;
}

/* Einheitlicher Zustand für jede laufende Zeiterfassung */
.timer-button.is-active,
.detail-timer-button.timer-button.is-active,
.mobile-timer-button.is-active,
.mobile-detail-timer.is-active,
.active-timer,
.ui-icon-button.ui-icon-button--running {
    border-color: var(--timer-running);
    background: var(--timer-running);
    color: #fff;
}

.timer-button.is-active:hover,
.detail-timer-button.timer-button.is-active:hover,
.mobile-timer-button.is-active:hover,
.mobile-detail-timer.is-active:hover,
.active-timer:hover,
.ui-icon-button.ui-icon-button--running:hover {
    border-color: var(--timer-running-hover);
    background: var(--timer-running-hover);
    color: #fff;
}

.dashboard-page .personal-checklist-add-point .ui-icon-button {
    margin: 0;
}

/* Listenstandards: Aufträge, Auftragsarchiv und Wartungsverträge */
.order-standard-list {
    --list-columns: 120px 160px minmax(260px, 1.6fr) minmax(180px, 1.1fr) 150px 280px;
    --list-cell-gap: 14px;
    --list-row-height: 48px;
}

.order-standard-list.contract-orders-table {
    --list-columns: 120px 160px minmax(240px, 1.5fr) minmax(170px, 1fr) minmax(170px, .9fr) 240px;
}

.order-standard-list .order-row.ui-list-row {
    row-gap: 0;
}

.order-standard-list .order-row.ui-list-row.has-meta {
    --list-row-height: 74px;
}

.order-standard-list .list-drag-handle.ui-icon-button,
.order-standard-list .list-drag-placeholder {
    flex-basis: 34px;
    width: 34px;
}

.order-standard-list .list-drag-handle.ui-icon-button {
    height: 34px;
}

.order-standard-list .assignee-picker,
.order-standard-list .assignee-picker > summary {
    width: 34px;
    height: 34px;
}

.order-standard-list .assignee-picker {
    flex-basis: 34px;
}

.order-standard-list .favorite-button.ui-icon-button.is-active {
    border-color: var(--accent);
    background: var(--panel);
    color: var(--accent);
}

.order-standard-list .favorite-button.ui-icon-button:hover,
.order-standard-list .favorite-button.ui-icon-button.is-active:hover {
    border-color: var(--accent);
    background: var(--panel-muted);
    color: var(--accent);
}

.order-standard-list .accounting-action-button.ui-icon-button {
    color: var(--success);
}

.order-standard-list .accounting-action-button.ui-icon-button:hover {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 14%, var(--panel));
    color: var(--success);
}

.order-standard-list .contract-maintenance-button.is-complete.ui-icon-button {
    border-color: color-mix(in srgb, var(--success) 60%, var(--line));
    background: color-mix(in srgb, var(--success) 18%, var(--panel));
    color: var(--success);
}

/* Listenstandards: Angebote, Angebotsarchiv und interne Aufgaben */
.offer-standard-list {
    --list-columns: 130px 155px minmax(260px, 1.7fr) minmax(180px, 1fr) 150px 160px;
    --list-cell-gap: 14px;
    --list-min-width: 1140px;
    --list-row-height: 50px;
}

.offer-standard-list .offer-row.ui-list-row {
    row-gap: 0;
}

.offer-standard-list .offer-row.ui-list-row.has-meta {
    --list-row-height: 74px;
}

.internal-task-standard-list {
    --list-columns: 88px 145px minmax(220px, 1.45fr) minmax(145px, .9fr) 135px 160px;
    --list-cell-gap: 14px;
    --list-min-width: 980px;
    --list-row-height: 56px;
}

.internal-task-standard-list .ui-list-header,
.internal-task-standard-list .ui-list-row {
    grid-template-columns: var(--list-columns);
    min-width: var(--list-min-width);
}

.internal-task-standard-list .row-actions {
    min-width: 0;
    flex-wrap: nowrap;
}

.offer-standard-list .list-drag-handle.ui-icon-button,
.offer-standard-list .list-drag-placeholder {
    flex-basis: 34px;
    width: 34px;
}

.offer-standard-list .list-drag-handle.ui-icon-button {
    height: 34px;
}

.offer-standard-list .assignee-picker,
.offer-standard-list .assignee-picker > summary,
.internal-task-standard-list .assignee-picker,
.internal-task-standard-list .assignee-picker > summary {
    width: 34px;
    height: 34px;
}

.offer-standard-list .assignee-picker,
.internal-task-standard-list .assignee-picker {
    flex-basis: 34px;
}

/* Einheitliche Dringlichkeitskennzeichnung in Arbeitslisten */
.urgent-action-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.urgent-action-icon::before {
    position: absolute;
    width: 26px;
    height: 24px;
    background: var(--danger);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    content: '';
}

.urgent-action-icon > span {
    position: relative;
    z-index: 1;
    transform: translateY(4px);
}

.orders-table .order-row.is-urgent,
.offers-table .offer-row.is-urgent {
    box-shadow: none;
}

.orders-table .order-row.is-accounting-released,
.orders-table .order-row.is-accounting-released.is-urgent {
    box-shadow: inset 5px 0 0 var(--success);
}

/* Listenstandards: Routinen, Lager, Produktion und Materialplanung */
.routine-standard-list {
    --list-columns: minmax(220px, 1.4fr) 150px 170px 170px 140px 90px 58px;
    --list-min-width: 1120px;
    --list-row-height: 58px;
}

.routine-open-standard-list .routine-open-row.ui-list-row {
    --list-columns: minmax(240px, 1fr) minmax(220px, .8fr) 110px;
    --list-row-height: 54px;
}

.inventory-standard-list {
    --list-columns: 105px minmax(190px, 1.4fr) 90px 115px 115px 105px minmax(110px, .8fr) 82px;
    --list-min-width: 1040px;
    --list-row-height: 48px;
}

.production-standard-list {
    --list-columns: 34px 78px 130px minmax(145px, 1.4fr) minmax(110px, .9fr) minmax(115px, 1fr) minmax(115px, .9fr) 420px;
    --list-min-width: 1220px;
    --list-cell-gap: 10px;
    --list-inline-padding: 6px;
    --list-row-height: 58px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.production-standard-list .production-category-row.ui-list-row:nth-child(even) {
    background: var(--panel-alt);
}

.production-standard-list .production-category-row.ui-list-row:hover {
    background: var(--panel-muted);
}

.production-standard-list .production-category-row.ui-list-row.is-urgent {
    box-shadow: inset 7px 0 0 var(--danger);
}

.production-standard-list .production-status-form {
    display: inline-flex;
    align-items: center;
    width: 100%;
    margin: 0;
}

.production-standard-list .production-status-form .list-status-select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: var(--quick-control-height);
    min-height: var(--quick-control-height);
    margin: 0;
    padding-block: 0;
    font-size: 13px;
}

.production-standard-list .production-overview-actions {
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

.production-standard-list .production-info-button.ui-icon-button,
.production-standard-list .production-inventory-link.ui-icon-button,
.production-standard-list .edit-icon-button.ui-icon-button {
    border-color: var(--line);
    background: var(--panel);
    color: var(--muted);
}

.production-standard-list .production-info-button.ui-icon-button:hover,
.production-standard-list .production-inventory-link.ui-icon-button:hover,
.production-standard-list .edit-icon-button.ui-icon-button:hover {
    border-color: var(--muted);
    background: var(--panel-muted);
    color: var(--text);
}

.material-pool-standard-list {
    --list-columns: 28px 120px minmax(190px, 1.3fr) minmax(140px, 1fr) 70px 150px 145px minmax(150px, 1fr) 110px;
    --list-min-width: 1280px;
    --list-row-height: 50px;
}

.material-pool-standard-list > .ui-list-category {
    margin: 0;
    border-inline: 0;
    border-radius: 0;
}

.material-pool-standard-list .material-pool-row.ui-list-row:hover {
    background: var(--panel-muted);
}

.material-history-standard-list {
    --list-columns: 150px 180px 100px 90px 150px 60px;
    --list-min-width: 760px;
    --list-row-height: 50px;
}

/* Listenstandards: Bestellungen, Kunden und Wissensdatenbank */
.purchase-standard-list {
    --list-columns: 125px minmax(190px, 1fr) 110px 70px 105px minmax(170px, .8fr) 82px;
    --list-min-width: 920px;
    --list-row-height: 54px;
}

.purchase-standard-list .purchase-list-row.ui-list-row {
    border-left: 5px solid var(--danger);
}

.purchase-standard-list .purchase-list-row.ui-list-row.is-ordered {
    border-left-color: var(--success);
}

.purchase-standard-list .purchase-list-row.ui-list-row:nth-of-type(even),
.material-pool-standard-list .material-pool-row.ui-list-row:nth-of-type(even),
.accounting-released-standard-list .accounting-released-row.ui-list-row:nth-of-type(even),
.statistics-standard-list .data-row.ui-list-row:nth-of-type(even),
.work-time-standard-list .admin-work-row.ui-list-row:nth-of-type(even) {
    background: var(--panel-alt);
}

:is(
    .purchase-standard-list .purchase-list-row.ui-list-row,
    .accounting-released-standard-list .accounting-released-row.ui-list-row,
    .statistics-standard-list .data-row.ui-list-row,
    .work-time-standard-list .admin-work-row.ui-list-row,
    .eisstock-standard-list .eisstock-row.ui-list-row
):hover {
    background: var(--panel-muted);
}

.clients-standard-list {
    --list-columns: minmax(190px, 1.35fr) minmax(170px, 1.15fr) 120px minmax(190px, 1.15fr) minmax(160px, 1fr) 88px 88px 130px 62px;
    --list-min-width: 1320px;
    --list-row-height: 58px;
}

.clients-standard-list .client-row.ui-list-row:hover,
.clients-standard-list .client-row.ui-list-row:focus-within {
    background: var(--panel-muted);
}

.clients-standard-list .client-metric:hover,
.clients-standard-list .client-metric:focus-visible,
.clients-standard-list .client-row .edit-icon-button.ui-icon-button:hover,
.clients-standard-list .client-row .edit-icon-button.ui-icon-button:focus-visible {
    border-color: var(--muted);
    background: var(--panel-muted);
    color: var(--text);
}

.knowledge-standard-list {
    --list-columns: 124px minmax(0, 1.5fr) minmax(0, 1.15fr) minmax(0, .95fr) 132px 76px;
    --list-row-height: 78px;
}

/* Listenstandards: Buchhaltung, Statistiken und Eisstock */
.accounting-released-standard-list {
    --list-columns: 110px 150px minmax(210px, 1.3fr) minmax(170px, 1fr) 155px 120px 58px;
    --list-min-width: 1080px;
    --list-row-height: 50px;
}

.provision-overview {
    --list-columns: 110px minmax(160px, 1fr) minmax(220px, 1.3fr) minmax(180px, 1fr) 110px 120px 120px;
}

.provision-overview .provision-overview-row.ui-list-header,
.provision-overview .provision-overview-row.ui-list-row {
    grid-template-columns: var(--list-columns);
    min-width: 1080px;
}

.provision-report-standard-list {
    --list-columns: minmax(220px, 1.5fr) 210px 190px 140px 70px;
    --list-min-width: 850px;
    --list-row-height: 54px;
}

.statistics-standard-list {
    --list-columns: 180px minmax(220px, 1fr) minmax(160px, 1fr) 150px;
    --list-min-width: 760px;
    --list-row-height: 48px;
}

.weekly-hours-standard-list {
    --list-columns: minmax(170px, 1.15fr) repeat(7, minmax(145px, 1fr));
    --list-min-width: 1240px;
    --list-cell-gap: 0px;
    --list-row-height: 54px;
}

.weekly-hours-standard-list .weekly-hours-row.ui-list-row,
.weekly-hours-standard-list .weekly-hours-row.ui-list-header {
    align-items: stretch;
    padding-inline: 0;
}

.work-time-standard-list {
    --list-columns: 42px 92px minmax(120px, 1fr) 60px 60px 82px 76px 82px 92px minmax(270px, auto);
    --list-min-width: 1150px;
    --list-cell-gap: 10px;
    --list-row-height: 54px;
}

.settings-config-work-time {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px;
}

.profile-work-standard-list .work-time-row.has-pause-deficit,
.work-time-standard-list .admin-work-row.has-pause-deficit,
.work-month-dialog .work-month-day.has-pause-deficit {
    box-sizing: border-box;
    border-left: 4px solid var(--danger);
}

.work-time-statistics-options {
    display: grid;
    gap: 14px;
}

.work-time-statistics-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
}

.work-time-summary-table {
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.work-time-summary-admin-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) repeat(6, minmax(115px, 1fr));
    align-items: center;
    min-width: 860px;
    min-height: 48px;
    padding: 0 12px;
    gap: 10px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.work-time-summary-admin-row:last-child {
    border-bottom: 0;
}

.work-time-summary-admin-row.is-head {
    min-height: var(--list-header-height);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    text-transform: uppercase;
}

.work-time-summary-month {
    margin: 18px 0 8px;
    font-size: 15px;
}

.work-time-year-filter {
    grid-template-columns: minmax(160px, 220px) auto;
    justify-content: start;
    margin-bottom: 18px;
}

@media (max-width: 700px) {
    .settings-config-work-time {
        grid-template-columns: 1fr;
    }
}

.eisstock-standard-list {
    --list-columns: minmax(190px, 1.15fr) minmax(170px, 1fr) minmax(150px, .9fr) minmax(210px, 1.15fr) 130px 105px 54px;
    --list-min-width: 1180px;
    --list-row-height: 58px;
}

/* Bestehende Sondericons innerhalb der umgestellten Listen */
:is(
    .routines-page,
    .inventory-page,
    .production-overview-page,
    .material-requirements-page,
    .purchases-page,
    .client-page,
    .knowledge-page,
    .accounting-page,
    .statistics-page,
    .eisstock-page
) :is(
    .row-actions,
    .inventory-row-actions,
    .production-overview-actions,
    .purchase-list-actions,
    .knowledge-library-actions,
    .statistics-actions,
    .work-time-actions
) {
    align-items: center;
    gap: 6px;
}

:is(
    .inventory-standard-list,
    .production-standard-list,
    .purchase-standard-list,
    .clients-standard-list,
    .knowledge-standard-list,
    .statistics-standard-list,
    .work-time-standard-list,
    .eisstock-standard-list
) :is(
    .icon-button,
    .favorite-button,
    .production-progress-button,
    .production-info-button,
    .purchase-row-action,
    .settings-delete-button,
    .list-save-button,
    .timer-button
) {
    box-sizing: border-box;
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
}

:is(
    .inventory-filter-form,
    .production-filter-form,
    .client-search-form,
    .client-page-size-form,
    .knowledge-filter-form,
    .work-statistics-filter,
    .eisstock-filters,
    .provision-toolbar
).ui-filter-form :is(input, select, button, .primary-button, .secondary-button) {
    height: var(--filter-control-height);
    min-height: var(--filter-control-height);
    margin-bottom: 0;
}

/* Nebenlisten in den umgestellten Bereichen */
.material-history-standard-list > article {
    display: grid;
    grid-template-columns: var(--list-columns);
    align-items: center;
    gap: var(--list-cell-gap);
    min-width: var(--list-min-width);
    min-height: var(--list-row-height);
    padding-inline: var(--list-inline-padding);
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: var(--list-font-size);
}

.material-history-standard-list > article:nth-child(odd) {
    background: var(--panel-alt);
}

.material-history-standard-list > article:hover {
    background: var(--panel-muted);
}

.material-history-standard-list > article :is(.icon-button, .view-icon-button) {
    box-sizing: border-box;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
}

.material-cut-list {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.material-cut-list > :is(.material-cut-head, div) {
    min-height: var(--list-row-height);
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    font-size: var(--list-font-size);
}

.material-cut-list > .material-cut-head {
    min-height: var(--list-header-height);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    text-transform: uppercase;
}

.material-cut-list > div:nth-child(odd):not(.material-cut-head) {
    background: var(--panel-alt);
}

.eisstock-event-list-head,
.eisstock-event-row {
    min-height: var(--list-row-height);
    font-size: var(--list-font-size);
}

.eisstock-event-list-head {
    min-height: var(--list-header-height);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    text-transform: uppercase;
}

.eisstock-event-row:nth-child(even) {
    background: var(--panel-alt);
}

.eisstock-event-row:hover {
    background: var(--panel-muted);
}

.eisstock-event-row .settings-delete-button {
    box-sizing: border-box;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    color: var(--danger);
    font-size: 26px;
}

.accounting-released-standard-list .list-save-button,
.provision-report-standard-list .ui-pdf-icon,
.statistics-standard-list :is(.icon-button, .settings-delete-button),
.work-time-standard-list :is(.icon-button, .settings-delete-button) {
    box-sizing: border-box;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
}

/* Listen- und Iconstandards: Profil */
.profile-appointment-standard-list {
    --list-columns: minmax(0, 1fr) 34px 34px;
    --list-row-height: 62px;
    --list-cell-gap: 8px;
}

.profile-appointment-standard-list > article.ui-list-row {
    border-left: 5px solid var(--appointment-color);
}

.profile-appointment-standard-list > article.ui-list-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.profile-appointment-standard-list > article.ui-list-row:hover {
    background: var(--panel-muted);
}

.profile-appointment-standard-list > article.ui-list-row > form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.profile-checklist-standard-list {
    --list-columns: 42px 28px minmax(0, 1fr) 42px;
    --list-row-height: 54px;
    --list-cell-gap: 8px;
}

.profile-checklist-standard-list .personal-checklist-profile-point.ui-list-row {
    padding-block: 6px;
    background: var(--input);
}

.profile-checklist-standard-list .personal-checklist-profile-point.ui-list-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.profile-checklist-standard-list .personal-checklist-profile-point.ui-list-row:hover {
    background: var(--panel-muted);
}

.profile-absence-standard-list {
    --list-columns: repeat(7, minmax(115px, 1fr));
    --list-min-width: 805px;
    --list-row-height: 48px;
    --list-cell-gap: 0px;
}

.profile-absence-standard-list .work-absence-row.ui-list-header,
.profile-absence-standard-list .work-absence-row.ui-list-row {
    text-align: center;
}

.profile-work-standard-list {
    --list-columns: 44px 100px 68px 68px 105px 95px 105px 105px minmax(220px, auto);
    --list-min-width: 1045px;
    --list-row-height: 54px;
    --list-cell-gap: 12px;
}

.profile-work-standard-list .work-time-head > span:last-child {
    text-align: center;
}

.work-time-month-summary {
    width: 100%;
    margin-top: 16px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.work-time-summary-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    align-items: center;
    min-width: 780px;
    min-height: 48px;
    text-align: center;
}

.work-time-summary-row > * {
    padding: 9px 12px;
    border-right: 1px solid var(--line);
}

.work-time-summary-row > *:last-child {
    border-right: 0;
}

.work-time-summary-row.is-head {
    min-height: 40px;
    background: var(--panel-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.work-month-dialog {
    width: min(1120px, calc(100vw - 32px));
}

.work-month-dialog .work-month-day {
    grid-template-columns: 110px repeat(5, minmax(90px, 1fr)) minmax(180px, 220px);
    min-width: 1010px;
}

.work-month-dialog .work-time-actions {
    justify-content: flex-end;
}

.profile-work-standard-list .work-time-row:is(.ui-list-header, .ui-list-row) {
    grid-template-columns: var(--list-columns);
    min-width: var(--list-min-width);
    padding-block: 0;
}

.profile-work-standard-list .work-time-row.ui-list-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.profile-work-standard-list .work-time-row.ui-list-row:hover {
    background: var(--panel-muted);
}

.profile-month-standard-list {
    --list-columns: 110px repeat(4, minmax(105px, 1fr)) 38px;
    --list-min-width: 720px;
    --list-row-height: 50px;
    --list-cell-gap: 12px;
}

.profile-month-standard-list .work-month-row {
    display: grid;
    grid-template-columns: var(--list-columns);
    align-items: center;
    gap: var(--list-cell-gap);
    min-width: var(--list-min-width);
    min-height: var(--list-row-height);
    padding-block: 0;
    padding-inline: var(--list-inline-padding);
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: var(--list-font-size);
}

.profile-month-standard-list .work-month-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.profile-month-standard-list .work-month-row:hover:not(.work-time-head) {
    background: var(--panel-muted);
}

.profile-month-standard-list .work-month-row.work-time-head {
    min-height: var(--list-header-height);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    text-transform: uppercase;
}

.profile-page :is(
    .profile-appointment-standard-list,
    .profile-checklist-standard-list,
    .profile-work-standard-list,
    .profile-month-standard-list,
    .work-month-days
) :is(.icon-button, .drag-handle, .settings-delete-button) {
    box-sizing: border-box;
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
}

.profile-page .profile-checklist-standard-list .ui-icon-button--control {
    flex: 0 0 var(--form-control-height);
    width: var(--form-control-height);
    min-width: var(--form-control-height);
    height: var(--form-control-height);
    min-height: var(--form-control-height);
}

.profile-page .work-time-actions {
    align-items: center;
    gap: 6px;
    min-height: 34px;
}

.profile-page .work-time-warning-button > .urgent-action-icon {
    transform: scale(.82);
}

.profile-work-standard-list .work-time-row.ui-list-row.is-weekend,
.work-time-standard-list .admin-work-row.ui-list-row.is-weekend {
    background: color-mix(in srgb, var(--panel-muted) 72%, var(--panel));
}

.profile-work-standard-list .work-time-row.ui-list-row.is-vacation,
.work-time-standard-list .admin-work-row.ui-list-row.is-vacation {
    background: color-mix(in srgb, #58b96d 12%, var(--panel));
}

.profile-work-standard-list .work-time-row.ui-list-row.is-sick,
.work-time-standard-list .admin-work-row.ui-list-row.is-sick {
    background: color-mix(in srgb, #d85f67 13%, var(--panel));
}

.profile-work-standard-list .work-time-row.ui-list-row:hover,
.work-time-standard-list .admin-work-row.ui-list-row:hover {
    background: var(--panel-muted);
}

/* Gemeinsame Listen-, Icon- und Formularstandards für alle Einstellungen */
.ui-settings-standard {
    --settings-list-row-height: var(--list-row-height);
    --settings-list-header-height: var(--list-header-height);
    --settings-list-gap: var(--list-cell-gap);
    --settings-control-height: var(--filter-control-height);
}

.ui-settings-standard :is(
    .settings-list,
    .settings-sort-list,
    .material-settings-list,
    .tag-settings-list,
    .checklist-template-sort-list,
    .checklist-point-list,
    .settings-user-list,
    .settings-vacation-list,
    .settings-holiday-list,
    .provision-access-list,
    .settings-user-vacation-history,
    .material-widths
) {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.project-delete-dialog {
    width: min(620px, calc(100vw - 32px));
}

.project-delete-dialog > p {
    line-height: 1.55;
}

.project-delete-time-option {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--panel-muted);
}

.project-delete-time-option input {
    flex: 0 0 auto;
    margin: 0;
}

.project-delete-note {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.ui-settings-standard :is(
    .settings-sort-row,
    .settings-list-row,
    .material-settings-item,
    .time-category-row,
    .tag-settings-row,
    .checklist-template,
    .checklist-edit-point,
    .settings-user-list-row:not(.is-head),
    .settings-vacation-row,
    .settings-holiday-row,
    .settings-user-history-row,
    .material-width-entry,
    .settings-edit-row,
    .provision-user-row,
    .calculation-extra-row
) {
    box-sizing: border-box;
    min-height: var(--settings-list-row-height);
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: var(--list-font-size);
    line-height: 1.4;
    transition: background-color 120ms ease;
}

.ui-settings-standard :is(
    .settings-sort-row,
    .settings-list-row,
    .material-settings-item,
    .time-category-row,
    .tag-settings-row,
    .checklist-template,
    .checklist-edit-point,
    .settings-user-list-row:not(.is-head),
    .settings-vacation-row,
    .settings-holiday-row,
    .settings-user-history-row,
    .material-width-entry,
    .settings-edit-row,
    .provision-user-row,
    .calculation-extra-row
):nth-of-type(even) {
    background: var(--panel-alt);
}

.ui-settings-standard :is(
    .settings-sort-row,
    .settings-list-row,
    .material-settings-item,
    .time-category-row,
    .tag-settings-row,
    .checklist-template,
    .checklist-edit-point,
    .settings-user-list-row:not(.is-head),
    .settings-vacation-row,
    .settings-holiday-row,
    .settings-user-history-row,
    .material-width-entry,
    .settings-edit-row,
    .provision-user-row,
    .calculation-extra-row
):hover {
    background: var(--panel-muted);
}

.ui-settings-standard :is(
    .settings-user-list-row.is-head,
    .settings-vacation-head,
    .settings-holiday-list-head,
    .settings-user-history-head
) {
    box-sizing: border-box;
    min-height: var(--settings-list-header-height);
    border-bottom: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
}

.ui-settings-standard .material-settings-category-heading {
    display: flex;
    align-items: center;
    min-height: 38px;
    margin: 0;
    padding: 8px var(--list-inline-padding);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel-muted) 78%, var(--panel));
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.ui-settings-standard :is(
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="month"],
    input[type="time"],
    input[type="url"],
    input[type="tel"],
    input[type="color"],
    select,
    button:not(.time-dialog-close):not(.ui-icon-button):not(.drag-handle):not(.list-save-button):not(.settings-delete-button):not(.checklist-delete-button):not(.edit-icon-button):not(.settings-dialog-open-button):not(.checklist-copy-button):not(.material-width-delete):not(.production-delete-button),
    .primary-button,
    .secondary-button
) {
    box-sizing: border-box;
    height: var(--settings-control-height);
    min-height: var(--settings-control-height);
    margin-bottom: 0;
    border-radius: var(--filter-control-radius);
}

.ui-settings-standard :is(.settings-create-form, .settings-edit-row, .settings-dialog form) {
    gap: 12px;
}

.ui-settings-standard :is(
    .drag-handle,
    .icon-button,
    .list-save-button,
    .settings-delete-button,
    .checklist-delete-button,
    .edit-icon-button,
    .settings-dialog-open-button,
    .checklist-copy-button,
    .material-width-delete,
    .production-delete-button
) {
    box-sizing: border-box;
    display: inline-grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    line-height: 1;
    text-decoration: none;
}

.ui-settings-standard :is(.drag-handle, .icon-button, .edit-icon-button, .settings-dialog-open-button, .checklist-copy-button) {
    background: var(--panel);
    color: var(--muted);
}

.ui-settings-standard :is(.drag-handle, .icon-button, .edit-icon-button, .settings-dialog-open-button, .checklist-copy-button):hover,
.ui-settings-standard :is(.drag-handle, .icon-button, .edit-icon-button, .settings-dialog-open-button, .checklist-copy-button):focus-visible {
    border-color: var(--muted);
    background: var(--panel-muted);
    color: var(--text);
}

.ui-settings-standard .list-save-button {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
    font-size: 18px;
}

.ui-settings-standard .list-save-button:hover,
.ui-settings-standard .list-save-button:focus-visible {
    border-color: color-mix(in srgb, var(--success) 72%, #000);
    background: color-mix(in srgb, var(--success) 82%, #000);
    color: #fff;
}

.ui-settings-standard :is(.settings-delete-button, .checklist-delete-button, .material-width-delete, .production-delete-button) {
    border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
    background: transparent;
    color: var(--danger);
    font-size: 26px;
    font-weight: 500;
}

.ui-settings-standard :is(.settings-delete-button, .checklist-delete-button, .material-width-delete, .production-delete-button):hover,
.ui-settings-standard :is(.settings-delete-button, .checklist-delete-button, .material-width-delete, .production-delete-button):focus-visible {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, var(--panel));
    color: var(--danger);
}

.ui-settings-standard .edit-icon-glyph {
    display: block;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px) scale(.9);
    transform-origin: center;
}

.ui-settings-standard .settings-compact-category-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px 34px;
    align-items: center;
    gap: 10px;
    padding: 8px var(--list-inline-padding);
}

.ui-settings-standard .settings-compact-category-row > form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.ui-settings-standard .settings-compact-category-row .settings-list-summary {
    min-width: 0;
}

.ui-settings-standard .settings-category-create-standard > div,
.ui-settings-standard div.settings-category-create-standard > div {
    display: grid;
    align-content: end;
    gap: var(--form-field-gap);
    min-width: 0;
    margin: 0;
}

.ui-settings-standard .settings-category-create-standard :is(input[type="text"], input[type="color"], button) {
    height: var(--form-control-height);
    min-height: var(--form-control-height);
    margin: 0;
}

.ui-settings-standard .settings-category-create-standard .checkbox-field {
    align-self: end;
    min-height: var(--form-control-height);
    margin: 0;
}

.ui-settings-standard input[type="color"] {
    width: 48px;
    min-width: 48px;
    padding: 3px;
}

.ui-settings-standard :is(
    .settings-create-form,
    .settings-edit-row,
    .settings-status-grid,
    .tag-settings-row,
    .material-settings-item,
    .material-width-entry,
    .settings-holiday-create,
    .settings-holiday-color
) > :is(
    .drag-handle,
    .icon-button,
    .list-save-button,
    .settings-delete-button,
    .checklist-delete-button,
    .edit-icon-button,
    .settings-dialog-open-button
) {
    align-self: end;
}

.ui-settings-standard :is(
    .material-settings-actions,
    .settings-holiday-actions,
    .settings-user-list-actions,
    .settings-dialog-actions
) {
    align-items: center;
    gap: 6px;
}

.ui-settings-standard :is(
    .material-settings-actions,
    .settings-holiday-actions,
    .settings-user-list-actions
) > form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

/* Einheitliche Verwaltungslisten im Newsletterbereich */
.newsletter-standard-list {
    --list-row-height: 54px;
    --list-header-height: 42px;
    --list-cell-gap: 12px;
    --list-inline-padding: 12px;
    --list-font-size: 14px;
    --list-header-font-size: 12px;
    overflow-x: auto;
    border: 1px solid var(--line);
    background: var(--panel);
}

.newsletter-standard-list > :is(.ui-list-header, .ui-list-row) {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.newsletter-standard-list.newsletter-standard-list > .ui-list-row {
    background: var(--panel);
}

.newsletter-standard-list.newsletter-standard-list > .ui-list-row:nth-of-type(even) {
    background: var(--panel-alt);
}

.newsletter-standard-list.newsletter-standard-list > .ui-list-row:hover,
.newsletter-standard-list.newsletter-standard-list > .ui-list-row:focus-within {
    background: var(--panel-muted);
}

.newsletter-standard-list .ui-list-actions,
.newsletter-standard-list .row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.newsletter-standard-list .ui-list-actions > form,
.newsletter-standard-list .row-actions > form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.newsletter-standard-list .newsletter-row {
    grid-template-columns: minmax(170px, 1.25fr) minmax(210px, 1.45fr) 120px 100px 138px;
    min-width: 820px;
    min-height: var(--list-row-height);
    padding: 0 var(--list-inline-padding);
    background: var(--panel);
    color: var(--text);
    font-size: var(--list-font-size);
}

.newsletter-standard-list .newsletter-row.is-head {
    min-height: var(--list-header-height);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
}

.newsletter-standard-list .newsletter-row > * {
    min-width: 0;
}

.newsletter-template-list .newsletter-row,
.newsletter-form-list .newsletter-row {
    grid-template-columns: minmax(190px, 1.2fr) 120px minmax(210px, 1.35fr) 90px 90px;
}

.newsletter-list-table .newsletter-row {
    grid-template-columns: minmax(150px, .8fr) minmax(230px, 1.5fr) 100px minmax(180px, 1fr) 138px;
}

.newsletter-campaign-list .newsletter-row.campaign-row,
.newsletter-delivery-list .newsletter-row.delivery-row {
    grid-template-columns: minmax(230px, 1.7fr) 105px 105px 125px 105px 90px;
    min-width: 900px;
}

.newsletter-folder-tree.newsletter-standard-list {
    display: block;
}

.newsletter-folder-tree.newsletter-standard-list > :is(.newsletter-folder-tree-head, .newsletter-folder-tree-row) {
    grid-template-columns: minmax(260px, 1fr) 90px 138px;
    min-width: 620px;
    padding-block: 0;
    padding-inline: var(--list-inline-padding);
}

.newsletter-folder-tree.newsletter-standard-list > .newsletter-folder-tree-head {
    min-height: var(--list-header-height);
    background: var(--panel-muted);
    color: var(--muted);
    font-size: var(--list-header-font-size);
    font-weight: 700;
    text-transform: uppercase;
}

.newsletter-recipient-list {
    margin-top: 16px;
}

.newsletter-recipient-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) 130px 120px 70px;
    align-items: center;
    gap: var(--list-cell-gap);
    min-width: 660px;
    min-height: var(--list-row-height);
    padding: 0 var(--list-inline-padding);
}

.newsletter-list-editor {
    box-sizing: border-box;
    width: 100%;
    min-width: 780px;
    margin: 0;
    border-width: 0 0 1px;
}

.newsletter-list-editor > summary {
    padding: 14px var(--list-inline-padding);
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.newsletter-list-editor[open] {
    padding: 0 18px 18px;
    background: var(--panel);
}

.newsletter-content :is(.primary-button, .secondary-button, .ui-form-button) {
    box-sizing: border-box;
    min-height: var(--form-control-height, 38px);
    margin: 0;
}

.newsletter-content .edit-icon-button .edit-icon-glyph {
    display: block;
}

@media (max-width: 760px) {
    .newsletter-standard-list {
        --list-inline-padding: 10px;
    }
}

/* Eisstock: Veranstaltungseditor mit Teams und kompaktem Spielplan */
.eisstock-event-overview {
    margin-top: 18px;
    overflow-x: auto;
}

.eisstock-event-overview-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(210px, 280px) 70px 92px;
    align-items: center;
    gap: var(--list-cell-gap, 12px);
    min-width: 760px;
    min-height: var(--list-row-height, 54px);
    padding: 0 var(--list-inline-padding, 12px);
    border-bottom: 1px solid var(--line);
}

.eisstock-event-overview-row.is-alternate {
    background: var(--panel-alt);
}

.eisstock-event-overview-row.ui-list-row:hover {
    background: var(--panel-muted);
}

.eisstock-event-overview-row > :nth-child(3) {
    text-align: center;
}

.eisstock-event-overview-row .ui-list-actions,
.eisstock-event-overview-row .ui-list-actions form {
    margin: 0;
}

.eisstock-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.eisstock-subtabs button {
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 7px 14px;
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--text);
}

.eisstock-subtabs button.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-contrast);
}

.eisstock-editor-panel[hidden],
.eisstock-group-panel[hidden] {
    display: none;
}

.eisstock-selected-event-form {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(210px, 1.4fr) 34px;
    align-items: end;
    gap: 14px;
    margin-top: 16px;
}

.eisstock-selected-event-form.without-sponsor {
    grid-template-columns: minmax(280px, 2fr) minmax(170px, 1fr) minmax(170px, 1fr) 34px;
}

.eisstock-event-dialog,
.eisstock-category-dialog {
    width: min(680px, calc(100vw - 32px));
}

.eisstock-sponsor-dialog {
    width: min(820px, calc(100vw - 32px));
}

.eisstock-event-dialog-form,
.eisstock-sponsor-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
}

.eisstock-event-dialog-form .span-2,
.eisstock-sponsor-form .span-2 {
    grid-column: 1 / -1;
}

.eisstock-sponsor-form :is(input:not([type="checkbox"]), select, textarea),
.eisstock-event-dialog-form :is(input, select),
.eisstock-category-dialog input {
    width: 100%;
    margin: 0;
}

.eisstock-sponsor-partner-toggle {
    min-height: var(--form-control-height, 38px);
    margin: 0;
}

.eisstock-sponsor-form [data-eisstock-venue-date][hidden] {
    display: none;
}

.eisstock-sponsor-filters {
    grid-template-columns: minmax(190px, 250px) minmax(210px, 280px) auto auto;
    margin: 18px 0;
}

.eisstock-sponsor-list,
.eisstock-category-list {
    overflow-x: auto;
}

.eisstock-sponsor-row {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) minmax(130px, .85fr) 105px 125px 112px 145px 125px 52px;
    align-items: center;
    gap: var(--list-cell-gap, 12px);
    min-width: 1110px;
    min-height: var(--list-row-height, 54px);
    padding: 0 var(--list-inline-padding, 12px);
    border-bottom: 1px solid var(--line);
}

.eisstock-category-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 110px 92px;
    align-items: center;
    gap: var(--list-cell-gap, 12px);
    min-width: 520px;
    min-height: var(--list-row-height, 54px);
    padding: 0 var(--list-inline-padding, 12px);
    border-bottom: 1px solid var(--line);
}

.eisstock-sponsor-row.is-alternate,
.eisstock-category-row.is-alternate {
    background: var(--panel-alt);
}

.eisstock-sponsor-row.ui-list-row:hover,
.eisstock-category-row.ui-list-row:hover {
    background: var(--panel-muted);
}

.eisstock-sponsor-row > :nth-child(n + 3),
.eisstock-category-row > :nth-child(2) {
    text-align: center;
}

.eisstock-sponsor-row .ui-list-actions,
.eisstock-category-row .ui-list-actions {
    justify-content: flex-end;
}

.eisstock-category-row .ui-list-actions form {
    margin: 0;
}

.eisstock-sponsor-status {
    font-weight: 700;
}

.eisstock-sponsor-status.is-laufend {
    color: var(--success, #31b76a);
}

.eisstock-sponsor-status.is-auslaufend {
    color: var(--accent);
}

.eisstock-sponsor-status.is-gekuendigt {
    color: var(--danger, #dc4c4c);
}

.eisstock-selected-event-form :is(input, select) {
    width: 100%;
    height: var(--form-control-height, 42px);
    margin: 0;
}

.eisstock-team-edit-form {
    margin: 18px 0 0;
}

.eisstock-team-list {
    overflow-x: auto;
}

.eisstock-team-row {
    grid-template-columns: minmax(260px, 1fr) minmax(200px, 300px) 92px;
    min-width: 650px;
}

.eisstock-team-row > :is(input, select) {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin: 0;
}

.eisstock-team-row .ui-list-actions {
    justify-content: flex-end;
}

.eisstock-group-tabs {
    margin-top: 18px;
}

.eisstock-group-panel .eisstock-standing-table {
    margin-bottom: 18px;
}

.eisstock-final-generate {
    margin: 0 0 18px;
}

.eisstock-game-table {
    overflow-x: auto;
    border: 1px solid var(--line);
}

.eisstock-game-row {
    display: grid;
    grid-template-columns: 72px minmax(210px, 1fr) minmax(350px, auto) 68px 188px minmax(150px, 210px) 46px;
    align-items: center;
    gap: 10px;
    min-width: 1200px;
    min-height: 62px;
    margin: 0;
    padding: 7px 10px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.eisstock-game-row.is-alternate {
    background: var(--panel-alt);
}

.eisstock-game-row.ui-list-row:hover {
    background: var(--panel-muted);
}

.eisstock-game-row.ui-list-header {
    min-height: var(--list-header-height, 42px);
    padding-block: 0;
}

.eisstock-game-row > input[type="text"] {
    width: 100%;
    height: 34px;
    margin: 0;
}

.eisstock-game-number strong,
.eisstock-game-number small {
    display: block;
}

.eisstock-game-number small,
.eisstock-game-pairing b {
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
}

.eisstock-inline-innings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eisstock-inline-innings label {
    display: grid;
    grid-template-columns: 14px 34px 7px 34px;
    align-items: center;
    gap: 3px;
    margin: 0;
}

.eisstock-inline-innings small {
    color: var(--muted);
    text-align: center;
}

.eisstock-inline-innings input {
    width: 34px;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 3px;
    text-align: center;
}

.eisstock-inline-total {
    color: var(--accent);
    text-align: center;
}

.eisstock-game-date {
    display: grid;
    grid-template-columns: minmax(108px, 1fr) 72px;
    gap: 5px;
}

.eisstock-game-date input {
    width: 100%;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding-inline: 5px;
}

.eisstock-game-save:not(.ui-icon-button--success) {
    border-color: var(--line);
    background: var(--panel-alt);
    color: var(--muted);
}

.eisstock-game-row.is-bye {
    color: var(--muted);
}

@media (max-width: 800px) {
    .eisstock-selected-event-form {
        grid-template-columns: 1fr 1fr;
    }

    .eisstock-selected-event-form > :first-of-type {
        grid-column: 1 / -1;
    }

    .eisstock-event-dialog-form,
    .eisstock-sponsor-form,
    .eisstock-sponsor-filters {
        grid-template-columns: 1fr;
    }

    .eisstock-event-dialog-form .span-2,
    .eisstock-sponsor-form .span-2 {
        grid-column: auto;
    }
}

/* Zweistufiger CSV-Kontaktimport */
.client-import-toolbar {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(240px, auto) minmax(320px, 1fr);
    align-items: end;
    gap: 20px;
    margin: 18px 0 24px;
}

.client-import-help {
    position: relative;
    align-self: end;
    min-height: var(--form-control-height, 42px);
}

.client-import-help > summary {
    display: flex;
    align-items: center;
    min-height: var(--form-control-height, 42px);
    color: var(--accent);
    cursor: pointer;
}

.client-import-help > p {
    position: absolute;
    z-index: 30;
    top: 100%;
    right: 0;
    width: min(480px, 80vw);
    margin: 5px 0 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--panel-raised, #25292d);
    box-shadow: 0 12px 28px rgba(0,0,0,.35);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.client-import-upload,
.client-import-batch-select {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 0;
}

.client-import-upload input[type="file"] {
    width: 100%;
    height: var(--form-control-height, 38px);
    padding: 5px 8px;
}

.client-import-batch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    background: var(--panel);
}

.client-import-batch-head h2,
.client-import-batch-head p {
    margin: 0;
}

.client-import-batch-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.client-import-batch-head form {
    margin: 0;
}

.client-import-filter {
    margin-bottom: 14px;
}

.client-import-list {
    overflow: visible;
    border: 1px solid var(--line);
}

.client-import-row {
    display: grid;
    grid-template-columns: 58px minmax(190px, 1.25fr) minmax(170px, 1fr) minmax(210px, 1.2fr) 105px;
    align-items: center;
    gap: var(--list-cell-gap, 12px);
    width: 100%;
    min-width: 780px;
    min-height: var(--list-row-height, 54px);
    padding: 0 var(--list-inline-padding, 12px);
}

.client-import-list-head {
    min-height: var(--list-header-height, 42px);
}

.client-import-entry {
    display: block;
    min-width: 780px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.client-import-entry.is-alternate {
    background: var(--panel-alt);
}

.client-import-entry:hover,
.client-import-entry:focus-within,
.client-import-entry[open] {
    background: var(--panel-muted);
}

.client-import-entry.has-error {
    border-left: 4px solid var(--danger, #d84b4b);
}

.client-import-entry > summary {
    list-style: none;
    cursor: pointer;
}

.client-import-entry > summary::-webkit-details-marker {
    display: none;
}

.client-import-entry > summary::after {
    content: "+";
    position: absolute;
    right: 12px;
    color: var(--accent);
    font-size: 18px;
}

.client-import-entry > summary {
    position: relative;
    padding-right: 38px;
}

.client-import-entry[open] > summary::after {
    content: "−";
}

.client-import-contact small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-import-contact small + small {
    margin-top: 3px;
    color: var(--muted);
}

.client-import-state {
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.client-import-state.is-importiert { color: var(--success, #45b86b); }
.client-import-state.is-fehler { color: var(--danger, #e45b5b); }
.client-import-state.is-ignoriert { color: var(--muted); }
.client-import-state.is-offen { color: var(--accent); }

.client-import-editor {
    padding: 18px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.client-import-match-hint {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 13px;
}

.client-import-match-hint > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.client-import-match-hint button {
    width: auto;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    background: var(--panel-muted);
    color: var(--text);
    font-size: 12px;
}

.client-import-match-hint button:hover,
.client-import-match-hint button:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.client-import-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.client-import-columns > section {
    min-width: 0;
}

.client-import-columns h3 {
    margin: 0 0 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}

.client-import-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.client-import-fields .span-2 {
    grid-column: span 2;
}

.client-import-decision {
    display: grid;
    grid-template-columns: minmax(230px, .8fr) minmax(300px, 1.2fr) auto;
    align-items: end;
    gap: 14px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.client-import-target {
    position: relative;
}

.client-import-target[hidden] {
    display: none;
}

.client-import-suggestions {
    position: absolute;
    z-index: 80;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--line);
    background: var(--panel-raised, #25292d);
    box-shadow: 0 12px 28px rgba(0,0,0,.35);
}

.client-import-suggestions button {
    display: block;
    width: 100%;
    height: auto;
    min-height: 52px;
    padding: 8px 11px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.client-import-suggestions button:hover,
.client-import-suggestions button:focus-visible {
    background: var(--panel-muted);
    color: var(--text);
}

.client-import-suggestions strong,
.client-import-suggestions small {
    display: block;
    text-align: left;
}

.client-import-suggestions small {
    margin-top: 3px;
    color: var(--muted);
}

.client-import-original {
    margin-top: 18px;
}

.client-import-original summary {
    color: var(--accent);
    cursor: pointer;
}

.client-import-original dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}

.client-import-original dl > div {
    min-width: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--line);
}

.client-import-original dt {
    color: var(--muted);
    font-size: 11px;
}

.client-import-original dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}

.client-import-result {
    margin: 0;
}

.client-import-result a {
    color: var(--accent);
}

@media (max-width: 900px) {
    .client-import-toolbar,
    .client-import-columns {
        grid-template-columns: 1fr;
    }

    .client-import-decision {
        grid-template-columns: 1fr 1fr;
    }

    .client-import-decision > button {
        grid-column: 2;
        justify-self: end;
    }
}

@media (max-width: 620px) {
    .client-import-upload,
    .client-import-batch-select,
    .client-import-decision,
    .client-import-fields {
        grid-template-columns: 1fr;
    }

    .client-import-fields .span-2,
    .client-import-decision > button {
        grid-column: auto;
    }

    .client-import-batch-head {
        align-items: stretch;
        flex-direction: column;
    }

    .client-import-match-hint {
        align-items: flex-start;
        flex-direction: column;
    }
}
