/* ============================================
   Course Version Control - Sidebar Styles
   ============================================ */

/* Toggle Button (left edge) */
.course-vc-toggle {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 12px 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, padding 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.course-vc-toggle:hover {
    background: #218838;
    padding-left: 12px;
}

.course-vc-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-vc-toggle-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Dashboard mode: black toggle */
.course-vc-dashboard-mode .course-vc-toggle {
    background: #1f2937;
}

.course-vc-dashboard-mode .course-vc-toggle:hover {
    background: #374151;
}

/* Hide toggle when sidebar is open */
body.course-vc-open .course-vc-toggle {
    display: none;
}

/* Sidebar Panel */
.course-vc-sidebar {
    position: fixed;
    top: 0;
    left: -34vw;
    width: 33vw;
    min-width: 360px;
    height: 100vh;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #dee2e6;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #1f2937;
}

body.course-vc-open .course-vc-sidebar {
    left: 0;
}

/* Push main content when sidebar is open */
body.course-vc-open .wrapper-view {
    margin-left: 33vw;
    transition: margin-left 0.3s ease;
}

@media (max-width: 1200px) {
    body.course-vc-open .wrapper-view {
        margin-left: 360px;
    }
}

/* Header */
.course-vc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.course-vc-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.course-vc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-vc-icon-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
}

.course-vc-icon-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Status Banner */
.course-vc-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.course-vc-version-badge {
    background: #28a745;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.course-vc-state-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.course-vc-state-badge[data-state="draft"] {
    background: #ffc107;
    color: #212529;
}

.course-vc-state-badge[data-state="in-revision"] {
    background: #17a2b8;
    color: #fff;
}

.course-vc-state-badge[data-state="published"] {
    background: #28a745;
    color: #fff;
}

.course-vc-branch-badge {
    background: #6c757d;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

/* Sync Warning */
.course-vc-sync-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff3cd;
    border-bottom: 1px solid #ffc107;
    font-size: 13px;
    color: #856404;
    flex-shrink: 0;
}

.course-vc-sync-warning span {
    flex: 1;
}

/* Tab Navigation */
.course-vc-tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    flex-shrink: 0;
}

.course-vc-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
    text-align: center;
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.course-vc-tab:hover {
    color: #28a745;
}

.course-vc-tab.active {
    color: #28a745;
    border-bottom-color: #28a745;
}

/* Scrollable Content */
.course-vc-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Tab Content */
.course-vc-tab-content {
    display: none;
    padding: 16px;
}

.course-vc-tab-content.active {
    display: block;
}

/* Sections */
.course-vc-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.course-vc-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.course-vc-section h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Settings Two-Column Layout */
.vc-settings-columns {
    display: flex;
    gap: 16px;
    min-height: 180px;
    flex-wrap: wrap;
}

.vc-settings-list {
    flex: 1 1 160px;
    min-width: 160px;
    max-height: 60vh;
    border-right: 1px solid #eee;
    padding-right: 16px;
    display: flex;
    flex-direction: column;
}

#vc-org-configs-list {
    flex: 1;
    overflow-y: auto;
    max-height: calc(60vh - 50px);
}

.vc-settings-form {
    flex: 1 1 200px;
    min-width: 200px;
}

/* Stack vertically on narrow sidebars */
@media (max-width: 500px) {
    .vc-settings-columns { flex-direction: column; }
    .vc-settings-list { border-right: none; border-bottom: 1px solid #eee; padding-right: 0; padding-bottom: 12px; }
}

.vc-settings-form h4 {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vc-settings-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.vc-settings-form-actions .course-vc-btn {
    flex: 1;
}

/* Org Config Items (left list) */
.vc-org-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 4px;
}

.vc-org-item:hover {
    border-color: #28a745;
    background: #f8fdf9;
}

.vc-org-item.selected {
    border-color: #28a745;
    background: #e6f7ed;
}

.vc-org-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    min-width: 0;
}

