.ha-vm-collab-wrap { max-width: 1600px; }

/* Kompakter zentraler Bereich für alle Neuanlagen. */
.ha-vm-create-panel { margin: 0 0 20px; padding: 14px 20px 16px; }
.ha-vm-create-panel h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.3; }
.ha-vm-create-list { display: grid; gap: 8px; }
.ha-vm-create-form {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr) 100px;
    gap: 10px;
    align-items: center;
    width: 100%;
}
.ha-vm-create-form label {
    font-weight: 600;
    color: #1d2327;
}
.ha-vm-create-form .regular-text {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 36px;
    margin: 0;
}
.ha-vm-create-form .ha-vm-action-button {
    width: 100px;
    min-height: 36px;
    margin: 0;
    justify-self: stretch;
    text-align: center;
}
.ha-vm-create-form .submit { margin: 0; padding: 0; }
.ha-vm-documents-panel h2 { margin-top: 0; }
.ha-vm-documents-panel { width: 100%; }

/* Einheitliche Aktionsbuttons in Tabellen */
.ha-vm-action-button {
    box-sizing: border-box;
    width: 100px;
    min-height: 32px;
    padding: 2px 12px;
    text-align: left;
    white-space: normal;
    line-height: 1.15;
}
.ha-vm-copy-cell { text-align: left; }
.ha-vm-copy-cell .ha-vm-action-button { margin-left: 0; }

