:root {
    color-scheme: dark;
    --bg: #141414;
    --bg-elevated: #1d1d1d;
    --panel: transparent;
    --panel-strong: #272727;
    --border: #3a3a3a;
    --text: #edf2f7;
    --muted: #a7a7a7;
    --accent: #d0d0d0;
    --accent-soft: rgba(208, 208, 208, 0.16);
    --status-done: #6fae8c;
    --status-progress: #d6b45b;
    --status-open: #d07a7a;
    --status-on-hold: #b0b8c8;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    --danger: #f08f8f;
    --due-soon: #d4956a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(150, 150, 150, 0.16), transparent 30%),
        radial-gradient(circle at top right, rgba(122, 122, 122, 0.12), transparent 26%),
        linear-gradient(180deg, #111111 0%, #1a1a1a 100%);
    color: var(--text);
    min-height: 100vh;
}

header,
main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.25rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #000;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

nav a,
.button,
button {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border-radius: 0.7rem;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #313131 0%, #262626 100%);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

nav a:hover,
.button:hover,
button:hover {
    border-color: #6a6a6a;
    transform: translateY(-1px);
    background: linear-gradient(180deg, #3a3a3a 0%, #2c2c2c 100%);
}

a {
    color: #e3e3e3;
}

a:hover {
    color: #f5f5f5;
}

.page-header,
.panel {
    background: var(--panel);
    border-radius: 1rem;
    padding: 0 0 1.2rem;
    margin-bottom: 1.1rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.project-header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.project-header-text {
    min-width: 0;
}

.project-header-edit {
    flex-shrink: 0;
}
.meta,
.empty-state,
.field-help {
    color: var(--muted);
}

.header-description {
    margin: 0.55rem 0 0;
    max-width: 70ch;
    color: #dddddd;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-scroll table {
    min-width: 44rem;
}

th,
td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: rgba(255, 255, 255, 0.03);
    color: #d6d6d6;
}

form.inline-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    align-items: end;
}

input,
select,
textarea,
button {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 0.7rem;
    border: 1px solid var(--border);
    background: #1d1d1d;
    color: var(--text);
    font: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #8c8c8c;
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

label {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: #d8d8d8;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.employee-pool-wrap {
    margin-top: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.employee-pool-search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-elevated);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
}

.employee-pool-search::placeholder {
    color: var(--muted);
}

.employee-pool-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.employee-pool-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.employee-pool-item:hover {
    background: var(--panel-strong);
}

ul.errorlist {
    color: var(--danger);
    margin: 0.25rem 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.9rem;
    border: 1px solid rgba(208, 208, 208, 0.16);
}

.person-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.person-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f3f5f8;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
}

.person-badge-tone-1 {
    background: linear-gradient(160deg, #46586f 0%, #293241 100%);
}

.person-badge-tone-2 {
    background: linear-gradient(160deg, #556b63 0%, #2a3430 100%);
}

.person-badge-tone-3 {
    background: linear-gradient(160deg, #6b5b63 0%, #34282d 100%);
}

.person-badge-tone-4 {
    background: linear-gradient(160deg, #6d634f 0%, #352f26 100%);
}

.person-badge-tone-5 {
    background: linear-gradient(160deg, #4f6771 0%, #26343a 100%);
}

.person-badge-tone-0 {
    background: linear-gradient(160deg, #64586e 0%, #2e2834 100%);
}

.link-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    padding: 0.55rem;
}

.icon-button svg {
    width: 1rem;
    height: 1rem;
}

.brand {
    text-decoration: none;
    color: inherit;
}

.brand:hover {
    color: inherit;
}

.mobile-home-btn {
    display: none;
}

.mobile-brand {
    display: none;
}

.mobile-header-row {
    display: none;
}

/* Burger menu */
.burger-menu {
    position: relative;
}

.burger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    cursor: pointer;
    color: #edf2f7;
    padding: 0;
}

.burger-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.burger-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 170px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.65rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow: hidden;
}

.burger-dropdown.open {
    display: block;
}

.burger-dropdown a,
.burger-dropdown button[type="submit"] {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1rem;
    color: #edf2f7;
    text-decoration: none;
    font-size: 0.92rem;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
}

.burger-dropdown a:hover,
.burger-dropdown button[type="submit"]:hover {
    background: rgba(255, 255, 255, 0.07);
}

.burger-dropdown hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}

.burger-logout-form {
    display: block;
    margin: 0;
    padding: 0;
}

.header-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.status-indicator.item-title-status-mobile {
    display: none;
}

.item-title-content {
    min-width: 0;
}

.item-title-meta-mobile {
    display: none;
}

.item-title-meta-empty {
    color: var(--color-text-muted, #888);
}

.item-title-cell {
    white-space: nowrap;
}

.item-title-link {
    display: inline-block;
}

.item-summary-row {
    cursor: pointer;
}

.item-summary-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.item-summary-row.is-open {
    background: rgba(255, 255, 255, 0.1);
}

.item-title-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.item-tree-indent {
    display: inline-block;
    width: 0.8rem;
    flex-shrink: 0;
}

.item-tree-connector {
    color: var(--color-text-muted, #888);
    margin-right: 0.2rem;
    font-size: 1em;
    opacity: 0.55;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}

.item-title-main .status-indicator {
    margin-right: 0.4rem;
    flex-shrink: 0;
}

.item-title-main {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.item-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-inline-shortcut {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0.2rem;
    font-size: 1rem;
    line-height: 1;
}

.item-detail-row > td {
    padding-top: 0;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.1);
/*    border-radius: 0.85rem; */
}

.item-group-separator td {
    padding: 0;
    height: 1rem;
    border-bottom: none;
    background: rgba(255, 255, 255, 0.03);
}

.item-group-separator td::before {
    content: "";
    display: block;
    height: 1px;
    margin: 0.5rem 0;
    background: rgba(255, 255, 255, 0.08);
}

.item-inline-panel {
    display: grid;
    gap: 1rem;
    padding: 1rem 1rem 0.75rem;
/*    background: rgba(255, 255, 255, 0.03); */
    border-radius: 0.8rem;
}

.item-inline-toolbar,
.item-inline-actions,
.item-child-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.item-inline-grid,
.item-child-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
}

.item-inline-field {
    min-width: 0;
}

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

.item-inline-field-compact {
    min-width: 110px;
}

.item-inline-form input,
.item-inline-form select {
    background: transparent;
}

.item-inline-form select,
.item-inline-form select option,
.item-inline-form select optgroup {
    background: #2d2d2d;
    color: var(--text);
}

.item-child-section {
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.trix-host {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.4rem;
}

.trix-input {
    display: none;
}

trix-toolbar {
    display: none;
}

.trix-host:focus-within trix-toolbar {
    display: block;
}

trix-toolbar .trix-button-group,
trix-toolbar .trix-dialogs {
    margin-bottom: 0.0rem;
}

trix-toolbar .trix-button-group {
    border: 0px solid var(--border);
    border-radius: 0.7rem;
    overflow: hidden;
    background: rgb(93, 93, 93);
}

trix-toolbar .trix-button {
    background: rgb(65, 65, 65);
    color: #000000;
    border-bottom: none;
    opacity: 1;
}

trix-toolbar .trix-button:hover {
    background: rgba(185, 185, 185, 1);
}

trix-toolbar .trix-button.trix-active {
    background: #8d8d8d;
    color: #000000;
}

trix-toolbar .trix-button:disabled {
   /* opacity: 0.45;*/
}

trix-editor {
    min-height: 8rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    background: rgba(45, 45, 45, 1);
    color: var(--text);
}

trix-editor:focus {
    outline: none;
    border-color: #747474;
}

trix-editor a {
    color: #e3e3e3;
}

.button-subtle {
    background: rgba(255, 255, 255, 0.03);
}

.item-inline-actions {
    justify-content: space-between;
    margin-top: 0.5rem;
}

.item-inline-actions > button[type="submit"] {
    width: auto;
}

.item-inline-actions .icon-button {
    width: 2.9rem;
    min-width: 2.9rem;
    height: 2.9rem;
}

.item-inline-actions .icon-button svg {
    width: 1.15rem;
    height: 1.15rem;
}

.item-inline-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-bar-normal,
.item-bar-confirm {
    width: 100%;
}

.item-bar-fields {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: 100%;
}

.item-bar-fields input[type="date"] {
    width: 8.5rem;
    min-width: 0;
    flex-shrink: 0;
}

.date-wrap {
    position: relative;
    display: inline-flex;
}

.date-wrap[data-empty]::after {
    content: "\2013";
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text);
}

.date-wrap[data-empty]:not(:focus-within) input[type="date"] {
    color: transparent;
}

.item-bar-fields .link-row {
    margin-left: auto;
    flex-shrink: 0;
}

.date-icon {
    width: 1rem;
    height: 1rem;
    color: var(--text-muted, rgba(255,255,255,0.4));
    flex-shrink: 0;
}

.date-sep {
    font-size: 0.8rem;
    color: var(--text-muted, rgba(255,255,255,0.4));
    flex-shrink: 0;
}

.status-picker {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.status-pick {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 999px;
    border: 2px solid transparent;
    transition: border-color 0.1s;
}

.status-pick input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.status-pick:has(input:checked) {
    border-color: rgba(255, 255, 255, 0.5);
}

.status-pick-dot {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
}

.status-indicator {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    vertical-align: middle;
}

.end-date-column {
    width: 9rem;
    white-space: nowrap;
}

/* Due-soon: End Date innerhalb der nächsten 7 Tage */
.row-due-soon > td:first-child {
    box-shadow: inset 3px 0 0 var(--due-soon);
}
.row-due-soon {
    background-color: rgba(212, 149, 106, 0.11);
}
.date-due-soon {
    color: var(--due-soon);
    font-weight: 500;
}

/* Overdue: End Date in der Vergangenheit */
.row-overdue > td:first-child {
    box-shadow: inset 3px 0 0 var(--status-open);
}
.row-overdue {
    background-color: rgba(208, 122, 122, 0.11);
}
.date-overdue {
    color: var(--status-open);
    font-weight: 500;
}

.responsible-column {
    width: 30rem;
}

[data-inline-item-table] .item-title-cell {
    width: auto;
}
.status-column {
    width: 2.5rem;
}

.action-column {
    width: 3.5rem;
    text-align: right;
}

.status-open {
    background: var(--status-open);
    box-shadow: 0 0 0 0.15rem rgba(208, 122, 122, 0.2);
}

.status-in-progress {
    background: var(--status-progress);
    box-shadow: 0 0 0 0.15rem rgba(214, 180, 91, 0.18);
}

.status-done {
    background: var(--status-done);
    box-shadow: 0 0 0 0.15rem rgba(111, 174, 140, 0.18);
}

.status-on-hold {
    background: var(--status-on-hold);
    box-shadow: 0 0 0 0.15rem rgba(237, 237, 237, 0.18);
}

/* ===== Edit item modal ===== */
#item-edit-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0;
    color: var(--text);
    max-width: 540px;
    width: calc(100% - 2rem);
    box-shadow: var(--shadow);
}

#item-edit-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.item-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.item-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.item-modal-body {
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
}

.item-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.item-modal-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.item-modal-checkboxes ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.item-modal-checkboxes li {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.item-modal-checkboxes input[type="checkbox"],
.employee-pool-list input[type="checkbox"] {
    width: auto;
    min-width: 0;
}

.item-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.item-modal-footer button {
    width: auto;
}



