/* ==================== FONT ==================== */
        @font-face {
            font-family: 'Inter';
            src: url('/assets/fonts/Inter/Inter-Light.woff2') format('woff2');
            font-weight: 300;
            font-style: normal;
            font-display: swap;
        }
        @font-face {
            font-family: 'Inter';
            src: url('/assets/fonts/Inter/Inter-Medium.woff2') format('woff2');
            font-weight: 500;
            font-style: normal;
            font-display: swap;
        }

/* ==================== ROOT & RESET ==================== */
        :root {
            --blue: #2da9d6;
            --blue-light: #e8f6fb;
            --blue-dark: #1e8ab3;
            --red: #a93535;
            --red-light: #fdeaea;
            --text: #57514d;
            --text-light: #8a847f;
            --bg: #f0f2f5;
            --white: #ffffff;
            --border: #e2e2e2;
            --shadow: 0 2px 12px rgba(0,0,0,0.07);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
            --radius: 12px;
            --radius-sm: 8px;
            --radius-xs: 6px;
            --green: #2e8b57;
            --yellow: #e6a817;
            --orange: #e67817;
            --open-column-bg: #eef4fb;
            --done-column-bg: #f5f8f5;
            --overdue-card-bg: #fff8f8;
            --project-row-hover-bg: #f2f6f9;
            --input-bg: #ffffff;
            --input-text: #57514d;
            --input-placeholder: #8a847f;
            --tp-viewport-height: calc(100vh - 220px);
            --tp-stage-width: 1820px;
            --tp-stage-height: 1100px;
            --tp-offset-x: 1465px;
            --tp-offset-y: -85px;
            --tp-rotate: 90deg;
            --tp-img-width: 1100px;
            --tp-img-height: 1600px;
        }
        :root[data-theme="dark"] {
            --blue: #44b7e0;
            --blue-light: #163746;
            --blue-dark: #83d4ef;
            --red: #d06666;
            --red-light: #3e1f1f;
            --text: #e6e9ee;
            --text-light: #a7b0bb;
            --bg: #171b21;
            --white: #222831;
            --border: #3a424d;
            --shadow: 0 2px 12px rgba(0,0,0,0.45);
            --shadow-lg: 0 8px 32px rgba(0,0,0,0.55);
            --green: #58b985;
            --yellow: #f1be4f;
            --orange: #ef994a;
            --open-column-bg: #1f2a36;
            --done-column-bg: #243129;
            --overdue-card-bg: #3a2424;
            --project-row-hover-bg: #2a313b;
            --input-bg: #1f252d;
            --input-text: #e6e9ee;
            --input-placeholder: #a7b0bb;
        }
        :root[data-theme="pink"] {
            --blue: #d86bb3;
            --blue-light: #fff0f9;
            --blue-dark: #a84684;
            --red: #b3477a;
            --red-light: #ffe8f1;
            --text: #5b3d51;
            --text-light: #8f6f83;
            --bg: #fff6fb;
            --white: #ffffff;
            --border: #f0cfe2;
            --shadow: 0 2px 12px rgba(170, 90, 135, 0.14);
            --shadow-lg: 0 8px 32px rgba(170, 90, 135, 0.20);
            --green: #4e9b73;
            --yellow: #e4a63d;
            --orange: #e1834f;
            --open-column-bg: #fdeff7;
            --done-column-bg: #eff9f2;
            --overdue-card-bg: #fff2f6;
            --project-row-hover-bg: #ffeaf6;
            --input-bg: #ffffff;
            --input-text: #5b3d51;
            --input-placeholder: #a88ca0;
        }
        :root[data-theme="terminal"] {
            --blue: #00a256;
            --blue-light: #1d7678;
            --blue-dark: #00eaff;
            --red: #ff5c5c;
            --red-light: #da1212;
            --text: #02e473;
            --text-light: #00d6d6;
            --bg: #131937;
            --white: #172A45;
            --border: #006dac;
            --shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
            --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.75);
            --green: #54ff7a;
            --yellow: #e5f36a;
            --orange: #ffb55c;
            --open-column-bg: #550000;
            --done-column-bg: #043100;
            --overdue-card-bg: #291313;
            --project-row-hover-bg: #1d4078;
            --input-bg: #0f1a11;
            --input-text: #ffffff;
            --input-placeholder: #cab100;
        }
        :root[data-theme="aurelia"] {
            --blue: #3d6b8a;
            --blue-light: #2a5070;
            --blue-dark: #797979;
            --red: #c46b77;
            --red-light: #3a1e2a;
            --text: #797979;
            --text-light: #c8d8e8;
            --bg: #141820;
            --white: #1e2430;
            --border: #0c3b7e;
            --shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
            --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.7);
            --green: #67b47a;
            --yellow: #d2b65c;
            --orange: #d98a65;
            --open-column-bg: #1e1726;
            --done-column-bg: #1f211e;
            --overdue-card-bg: #312028;
            --project-row-hover-bg: #231c2c;
            --input-bg: #1a1a1a;
            --input-text: #797979;
            --input-placeholder: #c8d8e8;
        }
        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            color: var(--text);
            background: var(--bg);
            min-height: 100vh;
            font-size: 14px;
            line-height: 1.5;
            transition: background-color 0.2s ease, color 0.2s ease;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }
        button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
        input, textarea, select {
            font-family: inherit;
            font-size: inherit;
            color: var(--input-text);
            background: var(--input-bg);
            border-color: var(--border);
        }
        input::placeholder, textarea::placeholder { color: var(--input-placeholder); opacity: 1; }
        input:-webkit-autofill,
        input:-webkit-autofill:hover,
        input:-webkit-autofill:focus,
        textarea:-webkit-autofill,
        textarea:-webkit-autofill:hover,
        textarea:-webkit-autofill:focus,
        select:-webkit-autofill,
        select:-webkit-autofill:hover,
        select:-webkit-autofill:focus {
            -webkit-text-fill-color: var(--input-text);
            -webkit-box-shadow: 0 0 0px 1000px var(--input-bg) inset;
            transition: background-color 9999s ease-in-out 0s;
        }
        a { color: var(--blue); text-decoration: none; }

        /* ==================== HEADER ==================== */
        .header {
            background: var(--white);
            box-shadow: 0 1px 4px rgba(0,0,0,0.08);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        .header-inner {
            max-width: 1440px;
            margin: 0 auto;
            padding: 0 24px;
            display: flex;
            align-items: center;
            height: 60px;
            gap: 32px;
        }
        .header-right {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }
        .user-select {
            border: 1px solid var(--border);
            border-radius: 999px;
            padding: 5px 9px;
            background: var(--bg);
            color: var(--text);
            font-weight: 600;
            font-size: 11px;
            min-width: 84px;
            max-width: 130px;
            outline: none;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            pointer-events: none;
        }
        .user-select::-ms-expand { display: none; }
        .user-select:disabled { opacity: 1; }
        .logo {
            display: flex;
            align-items: center;
            white-space: nowrap;
            flex-shrink: 0;
            cursor: pointer;
        }
        .logo-image {
            width: 75px;
            height: 36px;
            display: block;
            object-fit: contain;
        }

        .main-nav {
            display: flex;
            gap: 4px;
            flex: 1;
            overflow-x: auto;
        }
        .mobile-nav-toggle {
            display: none;
            width: 34px;
            height: 34px;
            border-radius: 8px;
            border: 1px solid var(--border);
            background: var(--bg);
            color: var(--text);
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .mobile-nav-toggle.active {
            background: var(--blue-light);
            color: var(--blue-dark);
            border-color: var(--blue);
        }
        .mobile-only-nav-item {
            display: none;
        }
        .nav-tab {
            padding: 8px 18px;
            font-weight: 500;
            font-size: 14px;
            border-radius: var(--radius-sm);
            transition: all 0.2s;
            white-space: nowrap;
            position: relative;
            color: var(--text-light);
        }
        .nav-tab:hover { background: var(--bg); color: var(--text); }
        .nav-tab.active {
            background: var(--blue-light);
            color: var(--blue-dark);
            font-weight: 600;
        }

        /* ==================== MAIN CONTENT ==================== */
        .content {
            max-width: 1440px;
            margin: 0 auto;
            padding: 24px;
        }
        .page-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 24px;
            gap: 16px;
            flex-wrap: wrap;
        }
        .page-title {
            font-size: 22px;
            font-weight: 700;
            color: var(--text);
        }
        .page-subtitle {
            font-size: 13px;
            color: var(--text-light);
            margin-top: 2px;
        }
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            border-radius: var(--radius-sm);
            font-weight: 600;
            font-size: 13px;
            transition: all 0.2s;
        }
        .btn-primary {
            background: var(--blue);
            color: white;
        }
        .btn-primary:hover { background: var(--blue-dark); }
        .btn-secondary {
            background: var(--bg);
            color: var(--text);
            border: 1px solid var(--border);
        }
        .btn-secondary:hover { background: var(--border); }
        .btn-danger {
            background: var(--red);
            color: white;
        }
        .btn-danger:hover { background: #8a2a2a; }
        .btn-sm { padding: 6px 14px; font-size: 12px; }
        .btn-icon {
            width: 32px; height: 32px;
            border-radius: var(--radius-xs);
            display: flex; align-items: center; justify-content: center;
            transition: all 0.2s;
        }
        .btn-icon:hover { background: var(--bg); }

        /* ==================== CARD ==================== */
        .card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }
        .card-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }
        .card-body { padding: 20px; }

        /* ==================== PROJECT GRID ==================== */
        .project-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 20px;
        }
        .favorite-projects-wrap {
            margin-bottom: 18px;
        }
        .favorite-title {
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 10px;
            color: var(--text-light);
            text-transform: uppercase;
            letter-spacing: 0.4px;
        }
        .project-list-wrap {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }
        .project-list-header,
        .project-list-row {
            display: grid;
            grid-template-columns: 110px 1.45fr 1.1fr 0.9fr 1.2fr 90px;
            gap: 12px;
            align-items: center;
            padding: 12px 14px;
        }
        .project-list-header {
            background: var(--bg);
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            font-weight: 700;
            color: var(--text-light);
        }
        .project-list-row {
            border-top: 1px solid var(--border);
            font-size: 13px;
        }
        .project-list-row.clickable {
            cursor: pointer;
            transition: background 0.15s;
        }
        .project-list-row.clickable:hover {
            background: var(--project-row-hover-bg);
        }
        .project-list-divider {
            margin: 16px 0 10px;
            border-top: 1px solid var(--border);
            padding-top: 12px;
        }
        .project-section-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--text-light);
            text-transform: uppercase;
            letter-spacing: 0.4px;
            margin-bottom: 8px;
        }
        .project-type-text {
            font-weight: 600;
        }
        .project-search-input {
            min-width: 280px;
            max-width: 420px;
            width: 100%;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
            outline: none;
            background: var(--white);
        }
        .project-search-input:focus {
            border-color: var(--blue);
        }
        .project-search-wrap {
            position: relative;
            min-width: 280px;
            max-width: 420px;
            width: 100%;
        }
        .project-search-input.has-clear {
            max-width: none;
            min-width: 0;
            padding-right: 34px;
        }
        .project-search-clear {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            border-radius: 50%;
            display: none;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            background: transparent;
        }
        .project-search-clear.visible {
            display: inline-flex;
        }
        .project-search-clear:hover {
            background: var(--bg);
            color: var(--text);
        }
        .assignee-check-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            gap: 6px;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 8px;
            background: var(--bg);
        }
        .assignee-check-grid .form-check {
            padding: 0;
            gap: 12px;
        }
        .wiki-layout {
            display: grid;
            grid-template-columns: 320px 1fr;
            gap: 16px;
            align-items: start;
        }
        .wiki-sidebar {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }
        .wiki-sidebar-header {
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            font-weight: 700;
            font-size: 13px;
        }
        .wiki-tree {
            padding: 10px;
            max-height: 70vh;
            overflow-y: auto;
        }
        .wiki-category-title {
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.4px;
            color: var(--text-light);
            margin: 8px 0 4px;
            font-weight: 700;
        }
        .wiki-article-link {
            width: 100%;
            text-align: left;
            border-radius: var(--radius-xs);
            padding: 8px 10px;
            font-size: 13px;
            color: var(--text);
            transition: all 0.15s;
        }
        .wiki-article-link:hover {
            background: var(--bg);
        }
        .wiki-article-link.active {
            background: var(--blue-light);
            color: var(--blue-dark);
            font-weight: 600;
        }
        .wiki-content {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            min-height: 420px;
            overflow: hidden;
        }
        .wiki-content-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }
        .wiki-meta {
            font-size: 12px;
            color: var(--text-light);
            margin-top: 3px;
        }
        .wiki-content-body {
            padding: 16px;
            line-height: 1.65;
        }
        .wiki-toolbar {
            display: flex;
            gap: 6px;
            margin-bottom: 8px;
        }
        .wiki-toolbar button {
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 5px 10px;
            font-size: 12px;
            background: var(--white);
        }
        .wiki-toolbar button:hover {
            border-color: var(--blue);
            color: var(--blue-dark);
        }
        .wiki-editor-title,
        .wiki-editor-text {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
            outline: none;
        }
        .wiki-editor-title {
            margin-bottom: 8px;
            font-weight: 600;
        }
        .wiki-editor-text {
            min-height: 240px;
            resize: vertical;
            margin-bottom: 10px;
        }
        .note-editor.note-frame {
            border-color: var(--border);
            border-radius: var(--radius-sm);
        }
        .note-editor .note-toolbar {
            background: var(--bg);
            border-bottom-color: var(--border);
        }
        .note-editor .note-editing-area .note-editable {
            background: var(--input-bg);
            color: var(--input-text);
            min-height: 220px;
        }
        .note-editor .note-btn {
            color: var(--blue-dark);
        }
        .wiki-images {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
            gap: 10px;
            margin-top: 12px;
        }
        .wiki-image {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg);
            min-height: 100px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-light);
            padding: 8px;
            text-align: center;
        }
        .wiki-image i {
            font-size: 20px;
            color: var(--blue);
        }
        .project-card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            cursor: pointer;
            transition: all 0.2s;
            overflow: hidden;
            border: 2px solid transparent;
        }
        .project-card:hover {
            box-shadow: var(--shadow-lg);
            border-color: var(--blue);
            transform: translateY(-2px);
        }
        .project-card-header {
            padding: 20px 20px 12px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 12px;
        }
        .favorite-star-btn {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            background: var(--bg);
            transition: all 0.15s;
            flex-shrink: 0;
        }
        .favorite-star-btn:hover { background: var(--border); color: var(--text); }
        .favorite-star-btn.active {
            color: #cc9a00;
            background: #fff8df;
        }
        .project-card-name {
            font-weight: 700;
            font-size: 16px;
        }
        .project-card-ort {
            color: var(--text-light);
            font-size: 13px;
            margin-top: 2px;
        }
        .project-card-body {
            padding: 0 20px 16px;
        }
        .project-card-footer {
            padding: 12px 20px;
            background: var(--bg);
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 12px;
            color: var(--text-light);
        }
        .type-badges { display: flex; gap: 6px; }
        .type-badge {
            padding: 3px 10px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.3px;
        }
        .type-badge.sanitaer { background: #e0f4ff; color: #1a7daa; }
        .type-badge.heizung { background: #ffeaea; color: #9a2e2e; }

        .stat-mini {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-light);
        }
        .stat-mini i { font-size: 11px; }
        .stats-row { display: flex; gap: 16px; }

        /* ==================== PROJECT DETAIL ==================== */
        .back-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-weight: 500;
            color: var(--text-light);
            margin-bottom: 8px;
            padding: 6px 12px;
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }
        .back-btn:hover { background: var(--white); color: var(--text); }

        .project-detail-header {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 10px 12px;
            margin-bottom: 10px;
        }
        .project-inline-meta {
            display: grid;
            grid-template-columns: auto minmax(0, 1.1fr) minmax(0, 0.8fr) auto minmax(0, 0.65fr) minmax(0, 0.85fr);
            gap: 6px;
        }
        .project-inline-item {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--bg);
            border-radius: var(--radius-xs);
            padding: 6px 8px;
            min-width: 0;
        }
        .project-inline-label {
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-light);
            font-weight: 700;
            white-space: nowrap;
        }
        .project-inline-value {
            flex: 1;
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
        }
        .project-id-with-folder {
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .desktop-folder-open-btn {
            width: 26px;
            height: 26px;
            border-radius: 6px;
            background: var(--white);
            border: 1px solid var(--border);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--blue-dark);
            flex: 0 0 auto;
        }
        .desktop-folder-open-btn:hover {
            border-color: var(--blue);
            color: var(--blue);
        }
        .desktop-only-inline { display: inline-flex; }
        .project-inline-input {
            width: 100%;
            border: 1px solid transparent;
            background: transparent;
            border-radius: var(--radius-xs);
            padding: 2px 4px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text);
            outline: none;
        }
        .project-inline-input:not([readonly]) {
            border-color: var(--blue);
            background: var(--white);
        }
        .project-inline-item.id-compact .project-inline-value {
            flex: 0 0 auto;
        }
        .project-inline-item.id-compact .project-inline-input {
            width: 7ch;
            max-width: 7ch;
        }
        .project-inline-item.plz-compact .project-inline-value {
            flex: 0 0 auto;
        }
        .project-inline-item.plz-compact .project-inline-input {
            width: 6ch;
            max-width: 6ch;
        }
        .project-inline-item.flex-grow {
            min-width: 0;
        }
        .project-inline-item.flex-grow .project-inline-value {
            min-width: 0;
        }

        .address-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 16px;
        }
        .address-card {
            background: var(--bg);
            border-radius: var(--radius-sm);
            padding: 14px;
        }
        .address-card-label {
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-light);
            margin-bottom: 8px;
        }
        .address-card input, .address-card textarea {
            width: 100%;
            border: none;
            background: transparent;
            padding: 2px 0;
            font-size: 13px;
            line-height: 1.6;
            resize: none;
            color: var(--text);
        }
        .address-card input:read-only, .address-card textarea:read-only {
            pointer-events: none;
        }
        .address-card.editable {
            background: var(--white);
            border: 1px solid var(--blue);
        }
        .address-card.editable input, .address-card.editable textarea {
            border-bottom: 1px solid var(--border);
            margin-bottom: 2px;
        }
        .kontakt-extra-list {
            margin-top: 16px;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 10px;
        }
        .kontakt-extra-item {
            background: var(--bg);
            border-radius: var(--radius-sm);
            padding: 12px;
            position: relative;
        }
        .kontakt-extra-funktion {
            display: inline-block;
            font-size: 11px;
            font-weight: 700;
            color: var(--blue-dark);
            background: var(--blue-light);
            padding: 2px 8px;
            border-radius: 10px;
            margin-bottom: 6px;
        }
        .kontakt-extra-name {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 2px;
        }
        .kontakt-extra-meta {
            font-size: 12px;
            color: var(--text-light);
        }
        .kontakt-extra-delete {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            transition: all 0.15s;
        }
        .kontakt-extra-delete:hover {
            background: var(--red-light);
            color: var(--red);
        }
        .kontakt-add-form {
            margin-top: 14px;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--white);
        }
        .kontakt-add-grid {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr auto;
            gap: 8px;
            align-items: center;
        }
        .kontakt-add-grid input {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 8px 10px;
            outline: none;
        }
        .kontakt-add-grid input:focus { border-color: var(--blue); }
        .kontakt-add-actions {
            display: flex;
            justify-content: flex-end;
            margin-top: 8px;
        }

        /* ==================== INNER TABS ==================== */
        .inner-tabs {
            display: flex;
            gap: 2px;
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 4px;
            margin-bottom: 20px;
            overflow-x: auto;
        }
        .inner-tab {
            padding: 10px 20px;
            border-radius: var(--radius-sm);
            font-weight: 500;
            font-size: 13px;
            transition: all 0.2s;
            white-space: nowrap;
            color: var(--text-light);
        }
        .inner-tab:hover { background: var(--bg); color: var(--text); }
        .inner-tab.active {
            background: var(--blue);
            color: white;
            font-weight: 600;
        }
        .inner-tabs-mobile { display: none; }
        .mobile-summary-only { display: none; }

        /* ==================== CHECKLISTS ==================== */
        .checklist-section-label {
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            color: var(--text-light);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .checklist-section-label i { font-size: 12px; }
        .checklist-section-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-bottom: 8px;
        }
        .checklist-template-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .checklist-row {
            display: grid;
            grid-template-columns: repeat(auto-fill, 336px);
            justify-content: start;
            gap: 16px;
            overflow-x: visible;
            padding-bottom: 0;
            margin-bottom: 24px;
        }
        .checklist-card {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            min-width: 0;
            max-width: 336px;
            display: flex;
            flex-direction: column;
            width: 100%;
            box-sizing: border-box;
        }
        .checklist-card-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .checklist-card-title {
            font-weight: 600;
            font-size: 14px;
        }
        .checklist-progress {
            font-size: 12px;
            color: var(--text-light);
            font-weight: 500;
            background: var(--bg);
            padding: 2px 10px;
            border-radius: 12px;
        }
        .checklist-items {
            padding: 8px 0;
            flex: 1;
            max-height: 400px;
            overflow-y: auto;
        }
        .checklist-item {
            display: flex;
            align-items: flex-start;
            padding: 8px 16px;
            gap: 10px;
            position: relative;
            transition: background 0.15s;
        }
        .checklist-item:hover { background: var(--bg); }
        .checklist-item input[type="checkbox"] {
            width: 18px; height: 18px;
            margin-top: 2px;
            accent-color: var(--blue);
            flex-shrink: 0;
            cursor: pointer;
        }
        .checklist-item-content { flex: 1; min-width: 0; }
        .checklist-item-text {
            font-size: 13px;
            word-break: break-word;
        }
        .checklist-item.checked .checklist-item-text {
            text-decoration: line-through;
            color: var(--text-light);
            opacity: 0.6;
        }
        .checklist-item-date-badge {
            font-size: 11px;
            margin-top: 3px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 1px 8px;
            border-radius: 4px;
            background: var(--blue-light);
            color: var(--blue-dark);
        }
        .checklist-item.checked .checklist-item-date-badge {
            opacity: 0.5;
            background: var(--bg);
            color: var(--text-light);
        }
        .checklist-item-date-badge.overdue {
            background: var(--red-light);
            color: var(--red);
            font-weight: 600;
        }
        .checklist-item-actions {
            display: flex;
            gap: 1px;
            opacity: 0;
            transition: opacity 0.15s;
            flex-shrink: 0;
        }
        .checklist-item:hover .checklist-item-actions { opacity: 1; }
        .checklist-item-actions button {
            width: 22px; height: 22px;
            border-radius: var(--radius-xs);
            display: flex; align-items: center; justify-content: center;
            font-size: 11px;
            color: var(--text-light);
            transition: all 0.15s;
        }
        .checklist-item-actions button:hover {
            background: var(--border);
            color: var(--text);
        }
        .checklist-item-actions button.delete-btn:hover {
            background: var(--red-light);
            color: var(--red);
        }
        .checklist-item.drag-sort-active {
            cursor: move;
        }
        .checklist-item-drag-handle {
            cursor: grab;
        }
        .checklist-item-drag-handle:active {
            cursor: grabbing;
        }
        .checklist-item.dragging {
            opacity: 0.5;
        }
        .checklist-item.drop-active {
            outline: 1px dashed var(--blue);
            background: var(--blue-light);
        }
        .checklist-add {
            padding: 10px 16px;
            border-top: 1px solid var(--border);
            display: flex;
            gap: 8px;
        }
        .checklist-add input {
            flex: 1;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 8px 12px;
            font-size: 13px;
            outline: none;
            transition: border-color 0.2s;
        }
        .checklist-add input:focus { border-color: var(--blue); }
        .checklist-add button {
            padding: 8px 14px;
            background: var(--blue);
            color: white;
            border-radius: var(--radius-xs);
            font-size: 12px;
            font-weight: 600;
            transition: background 0.2s;
        }
        .checklist-add button:hover { background: var(--blue-dark); }

        .add-checklist-card {
            width: 100%;
            max-width: 336px;
            min-width: 0;
            box-sizing: border-box;
            border: 2px dashed var(--border);
            border-radius: var(--radius);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.2s;
            padding: 20px;
            flex-shrink: 0;
        }
        .add-checklist-card:hover {
            border-color: var(--blue);
            color: var(--blue);
            background: var(--blue-light);
        }
        .add-checklist-card i { font-size: 24px; }
        .add-checklist-card span { font-size: 12px; font-weight: 600; }

        /* Date Popover */
        .date-popover {
            position: fixed;
            background: var(--white);
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow-lg);
            padding: 12px;
            z-index: 1300;
            border: 1px solid var(--border);
            min-width: 220px;
            max-width: min(92vw, 320px);
        }
        .date-popover.date-popover-top {
            transform: translateY(-100%);
        }
        .date-popover label {
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--text-light);
            display: block;
            margin-bottom: 6px;
        }
        .date-popover input[type="date"] {
            width: 100%;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            font-size: 13px;
            outline: none;
        }
        .date-popover input[type="date"]:focus { border-color: var(--blue); }
        .date-popover-actions {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }

        /* ==================== PENDENZEN ==================== */
        .pendenzen-board {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 24px;
        }
        .pendenzen-column {
            background: var(--bg);
            border-radius: var(--radius);
            padding: 16px;
            min-height: 300px;
        }
        .pendenzen-column-header {
            font-weight: 700;
            font-size: 15px;
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .pendenzen-count {
            background: var(--border);
            color: var(--text-light);
            font-size: 11px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 10px;
        }
        .pendenzen-column.drop-active {
            background: var(--blue-light);
            outline: 2px dashed var(--blue);
        }

        .pendenz-card {
            background: var(--white);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
            margin-bottom: 8px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
            cursor: grab;
            transition: all 0.2s;
            border-left: 4px solid transparent;
        }
        .pendenz-card:active { cursor: grabbing; }
        .pendenz-card:hover {
            box-shadow: var(--shadow);
            transform: translateY(-1px);
        }
        .pendenz-card.dragging {
            opacity: 0.4;
            transform: rotate(2deg);
        }
        .pendenz-card.priority-red { border-left-color: var(--red); }
        .pendenz-card.priority-yellow { border-left-color: var(--yellow); }
        .pendenz-card.priority-green { border-left-color: var(--green); }
        .pendenz-card.done {
            opacity: 0.7;
        }
        .pendenz-card.done .pendenz-title {
            text-decoration: line-through;
            color: var(--text-light);
        }

        .pendenz-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
        }
        .pendenz-title {
            font-weight: 600;
            font-size: 14px;
        }
        .pendenz-project-name {
            font-size: 11px;
            color: var(--text-light);
            margin-top: 2px;
        }
        .pendenz-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 6px;
            font-size: 12px;
        }
        .mini-assignees-inline {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            min-width: 0;
        }
        .pendenz-date {
            display: flex;
            align-items: center;
            gap: 4px;
            color: var(--text-light);
        }
        .pendenz-date.overdue {
            color: var(--red);
            font-weight: 600;
        }
        .priority-dot {
            width: 10px; height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .priority-dot.red { background: var(--red); }
        .priority-dot.yellow { background: var(--yellow); }
        .priority-dot.green { background: var(--green); }

        .pendenz-delete-btn {
            width: 24px; height: 24px;
            border-radius: 4px;
            display: flex; align-items: center; justify-content: center;
            font-size: 11px;
            color: var(--text-light);
            opacity: 0;
            transition: all 0.15s;
        }
        .pendenz-card:hover .pendenz-delete-btn { opacity: 1; }
        .pendenz-delete-btn:hover {
            background: var(--red-light);
            color: var(--red);
        }

        .pendenz-add-form {
            margin-top: 12px;
            background: var(--white);
            border-radius: var(--radius-sm);
            padding: 14px;
        }
        .pendenz-add-form input[type="text"] {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 8px 12px;
            margin-bottom: 8px;
            outline: none;
        }
        .pendenz-add-form input[type="text"]:focus { border-color: var(--blue); }
        .pendenz-add-row {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .pendenz-add-row input[type="date"] {
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 6px 10px;
            outline: none;
            font-size: 12px;
        }
        .pendenz-add-row select {
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 6px 10px;
            outline: none;
            font-size: 12px;
            background: var(--white);
        }
        .filter-bar {
            display: flex;
            gap: 12px;
            align-items: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }
        .filter-bar label {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-light);
        }
        .filter-bar select {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 8px 14px;
            background: var(--white);
            outline: none;
            font-size: 13px;
        }

        /* ==================== CHAT / BAUSTELLEN DOKU ==================== */
        .chat-container {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            max-height: 700px;
            min-height: 560px;
        }
        .chat-messages {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 16px;
            background: #f7f8fa;
        }
        .chat-message {
            display: flex;
            gap: 12px;
            max-width: 85%;
        }
        .chat-avatar {
            width: 36px; height: 36px;
            border-radius: 50%;
            background: var(--blue);
            color: white;
            display: flex; align-items: center; justify-content: center;
            font-weight: 700;
            font-size: 13px;
            flex-shrink: 0;
        }
        .chat-avatar.alt { background: var(--green); }
        .chat-avatar.alt2 { background: var(--orange); }
        .chat-bubble {
            background: var(--white);
            border-radius: 4px 16px 16px 16px;
            padding: 12px 16px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.06);
            flex: 1;
        }
        .chat-bubble-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 6px;
        }
        .chat-delete-btn {
            margin-left: auto;
            border: 0;
            background: transparent;
            color: var(--text-light);
            cursor: pointer;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.16s ease, background-color 0.16s ease, color 0.16s ease;
        }
        .chat-message:hover .chat-delete-btn {
            opacity: 1;
            pointer-events: auto;
        }
        .chat-delete-btn:hover {
            color: var(--red);
            background: var(--red-light);
        }
        .chat-sender {
            font-weight: 600;
            font-size: 13px;
        }
        .chat-time {
            font-size: 11px;
            color: var(--text-light);
        }
        .chat-text {
            font-size: 13px;
            line-height: 1.6;
        }
        .chat-image-placeholder {
            width: 200px;
            height: 150px;
            background: var(--bg);
            border-radius: var(--radius-sm);
            margin-top: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            font-size: 12px;
            gap: 6px;
            border: 1px solid var(--border);
        }
        .chat-image-placeholder i { font-size: 28px; }
        .chat-image-real {
            max-width: min(420px, 100%);
            max-height: 320px;
            display: block;
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            background: var(--bg);
            object-fit: cover;
            cursor: zoom-in;
        }
        .chat-input-area {
            padding: 16px;
            border-top: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 8px;
            align-items: stretch;
        }
        .chat-input-area textarea {
            flex: 1;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px 14px;
            resize: none;
            outline: none;
            min-height: 42px;
            max-height: 120px;
        }
        .chat-input-area textarea:focus { border-color: var(--blue); }
        .chat-input-meta {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
        }
        .chat-input-meta select {
            min-width: 150px;
        }
        .chat-input-actions {
            display: flex;
            gap: 4px;
            margin-left: auto;
            align-items: center;
        }
        .nas-tree-body {
            padding: 10px 12px;
        }
        .nas-tree-folder {
            margin-bottom: 4px;
        }
        .nas-tree-folder-row {
            width: 100%;
            border: 0;
            background: transparent;
            display: flex;
            align-items: center;
            gap: 8px;
            text-align: left;
            cursor: pointer;
            padding: 6px 4px;
            border-radius: 8px;
        }
        .nas-tree-folder-row:hover {
            background: var(--bg);
        }
        .nas-tree-folder-row.invalid {
            background: var(--red-light);
            color: var(--red);
        }
        .nas-tree-folder-row.static {
            cursor: default;
        }
        .nas-tree-folder-row.static:hover {
            background: transparent;
        }
        .nas-tree-folder-row.static.invalid:hover {
            background: var(--red-light);
        }
        .nas-tree-arrow {
            width: 12px;
            color: var(--text-light);
            font-size: 11px;
        }
        .nas-tree-folder-icon {
            color: var(--blue);
            font-size: 14px;
        }
        .nas-tree-folder-name {
            font-weight: 600;
            font-size: 13px;
        }
        .nas-tree-folder-count {
            margin-left: auto;
            font-size: 11px;
            color: var(--text-light);
        }
        .nas-tree-children {
            margin-left: 20px;
            border-left: 1px dashed var(--border);
            padding-left: 10px;
            display: grid;
            gap: 4px;
        }
        .nas-tree-file-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 6px 0;
            border-bottom: 1px solid var(--border);
        }
        .nas-tree-file-row.invalid {
            background: var(--red-light);
            border-radius: 8px;
            padding: 8px;
            border-bottom: 0;
        }
        .nas-tree-file-row:last-child {
            border-bottom: 0;
        }
        .nas-tree-file-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 0;
            flex: 1;
        }
        .nas-tree-file-icon {
            font-size: 14px;
            color: var(--red);
        }
        .nas-tree-file-text {
            min-width: 0;
        }
        .nas-tree-file-name {
            font-weight: 600;
            font-size: 13px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .nas-tree-file-link {
            color: inherit;
            text-decoration: underline;
            text-underline-offset: 2px;
            display: block;
            max-width: 100%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }
        .nas-tree-file-link:hover {
            color: var(--blue-dark);
        }
        .nas-tree-file-row.invalid .nas-tree-file-name,
        .nas-tree-file-row.invalid .page-subtitle,
        .nas-tree-folder-row.invalid .nas-tree-folder-name,
        .nas-tree-folder-row.invalid .nas-tree-folder-count {
            color: var(--red);
        }
        .nas-tree-file-row.invalid .nas-tree-file-icon,
        .nas-tree-folder-row.invalid .nas-tree-folder-icon,
        .nas-tree-folder-row.invalid .nas-tree-arrow {
            color: var(--red);
        }
        .nas-tree-folder.level-1 .nas-tree-folder-icon { color: var(--blue-dark); }
        .nas-tree-folder.level-2 .nas-tree-folder-icon { color: var(--green); }
        .nas-tree-folder.level-3 .nas-tree-folder-icon { color: var(--orange); }
        .doku-layout {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
            align-items: stretch;
        }
        .doku-notes-panel {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            display: flex;
            flex-direction: column;
            min-height: 560px;
        }
        .doku-notes-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .doku-note-list {
            padding: 12px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            overflow-y: auto;
        }
        .doku-note-chip {
            text-align: left;
            border: 1px solid var(--border);
            background: var(--bg);
            border-radius: var(--radius-xs);
            padding: 8px 10px;
            transition: all 0.15s;
        }
        .doku-note-chip:hover {
            border-color: var(--blue);
            background: var(--blue-light);
        }
        .doku-note-chip-title {
            font-size: 12px;
            font-weight: 600;
        }
        .doku-note-chip-date {
            font-size: 11px;
            color: var(--text-light);
            margin-top: 2px;
        }
        .doku-note-editor {
            border-top: 1px solid var(--border);
            padding: 12px;
            display: grid;
            gap: 8px;
            background: #fafbfc;
        }
        .doku-note-editor input, .doku-note-editor textarea {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 8px 10px;
            outline: none;
            font-size: 13px;
        }
        .doku-note-editor textarea {
            min-height: 120px;
            resize: vertical;
        }
        .notes-card-strip {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            padding: 10px 2px 6px;
            scrollbar-width: thin;
        }
        .note-card {
            width: 150px;
            min-width: 150px;
            height: 150px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg);
            text-align: left;
            padding: 8px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            transition: all 0.15s ease;
            position: relative;
        }
        .note-card-delete {
            position: absolute;
            top: 6px;
            right: 6px;
            width: 20px;
            height: 20px;
            border: 1px solid var(--border);
            border-radius: 999px;
            background: var(--white);
            color: var(--text-light);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
        }
        .note-card:hover .note-card-delete {
            opacity: 1;
        }
        .note-card-delete:hover {
            color: var(--red);
            background: var(--red-light);
        }
        .note-card:hover {
            border-color: var(--blue);
            background: var(--blue-light);
            transform: translateY(-1px);
        }
        .note-card-date {
            font-size: 10px;
            color: var(--text-light);
            line-height: 1.2;
        }
        .note-card-title {
            font-size: 12px;
            font-weight: 700;
            line-height: 1.2;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }
        .note-card-text {
            font-size: 11px;
            color: var(--text-light);
            line-height: 1.25;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
        }
        .note-editor-modal {
            display: grid;
            gap: 8px;
            align-content: start;
            grid-auto-rows: max-content;
        }
        .note-editor-row {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 10px;
            align-items: end;
            align-self: start;
        }
        .note-editor-row .form-group {
            margin-bottom: 0;
        }
        .note-editor-date-group input[type="date"] {
            width: 150px;
            min-width: 150px;
        }
        .note-editor-title-group {
            min-width: 0;
        }
        .note-editor-textarea {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            padding: 12px 14px;
            line-height: 1.45;
            min-height: 240px;
            resize: vertical;
        }

        /* ==================== GALLERY ==================== */
        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 16px;
        }
        .gallery-item {
            background: var(--white);
            border-radius: var(--radius-sm);
            box-shadow: var(--shadow);
            overflow: hidden;
            transition: all 0.2s;
            cursor: pointer;
        }
        .gallery-item:hover {
            box-shadow: var(--shadow-lg);
            transform: translateY(-2px);
        }
        .gallery-thumb {
            width: 100%;
            height: 140px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            color: var(--text-light);
        }
        .gallery-thumb.pdf {
            background: linear-gradient(135deg, #fff5f5, #ffe8e8);
        }
        .gallery-thumb.pdf i { font-size: 40px; color: var(--red); }
        .gallery-thumb.photo {
            background: linear-gradient(135deg, #e8f6fb, #d0ecf5);
        }
        .gallery-thumb.photo i { font-size: 40px; color: var(--blue); }
        .gallery-thumb.photo-alt {
            background: linear-gradient(135deg, #f0f5e8, #e0eccc);
        }
        .gallery-thumb.photo-alt i { font-size: 40px; color: var(--green); }
        .gallery-label {
            padding: 10px 12px;
            font-size: 12px;
            font-weight: 500;
            border-top: 1px solid var(--border);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* ==================== MODAL ==================== */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s;
        }
        .modal-overlay.active {
            opacity: 1;
            pointer-events: all;
        }
        .modal {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow-lg);
            max-width: 520px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            transform: translateY(20px);
            transition: transform 0.2s;
        }
        .modal.modal-photo-viewer {
            width: min(96vw, 1600px);
            max-width: min(96vw, 1600px);
            max-height: 95vh;
        }
        .modal.modal-photo-viewer .modal-header {
            padding: 14px 18px;
        }
        .modal.modal-photo-viewer .modal-body {
            padding: 8px 12px 12px;
        }
        .modal.modal-note-editor {
            width: min(92vw, 980px);
            max-width: min(92vw, 980px);
            min-width: 680px;
            height: min(94vh, 980px);
            max-height: 94vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .modal.modal-note-editor .modal-header {
            flex: 0 0 auto;
        }
        .modal.modal-note-editor .modal-body {
            padding: 16px 18px;
            flex: 1 1 auto;
            min-height: 0;
            overflow: auto;
        }
        .modal.modal-note-editor .note-editor-modal {
            height: 100%;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .modal.modal-note-editor .note-editor-text-group {
            flex: 1 1 auto;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }
        .modal.modal-note-editor .note-editor-text-group label {
            flex: 0 0 auto;
        }
        .modal.modal-note-editor .note-editor {
            display: flex;
            flex-direction: column;
            height: 100%;
            min-height: 0;
            flex: 1 1 auto;
        }
        .modal.modal-note-editor .note-editor .note-editing-area {
            flex: 1 1 auto;
            min-height: 0;
        }
        .modal.modal-note-editor .note-editor .note-editing-area .note-editable {
            min-height: 100%;
        }
        .modal.modal-note-editor .note-editor .note-statusbar {
            margin-top: auto;
        }
        .modal-overlay.active .modal { transform: translateY(0); }
        .modal-header {
            padding: 20px 24px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .modal-title { font-weight: 700; font-size: 18px; }
        .modal-close {
            width: 32px; height: 32px;
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            color: var(--text-light);
            transition: all 0.15s;
        }
        .modal-close:hover { background: var(--bg); color: var(--text); }
        .modal-body { padding: 24px; }
        .modal-footer {
            padding: 16px 24px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }
        .form-group { margin-bottom: 16px; }
        .form-group label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 6px;
            color: var(--text-light);
        }
        .form-group input[type="text"],
        .form-group input[type="email"],
        .form-group input[type="password"],
        .form-group input[type="date"],
        .form-group select {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            outline: none;
            transition: border-color 0.2s;
        }
        .form-group input:focus, .form-group select:focus { border-color: var(--blue); }
        .form-check {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 0;
        }
        .form-check input[type="checkbox"] {
            width: 18px; height: 18px;
            accent-color: var(--blue);
        }
        .form-check label {
            margin: 0;
            font-size: 14px;
            font-weight: 500;
            color: var(--text);
        }

        /* ==================== TERMINPROGRAMM PLACEHOLDER ==================== */
        .placeholder-box {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 60px 40px;
            text-align: center;
            max-width: 600px;
            margin: 40px auto;
        }
        .placeholder-box i {
            font-size: 48px;
            color: var(--border);
            margin-bottom: 20px;
        }
        .placeholder-box h3 {
            font-size: 18px;
            margin-bottom: 10px;
        }
        .placeholder-box p {
            color: var(--text-light);
            font-size: 14px;
        }

        /* ==================== RESPONSIVE ==================== */
        @media (min-width: 769px) and (max-width: 1024px) {
            .header-inner { padding: 0 16px; gap: 14px; }
            .content { padding: 18px; }
            .nav-tab { padding: 7px 12px; font-size: 13px; }
            .project-list-header, .project-list-row { grid-template-columns: 90px 1.2fr 1fr 1fr 1fr 100px; }
            .overview-grid { grid-template-columns: 1fr; }
            .doku-layout { grid-template-columns: 1fr; }
            .project-inline-meta { grid-template-columns: 1fr 1fr; }
            .card-body { padding: 16px; }
            .page-title { font-size: 20px; }
            .checklist-row { grid-template-columns: repeat(auto-fill, 336px); justify-content: start; }
        }
        @media (max-width: 768px) {
            .header-inner { padding: 0 12px; gap: 12px; }
            .content { padding: 12px; }
            .main-nav {
                display: none;
                position: fixed;
                top: 60px;
                left: 0;
                right: 0;
                z-index: 1200;
                background: var(--white);
                border-top: 1px solid var(--border);
                box-shadow: var(--shadow-lg);
                padding: 10px 12px;
                flex-direction: column;
                gap: 6px;
                max-height: calc(100vh - 60px);
                overflow-y: auto;
            }
            .main-nav.open { display: flex; }
            .mobile-nav-toggle { display: inline-flex; }
            .nav-tab { width: 100%; text-align: left; padding: 10px 12px; font-size: 14px; }
            .mobile-only-nav-item { display: inline-flex; }
            .desktop-only-inline { display: none !important; }
            .header-right { gap: 8px; }
            .user-select { min-width: 72px; max-width: 110px; font-size: 10px; padding: 4px 8px; }
            #logoutBtn { display: none !important; }
            .page-header { margin-bottom: 14px; gap: 10px; }
            .page-title { font-size: 18px; }
            .page-header > div { width: 100%; }
            .page-header .project-search-input { min-width: 0; max-width: 100%; width: 100%; }
            .btn { padding: 8px 12px; font-size: 12px; }
            .btn-sm { padding: 6px 10px; font-size: 11px; }
            .card-header {
                flex-direction: column;
                align-items: flex-start;
                padding: 12px;
                gap: 8px;
            }
            .card-body { padding: 12px; }
            .checklist-row { grid-template-columns: 1fr; gap: 12px; }
            .checklist-card { max-width: none; width: 100%; }
            .add-checklist-card { max-width: none; width: 100%; }
            .pendenzen-board { grid-template-columns: 1fr; }
            .overview-grid { grid-template-columns: 1fr; }
            .toolbox-pendenzen-grid { grid-template-columns: 1fr; }
            .project-inline-meta { grid-template-columns: 1fr; }
            .project-inline-item { gap: 6px; padding: 6px; }
            .project-inline-label { font-size: 9px; }
            .project-inline-value, .project-inline-input { font-size: 12px; }
            .project-inline-input { min-width: 0; }
            .project-inline-item.id-compact { display: none; }
            .project-detail-header { padding: 6px 8px; margin-bottom: 8px; }
            .doku-layout { grid-template-columns: 1fr; }
            .address-grid { grid-template-columns: 1fr; }
            .project-grid { grid-template-columns: 1fr; }
            .kontakt-add-grid { grid-template-columns: 1fr; }
            .finance-list-item { grid-template-columns: 1fr; gap: 4px; }
            .project-list-header,
            .project-list-row { grid-template-columns: 1fr; gap: 4px; }
            .wiki-layout { grid-template-columns: 1fr; }
            .wiki-content-header { flex-direction: column; align-items: flex-start; }
            .wiki-content-header > div:last-child { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; }
            .pendenz-add-row { flex-wrap: wrap; }
            .pendenz-add-row > * { width: 100%; min-width: 0; }
            .filter-bar { gap: 8px; }
            .filter-bar label { width: 100%; }
            .chat-container { min-height: 440px; max-height: none; }
            .chat-message { max-width: 100%; }
            .chat-input-actions { margin-left: 0; width: 100%; justify-content: flex-end; }
            .checklist-card-header { flex-wrap: wrap; gap: 6px; }
            .checklist-card-title { max-width: 100%; }
            .checklist-item { align-items: flex-start; }
            .checklist-item-actions { opacity: 1; }
            .checklist-item-actions button { width: 22px; height: 22px; }
            .modal {
                width: 96vw;
                max-height: 92vh;
                border-radius: 10px;
            }
            .modal-header { padding: 12px 14px; }
            .modal-body { padding: 10px 12px; }
            .modal-footer { padding: 10px 12px; flex-wrap: wrap; }
            .modal-footer .btn { width: 100%; justify-content: center; }
            .note-editor-row { grid-template-columns: 1fr; }
            .note-editor-date-group input[type="date"] { width: 100%; min-width: 0; }
            .modal.modal-note-editor {
                width: 96vw;
                max-width: 96vw;
                min-width: 0;
                height: 92vh;
                max-height: 92vh;
                border-radius: 10px;
            }
            .modal.modal-note-editor .modal-header {
                padding: 12px 14px;
            }
            .modal.modal-note-editor .modal-body {
                padding: 10px 12px;
            }
        }
        @media (max-width: 420px) {
            .header-inner { padding: 0 10px; gap: 8px; }
            .logo-image { width: 68px; height: 32px; }
            .content { padding: 10px; }
            .page-title { font-size: 17px; }
            .card-header { padding: 10px; }
            .card-body { padding: 10px; }
            .chip { font-size: 10px; padding: 2px 6px; }
            input[type="text"],
            input[type="email"],
            input[type="password"],
            input[type="number"],
            input[type="date"],
            textarea,
            select {
                font-size: 16px !important;
            }
            .btn-mobile-hide-project-create { display: none !important; }
            .desktop-only-inline { display: none !important; }
            .project-list-header { display: none !important; }
            .project-inline-meta { grid-template-columns: 1fr; }
            .project-inline-meta .project-inline-item:not(.mobile-summary-only) { display: none; }
            .project-inline-meta .mobile-summary-only {
                display: flex;
                grid-column: 1 / -1;
                padding: 6px 8px;
                background: var(--bg);
                border-radius: var(--radius-xs);
            }
            .project-inline-meta .mobile-summary-only .project-inline-value {
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                font-size: 12px;
                font-weight: 600;
            }
            .inner-tabs { display: none; }
            .inner-tabs-mobile {
                display: flex;
                align-items: center;
                gap: 6px;
                margin-bottom: 10px;
            }
            .inner-tabs-mobile-priority {
                display: flex;
                gap: 4px;
                flex: 1;
                overflow-x: auto;
            }
            .inner-tab.inner-tab-mobile {
                padding: 8px 10px;
                font-size: 12px;
                flex-shrink: 0;
            }
            .inner-tabs-mobile-dropdown { position: relative; }
            .inner-tabs-more-btn {
                display: inline-flex;
                width: 34px;
                height: 34px;
            }
            .inner-tabs-mobile-menu {
                display: none;
                position: absolute;
                right: 0;
                top: calc(100% + 6px);
                min-width: 190px;
                max-width: 78vw;
                z-index: 1150;
                background: var(--white);
                border: 1px solid var(--border);
                border-radius: var(--radius-sm);
                box-shadow: var(--shadow-lg);
                padding: 6px;
                flex-direction: column;
                gap: 4px;
            }
            .inner-tabs-mobile-menu.open { display: flex; }
            .inner-tabs-mobile-menu .nav-tab {
                width: 100%;
                text-align: left;
                padding: 10px 12px;
                font-size: 14px;
            }
            .project-inline-item.id-compact .project-inline-input { width: 100%; max-width: none; }
            .project-inline-item.plz-compact .project-inline-input { width: 100%; max-width: none; }
            .note-card { width: 138px; min-width: 138px; height: 138px; }
            .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
        }

        /* ==================== SCROLLBAR ==================== */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

        /* ==================== ANIMATIONS ==================== */
        @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
        .fade-in { animation: fadeIn 0.3s ease-out; }

        .empty-state {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-light);
        }
        .empty-state i { font-size: 36px; margin-bottom: 12px; display: block; }
        .section-stack { display: grid; gap: 16px; }
        .split-board { display: grid; gap: 18px; }
        .section-title-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 10px;
        }
        .overview-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }
        @media (max-width: 768px) {
            .overview-grid { grid-template-columns: 1fr !important; }
        }
        .overview-list {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            padding: 14px;
        }
        .overview-item {
            padding: 9px 0;
            border-bottom: 1px solid var(--border);
            font-size: 13px;
        }
        .overview-item:last-child { border-bottom: none; }
        .chip {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: 600;
            padding: 2px 7px;
            background: var(--bg);
            color: var(--text-light);
        }
        .chip.badge-info { background: #e8f6fb; color: var(--blue-dark); }
        .chip.badge-note { background: #fff5db; color: #8b6615; }
        .chip.badge-talk { background: #ffeaea; color: var(--red); }
        .mini-assignees { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
        .finance-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 12px;
            margin-bottom: 14px;
        }
        .finance-box {
            background: var(--bg);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
        }
        .finance-box-label { font-size: 11px; color: var(--text-light); text-transform: uppercase; font-weight: 700; }
        .finance-box-value { font-size: 18px; font-weight: 700; margin-top: 3px; }
        .finance-list-item {
            display: grid;
            grid-template-columns: 100px 120px 110px 100px 1fr auto;
            gap: 8px;
            padding: 8px 0;
            border-bottom: 1px solid var(--border);
            align-items: center;
            font-size: 12px;
        }
        .finance-list-item:last-child { border-bottom: none; }
        .details-field textarea {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 10px 12px;
            min-height: 90px;
            resize: vertical;
            outline: none;
            background: var(--white);
        }
        .details-field textarea:read-only { background: var(--bg); border-color: transparent; }
        .termine-list {
            display: grid;
            gap: 10px;
        }
        .termin-item {
            background: var(--white);
            border-radius: var(--radius-sm);
            border: 1px solid var(--border);
            padding: 12px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 10px;
        }
        .termin-item.done {
            opacity: 0.7;
            background: #f5f8f5;
        }
        .termin-item.done .termin-title {
            text-decoration: line-through;
            color: var(--text-light);
        }
        .termin-title {
            font-weight: 600;
            margin-bottom: 4px;
        }
        .termin-note {
            font-size: 12px;
            color: var(--text-light);
        }
        .toolbox-pendenzen-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 16px;
        }
        .toolbox-pendenz-item {
            border-bottom: 1px solid var(--border);
            padding: 10px 0;
        }
        .toolbox-pendenz-item:last-child { border-bottom: none; }
        .toolbox-pendenz-title {
            font-weight: 600;
            font-size: 13px;
        }
        .toolbox-pendenz-project {
            font-size: 11px;
            color: var(--text-light);
            margin-top: 3px;
        }
        .new-checklist-input-wrap {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 16px;
        }
        .new-checklist-input-wrap input {
            border: 1px solid var(--border);
            border-radius: var(--radius-xs);
            padding: 8px 12px;
            outline: none;
        }
        .new-checklist-input-wrap input:focus { border-color: var(--blue); }

        .terminprogramm-viewport {
            height: var(--tp-viewport-height);
            min-height: 520px;
            overflow-x: auto;
            overflow-y: hidden;
            position: relative;
        }
        .terminprogramm-stage {
            position: relative;
            width: var(--tp-stage-width);
            height: var(--tp-stage-height);
            margin: 0 auto;
        }
        .terminprogramm-rotated {
            position: absolute;
            left: var(--tp-offset-x);
            top: var(--tp-offset-y);
            transform: rotate(var(--tp-rotate));
            transform-origin: top left;
        }
        .terminprogramm-image {
            border: 0;
            display: block;
            width: var(--tp-img-width);
            height: var(--tp-img-height);
            max-width: none;
        }