:root, body.vce-theme-dark {
    /* Переменные для темной темы (по умолчанию) */
    --vce-bg: #1e1e1e;
    --vce-surface: #2d2d2d;
    --vce-border: #3e3e3e;
    --vce-text: #e0e0e0;
    --vce-text-muted: #888888;
    --vce-primary: #0073aa;
    --vce-primary-hover: #0091d5;
}

/* Переопределение для светлой темы */
body.vce-theme-light, .vce-theme-light {
    --vce-bg: #f9f9f9;
    --vce-surface: #ffffff;
    --vce-border: #cccccc;
    --vce-text: #2c3e50;
    --vce-text-muted: #7f8c8d;
    --vce-primary: #3498db;
    --vce-primary-hover: #2980b9;
}

/* Применение темы ко всей странице */
body.vce-theme-dark,
body.vce-theme-light {
    background-color: var(--vce-bg);
    color: var(--vce-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}


.vce-team-container {
    background-color: var(--vce-bg);
    color: var(--vce-text);
    padding: 20px;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.vce-team-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--vce-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.vce-project-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vce-btn,
.vce-btn-small,
.vce-theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid var(--vce-border);
    background-color: var(--vce-surface);
    color: var(--vce-text);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.vce-btn:hover,
.vce-btn-small:hover,
.vce-theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--vce-primary);
    color: var(--vce-text);
}

body.vce-theme-light .vce-btn:hover,
body.vce-theme-light .vce-btn-small:hover,
body.vce-theme-light .vce-theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.vce-btn-small {
    padding: 6px 12px;
    font-size: 13.5px;
}

/* Primary Button Modifier */
.vce-btn-primary,
.vce-custom-modal-submit,
.vce-custom-modal-confirm,
.vce-custom-modal-close-btn-bottom {
    background-color: var(--vce-primary) !important;
    border-color: var(--vce-primary) !important;
    color: #ffffff !important;
}

.vce-btn-primary:hover,
.vce-custom-modal-submit:hover,
.vce-custom-modal-confirm:hover,
.vce-custom-modal-close-btn-bottom:hover {
    background-color: var(--vce-primary-hover) !important;
    border-color: var(--vce-primary-hover) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Secondary Button Modifier */
.vce-btn-secondary,
.vce-custom-modal-cancel {
    background-color: transparent !important;
    border-color: var(--vce-border) !important;
    color: var(--vce-text) !important;
}

.vce-btn-secondary:hover,
.vce-custom-modal-cancel:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--vce-text-muted) !important;
}

body.vce-theme-light .vce-btn-secondary:hover,
body.vce-theme-light .vce-custom-modal-cancel:hover {
    background-color: rgba(0, 0, 0, 0.03) !important;
}

/* Danger Button Modifier */
.vce-btn-danger {
    background-color: #e74c3c !important;
    border-color: #e74c3c !important;
    color: #ffffff !important;
}

.vce-btn-danger:hover {
    background-color: #c0392b !important;
    border-color: #c0392b !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Icon Buttons (e.g. edit/delete) */
.vce-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 6px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--vce-text-muted);
}

.vce-icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--vce-text);
    transform: scale(1.1);
}

body.vce-theme-light .vce-icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.vce-theme-dark .vce-theme-toggle-btn .vce-theme-icon::before,
.vce-theme-dark #vce-theme-toggle .vce-theme-icon::before {
    content: "☀️";
}

.vce-theme-light .vce-theme-toggle-btn .vce-theme-icon::before,
.vce-theme-light #vce-theme-toggle .vce-theme-icon::before {
    content: "🌙";
}