.ha-vm-collab-editor-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.ha-vm-collab-panel { background: #fff; border: 1px solid #c3c4c7; padding: 20px; box-sizing: border-box; }
.ha-vm-collab-main { min-width: 0; }
.ha-vm-collab-sidebar { display: grid; gap: 20px; }
.ha-vm-title-input { display: block; width: 100%; margin: 0 0 16px; padding: 10px 12px; border: 1px solid #8c8f94; font-size: 1.5rem; line-height: 1.3; }
.ha-vm-collab-savebar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
#ha-vm-save-status[data-state="conflict"], #ha-vm-save-status[data-state="error"] { font-weight: 700; }
#ha-vm-presence { margin-left: auto; }
.ha-vm-collaborators { margin: 0 0 18px; }
.ha-vm-collaborators li { padding: 8px 0; border-bottom: 1px solid #dcdcde; }
.ha-vm-collaborators span, .ha-vm-revisions span { display: block; color: #646970; font-size: 12px; }
.ha-vm-remove { float: right; text-decoration: none; font-size: 20px; line-height: 1; }
.ha-vm-revisions { margin-left: 20px; }
.ha-vm-revisions li { margin-bottom: 10px; }
.ha-vm-danger { border-left: 4px solid #b32d2e; }
@media (max-width: 960px) {
    .ha-vm-collab-editor-layout { grid-template-columns: 1fr; }
    #ha-vm-presence { margin-left: 0; width: 100%; }
}

/* Einheitliche, platzsparende Spaltenbreiten */
.ha-vm-document-table { table-layout: auto; }
.ha-vm-document-table th:nth-child(1),
.ha-vm-document-table td:nth-child(1) { width: 64px; }
.ha-vm-document-table th:nth-child(2),
.ha-vm-document-table td:nth-child(2) { width: 82px; }
.ha-vm-document-table th:nth-child(4),
.ha-vm-document-table td:nth-child(4) { width: 112px; max-width: 112px; }
.ha-vm-document-table th:nth-child(5),
.ha-vm-document-table td:nth-child(5) { width: 138px; }
.ha-vm-document-table th:nth-child(6),
.ha-vm-document-table td:nth-child(6) { width: 92px; }
.ha-vm-document-table th:nth-child(7),
.ha-vm-document-table td:nth-child(7) { width: 70px; }
.ha-vm-document-table th:nth-child(8),
.ha-vm-document-table td:nth-child(8) { width: 92px; }
.ha-vm-document-link { display: flex; gap: 6px; align-items: center; min-width: 280px; }
.ha-vm-document-link-input { width: 100%; min-width: 160px; }
.ha-vm-copy-document-link { white-space: nowrap; }
.ha-vm-copy-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 1100px) {
    .ha-vm-document-link { min-width: 220px; flex-wrap: wrap; }
    .ha-vm-document-link-input { flex: 1 1 100%; }
}

@media (max-width: 782px) {
    .ha-vm-create-form { grid-template-columns: 1fr; gap: 5px; }
    .ha-vm-create-form + .ha-vm-create-form { margin-top: 8px; padding-top: 10px; border-top: 1px solid #dcdcde; }
    .ha-vm-create-form .ha-vm-action-button { width: 100%; }
}

 .ha-vm-presence-panel { position: sticky; top: 42px; }
.ha-vm-presence-heading { margin-bottom: 10px; }
.ha-vm-presence-heading h2 { margin: 0; }
.ha-vm-presence-table { width: 100%; }
.ha-vm-presence-table-head,
.ha-vm-presence-user {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 78px 88px;
    column-gap: 8px;
    align-items: center;
}
.ha-vm-presence-table-head {
    margin-bottom: 4px;
    color: #646970;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}
.ha-vm-presence-user { min-height: 32px; padding: 3px 0; }
.ha-vm-presence-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ha-vm-status-radio {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto;
    border: 2px solid #a7aaad;
    border-radius: 50%;
    background: #fff;
    box-sizing: border-box;
}
.ha-vm-presence-user.is-online .ha-vm-editing-radio,
.ha-vm-presence-user.is-approved .ha-vm-approved-radio {
    border-color: #2271b1;
    box-shadow: inset 0 0 0 3px #fff;
    background: #2271b1;
}
@media (max-width: 960px) {
    .ha-vm-presence-panel { position: static; }
}


.ha-vm-approve-button { border-color: #008a20 !important; color: #006b18 !important; }
.ha-vm-approve-button:hover, .ha-vm-approve-button:focus { border-color: #006b18 !important; color: #004d11 !important; }
.ha-vm-approve-button.is-approved { background: #00a32a !important; border-color: #008a20 !important; color: #fff !important; }
.ha-vm-approve-button:disabled { opacity: .55; cursor: not-allowed; }
#ha-vm-approval-status { color: #50575e; }
.ha-vm-approval-cell { white-space: nowrap; }
.ha-vm-approval-badge { display: inline-block; min-width: 42px; padding: 3px 8px; border-radius: 12px; background: #f0f0f1; color: #50575e; text-align: center; font-weight: 600; }
.ha-vm-approval-badge.is-approved { background: #edfaef; color: #006b18; }

/* Dokumentübersicht 2.21.8 */
.ha-vm-document-table th,
.ha-vm-document-table td { text-align: left; vertical-align: top; }
.ha-vm-document-table .ha-vm-date-cell,
.ha-vm-document-table .ha-vm-approval-cell,
.ha-vm-document-table .ha-vm-copy-cell { white-space: nowrap; }
.ha-vm-document-table .ha-vm-title-cell { min-width: 220px; }
.ha-vm-document-table .ha-vm-link-cell { white-space: nowrap; }
.ha-vm-document-table .ha-vm-link-cell a { font-family: monospace; }
.ha-vm-document-table .ha-vm-copy-cell { width: 1%; }


.ha-vm-circular-panel {
    margin-top: 16px;
}

.ha-vm-number-cell {
    white-space: nowrap;
    width: 72px;
}

.ha-vm-circular-label {
    margin: 0 0 12px;
    font-size: 14px;
}

/* Kompakte Tabellenkoepfe 2.22.2 */
.ha-vm-document-table .ha-vm-th-wrap { display: inline-block; line-height: 1.2; }
.ha-vm-document-table .ha-vm-copy-cell { min-width: 86px; text-align: left; }
.ha-vm-document-table .ha-vm-copy-document-link { white-space: normal; line-height: 1.15; min-height: 40px; padding-top: 4px; padding-bottom: 4px; }
.ha-vm-document-table .ha-vm-copy-document-link span { display: inline-block; }


/* Dokumentablage 2.22.9 */
.ha-vm-attachment-dropzone {
    display: flex;
    min-height: 112px;
    padding: 18px;
    border: 2px dashed #8c8f94;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    text-align: center;
    cursor: pointer;
    background: #f6f7f7;
}
.ha-vm-attachment-dropzone:hover,
.ha-vm-attachment-dropzone:focus,
.ha-vm-attachment-dropzone.is-dragover { border-color: #2271b1; background: #f0f6fc; outline: none; }
.ha-vm-attachment-dropzone.is-uploading { opacity: .65; cursor: progress; }
.ha-vm-attachment-dropzone span { color: #646970; font-size: 12px; }
.ha-vm-attachment-status { min-height: 20px; margin: 10px 0 0; color: #50575e; }
.ha-vm-attachment-list { margin: 12px 0 0; padding: 0; list-style: none; }
.ha-vm-attachment-item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin: 0; padding: 10px 0; border-top: 1px solid #dcdcde; }
.ha-vm-attachment-info { min-width: 0; }
.ha-vm-attachment-info a { overflow-wrap: anywhere; }
.ha-vm-attachment-info span { display: block; margin-top: 3px; color: #646970; font-size: 12px; }
.ha-vm-attachment-empty { color: #646970; }

/* Einheitliche Tabellenstruktur ab 2.23.3 */
.ha-vm-proposal-status {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
}


/* Kommentare 2.23.7 */
.ha-vm-comments-panel { margin-top: 18px; }
.ha-vm-comment-list { margin-bottom: 18px; }
.ha-vm-comment-item { padding: 14px 0; border-top: 1px solid #dcdcde; }
.ha-vm-comment-item:first-child { border-top: 0; padding-top: 0; }
.ha-vm-comment-item header { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.ha-vm-comment-item header span { color: #646970; font-size: 12px; white-space: nowrap; }
.ha-vm-comment-text p { margin: 8px 0 0; }
.ha-vm-comment-form { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid #dcdcde; }
.ha-vm-comment-form p { margin: 4px 0 0; }
#ha-vm-comment-status { margin-left: 8px; color: #50575e; }
.ha-vm-comment-empty { color: #646970; }

/* Frontend-Ausgabe ab 2.24.0 */
.ha-vm-collab-frontend {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}
.ha-vm-collab-frontend .button {
    display: inline-block;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid #2271b1;
    background: #f6f7f7;
    color: #2271b1;
    text-decoration: none;
    cursor: pointer;
}
.ha-vm-collab-frontend .button-primary {
    background: #2271b1;
    color: #fff;
}
.ha-vm-collab-frontend .widefat,
.ha-vm-collab-frontend .ha-vm-title-input {
    box-sizing: border-box;
    width: 100%;
}
.ha-vm-comment-item header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.ha-vm-comment-item header .ha-vm-comment-edit-toggle {
    margin-left: auto;
}
.ha-vm-comment-edit-form[hidden],
.ha-vm-comment-text[hidden] {
    display: none !important;
}
.ha-vm-comment-edit-text {
    margin-top: 10px;
}


/* Frontend-Tabellenausrichtung */
.ha-vm-collab-wrap table th,
.ha-vm-collab-wrap table td {
    text-align: left !important;
    vertical-align: top !important;
}


.ha-vm-owner-approval-controls { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; margin-top: 5px; }
.ha-vm-owner-approval-controls .ha-vm-approval-source { min-width: 110px; max-width: 140px; }
.ha-vm-owner-approval-controls .button { white-space: nowrap; }

/* Umlaufbeschluss-Uebersicht 2.24.4 */
.ha-vm-table-tools { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin: 0 0 14px; flex-wrap: wrap; }
.ha-vm-status-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.ha-vm-table-filter,
.ha-vm-sort-button { padding: 0; border: 0; background: transparent; color: #2271b1; font: inherit; cursor: pointer; text-align: left; }
.ha-vm-table-filter { padding: 5px 8px; border-bottom: 2px solid transparent; }
.ha-vm-table-filter.is-active { border-bottom-color: currentColor; font-weight: 600; }
.ha-vm-table-search { min-width: 220px; height: 34px; }
.ha-vm-sort-button { font-weight: 600; }
.ha-vm-sort-button[data-direction="asc"]::after { content: " ↑"; }
.ha-vm-sort-button[data-direction="desc"]::after { content: " ↓"; }
.ha-vm-clickable-row { cursor: pointer; }
.ha-vm-clickable-row:hover td { background: #f0f6fc; }
.ha-vm-document-status { white-space: nowrap; }
.ha-vm-document-status.is-done { color: #50575e; }
.ha-vm-document-status.is-progress { font-weight: 600; }
.ha-vm-progress-cell { min-width: 180px; }
.ha-vm-progress-label { display: block; margin-bottom: 5px; white-space: nowrap; }
.ha-vm-progress-track { display: block; width: 100%; max-width: 190px; height: 9px; overflow: hidden; background: #dcdcde; }
.ha-vm-progress-value { display: block; height: 100%; background: #2271b1; }
.ha-vm-circular-table th,
.ha-vm-circular-table td { text-align: left; vertical-align: top; }
@media (max-width: 782px) {
    .ha-vm-table-tools { align-items: stretch; }
    .ha-vm-table-search-label, .ha-vm-table-search { width: 100%; min-width: 0; }
}


/* Externe UB-Freigaben 2.24.5 */
.ha-vm-owner-approval-savebar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.ha-vm-owner-approval-savebar #ha-vm-owner-approval-save-status {
    font-size: 0.92em;
}
.ha-vm-approval-source.is-pending {
    border-color: #2271b1;
}


/* Einspaltiger Frontend-Editor ab 2.24.6 */
.ha-vm-collab-editor-layout {
    display: block;
    width: 100%;
}
.ha-vm-collab-main,
.ha-vm-collab-sidebar {
    width: 100%;
    max-width: none;
}
.ha-vm-collab-sidebar {
    display: block;
}
.ha-vm-collab-sidebar > .ha-vm-collab-panel,
.ha-vm-comments-panel {
    width: 100%;
    margin-top: 20px;
}
.ha-vm-presence-panel {
    position: static;
}
.ha-vm-presence-table-head,
.ha-vm-presence-user {
    grid-template-columns: minmax(220px, 1fr) 120px 140px;
    align-items: start;
}
.ha-vm-presence-table-head {
    text-align: left;
}
.ha-vm-status-radio {
    margin-left: 0;
}
.ha-vm-owner-approval-controls {
    grid-column: 1 / -1;
}
.ha-vm-collab-main .wp-editor-wrap,
.ha-vm-collab-main .wp-editor-container,
.ha-vm-collab-main textarea {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}
@media (max-width: 782px) {
    .ha-vm-presence-table-head,
    .ha-vm-presence-user {
        grid-template-columns: minmax(0, 1fr) 82px 96px;
    }
}

/* Editor-Schriftfarbe ab 2.24.9: im visuellen Editor und im Code-Textarea zwingend schwarz. */
body.ha-vm-edit-full-width #ha-vm-document-content,
body.ha-vm-edit-full-width .ha-vm-collab-main .wp-editor-area {
    color: #000000 !important;
}

/* 2.24.16 – Umschalter „Visuell“ und „Code“ in normaler UI-Schriftgröße. */
body.ha-vm-edit-full-width .wp-switch-editor,
body.ha-vm-edit-full-width .wp-editor-tabs button,
body.ha-vm-edit-full-width .wp-editor-tabs .wp-switch-editor {
    font-size: 14px !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: 28px !important;
    padding: 4px 10px !important;
}

.ha-vm-collab-button {
    display: inline-block;
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid #2271b1;
    border-radius: 0;
    font: inherit;
    font-size: 14px;
    line-height: 20px;
    cursor: pointer;
}
.ha-vm-collab-button-primary {
    background: #2271b1;
    color: #fff;
}
.ha-vm-collab-button-secondary {
    background: #fff;
    color: #2271b1;
}




/* 2.24.19 – Nur Dokumente beeinflussen; Header und Navigation bleiben vollständig im Theme-Layout. */
body.ha-vm-edit-full-width #page .s1,
body.ha-vm-edit-full-width #page .s2,
body.ha-vm-edit-full-width #page #sidebar,
body.ha-vm-edit-full-width #page #sidebar-primary,
body.ha-vm-edit-full-width #page #sidebar-secondary,
body.ha-vm-edit-full-width #page aside.sidebar,
body.ha-vm-edit-full-width #page .sidebar-primary,
body.ha-vm-edit-full-width #page .sidebar-secondary {
    display: none !important;
}
body.ha-vm-edit-full-width #page .main,
body.ha-vm-edit-full-width #page .main-inner,
body.ha-vm-edit-full-width #page .content,
body.ha-vm-edit-full-width #page #content,
body.ha-vm-edit-full-width #page .content-inner {
    width: 100% !important;
    max-width: none !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}
body.ha-vm-edit-full-width #page .main-inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
body.ha-vm-edit-full-width #page .main .pad,
body.ha-vm-edit-full-width #page #content > .pad,
body.ha-vm-edit-full-width #page .content > .pad {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}
body.ha-vm-edit-full-width .ha-vm-collab-frontend,
body.ha-vm-edit-full-width .ha-vm-collab-wrap,
body.ha-vm-edit-full-width .ha-vm-collab-editor-layout,
body.ha-vm-edit-full-width .ha-vm-collab-main,
body.ha-vm-edit-full-width .ha-vm-collab-sidebar,
body.ha-vm-edit-full-width .ha-vm-collab-panel,
body.ha-vm-edit-full-width .wp-editor-wrap,
body.ha-vm-edit-full-width .wp-editor-container,
body.ha-vm-edit-full-width .mce-tinymce,
body.ha-vm-edit-full-width .tox-tinymce {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}
body.ha-vm-edit-full-width .ha-vm-collab-savebar-top .button,
body.ha-vm-edit-full-width #ha-vm-save-document,
body.ha-vm-edit-full-width #ha-vm-approve-document,
body.ha-vm-edit-full-width .wp-switch-editor,
body.ha-vm-edit-full-width .wp-editor-tabs button,
body.ha-vm-edit-full-width .wp-editor-tabs .wp-switch-editor {
    font-size: 14px !important;
}