.vc-org-item-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-org-item-gh {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vc-org-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* Form Fields */
.course-vc-field {
    margin-bottom: 12px;
}

.course-vc-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

.course-vc-field input,
.course-vc-field select,
.course-vc-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    color: #495057;
    background: #fff;
    box-sizing: border-box;
}

.course-vc-field input:focus,
.course-vc-field select:focus,
.course-vc-field textarea:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

.course-vc-field small {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin-top: 2px;
}

.course-vc-field textarea {
    resize: vertical;
    min-height: 60px;
}

/* Buttons */
.course-vc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    font-family: inherit;
    gap: 6px;
}

.course-vc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.course-vc-btn-primary {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}

.course-vc-btn-primary:hover:not(:disabled) {
    background: #218838;
}

.course-vc-btn-outline {
    background: #fff;
    color: #28a745;
    border-color: #28a745;
}

.course-vc-btn-outline:hover:not(:disabled) {
    background: #f0fff4;
}

.course-vc-btn-danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.course-vc-btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.course-vc-btn-warning {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.course-vc-btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

.course-vc-btn-info {
    background: #17a2b8;
    color: #fff;
    border-color: #17a2b8;
}

.course-vc-btn-info:hover:not(:disabled) {
    background: #138496;
}

.course-vc-btn-block {
    width: 100%;
}

/* AI Improve Button */
.course-vc-ai-btn {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-family: inherit;
    transition: border-color 0.15s, color 0.15s;
}

.course-vc-ai-btn:hover:not(:disabled) {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.course-vc-ai-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.course-vc-ai-btn svg {
    flex-shrink: 0;
}

.course-vc-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Message Area */
.course-vc-message-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #dee2e6;
    font-size: 13px;
    flex-shrink: 0;
}

.course-vc-message-area.success {
    background: #d4edda;
    color: #155724;
}

.course-vc-message-area.error {
    background: #f8d7da;
    color: #721c24;
}

.course-vc-message-area.info {
    background: #d1ecf1;
    color: #0c5460;
}

.course-vc-message-area span {
    flex: 1;
}

.course-vc-message-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    color: inherit;
    opacity: 0.7;
}

.course-vc-message-close:hover {
    opacity: 1;
}

/* Setup Panel */
.course-vc-setup {
    padding: 24px 16px;
    text-align: center;
}

.course-vc-setup-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.course-vc-setup h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #343a40;
}

.course-vc-setup-desc {
    color: #6c757d;
    font-size: 13px;
    margin-bottom: 20px;
}

.course-vc-setup form {
    text-align: left;
}

/* Version List */
.course-vc-version-list {
    font-size: 13px;
}

.course-vc-version-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.course-vc-version-item:last-child {
    border-bottom: none;
}

.course-vc-version-tag {
    font-weight: 600;
    color: #28a745;
    min-width: 60px;
    font-size: 12px;
}

.course-vc-version-info {
    flex: 1;
    min-width: 0;
}

.course-vc-version-message {
    color: #495057;
    margin-bottom: 2px;
    word-wrap: break-word;
}

.course-vc-version-meta {
    font-size: 11px;
    color: #6c757d;
}

.course-vc-version-actions {
    position: relative;
    flex-shrink: 0;
}

/* Three-dots dropdown */
.course-vc-actions-toggle {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: #6c757d;
    font-size: 16px;
    line-height: 1;
}

.course-vc-actions-toggle:hover {
    background: #f0f0f0;
    border-color: #dee2e6;
}

.course-vc-actions-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
    min-width: 140px;
    overflow: hidden;
}

.course-vc-actions-menu.open {
    display: block;
}