/* Global transitions for elements inside container */
.vce-team-container,
.vce-select,
.vce-input,
.vce-task-group-card,
.vce-task-group-header,
.vce-theme-toggle-btn,
.vce-task-item,
.vce-btn,
.vce-btn-small {
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.vce-select, .vce-input {
    background-color: var(--vce-surface);
    color: var(--vce-text);
    border: 1px solid var(--vce-border);
    padding: 10px 14px;
    border-radius: 6px;
    outline: none;
    font-size: 15.5px;
    box-sizing: border-box;
    min-height: 40px;
}

.vce-select:focus, .vce-input:focus {
    border-color: var(--vce-primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.vce-task-group-card {
    background-color: var(--vce-surface);
    border: 1px solid var(--vce-border);
    border-radius: 6px;
    margin-bottom: 15px;
}

.vce-task-group-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    box-sizing: border-box;
}

/* Флажки приоритетов */
.vce-task-priority-flag {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}
.vce-priority-none { background-color: #7f8c8d; }
.vce-priority-low { background-color: #2ecc71; }
.vce-priority-medium { background-color: #f1c40f; }
.vce-priority-high { background-color: #e74c3c; }

/* Кастомизация аккордеона / списков */
.vce-task-group-body {
    padding: 15px;
}

/* Custom Modals Styling */
.vce-custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    animation: vceFadeInModal 0.2s ease-out;
}

.vce-custom-modal {
    background-color: var(--vce-bg);
    color: var(--vce-text);
    border: 1px solid var(--vce-border);
    border-radius: 8px;
    width: 450px;
    max-width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: vceSlideDownModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.vce-custom-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--vce-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
}

.vce-custom-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.vce-custom-modal-close-btn {
    background: none;
    border: none;
    color: var(--vce-text-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.vce-custom-modal-close-btn:hover {
    color: var(--vce-text);
}

.vce-custom-modal-body {
    padding: 20px;
    font-size: 15.5px;
    line-height: 1.5;
}

.vce-custom-modal-body p {
    margin: 0;
}

.vce-custom-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--vce-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.02);
}

/* Custom modal button styles */
.vce-custom-modal .vce-btn {
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14.5px;
    cursor: pointer;
    font-weight: 500;
    border: 1px solid transparent;
}

.vce-custom-modal .vce-btn-secondary {
    background-color: transparent;
    color: var(--vce-text);
    border-color: var(--vce-border);
}

.vce-custom-modal .vce-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.vce-custom-modal .vce-custom-modal-submit,
.vce-custom-modal .vce-custom-modal-confirm,
.vce-custom-modal .vce-custom-modal-close-btn-bottom {
    background-color: var(--vce-primary);
    color: #ffffff;
    border-color: var(--vce-primary);
}

.vce-custom-modal .vce-custom-modal-submit:hover,
.vce-custom-modal .vce-custom-modal-confirm:hover,
.vce-custom-modal .vce-custom-modal-close-btn-bottom:hover {
    background-color: var(--vce-primary-hover);
    border-color: var(--vce-primary-hover);
}

@keyframes vceFadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vceSlideDownModal {
    from { opacity: 0; transform: translate(-50%, -55%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* --- Task Modal Layout (2-column layout) --- */
.vce-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99999;
}

.vce-modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    max-width: 95%;
    max-height: 90vh;
    background-color: var(--vce-bg);
    color: var(--vce-text);
    border: 1px solid var(--vce-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: vceSlideDownModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.vce-modal-container h2,
.vce-modal-container h3 {
    color: var(--vce-text);
}

.vce-modal-header-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.vce-modal-body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.vce-task-layout {
    display: flex;
    gap: 24px;
    text-align: left;
}

.vce-task-main {
    flex: 1.8;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.vce-task-sidebar {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.02);
    border-left: 1px solid var(--vce-border);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.vce-theme-light .vce-task-sidebar {
    background-color: rgba(0, 0, 0, 0.01);
}

.vce-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vce-label {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--vce-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* UI/UX improvements for general board workspace */
.vce-team-container {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid var(--vce-border);
}

.vce-board-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.vce-board-actions {
    margin-bottom: 20px;
    text-align: left;
}

.vce-task-groups-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.vce-task-group-card {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.vce-task-group-header {
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.vce-task-group-title {
    font-size: 18px;
    font-weight: 600;
}

.vce-task-item {
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 12px;
    box-shadow: none;
    text-align: left;
}

.vce-task-item:hover {
    background-color: transparent;
    border-color: transparent;
    box-shadow: none;
}

.vce-task-main-layout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    position: relative;
}

/* collapse/expand toggle button placed to the left of the card */
.vce-subtask-toggle-btn {
    background: transparent;
    border: 1px solid var(--vce-border);
    color: var(--vce-text-muted);
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 12.5px;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.vce-subtask-toggle-btn:hover {
    border-color: var(--vce-primary);
    color: var(--vce-primary);
    background-color: rgba(0, 115, 170, 0.05);
}

/* Single-line task row layout */
.vce-task-row-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    background-color: var(--vce-bg);
    border: 1px solid var(--vce-border);
    border-radius: 6px;
    padding: 12px 15px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.vce-task-row-container:hover {
    border-color: var(--vce-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: var(--vce-surface);
}

.vce-status-circle {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.vce-status-badge-inline {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 3px 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    flex-shrink: 0;
}

.vce-status-picker-trigger {
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    color: var(--vce-text);
    cursor: pointer;
    font-family: inherit;
}
.vce-status-picker-wrap,
.vce-priority-picker-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.vce-status-picker-trigger:hover {
    background-color: rgba(0, 115, 170, 0.10);
    color: var(--vce-primary);
}
.vce-status-picker-arrow {
    margin-left: 3px;
    font-size: 10px;
}
.vce-status-dropdown,
.vce-priority-dropdown {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    min-width: 175px;
    padding: 6px;
    border: 1px solid var(--vce-border);
    border-radius: 8px;
    background: var(--vce-bg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.vce-status-dropdown.is-loading,
.vce-priority-dropdown.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.vce-status-dropdown-option,
.vce-priority-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--vce-text);
    text-align: left;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.vce-status-dropdown-option:hover,
.vce-priority-dropdown-option:hover {
    background: rgba(0, 115, 170, 0.10);
}
.vce-status-dropdown-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

body.vce-theme-light .vce-status-badge-inline {
    background-color: rgba(0, 0, 0, 0.03);
}

.vce-priority-badge-inline {
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.vce-priority-inline-low { background-color: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.vce-priority-inline-medium { background-color: rgba(241, 196, 15, 0.15); color: #f1c40f; }
.vce-priority-inline-high { background-color: rgba(231, 76, 60, 0.15); color: #e74c3c; }

.vce-task-title-inline {
    font-weight: 600;
    font-size: 16.5px;
    flex-grow: 1;
    min-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--vce-text);
}

.vce-task-assignee-inline {
    font-size: 14.5px;
    color: var(--vce-text-muted);
    min-width: 120px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.vce-task-files-inline,
.vce-task-comments-inline {
    font-size: 13.5px;
    color: var(--vce-text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 35px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.vce-placeholder-text {
    font-size: 17px;
    color: var(--vce-text-muted);
    padding: 40px 0;
}

/* Redesigned form elements and drag-and-drop upload zone */
.vce-dropzone {
    border: 2px dashed var(--vce-border);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 5px;
}
.vce-dropzone:hover {
    border-color: var(--vce-primary);
    background: rgba(255, 255, 255, 0.05);
}
body.vce-theme-light .vce-dropzone {
    background: rgba(0, 0, 0, 0.02);
}
body.vce-theme-light .vce-dropzone:hover {
    background: rgba(0, 0, 0, 0.04);
}

.vce-dropzone-icon {
    font-size: 32px;
    margin-bottom: 8px;
}
.vce-dropzone-text {
    font-size: 15.5px;
    font-weight: 500;
    color: var(--vce-text);
}

.vce-card-section {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--vce-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
body.vce-theme-light .vce-card-section {
    background: rgba(0, 0, 0, 0.01);
}

.vce-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.vce-file-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vce-queue-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--vce-border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14.5px;
}
body.vce-theme-light .vce-queue-file-item {
    background: rgba(0, 0, 0, 0.03);
}

.vce-task-placeholder {
    border: 2px dashed var(--vce-primary) !important;
    background-color: rgba(52, 152, 219, 0.08) !important;
    min-height: 44px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

/* Subtasks toggle visual feedback */
.vce-subtask-toggle {
    transition: transform 0.2s ease;
}
/* Subtasks toggle visual feedback */
.vce-subtask-toggle {
    transition: transform 0.2s ease;
}

/* --- Subtasks spacing & empty container layout fix --- */
.vce-subtasks-list {
    margin-left: 34px;
    padding-left: 10px;
    border-left: 2px solid var(--vce-border);
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.vce-subtasks-list:empty {
    min-height: 0;
    padding: 0;
    margin: 0;
    border: none;
}
/* Disable pointer-events on helper while dragging so document.elementFromPoint works */
.ui-sortable-helper {
    pointer-events: none !important;
}

/* Subtask list styling when accept-subtask is active */
.vce-subtasks-list.vce-accept-subtask {
    min-height: 48px;
    border: 2px dashed #f39c12 !important;
    background-color: rgba(243, 156, 18, 0.08) !important;
    margin-top: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
    display: block;
    position: relative;
}

.vce-subtasks-list.vce-accept-subtask::before {
    content: "↳ Release to attach as subtask";
    font-size: 12.5px;
    color: #f39c12;
    font-weight: 600;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

/* Highlight receiving parent item */
.vce-task-item.vce-subtask-hover-target > .vce-task-row-container {
    border-color: #f39c12 !important;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.2) !important;
}

.vce-child-task-item {
    margin-left: 0 !important;
    border: none !important;
}
.vce-child-task-item:hover {
    border-color: transparent !important;
}

/* --- Redesigned Search & Filters Panel --- */
.vce-search-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--vce-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
body.vce-theme-light .vce-search-panel {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.02));
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.vce-search-panel-main-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    width: 100%;
}
.vce-search-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.vce-search-input-wrapper {
    position: relative;
    width: 100%;
}
.vce-search-input-wrapper input {
    width: 100%;
    font-size: 16px;
    padding: 10px 16px;
}

.vce-search-option-group {
    display: flex;
    align-items: center;
    min-height: 42px;
}

.vce-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--vce-text);
    cursor: pointer;
    user-select: none;
}
.vce-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.vce-search-panel-filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: flex-end;
}
@media (min-width: 900px) {
    .vce-search-panel-filters-row {
        grid-template-columns: 1fr 1fr 1fr 1fr auto;
    }
}
@media (max-width: 768px) {
    .vce-search-panel-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .vce-search-option-group {
        min-height: auto;
    }
}

.vce-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.vce-filter-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--vce-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vce-clear-group {
    display: flex;
    align-items: flex-end;
}
.vce-clear-group button {
    width: 100%;
}

/* --- Prominent Add Task Button --- */
.vce-add-task-btn-wrapper {
    margin-top: 15px;
    padding: 0 10px;
    display: flex;
    justify-content: center;
}
.vce-add-task-btn {
    width: 100%;
    max-width: 280px;
    margin: 10px auto;
    border: 1px dashed var(--vce-primary) !important;
    background-color: rgba(0, 115, 170, 0.06) !important;
    color: var(--vce-primary) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.vce-add-task-btn:hover {
    background-color: var(--vce-primary) !important;
    border-color: var(--vce-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 15px rgba(0, 115, 170, 0.25);
    transform: translateY(-2px);
}
body.vce-theme-light .vce-add-task-btn {
    background-color: rgba(52, 152, 219, 0.06) !important;
}

/* --- Checklist assignees wrapper inside sidebar --- */
.vce-assignees-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--vce-border);
    padding: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
}
body.vce-theme-light .vce-assignees-checklist {
    background: rgba(0, 0, 0, 0.03);
}

.vce-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid var(--vce-border);
    transition: all 0.2s ease;
}
.vce-checklist-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--vce-primary);
}
body.vce-theme-light .vce-checklist-item {
    background: rgba(0, 0, 0, 0.01);
}
body.vce-theme-light .vce-checklist-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.vce-checklist-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}
.vce-checklist-item label {
    font-size: 14.5px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

/* --- Modal layout improvements --- */
.vce-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--vce-border);
    padding: 15px 24px;
    background-color: rgba(255, 255, 255, 0.02);
}
.vce-modal-close-btn {
    background: none;
    border: none;
    color: var(--vce-text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}
.vce-modal-close-btn:hover {
    color: var(--vce-text);
}

.vce-modal-footer-actions {
    padding: 15px 24px;
    border-top: 1px solid var(--vce-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
}

/* Remove default focus outline and make it clean */
#vce-lang-selector:focus {
    outline: none;
    box-shadow: none;
    border-color: var(--vce-primary);
}

/* Inline expanded details styles */
.vce-task-inline-details {
    margin-left: 34px;
    margin-top: 15px;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.12);
    border: 1px solid var(--vce-border);
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
    display: none;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15);
}
body.vce-theme-light .vce-task-inline-details {
    background-color: rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vce-inline-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--vce-border);
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}
body.vce-theme-light .vce-inline-card {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.vce-inline-metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.vce-meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vce-meta-label {
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--vce-text-muted);
    letter-spacing: 0.8px;
}

.vce-meta-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--vce-text);
    line-height: 1.4;
}

/* Dropzone hover transitions */
.vce-dropzone {
    border: 2px dashed var(--vce-border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.03);
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}
.vce-dropzone:hover {
    border-color: var(--vce-primary);
    background: rgba(255, 255, 255, 0.05) !important;
}
body.vce-theme-light .vce-dropzone {
    background: rgba(0, 0, 0, 0.01);
}
body.vce-theme-light .vce-dropzone:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

/* Inline task creation panel styling */
.vce-inline-create-task-panel {
    margin-top: 15px;
    margin-bottom: 20px;
    background-color: rgba(0, 0, 0, 0.12);
    border: 1px solid var(--vce-border);
    border-radius: 12px;
    padding: 24px;
    box-sizing: border-box;
    display: none;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15);
}
body.vce-theme-light .vce-inline-create-task-panel {
    background-color: rgba(0, 0, 0, 0.03);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.vce-inline-create-wiki-article-panel {
    margin-left: 15px;
    margin-right: 15px;
}
.vce-inline-wiki-create-header h4 {
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--vce-primary);
}
.vce-inline-wiki-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--vce-border);
}

/* Rich Text Editor Styling */
.vce-rte-container {
    border: 1px solid var(--vce-border);
    border-radius: 6px;
    background-color: var(--vce-surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 10px;
}
body.vce-theme-light .vce-rte-container {
    background-color: #ffffff;
}

.vce-rte-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--vce-border);
    background-color: rgba(0, 0, 0, 0.05);
}
body.vce-theme-light .vce-rte-toolbar {
    background-color: #f7f9fa;
}

.vce-rte-btn {
    background: none;
    border: none;
    color: var(--vce-text);
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.vce-rte-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--vce-primary);
}
body.vce-theme-light .vce-rte-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}
.vce-rte-btn.vce-active {
    background-color: var(--vce-primary);
    color: #ffffff !important;
}

.vce-rte-split-color-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 28px;
    border: 1px solid var(--vce-border);
    border-radius: 4px;
}
.vce-rte-color-apply,
.vce-rte-color-toggle {
    height: 26px;
    padding: 4px 6px;
}
.vce-rte-color-apply {
    position: relative;
    min-width: 28px;
    font-weight: 700;
}
.vce-rte-color-apply::after {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 3px;
    height: 3px;
    border-radius: 2px;
    background: var(--vce-rte-selected-color, var(--vce-primary));
    pointer-events: none;
}
.vce-rte-color-toggle {
    min-width: 19px;
    padding-left: 3px;
    padding-right: 3px;
    border-left: 1px solid var(--vce-border);
    font-size: 11px;
}
.vce-rte-color-palette {
    display: none;
    position: absolute;
    z-index: 10;
    top: calc(100% + 5px);
    left: 0;
    grid-template-columns: repeat(4, 24px);
    gap: 6px;
    min-width: 126px;
    padding: 8px;
    background: var(--vce-bg);
    border: 1px solid var(--vce-border);
    border-radius: 6px;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
}
.vce-rte-color-palette.is-open {
    display: grid;
}
.vce-rte-color-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
}
.vce-rte-color-swatch:hover,
.vce-rte-color-swatch:focus {
    outline: 2px solid var(--vce-primary);
    outline-offset: 1px;
}

.vce-rte-separator {
    width: 1px;
    height: 16px;
    background-color: var(--vce-border);
    margin: 0 4px;
}

.vce-rte-editor {
    min-height: 120px;
    padding: 12px;
    color: var(--vce-text);
    font-size: 15.5px;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
    box-sizing: border-box;
    white-space: normal;
}
.vce-rte-editor[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: var(--vce-text-muted);
    cursor: text;
}

/* Task Drag Handle Styling */
.vce-task-drag-handle {
    cursor: grab;
    margin-left: 12px;
    padding: 2px 6px;
    color: var(--vce-text-muted);
    font-size: 16px;
    font-weight: bold;
    user-select: none;
    opacity: 0.6;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.vce-task-drag-handle:hover {
    color: var(--vce-primary);
    opacity: 1;
}
.vce-task-drag-handle:active {
    cursor: grabbing;
}

/* Code block typography and whitespaces formatting */
.vce-rte-editor code,
.vce-inline-description code,
.vce-comment-item code {
    font-family: monospace, Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
    background-color: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    white-space: pre-wrap;
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    line-height: 1.4;
    font-size: 14px;
    border: 1px solid var(--vce-border);
    vertical-align: middle;
}
body.vce-theme-light .vce-rte-editor code,
body.vce-theme-light .vce-inline-description code,
body.vce-theme-light .vce-comment-item code {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Attachment Thumbnail & Lightbox Styles */
.vce-attachment-thumbnail,
.vce-embedded-image-thumbnail {
    transition: transform 0.2s ease;
}
.vce-attachment-thumbnail:hover,
.vce-embedded-image-thumbnail:hover {
    transform: scale(1.05);
}
.vce-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: zoom-out;
}
.vce-lightbox-overlay.active {
    opacity: 1;
}
.vce-lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    cursor: default;
}
.vce-lightbox-overlay.active .vce-lightbox-image {
    transform: scale(1);
}
.vce-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    transition: color 0.2s;
    line-height: 1;
}
.vce-lightbox-close:hover {
    color: var(--vce-primary);
}

/* Wiki-Specific Styles */
.vce-wiki-article-card {
    margin-bottom: 8px;
}

/* Persisted marker highlights use classes rather than inline CSS so they survive content sanitization. */
.vce-highlight-default { background-color: #fff3a3 !important; }
.vce-highlight-yellow { background-color: #f1c40f !important; }
.vce-highlight-green { background-color: #2ecc71 !important; }
.vce-highlight-light-blue { background-color: #5dade2 !important; }
.vce-highlight-pink { background-color: #f5b7b1 !important; }
.vce-highlight-red { background-color: #e74c3c !important; }
.vce-highlight-purple { background-color: #9b59b6 !important; }
.vce-highlight-gray { background-color: #95a5a6 !important; }

.vce-wiki-article-layout {
    display: flex;
    width: 100%;
}
.vce-wiki-article-header {
    cursor: pointer;
}
.vce-wiki-article-author-inline {
    min-width: 120px;
    color: var(--vce-text-muted);
    font-size: 14.5px;
}
.vce-wiki-article-body.vce-task-inline-details {
    margin-left: 0;
    margin-top: 15px;
}
.vce-wiki-article-body-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--vce-border);
    padding-bottom: 10px;
}
.vce-wiki-article-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.vce-wiki-article-caret {
    transition: transform 0.2s ease;
    display: inline-block;
}
.vce-wiki-article-card.active .vce-wiki-article-caret {
    transform: rotate(180deg);
}
.vce-wiki-comment-form .vce-uploaded-queue div {
    border: 1px solid var(--vce-border);
    margin-top: 4px;
}

/* Horizontal Menu Bar Styles */
.vce-team-menu-bar .vce-btn {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.vce-team-menu-bar .vce-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
body.vce-theme-light .vce-team-menu-bar {
    background: #f8fafc !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* Wiki Article Drag and Drop Reordering */
.vce-wiki-article-placeholder {
    border: 1px dashed var(--vce-primary);
    background-color: rgba(0, 115, 170, 0.05);
    border-radius: 6px;
    height: 48px;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.vce-wiki-articles-list {
    min-height: 30px;
}

/* --- Files Module --- */
.vce-file-item-card {
    margin-bottom: 12px;
}
.vce-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 15px;
}
.vce-file-row-container {
    cursor: pointer;
}
.vce-file-type-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
}
.vce-file-name-label {
    word-break: break-word;
}
.vce-file-uploader-inline {
    min-width: 140px;
    color: var(--vce-text-muted);
    font-size: 14.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.vce-file-inline-details.vce-task-inline-details {
    margin-left: 0;
    margin-top: 15px;
}
.vce-file-expanded-panel {
    font-size: 13px;
    color: var(--vce-text);
}
.vce-file-expanded-panel .vce-meta-value a {
    color: var(--vce-primary);
    text-decoration: underline;
}
.vce-file-expanded-panel > div:last-child {
    margin-top: 20px !important;
}

/* Revision history always uses standard diff colours, independent of source rich-text colours. */
.vce-revision-diff-wrapper .vce-diff-added {
    color: #166534 !important;
    background-color: #dcfce7 !important;
    font-weight: 600;
    border-radius: 2px;
    padding: 0 1px;
}
.vce-revision-diff-wrapper .vce-diff-removed {
    color: #b91c1c !important;
    background-color: #fee2e2 !important;
    text-decoration: line-through;
    border-radius: 2px;
    padding: 0 1px;
}

.vce-group-placeholder {
    border: 2px dashed var(--vce-primary) !important;
    background-color: rgba(52, 152, 219, 0.08) !important;
    min-height: 80px;
    border-radius: 6px;
    margin-bottom: 15px;
    box-sizing: border-box;
}
