/* ==========================================================================
   Zentrales Designsystem
   - Drei Presets (Neutral, Ozean, Wald)
   - Jedes Preset besitzt einen hellen und dunklen Modus
   - Dynamische Typografie-Werte werden durch /admin/typography/styles.css
     überschrieben. Die Werte hier sind robuste Fallbacks.
   ========================================================================== */
:root {
    --pmh-type-body-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --pmh-type-body-size: 14px;
    --pmh-type-body-weight: 400;
    --pmh-type-body-line-height: 1.5;
    --pmh-type-heading-family: var(--pmh-type-body-family);
    --pmh-type-heading-size: 18px;
    --pmh-type-heading-weight: 700;
    --pmh-type-heading-line-height: 1.25;
    --pmh-type-control-family: var(--pmh-type-body-family);
    --pmh-type-control-size: 13px;
    --pmh-type-control-weight: 600;
    --pmh-type-control-line-height: 1.35;
    --pmh-type-table-family: var(--pmh-type-body-family);
    --pmh-type-table-size: 12px;
    --pmh-type-table-weight: 400;
    --pmh-type-table-line-height: 1.4;
    --pmh-type-label-family: var(--pmh-type-body-family);
    --pmh-type-label-size: 12px;
    --pmh-type-label-weight: 700;
    --pmh-type-label-line-height: 1.3;
    --pmh-type-meta-family: var(--pmh-type-body-family);
    --pmh-type-meta-size: 11px;
    --pmh-type-meta-weight: 400;
    --pmh-type-meta-line-height: 1.35;
}

body.theme-hell {
    --pmh-page-bg: #f3f5f7;
    --pmh-page-bg-accent: #e4e9ef;
    --pmh-surface: #ffffff;
    --pmh-surface-raised: #ffffff;
    --pmh-surface-soft: #edf1f5;
    --pmh-text: #1f2937;
    --pmh-text-muted: #52606d;
    --pmh-border: #c8d0d9;
    --pmh-border-strong: #9aa6b2;
    --pmh-accent: #245ea8;
    --pmh-accent-hover: #194a88;
    --pmh-accent-contrast: #ffffff;
    --pmh-danger: #a5261c;
    --pmh-nav-bg: #1e2936;
    --pmh-nav-text: #ffffff;
    --pmh-input-bg: #ffffff;
    --pmh-input-text: #17202b;
    --pmh-focus: #3478cf;
    --pmh-shadow: rgba(15, 23, 42, 0.13);
    --pmh-type-body-color: #1f2937;
    --pmh-type-heading-color: #111827;
    --pmh-type-control-color: #1f2937;
    --pmh-type-table-color: #1f2937;
    --pmh-type-label-color: #374151;
    --pmh-type-meta-color: #4b5563;
}

body.theme-dunkel {
    --pmh-page-bg: #14181e;
    --pmh-page-bg-accent: #222a33;
    --pmh-surface: #20262e;
    --pmh-surface-raised: #29313b;
    --pmh-surface-soft: #2e3742;
    --pmh-text: #f3f4f6;
    --pmh-text-muted: #c3ccd6;
    --pmh-border: #4b5663;
    --pmh-border-strong: #73808e;
    --pmh-accent: #79aff8;
    --pmh-accent-hover: #a5caff;
    --pmh-accent-contrast: #101820;
    --pmh-danger: #ffb4ab;
    --pmh-nav-bg: #0d1014;
    --pmh-nav-text: #ffffff;
    --pmh-input-bg: #171c22;
    --pmh-input-text: #f8fafc;
    --pmh-focus: #8bbdff;
    --pmh-shadow: rgba(0, 0, 0, 0.34);
    --pmh-type-body-color: #f3f4f6;
    --pmh-type-heading-color: #ffffff;
    --pmh-type-control-color: #f9fafb;
    --pmh-type-table-color: #f3f4f6;
    --pmh-type-label-color: #e5e7eb;
    --pmh-type-meta-color: #cbd5e1;
}

body.theme-blue-light {
    --pmh-page-bg: #edf6fb;
    --pmh-page-bg-accent: #d8edf7;
    --pmh-surface: #ffffff;
    --pmh-surface-raised: #f8fcfe;
    --pmh-surface-soft: #e2f1f7;
    --pmh-text: #102a43;
    --pmh-text-muted: #486581;
    --pmh-border: #b2d0df;
    --pmh-border-strong: #78a9bf;
    --pmh-accent: #086b8f;
    --pmh-accent-hover: #075574;
    --pmh-accent-contrast: #ffffff;
    --pmh-danger: #a5261c;
    --pmh-nav-bg: #0b3449;
    --pmh-nav-text: #ffffff;
    --pmh-input-bg: #ffffff;
    --pmh-input-text: #102a43;
    --pmh-focus: #0b7fa8;
    --pmh-shadow: rgba(8, 73, 101, 0.16);
    --pmh-type-body-color: #1f2937;
    --pmh-type-heading-color: #111827;
    --pmh-type-control-color: #1f2937;
    --pmh-type-table-color: #1f2937;
    --pmh-type-label-color: #374151;
    --pmh-type-meta-color: #4b5563;
}

body.theme-darkblue {
    --pmh-page-bg: #071923;
    --pmh-page-bg-accent: #123547;
    --pmh-surface: #102a38;
    --pmh-surface-raised: #17394a;
    --pmh-surface-soft: #1c4153;
    --pmh-text: #f0f9ff;
    --pmh-text-muted: #b8d9e8;
    --pmh-border: #396174;
    --pmh-border-strong: #64899a;
    --pmh-accent: #62c6e8;
    --pmh-accent-hover: #8bd8f1;
    --pmh-accent-contrast: #07202b;
    --pmh-danger: #ffb4ab;
    --pmh-nav-bg: #041017;
    --pmh-nav-text: #ffffff;
    --pmh-input-bg: #0b202b;
    --pmh-input-text: #f0f9ff;
    --pmh-focus: #76d4f2;
    --pmh-shadow: rgba(0, 0, 0, 0.38);
    --pmh-type-body-color: #f3f4f6;
    --pmh-type-heading-color: #ffffff;
    --pmh-type-control-color: #f9fafb;
    --pmh-type-table-color: #f3f4f6;
    --pmh-type-label-color: #e5e7eb;
    --pmh-type-meta-color: #cbd5e1;
}

body.theme-green-light {
    --pmh-page-bg: #eff7f1;
    --pmh-page-bg-accent: #dfeee3;
    --pmh-surface: #ffffff;
    --pmh-surface-raised: #f9fcfa;
    --pmh-surface-soft: #e4f0e7;
    --pmh-text: #193222;
    --pmh-text-muted: #4c6b57;
    --pmh-border: #b9d0c0;
    --pmh-border-strong: #82aa8e;
    --pmh-accent: #287a48;
    --pmh-accent-hover: #1e6238;
    --pmh-accent-contrast: #ffffff;
    --pmh-danger: #a5261c;
    --pmh-nav-bg: #173d26;
    --pmh-nav-text: #ffffff;
    --pmh-input-bg: #ffffff;
    --pmh-input-text: #193222;
    --pmh-focus: #358f58;
    --pmh-shadow: rgba(25, 77, 43, 0.15);
    --pmh-type-body-color: #1f2937;
    --pmh-type-heading-color: #111827;
    --pmh-type-control-color: #1f2937;
    --pmh-type-table-color: #1f2937;
    --pmh-type-label-color: #374151;
    --pmh-type-meta-color: #4b5563;
}

body.theme-darkgreen {
    --pmh-page-bg: #0d1c14;
    --pmh-page-bg-accent: #1d3a29;
    --pmh-surface: #183024;
    --pmh-surface-raised: #21402f;
    --pmh-surface-soft: #294b38;
    --pmh-text: #f1fbf4;
    --pmh-text-muted: #bed8c6;
    --pmh-border: #466c54;
    --pmh-border-strong: #70947b;
    --pmh-accent: #6acd8b;
    --pmh-accent-hover: #91dfaa;
    --pmh-accent-contrast: #102519;
    --pmh-danger: #ffb4ab;
    --pmh-nav-bg: #07120b;
    --pmh-nav-text: #ffffff;
    --pmh-input-bg: #10251a;
    --pmh-input-text: #f1fbf4;
    --pmh-focus: #7cdd9d;
    --pmh-shadow: rgba(0, 0, 0, 0.38);
    --pmh-type-body-color: #f3f4f6;
    --pmh-type-heading-color: #ffffff;
    --pmh-type-control-color: #f9fafb;
    --pmh-type-table-color: #f3f4f6;
    --pmh-type-label-color: #e5e7eb;
    --pmh-type-meta-color: #cbd5e1;
}

body[class*="theme-"] {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--pmh-page-bg) 72%, var(--pmh-page-bg-accent) 100%);
    color: var(--pmh-text);
}

body:is(.theme-hell, .theme-blue-light, .theme-green-light) {
    color-scheme: light;
}

body:is(.theme-dunkel, .theme-darkblue, .theme-darkgreen) {
    color-scheme: dark;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.login-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(39, 70, 144, 0.22), transparent 28%),
        radial-gradient(circle at bottom right, rgba(98, 140, 255, 0.16), transparent 24%),
        linear-gradient(145deg, #edf3ff 0%, #f7f2e8 52%, #eef6ef 100%);
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.login-card {
    width: min(100%, 400px);
    padding: 26px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(19, 34, 61, 0.12);
    box-shadow: 0 24px 60px rgba(31, 44, 77, 0.18);
    backdrop-filter: blur(16px);
}

.login-card__intro {
    margin-bottom: 14px;
}

.login-card__eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #5d6b8a;
}

.login-card__subtitle {
    margin: 0;
    color: #53627f;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-alert {
    margin: 0;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-field label {
    font-weight: 600;
    color: #2d3a56;
}

.login-field .form-control {
    min-height: 22px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(30, 48, 82, 0.16);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-field .form-control:focus {
    border-color: #274690;
    box-shadow: 0 0 0 0.2rem rgba(39, 70, 144, 0.14);
}

.login-submit {
    min-height: 44px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
}

.login-register-link {
    align-self: center;
    color: #274690;
    text-decoration: none;
    font-weight: 600;
}

.login-register-link:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .login-card {
        width: min(100%, 360px);
        padding: 22px 18px;
        border-radius: 20px;
    }
}

/* Global tooltip styling (JS-driven for cross-browser consistency) */
body.js-tooltips .has-tooltip[data-tooltip]::after,
body.js-tooltips .has-tooltip[data-tooltip]::before {
    display: none;
}

#global-tooltip {
    position: fixed;
    inset: auto auto auto auto;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    white-space: nowrap;
    z-index: 5000;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -6px);
    transition: opacity 0.12s ease;
}

#global-tooltip.is-visible {
    opacity: 1;
}

nav {
    background: #222;
    color: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

nav.main-nav {
    position: sticky;
    top: 0;
    z-index: 1500;
    padding: 0.6em;
    display: flex;
    align-items: center;
    gap: 0.9em;
    color: #fff;
}

.main-nav .nav-left,
.main-nav .nav-center,
.main-nav .nav-right {
    display: flex;
    align-items: center;
    gap: 0.6em;
    min-height: 64px;
}

.nav-clock {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
    padding: 2px 10px;
    margin-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.nav-clock-time {
    font-family: var(--pmh-type-control-family);
    font-size: var(--pmh-type-control-size);
    font-weight: var(--pmh-type-control-weight);
    line-height: var(--pmh-type-control-line-height);
    letter-spacing: 0.5px;
    color: #fff;
}

.main-nav .nav-clock .nav-clock-time {
    color: #fff;
}

.nav-clock-date {
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: var(--pmh-type-meta-weight);
    line-height: var(--pmh-type-meta-line-height);
    text-transform: capitalize;
    color: rgba(255, 255, 255, 0.8);
}

.main-nav .nav-clock .nav-clock-date {
    color: rgba(255, 255, 255, 0.8);
}

.main-nav .nav-left {
    position: relative;
    z-index: 1;
    justify-content: flex-start;
    min-width: 0;
}

.nav-account-menu {
    position: relative;
    flex: 0 0 auto;
}

.nav-account-menu>summary,
.nav-account-section>summary {
    list-style: none;
}

.nav-account-menu>summary::-webkit-details-marker,
.nav-account-section>summary::-webkit-details-marker {
    display: none;
}

.nav-avatar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    background: #f4f4f4;
    color: #191919;
    font-family: var(--pmh-type-control-family);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.nav-avatar-button:hover,
.nav-avatar-button:focus-visible,
.nav-account-menu[open]>.nav-avatar-button {
    border-color: #fff;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.nav-account-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 2500;
    width: min(350px, calc(100vw - 24px));
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 18px;
    background: #fff;
    color: #202020;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .24);
    font-family: var(--pmh-type-body-family);
    font-size: var(--pmh-type-body-size);
    font-weight: var(--pmh-type-body-weight);
    line-height: var(--pmh-type-body-line-height);
}

.nav-account-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid #ececec;
}

.nav-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 50%;
    background: #202020;
    color: #fff;
    font-weight: 700;
}

.nav-account-identity {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.nav-account-identity strong,
.nav-account-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-account-identity strong {
    font-size: 14px;
}

.nav-account-identity small {
    color: #6b6b6b;
    font-size: 12px;
}

.nav-account-section {
    border-bottom: 1px solid #ececec;
}

.nav-account-section>summary {
    position: relative;
    padding: 11px 30px 11px 10px;
    color: #505050;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
}

.nav-account-section>summary::after {
    content: '›';
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%) rotate(90deg);
    font-size: 18px;
    transition: transform .15s ease;
}

.nav-account-section[open]>summary::after {
    transform: translateY(-50%) rotate(-90deg);
}

.nav-account-section-body {
    display: grid;
    gap: 2px;
    padding: 0 0 8px;
}

.nav-account-item,
.nav-account-item:visited,
.nav-account-item-button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 11px;
    min-height: 48px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #202020;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.nav-account-item:hover,
.nav-account-item:focus-visible,
.nav-account-item-button:hover,
.nav-account-item-button:focus-visible {
    background: #f3f3f3;
    color: #111;
    outline: none;
}

.nav-account-item-icon {
    display: inline-flex;
    justify-content: center;
    width: 22px;
    flex: 0 0 22px;
    color: #555;
    font-size: 16px;
}

.nav-account-item>span:last-child,
.nav-account-item-button>span:last-child {
    display: grid;
    gap: 2px;
}

.nav-account-item strong,
.nav-account-item-button strong {
    font-size: 13px;
    font-weight: 600;
}

.nav-account-item small,
.nav-account-item-button small {
    color: #727272;
    font-size: 11px;
    line-height: 1.25;
}

.nav-account-logout,
.nav-account-logout:visited {
    display: block;
    margin-top: 4px;
    padding: 11px 10px;
    border-radius: 10px;
    color: #b42318;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.nav-account-logout:hover,
.nav-account-logout:focus-visible {
    background: #fff1f0;
    color: #8f1d14;
    outline: none;
}

@media (max-width: 1100px) {
    .nav-account-popover {
        position: fixed;
        top: 76px;
        right: 12px;
    }
}

.main-nav .nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(calc(-50% - 100px));
    z-index: 2;
    justify-content: center;
    padding: 0 10px;
}

.main-nav .nav-right {
    position: relative;
    z-index: 1;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
}

.checkout-indicator {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 220px;
    padding: 4px 7px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.checkout-indicator[hidden] { display: none; }

.checkout-stopwatch-title,
.checkout-stopwatch-controls { display: flex; align-items: center; gap: 5px; }
.checkout-stopwatch-title { min-width: 0; }

.icon-invert {
    filter: invert(1);
}

.checkout-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.checkout-timer {
    font-variant-numeric: tabular-nums;
    min-width: 67px;
    margin-right: auto;
}

.checkout-action-btn {
    width: 21px;
    height: 21px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .42);
    border-radius: 4px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

.checkout-action-btn:hover:not(:disabled),
.checkout-action-btn:focus-visible:not(:disabled) { background: rgba(255, 255, 255, .2); outline: 0; }
.checkout-action-btn:disabled { cursor: default; opacity: .42; }
.checkout-action-btn--finish { border-color: rgba(123, 229, 156, .75); color: #9ff0b7; }
}

.main-nav .main-nav-link {
    color: #fff;
    font-weight: 500;
}

.main-nav .main-nav-link:visited,
.main-nav .main-nav-link:hover,
.main-nav .main-nav-link:active {
    color: #fff;
}

/* Die Hauptnavigation liegt immer auf der schwarzen Kopfzeile. */
.main-nav .main-nav-link,
.main-nav .main-nav-link:visited,
.main-nav .main-nav-link:hover,
.main-nav .main-nav-link:active,
.main-nav .nav-user-link,
.main-nav .nav-user-logout,
.main-nav .nav-user-greeting,
.main-nav .theme-toggle-btn {
    color: #fff !important;
}

.nav-global-search {
    margin: 0 2px 0 0;
}

.nav-global-search input {
    width: 150px;
    min-height: 30px;
    padding: 4px 9px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 13px;
}

.nav-global-search input::placeholder { color: rgba(255, 255, 255, 0.72); }
.nav-global-search input:focus { width: 210px; outline: 2px solid rgba(255, 255, 255, 0.72); outline-offset: 1px; }

.nav-message-link,
.nav-message-link:visited {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
}

.nav-message-link:hover,
.nav-message-link:focus-visible {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, .65);
    outline-offset: 1px;
}

.nav-message-link svg {
    width: 21px;
    height: 21px;
}

.nav-message-badge {
    position: absolute;
    top: -4px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #222;
    border-radius: 999px;
    background: #d92d20;
    color: #fff;
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: 700;
    line-height: 1;
}

.nav-message-badge[hidden] {
    display: none;
}

.global-search-page { padding-top: 24px; padding-bottom: 32px; }
.global-search-page-form { display: flex; gap: 8px; margin-bottom: 20px; }
.global-search-results { display: grid; gap: 8px; }
.global-search-result {
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}
.global-search-result:hover { border-color: #0d6efd; color: inherit; background: rgba(13, 110, 253, .035); }
.global-search-result-meta { display: flex; gap: 8px; font-size: 12px; color: #667085; }
.global-search-result-excerpt { color: #667085; font-size: 13px; }
.global-search-result-target { color: #475467; font-size: 12px; }

@media (max-width: 1100px) {
    .nav-global-search input { width: 105px; }
    .nav-global-search input:focus { width: 150px; }
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
}

.nav-user-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    position: relative;
    line-height: 1;
}

.nav-user-link {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.nav-user-link:visited,
.nav-user-logout:visited {
    color: #fff;
}

.build-info {
    position: absolute;
    top: 3px;
    left: 8px;
    pointer-events: none;
    user-select: none;
}

.build-info-text {
    white-space: nowrap;
}

button,
.btn {
    border-radius: 6px;
    padding: 0.5em 1.2em;
    font-weight: 500;
    transition: background 0.2s;
}

body.theme-hell .btn-primary {
    background: #274690;
    color: #fff;
}

body.theme-dunkel .btn-primary {
    background: #444;
    color: #eaffea;
}

body.theme-darkblue .btn-primary {
    background: #0a2342;
    color: #eaf6ff;
}

body.theme-darkgreen .btn-primary {
    background: #3e5641;
    color: #eaffea;
}

/* Projekt-Details Grid */
.proj-fields-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

.proj-field {
    background: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proj-field .proj-label {
    font-weight: 600;
    opacity: .85;
}

.proj-field .proj-value {
    white-space: normal;
    word-break: break-word;
    flex: 1 1 auto;
}

.proj-field-full {
    grid-column: 1 / -1;
}

/* Neues Projekt: Form-Layout (ohne Bootstrap Grid) */
.project-new-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-new-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 820px) {
    .project-new-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.project-new-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.project-new-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.project-new-form .form-control,
.project-new-form .form-select,
.project-new-form input,
.project-new-form select,
.project-new-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.project-new-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.privacy-label {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-right: 6px;
}

.privacy-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.privacy-toggle__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.privacy-toggle__track {
    display: inline-block;
    width: 35px;
    height: 18px;
    background: #e74c3c;
    border-radius: 999px;
    position: relative;
    transition: background 0.2s ease;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.privacy-toggle__thumb {
    display: block;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.privacy-toggle__input:checked+.privacy-toggle__track {
    background: #2ecc71;
}

.privacy-toggle__input:checked+.privacy-toggle__track .privacy-toggle__thumb {
    transform: translateX(17px);
}

.privacy-toggle__input:focus-visible+.privacy-toggle__track {
    outline: 2px solid rgba(46, 204, 113, 0.5);
    outline-offset: 2px;
}

body.theme-dunkel .privacy-toggle__track,
body.theme-darkblue .privacy-toggle__track,
body.theme-darkgreen .privacy-toggle__track {
    background: #c0392b;
}

/* Action center in header */
.action-indicator-wrap {
    display: inline-flex;
    align-items: center;
    margin-left: 0;
}

.action-indicator {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.action-indicator:hover,
.action-indicator:focus-visible {
    transform: none;
}

.action-indicator__icon-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.action-indicator__icon {
    display: block;
    width: 50px;
    height: 59px;
    object-fit: contain;
}

.action-indicator__badge {
    left: 0%;
    bottom: 2px;
}


/* Kleine Icon-Buttons vereinheitlichen */
.btn-icon-xs {
    padding: 2px 6px;
    line-height: 1;
}

.icon-img-xs {
    /* 15% größer als Basis (14px) */
    width: var(--icon-size, calc(14px * 1.15));
    height: var(--icon-size, calc(14px * 1.15));
    display: inline-block;
    vertical-align: text-bottom;
    filter: none;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 1px;
}

.icon-img-xs.icon-img--dark-contrast {
    object-fit: contain;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body:is(.theme-dunkel, .theme-darkblue, .theme-darkgreen) .icon-img-xs.icon-img--dark-contrast {
    background: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.icon-click {
    cursor: pointer;
}

.icon-text-btn {
    /* 5% größer */
    font-weight: 700;
    font-size: calc(12px * 1.05);
    display: inline-block;
    line-height: 1;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 1px 3px;
}

/* Dashboard: "P+" (neues Projekt) soll 3x größer sein */
.icon-text-btn.pplus-btn {
    font-size: 1.5em;
    line-height: 1.1;
    padding: 4px 8px;
}

/* Dark themes: etwas hellere Rahmenfarbe für Kontrast */
body.theme-dunkel .icon-img-xs,
body.theme-darkblue .icon-img-xs,
body.theme-darkgreen .icon-img-xs,
body.theme-dunkel .icon-text-btn,
body.theme-darkblue .icon-text-btn,
body.theme-darkgreen .icon-text-btn {
    border-color: rgba(255, 255, 255, 0.25);
}

/* ToDo list layout: title left, action icon right */
.dashboard-widget[data-widget-id="todo"] {
    font-family: var(--pmh-type-body-family);
    font-size: var(--pmh-type-body-size);
    font-weight: var(--pmh-type-body-weight);
    line-height: var(--pmh-type-body-line-height);
}

.dashboard-widget[data-widget-id="todo"] .dashboard-widget-handle {
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-label-size);
    font-weight: var(--pmh-type-label-weight);
    line-height: var(--pmh-type-label-line-height);
    color: var(--pmh-type-label-color, inherit);
}

.dashboard-widget[data-widget-id="todo"] .overview-body--todos .todo-header {
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-label-size);
    font-weight: var(--pmh-type-label-weight);
    line-height: var(--pmh-type-label-line-height);
    color: var(--pmh-type-label-color, inherit);
}

.dashboard-widget[data-widget-id="todo"] .overview-body--todos .todo-hours {
    font-family: var(--pmh-type-table-family);
    font-size: var(--pmh-type-table-size);
    font-weight: var(--pmh-type-table-weight);
    line-height: var(--pmh-type-table-line-height);
}

.overview-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.overview-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}

.overview-list .todo-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
    white-space: normal;
}

.overview-list .todo-title.todo-title-cell {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    overflow: visible;
    white-space: normal;
}

.overview-list .todo-title-text {
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.todo-kind-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 14px;
    padding: 1px 4px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.todo-kind-badge--task {
    background: #d9f4df;
    color: #185b2d;
}

.todo-kind-badge--spontan {
    background: #ffe8bd;
    color: #7a4a00;
}

.todo-kind-badge--project {
    background: #d8e7ff;
    color: #194c8a;
}

.note-timesheet-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-left: 6px;
    border-radius: 999px;
    background: #d8e7ff;
    color: #194c8a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.note-timesheet-badge--compact {
    margin-left: 0;
    padding: 1px 5px;
}

.overview-list .todo-date {
    flex: 0 0 auto;
}

/* Dashboard ToDo list: columns + drag handle */
.overview-body--todos .todo-cols,
.overview-body--todos #todos-list .todo-row {
    display: grid !important;
    grid-template-columns: 18px minmax(0, 1fr) var(--todo-date-width, 72px) var(--todo-delivery-width, 92px) var(--todo-hours-width, 68px) var(--todo-actions-width, 44px) !important;
    align-items: center;
    gap: 8px;
}

.overview-body--todos .todo-drag,
.overview-body--todos .todo-drag-handle {
    grid-column: 1;
}

.overview-body--todos .todo-title {
    grid-column: 2;
}

.overview-body--todos .todo-date {
    grid-column: 3;
}

.overview-body--todos .todo-delivery {
    grid-column: 4;
}

.overview-body--todos .todo-hours {
    grid-column: 5;
}

.overview-body--todos .todo-actions {
    grid-column: 6;
}

.overview-body--todos #todos-list .todo-row--interactive {
    cursor: pointer;
}

.overview-body--todos #todos-list .todo-row--interactive:hover,
.overview-body--todos #todos-list .todo-row--interactive:focus-visible {
    background: rgba(0, 0, 0, 0.045);
    outline: none;
}

body.theme-dunkel .overview-body--todos #todos-list .todo-row--interactive:hover,
body.theme-dunkel .overview-body--todos #todos-list .todo-row--interactive:focus-visible,
body.theme-darkblue .overview-body--todos #todos-list .todo-row--interactive:hover,
body.theme-darkblue .overview-body--todos #todos-list .todo-row--interactive:focus-visible,
body.theme-darkgreen .overview-body--todos #todos-list .todo-row--interactive:hover,
body.theme-darkgreen .overview-body--todos #todos-list .todo-row--interactive:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.overview-body--todos .todo-header {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.55);
    padding: 0 0 4px 0;
}

body.theme-dunkel .overview-body--todos .todo-header,
body.theme-darkblue .overview-body--todos .todo-header,
body.theme-darkgreen .overview-body--todos .todo-header {
    color: rgba(255, 255, 255, 0.65);
}

.overview-body--todos .todo-drag-handle {
    cursor: grab;
    user-select: none;
    opacity: 0.7;
}

.overview-body--todos .todo-drag-handle:active {
    cursor: grabbing;
}

.overview-body--todos .todo-hours {
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.overview-body--todos .todo-date {
    width: var(--todo-date-width, 72px);
    min-width: var(--todo-date-width, 72px);
}

.overview-body--todos .todo-delivery {
    width: var(--todo-delivery-width, 92px);
    min-width: var(--todo-delivery-width, 92px);
}

.overview-body--todos .todo-hours {
    width: var(--todo-hours-width, 96px);
    min-width: var(--todo-hours-width, 96px);
}

.overview-body--todos .todo-actions {
    width: var(--todo-actions-width, 44px);
    min-width: var(--todo-actions-width, 44px);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    justify-self: end;
    margin-left: auto;
}

/* „Dringend"-Button (Flamme) in der Title-Zelle */
.overview-body--todos .todo-urgent-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    padding: 0 4px 0 0;
    margin: 0;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.35);
    line-height: 1;
    vertical-align: middle;
}

body.theme-dunkel .overview-body--todos .todo-urgent-toggle,
body.theme-darkblue .overview-body--todos .todo-urgent-toggle,
body.theme-darkgreen .overview-body--todos .todo-urgent-toggle {
    color: rgba(255, 255, 255, 0.45);
}

.overview-body--todos .todo-urgent-toggle:hover {
    color: #d2392f;
}

.overview-body--todos .todo-urgent-toggle.is-active {
    color: #d2392f;
}

.overview-body--todos #todos-list .todo-row.is-urgent {
    background: rgba(210, 57, 47, 0.10);
    border-left: 3px solid #d2392f;
    padding-left: 5px;
}

