/* ============================================
   RIICT PM - Projektmanagement 2026
   ============================================ */

.pm-form-page, .pm-single, .pm-project-list, .pm-dashboard {
    max-width: 100%; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.6; color: #333;
}

/* ============================================
   LAYOUT MIT THEME-SIDEBAR
   ============================================
   Diese Templates ersetzen die komplette Seite (template_include) und riefen
   bisher get_sidebar() nie auf, wodurch eine im Theme aktivierte Sidebar nie
   erschien. .pm-layout-wrap begrenzt die Gesamtbreite auf 1920px -5% (1824px)
   und teilt den verbleibenden Platz responsiv zwischen Inhalt (#primary) und
   der Sidebar auf.
   Bewusst NICHT auf die IDs/Klassen der Sidebar (#secondary, .widget-area
   o.ä.) verlassen: manche Themes wrappen get_sidebar() in ein eigenes
   Container-Element mit anderem Namen, wodurch diese Selektoren ins Leere
   liefen. Stattdessen gilt: #primary.pm-content-area (unser eigenes Markup,
   immer als erstes Kind vorhanden) bekommt die Inhaltsspalte, ALLES übrige
   direkte Kind von .pm-layout-wrap (= was auch immer get_sidebar() ausgibt)
   wird automatisch als Sidebar-Spalte behandelt — unabhängig vom Theme. */
.pm-layout-wrap {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 40px;
    max-width: 1824px;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
    width: 100%;
}
/* Hohe Spezifität + !important, da viele Themes #primary bereits selbst mit
   display/width/float belegen (z.B. eigenes Flex- oder Float-Layout). Diese
   Regeln erzwingen unser Spaltenmodell zuverlässig unabhängig vom Theme. */
