/* ============================================
   RIICT PM - Projektmanagement 2026
   ============================================ */

.pm-form-page, .pm-single, .pm-project-list, .pm-dashboard {
    max-width: 1000px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.6; color: #333;
}

/* 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: 1100px; margin: 0 auto; }
.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: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.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;
}

.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-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;
}

.pm-section-title {
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
    font-size: 1.3em;
    color: #1a1a2e;
}
}