.overview-body--todos #todos-list .todo-row.is-urgent:hover,
.overview-body--todos #todos-list .todo-row.is-urgent:focus-visible {
    background: rgba(210, 57, 47, 0.16);
}

body.theme-dunkel .overview-body--todos #todos-list .todo-row.is-urgent,
body.theme-darkblue .overview-body--todos #todos-list .todo-row.is-urgent,
body.theme-darkgreen .overview-body--todos #todos-list .todo-row.is-urgent {
    background: rgba(232, 90, 80, 0.18);
}

body.theme-dunkel .overview-body--todos #todos-list .todo-row.is-urgent:hover,
body.theme-darkblue .overview-body--todos #todos-list .todo-row.is-urgent:hover,
body.theme-darkgreen .overview-body--todos #todos-list .todo-row.is-urgent:hover {
    background: rgba(232, 90, 80, 0.26);
}

/* Ausgeklappter Projektbereich: eingerückter Kasten mit Leitlinie */
.proj-details {
    position: relative;
    margin-left: 28px;
    width: calc(100% - 28px);
    box-sizing: border-box;
    /* Einrückung nach rechts */
    display: none;
    /* standardmäßig eingeklappt */
}

.proj-details.show {
    display: block;
}

/* Aufgabenliste unter dem Projekt, mit Leitlinie analog zu Details */
.proj-tasks {
    position: relative;
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding-left: 28px;
    padding-right: 12px;
    box-sizing: border-box;
    overflow-x: auto;
    /* allow horizontal scroll for wide task tables */
}

.proj-tasks::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(39, 70, 144, 0.6);
    border-radius: 1px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.tasks-head {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, auto);
    gap: 0;
    padding: 4px 0;
    color: #666;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

body.theme-dunkel .tasks-head,
body.theme-darkblue .tasks-head,
body.theme-darkgreen .tasks-head {
    color: #aaa;
}

.tasks-head>div {
    padding: 0 8px;
    opacity: .85;
    min-width: 0;
    box-sizing: border-box;
}

.table-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    text-align: left;
    cursor: pointer;
}

.table-sort-trigger--static {
    cursor: default;
}

.table-sort-trigger--end {
    justify-content: flex-end;
    text-align: right;
}

.table-sort-label {
    min-width: 0;
}

.table-sort-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10px;
    font-size: 10px;
    line-height: 1;
}

.table-sort-arrow.is-inactive {
    opacity: 0.25;
}

.task-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, auto);
    gap: 0;
    align-items: start;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.06);
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

body.theme-dunkel .task-row,
body.theme-darkblue .task-row,
body.theme-darkgreen .task-row {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.task-row>div {
    padding: 0 8px;
    min-width: 0;
    box-sizing: border-box;
}

.task-row>div+div {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-dunkel .task-row>div+div,
body.theme-darkblue .task-row>div+div,
body.theme-darkgreen .task-row>div+div {
    border-left-color: rgba(255, 255, 255, 0.12);
}

.task-col-desc {
    min-width: 0;
    max-width: none;
}

.task-col-comment {
    min-width: 0;
    max-width: none;
    color: #666;
}

.task-desc-view,
.task-comment-view {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.task-desc-input,
.task-comment-input {
    width: 100%;
}

.task-col-estimated,
.task-col-due,
.task-col-prio {
    white-space: nowrap;
}

body.theme-dunkel .task-col-comment,
body.theme-darkblue .task-col-comment,
body.theme-darkgreen .task-col-comment {
    color: #aaa;
}

body.theme-dunkel .task-meta,
body.theme-darkblue .task-meta,
body.theme-darkgreen .task-meta {
    color: #aaa;
}

.task-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.tasks-head>div[data-col="actions"],
.task-row>div[data-col="actions"] {
    min-width: 132px;
}

.task-actions-view,
.task-actions-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.task-actions-view .icon-img-xs,
.task-actions-view .icon-text-btn,
.task-actions-edit .icon-img-xs,
.task-actions-edit .icon-text-btn {
    flex: 0 0 auto;
}

.btn-icon-xxs {
    padding: 2px 6px;
    line-height: 1;
}

/* Kopf letzte Spalte rechtsbündig */
.tasks-head>div:last-child {
    text-align: right;
}

/* Einzeiliges Aufgabenformular */
.task-form-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Aufgaben-Badge Toggle-Icon */
.tasks-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-right: 6px;
}

.twisty-icon {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid currentColor;
    display: inline-block;
    transition: transform 0.15s ease;
}

.tasks-toggle.open .twisty-icon {
    transform: rotate(90deg);
}

.proj-details::before {
    /* vertikaler Strich links als Zugehörigkeitsindikator */
    content: '';
    position: absolute;
    left: -14px;
    /* vor dem Kasten */
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(39, 70, 144, 0.6);
    /* dezent in Primärfarbe */
    border-radius: 1px;
}

.proj-details .task-collapse {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-left: 4px solid #274690;
    /* Akzent links am Kasten */
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
}

body.theme-dunkel .proj-details .task-collapse,
body.theme-darkblue .proj-details .task-collapse,
body.theme-darkgreen .proj-details .task-collapse {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

/* Projektliste: Spalten optisch trennen */
.projects-table thead th+th {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.projects-table tbody td+td {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}

.projects-table tbody tr+tr td {
    border-top: 1px dashed rgba(0, 0, 0, 0.06);
}

body.theme-dunkel .projects-table thead th+th,
body.theme-darkblue .projects-table thead th+th,
body.theme-darkgreen .projects-table thead th+th,
body.theme-dunkel .projects-table tbody td+td,
body.theme-darkblue .projects-table tbody td+td,
body.theme-darkgreen .projects-table tbody td+td {
    border-left-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .projects-table tbody tr+tr td,
body.theme-darkblue .projects-table tbody tr+tr td,
body.theme-darkgreen .projects-table tbody tr+tr td {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.projects-col-w-110 {
    width: 110px;
}

.projects-col-w-80 {
    width: 80px;
}

.projects-col-w-90 {
    width: 90px;
}

.projects-col-w-100 {
    width: 100px;
}

.projects-col-w-120 {
    width: 120px;
}

.projects-col-w-130 {
    width: 130px;
}

.projects-col-w-140 {
    width: 140px;
}

.projects-col-w-150 {
    width: 150px;
}

.projects-col-w-160 {
    width: 160px;
}

.projects-col-w-210 {
    width: 210px;
}

.projects-col-w-220 {
    width: 220px;
}

.projects-col-w-260 {
    width: 260px;
}

.tasks-empty-note {
    padding: 4px 8px;
}

/* Edit-Grid analog zur Ansicht */
.proj-edit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
}

.proj-edit-grid .proj-field .proj-value>input,
.proj-edit-grid .proj-field .proj-value>select,
.proj-edit-grid .proj-field .proj-value>textarea {
    width: 100%;
}

/* Task-Anzahl Badge vor Projekttitel */
.task-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #274690;
    border-radius: 999px;
}

body.theme-dunkel .task-badge,
body.theme-darkblue .task-badge,
body.theme-darkgreen .task-badge {
    background: #6ea8fe;
    color: #0a2342;
}

.task-form-wrap {
    border: 1px dashed rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.02);
}

body.theme-dunkel .task-form-wrap,
body.theme-darkblue .task-form-wrap,
body.theme-darkgreen .task-form-wrap {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.03);
}

/* Nachrichten-Widget (oben rechts) */
.messages-widget {
    width: 100%;
    max-width: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.theme-dunkel .messages-widget,
body.theme-darkblue .messages-widget,
body.theme-darkgreen .messages-widget {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
}

.messages-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* Wenn ungelesene Chats existieren: Header leicht akzentuieren */
.messages-widget.has-unread .messages-header {
    background: rgba(220, 53, 69, 0.08);
}

body.theme-dunkel .messages-widget.has-unread .messages-header,
body.theme-darkblue .messages-widget.has-unread .messages-header,
body.theme-darkgreen .messages-widget.has-unread .messages-header {
    background: rgba(220, 53, 69, 0.18);
}

body.theme-dunkel .messages-header,
body.theme-darkblue .messages-header,
body.theme-darkgreen .messages-header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.messages-header .msg-icon {
    width: 16px;
    height: 16px;
    opacity: .8;
}

.messages-header .msg-refresh {
    margin-left: auto;
    border: none;
    background: transparent;
    padding: 2px;
}

.messages-header .msg-refresh img {
    width: 14px;
    height: 14px;
    opacity: .8;
}

.messages-inner {
    display: grid;
    grid-template-columns: 180px 1fr;
    height: 260px;
    min-height: 260px;
}

.messages-sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow: hidden;
}

.messages-sidebar .sidebar-search {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.messages-sidebar .sidebar-list {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

body.theme-dunkel .messages-sidebar,
body.theme-darkblue .messages-sidebar,
body.theme-darkgreen .messages-sidebar {
    border-right-color: rgba(255, 255, 255, 0.12);
}

.sidebar-item {
    display: block;
    text-align: left;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.sidebar-item .name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-item .name .label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-item .meta {
    font-size: 50%;
    opacity: .7;
}

.sidebar-item.active {
    background: rgba(39, 70, 144, 0.08);
}

/* Nachrichten: Statuspunkt + ungelesen fett */
.presence-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}

.presence-dot.online {
    background: #28a745;
}

.presence-dot.offline {
    background: #adb5bd;
}

.sidebar-item.unread .name {
    font-weight: 800;
}

/* Ungelesen: zusätzlich über Farben hervorheben */
.sidebar-item.unread {
    background: rgba(220, 53, 69, 0.06);
    border-left: 3px solid rgba(220, 53, 69, 0.55);
    padding-left: 7px;
}

.sidebar-item.unread .label {
    color: #dc3545;
}

.sidebar-item.unread:hover {
    background: rgba(220, 53, 69, 0.10);
}

.sidebar-item.unread.active {
    background: rgba(220, 53, 69, 0.14);
}

body.theme-dunkel .sidebar-item.unread,
body.theme-darkblue .sidebar-item.unread,
body.theme-darkgreen .sidebar-item.unread {
    background: rgba(220, 53, 69, 0.14);
    border-left-color: rgba(220, 53, 69, 0.75);
}

body.theme-dunkel .sidebar-item.unread .label,
body.theme-darkblue .sidebar-item.unread .label,
body.theme-darkgreen .sidebar-item.unread .label {
    color: #ff6b7a;
}

.sidebar-item .unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    min-width: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
}

/* Dark themes: ensure readable light text for user list */
body.theme-dunkel .messages-widget .sidebar-item,
body.theme-darkblue .messages-widget .sidebar-item,
body.theme-darkgreen .messages-widget .sidebar-item {
    color: rgba(255, 255, 255, 0.9);
}

body.theme-dunkel .messages-widget .sidebar-item .name,
body.theme-darkblue .messages-widget .sidebar-item .name,
body.theme-darkgreen .messages-widget .sidebar-item .name {
    color: rgba(255, 255, 255, 0.95);
}

.messages-main {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 0;
}

.messages-body {
    overflow-y: auto;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.msg-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.msg-row.mine {
    align-items: flex-end;
}

/* Nachrichtentext ohne Bubble-Hintergrund */
.msg-bubble {
    display: inline-flex;
    flex-direction: column;
    width: auto;
    max-width: 100%;
    margin: 2px 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    align-self: flex-start;
    line-height: 1.2;
    box-sizing: border-box;
}

.msg-bubble.mine {
    background: transparent;
    color: inherit;
    align-self: flex-end;
}

.msg-content {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 69%;
    line-height: 1.2;
}

/* Name + Uhrzeit: kleiner und unterhalb des Ovals */
.msg-meta {
    margin-top: 2px;
    font-size: 8px;
    opacity: .75;
    white-space: nowrap;
}

body.theme-dunkel .msg-bubble {
    background: transparent;
}

body.theme-dunkel .msg-bubble.mine {
    background: transparent;
    color: inherit;
}

/* Day separator */
.day-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: .7;
    margin: 10px 0;
    font-size: 12px;
}

.day-sep::before,
.day-sep::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
}

body.theme-dunkel .day-sep::before,
body.theme-dunkel .day-sep::after,
body.theme-darkblue .day-sep::before,
body.theme-darkblue .day-sep::after,
body.theme-darkgreen .day-sep::before,
body.theme-darkgreen .day-sep::after {
    background: rgba(255, 255, 255, 0.2);
}

.messages-form {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-dunkel .messages-form,
body.theme-darkblue .messages-form,
body.theme-darkgreen .messages-form {
    border-top-color: rgba(255, 255, 255, 0.12);
}

.messages-form input[type="text"] {
    flex: 1 1 auto;
    min-width: 120px;
}

.messages-form .msg-send {
    border: none;
    background: transparent;
    padding: 2px 6px;
}

.messages-form .msg-send img {
    width: 16px;
    height: 16px;
}

/* Responsiv: bei sehr schmalen Viewports kleinere Breite, damit nichts überläuft */
@media (max-width: 420px) {
    .msg-bubble {
        max-width: 100%;
    }
}

@media (min-width: 1200px) {
    .messages-widget .msg-bubble {
        max-width: 70%;
    }

    .messages-widget .msg-bubble.mine {
        max-width: 70%;
    }
}

/* Übersichtspanel links von Nachrichtenfenster */
.dashboard-overview-panel {
    width: 100%;
    height: 260px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top panels row */
.dashboard-top-panels {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.dashboard-top-panels>* {
    min-width: 0;
}

/* Use grow ratios instead of fixed % widths so gap doesn't cause overflow */
.dashboard-top-panels .dashboard-overview-panel {
    flex: 3 1 0;
    max-width: none;
}

.dashboard-top-panels .messages-widget {
    flex: 2 1 0;
    max-width: none;
}

@media (max-width: 900px) {
    .dashboard-top-panels {
        flex-direction: column;
    }

    .dashboard-top-panels .dashboard-overview-panel,
    .dashboard-top-panels .messages-widget {
        flex: 0 0 auto;
        max-width: 100%;
    }
}

body.theme-dunkel .dashboard-overview-panel,
body.theme-darkblue .dashboard-overview-panel,
body.theme-darkgreen .dashboard-overview-panel {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-overview-panel header {
    padding: 6px 10px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-dunkel .dashboard-overview-panel header,
body.theme-darkblue .dashboard-overview-panel header,
body.theme-darkgreen .dashboard-overview-panel header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.dashboard-overview-panel .overview-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    min-height: 0;
}

.overview-body--todos {
    overflow: hidden;
}

/* Dashboard: Rahmen-Panel (wie ToDo/Nachrichten) */
.dashboard-panel {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

body.theme-dunkel .dashboard-panel,
body.theme-darkblue .dashboard-panel,
body.theme-darkgreen .dashboard-panel {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.15);
}

.dashboard-panel header {
    padding: 6px 10px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dashboard-panel header:empty {
    display: none;
}

body.theme-dunkel .dashboard-panel header,
body.theme-darkblue .dashboard-panel header,
body.theme-darkgreen .dashboard-panel header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.dashboard-panel .panel-body {
    padding: 10px;
}

.dashboard-panel.dashboard-panel--compact .panel-body {
    padding: 2px 6px;
}

.project-create-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
}

.project-create-table td {
    border: 0;
    padding: 0;
    vertical-align: middle;
}

.project-create-table .project-create-left {
    white-space: nowrap;
}

.project-create-table .project-create-right {
    text-align: left;
}

.project-create-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.project-create-divider {
    display: inline-block;
    width: 1px;
    height: 30px;
    background: rgba(0, 0, 0, 0.2);
}

body.theme-dunkel .project-create-divider,
body.theme-darkblue .project-create-divider,
body.theme-darkgreen .project-create-divider {
    background: rgba(255, 255, 255, 0.3);
}

.project-create-icons-table {
    border-collapse: separate;
    border-spacing: 0;
    border: 0;
    margin: 0;
}

.project-create-icons-table td {
    border: 0;
    padding: 0;
    vertical-align: middle;
    width: 1%;
    white-space: nowrap;
}

.project-view-trigger {
    text-decoration: none;
}

.project-view-icon-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.project-view-count-badge {
    position: absolute;
    bottom: 0;
    left: -40%;
    height: 18px;
    min-width: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff3b30;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.action-indicator__icon-wrap .action-indicator__badge {
    left: auto;
    right: calc(-12% - 15px);
    bottom: 2px;
}

/* Bald fällig Button */
.soondue-btn-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #333);
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: background 0.15s ease;
}

.soondue-btn-label:hover {
    background: rgba(255, 59, 48, 0.08);
}

.soondue-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    height: 20px;
    min-width: 20px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff3b30;
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

.action-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-project-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    text-decoration: none;
    background: rgba(58, 136, 254, 0.1);
    color: #21446f;
    font-weight: 700;
    line-height: 1;
}

.action-project-tag:hover,
.action-project-tag:focus-visible {
    background: rgba(58, 136, 254, 0.18);
}

.action-project-tag__count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff3b30;
    color: #fff;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

body.theme-dunkel .action-project-tag,
body.theme-darkblue .action-project-tag,
body.theme-darkgreen .action-project-tag {
    background: rgba(255, 255, 255, 0.12);
    color: #f2f5fb;
}

#projects-overview-pane .projects-overview-field {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 12px;
    overflow: visible;
}

#projects-overview-pane.dashboard-projects-initializing .projects-overview-field {
    visibility: hidden;
}

body.theme-dunkel #projects-overview-pane .projects-overview-field,
body.theme-darkblue #projects-overview-pane .projects-overview-field,
body.theme-darkgreen #projects-overview-pane .projects-overview-field {
    border-color: rgba(255, 255, 255, 0.14);
}

#projects-overview-pane .projects-overview-field .table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

#projects-overview-pane .projects-overview-field .projects-table {
    width: 100% !important;
    table-layout: auto;
}

#projects-overview-pane .projects-overview-field .projects-table th[data-col],
#projects-overview-pane .projects-overview-field .projects-table td[data-col] {
    width: auto !important;
}

.proj-detail-wrap .proj-view-section {
    display: block;
}

.proj-detail-wrap .proj-edit-section {
    display: none;
}

.proj-detail-wrap.editing .proj-view-section {
    display: none;
}

.proj-detail-wrap.editing .proj-edit-section {
    display: block;
}

.task-form-field-description {
    min-width: 240px;
    flex: 1 1 320px;
}

.task-form-field-comment {
    min-width: 160px;
    flex: 1 1 200px;
}

.task-form-field-estimated {
    width: 110px;
    flex: 0 0 auto;
}

.task-form-field-due {
    width: 150px;
    flex: 0 0 auto;
}

.task-form-field-assigned {
    width: 160px;
    flex: 0 0 auto;
}

.task-form-field-priority {
    width: 140px;
    flex: 0 0 auto;
}

.privacy-toggle.privacy-toggle--compact {
    margin: 0 8px;
}

#projects-window-pane {
    display: none;
}

#projects-window-frame {
    width: 100%;
    min-height: 960px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    background: transparent;
    padding: 8px;
    overflow-x: auto;
}

body.theme-dunkel #projects-window-frame,
body.theme-darkblue #projects-window-frame,
body.theme-darkgreen #projects-window-frame {
    border-color: rgba(255, 255, 255, 0.15);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.modal-backdrop.show {
    display: flex;
}