.pm-layout-wrap > #primary.pm-content-area {
    display: block !important;
    float: none !important;
    flex: 1 1 0 !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.pm-layout-wrap > *:not(#primary) {
    display: block !important;
    float: none !important;
    flex: 0 0 300px !important;
    width: 300px !important;
    max-width: 300px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
/* Beide Spalten sollen optisch gleich hoch wirken, auch wenn eine Seite
   (meist die Sidebar) weniger Inhalt hat: align-items:stretch (oben)
   zieht #primary und die Sidebar automatisch auf die Höhe des jeweils
   höheren Geschwisterelements. Wird zusätzlich per JS abgesichert, siehe
   pmEqualizeLayoutHeight() in pm-script.js. */
@media (max-width: 900px) {
    .pm-layout-wrap {
        flex-wrap: wrap;
        flex-direction: column;
        gap: 24px;
        padding: 0 16px;
    }
    .pm-layout-wrap > *:not(#primary) {
        flex-basis: auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Formular */
.pm-form-wrapper { background: #f8f9fa; padding: 32px; border-radius: 10px; border: 1px solid #e9ecef; margin-bottom: 40px; }
.pm-form-wrapper h2 { margin-top: 0; margin-bottom: 24px; font-size: 1.6em; color: #1a1a2e; }
.pm-field { margin-bottom: 20px; }
.pm-field label { display: block; font-weight: 600; margin-bottom: 6px; color: #495057; font-size: 0.95em; }
.pm-field input[type="text"], .pm-field input[type="number"], .pm-field input[type="date"], .pm-field input[type="range"], .pm-field select, .pm-field textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #ced4da; border-radius: 6px; font-size: 15px; box-sizing: border-box;
}
.pm-meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pm-check-group { display: flex; flex-wrap: wrap; gap: 14px; }
.pm-check-group label { font-weight: 400; display: flex; align-items: center; gap: 6px; background: #fff; padding: 8px 14px; border-radius: 20px; border: 1px solid #dee2e6; cursor: pointer; }
.pm-actions { margin-top: 24px; }

/* Buttons */
.pm-btn { display: inline-block; padding: 10px 22px; background: #6c757d; color: #fff; text-decoration: none; border-radius: 6px; border: none; cursor: pointer; font-size: 15px; font-weight: 500; transition: background 0.2s; }
.pm-btn:hover { background: #5a6268; color: #fff; }
.pm-btn-primary { background: var(--pm-primary, #3c0103); }
.pm-btn-primary:hover { background: var(--pm-primary, #3c0103); filter: brightness(1.15); }
.pm-btn-danger { background: #dc3545; }
.pm-btn-danger:hover { background: #c82333; }
.pm-btn-danger:disabled { background: #e9ecef; color: #adb5bd; cursor: not-allowed; }
.pm-btn-small { padding: 5px 12px; font-size: 0.85em; background: #fff; color: #dc3545; border: 1px solid #dc3545; border-radius: 5px; cursor: pointer; }
.pm-btn-small:hover { background: #dc3545; color: #fff; }
.pm-status { margin-left: 15px; font-weight: 600; }

/* Bulk-Bar */
.pm-bulk-bar { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.pm-bulk-bar label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.pm-bulk-count { margin-left: auto; font-size: 0.9em; color: #6c757d; }

/* Karten & Listen */
.pm-list { display: flex; flex-direction: column; gap: 14px; }
.pm-card { display: flex; align-items: flex-start; gap: 14px; background: #fff; border: 1px solid #e9ecef; padding: 18px; border-radius: 10px; transition: box-shadow 0.2s; }
.pm-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.pm-card-check { padding-top: 2px; flex-shrink: 0; }
.pm-card-main { flex: 1; min-width: 0; }
.pm-card h4 { margin: 0 0 8px; font-size: 1.15em; }
.pm-card h4 a { color: #1a1a2e; text-decoration: none; }
.pm-card h4 a:hover { text-decoration: underline; }
.pm-card-meta { font-size: 0.85em; color: #6c757d; margin-bottom: 8px; }
.pm-card-actions { flex-shrink: 0; padding-top: 2px; }

/* Fortschrittsbalken */
.pm-progress { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85em; font-weight: 600; color: #495057; background: #e9ecef; padding: 3px 10px; border-radius: 12px; }
.pm-progress span { display: inline-block; height: 8px; background: #0073aa; border-radius: 4px; min-width: 4px; }
.pm-progress.large { display: flex; width: 100%; max-width: 300px; padding: 4px 12px; margin-bottom: 10px; }
.pm-progress.large span { height: 12px; }

/* Dashboard */
.pm-dashboard { padding: 20px 0; }
.pm-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; margin-bottom: 30px; }
.pm-stat-box { background: #fff; border: 1px solid #e9ecef; border-radius: 10px; padding: 24px; text-align: center; }
.pm-stat-num { display: block; font-size: 2.2em; font-weight: 700; color: #1a1a2e; }
.pm-stat-critical .pm-stat-num { color: #dc3545; }
.pm-mini-list { display: flex; flex-direction: column; gap: 10px; }
.pm-mini-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: #fff; border: 1px solid #e9ecef; border-radius: 8px; text-decoration: none; color: #333; }
.pm-mini-item:hover { border-color: #0073aa; }

/* Phasen-Baum */
.pm-phase-tree { list-style: none; padding: 0; margin: 0; }
.pm-phase-tree li { margin: 8px 0; }
.pm-phase-tree > li { margin: 14px 0; }
.pm-phase-tree a { display: inline-block; padding: 6px 14px; color: #1a1a2e; text-decoration: none; font-weight: 500; border-radius: 6px; transition: background 0.15s; }
.pm-phase-tree a:hover { background: #f1f8ff; text-decoration: underline; }
.pm-phase-children { list-style: none; padding-left: 24px; margin: 6px 0 10px; border-left: 2px solid #e9ecef; }
.pm-phase-children a { font-size: 0.95em; color: #495057; }

/* Einzelansicht */
.pm-project-header { border-bottom: 2px solid #e9ecef; padding-bottom: 24px; margin-bottom: 30px; }
.pm-project-header h1 { margin: 0 0 16px; font-size: 2em; color: #1a1a2e; }
.pm-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 24px; padding: 20px; background: #f8f9fa; border-radius: 10px; }
.pm-dora-badge { display: inline-block; background: #721c24; color: #f8d7da; padding: 4px 12px; border-radius: 20px; font-size: 0.8em; font-weight: 700; }
.pm-ai-box, .pm-okr-box { background: #e7f3ff; border-left: 4px solid #0073aa; padding: 16px 20px; margin: 20px 0; border-radius: 0 8px 8px 0; }
.pm-milestone-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.pm-milestone { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: #f8f9fa; border-radius: 8px; border-left: 4px solid #6c757d; }
.pm-milestone.erreicht { border-left-color: #28a745; background: #d4edda; }
.pm-milestone.verzoegert { border-left-color: #dc3545; background: #f8d7da; }
.pm-ms-status { font-size: 0.8em; font-weight: 600; text-transform: uppercase; }
.pm-edit-link { margin-top: 40px; padding-top: 24px; border-top: 1px solid #e9ecef; display: flex; gap: 10px; flex-wrap: wrap; }

/* Archiv-Template */
.pm-archive-page { max-width: 100%; margin: 0; }
.pm-header { text-align: center; margin-bottom: 40px; padding-bottom: 24px; border-bottom: 2px solid #e9ecef; }
.pm-header h1 { font-size: 2.2em; color: #1a1a2e; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

/* Responsive */
@media (max-width: 768px) {
    .pm-meta-grid { grid-template-columns: 1fr; }
    .pm-grid { grid-template-columns: 1fr; }
    .pm-bulk-bar { gap: 10px; }
    .pm-card { flex-wrap: wrap; }
    .pm-card-actions { width: 100%; text-align: right; padding-top: 8px; }
}

/* ============================================
   BUDGET, STUNDEN, ARTIKEL, DOKUMENTATION
   ============================================ */

.pm-dynamic-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.pm-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #f8f9fa; padding: 10px; border-radius: 8px; }
.pm-row input, .pm-row select { padding: 8px 10px; border: 1px solid #ced4da; border-radius: 5px; font-size: 14px; flex: 1; min-width: 100px; }
.pm-row-total { font-weight: 700; color: #1a1a2e; min-width: 80px; text-align: right; }
.pm-budget-hint { font-size: 0.9em; color: #6c757d; margin: 8px 0 16px; text-align: right; }
.pm-budget-bar { font-size: 1.05em; }

.pm-budget-panel { background: #fff; border: 1px solid #e9ecef; border-radius: 10px; padding: 24px; margin: 24px 0; }
.pm-budget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 16px; }
.pm-budget-card { text-align: center; padding: 16px; background: #f8f9fa; border-radius: 8px; }
.pm-budget-card.used { background: #fff3cd; }
.pm-budget-card.left { background: #d4edda; }
.pm-budget-card.left.negative { background: #f8d7da; }
.pm-budget-label { display: block; font-size: 0.8em; color: #6c757d; text-transform: uppercase; margin-bottom: 6px; }
.pm-budget-num { display: block; font-size: 1.4em; font-weight: 700; color: #1a1a2e; }
.pm-budget-bar-visual { height: 12px; background: #e9ecef; border-radius: 6px; overflow: hidden; }
.pm-budget-bar-visual span { display: block; height: 100%; border-radius: 6px; transition: width 0.3s; }

.pm-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.95em; }
.pm-table th { text-align: left; padding: 10px 12px; background: #f8f9fa; border-bottom: 2px solid #e9ecef; font-weight: 600; }
.pm-table td { padding: 10px 12px; border-bottom: 1px solid #e9ecef; }
.pm-total-row td { background: #f8f9fa; font-weight: 600; border-top: 2px solid #e9ecef; }

.pm-documentation { background: #f8f9fa; padding: 24px; border-radius: 10px; border-left: 4px solid #0073aa; line-height: 1.7; }
.pm-documentation p { margin: 0 0 12px; }
.pm-documentation p:last-child { margin-bottom: 0; }

/* Backend Meta-Box Hilfsstyles */
.pm-meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pm-inline { display: inline-flex !important; align-items: center; gap: 6px; font-weight: 400 !important; }
.pm-ms-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.pm-ms-row input, .pm-ms-row select { padding: 6px 8px; }


/* ============================================
   GROSSE ERFASSUNGSFELDER & BUTTONS
   ============================================ */

.pm-dynamic-rows .pm-row {
    padding: 20px;
    gap: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    align-items: stretch;
    margin-bottom: 10px;
}

.pm-dynamic-rows .pm-row input[type="text"],
.pm-dynamic-rows .pm-row input[type="number"],
.pm-dynamic-rows .pm-row input[type="date"],
.pm-dynamic-rows .pm-row select {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 52px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    flex: 1;
}

.pm-dynamic-rows .pm-row input[type="text"]::placeholder,
.pm-dynamic-rows .pm-row input[type="number"]::placeholder {
    color: #adb5bd;
}

.pm-row-total {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--pm-primary, #3c0103);
    min-width: 100px;
    text-align: right;
    align-self: center;
}

/* Alle Add-Buttons in Primary-Farbe */
#pm-add-milestone,
#pm-add-hour,
#pm-add-article {
    background: var(--pm-primary, #3c0103);
    color: #fff;
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.2s;
}

#pm-add-milestone:hover,
#pm-add-hour:hover,
#pm-add-article:hover {
    filter: brightness(1.2);
}

/* ============================================
   KANBAN BOARD
   ============================================ */

.pm-kanban-page {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.pm-kanban-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.pm-kanban-header-bar h1 {
    margin: 0;
    font-size: 1.8em;
    color: #1a1a2e;
}

.pm-kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.pm-kanban-column {
    min-width: 300px;
    width: 300px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
}

.pm-kanban-col-header {
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    border-top: 4px solid var(--pm-primary, #3c0103);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pm-kanban-col-count {
    background: #e9ecef;
    color: #495057;
    font-size: 0.85em;
    padding: 4px 12px;
    border-radius: 20px;
}

.pm-kanban-dropzone {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    transition: background 0.2s;
}

.pm-kanban-dropzone.drag-over {
    background: #e7f3ff;
    box-shadow: inset 0 0 0 2px var(--pm-primary, #3c0103);
}

.pm-kanban-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: grab;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}

.pm-kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.pm-kanban-card:active {
    cursor: grabbing;
}

.pm-kanban-card[draggable="true"] {
    user-select: none;
}

.pm-kanban-prio {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 10px 0 0 10px;
}

.pm-kanban-card h4 {
    margin: 0 0 10px;
    font-size: 1.05em;
    padding-left: 8px;
}

.pm-kanban-card h4 a {
    color: #1a1a2e;
    text-decoration: none;
}

.pm-kanban-card h4 a:hover {
    color: var(--pm-primary, #3c0103);
}

.pm-kanban-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 8px;
}

.pm-progress.mini {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    display: block;
}

.pm-progress.mini span {
    display: block;
    height: 100%;
    background: var(--pm-primary, #3c0103);
    border-radius: 3px;
}

.pm-kanban-prio-label {
    font-size: 0.75em;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    white-space: nowrap;
}

.pm-kanban-edit {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #adb5bd;
    text-decoration: none;
    font-size: 0.9em;
}

.pm-kanban-edit:hover {
    color: var(--pm-primary, #3c0103);
}

/* Responsive Kanban */
@media (max-width: 768px) {
    .pm-kanban-board {
        flex-direction: column;
        align-items: stretch;
    }
    .pm-kanban-column {
        width: 100%;
        min-width: auto;
        max-height: none;
    }
}

/* ============================================
   STATUS-DOKUMENTATIONEN
   ============================================ */

.pm-status-docs {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.pm-status-doc-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
}

.pm-doc-empty-hint {
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 10px;
    padding: 18px 20px;
    color: #6c757d;
    margin: 0;
}

.pm-status-doc-label {
    display: block;
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 12px;
    color: #1a1a2e;
}

.pm-status-docs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.pm-status-doc-box {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.pm-status-doc-box:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.pm-status-doc-box.is-current {
    border-color: var(--pm-primary, #3c0103);
    border-left-width: 4px;
}

.pm-status-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.pm-status-doc-name {
    font-weight: 700;
    color: #1a1a2e;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.pm-status-doc-badge {
    background: var(--pm-primary, #3c0103);
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
}

.pm-status-doc-content {
    padding: 20px;
    line-height: 1.7;
    color: #495057;
}

.pm-status-doc-content p {
    margin: 0 0 12px;
}

.pm-status-doc-content p:last-child {
    margin-bottom: 0;
}

/* Phasen-Dokumentationen erben die Status-Doc-Styles (gleiche Klassen),
   bekommen aber einen dezenten eigenen Akzent zur Unterscheidung. */
.pm-phase-doc-box.is-current {
    border-color: #0073aa;
}

.pm-phase-doc-box.is-current .pm-status-doc-badge {
    background: #0073aa;
}

.pm-section-title {
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.3em;
    color: #1a1a2e;
}

/* Frontend Admin */
.pm-admin-page { max-width: 100%; margin: 0; padding: 0; }
.pm-admin-wrapper { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.pm-admin-tabs { display: flex; gap: 8px; border-bottom: 2px solid #e9ecef; margin-bottom: 25px; padding-bottom: 0; }
.pm-admin-tabs a { padding: 12px 20px; text-decoration: none; color: #495057; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.pm-admin-tabs a.active { color: var(--pm-primary, #3c0103); border-bottom-color: var(--pm-primary, #3c0103); }
.pm-admin-section h2 { margin-top: 0; font-size: 1.4rem; }
.pm-admin-section h3 { font-size: 1.1rem; margin-top: 25px; padding-bottom: 8px; border-bottom: 1px solid #e9ecef; }
.pm-tax-box { background: #f8f9fa; padding: 20px; border-radius: 6px; margin-bottom: 20px; }
.pm-admin-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.pm-admin-table th, .pm-admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #dee2e6; }
.pm-admin-table input { padding: 5px 8px; border: 1px solid #ced4da; border-radius: 4px; }
.pm-dept-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.pm-dept-card { background: #f8f9fa; padding: 20px; border-radius: 6px; border-left: 4px solid var(--pm-primary, #3c0103); }
.pm-dept-card h4 { margin: 0 0 10px; }
.pm-dept-actions { margin-top: 15px; display: flex; gap: 8px; }
.pm-add-term-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pm-add-term-row input { padding: 6px 10px; border: 1px solid #ced4da; border-radius: 4px; }
.pm-status { margin-left: 12px; font-weight: 500; color: #28a745; }
/* ============================================
   VIEW SWITCHER (Liste / Kanban / Zeitstrahl)
   ============================================ */
.pm-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pm-view-switcher {
    display: inline-flex;
    gap: 3px;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pm-view-switcher a {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-decoration: none;
    white-space: nowrap;
}
.pm-view-switcher a.active {
    background: #fff;
    color: var(--pm-primary, #3c0103);
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.pm-view-switcher a:hover:not(.active) {
    color: var(--pm-primary, #3c0103);
}

/* ============================================
   ZEITSTRAHL / GANTT-ANSICHT
   ============================================ */
.pm-timeline-page { max-width: 100%; width: 100%; min-width: 0; box-sizing: border-box; }
.pm-timeline-board { width: 100%; min-width: 0; }
.pm-timeline-scroll {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.pm-timeline-grid {
    min-width: 900px;
    position: relative;
}
.pm-timeline-head {
    display: flex;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
    border-bottom: 2px solid #e9ecef;
}
.pm-timeline-label-col {
    flex: 0 0 220px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    color: #495057;
    border-right: 1px solid #e9ecef;
    box-sizing: border-box;
}
.pm-timeline-months {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(var(--pm-tl-months), 1fr);
}
.pm-timeline-month {
    padding: 10px 6px;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    color: #6c757d;
    border-right: 1px solid #f1f3f5;
}
.pm-timeline-phase-header {
    background: #f8f9fa;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 13px;
    color: var(--pm-primary, #3c0103);
    border-bottom: 1px solid #e9ecef;
    border-top: 1px solid #e9ecef;
}
.pm-timeline-row {
    display: flex;
    border-bottom: 1px solid #f1f3f5;
    min-height: 48px;
}
.pm-timeline-row:hover {
    background: #fafbfc;
}
.pm-timeline-row .pm-timeline-label-col {
    display: flex;
    align-items: center;
    font-weight: 400;
}
.pm-timeline-row .pm-timeline-label-col a {
    color: #212529;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}
.pm-timeline-row .pm-timeline-label-col a:hover {
    color: var(--pm-primary, #3c0103);
}
.pm-timeline-track {
    flex: 1;
    position: relative;
    padding: 9px 0;
}
.pm-timeline-bar {
    position: absolute;
    top: 9px;
    bottom: 9px;
    border-radius: 6px;
    min-width: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.pm-timeline-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(255,255,255,.35);
}
.pm-timeline-bar-label {
    position: relative;
    margin-left: 8px;
    font-size: 10.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 1px rgba(0,0,0,.2);
}
.pm-timeline-milestone {
    position: absolute;
    top: 50%;
    width: 9px;
    height: 9px;
    background: #fff;
    border: 2px solid #212529;
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
}
.pm-timeline-nodate {
    font-size: 12px;
    color: #adb5bd;
    padding-left: 4px;
    display: inline-block;
    margin-top: 12px;
}
.pm-timeline-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #0073aa;
    z-index: 1;
}
.pm-timeline-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
    color: #6c757d;
    flex-wrap: wrap;
}
.pm-timeline-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: middle;
}
.pm-kanban-embed-actions {
    margin-bottom: 15px;
}

@media (max-width: 782px) {
    .pm-timeline-label-col { flex-basis: 150px; padding: 8px 10px; }
    .pm-view-switcher a { padding: 6px 10px; font-size: 12px; }
}

/* ============================================
   ÄNDERUNGSHISTORIE
   ============================================ */
.pm-history-box {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 20px;
}
.pm-history-box summary {
    cursor: pointer;
    font-weight: 600;
    color: #495057;
}
.pm-history-list {
    list-style: none;
    margin: 12px 0 0 0;
    padding: 0;
    max-height: 320px;
    overflow-y: auto;
}
.pm-history-list li {
    padding: 8px 0;
    border-top: 1px solid #f1f3f5;
    font-size: 13px;
    line-height: 1.5;
}
.pm-history-list li:first-child { border-top: none; }
.pm-history-field {
    display: inline-block;
    font-weight: 700;
    color: var(--pm-primary, #3c0103);
    margin-right: 6px;
}
.pm-history-change {
    display: block;
    color: #343a40;
    word-break: break-word;
}
.pm-history-meta {
    display: block;
    color: #adb5bd;
    font-size: 11.5px;
    margin-top: 2px;
}

/* ============================================
   DATEI-ANHÄNGE
   ============================================ */
.pm-attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pm-attachment-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}
.pm-att-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.pm-att-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #e9ecef;
    border-radius: 4px;
    flex-shrink: 0;
}
.pm-att-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.pm-att-info a {
    color: #212529;
    font-weight: 500;
    font-size: 13.5px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-att-info a:hover {
    color: var(--pm-primary, #3c0103);
    text-decoration: underline;
}
.pm-att-size {
    font-size: 11.5px;
    color: #adb5bd;
}
.pm-att-delete {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: #adb5bd;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
}
.pm-att-delete:hover {
    background: #fbe6e7;
    color: #c62839;
}
.pm-att-status {
    margin-left: 10px;
    font-size: 12.5px;
    color: #6c757d;
}

/* ============================================
   EXPORT-BUTTONS
   ============================================ */
.pm-export-buttons {
    display: flex;
    gap: 8px;
}

/* ============================================
   AUFGABEN (TASKS)
   ============================================ */
.pm-tasks-section {
    margin-top: 20px;
}
.pm-tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.pm-tasks-header h3 {
    margin: 0;
}
.pm-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pm-task-sublist {
    margin-top: 4px;
}
.pm-task-item {
    margin-bottom: 4px;
}
.pm-task-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    padding-left: calc(12px + (var(--pm-task-depth, 0) * 26px));
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
}
.pm-task-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pm-task-title {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-task-assignee-tag {
    font-size: 11.5px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.pm-task-due-tag {
    font-size: 11.5px;
    color: #6c757d;
    white-space: nowrap;
}
.pm-task-due-tag.is-overdue {
    color: #dc3545;
    font-weight: 700;
}
.pm-task-row .pm-progress.mini {
    width: 60px;
    flex-shrink: 0;
}
.pm-task-edit-link, .pm-task-delete-link {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #adb5bd;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
}
.pm-task-edit-link:hover {
    background: #e7f3ff;
    color: #0073aa;
}
.pm-task-delete-link:hover {
    background: #fbe6e7;
    color: #c62839;
}
.pm-task-project-context {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 4px;
}
.pm-task-project-context a {
    color: var(--pm-primary, #3c0103);
    font-weight: 600;
    text-decoration: none;
}
.pm-budget-hint-line {
    font-size: 12px;
    color: #6c757d;
    margin: 8px 0 0 0;
}

/* Task-Karten auf dem Kanban-Board */
.pm-task-card h4 {
    margin: 6px 0 4px 0;
}
.pm-task-project-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--pm-primary, #3c0103);
    margin-top: 4px;
}
.pm-task-assignee {
    font-size: 11px;
    color: #6c757d;
}
.pm-task-due {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}
.pm-task-due.is-overdue {
    color: #dc3545;
    font-weight: 700;
}

/* "Meine Aufgaben" (Dashboard + Shortcode) */
.pm-mytasks-list, .pm-my-tasks-shortcode {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pm-mytask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
}
.pm-mytask-item:hover {
    border-color: var(--pm-primary, #3c0103);
}
.pm-mytask-title {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pm-mytask-project {
    font-size: 11px;
    color: #6c757d;
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.pm-mytask-item .pm-progress.mini {
    width: 50px;
    flex-shrink: 0;
}

/* ============================================
   ICON-AUSRICHTUNG
   ============================================ */
.pm-btn svg,
.pm-btn-small svg {
    vertical-align: -3px;
    margin-right: 4px;
}
.pm-kanban-edit svg,
.pm-task-edit-link svg,
.pm-task-delete-link svg,
.pm-att-delete svg,
.pm-del-row svg {
    vertical-align: -2px;
    margin-right: 0;
}

/* ============================================
   FORMULAR-ACCORDION
   ============================================ */
.pm-accordion {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin: 16px 0;
    overflow: hidden;
}
.pm-accordion > summary {
    cursor: pointer;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 15px;
    color: #212529;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pm-accordion > summary::-webkit-details-marker {
    display: none;
}
.pm-accordion > summary::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid #adb5bd;
    border-bottom: 2px solid #adb5bd;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}
.pm-accordion[open] > summary::before {
    transform: rotate(45deg);
}
.pm-accordion > summary .pm-accordion-hint {
    font-size: 12px;
    font-weight: 400;
    color: #6c757d;
}
.pm-accordion > summary .pm-accordion-count {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    background: var(--pm-primary, #3c0103);
    border-radius: 10px;
    padding: 1px 8px;
}
.pm-accordion-body {
    padding: 6px 18px 20px 18px;
    border-top: 1px solid #f1f3f5;
}
.pm-accordion-core {
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0 0 4px 0;
}
.pm-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 4px 0 20px 0;
    font-size: 13px;
    color: #495057;
}

/* ============================================
   LEERZUSTAND
   ============================================ */
.pm-empty-state {
    text-align: center;
    padding: 50px 24px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 12px;
    max-width: 460px;
    margin: 20px auto;
}
.pm-empty-state-icon {
    color: #adb5bd;
    margin-bottom: 14px;
}
.pm-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 17px;
    color: #343a40;
}
.pm-empty-state p {
    margin: 0 0 18px 0;
    color: #6c757d;
    font-size: 13.5px;
    line-height: 1.6;
}

/* ============================================
   SCHNELLSTART
   ============================================ */
.pm-quickstart-list {
    margin: 0 0 12px 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #495057;
}
.pm-quickstart-list a {
    color: var(--pm-primary, #3c0103);
    font-weight: 600;
}

/* ============================================
   KONTO-KARTE (Sidebar)
   ============================================
   Dunkle, abgerundete Profilkarte für [pm_account_card]: Avatar, Name,
   E-Mail, Beitragszähler und eine vertikale Schnellnavigation inkl.
   Abmelden-Link. Hintergrundfarbe über die Einstellung
   riict_pm_account_card_bg konfigurierbar (Standard: dunkles Grün). */
.pm-account-card {
    background: var(--pm-account-card-bg, #1b3d2c);
    border-radius: 16px;
    padding: 28px 22px 14px;
    color: #fff;
    box-sizing: border-box;
    width: 100%;
}
.pm-account-card-top {
    text-align: center;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.pm-account-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pm-account-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.pm-account-name {
    font-size: 1.15em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}
.pm-account-email {
    font-size: 0.85em;
    color: var(--pm-account-card-text, #9fb5a8);
    opacity: 0.75;
    word-break: break-word;
}
.pm-account-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.pm-account-stat-num {
    font-size: 1.6em;
    font-weight: 800;
    color: var(--pm-account-card-accent, #4ade80);
    line-height: 1;
}
.pm-account-stat-label {
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--pm-account-card-text, #9fb5a8);
    opacity: 0.75;
    text-transform: uppercase;
}
.pm-account-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}
.pm-account-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 6px;
    color: var(--pm-account-card-text, #e3ece7);
    text-decoration: none;
    font-size: 0.92em;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.pm-account-nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}
.pm-account-nav-icon {
    flex-shrink: 0;
    opacity: 0.85;
}
.pm-account-logout-wrap {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-top: 4px;
}
.pm-account-logout {
    color: #ff9166;
}
.pm-account-logout:hover {
    background: rgba(255,102,51,0.12);
    color: #ffab85;
}