.course-vc-action-item {
    display: block;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    font-size: 13px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.course-vc-action-item:hover {
    background: #f5f5f5;
}

.course-vc-action-item.danger {
    color: #dc3545;
}

/* Diff View */
.course-vc-diff-container {
    background: #fafafa;
    padding: 12px;
    border-top: 2px solid #28a745;
    margin: 8px 0;
    border-radius: 4px;
}

.course-vc-diff-summary {
    margin-bottom: 10px;
    color: #666;
    font-size: 12px;
}

.course-vc-diff-file-header {
    cursor: pointer;
    padding: 6px 10px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    margin-bottom: 2px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.course-vc-diff-file-header:hover {
    background: #e8e8e8;
}

.course-vc-diff-status {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
}

.course-vc-diff-status.added { background: #d4edda; color: #155724; }
.course-vc-diff-status.modified { background: #cce5ff; color: #004085; }
.course-vc-diff-status.removed { background: #f8d7da; color: #721c24; }
.course-vc-diff-status.renamed { background: #fff3cd; color: #856404; }

.course-vc-diff-filename {
    flex: 1;
    font-family: 'SF Mono', Consolas, monospace;
    word-break: break-all;
}

.course-vc-diff-stats {
    font-size: 11px;
    white-space: nowrap;
}

.course-vc-diff-stat-add { color: #28a745; }
.course-vc-diff-stat-del { color: #dc3545; }

.course-vc-diff-patch {
    display: none;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 11px;
    overflow-x: auto;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    padding: 0;
    margin-bottom: 4px;
    white-space: pre;
    line-height: 1.5;
}

.course-vc-diff-patch.open {
    display: block;
}

.course-vc-diff-line {
    padding: 0 8px;
    min-height: 18px;
}

.course-vc-diff-line-add { background: #e6ffec; color: #22863a; }
.course-vc-diff-line-del { background: #ffeef0; color: #cb2431; }
.course-vc-diff-line-info { background: #f1f8ff; color: #0366d6; }

/* Loading */
.course-vc-loading {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-size: 13px;
}

/* Spinner */
.course-vc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: course-vc-spin 0.6s linear infinite;
}

.course-vc-spinner.dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #28a745;
}

@keyframes course-vc-spin {
    to { transform: rotate(360deg); }
}

/* Workflow Stepper */
.course-vc-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 12px 64px 16px;
    padding: 0 4px;
}

.course-vc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.course-vc-step-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s ease;
}

.course-vc-step.completed .course-vc-step-circle {
    background: #28a745;
    border-color: #28a745;
    color: #fff;
}

.course-vc-step.active .course-vc-step-circle {
    border-color: #0075ca;
    background: #0075ca;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 117, 202, 0.2);
}

.course-vc-step-label {
    margin-top: 6px;
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    max-width: 72px;
    line-height: 1.2;
}

.course-vc-step.completed .course-vc-step-label {
    color: #28a745;
}

.course-vc-step.active .course-vc-step-label {
    color: #1a1a1a;
    font-weight: 600;
}

.course-vc-step-connector {
    flex: 1;
    height: 2px;
    background: #d1d5db;
    margin-top: 14px;
    min-width: 20px;
}

.course-vc-step-connector.completed {
    background: #28a745;
}

/* Workflow action buttons */
.course-vc-workflow-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.course-vc-workflow-row {
    display: flex;
    gap: 8px;
}

.course-vc-workflow-row .course-vc-btn {
    flex: 1;
}

/* Comments */
.course-vc-comments-list {
    font-size: 13px;
}

.course-vc-comment-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.course-vc-comment-item:last-child {
    border-bottom: none;
}

.course-vc-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.course-vc-comment-author {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}

.course-vc-comment-date {
    font-size: 11px;
    color: #6c757d;
}

.course-vc-comment-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.course-vc-comment-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.course-vc-comment-badge-version {
    background: #e9ecef;
    color: #495057;
}

.course-vc-comment-badge-approved {
    background: #d4edda;
    color: #155724;
}

.course-vc-comment-badge-rejected {
    background: #f8d7da;
    color: #721c24;
}

.course-vc-comment-badge-submitted {
    background: #d1ecf1;
    color: #0c5460;
}

.course-vc-comment-unit-link {
    margin-bottom: 4px;
}

.course-vc-comment-unit-link a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #28a745;
    text-decoration: none;
}

.course-vc-comment-unit-link a:hover {
    color: #218838;
    text-decoration: underline;
}

/* Severity Badges */
.course-vc-severity-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.course-vc-severity-A { background: #ffeef0; color: #d73a49; }
.course-vc-severity-B { background: #fff5e6; color: #e36209; }
.course-vc-severity-C { background: #fffbdd; color: #735c0f; }
.course-vc-severity-D { background: #e6f0ff; color: #0366d6; }

/* Status Badges */
.course-vc-status-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.course-vc-status-open { background: #fffbdd; color: #735c0f; }
.course-vc-status-resolved { background: #e6ffed; color: #22863a; }
.course-vc-status-wont_fix { background: #f1f1f1; color: #6a737d; }

/* Issue Link */
.course-vc-issue-link {
    font-size: 11px;
    font-weight: 600;
    color: #0366d6;
    text-decoration: none;
}

.course-vc-issue-link:hover {
    text-decoration: underline;
}

/* Comment Location */
.course-vc-comment-location {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 4px;
    font-style: italic;
}

.course-vc-comment-content {
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}
.course-vc-comment-content code,
.course-vc-comment-suggestion code,
.course-vc-comment-evidence code,
.course-vc-comment-reason code {
    background: #f1f3f5;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: monospace;
}

/* Suggestion block */
.course-vc-comment-suggestion {
    margin-top: 6px;
    padding: 6px 8px;
    background: #f0f7ff;
    border-left: 3px solid #0366d6;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    color: #495057;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.course-vc-comment-suggestion-label {
    font-weight: 600;
    color: #0366d6;
}

/* Evidence note */
.course-vc-comment-evidence {
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Status change reason */
.course-vc-comment-reason {
    margin-top: 6px;
    padding: 6px 8px;
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    border-radius: 0 4px 4px 0;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.course-vc-comment-reason-label {
    font-weight: 600;
    color: #f57f17;
}

/* Resolved items dimmed */
.course-vc-comment-resolved {
    opacity: 0.6;
}

.course-vc-comment-resolved:hover {
    opacity: 1;
}

/* Status Action Buttons */
.course-vc-comment-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.course-vc-action-status-btn {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid;
    transition: background 0.15s;
}

.course-vc-action-resolve {
    background: #e6ffed;
    color: #22863a;
    border-color: #bee5c8;
}

.course-vc-action-resolve:hover { background: #d4edda; }

.course-vc-action-wontfix {
    background: #f6f8fa;
    color: #6a737d;
    border-color: #d1d5db;
}

.course-vc-action-wontfix:hover { background: #e9ecef; }

.course-vc-action-reopen {
    background: #fff5e6;
    color: #e36209;
    border-color: #ffd8a8;
}

.course-vc-action-reopen:hover { background: #ffecd0; }

.course-vc-comment-quote {
    margin: 4px 0 6px 0;
    padding: 6px 10px;
    border-left: 3px solid #28a745;
    background: #f8fdf9;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    line-height: 1.4;
    max-height: 60px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 0 4px 4px 0;
}

/* Comment Stats */
.course-vc-comment-stats {
    margin-bottom: 10px;
}

.course-vc-stats-cert {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.course-vc-stats-cert.cert-ready {
    background: #e6ffed;
    color: #22863a;
    border: 1px solid #bee5c8;
}

.course-vc-stats-cert.cert-blocked {
    background: #ffeef0;
    color: #d73a49;
    border: 1px solid #fdaeb7;
}

.course-vc-stats-cert-icon {
    font-size: 15px;
    line-height: 1;
}

.course-vc-stats-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.course-vc-stats-meta {
    font-size: 11px;
    color: #6c757d;
    margin-bottom: 8px;
}

/* Comments Filters */
.course-vc-comments-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
    /* Wrap to a new line when the four controls don't fit (sidebar
       at min-width 360px or when the user shrinks the viewport).
       Without this, the trailing buttons get clipped at the right
       edge of the sidebar. */
    flex-wrap: wrap;
}
.course-vc-comments-filters .course-vc-btn {
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.course-vc-filter-select {
    /* Keep selects readable (min 120px) but let them grow to share
       the row when there's space. Combined with flex-wrap above,
       narrow widths drop the buttons to a second row instead of
       squashing the selects. */
    flex: 1 1 140px;
    min-width: 120px;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    color: #495057;
    background: #fff;
}

.course-vc-filter-select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}

.course-vc-comments-load-more {
    padding: 12px 0;
    text-align: center;
}

/* Tooltip (JS-positioned, fixed) */
.course-vc-tooltip {
    position: fixed;
    display: none;
    background: #1f2937;
    color: #fff;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: normal;
    max-width: 220px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Status change reason modal */
.course-vc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}
.course-vc-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 20px;
    width: 400px;
    max-width: 90vw;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.course-vc-modal-header {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 12px;
}
.course-vc-modal-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.5;
    box-sizing: border-box;
}
.course-vc-modal-textarea:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}
.course-vc-modal-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
}
.course-vc-modal-input:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}
.course-vc-modal-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    box-sizing: border-box;
    background: #fff;
}
.course-vc-modal-select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.15);
}
.course-vc-modal-error {
    color: #b91c1c;
    font-size: 12px;
    margin-top: 6px;
    display: none;
}
.course-vc-modal-ai-btn {
    margin-top: 6px;
    font-size: 12px;
}
.course-vc-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}

/* ─── SKIIM v2 lifecycle panel ──────────────────────────────────── */
.course-vc-lifecycle-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 13px;
    margin: 6px 0;
}
.course-vc-lifecycle-id {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
}
.course-vc-lifecycle-name { font-size: 13px; }
.course-vc-lifecycle-owner {
    font-size: 12px;
    color: #444;
    margin-bottom: 8px;
}
.course-vc-empty-state {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
    padding: 8px 0;
}

/* ─── SKIIM v2 Roles UI ─────────────────────────────────────────── */
.course-vc-role-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fafafa;
}
.course-vc-role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.course-vc-role-count {
    color: #6c757d;
    font-size: 12px;
}
.course-vc-role-member-list {
    list-style: none;
    padding: 0;
    margin: 6px 0;
    font-size: 12px;
}
.course-vc-role-member-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    border-bottom: 1px solid #f0f0f0;
}
.course-vc-role-member-list li:last-child { border-bottom: none; }
.course-vc-role-member-name { font-weight: 600; }
.course-vc-role-member-email { color: #6c757d; flex: 1; }
.course-vc-role-remove-btn {
    background: transparent;
    border: none;
    color: #b91c1c;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.course-vc-role-remove-btn:hover { color: #7f1d1d; }
.course-vc-role-add {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.course-vc-role-add-input {
    flex: 1;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}
.course-vc-role-add-btn { font-size: 12px; padding: 4px 10px; }
.course-vc-help-text { font-size: 12px; color: #6c757d; margin-bottom: 8px; }

/* ─── SKIIM v2 role-scope UI ────────────────────────────────────── */
.course-vc-roles-toolbar {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.course-vc-roles-toolbar .course-vc-btn { font-size: 12px; padding: 4px 10px; }
.course-vc-role-section { margin-top: 8px; }
.course-vc-role-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.04em;
    margin: 4px 0;
}
.course-vc-role-source-badge {
    display: inline-block;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
    background: #e9ecef;
    color: #495057;
}
.course-vc-role-source-badge[data-source="org_default"] {
    background: #e7f1ff;
    color: #1d4ed8;
}
.course-vc-modal-wide {
    width: 560px;
    max-width: 90vw;
}

/* ─── NC picker (rejection flow) ────────────────────────────────── */
.course-vc-nc-picker-list {
    max-height: 50vh;
    overflow-y: auto;
    margin: 8px 0;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}
.course-vc-nc-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    background: #fff;
}
.course-vc-nc-picker-item:last-child { border-bottom: none; }
.course-vc-nc-picker-item:hover { background: #fafafa; }
.course-vc-nc-picker-item input[type="checkbox"] { margin-top: 4px; }
.course-vc-nc-picker-row { flex: 1; min-width: 0; }
.course-vc-nc-picker-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #374151;
}
.course-vc-nc-picker-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
    word-wrap: break-word;
}
.course-vc-nc-loc { font-weight: 600; }
.course-vc-nc-severity {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    color: #fff;
}
.course-vc-nc-severity-A { background: #dc2626; }
.course-vc-nc-severity-B { background: #f59e0b; color: #1f2937; }
.course-vc-nc-severity-C { background: #3b82f6; }
.course-vc-nc-severity-D { background: #6b7280; }
.course-vc-nc-already {
    color: #10b981;
    font-size: 14px;
    line-height: 1;
}

/* ─── Lifecycle process modal ───────────────────────────────────── */
.course-vc-lifecycle-badge {
    /* override the static styles to make it look + behave like a button */
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.course-vc-lifecycle-badge:hover { filter: brightness(0.92); }
.course-vc-lifecycle-info {
    font-size: 11px;
    opacity: 0.85;
    margin-left: 2px;
}

.course-vc-lc-modal { width: 720px; max-width: 95vw; }
.course-vc-lc-happy-path {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    margin: 6px 0;
}
.course-vc-lc-node {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    opacity: 0.55;
    border: 2px solid transparent;
}
.course-vc-lc-node.is-current {
    opacity: 1;
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.15);
}
.course-vc-lc-node.is-next {
    opacity: 1;
    border-color: rgba(16, 185, 129, 0.6);
}
.course-vc-lc-node-id { font-weight: 700; }
.course-vc-lc-arrow { color: #9ca3af; font-size: 13px; }

.course-vc-lc-lanes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 6px 0;
}
.course-vc-lc-lane {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    align-items: start;
    padding: 6px 8px;
    border-left: 3px solid #e5e7eb;
    background: #fafafa;
    border-radius: 4px;
}
.course-vc-lc-lane-label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-top: 4px;
}
.course-vc-lc-lane-states {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.course-vc-lc-state {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
}
.course-vc-lc-state.is-current { background: rgba(17, 24, 39, 0.05); }
.course-vc-lc-state-badge {
    display: inline-block;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}
.course-vc-lc-state-name { font-size: 12px; color: #374151; }
.course-vc-lc-state.is-current .course-vc-lc-state-name { font-weight: 700; color: #111827; }
.course-vc-lc-marker {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.course-vc-lc-marker.is-next {
    background: #10b981;
}

.course-vc-lc-legend {
    margin-top: 14px;
    padding: 10px 12px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #4b5563;
}
.course-vc-lc-legend p { margin: 0 0 6px; }
.course-vc-lc-legend ul { margin: 0; padding-left: 18px; }
.course-vc-lc-legend li { margin: 2px 0; }

/* Lifecycle panel: lay action buttons side-by-side inside the panel.
   Overrides the default vertical stack inherited from
   .course-vc-workflow-btns. Wraps when the sidebar is narrow so a
   third / fourth button doesn't overflow. */
#vc-lifecycle-actions .course-vc-workflow-btns {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
}
#vc-lifecycle-actions .course-vc-workflow-btns .course-vc-btn {
    flex: 1 1 0;
    min-width: 160px;
}

/* ============================================================
   Actions tab modernization (2026-05)
   ============================================================ */

/* Section cards — soft shadow + 8px radius so each block reads as
   a distinct card without heavy borders. The existing bottom border
   stays as a fallback for fluid stacks; the new chrome is additive. */
#tab-actions .course-vc-section {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
#tab-actions .course-vc-section:hover {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    border-color: #e5e7eb;
}
#tab-actions .course-vc-section h4 {
    margin-top: 0;
}

/* Lifecycle panel — clearer "where" / "what" hierarchy without
   splitting the section. Header band (badge + owner), thin
   divider, then the action band. */
#vc-lifecycle-section #vc-lifecycle-summary {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #e5e7eb;
}
#vc-lifecycle-section .course-vc-lifecycle-badge {
    animation: vc-lc-badge-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 7px 14px;
    font-size: 13px;
}
#vc-lifecycle-section .course-vc-lifecycle-id {
    font-size: 12px;
}
@keyframes vc-lc-badge-in {
    from { opacity: 0; transform: translateY(4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
#vc-lifecycle-section .course-vc-lifecycle-owner {
    margin-bottom: 0;
    padding-top: 4px;
}
#vc-lifecycle-actions .course-vc-btn {
    animation: vc-lc-btn-in 0.22s ease both;
    animation-delay: 60ms;
}
@keyframes vc-lc-btn-in {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Buttons — micro-interaction polish across the Actions tab. */
#tab-actions .course-vc-btn {
    transition:
        transform 0.12s ease,
        filter 0.12s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}
#tab-actions .course-vc-btn:not(:disabled):hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
#tab-actions .course-vc-btn:not(:disabled):active {
    transform: translateY(0);
    filter: brightness(0.96);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
#tab-actions .course-vc-btn:disabled {
    opacity: 0.55;
}

/* Textareas + selects — softer focus ring (matches the brand
   green) and a subtle background tween when focused. */
#tab-actions textarea,
#tab-actions select,
#tab-actions input[type="text"],
#tab-actions input[type="password"] {
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}
#tab-actions textarea:focus,
#tab-actions select:focus,
#tab-actions input[type="text"]:focus,
#tab-actions input[type="password"]:focus {
    outline: none;
    border-color: #28a745;
    background-color: #fafffa;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.12);
}

/* Section entry — light fade-in on first paint of the tab. */
#tab-actions.active .course-vc-section {
    animation: vc-section-in 0.32s ease both;
}
#tab-actions.active .course-vc-section:nth-child(1) { animation-delay: 0ms; }
#tab-actions.active .course-vc-section:nth-child(2) { animation-delay: 40ms; }
#tab-actions.active .course-vc-section:nth-child(3) { animation-delay: 80ms; }
#tab-actions.active .course-vc-section:nth-child(4) { animation-delay: 120ms; }
#tab-actions.active .course-vc-section:nth-child(5) { animation-delay: 160ms; }
@keyframes vc-section-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Loading shimmer — replaces the static text in loaders with a
   moving sheen so it's clear something is happening. */
.course-vc-loading {
    position: relative;
    overflow: hidden;
    color: transparent !important;
    background: linear-gradient(
        90deg,
        rgba(15, 23, 42, 0.04) 0%,
        rgba(15, 23, 42, 0.08) 50%,
        rgba(15, 23, 42, 0.04) 100%
    );
    background-size: 200% 100%;
    border-radius: 4px;
    animation: vc-shimmer 1.4s infinite ease-in-out;
    min-height: 14px;
}
@keyframes vc-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Respect users who prefer no motion. */
@media (prefers-reduced-motion: reduce) {
    #tab-actions .course-vc-section,
    #tab-actions .course-vc-btn,
    #vc-lifecycle-section .course-vc-lifecycle-badge,
    #vc-lifecycle-actions .course-vc-btn,
    .course-vc-loading {
        animation: none !important;
        transition: none !important;
    }
}

/* ─── Settings tab sub-tabs (Repository | Roles) ─────────────────── */
.course-vc-settings-subtabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 14px;
}
.course-vc-settings-subtab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.course-vc-settings-subtab:hover { color: #28a745; }
.course-vc-settings-subtab.active {
    color: #28a745;
    border-bottom-color: #28a745;
}
.course-vc-settings-subtab-content { display: none; }
.course-vc-settings-subtab-content.active { display: block; }