.modal-card {
    background: #fff;
    color: #222;
    border-radius: 8px;
    min-width: 320px;
    max-width: 90vw;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.modal-card--todo-detail {
    width: min(1120px, 96vw);
}

.todo-detail-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.todo-detail-tabs[hidden] {
    display: none;
}

.todo-detail-tab {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 10px 14px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    color: inherit;
    opacity: 0.72;
}

.todo-detail-tab.is-active {
    background: rgba(0, 0, 0, 0.06);
    opacity: 1;
}

body.theme-dunkel .todo-detail-tabs,
body.theme-darkblue .todo-detail-tabs,
body.theme-darkgreen .todo-detail-tabs {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .todo-detail-tab.is-active,
body.theme-darkblue .todo-detail-tab.is-active,
body.theme-darkgreen .todo-detail-tab.is-active {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dunkel .modal-card,
body.theme-darkblue .modal-card,
body.theme-darkgreen .modal-card {
    background: #2b2b2b;
    color: #f0f0f0;
}

.modal-card header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.dashboard-modal-header {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 52px;
}

.dashboard-modal-header--compact {
    grid-template-columns: auto minmax(0, 1fr);
}

.dashboard-modal-header__label {
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-modal-header__subtitle {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-modal-close-mac {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff5f57;
    color: rgba(80, 18, 15, 0.88);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.dashboard-modal-close-mac span {
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    color: #111;
    opacity: 0;
    transition: opacity 0.14s ease;
}

.dashboard-modal-close-mac:hover,
.dashboard-modal-close-mac:focus-visible {
    transform: scale(1.06);
    filter: saturate(1.06);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 95, 87, 0.16);
    outline: 0;
}

.dashboard-modal-close-mac:hover span,
.dashboard-modal-close-mac:focus-visible span {
    color: #000;
    opacity: 1;
}

body.theme-dunkel .modal-card header,
body.theme-darkblue .modal-card header,
body.theme-darkgreen .modal-card header {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

body.theme-dunkel .dashboard-modal-close-mac,
body.theme-darkblue .dashboard-modal-close-mac,
body.theme-darkgreen .dashboard-modal-close-mac {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.modal-card .modal-body {
    padding: 12px 14px;
    display: grid;
    gap: 10px;
}

.modal-card .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 10px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

body.theme-dunkel .modal-card .modal-actions,
body.theme-darkblue .modal-card .modal-actions,
body.theme-darkgreen .modal-card .modal-actions {
    border-top-color: rgba(255, 255, 255, 0.15);
}

.todo-detail-modal-body {
    max-height: 82vh;
    overflow: auto;
}

/* Aktion-Detail: Single-Page-Layout (kein Tabs-Switcher) */
.modal-card--todo-detail:not(.modal-card--entity-detail) {
    width: min(1400px, 99vw);
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tabs {
    display: none;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) header {
    padding: 6px 12px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .dashboard-modal-header {
    grid-template-columns: auto auto minmax(180px, 1fr) auto minmax(180px, 0.8fr);
    gap: 8px;
    min-height: 42px;
    align-items: start;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .dashboard-modal-header__subtitle {
    display: none;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .dashboard-modal-header__label {
    display: none;
}

.todo-detail-header-fields {
    display: contents;
}

.todo-detail-header-fields > .todo-detail-title-card {
    min-width: 0;
    width: 100%;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 21px;
    line-height: 1.15;
}

.todo-detail-header-fields > .todo-detail-edit-toggle {
    margin-left: 0;
}

.todo-detail-header-comment {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    max-width: 100%;
    gap: 3px;
}

.todo-detail-header-comment > .todo-detail-info-card,
.todo-detail-header-comment > .todo-detail-direct-textarea {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 54px;
    max-height: 220px;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 13px;
}

.todo-detail-header-comment > .todo-detail-direct-textarea {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.todo-detail-direct-textarea {
    resize: both;
    overflow: auto;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.todo-detail-header-comment > .todo-detail-edit-toggle {
    flex: 0 0 auto;
}

.todo-detail-header-comment .todo-detail-edit-input {
    min-height: 36px;
    max-height: 160px;
    resize: vertical;
}

@media (max-width: 920px) {
    .modal-card--todo-detail:not(.modal-card--entity-detail) .dashboard-modal-header {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
    }

    .todo-detail-header-comment {
        display: none !important;
    }
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-form.todo-detail-modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 12px 10px;
    max-height: 80vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="overview"] {
    display: flex !important;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    overflow: visible;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="notes"] {
    display: flex !important;
    flex-direction: column;
    flex: 0 0 auto;
    border: 1.5px solid rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.025);
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="notes"] #todo-detail-notes-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 6px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="notes"] #todo-detail-notes-section>.form-row:has(#note-list) {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="notes"] #note-form {
    flex: 0 0 auto;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="time"] {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    border: 1.5px solid rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.025);
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="finish"],
.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-panel--legacy-finish {
    display: none !important;
}

/* Reihenfolge im overview-readonly: Kopfdaten zuerst, dann Aktionen, Titel, Kommentar */
.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly>.form-row {
    order: 5;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly>.todo-detail-title-row {
    order: 1;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly>.todo-detail-due-row {
    order: 2;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly>.form-row:has(#todo-detail-actions) {
    order: 3;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly>.form-row#todo-detail-comment-row {
    order: 4;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-overview-readonly>.todo-detail-disclosure-row {
    order: 5;
}

/* Kompakte Form-Rows */
.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel .form-row {
    margin: 0;
    gap: 2px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel .form-row>.form-label {
    text-align: left;
    margin: 0;
    font-size: 11px;
    line-height: 1.2;
    opacity: 0.75;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel .todo-detail-info-row {
    gap: 2px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel .todo-detail-info-card {
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    box-shadow: none;
    font-size: 13px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel .todo-detail-info-card--compact {
    min-height: 26px;
    padding: 3px 8px;
}

/* Kopfdaten in kompakten, nebeneinanderliegenden Feldern. */
.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-overview-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.todo-detail-overview-grid--meta {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-overview-field .form-label {
    font-size: 11px;
    opacity: 0.7;
    margin: 0;
}

/* Aktionen-Toolbar Höhe reduzieren */
.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions {
    padding: 4px 8px;
    min-height: 32px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions .todo-detail-actions-tools {
    gap: 4px;
}

.todo-detail-title-card {
    display: block;
    width: 100%;
    padding: 6px 2px 2px;
    font-size: clamp(24px, 2.2vw, 32px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.todo-detail-title-line {
    display: flex;
    align-items: baseline;
    gap: 12px;
    width: 100%;
}

.todo-detail-title-line .todo-detail-title-card {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.todo-detail-due-card {
    font-size: 15px;
    font-weight: 600;
}

.todo-detail-edit-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 3px 5px;
    cursor: pointer;
    flex: 0 0 auto;
    height: 24px;
    width: 24px;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.todo-detail-edit-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.18);
}

.todo-detail-edit-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.todo-detail-edit-toggle img {
    display: block;
}

.todo-detail-editable-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.todo-detail-editable-row>.todo-detail-info-card,
.todo-detail-editable-row>.todo-detail-comment-card {
    flex: 1 1 auto;
    min-width: 0;
}

.todo-detail-title-line .todo-detail-edit-toggle {
    align-self: center;
}

.todo-detail-actions-menu {
    position: relative;
    flex: 0 0 auto;
}

.todo-detail-actions-toggle {
    width: 18px;
    height: 28px;
    padding: 0 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.todo-detail-actions-toggle:hover,
.todo-detail-actions-toggle:focus-visible {
    color: #0d6efd;
    outline: 0;
}

.todo-detail-actions-menu-panel {
    position: absolute;
    z-index: 10;
    top: calc(100% + 5px);
    left: 0;
    width: max-content;
    max-width: min(360px, 80vw);
    padding: 7px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.todo-detail-actions-menu-panel[hidden] {
    display: none;
}

.todo-detail-time-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

.todo-detail-time-columns > .todo-detail-disclosure-row:first-child {
    grid-column: 1 / -1;
}

.todo-detail-time-columns > .todo-detail-tab-panel[data-todo-panel="time"] {
    min-width: 0;
    margin: 0;
}

@media (max-width: 820px) {
    .modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-overview-grid,
    .modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-overview-grid--meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .todo-detail-time-columns {
        grid-template-columns: 1fr;
    }
}

.todo-detail-actions-menu-panel .todo-detail-actions-tools {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
}

.todo-detail-actions-menu-panel .todo-detail-action {
    justify-content: flex-start;
    min-height: 28px;
    padding: 4px 6px;
}

.todo-detail-actions-menu-panel .todo-detail-visibility-inline {
    width: auto;
    margin: 2px 4px 6px;
}

body.theme-dunkel .todo-detail-actions-menu-panel,
body.theme-darkblue .todo-detail-actions-menu-panel,
body.theme-darkgreen .todo-detail-actions-menu-panel {
    background: #2b2b2b;
    border-color: rgba(255, 255, 255, 0.16);
}

.todo-detail-edit-input {
    width: 100%;
    font: inherit;
}

textarea.todo-detail-edit-input {
    resize: vertical;
    min-height: 60px;
}

.todo-detail-disclosure {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.025);
    overflow: hidden;
}

.todo-detail-disclosure-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px;
    font-size: 12px;
    font-weight: 700;
}

.todo-detail-disclosure-summary-text {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.todo-detail-disclosure-summary-meta {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

body.theme-dunkel .todo-detail-disclosure-summary-meta,
body.theme-darkblue .todo-detail-disclosure-summary-meta,
body.theme-darkgreen .todo-detail-disclosure-summary-meta {
    background: rgba(255, 255, 255, 0.12);
}

.todo-detail-disclosure-card {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.todo-detail-tab-panel--persistent {
    display: block;
    min-height: 0;
}

.todo-detail-timesheet-list {
    max-height: 220px;
    overflow: auto;
}

.todo-detail-timesheet-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.todo-detail-timesheet-table th,
.todo-detail-timesheet-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    vertical-align: top;
}

.todo-detail-timesheet-table th:first-child,
.todo-detail-timesheet-table td:first-child {
    width: 130px;
}

.todo-detail-timesheet-table th:last-child,
.todo-detail-timesheet-table td:last-child {
    width: 90px;
    text-align: right;
}

.todo-detail-timesheet-note {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
}

.todo-detail-timesheet-hours {
    font-weight: 700;
    white-space: nowrap;
}

/* Notizen: Liste füllt die Höhe, Editor kompakt */
.modal-card--todo-detail:not(.modal-card--entity-detail) #note-list.todo-detail-note-list {
    flex: 0 0 auto;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #note-text.form-control {
    min-height: 70px;
    height: auto;
    max-height: 240px;
    padding: 4px 8px;
    font-size: 12px;
    resize: both;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-note {
    resize: both;
    max-width: none;
    position: relative;
    z-index: 2;
}

.todo-detail-header-comment,
.modal-card--todo-detail:not(.modal-card--entity-detail) #note-form,
.modal-card--todo-detail:not(.modal-card--entity-detail) #time-note-row {
    overflow: visible;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-note-editor {
    display: grid;
    gap: 4px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) .todo-detail-tab-panel[data-todo-panel="notes"] .todo-detail-note-actions {
    padding: 2px 0 0;
    margin: 0;
    border-top: none;
    justify-content: flex-end;
}

/* Zeit-Eintragung: 3 Spalten, Label kompakt oben links über Input */
.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form.todo-detail-embedded-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 10px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 14px 28px;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    min-width: 0;
    box-sizing: border-box;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form .form-row>.form-label {
    text-align: left;
    font-size: 11px;
    line-height: 14px;
    opacity: 0.75;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    align-self: start;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form input,
.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form select {
    height: 28px;
    min-height: 28px;
    padding: 2px 6px;
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-self: stretch;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form .todo-detail-info-card {
    height: 28px;
    min-height: 28px;
    padding: 2px 8px;
    font-size: 13px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    align-self: stretch;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form .modal-actions {
    grid-column: 1 / -1;
    border-top: none;
    padding: 4px 0 0;
    justify-content: flex-end;
    gap: 6px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form #time-note-row {
    grid-column: 1 / -1;
    grid-template-rows: 14px auto;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #time-form #time-note {
    min-height: 36px;
    height: 36px;
    max-height: 240px;
    padding: 4px 8px;
    font-size: 12px;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    resize: both;
    align-self: start;
    justify-self: start;
}

/* Aktionen-Toolbar kompakter */
.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions {
    padding: 4px 8px;
    min-height: 30px;
    gap: 6px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions .todo-detail-actions-tools {
    gap: 4px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions .todo-detail-action {
    padding: 2px 6px;
    min-height: 26px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions .todo-detail-close-btn {
    padding: 2px 10px;
    font-size: 12px;
    min-height: 26px;
}

.modal-card--todo-detail:not(.modal-card--entity-detail) #todo-detail-actions .privacy-toggle {
    transform: scale(0.85);
    transform-origin: left center;
}


.modal-card--entity-detail {
    width: min(980px, 96vw);
}

.entity-detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.entity-detail-modal-body {
    max-height: 84vh;
    overflow: auto;
    padding: 18px;
}

.entity-detail-grid-card {
    align-items: stretch;
}

.entity-detail-input-card {
    width: 100%;
    align-items: stretch;
}

.entity-detail-input-card--textarea {
    display: block;
}

.entity-detail-input-card--toggle {
    justify-content: flex-start;
}

.entity-detail-inline-control {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    min-height: auto;
}

.entity-detail-inline-control:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.entity-detail-inline-control.form-select {
    padding-right: 22px;
}

.entity-detail-inline-control.form-control:disabled,
.entity-detail-inline-control.form-select:disabled,
.entity-detail-inline-control.form-control[readonly] {
    opacity: 1;
    background: transparent;
    color: inherit;
    cursor: default;
}

.entity-detail-inline-control--title {
    font-size: 18px;
    font-weight: 600;
}

.entity-detail-inline-textarea {
    min-height: 112px;
    resize: vertical;
}

.entity-detail-inline-textarea--compact {
    min-height: 92px;
}

.entity-detail-inline-toggle {
    padding: 2px 0;
}

.entity-detail-edit-grid--secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.entity-detail-state {
    min-height: 16px;
}

.entity-detail-shell {
    display: grid;
    gap: 18px;
}

.entity-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.entity-detail-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.68;
}

.entity-detail-heading {
    margin: 4px 0 0;
    font-size: 24px;
    line-height: 1.15;
}

.entity-detail-sub {
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.72;
}

.entity-detail-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.entity-detail-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.entity-detail-icon-btn:hover {
    background: rgba(255, 255, 255, 0.94);
}

.entity-detail-icon-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.entity-detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.entity-detail-meta-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.03);
}

.entity-detail-meta-label {
    font-size: 11px;
    opacity: 0.65;
    margin-bottom: 4px;
}

.entity-detail-meta-value {
    font-size: 14px;
    font-weight: 600;
}

.entity-detail-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.entity-detail-field {
    display: grid;
    gap: 6px;
}

.entity-detail-field--wide,
.entity-detail-field--full {
    grid-column: 1 / -1;
}

.entity-detail-field-label {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.82;
}

.entity-detail-textarea {
    min-height: 120px;
    resize: vertical;
}

.entity-detail-field--checkbox {
    align-content: end;
}

.entity-detail-field--checkbox .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.entity-detail-form [data-entity-detail-input="1"]:disabled {
    opacity: 1;
    background: rgba(0, 0, 0, 0.035);
    color: inherit;
    cursor: default;
}

.entity-detail-state {
    min-height: 16px;
}

body.theme-dunkel .entity-detail-icon-btn,
body.theme-darkblue .entity-detail-icon-btn,
body.theme-darkgreen .entity-detail-icon-btn {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dunkel .entity-detail-icon-btn:hover,
body.theme-darkblue .entity-detail-icon-btn:hover,
body.theme-darkgreen .entity-detail-icon-btn:hover {
    background: rgba(255, 255, 255, 0.09);
}

body.theme-dunkel .entity-detail-meta-card,
body.theme-darkblue .entity-detail-meta-card,
body.theme-darkgreen .entity-detail-meta-card {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dunkel .entity-detail-form [data-entity-detail-input="1"]:disabled,
body.theme-darkblue .entity-detail-form [data-entity-detail-input="1"]:disabled,
body.theme-darkgreen .entity-detail-form [data-entity-detail-input="1"]:disabled {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {

    .entity-detail-meta-grid,
    .entity-detail-form-grid,
    .entity-detail-edit-grid--secondary {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {

    .entity-detail-hero,
    .entity-detail-modal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .entity-detail-heading {
        font-size: 20px;
    }

    .entity-detail-toolbar {
        justify-content: flex-end;
    }
}

.todo-detail-tab-panel {
    display: none;
    gap: 10px;
}

.todo-detail-tab-panel.is-active {
    display: grid;
}

.todo-detail-type-strip {
    display: flex;
    justify-content: flex-end;
}

.todo-detail-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.08);
}

.todo-detail-type-badge--task {
    background: #d9f4df;
    color: #185b2d;
}

.todo-detail-type-badge--spontan {
    background: #ffe8bd;
    color: #7a4a00;
}

.todo-detail-type-badge--project {
    background: #d8e7ff;
    color: #194c8a;
}

body.theme-dunkel .todo-detail-type-badge,
body.theme-darkblue .todo-detail-type-badge,
body.theme-darkgreen .todo-detail-type-badge {
    color: #111;
}

.form-row.todo-detail-form-row--stacked {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.form-row.todo-detail-form-row--stacked .form-label {
    margin-bottom: 2px;
}

.todo-detail-info-row {
    gap: 6px;
}

.todo-detail-overview-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.todo-detail-overview-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.todo-detail-overview-field .form-label {
    margin-bottom: 0;
}

.todo-detail-info-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.todo-detail-info-card--compact {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
}

body.theme-dunkel .todo-detail-info-card,
body.theme-darkblue .todo-detail-info-card,
body.theme-darkgreen .todo-detail-info-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

@media (max-width: 820px) {
    .todo-detail-overview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .todo-detail-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .todo-detail-overview-grid {
        grid-template-columns: 1fr;
    }
}

.todo-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.todo-detail-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.todo-detail-actions-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.todo-detail-visibility-inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.todo-detail-comment-card {
    display: block;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.4;
}

.todo-detail-close-btn {
    margin-left: auto;
}

.todo-detail-visibility-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.todo-convert-shell {
    display: grid;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 252, 0.96)),
        radial-gradient(circle at top right, rgba(255, 214, 102, 0.18), transparent 42%);
}

.todo-convert-header-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
}

.todo-convert-header-copy {
    display: grid;
    gap: 0;
}

.todo-convert-header-field {
    display: grid;
    gap: 0;
}

.todo-convert-target-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.todo-convert-inline-picker {
    display: grid;
    gap: 4px;
    margin-top: 6px;
}

.todo-convert-inline-picker .form-label {
    margin: 0;
    font-size: 11px;
    opacity: 0.75;
}

.todo-convert-inline-picker .form-select {
    min-height: 30px;
    height: 30px;
    padding: 3px 8px;
    font-size: 12px;
}

.todo-convert-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.todo-convert-subtitle {
    display: none;
}

.todo-convert-target-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    padding: 2px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
}

.todo-convert-target-option {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.todo-convert-target-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.todo-convert-target-option span {
    display: block;
    min-width: 90px;
    padding: 4px 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.78);
    transition: background 0.18s ease, color 0.18s ease;
}

.todo-convert-target-option input:checked+span {
    background: #fff;
    color: #14213d;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.todo-convert-icon-action {
    min-height: 30px;
    padding: 3px 6px;
}

.todo-convert-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
}

.todo-convert-card {
    display: grid;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
}

.todo-convert-card .form-label {
    font-size: 11px;
    margin: 0;
    opacity: 0.75;
}

.todo-convert-card .form-control,
.todo-convert-card .form-select {
    min-height: 26px;
    height: 26px;
    padding: 2px 6px;
    font-size: 12px;
    box-sizing: border-box;
}

.todo-convert-card--wide {
    grid-column: 1 / -1;
}

.todo-convert-card--toggle {
    align-content: space-between;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.todo-convert-card--toggle>div {
    min-width: 0;
}

.todo-convert-card--accent {
    background: linear-gradient(135deg, rgba(226, 244, 255, 0.96), rgba(255, 255, 255, 0.94));
    border-color: rgba(56, 189, 248, 0.2);
}

.todo-convert-card-title {
    font-size: 12px;
    font-weight: 700;
}

.todo-convert-card-note {
    display: none;
}

.todo-convert-textarea {
    min-height: 48px;
    height: 48px;
    max-height: 120px;
    resize: vertical;
}

.todo-convert-textarea--compact {
    min-height: 36px;
    height: 36px;
}

.todo-convert-actions {
    padding: 4px 0 0;
    border-top: 0;
    justify-content: flex-end;
}

.todo-convert-submit {
    min-width: 120px;
    border-radius: 8px;
    padding-inline: 14px;
    font-weight: 700;
}

body.theme-dunkel .todo-convert-shell,
body.theme-darkblue .todo-convert-shell,
body.theme-darkgreen .todo-convert-shell {
    border-color: rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(37, 37, 37, 0.94), rgba(30, 30, 30, 0.98)),
        radial-gradient(circle at top right, rgba(255, 214, 102, 0.14), transparent 42%);
}

body.theme-dunkel .todo-convert-header-card,
body.theme-darkblue .todo-convert-header-card,
body.theme-darkgreen .todo-convert-header-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

body.theme-dunkel .todo-convert-target-switch,
body.theme-darkblue .todo-convert-target-switch,
body.theme-darkgreen .todo-convert-target-switch {
    background: rgba(255, 255, 255, 0.08);
}

body.theme-dunkel .todo-convert-target-option span,
body.theme-darkblue .todo-convert-target-option span,
body.theme-darkgreen .todo-convert-target-option span {
    color: rgba(255, 255, 255, 0.78);
}

body.theme-dunkel .todo-convert-target-option input:checked+span,
body.theme-darkblue .todo-convert-target-option input:checked+span,
body.theme-darkgreen .todo-convert-target-option input:checked+span {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: none;
}

body.theme-dunkel .todo-convert-card,
body.theme-darkblue .todo-convert-card,
body.theme-darkgreen .todo-convert-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

body.theme-dunkel .todo-convert-card--accent,
body.theme-darkblue .todo-convert-card--accent,
body.theme-darkgreen .todo-convert-card--accent {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(255, 255, 255, 0.05));
    border-color: rgba(56, 189, 248, 0.18);
}

.dashboard-target-highlight {
    animation: dashboardTargetPulse 2.2s ease;
}

@keyframes dashboardTargetPulse {
    0% {
        background-color: rgba(255, 214, 102, 0);
        box-shadow: none;
    }

    20% {
        background-color: rgba(255, 214, 102, 0.32);
        box-shadow: inset 0 0 0 1px rgba(179, 120, 0, 0.25);
    }

    100% {
        background-color: rgba(255, 214, 102, 0);
        box-shadow: none;
    }
}

.todo-detail-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    cursor: pointer;
}

.todo-detail-action-label {
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.todo-detail-action--push {
    border-color: rgba(176, 43, 43, 0.25);
    background: rgba(176, 43, 43, 0.08);
}

.todo-detail-action--push .icon-text-btn {
    color: #b02b2b;
    font-weight: 700;
}

.todo-detail-action-toast {
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(34, 139, 34, 0.12);
    color: #1f7a1f;
    font-size: 12px;
    line-height: 1.3;
    transition: opacity 0.2s ease;
}

.todo-detail-action-toast[hidden] {
    display: none;
}

body.theme-dunkel .todo-detail-action-toast,
body.theme-darkblue .todo-detail-action-toast,
body.theme-darkgreen .todo-detail-action-toast {
    background: rgba(80, 200, 120, 0.18);
    color: #b6e7c0;
}

body.theme-dunkel .todo-detail-action,
body.theme-darkblue .todo-detail-action,
body.theme-darkgreen .todo-detail-action {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dunkel .todo-detail-disclosure,
body.theme-darkblue .todo-detail-disclosure,
body.theme-darkgreen .todo-detail-disclosure {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

body.theme-dunkel .todo-detail-disclosure-card,
body.theme-darkblue .todo-detail-disclosure-card,
body.theme-darkgreen .todo-detail-disclosure-card,
body.theme-dunkel .todo-detail-timesheet-table th,
body.theme-dunkel .todo-detail-timesheet-table td,
body.theme-darkblue .todo-detail-timesheet-table th,
body.theme-darkblue .todo-detail-timesheet-table td,
body.theme-darkgreen .todo-detail-timesheet-table th,
body.theme-darkgreen .todo-detail-timesheet-table td {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.action-status-icon--done {
    color: #2f6b52;
}

.action-status-icon--done:hover {
    color: #255440;
}

.todo-detail-notes-section {
    display: grid;
    gap: 12px;
}

.todo-detail-note-list {
    max-height: 260px;
    overflow: auto;
}

@media (max-width: 640px) {
    .dashboard-modal-header {
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 6px;
    }

    .dashboard-modal-header__label {
        grid-column: 2;
    }

    .dashboard-modal-header__subtitle {
        grid-column: 1 / -1;
    }
}

.todo-detail-notes-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.todo-detail-notes-table th,
.todo-detail-notes-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-align: left;
    vertical-align: top;
}

.todo-detail-notes-table th {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    font-size: 12px;
}

body.theme-dunkel .todo-detail-notes-table th,
body.theme-darkblue .todo-detail-notes-table th,
body.theme-darkgreen .todo-detail-notes-table th {
    background: #2b2b2b;
}

body.theme-dunkel .todo-detail-notes-table th,
body.theme-dunkel .todo-detail-notes-table td,
body.theme-darkblue .todo-detail-notes-table th,
body.theme-darkblue .todo-detail-notes-table td,
body.theme-darkgreen .todo-detail-notes-table th,
body.theme-darkgreen .todo-detail-notes-table td {
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.todo-detail-notes-table th:first-child,
.todo-detail-notes-table td:first-child {
    width: 42px;
    text-align: center;
}

.todo-detail-notes-table th:nth-child(2),
.todo-detail-notes-table td:nth-child(2) {
    width: 150px;
}

.todo-detail-notes-table th:last-child,
.todo-detail-notes-table td:last-child {
    width: 72px;
}

.todo-note-text-cell {
    white-space: pre-wrap;
    word-break: break-word;
}

.todo-note-meta {
    font-size: 12px;
    opacity: 0.75;
}

.todo-note-flag-col,
.todo-note-flag-cell {
    text-align: center;
    white-space: nowrap;
}

.todo-note-flag-empty {
    display: inline-block;
    width: 1px;
}

.todo-note-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.todo-note-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
    padding: 0;
}

body.theme-dunkel .todo-note-action,
body.theme-darkblue .todo-note-action,
body.theme-darkgreen .todo-note-action {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.todo-detail-note-editor {
    display: grid;
    gap: 10px;
}

.todo-detail-embedded-form {
    display: grid;
    gap: 10px;
}

.todo-detail-tab-actions {
    padding-right: 0;
    padding-left: 0;
}

.todo-detail-note-actions {
    padding: 0;
    border-top: 0;
}

body.theme-dunkel .todo-detail-note-actions,
body.theme-darkblue .todo-detail-note-actions,
body.theme-darkgreen .todo-detail-note-actions {
    border-top: 0;
}

@media (max-width: 720px) {

    .overview-body--todos .todo-cols,
    .overview-body--todos #todos-list .todo-row {
        grid-template-columns: 18px minmax(0, 1fr) var(--todo-delivery-width, 92px) var(--todo-actions-width, 44px) !important;
    }

    .overview-body--todos .todo-drag,
    .overview-body--todos .todo-drag-handle {
        grid-column: 1;
    }

    .overview-body--todos .todo-title {
        grid-column: 2;
    }

    .overview-body--todos .todo-delivery {
        grid-column: 3;
    }

    .overview-body--todos .todo-actions {
        grid-column: 4;
    }

    .overview-body--todos .todo-date,
    .overview-body--todos .todo-hours,
    .overview-body--todos .todo-header .todo-date,
    .overview-body--todos .todo-header .todo-hours {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .todo-convert-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .todo-convert-target-switch {
        width: 100%;
    }

    .todo-convert-target-option span {
        min-width: 0;
    }

    .todo-convert-grid {
        grid-template-columns: 1fr;
    }

    .todo-convert-card,
    .todo-convert-card--wide {
        grid-column: auto;
    }

    .todo-convert-submit {
        width: 100%;
    }

    .todo-detail-notes-table,
    .todo-detail-notes-table thead,
    .todo-detail-notes-table tbody,
    .todo-detail-notes-table tr,
    .todo-detail-notes-table th,
    .todo-detail-notes-table td {
        display: block;
    }

    .todo-detail-notes-table thead {
        display: none;
    }

    .todo-detail-notes-table tr {
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        padding: 8px 0;
    }

    body.theme-dunkel .todo-detail-notes-table tr,
    body.theme-darkblue .todo-detail-notes-table tr,
    body.theme-darkgreen .todo-detail-notes-table tr {
        border-bottom-color: rgba(255, 255, 255, 0.12);
    }

    .todo-detail-notes-table th:first-child,
    .todo-detail-notes-table td:first-child,
    .todo-detail-notes-table th:nth-child(2),
    .todo-detail-notes-table td:nth-child(2),
    .todo-detail-notes-table th:last-child,
    .todo-detail-notes-table td:last-child {
        width: auto;
    }

    .todo-detail-notes-table th,
    .todo-detail-notes-table td {
        border-bottom: 0;
        padding: 4px 0;
    }
}

.form-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    gap: 8px;
}

.form-row .form-label {
    font-weight: 600;
}

.form-row input[type="time"],
.form-row select,
.form-row input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: transparent;
    color: inherit;
}

body.theme-dunkel .form-row input,
body.theme-darkblue .form-row input,
body.theme-darkgreen .form-row input,
body.theme-dunkel .form-row select,
body.theme-darkblue .form-row select,
body.theme-darkgreen .form-row select {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Dashboard widgets: Variante A (Drag&Drop Reorder) */
.dashboard-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
}

.dashboard-widgets>* {
    min-width: 0;
}

.dashboard-widget {
    min-width: 0;
}

.dashboard-widget--half {
    flex: 1 1 520px;
}

.dashboard-widget[data-widget-id="todo"].dashboard-widget--half {
    flex: 3 1 0;
}

.dashboard-widget[data-widget-id="messages"].dashboard-widget--half {
    flex: 2 1 0;
}

.dashboard-widget--full {
    flex: 1 1 100%;
}

.dashboard-widget-handle {
    cursor: grab;
    user-select: none;
}

.dashboard-widget.is-dragging {
    opacity: 0.85;
}

@media (max-width: 900px) {
    .dashboard-widget--half {
        flex: 1 1 100%;
    }
}

.overview-todo-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-widget[data-widget-id="todo"] .dashboard-overview-panel {
    min-height: 312px;
}

.overview-list-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    margin: 0 0 4px 0;
    padding: 0 2px 6px 0;
}

.spontan-input-bar {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    padding: 6px 0 0 0;
    border-top: 1px solid rgba(0, 0, 0, 0.15);
}

body.theme-dunkel .spontan-input-bar,
body.theme-darkblue .spontan-input-bar,
body.theme-darkgreen .spontan-input-bar {
    background: rgba(0, 0, 0, 0.25);
    border-top-color: rgba(255, 255, 255, 0.25);
}

body.theme-dunkel .overview-list-scroll,
body.theme-darkblue .overview-list-scroll,
body.theme-darkgreen .overview-list-scroll {
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

body.theme-dunkel .spontan-input-bar,
body.theme-darkblue .spontan-input-bar,
body.theme-darkgreen .spontan-input-bar {
    background: transparent;
}

.overview-section {
    margin-bottom: 6px;
}

.overview-section h6 {
    margin: 0 0 2px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    opacity: .7;
}

.overview-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.overview-list li {
    padding: 2px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
    font-size: 11px;
}

body.theme-dunkel .overview-list li,
body.theme-darkblue .overview-list li,
body.theme-darkgreen .overview-list li {
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* Table layout panel styles */
.tl-listbox {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.70);
    width: 100%;
    box-sizing: border-box;
}

select.tl-listbox {
    padding: 6px;
}

body.theme-dunkel .tl-listbox,
body.theme-darkblue .tl-listbox,
body.theme-darkgreen .tl-listbox {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.18);
}

.tl-width-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tl-width-label {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.tl-width-hint {
    font-size: 11px;
    opacity: 0.65;
    line-height: 1.2;
}

.tl-width-current {
    font-size: 11px;
    opacity: 0.75;
    line-height: 1.2;
}

.tl-width {
    width: 100%;
}

/* User bearbeiten: Tabellenlayout ohne Bootstrap */
.user-edit-tablelayout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 1180px) {
    .user-edit-tablelayout-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.user-edit-tablelayout-box {
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.45);
    overflow: hidden;
}

body.theme-dunkel .user-edit-tablelayout-box,
body.theme-darkblue .user-edit-tablelayout-box,
body.theme-darkgreen .user-edit-tablelayout-box {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.20);
}

.user-edit-tablelayout-box__header {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
}

body.theme-dunkel .user-edit-tablelayout-box__header,
body.theme-darkblue .user-edit-tablelayout-box__header,
body.theme-darkgreen .user-edit-tablelayout-box__header {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.user-edit-tablelayout-box__body {
    padding: 12px;
}

/* Tabellenlayout: kompakte 1-Reihen-UI */
.tl-layout {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 52px minmax(240px, 1fr);
    gap: 12px;
    align-items: start;
}

.tl-layout>* {
    min-width: 0;
}

@media (max-width: 720px) {
    .tl-layout {
        grid-template-columns: 1fr;
    }

    .tl-transfer {
        flex-direction: row;
        justify-content: flex-start;
    }
}

.tl-available-wrap .tl-title,
.tl-selected-wrap .tl-title {
    font-size: 12px;
    opacity: 0.8;
    margin: 0 0 6px;
}

.tl-available,
.tl-selected {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.tl-transfer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.tl-selected-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 6px;
}

.tl-selected {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tl-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tl-row.is-dragging {
    opacity: 0.65;
}

/* Tabellenlayout: Buttons und Text um 30% kleiner */
.tl-panel .btn,
.tl-inline .btn {
    font-size: 70%;
    padding: calc(var(--btn-sm-padding-y, 0.25rem) * 0.7) calc(var(--btn-sm-padding-x, 0.5rem) * 0.7);
}

.tl-listbox .tl-row {
    font-size: 70%;
}

.ua-title,
.task-open-page .open-hero h1,
.project-open-page .open-hero h1 {
    font-family: var(--pmh-type-heading-family);
    font-size: var(--pmh-type-heading-size);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, inherit);
}

.task-open-page .open-section-title,
.project-open-page .open-section-title,
.open-section-title {
    font-family: var(--pmh-type-heading-family);
    font-size: var(--pmh-type-heading-size);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, inherit);
}

.pmh3 {
    font-family: var(--pmh-type-control-family);
    font-size: var(--pmh-type-control-size);
    font-weight: var(--pmh-type-control-weight);
    line-height: var(--pmh-type-control-line-height);
    color: var(--pmh-type-control-color, inherit);
}

.pmh4 {
    font-family: var(--pmh-type-control-family);
    font-size: var(--pmh-type-control-size);
    font-weight: var(--pmh-type-control-weight);
    line-height: var(--pmh-type-control-line-height);
    color: var(--pmh-type-control-color, inherit);
}

.pmhtext1 {
    font-family: var(--pmh-type-body-family);
    font-size: var(--pmh-type-body-size);
    font-weight: var(--pmh-type-body-weight);
    line-height: var(--pmh-type-body-line-height);
    text-decoration: none;
}

.pmhtext2 {
    font-family: var(--pmh-type-body-family);
    font-size: var(--pmh-type-body-size);
    font-weight: var(--pmh-type-body-weight);
    line-height: var(--pmh-type-body-line-height);
    text-decoration: none;
}

.pmhtext3 {
    font-family: var(--pmh-type-table-family);
    font-size: var(--pmh-type-table-size);
    font-weight: var(--pmh-type-table-weight);
    line-height: var(--pmh-type-table-line-height);
    text-decoration: none;
}

.pmhtext4 {
    font-family: var(--pmh-type-table-family);
    font-size: var(--pmh-type-table-size);
    font-weight: var(--pmh-type-table-weight);
    line-height: var(--pmh-type-table-line-height);
    text-decoration: none;
}

.pmhtext5 {
    font-family: var(--pmh-type-table-family);
    font-size: var(--pmh-type-table-size);
    font-weight: var(--pmh-type-table-weight);
    line-height: var(--pmh-type-table-line-height);
    text-decoration: none;
}

.pmhmeta1 {
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: var(--pmh-type-meta-weight);
    line-height: var(--pmh-type-meta-line-height);
    text-decoration: none;
}

.pmhmeta2 {
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: var(--pmh-type-meta-weight);
    line-height: var(--pmh-type-meta-line-height);
    text-decoration: none;
}

.pmh-color-white {
    color: #fff;
}

.pmh-opacity-90 {
    opacity: 0.9;
}

.pmh-opacity-80 {
    opacity: 0.8;
}

.pmh-opacity-55 {
    opacity: 0.55;
}

.pmh-no-underline {
    text-decoration: none;
}

.line-height-1 {
    line-height: 1;
}

/* Dashboard open views (inprogress, unaccepted, overdue, unassigned) */
.open-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.10);
}

body.theme-dunkel .open-table,
body.theme-darkblue .open-table,
body.theme-darkgreen .open-table {
    border-color: rgba(255, 255, 255, 0.14);
}

.open-table th,
.open-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}

body.theme-dunkel .open-table th,
body.theme-darkblue .open-table th,
body.theme-darkgreen .open-table th,
body.theme-dunkel .open-table td,
body.theme-darkblue .open-table td,
body.theme-darkgreen .open-table td {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

.open-table tbody tr:last-child td {
    border-bottom: 0;
}

.lupe-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    opacity: 0.75;
}

.lupe-btn:hover {
    opacity: 1;
}

.dashboard-action-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Aktionen-Tabelle: Status-Icon nach action_key */
.action-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: #6c757d;
    margin-right: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    vertical-align: middle;
}

.action-status-icon:last-child {
    margin-right: 0;
}

.action-status-icon--clickable {
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.action-status-icon--clickable:hover,
.action-status-icon--clickable:focus-visible {
    transform: scale(1.15);
    outline: none;
    filter: brightness(1.1);
}

.action-status-icon--armed {
    background: rgba(40, 167, 69, 0.18);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(40, 167, 69, 0.45);
}

.action-status-icon--dimmed {
    opacity: 0.35;
    pointer-events: none;
}

.action-status-icon>svg,
.action-status-icon svg {
    width: 18px;
    height: 18px;
    fill: #6c757d;
}

.action-status-icon--overdue>svg {
    fill: #d2392f !important;
}

.action-status-icon--soon_due>svg {
    fill: #d97706 !important;
}

.action-status-icon--new_assignment>svg {
    fill: #2563eb !important;
}

.action-status-icon--nodelivery>svg,
.action-status-icon--missing_estimate>svg {
    fill: #7c3aed !important;
}

.action-status-icon--start_now>svg {
    fill: #0f766e !important;
}

.action-status-icon--estimate_overrun>svg {
    fill: #b91c1c !important;
}

.attention-group-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.attention-status-stack {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.attention-status-prompts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.attention-status-prompt.action-status-icon {
    width: auto;
    height: auto;
    min-height: 22px;
    margin: 0;
    justify-content: flex-start;
    gap: 5px;
    white-space: nowrap;
}

.attention-status-prompt.action-status-icon>svg {
    flex: 0 0 18px;
}

.attention-status-prompt__label {
    color: var(--bs-body-color, #212529);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.attention-action-button {
    white-space: nowrap;
}

body.theme-dunkel .attention-status-prompt__label,
body.theme-darkblue .attention-status-prompt__label,
body.theme-darkgreen .attention-status-prompt__label {
    color: rgba(255, 255, 255, 0.9);
}

.attention-group-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    opacity: 0.72;
    white-space: nowrap;
}

.attention-group-badge--primary {
    opacity: 1;
    box-shadow: 0 0 0 1px currentColor;
}

.attention-group-badge--new {
    color: #2563eb;
}

.attention-group-badge--planning {
    color: #7c3aed;
}

.attention-group-badge--start {
    color: #0f766e;
}

.attention-group-badge--critical {
    color: #b91c1c;
}

.action-status-icon--unaccepted>svg {
    fill: #b45309 !important;
}

.action-status-icon--nodelivery>svg {
    fill: #7c3aed !important;
}

.action-status-icon--unassigned>svg {
    fill: #6b7280 !important;
}

.action-status-icon--done>svg {
    fill: #2f9e44 !important;
}

.action-status-icon--pushed>svg {
    fill: #b02b2b !important;
}

body.theme-dunkel .action-status-icon--overdue>svg,
body.theme-darkblue .action-status-icon--overdue>svg,
body.theme-darkgreen .action-status-icon--overdue>svg {
    fill: #ff6b60 !important;
}

body.theme-dunkel .action-status-icon--soon_due>svg,
body.theme-darkblue .action-status-icon--soon_due>svg,
body.theme-darkgreen .action-status-icon--soon_due>svg {
    fill: #fbbf24 !important;
}

body.theme-dunkel .action-status-icon--unaccepted>svg,
body.theme-darkblue .action-status-icon--unaccepted>svg,
body.theme-darkgreen .action-status-icon--unaccepted>svg {
    fill: #f59e0b !important;
}

body.theme-dunkel .action-status-icon--nodelivery>svg,
body.theme-darkblue .action-status-icon--nodelivery>svg,
body.theme-darkgreen .action-status-icon--nodelivery>svg {
    fill: #60a5fa !important;
}

body.theme-dunkel .action-status-icon--unassigned>svg,
body.theme-darkblue .action-status-icon--unassigned>svg,
body.theme-darkgreen .action-status-icon--unassigned>svg {
    fill: rgba(255, 255, 255, 0.7) !important;
}

body.theme-dunkel .action-status-icon--pushed>svg,
body.theme-darkblue .action-status-icon--pushed>svg,
body.theme-darkgreen .action-status-icon--pushed>svg {
    fill: #ff8f8f !important;
}

/* „Armed" (Speichern-Modus): Save-Icon grün, schlägt alle Action-Modifier-Farben (auch Dark-Themes). */
body .action-status-icon.action-status-icon--armed>svg,
body.theme-dunkel .action-status-icon.action-status-icon--armed>svg,
body.theme-darkblue .action-status-icon.action-status-icon--armed>svg,
body.theme-darkgreen .action-status-icon.action-status-icon--armed>svg {
    fill: #198754 !important;
}

.dashboard-action-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    opacity: 0.78;
}

.dashboard-action-detail-btn:hover,
.dashboard-action-detail-btn:focus-visible {
    opacity: 1;
}

.row-accepted td {
    opacity: 0.4;
    text-decoration: line-through;
}

.save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.8;
}

.save-btn:hover {
    opacity: 1;
}

body.theme-dunkel .save-btn,
body.theme-darkblue .save-btn,
body.theme-darkgreen .save-btn {
    border-color: rgba(255, 255, 255, 0.22);
    color: inherit;
}

.save-btn.is-saved {
    opacity: 0.6;
}

.assigned-user-label {
    font-weight: inherit;
    font-size: inherit;
}

.row-fade-out-fast {
    transition: opacity 0.4s;
    opacity: 0;
}

.row-fade-out {
    transition: opacity 0.8s;
    opacity: 0;
}

/* Utility classes for template cleanup */
.container-max-960 {
    max-width: 960px;
}

.container-max-1100 {
    max-width: 1100px;
}

.container-max-860 {
    max-width: 860px;
}

.container-max-900 {
    max-width: 900px;
}

.privacy-toggle--legacy .privacy-toggle__input:checked+.privacy-toggle__track .privacy-toggle__thumb {
    transform: translateX(22px);
}

.cell-max-420 {
    max-width: 420px;
}

.cell-max-220 {
    max-width: 220px;
}

.cell-max-480 {
    max-width: 480px;
}

.legacy-col-w-44 {
    width: 44px;
}

.legacy-col-w-80 {
    width: 80px;
}

.legacy-col-w-110 {
    width: 110px;
}

.legacy-col-w-140 {
    width: 140px;
}

.legacy-col-18p {
    width: 18%;
}

.legacy-col-14p {
    width: 14%;
}

.legacy-col-12p {
    width: 12%;
}

.legacy-col-10p {
    width: 10%;
}

.legacy-col-9p {
    width: 9%;
}

.legacy-col-8p {
    width: 8%;
}

.legacy-pplus-btn {
    padding: 2px 6px;
    vertical-align: baseline;
}

.chat-peer-select {
    width: auto;
    min-width: 140px;
}

.chat-inbox-box {
    height: 200px;
    overflow: auto;
}

.chat-messages-box {
    height: 160px;
    overflow: auto;
    background: #fff;
}

.progress-thin {
    height: 6px;
}

.dashboard-long-action-indicator {
    position: fixed;
    top: 88px;
    right: 20px;
    z-index: 1400;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.dashboard-long-action-indicator__card {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(18, 44, 61, 0.96), rgba(33, 80, 92, 0.94));
    color: #fff;
    box-shadow: 0 20px 45px rgba(11, 24, 34, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(10px);
}

.dashboard-long-action-indicator__label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.76;
}

.dashboard-long-action-indicator__title {
    margin: 0;
    color: inherit;
}

.dashboard-long-action-indicator__hint {
    margin: 0;
    opacity: 0.88;
}

.dashboard-long-action-indicator__bar {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
}

.dashboard-long-action-indicator__bar-fill {
    position: absolute;
    inset: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), #f8d66d, rgba(255, 255, 255, 0.22));
    animation: dashboard-long-action-slide 1.15s ease-in-out infinite;
}

.btn.is-loading {
    cursor: wait;
}

body.dashboard-long-action-active [data-long-action-form] {
    opacity: 0.98;
}

body.theme-dunkel .dashboard-long-action-indicator__card,
body.theme-darkblue .dashboard-long-action-indicator__card,
body.theme-darkgreen .dashboard-long-action-indicator__card {
    background: linear-gradient(135deg, rgba(13, 25, 34, 0.96), rgba(28, 60, 71, 0.94));
    border-color: rgba(255, 255, 255, 0.14);
}

@keyframes dashboard-long-action-slide {
    0% {
        transform: translateX(-115%);
    }

    100% {
        transform: translateX(235%);
    }
}

@media (max-width: 767.98px) {
    .dashboard-long-action-indicator {
        top: auto;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }
}

.task-desc-min-220 {
    min-width: 220px;
}

.legacy-hidden-frame {
    display: none;
    width: 0;
    height: 0;
}

.chat-inbox-item-clickable {
    cursor: pointer;
}

.white-space-pre-wrap {
    white-space: pre-wrap;
}

.btn-unstyled-icon {
    background: none;
    border: 0;
    padding: 0;
}

.task-open-actions-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 10px;
}

.task-open-back-link {
    display: inline-flex;
    align-items: center;
}

.task-open-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-open-actions-menu {
    align-self: center;
}

.task-open-actions-menu .todo-detail-actions-menu-panel {
    z-index: 50;
}

.task-open-actions-menu .task-open-action--danger {
    color: #b42318;
}

.open-section-title--reset {
    margin: 0;
}

.dashboard-row-hidden {
    display: none;
}

.example-wrapper {
    margin: 1em auto;
    max-width: 800px;
    width: 95%;
    font-family: var(--pmh-type-body-family);
    font-size: 18px;
    line-height: var(--pmh-type-body-line-height);
}

.example-wrapper code {
    background: #f5f5f5;
    padding: 2px 6px;
}

.home-nav-spaced {
    margin-bottom: 2em;
}

.admin-dept-back-wrap {
    margin: .5rem 0 1rem 0;
}

.admin-dept-card {
    margin-bottom: 1rem;
}

.admin-dept-title-reset {
    margin-top: 0;
}

.admin-dept-form-gap {
    row-gap: .5rem;
}

.admin-dept-min-220 {
    min-width: 220px;
}

.admin-dept-col-id {
    width: 90px;
}

.admin-dept-col-action {
    width: 120px;
}

.admin-dept-cell-nowrap {
    white-space: nowrap;
}

.back-wrap-sm {
    margin: .5rem 0 1rem 0;
}

.cell-nowrap {
    white-space: nowrap;
}

.user-preview-card {
    margin-bottom: 1rem;
}

.card-title-mt-0 {
    margin-top: 0;
}

.flex-gap-1rem {
    gap: 1rem;
}

.mt-05rem {
    margin-top: .5rem;
}

.table-wrap-top {
    margin-top: .75rem;
    overflow: auto;
}

.archive-frame {
    width: 100%;
    box-sizing: border-box;
    padding: 0 12px 12px;
}

.archive-table {
    min-width: 100%;
    border-collapse: collapse;
}

.archive-table-bordered,
.archive-table-bordered th,
.archive-table-bordered td {
    border: 1px solid #cfcfcf;
}

.cell-max-520 {
    max-width: 520px;
}

/* User admin page */
.ua-top {
    margin-bottom: 1rem;
}

.ua-hero {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.ua-col {
    flex: 1;
    min-width: 340px;
}

.ua-panel {
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.10);
    background: rgba(0, 0, 0, 0.02);
    padding: 14px 16px;
}

body.theme-dunkel .ua-panel,
body.theme-darkblue .ua-panel,
body.theme-darkgreen .ua-panel {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.ua-title {
    font-weight: 700;
    font-size: 18px;
    margin: 0 0 10px 0;
    letter-spacing: .2px;
}

.ua-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

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

.ua-field label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    opacity: .75;
    margin: 0 0 6px 0;
}

.ua-field .form-control {
    border-radius: 12px;
}

.ua-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.ua-actions .btn {
    border-radius: 999px;
}

.ua-save-icon-btn {
    background: none;
    border: none;
    padding: 0;
}

.ua-subtitle {
    font-weight: 700;
    font-size: 14px;
    margin: 14px 0 8px 0;
    opacity: .9;
}

.ua-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.ua-spacer-12 {
    height: 12px;
}

.ua-mail-import-grid {
    margin-top: 8px;
}

.ua-note-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
    font-size: 12px;
    line-height: 1.45;
}

.ua-note-box-tight {
    display: grid;
    gap: 2px;
}

.ua-mail-failed-panel {
    margin-top: 16px;
    scroll-margin-top: 24px;
}

.ua-mail-failed-table td {
    vertical-align: top;
}

.ua-mail-failed-summary {
    margin-top: 12px;
}

.ua-mail-failed-summary .btn {
    margin-top: 6px;
}

.ua-mail-meta {
    font-size: 11px;
    opacity: 0.72;
}

.ua-mail-error {
    max-width: 360px;
    white-space: pre-wrap;
    word-break: break-word;
}

.ua-inline-form {
    display: inline;
}

.ua-actions-top {
    margin-top: 10px;
}

.ua-overflow-auto {
    overflow: auto;
}

.ua-table-m0 {
    margin: 0;
}

.ua-password-wrap {
    min-width: 200px;
}

.ua-password-input {
    min-width: 140px;
}

.ua-matrix-panel {
    margin-top: 14px;
}

.ua-matrix-intro {
    font-size: 13px;
    line-height: 1.45;
    opacity: .82;
    margin-bottom: 12px;
}

.ua-matrix-legend {
    margin: -2px 0 14px;
    padding: 9px 11px;
    border: 1px solid rgba(13, 110, 253, .18);
    border-radius: 10px;
    background: rgba(13, 110, 253, .06);
    font-size: 12px;
    line-height: 1.4;
}

.ua-role-summary-wrap {
    overflow: auto;
}

.ua-role-summary,
.ua-permission-table {
    margin: 0;
}

.ua-role-summary th,
.ua-role-summary td,
.ua-permission-table th,
.ua-permission-table td {
    vertical-align: top;
}

.ua-role-name,
.ua-permission-name {
    font-weight: 700;
}

.ua-role-key,
.ua-permission-key {
    font-size: 11px;
    opacity: .68;
    margin-top: 2px;
    font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.ua-role-note {
    font-size: 12px;
    opacity: .75;
    margin-top: 4px;
}

.ua-warning-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 6px;
}

.ua-field-full {
    grid-column: 1 / -1;
}

.ua-warning-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 193, 7, 0.12);
    border: 1px solid rgba(255, 193, 7, 0.28);
}

.ua-permission-group+.ua-permission-group {
    margin-top: 12px;
}

.ua-grant-cell {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

.ua-source-list {
    font-size: 12px;
    line-height: 1.35;
    min-width: 220px;
}

.ua-role-editor-panel {
    margin-top: 14px;
}

.ua-role-create-form {
    margin-bottom: 18px;
}

.ua-role-matrix-wrap {
    overflow: auto;
}

.ua-role-matrix-table {
    margin: 0;
    min-width: 1040px;
}

.ua-role-matrix-table th,
.ua-role-matrix-table td {
    vertical-align: top;
}

.ua-role-matrix-sidehead {
    min-width: 280px;
    width: 280px;
    background: rgba(0, 0, 0, 0.03);
}

.ua-role-matrix-rolehead,
.ua-role-matrix-metahead {
    min-width: 260px;
    width: 260px;
}

.ua-role-column-head {
    display: grid;
    gap: 4px;
}

.ua-role-column-meta {
    display: grid;
    gap: 10px;
}

.ua-role-meta-field {
    display: grid;
    gap: 4px;
    font-size: 12px;
}

.ua-role-meta-field span {
    font-weight: 700;
    opacity: .8;
}

.ua-role-meta-switch {
    justify-items: start;
}

.ua-role-meta-switch input {
    margin-top: 2px;
}

.ua-role-group-row th {
    background: rgba(13, 110, 253, 0.08);
    font-weight: 700;
    letter-spacing: .02em;
}

.ua-role-matrix-permission {
    min-width: 280px;
}

.ua-role-matrix-cell {
    text-align: center;
    vertical-align: middle;
}

.ua-role-matrix-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 64px;
    width: 100%;
}

.ua-role-matrix-checkbox input {
    transform: scale(1.15);
}

.ua-role-editor-list {
    display: grid;
    gap: 14px;
}

.ua-role-editor-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.38);
}

.ua-role-editor-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.ua-role-active-field {
    align-self: center;
}

.ua-role-editor-note {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin: 10px 0 4px;
    font-size: 12px;
    opacity: .8;
}

.ua-role-permission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.ua-role-permission-item {
    display: grid;
    gap: 4px;
    align-content: start;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.5);
}

.ua-role-permission-item input {
    margin: 0 0 2px;
}

.ua-role-permission-name {
    font-weight: 700;
}

.ua-role-permission-desc {
    font-size: 12px;
    line-height: 1.35;
    opacity: .78;
}

body.theme-dunkel .ua-warning-item,
body.theme-darkblue .ua-warning-item,
body.theme-darkgreen .ua-warning-item {
    background: rgba(255, 193, 7, 0.10);
    border-color: rgba(255, 214, 102, 0.28);
}

body.theme-dunkel .ua-matrix-legend,
body.theme-darkblue .ua-matrix-legend,
body.theme-darkgreen .ua-matrix-legend {
    border-color: rgba(110, 168, 254, .24);
    background: rgba(110, 168, 254, .09);
}

body.theme-dunkel .ua-note-box,
body.theme-darkblue .ua-note-box,
body.theme-darkgreen .ua-note-box {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dunkel .ua-role-editor-card,
body.theme-darkblue .ua-role-editor-card,
body.theme-darkgreen .ua-role-editor-card {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

body.theme-dunkel .ua-role-matrix-sidehead,
body.theme-darkblue .ua-role-matrix-sidehead,
body.theme-darkgreen .ua-role-matrix-sidehead {
    background: rgba(255, 255, 255, 0.06);
}

body.theme-dunkel .ua-role-group-row th,
body.theme-darkblue .ua-role-group-row th,
body.theme-darkgreen .ua-role-group-row th {
    background: rgba(110, 168, 254, 0.12);
}

body.theme-dunkel .ua-role-permission-item,
body.theme-darkblue .ua-role-permission-item,
body.theme-darkgreen .ua-role-permission-item {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 980px) {
    .ua-role-editor-meta {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 980px) {

    .ua-role-matrix-rolehead,
    .ua-role-matrix-metahead {
        min-width: 220px;
        width: 220px;
    }
}

@media (max-width: 680px) {
    .ua-role-editor-meta {
        grid-template-columns: 1fr;
    }

    .todo-detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .todo-detail-actions-left {
        align-items: stretch;
        flex-direction: column;
    }

    .todo-detail-actions-tools {
        width: 100%;
    }

    .todo-detail-close-btn {
        margin-left: 0;
        align-self: flex-end;
    }
}

.user-field.changed {
    border-color: #0d6efd;
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25);
}

.save-btn[disabled] img {
    filter: grayscale(100%);
    opacity: .5;
}

/* Stundenzettel */
.stz-table {
    border-collapse: collapse;
    width: 100%;
}

.stz-table th,
.stz-table td {
    border: 1px solid rgba(0, 0, 0, 0.35);
    padding: 6px 8px;
}

body.theme-dunkel .stz-table th,
body.theme-dunkel .stz-table td,
body.theme-darkblue .stz-table th,
body.theme-darkblue .stz-table td,
body.theme-darkgreen .stz-table th,
body.theme-darkgreen .stz-table td {
    border-color: rgba(255, 255, 255, 0.25);
}

.stz-table th {
    text-align: left;
}

.stz-icon-btn {
    position: relative;
}

.stz-col-day {
    width: 130px;
}

.stz-col-actions {
    width: 40px;
}

.stz-col-hours {
    width: 90px;
}

.stz-actions-menu { position: relative; width: 20px; }
.stz-actions-menu-toggle {
    display: block;
    width: 20px;
    height: 28px;
    padding: 0 0 2px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
    list-style: none;
    text-align: center;
}
.stz-actions-menu-toggle::-webkit-details-marker { display: none; }
.stz-actions-menu-toggle::marker { content: ''; }
.stz-actions-menu-panel {
    position: absolute;
    z-index: 20;
    top: 30px;
    left: 0;
    width: max-content;
    min-width: 170px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .16);
}
.stz-actions-menu-panel form { margin: 0; }
.stz-actions-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 28px;
    gap: 7px;
    padding: 4px 6px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.stz-actions-menu-item:hover,
.stz-actions-menu-item:focus-visible { background: rgba(13, 110, 253, .08); color: inherit; outline: 0; }
.stz-actions-menu-item--danger { color: #b42318; }
body.theme-dunkel .stz-actions-menu-panel,
body.theme-darkblue .stz-actions-menu-panel,
body.theme-darkgreen .stz-actions-menu-panel { background: #2b2b2b; border-color: rgba(255, 255, 255, .16); }

/* Verbesserung pages */
.verb-card {
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: visible;
}

body.theme-dunkel .verb-card,
body.theme-darkblue .verb-card,
body.theme-darkgreen .verb-card {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.verb-field {
    display: grid;
    gap: 4px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 6px 8px;
    height: auto;
}

body.theme-dunkel .verb-field,
body.theme-darkblue .verb-field,
body.theme-darkgreen .verb-field {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.verb-label {
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
}

.verb-value {
    font-size: 13px;
    line-height: 1.2;
}

.verb-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.verb-list {
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 2px;
}

.verb-row {
    display: grid;
    grid-template-columns: 40px 140px 220px 1fr 1fr 120px;
    gap: 8px;
    align-items: stretch;
    min-width: 980px;
}

.verb-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.verb-status__check,
.verb-status__placeholder {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
}

.verb-status__check {
    background: #daf5df;
    color: #1d7a31;
    border: 1px solid rgba(29, 122, 49, 0.25);
}

.task-status-strip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    vertical-align: middle;
}

.task-status-visual {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    flex: 0 0 auto;
}

.task-status-visual svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.task-status-visual--done {
    background: #daf5df;
    color: #1d7a31;
    border: 1px solid rgba(29, 122, 49, 0.25);
}

.task-status-visual--progress {
    width: 34px;
    height: 10px;
    border-radius: 999px;
    background: rgba(13, 110, 253, 0.15);
    border: 1px solid rgba(13, 110, 253, 0.22);
    justify-content: flex-start;
    padding: 2px;
}

.task-status-visual--progress span {
    width: 58%;
    height: 100%;
    border-radius: inherit;
    background: #0d6efd;
}

.task-status-visual--overdue {
    background: #fde2df;
    color: #c92a2a;
    border: 1px solid rgba(201, 42, 42, 0.24);
}

.task-status-visual--soon {
    background: #fff1d6;
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.task-status-visual--unassigned {
    background: #edf0f3;
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.task-status-visual--unaccepted,
.task-status-visual--archived,
.task-status-visual--unknown {
    background: rgba(0, 0, 0, 0.05);
    color: #6c757d;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.task-status-visual--open {
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed rgba(0, 0, 0, 0.08);
}

.verb-status__placeholder {
    background: rgba(0, 0, 0, 0.04);
    border: 1px dashed rgba(0, 0, 0, 0.08);
}

.verb-card--done {
    border-color: rgba(29, 122, 49, 0.18);
}

body.theme-dunkel .verb-status__placeholder,
body.theme-darkblue .verb-status__placeholder,
body.theme-darkgreen .verb-status__placeholder {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .task-status-visual--open,
body.theme-darkblue .task-status-visual--open,
body.theme-darkgreen .task-status-visual--open,
body.theme-dunkel .task-status-visual--unaccepted,
body.theme-darkblue .task-status-visual--unaccepted,
body.theme-darkgreen .task-status-visual--unaccepted,
body.theme-dunkel .task-status-visual--archived,
body.theme-darkblue .task-status-visual--archived,
body.theme-darkgreen .task-status-visual--archived,
body.theme-dunkel .task-status-visual--unknown,
body.theme-darkblue .task-status-visual--unknown,
body.theme-darkgreen .task-status-visual--unknown {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
}

.verb-form textarea {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.verb-form .btn {
    border-radius: 10px;
}

.verb-meta {
    display: grid;
    gap: 6px;
}

/* Task open detail page */
.task-open-page {
    --task-open-bg: var(--pmh-page-bg);
    --task-open-ink: var(--pmh-text);
    --task-open-muted: var(--pmh-text-muted);
    --task-open-accent: var(--pmh-accent);
    --task-open-card: var(--pmh-surface);
    --task-open-line: var(--pmh-border);
    --task-open-shadow: 0 16px 44px var(--pmh-shadow);
    --task-open-radius: 18px;
    background: linear-gradient(135deg, var(--task-open-bg) 72%, var(--pmh-page-bg-accent) 100%);
    color: var(--task-open-ink);
    min-height: 100vh;
    font-family: var(--pmh-type-body-family);
    padding: 28px 24px 48px;
}

.task-open-page .open-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    animation: taskOpenFadeUp 420ms ease-out;
}

.task-open-page .open-hero h1 {
    font-family: var(--pmh-type-heading-family);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, var(--task-open-ink));
    font-size: clamp(26px, 3vw, 36px);
    margin: 0 0 6px 0;
}

.task-open-page .open-hero .sub {
    color: var(--task-open-muted);
    font-size: 14px;
}

.task-open-page .open-pill {
    background: var(--task-open-card);
    border: 1px solid var(--task-open-line);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    color: var(--task-open-accent);
    box-shadow: var(--task-open-shadow);
    white-space: nowrap;
}

.task-open-page .open-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    animation: taskOpenFadeUp 520ms ease-out;
}

.task-open-page .open-card {
    background: var(--task-open-card);
    border: 1px solid var(--task-open-line);
    border-radius: var(--task-open-radius);
    padding: 14px 16px;
    box-shadow: var(--task-open-shadow);
}

.task-open-page .task-open-comment-card {
    margin-bottom: 18px;
}

.task-open-comment-field {
    min-height: 96px;
    resize: both;
    background: var(--pmh-surface-raised, var(--pmh-surface, #fff));
    color: var(--pmh-text, inherit);
}

.task-open-comment-field:read-only {
    opacity: 1;
}

.task-open-page .open-label {
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-label-size);
    font-weight: var(--pmh-type-label-weight);
    line-height: var(--pmh-type-label-line-height);
    color: var(--task-open-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.task-open-page .open-value {
    font-weight: 600;
    font-size: 15px;
    word-break: break-word;
}

.task-open-page .open-section-title {
    font-family: var(--pmh-type-heading-family);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, var(--task-open-ink));
    font-size: 20px;
    margin: 0 0 10px 0;
}

.task-open-page .open-table {
    background: var(--task-open-card);
    border: 1px solid var(--task-open-line);
    border-radius: var(--task-open-radius);
    overflow: hidden;
    box-shadow: var(--task-open-shadow);
    animation: taskOpenFadeUp 620ms ease-out;
}

.task-open-page .open-table table {
    margin: 0;
    width: 100%;
}

.task-open-page .open-table thead th {
    background: transparent;
    color: inherit;
    border-bottom: 1px solid var(--task-open-line);
    white-space: nowrap;
}

.task-open-page .open-table tbody td {
    vertical-align: middle;
}

.task-open-page .open-table thead th+th,
.task-open-page .open-table tbody td+td,
.task-open-page .open-table tbody tr+tr td,
.project-open-page .open-table thead th+th,
.project-open-page .open-table tbody td+td,
.project-open-page .open-table tbody tr+tr td {
    border-left: 1px solid var(--pmh-border);
}

.task-open-page .open-table tbody tr+tr td,
.project-open-page .open-table tbody tr+tr td {
    border-top: 1px dashed var(--pmh-border);
}

body.theme-dunkel .task-open-page .open-table thead th+th,
body.theme-darkblue .task-open-page .open-table thead th+th,
body.theme-darkgreen .task-open-page .open-table thead th+th,
body.theme-dunkel .task-open-page .open-table tbody td+td,
body.theme-darkblue .task-open-page .open-table tbody td+td,
body.theme-darkgreen .task-open-page .open-table tbody td+td,
body.theme-dunkel .project-open-page .open-table thead th+th,
body.theme-darkblue .project-open-page .open-table thead th+th,
body.theme-darkgreen .project-open-page .open-table thead th+th,
body.theme-dunkel .project-open-page .open-table tbody td+td,
body.theme-darkblue .project-open-page .open-table tbody td+td,
body.theme-darkgreen .project-open-page .open-table tbody td+td {
    border-left-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .task-open-page .open-table tbody tr+tr td,
body.theme-darkblue .task-open-page .open-table tbody tr+tr td,
body.theme-darkgreen .task-open-page .open-table tbody tr+tr td,
body.theme-dunkel .project-open-page .open-table tbody tr+tr td,
body.theme-darkblue .project-open-page .open-table tbody tr+tr td,
body.theme-darkgreen .project-open-page .open-table tbody tr+tr td {
    border-top-color: rgba(255, 255, 255, 0.12);
}

@keyframes taskOpenFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Project open detail page */
.project-open-page {
    --project-open-bg: var(--pmh-page-bg);
    --project-open-ink: var(--pmh-text);
    --project-open-muted: var(--pmh-text-muted);
    --project-open-accent: var(--pmh-accent);
    --project-open-card: var(--pmh-surface);
    --project-open-line: var(--pmh-border);
    --project-open-shadow: 0 14px 40px var(--pmh-shadow);
    --project-open-radius: 18px;
    background: linear-gradient(135deg, var(--project-open-bg) 72%, var(--pmh-page-bg-accent) 100%);
    color: var(--project-open-ink);
    min-height: 100vh;
    font-family: var(--pmh-type-body-family);
    padding: 28px 24px 48px;
}

.project-open-page .open-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    animation: projectOpenFadeUp 420ms ease-out;
}

.project-open-page .open-hero h1 {
    font-family: var(--pmh-type-heading-family);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, var(--project-open-ink));
    font-size: clamp(28px, 3.2vw, 40px);
    margin: 0 0 6px 0;
    letter-spacing: 0.2px;
}

.project-open-page .open-hero .sub {
    color: var(--project-open-muted);
    font-size: 14px;
}

.project-open-page .open-pill {
    background: var(--project-open-card);
    border: 1px solid var(--project-open-line);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    color: var(--project-open-accent);
    box-shadow: var(--project-open-shadow);
    white-space: nowrap;
}

.project-open-page .open-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
    animation: projectOpenFadeUp 520ms ease-out;
}

.project-open-page .open-card {
    background: var(--project-open-card);
    border: 1px solid var(--project-open-line);
    border-radius: var(--project-open-radius);
    padding: 14px 16px;
    box-shadow: var(--project-open-shadow);
}

.project-open-page .open-label {
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-label-size);
    font-weight: var(--pmh-type-label-weight);
    line-height: var(--pmh-type-label-line-height);
    color: var(--project-open-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.project-open-page .open-value {
    font-weight: 600;
    font-size: 15px;
    word-break: break-word;
}

.project-open-page .open-desc {
    background: var(--project-open-card);
    border: 1px solid var(--project-open-line);
    border-radius: var(--project-open-radius);
    padding: 16px 18px;
    box-shadow: var(--project-open-shadow);
    margin-bottom: 22px;
    animation: projectOpenFadeUp 620ms ease-out;
}

.project-open-page .open-section-title {
    font-family: var(--pmh-type-heading-family);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, var(--project-open-ink));
    font-size: 20px;
    margin: 0 0 10px 0;
}

.project-open-page .open-table {
    background: var(--project-open-card);
    border: 1px solid var(--project-open-line);
    border-radius: var(--project-open-radius);
    overflow: hidden;
    box-shadow: var(--project-open-shadow);
    animation: projectOpenFadeUp 700ms ease-out;
}

.project-open-page .open-table table {
    margin: 0;
    width: 100%;
}

.project-open-page .open-table thead th {
    background: transparent;
    color: inherit;
    border-bottom: 1px solid var(--project-open-line);
    white-space: nowrap;
}

.project-open-page .open-table tbody td {
    vertical-align: middle;
}

@keyframes projectOpenFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.open-back-icon {
    --icon-size: 50.4px;
}

@media (max-width: 900px) {

    .task-open-page .open-hero,
    .project-open-page .open-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-open-page .open-pill,
    .project-open-page .open-pill {
        align-self: flex-start;
    }
}


/* ===== Flat 20-column layout cells (P+ toolbar) ===== */
.pct-col {
    padding: 0;
    vertical-align: middle;
    white-space: nowrap;
}

.pct-col--gap {
    width: 8px;
    min-width: 8px;
}

.pct-col--gap-sm {
    width: 4px;
    min-width: 4px;
}

.pct-col--divider {
    width: 20px;
    min-width: 20px;
    text-align: center;
}

.pct-col--icon {
    padding: 0 4px;
}

.pct-col--icons {
    padding: 0;
}

.pct-col--label {
    padding: 0 4px;
    white-space: nowrap;
}

.pct-col--hint {
    padding: 0 4px;
    white-space: nowrap;
}

.pct-col--spacer {
    width: 100%;
}

/* ===== Dashboard filter toolbar / icons ===== */
.project-create-icons-table--filters {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.project-create-icon-cell {
    padding: 0 10px;
    vertical-align: middle;
}

.project-create-icon-cell--button {
    padding-right: 0;
    width: 100%;
}

.project-create-icon-cell--system {
    width: auto;
    white-space: nowrap;
}

.project-create-icon-divider-cell {
    width: 34px;
    padding: 0 10px;
    vertical-align: middle;
}

.dashboard-filter-toolbar {
    display: grid;
    gap: 12px;
    align-items: center;
}

.dashboard-filter-launch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(14, 76, 88, 0.18);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(225, 244, 245, 0.96));
    color: #164a55;
    box-shadow: 0 10px 24px rgba(19, 64, 72, 0.12);
}

.dashboard-filter-launch--label {
    pointer-events: none;
}

.dashboard-filter-launch__icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
}

.dashboard-filter-launch__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.dashboard-filter-launch__label {
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dashboard-filter-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.dashboard-filter-icons {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: visible;
    padding-top: 12px;
    padding-right: 12px;
}

.dashboard-filter-icons--system {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    padding-right: 0;
}

.dashboard-filter-icon {
    --dashboard-filter-accent: #164a55;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 91px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(17, 58, 67, 0.14);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 248, 0.99));
    color: var(--dashboard-filter-accent);
    box-shadow: 0 12px 24px rgba(17, 45, 53, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-filter-icon+.dashboard-filter-icon {
    margin-left: 22px;
}

.dashboard-filter-icon+.dashboard-filter-icon::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    width: 1px;
    height: 24px;
    transform: translateY(-50%);
    background: rgba(22, 74, 85, 0.22);
}

.dashboard-filter-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 26px rgba(17, 45, 53, 0.12);
}

.dashboard-filter-icon.is-active {
    border-color: var(--dashboard-filter-accent);
    border-width: 2px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--dashboard-filter-accent) 12%, white 88%), color-mix(in srgb, var(--dashboard-filter-accent) 22%, white 78%));
    color: color-mix(in srgb, var(--dashboard-filter-accent) 85%, black 15%);
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--dashboard-filter-accent) 28%, transparent),
        0 18px 34px color-mix(in srgb, var(--dashboard-filter-accent) 22%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transform: translateY(-1px);
    font-weight: 700;
}

.dashboard-filter-icon.is-active .dashboard-filter-icon__glyph {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
}

.dashboard-filter-icon.is-active .dashboard-filter-icon__badge {
    box-shadow: 0 10px 22px color-mix(in srgb, var(--dashboard-filter-accent) 45%, transparent);
    outline: 2px solid rgba(255, 255, 255, 0.9);
}

.dashboard-filter-icon--overview.is-active {
    transform: translateY(-1px);
    background: linear-gradient(180deg, rgba(228, 244, 232, 0.98), rgba(201, 231, 208, 0.98));
    border-color: #3a7a48;
    border-width: 2px;
    color: #1f4527;
    box-shadow:
        0 0 0 3px rgba(76, 151, 88, 0.32),
        0 18px 30px rgba(45, 92, 54, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dashboard-filter-icon__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.dashboard-filter-icon__glyph svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.dashboard-filter-icon__badge {
    position: absolute;
    top: -7px;
    right: -10px;
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--dashboard-filter-accent);
    color: #f7fbfb;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(17, 45, 53, 0.18);
}

.dashboard-filter-icon__active-mark {
    position: absolute;
    top: -5px;
    right: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #4c9758;
    color: #f7fbfb;
    box-shadow: 0 6px 14px rgba(40, 103, 51, 0.24);
}

.dashboard-filter-icon__active-mark svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.dashboard-filter-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex: 0 0 auto;
}

.dashboard-filter-toolbar-btn {
    width: 40px;
    height: 40px;
}

.dashboard-filter-toolbar-btn__glyph {
    font-size: 24px;
    line-height: 1;
    font-weight: 400;
}

.dashboard-filter-toolbar-btn__icon {
    display: block;
    width: 16px;
    height: 16px;
}

.dashboard-filter-selection-summary {
    color: #24515a;
    max-width: min(860px, 92vw);
    line-height: 1.45;
}

.dashboard-filter-empty-note {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed rgba(22, 74, 85, 0.28);
    border-radius: 14px;
    background: rgba(237, 247, 248, 0.9);
    color: #24515a;
}

.dashboard-filter-modal-card {
    width: min(1240px, 98vw);
    position: relative;
}

.dashboard-filter-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #ff5f57;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.dashboard-filter-close-btn:hover {
    background: #e0443d;
}

.dashboard-filter-modal-body {
    max-height: 84vh;
    overflow: auto;
}

.dashboard-filter-shell {
    display: grid;
    gap: 10px;
}

.dashboard-filter-mgmt-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.dashboard-filter-mgmt-columns--single {
    grid-template-columns: minmax(0, 1fr);
}

.dashboard-filter-mgmt-column-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #24515a;
}

.dashboard-filter-card-list {
    display: grid;
    gap: 5px;
}

.dashboard-filter-card {
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 252, 0.99));
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.dashboard-filter-card--overview .dashboard-filter-card-summary {
    padding-bottom: 10px;
}

.dashboard-filter-card-summary {
    padding: 8px 12px;
}

.dashboard-filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.dashboard-filter-card-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a3c44;
}

.dashboard-filter-card-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.dashboard-filter-card-status.is-active {
    background: rgba(76, 127, 87, 0.14);
    color: #346341;
}

.dashboard-filter-card-status.is-inactive {
    background: rgba(125, 77, 116, 0.10);
    color: #76546f;
}

.dashboard-filter-card-body {
    font-size: 12.5px;
    color: #4a6e76;
    line-height: 1.5;
}

.dashboard-filter-card-body .dashboard-filter-card-criteria-list {
    margin: 0;
    padding: 0 0 0 16px;
    font-size: 12px;
    color: #4a6e76;
}

.dashboard-filter-card-footer {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.dashboard-filter-card-toggle {
    font-size: 12px;
    font-weight: 500;
    color: #4a6e76;
    cursor: pointer;
    user-select: none;
}

.dashboard-filter-card-toggle input[type="checkbox"] {
    margin-right: 4px;
}

.dashboard-filter-card-editor {
    padding: 8px 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(226, 240, 242, 0.35);
}

.dashboard-filter-card--overview .dashboard-filter-card-editor {
    border-top: 0;
    padding-top: 0;
}

.dashboard-filter-card-editor-field {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #24515a;
}

.dashboard-filter-card-editor-field input,
.dashboard-filter-card-editor-field select {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 6px 10px;
    border: 1px solid rgba(17, 58, 67, 0.18);
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
}

.dashboard-filter-card-editor-field--readonly {
    margin-bottom: 6px;
}

.dashboard-filter-card-editor-field--toggle {
    margin-bottom: 5px;
}

.dashboard-filter-card-auto-name {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid rgba(17, 58, 67, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: #1f4a53;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-filter-card-editor-criteria {
    margin-top: 4px;
}

.dashboard-filter-card-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.dashboard-filter-card--overview .dashboard-filter-card-editor-actions {
    justify-content: flex-end;
}

.dashboard-filter-hero {
    padding-bottom: 2px;
}

.dashboard-filter-form-grid {
    gap: 14px;
}

.dashboard-filter-field {
    min-width: 0;
}

.dashboard-filter-editor-card {
    display: grid;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 252, 0.98));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
}

.dashboard-filter-criteria-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-filter-criteria-list {
    display: table-row-group;
}

.dashboard-filter-criteria-table-wrap {
    margin-top: 12px;
    border: 1px solid rgba(17, 58, 67, 0.12);
    border-radius: 16px;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.72);
}

.dashboard-filter-criteria-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-filter-criteria-table th {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(17, 58, 67, 0.12);
    background: rgba(226, 240, 242, 0.9);
    color: #24515a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dashboard-filter-criteria-table th:last-child {
    text-align: right;
}

.dashboard-filter-criteria-row {
    border-bottom: 1px solid rgba(17, 58, 67, 0.08);
}

.dashboard-filter-criteria-row:last-child {
    border-bottom: 0;
}

.dashboard-filter-criteria-cell {
    padding: 5px 10px;
    vertical-align: middle;
}

.dashboard-filter-criteria-cell--actions {
    white-space: nowrap;
    text-align: right;
}

.dashboard-filter-criteria-cell--scope {
    min-width: 100px;
    width: 110px;
}

.dashboard-filter-conjunction-row td {
    padding: 0 12px;
    vertical-align: middle;
    border-bottom: 0;
}

.dashboard-filter-conjunction-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #24515a;
    opacity: 0.7;
}

.dashboard-filter-conjunction-select select {
    width: auto;
    font-size: 11px;
    padding: 1px 6px;
    height: auto;
}

.dashboard-filter-card-header--inline {
    padding: 0 0 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    margin-bottom: 8px;
}

.dashboard-filter-card--with-handle {
    display: grid;
    grid-template-columns: 28px 1fr;
}

.dashboard-filter-card-handle-area {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(226, 240, 242, 0.5);
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    cursor: grab;
}

.dashboard-filter-card--with-handle>.dashboard-filter-card-editor {
    border-top: 0;
}

.dashboard-filter-drag-handle {
    cursor: grab;
    font-size: 16px;
    line-height: 1;
    color: #8a9ba0;
    user-select: none;
    flex-shrink: 0;
}

.dashboard-filter-drag-handle:hover {
    color: #1a3c44;
}

.dashboard-filter-card.is-dragging {
    opacity: 0.4;
}

.dashboard-filter-card.drag-over {
    border-top: 2px solid var(--pmh-accent, #1a3c44);
}

.dashboard-filter-add-criterion-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 0;
    background: transparent;
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
}

.dashboard-filter-add-criterion-btn:hover {
    background: rgba(22, 74, 85, 0.08);
}

.dashboard-filter-add-criterion-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 74, 85, 0.16);
}

.dashboard-filter-row-action {
    border: 0;
    background: transparent;
    padding: 4px;
    margin-left: 6px;
    opacity: 0.84;
}

.dashboard-filter-row-action:hover {
    opacity: 1;
}

.dashboard-filter-row-action .icon-img-xs {
    display: block;
}

.dashboard-filter-empty-placeholder {
    min-height: 31px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(22, 74, 85, 0.06);
}

.dashboard-filter-modal-actions {
    padding: 0;
    border-top: 0;
}

.dashboard-filter-modal-delete[hidden] {
    display: none !important;
}

body.theme-dunkel .dashboard-filter-launch,
body.theme-darkblue .dashboard-filter-launch,
body.theme-darkgreen .dashboard-filter-launch,
body.theme-dunkel .dashboard-filter-icon,
body.theme-darkblue .dashboard-filter-icon,
body.theme-darkgreen .dashboard-filter-icon,
body.theme-dunkel .dashboard-filter-editor-card,
body.theme-darkblue .dashboard-filter-editor-card,
body.theme-darkgreen .dashboard-filter-editor-card {
    background: rgba(34, 45, 54, 0.96);
    color: #eef6f7;
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .dashboard-filter-criteria-table-wrap,
body.theme-darkblue .dashboard-filter-criteria-table-wrap,
body.theme-darkgreen .dashboard-filter-criteria-table-wrap,
body.theme-dunkel .dashboard-filter-criteria-row,
body.theme-darkblue .dashboard-filter-criteria-row,
body.theme-darkgreen .dashboard-filter-criteria-row {
    background: rgba(34, 45, 54, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .dashboard-filter-criteria-table th,
body.theme-darkblue .dashboard-filter-criteria-table th,
body.theme-darkgreen .dashboard-filter-criteria-table th {
    background: rgba(255, 255, 255, 0.08);
    color: #eef6f7;
    border-color: rgba(255, 255, 255, 0.14);
}

body.theme-dunkel .dashboard-filter-icon__glyph,
body.theme-darkblue .dashboard-filter-icon__glyph,
body.theme-darkgreen .dashboard-filter-icon__glyph {
    color: inherit;
}

body.theme-dunkel .dashboard-filter-icon__badge,
body.theme-darkblue .dashboard-filter-icon__badge,
body.theme-darkgreen .dashboard-filter-icon__badge {
    background: #d9ecec;
    color: #16333a;
}

body.theme-dunkel .dashboard-filter-icon--overview.is-active,
body.theme-darkblue .dashboard-filter-icon--overview.is-active,
body.theme-darkgreen .dashboard-filter-icon--overview.is-active {
    background: linear-gradient(180deg, rgba(54, 86, 62, 0.96), rgba(43, 72, 50, 0.96));
    border-color: rgba(131, 205, 145, 0.42);
    box-shadow: inset 0 2px 6px rgba(12, 25, 15, 0.35), 0 10px 22px rgba(10, 16, 11, 0.25);
}

body.theme-dunkel .dashboard-filter-icon__active-mark,
body.theme-darkblue .dashboard-filter-icon__active-mark,
body.theme-darkgreen .dashboard-filter-icon__active-mark {
    background: #7bc889;
    color: #18321d;
}

body.theme-dunkel .dashboard-filter-icon+.dashboard-filter-icon::before,
body.theme-darkblue .dashboard-filter-icon+.dashboard-filter-icon::before,
body.theme-darkgreen .dashboard-filter-icon+.dashboard-filter-icon::before {
    background: rgba(255, 255, 255, 0.16);
}

body.theme-dunkel .dashboard-filter-selection-summary,
body.theme-darkblue .dashboard-filter-selection-summary,
body.theme-darkgreen .dashboard-filter-selection-summary {
    color: rgba(241, 247, 248, 0.92);
}

body.theme-dunkel .dashboard-filter-card,
body.theme-darkblue .dashboard-filter-card,
body.theme-darkgreen .dashboard-filter-card {
    background: rgba(34, 45, 54, 0.96);
    border-color: rgba(255, 255, 255, 0.12);
}

body.theme-dunkel .dashboard-filter-card-name,
body.theme-darkblue .dashboard-filter-card-name,
body.theme-darkgreen .dashboard-filter-card-name {
    color: #eef6f7;
}

body.theme-dunkel .dashboard-filter-card-status.is-active,
body.theme-darkblue .dashboard-filter-card-status.is-active,
body.theme-darkgreen .dashboard-filter-card-status.is-active {
    background: rgba(126, 185, 138, 0.22);
    color: #e7f7ea;
}

body.theme-dunkel .dashboard-filter-card-status.is-inactive,
body.theme-darkblue .dashboard-filter-card-status.is-inactive,
body.theme-darkgreen .dashboard-filter-card-status.is-inactive {
    background: rgba(199, 156, 190, 0.16);
    color: #f0dfeb;
}

body.theme-dunkel .dashboard-filter-card-body,
body.theme-darkblue .dashboard-filter-card-body,
body.theme-darkgreen .dashboard-filter-card-body,
body.theme-dunkel .dashboard-filter-card-toggle,
body.theme-darkblue .dashboard-filter-card-toggle,
body.theme-darkgreen .dashboard-filter-card-toggle {
    color: rgba(238, 246, 247, 0.7);
}

body.theme-dunkel .dashboard-filter-card-editor,
body.theme-darkblue .dashboard-filter-card-editor,
body.theme-darkgreen .dashboard-filter-card-editor {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.10);
}

body.theme-dunkel .dashboard-filter-card-editor-field,
body.theme-darkblue .dashboard-filter-card-editor-field,
body.theme-darkgreen .dashboard-filter-card-editor-field {
    color: #eef6f7;
}

body.theme-dunkel .dashboard-filter-card-editor-field input,
body.theme-darkblue .dashboard-filter-card-editor-field input,
body.theme-darkgreen .dashboard-filter-card-editor-field input,
body.theme-dunkel .dashboard-filter-card-editor-field select,
body.theme-darkblue .dashboard-filter-card-editor-field select,
body.theme-darkgreen .dashboard-filter-card-editor-field select {
    background: rgba(34, 45, 54, 0.9);
    color: #eef6f7;
    border-color: rgba(255, 255, 255, 0.18);
}

body.theme-dunkel .dashboard-filter-card-auto-name,
body.theme-darkblue .dashboard-filter-card-auto-name,
body.theme-darkgreen .dashboard-filter-card-auto-name {
    background: rgba(34, 45, 54, 0.9);
    color: #eef6f7;
    border-color: rgba(255, 255, 255, 0.18);
}

body.theme-dunkel .dashboard-filter-mgmt-column-title,
body.theme-darkblue .dashboard-filter-mgmt-column-title,
body.theme-darkgreen .dashboard-filter-mgmt-column-title {
    color: #eef6f7;
}

body.theme-dunkel .dashboard-filter-empty-note,
body.theme-darkblue .dashboard-filter-empty-note,
body.theme-darkgreen .dashboard-filter-empty-note {
    background: rgba(255, 255, 255, 0.05);
    color: #f1f7f8;
    border-color: rgba(255, 255, 255, 0.18);
}

@media (max-width: 900px) {
    .dashboard-filter-picker {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .dashboard-filter-icons {
        flex: 1 1 100%;
        overflow-x: auto;
    }

    .dashboard-filter-toolbar-actions {
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .dashboard-filter-mgmt-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {

    .dashboard-filter-criteria-table,
    .dashboard-filter-criteria-table thead,
    .dashboard-filter-criteria-table tbody,
    .dashboard-filter-criteria-table tr,
    .dashboard-filter-criteria-table th,
    .dashboard-filter-criteria-table td {
        display: block;
        width: 100%;
    }

    .dashboard-filter-criteria-table thead {
        display: none;
    }

    .dashboard-filter-criteria-cell {
        padding: 8px 12px;
    }

    .dashboard-filter-criteria-cell--actions {
        text-align: left;
    }
}

/* === Project open page: kompaktes Inline-Header-Layout === */
.project-open-page .project-open-hero {
    margin-bottom: 14px
}

.project-open-page .project-open-hero h1 {
    font-size: clamp(20px, 2vw, 26px);
    margin: 0 0 2px 0
}

.project-open-header-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 6px 18px;
    margin: 8px 0 14px;
    background: var(--project-open-card, transparent);
    border: 1px solid var(--project-open-line, rgba(0, 0, 0, .08));
    border-radius: var(--project-open-radius, 8px);
    padding: 10px 14px;
    box-shadow: var(--project-open-shadow, none)
}

.project-open-header-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 10px;
    padding: 2px 0
}

.project-open-header-label {
    color: var(--project-open-muted, #666);
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase
}

.project-open-header-value-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0
}

.project-open-header-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 500
}

.project-open-header-input-slot {
    flex: 1 1 auto;
    min-width: 0
}

.project-open-header-input-slot input,
.project-open-header-input-slot select,
.project-open-header-input-slot textarea {
    width: 100%
}

.project-open-header-input-slot textarea {
    min-height: 90px;
    max-width: none;
    resize: both;
    overflow: auto;
}

.project-open-description-row .project-open-header-value-wrap,
.project-open-description-row .project-open-header-input-slot {
    overflow: visible;
}

.project-open-header-edit-toggle {
    background: none;
    border: 0;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    line-height: 1
}

.project-open-description-row {
    grid-template-columns: 120px 1fr;
    display: grid;
    align-items: start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 8px 14px;
    background: var(--project-open-card, transparent);
    border: 1px solid var(--project-open-line, rgba(0, 0, 0, .08));
    border-radius: var(--project-open-radius, 8px)
}

.project-open-description-row .project-open-header-value {
    white-space: pre-wrap
}

.project-open-tasks .tasks-list {
    display: block
}

.task-desc-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px
}

.task-desc-link:hover {
    color: var(--project-open-accent, #1a73e8)
}

/* === Project open page: Aufgabenliste in eigenem Feld + alle Spalten sichtbar === */
.project-open-page .project-open-tasks {
    background: var(--project-open-card, transparent);
    border: 1px solid var(--project-open-line, rgba(0, 0, 0, .08));
    border-radius: var(--project-open-radius, 8px);
    padding: 10px 14px !important;
    margin: 0 0 18px;
    box-shadow: var(--project-open-shadow, none);
    overflow: hidden;
}

.project-open-page .project-open-tasks::before {
    display: none
}

.project-open-page .project-open-tasks .tasks-head,
.project-open-page .project-open-tasks .task-row {
    display: grid;
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    grid-template-columns: 65px minmax(0, 1.4fr) minmax(0, 1.4fr) 70px 70px 90px 110px 110px 90px;
    width: 100%;
    max-width: 100%;
}

.project-open-page .project-open-tasks .task-row>div,
.project-open-page .project-open-tasks .tasks-head>div {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-open-page .project-open-tasks .task-col-desc,
.project-open-page .project-open-tasks .task-col-comment {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.project-open-page .project-open-tasks .task-actions {
    white-space: nowrap;
    text-align: right;
}

.project-task-notes-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 26px;
    height: 28px;
    padding: 1px 7px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: inherit;
    cursor: pointer;
}

.project-task-notes-toggle:hover,
.project-task-notes-toggle:focus-visible {
    border-color: #0d6efd;
    color: #0d6efd;
    outline: 0;
}

.project-task-notes-toggle--empty {
    cursor: default;
    opacity: 0.7;
}

.project-task-notes-panel {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid var(--project-open-line, rgba(0, 0, 0, .08));
    border-top: 0;
    border-radius: 0 0 var(--project-open-radius, 8px) var(--project-open-radius, 8px);
    background: rgba(15, 23, 42, 0.025);
}

.project-task-note-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Nachrichten: kompakte Benutzerliste, bewusst ohne Live-Polling */
.messages-page {
    width: min(1180px, calc(100% - 32px));
    margin: 22px auto 38px;
}

.messages-page-heading {
    margin-bottom: 12px;
}

.messages-page-heading h1 {
    margin: 0 0 3px;
    font-size: 28px;
}

.messages-page-heading p {
    margin: 0;
    color: #667085;
    font-size: 13px;
}

.messages-local-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.messages-local-unread[hidden] {
    display: none;
}

.messages-sidebar .sidebar-search {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    padding: 7px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
    background: rgba(255, 255, 255, .96);
}

.messages-sidebar .sidebar-search input {
    width: 100%;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 6px;
    background: #fff;
    color: #101828;
    font-size: 12px;
}

.messages-sidebar .sidebar-search input:focus {
    border-color: #274690;
    outline: 2px solid rgba(39, 70, 144, .14);
}

.messages-widget .sidebar-item {
    position: relative;
    width: 100%;
    padding-right: 54px;
}

.messages-widget .sidebar-item > .meta {
    position: absolute;
    top: 9px;
    right: 8px;
}

.messages-widget .sidebar-item.is-inactive {
    opacity: .62;
}

.messages-sidebar-empty {
    margin: 0;
    padding: 12px 10px;
    color: #667085;
    font-size: 11px;
}

.messages-main {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.messages-conversation-header {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    font-size: 12px;
}

.messages-load-older {
    flex: 0 0 auto;
    align-self: center;
    justify-self: center;
    margin: 5px 0 0;
    padding: 3px 9px;
    border: 0;
    border-radius: 999px;
    background: rgba(39, 70, 144, .09);
    color: #274690;
    font-size: 10px;
    cursor: pointer;
}

.messages-load-older[hidden] {
    display: none;
}

.messages-conversation-content {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.messages-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 18px;
    color: #667085;
    text-align: center;
}

.messages-empty-state[hidden] {
    display: none;
}

.messages-conversation-content .messages-body {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

.messages-widget .msg-row.is-system {
    width: min(92%, 680px);
    align-self: center;
    margin: 4px 0;
}

.messages-widget .msg-bubble.is-system {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid rgba(196, 135, 20, .42);
    border-left: 3px solid #c48714;
    border-radius: 5px;
    background: rgba(255, 248, 226, .75);
}

.msg-system-label {
    color: #805600;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.msg-system-action {
    margin-top: 3px;
    color: #274690;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
}

.msg-system-action:hover,
.msg-system-action:focus-visible {
    text-decoration: underline;
}

.messages-form input[type="text"] {
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 6px;
    background: #fff;
    color: #101828;
}

.messages-main > .messages-form {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    width: 100%;
    box-sizing: border-box;
    background: inherit;
}

.messages-form input[type="text"]:focus {
    border-color: #274690;
    outline: 2px solid rgba(39, 70, 144, .14);
}

.messages-form.is-disabled input {
    background: rgba(0, 0, 0, .035);
}

.messages-status {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 10px 3px;
    color: #198754;
    font-size: 10px;
}

.messages-status:empty {
    display: none;
}

.messages-status.is-error {
    color: #b42318;
}

.messages-widget--full .messages-inner {
    height: min(680px, calc(100vh - 185px));
    height: clamp(320px, calc(100dvh - 185px), 680px);
    min-height: 320px;
    grid-template-columns: 220px minmax(0, 1fr);
}

.messages-widget--full .msg-content {
    font-size: 13px;
}

body.theme-dunkel .messages-page-heading p,
body.theme-darkblue .messages-page-heading p,
body.theme-darkgreen .messages-page-heading p {
    color: rgba(255, 255, 255, .68);
}

body.theme-dunkel .messages-sidebar .sidebar-search,
body.theme-darkblue .messages-sidebar .sidebar-search,
body.theme-darkgreen .messages-sidebar .sidebar-search,
body.theme-dunkel .messages-conversation-header,
body.theme-darkblue .messages-conversation-header,
body.theme-darkgreen .messages-conversation-header {
    border-color: rgba(255, 255, 255, .12);
}

body.theme-dunkel .messages-sidebar .sidebar-search,
body.theme-darkblue .messages-sidebar .sidebar-search,
body.theme-darkgreen .messages-sidebar .sidebar-search {
    background: rgba(20, 24, 30, .96);
}

body.theme-dunkel .messages-sidebar-empty,
body.theme-darkblue .messages-sidebar-empty,
body.theme-darkgreen .messages-sidebar-empty {
    color: rgba(255, 255, 255, .66);
}

body.theme-dunkel .messages-widget .msg-bubble.is-system,
body.theme-darkblue .messages-widget .msg-bubble.is-system,
body.theme-darkgreen .messages-widget .msg-bubble.is-system {
    border-color: rgba(239, 184, 63, .5);
    border-left-color: #efb83f;
    background: rgba(239, 184, 63, .12);
}

body.theme-dunkel .msg-system-label,
body.theme-darkblue .msg-system-label,
body.theme-darkgreen .msg-system-label,
body.theme-dunkel .msg-system-action,
body.theme-darkblue .msg-system-action,
body.theme-darkgreen .msg-system-action {
    color: #ffd479;
}

@media (max-width: 760px) {
    .messages-page {
        width: calc(100% - 16px);
        margin-top: 12px;
    }

    .messages-inner,
    .messages-widget--full .messages-inner {
        height: auto;
        min-height: 520px;
        grid-template-columns: 1fr;
        grid-template-rows: 150px minmax(350px, 1fr);
    }

    .messages-sidebar {
        border-right: 0;
        border-bottom: 1px solid rgba(0, 0, 0, .08);
    }
}

/* ==========================================================================
   Semantische Typografie
   Die Kompatibilitätsklassen bleiben bestehen, werden aber auf sechs verständliche
   Rollen zusammengeführt. Die gezielten Rollen-Zuordnungen haben genug Spezifität,
   um alte Größen zu ersetzen; Farben bleiben bewusst leicht überschreibbar, damit
   Statusfarben und fachliche Badges weiterhin Vorrang haben.
   ========================================================================== */
body[class*="theme-"] {
    font-family: var(--pmh-type-body-family);
    font-size: var(--pmh-type-body-size);
    font-weight: var(--pmh-type-body-weight);
    line-height: var(--pmh-type-body-line-height);
    color: var(--pmh-type-body-color, var(--pmh-text));
}

:where(p, li, dd) {
    font-family: var(--pmh-type-body-family);
    line-height: var(--pmh-type-body-line-height);
    color: var(--pmh-type-body-color, inherit);
}

:where(h1, h2, h3, h4) {
    font-family: var(--pmh-type-heading-family);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
    color: var(--pmh-type-heading-color, inherit);
}

:where(button, .btn, input, select, textarea) {
    font-family: var(--pmh-type-control-family);
    font-size: var(--pmh-type-control-size);
    font-weight: var(--pmh-type-control-weight);
    line-height: var(--pmh-type-control-line-height);
}

:where(table tbody td, .task-row > div, .overview-list li) {
    font-family: var(--pmh-type-table-family);
    font-size: var(--pmh-type-table-size);
    font-weight: var(--pmh-type-table-weight);
    line-height: var(--pmh-type-table-line-height);
}

:where(table thead th, .tasks-head > div, .todo-header, label, .form-label) {
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-label-size);
    font-weight: var(--pmh-type-label-weight);
    line-height: var(--pmh-type-label-line-height);
}

:where(small, .todo-note-meta, .task-meta) {
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: var(--pmh-type-meta-weight);
    line-height: var(--pmh-type-meta-line-height);
}

body[class*="theme-"] :is(.pmh-global-base, .pmhtext1, .pmhtext2, .open-value, .verb-value, .messages-body) {
    font-family: var(--pmh-type-body-family);
    font-size: var(--pmh-type-body-size);
    font-weight: var(--pmh-type-body-weight);
    line-height: var(--pmh-type-body-line-height);
}

body[class*="theme-"] :is(.pmh-global-headings, .open-section-title, .ua-title, .card-title, .typography-heading) {
    font-family: var(--pmh-type-heading-family);
    font-size: var(--pmh-type-heading-size);
    font-weight: var(--pmh-type-heading-weight);
    line-height: var(--pmh-type-heading-line-height);
}

body[class*="theme-"] :is(.pmh-global-form, .pmh-global-button, .pmh3, .pmh4, .save-btn, .main-nav-link, .nav-account-item, .nav-account-item-button) {
    font-family: var(--pmh-type-control-family);
    font-size: var(--pmh-type-control-size);
    font-weight: var(--pmh-type-control-weight);
    line-height: var(--pmh-type-control-line-height);
}

body[class*="theme-"] :is(.pmh-table-cell, .task-row > div, .overview-list li, .pmhtext3, .pmhtext4, .pmhtext5, .pmh-chat-user, .pmh-chat-message) {
    font-family: var(--pmh-type-table-family);
    font-size: var(--pmh-type-table-size);
    font-weight: var(--pmh-type-table-weight);
    line-height: var(--pmh-type-table-line-height);
}

body[class*="theme-"] :is(.tasks-head > div, .todo-header, .form-label, .nav-account-section > summary, .pmh-table-head-lg, .pmh-table-head-sm, .pmh-chat-header) {
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-label-size);
    font-weight: var(--pmh-type-label-weight);
    line-height: var(--pmh-type-label-line-height);
}

body[class*="theme-"] :is(.pmhmeta1, .pmhmeta2, .todo-note-meta, .task-meta, .pmh-chat-user-meta, .pmh-chat-message-meta, .pmh-chat-daysep) {
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: var(--pmh-type-meta-weight);
    line-height: var(--pmh-type-meta-line-height);
}

:where(.pmh-global-base, .pmhtext1, .pmhtext2, .open-value, .verb-value, .messages-body) {
    color: var(--pmh-type-body-color, inherit);
}

:where(.pmh-global-headings, .open-section-title, .ua-title, .card-title, .typography-heading) {
    color: var(--pmh-type-heading-color, inherit);
}

:where(.pmh3, .pmh4, .main-nav-link) {
    color: var(--pmh-type-control-color, inherit);
}

:where(table tbody td, .pmh-table-cell, .task-row > div, .overview-list li, .pmhtext3, .pmhtext4, .pmhtext5, .pmh-chat-user, .pmh-chat-message) {
    color: var(--pmh-type-table-color, inherit);
}

:where(table thead th, .tasks-head > div, .todo-header, label, .form-label, .pmh-table-head-lg, .pmh-table-head-sm, .pmh-chat-header) {
    color: var(--pmh-type-label-color, inherit);
}

:where(small, .pmhmeta1, .pmhmeta2, .todo-note-meta, .task-meta, .pmh-chat-user-meta, .pmh-chat-message-meta, .pmh-chat-daysep) {
    color: var(--pmh-type-meta-color, inherit);
}

/* ==========================================================================
   Zentraler Komponenten-Layer
   Ältere Einzelregeln bleiben kompatibel; diese abschließende Schicht sorgt dafür,
   dass alle Presets dieselben kontrastgeprüften Design-Tokens verwenden.
   ========================================================================== */
body[class*="theme-"] nav.main-nav {
    background: var(--pmh-nav-bg);
    color: var(--pmh-nav-text);
    border-color: var(--pmh-border);
    box-shadow: 0 3px 14px var(--pmh-shadow);
}

body[class*="theme-"] nav.main-nav :where(a, button, summary, .pmh3, .pmh4, .pmhmeta1, .pmhmeta2) {
    color: var(--pmh-nav-text);
}

body[class*="theme-"] nav.main-nav .nav-avatar-button,
body[class*="theme-"] nav.main-nav .nav-avatar-button:hover,
body[class*="theme-"] nav.main-nav .nav-avatar-button:focus-visible,
body[class*="theme-"] nav.main-nav .nav-account-menu[open] > .nav-avatar-button {
    background: var(--pmh-surface-soft);
    color: var(--pmh-text);
    border-color: var(--pmh-nav-text);
}

body[class*="theme-"] .nav-account-popover {
    background: var(--pmh-surface-raised);
    color: var(--pmh-text);
    border-color: var(--pmh-border);
    box-shadow: 0 18px 50px var(--pmh-shadow);
}

body[class*="theme-"] .nav-account-header,
body[class*="theme-"] .nav-account-section {
    border-color: var(--pmh-border);
}

body[class*="theme-"] .nav-account-avatar {
    background: var(--pmh-surface-soft);
    color: var(--pmh-text);
}

body[class*="theme-"] .nav-account-popover .nav-account-section > summary,
body[class*="theme-"] .nav-account-popover .nav-account-item,
body[class*="theme-"] .nav-account-popover .nav-account-item-button,
body[class*="theme-"] .nav-account-popover strong {
    color: var(--pmh-text);
}

body[class*="theme-"] .nav-account-popover :where(small, .nav-account-item-icon) {
    color: var(--pmh-text-muted);
}

body[class*="theme-"] .nav-account-popover :where(.nav-account-item, .nav-account-item-button):hover,
body[class*="theme-"] .nav-account-popover :where(.nav-account-item, .nav-account-item-button):focus-visible {
    background: var(--pmh-surface-soft);
    color: var(--pmh-text);
}

body[class*="theme-"] .nav-account-popover .nav-account-logout {
    color: var(--pmh-danger);
}

body[class*="theme-"] .nav-account-popover .nav-account-logout:hover,
body[class*="theme-"] .nav-account-popover .nav-account-logout:focus-visible {
    background: color-mix(in srgb, var(--pmh-danger) 12%, transparent);
    color: var(--pmh-danger);
}

body[class*="theme-"] a:not(.btn):not(.main-nav-link):not(.nav-account-item):not(.nav-account-logout) {
    color: var(--pmh-accent);
}

body[class*="theme-"] a:not(.btn):hover {
    color: var(--pmh-accent-hover);
}

body[class*="theme-"] .dashboard-panel,
body[class*="theme-"] .dashboard-overview-panel,
body[class*="theme-"] .modal-card,
body[class*="theme-"] .open-card,
body[class*="theme-"] .open-desc,
body[class*="theme-"] .open-table,
body[class*="theme-"] .user-edit-tablelayout-box,
body[class*="theme-"] .messages-widget,
body[class*="theme-"] .ua-panel,
body[class*="theme-"] .verb-card,
body[class*="theme-"] .todo-detail-info-card,
body[class*="theme-"] .entity-detail-meta-card,
body[class*="theme-"] .dashboard-filter-card,
body[class*="theme-"] .dashboard-filter-editor-card,
body[class*="theme-"] .typography-role-card {
    background: var(--pmh-surface);
    color: var(--pmh-text);
    border-color: var(--pmh-border);
    box-shadow: 0 10px 28px var(--pmh-shadow);
}

body[class*="theme-"] .dashboard-panel > header,
body[class*="theme-"] .dashboard-overview-panel > header,
body[class*="theme-"] .messages-header,
body[class*="theme-"] .user-edit-tablelayout-box__header,
body[class*="theme-"] .tasks-head,
body[class*="theme-"] .todo-header {
    background: var(--pmh-surface-soft);
    color: var(--pmh-type-label-color, var(--pmh-text));
    border-color: var(--pmh-border);
}

body[class*="theme-"] input:not([type="color"]):not([type="checkbox"]):not([type="radio"]),
body[class*="theme-"] select,
body[class*="theme-"] textarea,
body[class*="theme-"] .form-control,
body[class*="theme-"] .form-select {
    background: var(--pmh-input-bg);
    color: var(--pmh-input-text);
    border-color: var(--pmh-border-strong);
}

body[class*="theme-"] input::placeholder,
body[class*="theme-"] textarea::placeholder {
    color: var(--pmh-text-muted);
    opacity: 0.82;
}

body[class*="theme-"] input:focus,
body[class*="theme-"] select:focus,
body[class*="theme-"] textarea:focus,
body[class*="theme-"] button:focus-visible,
body[class*="theme-"] a:focus-visible {
    border-color: var(--pmh-focus);
    outline: 3px solid color-mix(in srgb, var(--pmh-focus) 32%, transparent);
    outline-offset: 2px;
}

body[class*="theme-"] .btn-primary,
body[class*="theme-"] .save-btn {
    background: var(--pmh-accent);
    border-color: var(--pmh-accent);
    color: var(--pmh-accent-contrast);
}

body[class*="theme-"] .btn-primary:hover,
body[class*="theme-"] .save-btn:hover {
    background: var(--pmh-accent-hover);
    border-color: var(--pmh-accent-hover);
    color: var(--pmh-accent-contrast);
}

body[class*="theme-"] .btn-outline-secondary,
body[class*="theme-"] .btn-secondary {
    border-color: var(--pmh-border-strong);
    color: var(--pmh-text);
}

body[class*="theme-"] table {
    color: var(--pmh-type-table-color, var(--pmh-text));
    border-color: var(--pmh-border);
}

body[class*="theme-"] table thead th {
    background: var(--pmh-surface-soft);
    color: var(--pmh-type-label-color, var(--pmh-text));
    border-color: var(--pmh-border);
}

body[class*="theme-"] table tbody td,
body[class*="theme-"] .task-row,
body[class*="theme-"] .overview-list li {
    background-color: var(--pmh-surface);
    color: var(--pmh-type-table-color, var(--pmh-text));
    border-color: var(--pmh-border);
}

body[class*="theme-"] :where(.text-muted, .todo-note-meta, .task-meta, .open-label, .typography-admin__eyebrow) {
    color: var(--pmh-text-muted) !important;
}

/* ==========================================================================
   Admin: Typografie-Vorschau
   ========================================================================== */
.typography-admin {
    width: min(1240px, calc(100% - 32px));
    margin: 28px auto 52px;
}

.typography-admin__hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
}

.typography-admin__hero h1 {
    margin: 4px 0 8px;
    font-size: clamp(28px, 3vw, 40px);
}

.typography-admin__hero p {
    max-width: 780px;
    margin: 0;
    color: var(--pmh-text-muted);
}

.typography-admin__eyebrow {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.typography-admin__legend {
    display: flex;
    gap: 14px;
    padding: 10px 14px;
    border: 1px solid var(--pmh-border);
    border-radius: 999px;
    background: var(--pmh-surface);
    white-space: nowrap;
}

.typography-admin__legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
}

.typography-admin__legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #8793a0;
    border-radius: 50%;
}

.typography-admin__legend-dot--light {
    background: #ffffff;
}

.typography-admin__legend-dot--dark {
    background: #17202a;
}

.typography-admin__flash {
    margin-bottom: 16px;
}

.typography-admin__principles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.typography-admin__principles article {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid var(--pmh-border);
    border-radius: 14px;
    background: var(--pmh-surface-soft);
}

.typography-admin__principles span {
    color: var(--pmh-text-muted);
    font-size: 12px;
    line-height: 1.45;
}

.typography-admin__roles {
    display: grid;
    gap: 18px;
}

.typography-role-card {
    overflow: hidden;
    border: 1px solid var(--pmh-border);
    border-radius: 20px;
}

.typography-role-card__header {
    display: grid;
    grid-template-columns: minmax(240px, 0.65fr) 1fr;
    gap: 20px;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--pmh-border);
}

.typography-role-card__header > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.typography-role-card__header h2 {
    margin: 0;
    font-size: 19px;
}

.typography-role-card__header p {
    margin: 0;
    color: var(--pmh-text-muted);
    font-size: 13px;
}

.typography-role-card__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--pmh-surface-soft);
    color: var(--pmh-accent);
    font-size: 11px;
    font-weight: 800;
}

