: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;
    --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 {
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    cursor: pointer;
    transition: background-color 120ms ease;
}

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

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

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

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

.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-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-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 {
    color: var(--accent);
    font-weight: 700;
}

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

.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-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: 38px;
    min-height: 38px;
    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-table .row-actions {
    justify-content: center;
}

.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 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) 38px;
    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: 36px;
    margin: 0;
}

.dashboard-routine-list button {
    grid-column: 2;
    grid-row: 1;
    width: 38px;
    padding: 0;
    color: #fff;
    background: var(--success);
    border-color: var(--success);
}

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

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

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

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

.statistics-page .statistics-actions .statistics-pdf-button {
    width: 34px;
    min-width: 34px;
    padding: 0;
    border-color: #d6d6d6;
    background: #fff;
    color: #d93636;
    font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1;
    white-space: nowrap;
}

.statistics-page .statistics-actions .statistics-pdf-button:hover {
    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);
}

.urgent-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 13px;
}

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

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

.mtask-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--accent-contrast);
    font-weight: 800;
}

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

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

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

.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: pre-wrap;
    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;
}

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

.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-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(220px, 1fr) 54px 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;
}

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

.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-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-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(220px, 0.8fr) minmax(260px, 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 {
    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;
}

.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: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) repeat(2, minmax(0, 1.35fr));
    gap: 14px;
    align-items: end;
}

.knowledge-filter-field {
    position: relative;
    display: grid;
    min-width: 0;
    gap: 7px;
}

.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%;
    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: 1fr 1fr;
    gap: 22px 18px;
}

.knowledge-create-grid > div {
    min-width: 0;
}

.knowledge-create-grid label {
    display: block;
    margin-bottom: 6px;
}

.knowledge-create-grid input,
.knowledge-create-grid select,
.knowledge-create-grid textarea {
    width: 100%;
}

.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-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-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: 920px;
    margin: 0 auto;
}

.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,
.personal-checklist-profile-head > form:first-child,
.personal-checklist-add-point,
.personal-checklist-point-edit {
    display: flex;
    align-items: end;
    gap: 10px;
}

.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: 38px;
    height: 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: 38px 28px minmax(0, 1fr) 38px;
    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-info {
    grid-column: 1 / -1;
}

.profile-message-compose textarea,
.profile-message-reply textarea {
    resize: vertical;
}

.profile-message-compose > form > button {
    grid-column: 3;
    grid-row: 1;
}

.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-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-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 span {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-week-duration {
    display: block;
    padding: 22px 17px 24px;
    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-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: 28px 84px minmax(220px, 1fr) minmax(110px, auto) 38px;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.dashboard-order-link {
    display: contents;
    color: inherit;
    text-decoration: none;
}

.dashboard-order-timer {
    grid-column: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.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-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 {
    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.is-clickable:hover {
    background: var(--accent-soft);
}

.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(--accent-soft);
}

.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-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: color-mix(in srgb, var(--accent) 13%, var(--panel));
    box-shadow: inset 4px 0 0 var(--accent);
}

.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;
    margin-bottom: 18px;
}

.client-search-form {
    display: flex;
    align-items: end;
    gap: 10px;
    margin-bottom: 18px;
}

.client-search-form > div {
    flex: 1 1 520px;
    max-width: 720px;
}

.client-search-form input[type="search"] {
    width: 100%;
    height: 42px;
    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: 42px;
    margin: 0;
}

.client-list-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    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 {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.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-count-link):not(.client-edit-button):hover,
.client-contact-quick-list a:hover {
    color: var(--accent);
}

.client-phone-summary {
    display: grid;
    gap: 3px;
}

.client-count-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--input);
    color: var(--accent);
    font-weight: 800;
}

.client-count-link:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.client-contact-button,
.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-contact-button {
    width: 62px;
}

.client-contact-button:hover,
.client-edit-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.contact-person-icon {
    position: relative;
    width: 17px;
    height: 17px;
}

.contact-person-icon::before {
    position: absolute;
    top: 0;
    left: 6px;
    width: 6px;
    height: 6px;
    border: 2px solid currentColor;
    border-radius: 50%;
    content: '';
}

.contact-person-icon::after {
    position: absolute;
    bottom: 0;
    left: 2px;
    width: 14px;
    height: 7px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    content: '';
}

.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-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: 760px) {
    .client-form-grid,
    .client-contact-form,
    .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-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 {
    overflow: hidden;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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-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: 34px;
    min-width: 34px;
    height: 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-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-deliverability ul {
    margin: 14px 0 0;
    padding-left: 20px;
    color: var(--muted);
}

.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;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 10px 30px #0006;
}

.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-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-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-block-editor {
    display: grid;
    gap: 12px;
}

.newsletter-block-list {
    display: grid;
    gap: 9px;
}

.newsletter-block {
    display: grid;
    grid-template-columns: 34px 145px minmax(180px, 1fr) minmax(160px, .7fr) minmax(130px, .6fr) minmax(180px, 1fr) 34px;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--panel-muted);
}

.newsletter-block.is-dragging {
    opacity: .55;
}

.newsletter-block textarea {
    min-height: 66px;
}

.newsletter-add-blocks,
.newsletter-form-actions,
.newsletter-send-actions,
.newsletter-send-actions > form,
.newsletter-recipient-selection {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.newsletter-add-blocks button {
    width: auto;
}

.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-block {
        grid-template-columns: 34px 140px 1fr 34px;
    }

    .newsletter-block textarea,
    .newsletter-block input {
        grid-column: 2 / 4;
    }
}

@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 {
        grid-template-columns: 1fr;
    }
}

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