: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="datetime-local"],
input[type="date"],
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 minmax(280px, 1.7fr) minmax(190px, 1fr) 150px 170px 90px;
    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;
}

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

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

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

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

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

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

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

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

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

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

.calendar-filters label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
}

.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-outside {
    background: var(--bg);
    color: var(--muted);
}

.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 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;
    margin-top: 20px;
}

@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-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 {
    min-height: 38px;
    padding: 3px;
    background: var(--panel);
}

.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) {
    .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 150px 54px;
    min-width: 1080px;
}

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

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

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

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

.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) 120px 120px;
    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-table .data-head {
    background: var(--panel-alt);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.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: 150px 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));
    margin-top: 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--panel-alt);
}

.client-detail-contacts > section {
    min-width: 0;
    padding: 16px 18px;
}

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

.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 170px 244px;
    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);
}

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

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

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

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

.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;
    gap: 20px;
    margin-bottom: 14px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

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

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

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

.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;
    grid-template-columns: minmax(140px, 0.8fr) minmax(210px, 1.2fr) minmax(170px, 1fr) minmax(190px, 1fr) 76px 86px 110px auto;
    gap: 12px;
    align-items: end;
}

.settings-status-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 76px auto;
    gap: 12px;
    align-items: end;
    width: 100%;
}

.internal-category-form-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 76px 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) 90px;
    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(240px, 1fr) minmax(190px, 0.6fr) 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-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 38px;
    align-items: end;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

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

.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 {
    height: 42px;
    margin-bottom: 14px;
    white-space: nowrap;
}

.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 {
    height: 42px;
    margin-bottom: 14px;
}

.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) 72px 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-edit-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 62px auto;
    gap: 10px;
    align-items: center;
}

.tag-edit-form input,
.tag-edit-form button {
    margin-bottom: 0;
}

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

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

.order-checklist h3 {
    margin: 0 0 5px;
    font-size: 18px;
}

.checklist-progress {
    color: var(--muted);
    font-size: 13px;
}

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

.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 {
    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: -2px 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 {
    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-reply-button:hover,
.note-entry .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;
}

.manual-time-entry {
    margin-bottom: 28px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fafbfc;
}

.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(210px, 1.3fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(160px, 0.9fr) 145px 172px;
    min-width: 1375px;
    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;
    justify-content: flex-end;
    gap: 6px;
}

.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-mark-button.is-active {
    border-color: var(--accent);
    background: var(--panel);
    color: var(--accent);
}

.production-mark-button.is-active svg {
    fill: currentColor;
}

.production-overview-detail-dialog {
    width: min(680px, calc(100vw - 32px));
}

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

.production-overview-header,
.production-overview-row {
    display: grid;
    grid-template-columns: 110px 170px 140px minmax(220px, 1.4fr) minmax(180px, 1fr) 170px 70px;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    min-width: 1120px;
    padding: 8px 14px;
}

.production-overview-header {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

.production-overview-row {
    color: inherit;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

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

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

.production-overview-row:hover,
.production-overview-row:focus-visible {
    background: var(--accent-soft);
}

.production-overview-row.is-urgent {
    border-left: 8px solid var(--danger);
    padding-left: 7px;
}

.production-overview-row > span,
.production-overview-row > strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.production-overview-row > span > i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--user-color);
}

.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-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 {
    margin-top: 12px;
}

.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: 140px minmax(210px, 1fr) 155px minmax(180px, 0.8fr) 245px 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-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-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-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: 170px 145px minmax(220px, 1fr) 130px 90px 135px minmax(180px, 0.7fr) 150px 125px minmax(260px, 1fr) 52px;
    gap: 14px;
    align-items: center;
    min-width: 1780px;
    min-height: 54px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    border-left: 5px solid var(--danger);
    background: var(--panel);
}

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

.knowledge-filters {
    display: grid;
    grid-template-columns: minmax(230px, 1.4fr) minmax(160px, .8fr) minmax(150px, .7fr) minmax(210px, 1fr) minmax(220px, 1fr) auto auto;
    align-items: end;
}

.knowledge-filters input,
.knowledge-filters select {
    width: 100%;
    margin-bottom: 0;
}

.knowledge-purchase-filter {
    position: relative;
}

.knowledge-library-results {
    min-width: 1120px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.knowledge-library-header,
.knowledge-library-row {
    display: grid;
    grid-template-columns: 150px minmax(230px, 1.5fr) minmax(220px, 1.2fr) minmax(190px, 1fr) 150px 48px;
    gap: 14px;
    align-items: center;
    padding: 10px 12px;
}

.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: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-download-link span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.knowledge-library-assignment a,
.knowledge-download-link {
    color: var(--accent);
}

.knowledge-library-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.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-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: 13px;
}

.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-create-wide {
    grid-column: 1 / -1;
}

@media (max-width: 1250px) {
    .knowledge-page {
        overflow-x: auto;
    }

    .knowledge-filters {
        grid-template-columns: repeat(3, minmax(190px, 1fr));
    }
}

.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-status-grid,
    .settings-material-art-grid,
    .settings-material-grid,
    .settings-time-category-grid {
        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="datetime-local"],
input[type="date"],
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-form {
    display: grid;
    gap: 18px;
}

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

.personal-checklist-management {
    margin-top: 18px;
}

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

.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-order-row {
    display: grid;
    grid-template-columns: 28px 84px minmax(220px, 1fr) minmax(110px, auto);
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.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: 88px minmax(220px, 1fr) 92px;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
}

.dashboard-worked-time {
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
}

.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 > 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 textarea {
    margin-bottom: 12px;
}

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

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

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

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

.client-row {
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    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 > 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: 0 14px;
    max-width: 1120px;
}

.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: 0 12px;
    align-items: end;
}

.client-contact-form input,
.client-contact-form button {
    margin-bottom: 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;
    }
}