.typography-role-card__previews {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.typography-preview {
    display: flex;
    min-height: 160px;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    font-family: var(--preview-family);
    font-size: var(--preview-size);
    font-weight: var(--preview-weight);
    line-height: var(--preview-line-height);
}

.typography-preview--light {
    background: linear-gradient(135deg, #ffffff, #edf1f5);
    color: var(--preview-light-color);
}

.typography-preview--dark {
    background: linear-gradient(135deg, #182029, #293440);
    color: var(--preview-dark-color);
}

.typography-preview__mode {
    align-self: flex-start;
    margin-bottom: 18px;
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    opacity: 0.72;
    text-transform: uppercase;
}

.typography-preview__title {
    display: block;
    margin-bottom: 5px;
    font: inherit;
}

.typography-preview__text {
    display: block;
    font: inherit;
}

.typography-preview__context {
    display: block;
    margin-top: 14px;
    font-family: system-ui, sans-serif;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.35;
    opacity: 0.7;
}

.typography-role-card__controls {
    display: grid;
    grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(120px, 0.7fr)) repeat(2, minmax(155px, 0.9fr));
    gap: 12px;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--pmh-border);
    background: var(--pmh-surface-raised);
}

.typography-control {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.typography-control > span:first-child {
    color: var(--pmh-type-label-color);
    font-size: 11px;
    font-weight: 700;
}

.typography-control small {
    color: var(--pmh-text-muted);
    font-size: 10px;
}

.typography-contrast.is-readable {
    color: var(--pmh-accent);
    font-weight: 700;
}

.typography-contrast.is-unreadable {
    color: var(--pmh-danger);
    font-weight: 700;
}

.typography-control--light {
    padding-left: 10px;
    border-left: 3px solid #d5dbe1;
}

.typography-control--dark {
    padding-left: 10px;
    border-left: 3px solid #46515d;
}

.typography-color-input {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 38px;
    padding: 4px 8px 4px 4px;
    border: 1px solid var(--pmh-border);
    border-radius: 8px;
    background: var(--pmh-input-bg);
}

.typography-color-input input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
}

.typography-color-input code {
    color: var(--pmh-input-text);
    font-size: 11px;
}

.typography-admin__actions {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--pmh-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--pmh-surface) 92%, transparent);
    box-shadow: 0 16px 38px var(--pmh-shadow);
    backdrop-filter: blur(14px);
}

.typography-admin__actions > div {
    display: grid;
    flex: 1 1 auto;
}

.typography-admin__actions span {
    color: var(--pmh-text-muted);
    font-size: 11px;
}

@media (max-width: 1080px) {
    .typography-role-card__controls {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .typography-control--family {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .typography-admin {
        width: min(100% - 16px, 1240px);
        margin-top: 16px;
    }

    .typography-admin__hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .typography-admin__principles,
    .typography-role-card__previews,
    .typography-role-card__header,
    .typography-role-card__controls {
        grid-template-columns: 1fr;
    }

    .typography-control--family {
        grid-column: auto;
    }

    .typography-admin__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .typography-admin__actions .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Projekt-Zeitstrahl und Kapazitätsplanung
   ========================================================================== */
.timeline-page-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
}

.timeline-page-body > nav.main-nav { flex: 0 0 auto; }

.project-timeline-page {
    --project-timeline-day-width: 30px;
    --project-timeline-label-width: 310px;
    --project-timeline-grid-line: color-mix(in srgb, var(--pmh-border) 72%, transparent);
    --project-timeline-weekend: color-mix(in srgb, var(--pmh-surface-soft) 68%, transparent);
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    box-sizing: border-box;
    min-height: 0;
    max-width: 100%;
    padding: 12px clamp(12px, 2vw, 30px) 8px;
    overflow: hidden;
    color: var(--pmh-text);
}

.project-timeline-page.is-one-week {
    --project-timeline-day-width: clamp(72px, calc((100vw - var(--project-timeline-label-width) - 70px) / 7), 150px);
}

.project-timeline-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex: 0 0 auto;
    margin-bottom: 8px;
}

.project-timeline-page :is(h1, h2) {
    margin: 0;
    color: var(--pmh-type-heading-color);
}

.project-timeline-period-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.project-timeline-auto-plan-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 11px;
    border: 1px solid color-mix(in srgb, var(--pmh-accent) 60%, var(--pmh-border));
    border-radius: 9px;
    background: color-mix(in srgb, var(--pmh-accent) 10%, var(--pmh-surface));
    color: var(--pmh-accent);
    font-family: var(--pmh-type-control-family);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    box-shadow: 0 2px 8px var(--pmh-shadow);
}

.project-timeline-auto-plan-button svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: currentColor;
}

.project-timeline-auto-plan-button:hover,
.project-timeline-auto-plan-button:focus-visible {
    border-color: var(--pmh-accent);
    background: color-mix(in srgb, var(--pmh-accent) 17%, var(--pmh-surface));
    color: var(--pmh-accent);
    outline: 0;
    box-shadow: inset 0 0 0 1px var(--pmh-accent), 0 3px 10px var(--pmh-shadow);
}

.project-timeline-period-buttons {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--pmh-border-strong);
    border-radius: 9px;
    background: var(--pmh-surface);
    box-shadow: 0 2px 8px var(--pmh-shadow);
}

.project-timeline-period-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 5px 10px;
    border-right: 1px solid var(--pmh-border);
    color: var(--pmh-text);
    font-family: var(--pmh-type-control-family);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    text-decoration: none;
    transition: color .15s ease, background .15s ease;
}

.project-timeline-period-button:last-child { border-right: 0; }
.project-timeline-period-button svg,
.project-timeline-weeks-select > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.project-timeline-period-button.is-today {
    background: color-mix(in srgb, var(--pmh-accent) 11%, var(--pmh-surface));
    color: var(--pmh-accent);
}
.project-timeline-period-button:hover,
.project-timeline-period-button:focus-visible {
    background: var(--pmh-surface-soft);
    color: var(--pmh-accent);
    outline: 0;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pmh-accent) 45%, transparent);
}

.project-timeline-weeks-select {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 112px;
    color: var(--pmh-accent);
}

.project-timeline-weeks-select .form-select {
    width: 100%;
    min-height: 34px;
    padding-left: 30px;
    border-color: var(--pmh-border-strong);
    border-radius: 9px;
    background-color: var(--pmh-input-bg);
    color: var(--pmh-input-text);
    font-size: 12px;
    font-weight: 650;
    box-shadow: 0 2px 8px var(--pmh-shadow);
}
.project-timeline-weeks-select > svg { position: absolute; left: 9px; z-index: 1; pointer-events: none; }

.project-timeline-status {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 2200;
    max-width: min(420px, calc(100vw - 36px));
    margin-bottom: 12px;
    padding: 9px 12px;
    border: 1px solid var(--pmh-accent);
    border-radius: 9px;
    background: color-mix(in srgb, var(--pmh-accent) 12%, var(--pmh-surface));
    color: var(--pmh-text);
}

.project-timeline-status.is-error {
    border-color: var(--pmh-danger);
    background: color-mix(in srgb, var(--pmh-danger) 12%, var(--pmh-surface));
}

.project-timeline-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 7px;
    flex: 0 0 auto;
    margin-bottom: 7px;
}

.project-timeline-summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 1px 8px;
    min-height: 38px;
    padding: 4px 9px;
    border: 1px solid var(--pmh-border);
    border-radius: 8px;
    background: var(--pmh-surface-raised);
    box-shadow: 0 3px 10px var(--pmh-shadow);
}

.project-timeline-summary-card > span,
.project-timeline-summary-card small {
    min-width: 0;
    overflow: hidden;
    color: var(--pmh-text-muted);
    font-size: 9px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.project-timeline-summary-card > span {
    grid-column: 1;
    grid-row: 1;
    font-size: 10px;
    font-weight: 650;
}
.project-timeline-summary-card small {
    grid-column: 1 / -1;
    grid-row: 2;
}
.project-timeline-summary-card strong {
    grid-column: 2;
    grid-row: 1;
    color: var(--pmh-type-heading-color);
    font-size: 17px;
    line-height: 1;
}

.project-timeline-summary-card.is-warning {
    border-color: var(--pmh-danger);
    background: color-mix(in srgb, var(--pmh-danger) 8%, var(--pmh-surface-raised));
}

.project-timeline-summary-card.is-filter {
    color: inherit;
    text-decoration: none !important;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.project-timeline-summary-card.is-filter:hover,
.project-timeline-summary-card.is-filter:focus-visible {
    border-color: var(--pmh-accent);
    box-shadow: 0 5px 14px var(--pmh-shadow);
    transform: translateY(-1px);
    outline: 0;
}

.project-timeline-summary-card.is-filter.is-active {
    border-color: var(--pmh-accent);
    background: color-mix(in srgb, var(--pmh-accent) 14%, var(--pmh-surface-raised));
    box-shadow: inset 0 0 0 1px var(--pmh-accent), 0 3px 10px var(--pmh-shadow);
}

.project-timeline-auto-plan-result {
    display: flex;
    align-items: center;
    gap: 6px 12px;
    flex: 0 0 auto;
    margin-bottom: 7px;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--bs-success, #198754) 55%, var(--pmh-border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--bs-success, #198754) 9%, var(--pmh-surface));
    color: var(--pmh-text);
    font-size: 11px;
}

.project-timeline-auto-plan-result span { color: var(--pmh-text-muted); }

.project-timeline-auto-plan {
    display: grid;
    grid-template-columns: minmax(180px, .7fr) auto minmax(300px, 1.5fr);
    gap: 7px 14px;
    flex: 0 0 auto;
    min-height: 0;
    max-height: 265px;
    margin-bottom: 7px;
    padding: 9px 11px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--pmh-accent) 55%, var(--pmh-border));
    border-radius: 11px;
    background: color-mix(in srgb, var(--pmh-accent) 5%, var(--pmh-surface-raised));
    box-shadow: 0 6px 18px var(--pmh-shadow);
}

.project-timeline-auto-plan__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    grid-column: 1;
    grid-row: 1;
}

.project-timeline-auto-plan__heading h3 {
    margin: 1px 0 0;
    color: var(--pmh-type-heading-color);
    font-size: 15px;
}

.project-timeline-auto-plan__eyebrow {
    color: var(--pmh-accent);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.project-timeline-auto-plan__close {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    flex: 0 0 24px;
    border-radius: 50%;
    color: var(--pmh-text-muted);
    font-size: 19px;
    line-height: 1;
    text-decoration: none !important;
}

.project-timeline-auto-plan__close:hover,
.project-timeline-auto-plan__close:focus-visible { background: var(--pmh-surface-soft); color: var(--pmh-text); outline: 0; }

.project-timeline-auto-plan__metrics {
    display: flex;
    align-items: center;
    gap: 6px;
    grid-column: 2;
    grid-row: 1;
}

.project-timeline-auto-plan__metrics > span {
    display: grid;
    min-width: 76px;
    padding: 4px 7px;
    border: 1px solid var(--pmh-border);
    border-radius: 7px;
    background: var(--pmh-surface);
}

.project-timeline-auto-plan__metrics small { color: var(--pmh-text-muted); font-size: 8px; text-transform: uppercase; }
.project-timeline-auto-plan__metrics strong { color: var(--pmh-type-heading-color); font-size: 13px; }
.project-timeline-auto-plan__metrics .is-success { border-color: color-mix(in srgb, var(--bs-success, #198754) 50%, var(--pmh-border)); }
.project-timeline-auto-plan__metrics .is-warning { border-color: color-mix(in srgb, var(--pmh-danger) 55%, var(--pmh-border)); }

.project-timeline-auto-plan__explanation {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    margin: 0;
    color: var(--pmh-text-muted);
    font-size: 10px;
    line-height: 1.35;
}

.project-timeline-auto-plan__list {
    grid-column: 1 / -1;
    max-height: 112px;
    overflow: auto;
    border-block: 1px solid var(--pmh-border);
}

.project-timeline-auto-plan__change {
    display: grid;
    grid-template-columns: minmax(210px, 1.4fr) minmax(120px, .7fr) 18px minmax(145px, .8fr);
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 4px 2px;
    border-bottom: 1px solid var(--pmh-border);
    color: var(--pmh-text);
    font-size: 10px;
}

.project-timeline-auto-plan__change:last-child { border-bottom: 0; }
.project-timeline-auto-plan__change > div { display: grid; min-width: 0; }
.project-timeline-auto-plan__change > div strong,
.project-timeline-auto-plan__change > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-timeline-auto-plan__change > div small,
.project-timeline-auto-plan__change > span small { color: var(--pmh-text-muted); font-size: 8px; }
.project-timeline-auto-plan__change > span { display: grid; }
.project-timeline-auto-plan__change > svg { width: 16px; fill: none; stroke: var(--pmh-accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.project-timeline-auto-plan__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    grid-column: 1 / -1;
}

.project-timeline-auto-plan__footer > div:first-child { display: grid; color: var(--pmh-text-muted); font-size: 9px; }
.project-timeline-auto-plan__actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.project-timeline-auto-plan__actions form { margin: 0; }

.project-timeline-auto-plan__empty {
    display: flex;
    align-items: center;
    gap: 8px 14px;
    grid-column: 2 / -1;
    align-self: center;
    color: var(--pmh-text-muted);
    font-size: 10px;
}

.project-timeline-auto-plan__empty strong { color: var(--pmh-type-heading-color); font-size: 12px; }
.project-timeline-auto-plan__empty .btn { margin-left: auto; white-space: nowrap; }

.project-timeline-legend-bar {
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
    margin-top: 4px;
    padding: 3px 7px;
    overflow-x: auto;
    border: 1px solid var(--pmh-border);
    border-radius: 7px;
    background: var(--pmh-surface);
}

.project-timeline-legend {
    display: flex;
    gap: 4px 11px;
    flex-wrap: nowrap;
    color: var(--pmh-text-muted);
    font-size: 10px;
}

.project-timeline-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.project-timeline-legend-swatch {
    width: 10px;
    height: 10px;
    border: 1px solid var(--pmh-border-strong);
    border-radius: 3px;
    background: var(--pmh-accent);
}

.project-timeline-legend-swatch.is-high { background: color-mix(in srgb, var(--pmh-accent) 52%, var(--pmh-danger)); }
.project-timeline-legend-swatch.is-risk { background: var(--pmh-danger); }
.project-timeline-legend-swatch.is-overdue {
    border-color: var(--pmh-danger);
    background:
        repeating-linear-gradient(135deg, transparent 0 4px, var(--pmh-danger) 4px 7px),
        var(--pmh-surface-raised);
}
.project-timeline-legend-swatch.is-weekend { background: var(--pmh-surface-soft); }

.project-timeline-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--pmh-border);
    border-radius: 14px;
    background: var(--pmh-surface);
    box-shadow: 0 12px 30px var(--pmh-shadow);
}

.project-timeline-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex: 0 0 auto;
    padding: 7px 11px;
    border-bottom: 1px solid var(--pmh-border);
}

.project-timeline-panel-heading h2 { font-size: 17px; }
.project-timeline-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    overflow: auto;
    overscroll-behavior-inline: contain;
    scrollbar-color: var(--pmh-border-strong) var(--pmh-surface-soft);
}

.project-timeline-board { width: max-content; min-width: 100%; }
.project-timeline-row {
    display: grid;
    grid-template-columns: var(--project-timeline-label-width) calc(var(--project-timeline-days) * var(--project-timeline-day-width));
    min-width: calc(var(--project-timeline-label-width) + (var(--project-timeline-days) * var(--project-timeline-day-width)));
}

.project-timeline-label {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 0;
    padding: 8px 11px;
    border-right: 1px solid var(--pmh-border-strong);
    border-bottom: 1px solid var(--pmh-border);
    background: var(--pmh-surface);
}

.project-timeline-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--project-timeline-days), var(--project-timeline-day-width));
    min-height: 42px;
    border-bottom: 1px solid var(--pmh-border);
    background-color: var(--pmh-surface);
    background-image:
        repeating-linear-gradient(to right, transparent 0 calc(var(--project-timeline-day-width) - 1px), var(--project-timeline-grid-line) calc(var(--project-timeline-day-width) - 1px) var(--project-timeline-day-width)),
        repeating-linear-gradient(to right, transparent 0 calc(var(--project-timeline-day-width) * 5), var(--project-timeline-weekend) calc(var(--project-timeline-day-width) * 5) calc(var(--project-timeline-day-width) * 7));
}

.project-timeline-track::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset-block: 0;
    left: calc((var(--project-timeline-today-column) - 1) * var(--project-timeline-day-width));
    width: 2px;
    background: color-mix(in srgb, var(--pmh-danger) 76%, transparent);
    pointer-events: none;
}

.project-timeline-axis-row { position: sticky; top: 0; z-index: 10; }
.project-timeline-label--axis {
    z-index: 12;
    display: flex;
    align-items: center;
    min-height: 58px;
    color: var(--pmh-type-heading-color);
    font-weight: 700;
    background: var(--pmh-surface-raised);
}

.project-timeline-project-filter {
    display: grid;
    grid-template-columns: auto minmax(130px, 1fr);
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.project-timeline-project-filter > span {
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: 10px;
    line-height: 1.1;
    white-space: nowrap;
}

.project-timeline-project-filter .form-select {
    min-width: 0;
    min-height: 32px;
    border-color: var(--pmh-border-strong);
    background-color: var(--pmh-input-bg);
    color: var(--pmh-input-text);
    font-size: 11px;
}

.project-timeline-axis { z-index: 9; min-height: 58px; background: var(--pmh-surface-raised); }
.project-timeline-day {
    z-index: 2;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 4px 1px;
    border-right: 1px solid var(--project-timeline-grid-line);
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    line-height: var(--pmh-type-meta-line-height);
}

.project-timeline-day strong { color: var(--pmh-text); font-size: var(--pmh-type-label-size); }
.project-timeline-day small { color: var(--pmh-accent); font-size: var(--pmh-type-meta-size); text-transform: uppercase; }
.project-timeline-day.is-weekend { background: var(--project-timeline-weekend); }
.project-timeline-day.is-today { background: color-mix(in srgb, var(--pmh-danger) 11%, var(--pmh-surface-raised)); }
.project-timeline-day.is-today strong { color: var(--pmh-danger); }

.project-timeline-section-row .project-timeline-label,
.project-timeline-section-track { min-height: 49px; background-color: var(--pmh-surface-soft); }
.project-timeline-label--section { display: grid; align-content: center; }
.project-timeline-label--section small,
.project-timeline-resource-label small,
.project-timeline-project-label small { display: block; color: var(--pmh-text-muted); font-size: 11px; }
.project-timeline-resource-label { display: grid; align-content: center; min-height: 40px; padding-block: 5px; }
.project-timeline-capacity-track { min-height: 40px; }
.project-timeline-capacity-row.is-current-user .project-timeline-label,
.project-timeline-capacity-row.is-current-user .project-timeline-track {
    background-color: color-mix(in srgb, var(--pmh-accent) 9%, var(--pmh-surface));
}
.project-timeline-capacity-row.is-current-user .project-timeline-label {
    box-shadow: inset 4px 0 0 var(--pmh-accent);
}
.project-timeline-self-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-left: 5px;
    padding: 1px 7px;
    border: 1px solid var(--pmh-accent);
    border-radius: 999px;
    background: var(--pmh-accent);
    color: var(--pmh-accent-contrast);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    line-height: 1;
}
.project-timeline-capacity-cell {
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 2px;
    border: 1px solid var(--pmh-border);
    border-radius: 4px;
    background: var(--pmh-surface-soft);
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-variant-numeric: tabular-nums;
}

.project-timeline-capacity-cell.is-medium { border-color: var(--pmh-accent); background: color-mix(in srgb, var(--pmh-accent) 28%, var(--pmh-surface)); color: var(--pmh-text); }
.project-timeline-capacity-cell.is-high { border-color: var(--pmh-accent); background: var(--pmh-accent); color: var(--pmh-accent-contrast); font-weight: 700; }
.project-timeline-capacity-cell.is-over { border-color: var(--pmh-danger); background: var(--pmh-danger); color: var(--pmh-accent-contrast); font-weight: 700; }

.project-timeline-project > summary { list-style: none; cursor: pointer; }
.project-timeline-project > summary::-webkit-details-marker { display: none; }
.project-timeline-project-label {
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    background: var(--pmh-surface-raised);
}

.project-timeline-project-toggle {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-right: 2px solid var(--pmh-accent);
    border-bottom: 2px solid var(--pmh-accent);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .15s ease;
}

.project-timeline-project:not([open]) .project-timeline-project-toggle { transform: rotate(-45deg); }
.project-timeline-project-track { min-height: 54px; background-color: var(--pmh-surface-raised); }
.project-timeline-project-due {
    position: sticky;
    right: 8px;
    z-index: 3;
    align-self: center;
    justify-self: end;
    grid-column: 1 / -1;
    margin-right: 8px;
    padding: 3px 7px;
    border: 1px solid var(--pmh-border);
    border-radius: 999px;
    background: var(--pmh-surface-raised);
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
}

.project-timeline-deadline-marker,
.project-timeline-task-deadline {
    z-index: 3;
    justify-self: end;
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: var(--pmh-danger);
    pointer-events: none;
}

.project-timeline-task-row {
    --project-timeline-drag-x: 0px;
    isolation: isolate;
}
.project-timeline-task-label {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "meta" "overdue" "controls";
    align-content: center;
    gap: 3px;
    min-height: 82px;
    padding-block: 5px;
    padding-left: 22px;
}
.project-timeline-projects.is-task-view .project-timeline-task-label { padding-left: 11px; }
.project-timeline-task-project {
    color: var(--pmh-accent);
    font-weight: 700;
}

.project-timeline-task-row.has-risk .project-timeline-task-label { box-shadow: inset 4px 0 0 var(--pmh-danger); }
.project-timeline-task-row.is-overdue .project-timeline-task-label {
    border-block-color: var(--pmh-danger);
    background:
        repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in srgb, var(--pmh-danger) 8%, transparent) 12px 20px),
        color-mix(in srgb, var(--pmh-danger) 7%, var(--pmh-surface));
    box-shadow: inset 5px 0 0 var(--pmh-danger);
}
.project-timeline-task-row.is-overdue .project-timeline-task-track {
    box-shadow: inset 0 2px 0 var(--pmh-danger), inset 0 -2px 0 var(--pmh-danger);
}
.project-timeline-task-title {
    grid-area: title;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--pmh-text);
    font-weight: 650;
}
.project-timeline-task-title-text {
    appearance: none;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.project-timeline-task-title-text:hover,
.project-timeline-task-title-text:focus-visible {
    color: var(--pmh-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: 0;
}
.project-timeline-delegation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 2px solid var(--pmh-surface);
    border-radius: 50%;
    background: var(--pmh-accent);
    box-shadow: 0 0 0 1px var(--pmh-border-strong);
    color: var(--pmh-accent-contrast);
    font-family: var(--pmh-type-label-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: 1;
}

.project-timeline-task-meta {
    grid-area: meta;
    display: flex;
    gap: 3px 6px;
    overflow: hidden;
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    white-space: nowrap;
}

.project-timeline-task-meta strong { color: var(--pmh-danger); }
.project-timeline-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border: 1px solid var(--pmh-border-strong);
    border-radius: 999px;
    background: var(--pmh-surface-soft);
    color: var(--pmh-text);
    line-height: 1.35;
}
.project-timeline-mode-badge.is-spread {
    border-color: var(--pmh-accent);
    background: color-mix(in srgb, var(--pmh-accent) 12%, var(--pmh-surface));
}
.project-timeline-overdue-notice {
    grid-area: overdue;
    display: flex;
    align-items: baseline;
    gap: 3px 6px;
    flex-wrap: wrap;
    padding: 2px 6px;
    border: 1px dashed var(--pmh-danger);
    border-radius: 6px;
    background: var(--pmh-surface-raised);
    color: var(--pmh-text);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    line-height: var(--pmh-type-meta-line-height);
}
.project-timeline-overdue-notice strong { color: var(--pmh-danger); text-transform: uppercase; letter-spacing: .035em; }
.project-timeline-task-controls {
    grid-area: controls;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 0;
}
.project-timeline-plan-field {
    display: grid;
    gap: 1px;
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: 600;
    line-height: 1.2;
}
.project-timeline-plan-field small { color: var(--pmh-text-muted); font: inherit; font-weight: 400; }
.project-timeline-plan-field input,
.project-timeline-task-controls input[type="date"] {
    min-height: 25px;
    padding: 2px 4px;
    border: 1px solid var(--pmh-border);
    border-radius: 5px;
    background: var(--pmh-input-bg);
    color: var(--pmh-input-text);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
}
.project-timeline-plan-field--estimate input { width: 56px; }
.project-timeline-plan-field--due input,
.project-timeline-plan-field--start input { width: 105px; }
.project-timeline-hours-input {
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    background: var(--pmh-input-bg);
    color: var(--pmh-text-muted);
}
.project-timeline-hours-input input { padding-right: 2px; }
.project-timeline-hours-input > span { padding: 0 6px 0 2px; }
.project-timeline-mode-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    gap: 4px;
    min-height: 25px;
    color: var(--pmh-text);
    cursor: pointer;
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: 650;
}
.project-timeline-mode-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.project-timeline-mode-switch-track {
    position: relative;
    width: 29px;
    height: 16px;
    flex: 0 0 29px;
    border: 1px solid var(--pmh-border-strong);
    border-radius: 999px;
    background: var(--pmh-surface-soft);
    transition: background-color .15s ease, border-color .15s ease;
}
.project-timeline-mode-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pmh-text-muted);
    transition: transform .15s ease, background-color .15s ease;
}
.project-timeline-mode-switch input:checked + .project-timeline-mode-switch-track {
    border-color: var(--pmh-accent);
    background: var(--pmh-accent);
}
.project-timeline-mode-switch input:checked + .project-timeline-mode-switch-track::after {
    background: var(--pmh-accent-contrast);
    transform: translateX(13px);
}
.project-timeline-mode-switch input:focus-visible + .project-timeline-mode-switch-track {
    outline: 3px solid color-mix(in srgb, var(--pmh-focus) 45%, transparent);
    outline-offset: 2px;
}
.project-timeline-plan-field[hidden] { display: none !important; }
.project-timeline-static-plan {
    display: flex;
    gap: 4px 10px;
    flex-wrap: wrap;
    color: var(--pmh-text-muted);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
}
.project-timeline-shift-controls { display: inline-flex; align-self: center; gap: 3px; }
.project-timeline-task-title > .project-timeline-shift-controls { flex: 0 0 auto; margin-left: auto; }

.project-timeline-shift-button {
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid var(--pmh-border);
    border-radius: 5px;
    background: var(--pmh-surface-soft);
    color: var(--pmh-text);
    cursor: pointer;
}

.project-timeline-shift-button:hover,
.project-timeline-shift-button:focus-visible { border-color: var(--pmh-accent); color: var(--pmh-accent); outline: 2px solid color-mix(in srgb, var(--pmh-focus) 32%, transparent); }
.project-timeline-task-date { color: var(--pmh-text-muted); font-family: var(--pmh-type-meta-family); font-size: var(--pmh-type-meta-size); }
.project-timeline-task-date.is-missing { color: var(--pmh-danger); }
.project-timeline-task-track { min-height: 82px; }
.project-timeline-task-segment {
    z-index: 2;
    align-self: center;
    min-width: 0;
    height: 28px;
    margin: 0 2px;
    padding: 0 1px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--pmh-accent) 72%, var(--pmh-border-strong));
    border-radius: 5px;
    background: var(--pmh-accent);
    color: var(--pmh-accent-contrast);
    font-family: var(--pmh-type-meta-family);
    font-size: var(--pmh-type-meta-size);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    transform: translateX(var(--project-timeline-drag-x));
    transition: transform .08s linear, opacity .12s ease, box-shadow .12s ease;
    touch-action: pan-y;
}

.project-timeline-task-segment::after {
    content: "";
    display: block;
    width: var(--project-timeline-segment-fill);
    height: 3px;
    margin: 3px auto 0 0;
    border-radius: 3px;
    background: currentColor;
    opacity: .72;
}

.project-timeline-task-segment.is-draggable { cursor: grab; }
.project-timeline-color-1 { background: var(--pmh-danger); border-color: var(--pmh-danger); color: var(--pmh-accent-contrast); }
body:is(.theme-hell, .theme-blue-light, .theme-green-light) .project-timeline-color-2 { background: #287a48; border-color: #1e6238; color: #fff; }
body:is(.theme-dunkel, .theme-darkblue, .theme-darkgreen) .project-timeline-color-2 { background: #6acd8b; border-color: #91dfaa; color: #102519; }
body:is(.theme-hell, .theme-blue-light, .theme-green-light) .project-timeline-color-3 { background: #8a4b08; border-color: #6f3b05; color: #fff; }
body:is(.theme-dunkel, .theme-darkblue, .theme-darkgreen) .project-timeline-color-3 { background: #f2bd62; border-color: #ffd58b; color: #2a1b05; }
.project-timeline-task-segment.is-overflow {
    border: 2px solid var(--pmh-danger);
    background-image: repeating-linear-gradient(
        135deg,
        transparent 0 5px,
        color-mix(in srgb, var(--pmh-danger) 48%, transparent) 5px 9px
    );
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--pmh-danger) 55%, transparent);
}
.project-timeline-task-row.is-overdue .project-timeline-task-segment {
    border: 2px solid var(--pmh-danger);
    background-image: repeating-linear-gradient(
        135deg,
        transparent 0 5px,
        color-mix(in srgb, var(--pmh-surface-raised) 48%, transparent) 5px 9px
    );
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--pmh-danger) 55%, transparent);
}
.project-timeline-task-row.is-dragging .project-timeline-task-segment { z-index: 7; cursor: grabbing; box-shadow: 0 5px 13px var(--pmh-shadow); }
.project-timeline-task-row.is-saving { opacity: .58; }
.project-timeline-task-empty,
.project-timeline-empty-track { z-index: 2; align-self: center; grid-column: 1 / -1; margin-left: 9px; color: var(--pmh-text-muted); font-size: 11px; }
.project-timeline-footnote {
    flex: 0 0 auto;
    margin-top: 4px;
    overflow: hidden;
    color: var(--pmh-text-muted);
    font-size: 10px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1320px) {
    .timeline-page-body .main-nav .nav-clock { display: none; }
    .project-timeline-page { --project-timeline-label-width: 290px; }
}

@media (max-width: 1100px) {
    .timeline-page-body .main-nav .nav-global-search { display: none; }
    .project-timeline-summary { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .project-timeline-page-header { align-items: flex-start; flex-direction: column; }
    .project-timeline-legend { justify-content: flex-start; }
}

@media (max-width: 700px) {
    .timeline-page-body nav.main-nav { flex-wrap: wrap; }
    .timeline-page-body .main-nav .nav-center { display: none; }
    .timeline-page-body .main-nav .nav-right {
        order: 3;
        width: 100%;
        min-height: 38px;
        padding-top: 4px;
        overflow-x: auto;
        justify-content: flex-start;
    }
    .project-timeline-page { --project-timeline-day-width: 28px; --project-timeline-label-width: 220px; padding: 8px 8px 5px; }
    .project-timeline-panel-heading { align-items: flex-start; flex-direction: column; }
    .project-timeline-summary { grid-template-columns: 1fr 1fr; gap: 7px; }
    .project-timeline-summary-card { min-height: 38px; padding: 4px 7px; }
    .project-timeline-project-filter { grid-template-columns: 1fr; gap: 2px; }
    .project-timeline-task-label { padding-left: 13px; }
    .project-timeline-task-meta { flex-wrap: wrap; white-space: normal; }
    .project-timeline-task-controls { align-items: stretch; flex-direction: column; }
    .project-timeline-plan-field input,
    .project-timeline-plan-field--estimate input,
    .project-timeline-plan-field--due input,
    .project-timeline-plan-field--start input { width: 100%; }
    .project-timeline-mode-switch,
    .project-timeline-shift-controls { align-self: flex-start; }
}

.project-folder-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--pmh-text, currentColor);
    vertical-align: middle;
    text-decoration: none;
}

.project-folder-link:hover,
.project-folder-link:focus-visible {
    color: var(--bs-primary);
}

.project-folder-link svg {
    display: block;
}

.project-folder-link--empty {
    opacity: 0.42;
    cursor: not-allowed;
}

button.project-folder-link {
    padding: 0;
    border: 0;
    background: transparent;
}

.project-folder-link--configure {
    cursor: pointer;
}

.project-folder-link--configure:hover,
.project-folder-link--configure:focus-visible {
    opacity: 1;
}

body.project-folder-modal-open {
    overflow: hidden;
}

body.action-detail-overlay-open {
    overflow: hidden;
}

.action-detail-overlay {
    position: fixed;
    z-index: 6000;
    inset: 0;
    display: none;
    background: transparent;
}

.action-detail-overlay[hidden] {
    display: none !important;
}

.action-detail-overlay.show {
    display: block;
}

.action-detail-overlay__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}

body.action-detail-embed-page {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: transparent !important;
    background-image: none !important;
}

body.action-detail-embed-page > nav.main-nav {
    display: none !important;
}

body.action-detail-embed-page > .container-fluid.py-3 {
    width: 100%;
    height: 100%;
    padding: 0 !important;
    background: transparent !important;
}

body.action-detail-embed-page > .container-fluid.py-3 > main > :not(#note-modal) {
    display: none !important;
}

.project-folder-modal {
    z-index: 5000;
    padding: 2.5vh 2vw;
}

.project-folder-modal__card {
    display: flex;
    flex-direction: column;
    width: min(1500px, 96vw);
    height: min(940px, 94vh);
    max-width: none;
    overflow: hidden;
}

.project-folder-modal__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.project-folder-modal__external {
    white-space: nowrap;
}

.project-folder-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    background: #f5f6f8;
}

.project-folder-modal__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.project-folder-modal__footer {
    padding: 7px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--pmh-text-muted, #667085);
    font-size: 0.78rem;
}

body.theme-dunkel .project-folder-modal__footer,
body.theme-darkblue .project-folder-modal__footer,
body.theme-darkgreen .project-folder-modal__footer {
    border-top-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.68);
}

@media (max-width: 700px) {
    .project-folder-modal {
        padding: 0;
    }

    .project-folder-modal__card {
        width: 100vw;
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }

    .project-folder-modal__header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .project-folder-modal__external {
        grid-column: 1 / -1;
        justify-self: stretch;
        text-align: center;
    }
}
