/* Admin Interface Styles */

:root {
    --admin-bg: #f9fafb;
    --admin-card-bg: #ffffff;
    --admin-text-primary: #1f2937;
    --admin-text-secondary: #6b7280;
    --admin-border: #e5e7eb;
    --admin-primary: #2563eb;
    --admin-primary-hover: #1d4ed8;
    --admin-success: #10b981;
    --admin-success-hover: #059669;
    --admin-danger: #ef4444;
    --admin-danger-hover: #dc2626;
    --admin-warning: #f59e0b;
    --admin-warning-hover: #d97706;
    --admin-secondary: #6b7280;
    --admin-secondary-hover: #4b5563;
    --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --admin-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark mode - automatically applied when browser is in dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --admin-bg: #1e1e1e;
        --admin-card-bg: #2d2d2d;
        --admin-text-primary: #b8b8b8;
        --admin-text-secondary: #8a8a8a;
        --admin-border: #444;
        --admin-primary: #3b82f6;
        --admin-primary-hover: #60a5fa;
        --admin-success: #10b981;
        --admin-success-hover: #34d399;
        --admin-danger: #ef4444;
        --admin-danger-hover: #f87171;
        --admin-warning: #fbbf24;
        --admin-warning-hover: #fcd34d;
        --admin-secondary: #6b7280;
        --admin-secondary-hover: #9ca3af;
        --admin-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        --admin-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    }

    /* Scrollbar styling for dark mode */
    * {
        scrollbar-width: thin;
        scrollbar-color: #444 #1e1e1e;
    }

    /* Webkit browsers (Chrome, Safari, Edge) */
    *::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }

    *::-webkit-scrollbar-track {
        background: #1e1e1e;
    }

    *::-webkit-scrollbar-thumb {
        background-color: #444;
        border-radius: 6px;
        border: 3px solid #1e1e1e;
    }

    *::-webkit-scrollbar-thumb:hover {
        background-color: #555;
    }
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--admin-bg);
    color: var(--admin-text-primary);
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header Bar */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--admin-card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--admin-shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-left h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--admin-text-primary);
}

.header-right {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

/* User Dropdown Menu */
.user-menu-container {
    position: relative;
}

.current-user {
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
    user-select: none;
}

.current-user:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .current-user:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

.user-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    box-shadow: var(--admin-shadow-lg);
    z-index: 50;
    min-width: 150px;
    display: none;
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.875rem;
    color: var(--admin-text-primary);
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

.dropdown-item:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--admin-border);
    margin: 0.25rem 0;
}

/* Workflow Navigation Tabs */
.workflow-nav-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--admin-card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--admin-shadow);
}

.workflow-nav-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--admin-text-secondary);
    background: var(--admin-bg);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.workflow-nav-tab:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--admin-primary);
}

.workflow-nav-tab.active {
    background: var(--admin-primary);
    color: white;
}

@media (prefers-color-scheme: dark) {
    .workflow-nav-tab.active {
        background: #1e3a5f;
        color: white;
    }

    .workflow-nav-tab:hover {
        background: rgba(45, 90, 138, 0.2);
        color: #60a5fa;
    }
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--admin-primary-hover);
}

.btn-secondary {
    background: var(--admin-secondary);
}

.btn-secondary:hover {
    background: var(--admin-secondary-hover);
}

.btn-danger {
    background: var(--admin-danger);
}

.btn-danger:hover {
    background: var(--admin-danger-hover);
}

.btn-success {
    background: var(--admin-success);
}

.btn-success:hover {
    background: var(--admin-success-hover);
}

/* Stats Row */
.stats-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--admin-card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--admin-shadow);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

/* Search Bar */
.search-bar {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--admin-card-bg);
    color: var(--admin-text-primary);
}

.search-bar:focus {
    outline: none;
    border-color: var(--admin-primary);
}

/* User Cards Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.user-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.user-name {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--admin-text-primary);
}

.user-role {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #fee2e2;
    color: #991b1b;
}

.role-tech {
    background: #dbeafe;
    color: #1e40af;
}

.role-user {
    background: #d1fae5;
    color: #065f46;
}

.role-viewer {
    background: #f3f4f6;
    color: #374151;
}

.user-details {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

.user-detail {
    margin: 0.25rem 0;
}

.user-status {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.status-active {
    background: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--admin-card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    color: var(--admin-text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--admin-text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--admin-text-secondary);
}

.close-btn:hover {
    color: var(--admin-text-primary);
}

/* Floating Panel (draggable/resizable) */
.floating-panel {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 50px;
    right: 50px;
    width: 600px;
    min-width: 400px;
    min-height: 300px;
    max-width: calc(100vw - 100px);
    max-height: calc(100vh - 100px);
}

.floating-panel[style*="display: flex"],
.floating-panel.show {
    display: flex;
}

.floating-panel-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: var(--admin-card-bg);
    border-radius: 0.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--admin-border);
    overflow: hidden;
    position: relative;
}

.floating-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--admin-bg);
    border-bottom: 1px solid var(--admin-border);
    cursor: grab;
    user-select: none;
}

.floating-panel-header:active {
    cursor: grabbing;
}

.floating-panel-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.floating-panel-header .drag-indicator {
    color: var(--admin-text-secondary);
    font-size: 1rem;
    letter-spacing: -2px;
}

.floating-panel .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.floating-panel .modal-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--admin-border);
    background: var(--admin-bg);
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, var(--admin-text-secondary) 50%);
    opacity: 0.3;
    border-bottom-right-radius: 0.5rem;
}

.resize-handle:hover {
    opacity: 0.6;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-text-primary);
}

.form-input,
input,
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: var(--admin-card-bg);
    color: var(--admin-text-primary);
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.permission-list {
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    padding: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    background: var(--admin-card-bg);
}

.permission-item {
    display: flex;
    align-items: center;
    margin: 0.25rem 0;
}

.permission-item input {
    margin-right: 0.5rem;
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Task Library Styles */
.task-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--admin-border);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.task-row:hover {
    background: var(--admin-bg);
}

.task-row:last-child {
    border-bottom: none;
}

/* Hover animations for draggable rows */
.task-row {
    cursor: grab;
    border-left: 3px solid transparent;
    transition: border-left-color 0.2s ease, background 0.2s ease;
}

.task-row:hover {
    border-left-color: var(--admin-primary);
    background: var(--admin-bg);
}

.task-row:active {
    cursor: grabbing;
    border-left-color: var(--admin-success);
}

/* Drag states */
.task-row.dragging {
    opacity: 0.4;
    background: var(--admin-bg);
}

.task-row.drag-over {
    border-top: 3px solid #3b82f6;
}

.task-row.drag-over-bottom {
    border-bottom: 3px solid #3b82f6;
}

/* Newly added task highlight animation */
.task-row.task-newly-added,
[data-task-id].task-newly-added {
    animation: task-highlight-pulse 3s ease-out;
}

@keyframes task-highlight-pulse {
    0% {
        background-color: rgba(34, 197, 94, 0.4);
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
    }
    50% {
        background-color: rgba(34, 197, 94, 0.2);
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* Hierarchical tree indentation - handled inline in task-hierarchy-view.js
   Content indents based on level using padding-left */

/* Expand/collapse icons */
.expand-icon {
    cursor: pointer;
    width: 20px;
    min-width: 20px;
    font-size: 0.875rem;
    transition: transform 0.2s;
    user-select: none;
    display: inline-block;
    margin-right: 0.5rem;
    color: var(--admin-text-secondary);
}

.expand-icon:hover {
    color: var(--admin-text-primary);
}

.expand-icon-placeholder {
    width: 20px;
    min-width: 20px;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Subtree container */
.task-subtree {
    display: block;
}

.task-subtree.collapsed {
    display: none;
}

.task-subtree.expanded {
    display: block;
}

.category-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Category colors (alphabetical) */
.category-cleanup { background: #fef9c3; color: #854d0e; }
.category-configuration { background: #e0f2fe; color: #0c4a6e; }
.category-customer_communication { background: #fce4ec; color: #880e4f; }
.category-data_backup { background: #bfdbfe; color: #1e3a8a; }
.category-data_integrity { background: #fef08a; color: #713f12; }
.category-data_management { background: #dbeafe; color: #1e40af; }
.category-data_recovery { background: #a78bfa; color: #4c1d95; }
.category-data_transfer { background: #a5f3fc; color: #155e75; }
.category-diagnostics { background: #fef3c7; color: #92400e; }
.category-documentation { background: #f5f3ff; color: #5b21b6; }
.category-hardware { background: #f3e8ff; color: #6b21a8; }
.category-installation { background: #e0e7ff; color: #3730a3; }
.category-maintenance { background: #d1fae5; color: #065f46; }
.category-preparation { background: #fce7f3; color: #9f1239; }
.category-quality_assurance { background: #e8f5e9; color: #1b5e20; }
.category-security { background: #fee2e2; color: #991b1b; }
.category-software { background: #ddd6fe; color: #5b21b6; }
.category-training { background: #fff3e0; color: #e65100; }
.category-troubleshooting { background: #ffebee; color: #c62828; }
.category-verification { background: #cffafe; color: #0e7490; }
.category-other { background: #f5f5f5; color: #424242; }

/* Dark mode: softer, muted category badge colors (alphabetical) */
@media (prefers-color-scheme: dark) {
    .category-cleanup { background: rgba(234, 179, 8, 0.15); color: #fde047; }
    .category-configuration { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; }
    .category-customer_communication { background: rgba(236, 72, 153, 0.15); color: #f9a8d4; }
    .category-data_backup { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
    .category-data_integrity { background: rgba(250, 204, 21, 0.15); color: #facc15; }
    .category-data_management { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
    .category-data_recovery { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
    .category-data_transfer { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
    .category-diagnostics { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
    .category-documentation { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }
    .category-hardware { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
    .category-installation { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
    .category-maintenance { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
    .category-preparation { background: rgba(236, 72, 153, 0.15); color: #f9a8d4; }
    .category-quality_assurance { background: rgba(34, 197, 94, 0.15); color: #86efac; }
    .category-security { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
    .category-software { background: rgba(139, 92, 246, 0.15); color: #c4b5fd; }
    .category-training { background: rgba(249, 115, 22, 0.15); color: #fdba74; }
    .category-troubleshooting { background: rgba(220, 38, 38, 0.15); color: #fca5a5; }
    .category-verification { background: rgba(6, 182, 212, 0.15); color: #67e8f9; }
    .category-other { background: rgba(255, 255, 255, 0.08); color: #d4d4d4; }
}

/* Toast styles */
.toast {
    background: var(--admin-card-bg);
    color: var(--admin-text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    box-shadow: var(--admin-shadow-lg);
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--admin-primary);
}

.toast.toast-info {
    border-left-color: var(--admin-primary);
}

.toast.toast-success {
    border-left-color: var(--admin-success);
}

.toast.toast-error {
    border-left-color: var(--admin-danger);
}

.toast.toast-warning {
    border-left-color: var(--admin-warning);
}

.toast.show {
    display: block;
}

/* Condition Builder Styles */
.condition-builder-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
}

.condition-builder-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background 0.2s;
}

.condition-builder-toggle:hover {
    background: var(--admin-bg);
}

.condition-builder-toggle-icon {
    font-size: 0.875rem;
    transition: transform 0.2s;
}

.condition-builder-toggle-icon.expanded {
    transform: rotate(90deg);
}

.condition-builder-content {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--admin-bg);
    border-radius: 0.375rem;
}

.condition-builder-content.collapsed {
    display: none;
}

.condition-builder-empty {
    text-align: center;
    padding: 2rem;
    color: var(--admin-text-secondary);
}

.condition-builder-empty p {
    margin-bottom: 1rem;
}

.condition-builder-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.condition-builder-header label {
    font-weight: 500;
    margin: 0;
}

.condition-operator {
    padding: 0.5rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    background: white;
}

.condition-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.condition-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
}

.condition-field,
.condition-operator-select {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
}

.condition-value {
    flex: 1;
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
}

/* ========================================
   AI Task Mapper Styles
   ======================================== */

.ai-explanation {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--admin-primary);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.suggestion-section {
    margin-bottom: 1.5rem;
}

.suggestion-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--admin-border);
}

.suggestion-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    background: var(--admin-card-bg);
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    border-color: var(--admin-primary);
    box-shadow: var(--admin-shadow);
}

.suggestion-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.25rem;
    cursor: pointer;
}

.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.suggestion-description {
    color: var(--admin-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.suggestion-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
    margin-bottom: 0.5rem;
}

.suggestion-reason {
    font-size: 0.8125rem;
    color: var(--admin-text-secondary);
    font-style: italic;
    padding: 0.5rem;
    background: var(--admin-bg);
    border-radius: 0.25rem;
    border-left: 2px solid var(--admin-border);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-required {
    background: rgba(16, 185, 129, 0.1);
    color: var(--admin-success);
}

.badge-optional {
    background: rgba(107, 114, 128, 0.1);
    color: var(--admin-secondary);
}

.badge-order {
    background: rgba(59, 130, 246, 0.15);
    color: var(--admin-info, #3b82f6);
    font-weight: 700;
    min-width: 1.75rem;
    text-align: center;
}

.badge-new-task {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    font-style: italic;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--admin-danger, #ef4444);
}

/* Ticket search and controls */
#ticket-search {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

#search-mode-toggle {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .ai-explanation {
        background: rgba(59, 130, 246, 0.1);
    }

    .suggestion-item {
        background: var(--admin-bg);
    }

    .suggestion-item:hover {
        background: var(--admin-card-bg);
    }

    .suggestion-reason {
        background: var(--admin-card-bg);
    }

    #ticket-search {
        background: var(--card-bg);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    #ticket-search::placeholder {
        color: var(--text-secondary);
        opacity: 0.7;
    }

    #search-mode-toggle {
        background: var(--card-bg);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    #search-mode-toggle:hover {
        background: var(--hover-bg);
    }
}

/* ============================================
   Workflow Tree Builder Styles
   ============================================ */

.workflow-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--admin-bg);
    border-radius: 0.5rem;
}

.workflow-tree-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--admin-bg);
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 1px solid var(--admin-border);
}

.workflow-tree-toolbar .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.workflow-tree-container {
    padding: 0.5rem;
    min-height: 300px;
}

.workflow-node-wrapper {
    position: relative;
}

.workflow-node {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 2px 0;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-left: 3px solid var(--admin-border);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: calc(var(--node-depth, 0) * 1.5rem);
}

.workflow-node:hover {
    background: var(--admin-bg);
    border-left-color: var(--admin-primary);
}

.workflow-node.selected {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--admin-primary);
}

.workflow-node.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.workflow-node.drag-over-before {
    border-top: 2px solid var(--admin-primary);
    margin-top: 0;
}

.workflow-node.drag-over-after {
    border-bottom: 2px solid var(--admin-primary);
    margin-bottom: 0;
}

.workflow-node.drag-over-inside {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--admin-primary);
}

/* Ghost preview for drag and drop */
.workflow-node-ghost {
    opacity: 0.6;
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--admin-primary);
    border-left-width: 3px;
    pointer-events: none;
    animation: ghost-pulse 1s ease-in-out infinite;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}

.workflow-node-ghost .workflow-node-content {
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.workflow-node-ghost .workflow-node-name {
    white-space: nowrap;
}

.workflow-ghost-container {
    pointer-events: none;
}

@keyframes ghost-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.7; }
}

/* Multi-selection count badge */
.workflow-selection-badge,
.workflow-drag-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-left: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    background: var(--admin-primary);
    border-radius: 0.625rem;
}

.workflow-drag-count {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--admin-danger, #ef4444);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Template picker dropdown */
.template-picker {
    position: relative;
}

.template-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 2px;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--admin-border);
}

.template-option:last-child {
    border-bottom: none;
}

.template-option:hover {
    background: var(--admin-bg);
}

.template-option-custom {
    background: rgba(59, 130, 246, 0.05);
    border-bottom: 2px solid var(--admin-border);
}

.template-option-custom:hover {
    background: rgba(59, 130, 246, 0.1);
}

.template-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.template-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-time {
    font-size: 0.8rem;
    color: var(--admin-text-secondary);
    flex-shrink: 0;
}

/* Base context menu styles (shared by device, workflow, etc.) */
.context-menu {
    position: fixed;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 160px;
    padding: 0.375rem 0;
    z-index: 10000;
    display: none;
}

.context-menu.show,
.context-menu.active {
    display: block;
}

/* Context menu for workflow nodes (extends base) */
.workflow-context-menu {
    position: fixed;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 160px;
    padding: 0.375rem 0;
    z-index: 10000;
    display: none;
}

.workflow-context-menu.show {
    display: block;
}

/* Context menu separator */
.context-menu-separator {
    height: 1px;
    background: var(--admin-border);
    margin: 0.375rem 0;
}

/* Danger item variant */
.context-menu-item-danger {
    color: var(--admin-danger, #ef4444);
}

.context-menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--admin-text-primary);
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: var(--admin-bg);
}

.context-menu-item.context-menu-danger {
    color: var(--admin-danger, #ef4444);
}

.context-menu-item.context-menu-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.context-menu-icon {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.context-menu-divider {
    height: 1px;
    background: var(--admin-border);
    margin: 0.375rem 0;
}

/* Task outcome nodes (outcome questions and options) */
.workflow-outcome-question {
    background: rgba(168, 85, 247, 0.05);
    border-left-color: #a855f7 !important;
}

.workflow-outcome-question:hover {
    background: rgba(168, 85, 247, 0.1);
}

.workflow-outcome-option {
    background: rgba(59, 130, 246, 0.05);
    border-left-color: #3b82f6 !important;
    cursor: default;
}

.workflow-outcome-option:hover {
    background: rgba(59, 130, 246, 0.1);
}

.workflow-outcome-option.drag-over-inside {
    background: rgba(59, 130, 246, 0.2);
    border: 2px dashed #3b82f6;
}

.workflow-outcome-children {
    border-left: 1px dashed rgba(168, 85, 247, 0.3);
    margin-left: 0.75rem;
    padding-left: 0.5rem;
}

.workflow-node-toggle {
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: var(--admin-text-secondary);
    cursor: pointer;
    flex-shrink: 0;
}

.workflow-node-toggle:hover {
    color: var(--admin-text-primary);
}

.workflow-node-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.workflow-node-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0 0.5rem;
}

.workflow-node-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workflow-node-key,
.workflow-node-value {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    background: var(--admin-bg);
    border-radius: 0.25rem;
    font-family: monospace;
    color: var(--admin-text-secondary);
}

.workflow-node-time,
.workflow-node-price {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
}

.workflow-node-depends {
    font-size: 0.75rem;
    opacity: 0.6;
    cursor: help;
}

/* Surface timing badges for questions */
.workflow-surface-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.375rem;
    font-weight: 500;
}

.workflow-surface-check_in {
    background: #dbeafe;
    color: #1e40af;
}

.workflow-surface-pre_work {
    background: #fef3c7;
    color: #92400e;
}

@media (prefers-color-scheme: dark) {
    .workflow-surface-check_in {
        background: #1e3a5f;
        color: #93c5fd;
    }
    .workflow-surface-pre_work {
        background: #422006;
        color: #fcd34d;
    }
}

.workflow-node-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.workflow-node:hover .workflow-node-actions {
    opacity: 1;
}

.workflow-node-action {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
    transition: all 0.15s ease;
}

.workflow-node-action:hover {
    background: var(--admin-bg);
    color: var(--admin-text-primary);
}

.workflow-node-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--admin-danger);
}

.workflow-node-children {
    position: relative;
}

.workflow-node-children::before {
    content: '';
    position: absolute;
    left: calc(var(--node-depth, 0) * 1.5rem + 0.75rem);
    top: 0;
    bottom: 0.5rem;
    width: 1px;
    background: var(--admin-border);
}

.workflow-type-dropdown {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    box-shadow: var(--admin-shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.workflow-type-option {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
}

.workflow-type-option:hover {
    background: var(--admin-bg);
}

/* Workflow mode toggle in service header */
.workflow-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.workflow-mode-toggle:hover {
    border-color: var(--admin-primary);
}

.workflow-mode-toggle.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.workflow-mode-toggle input {
    margin: 0;
}

/* Outcome Variables Container */
.outcomes-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.outcome-variable-card {
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    background: var(--admin-bg);
    overflow: hidden;
}

.outcome-card-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--admin-border);
}

.outcome-card-header .outcome-var-name {
    flex: 1;
    font-family: monospace;
    font-size: 0.875rem;
}

.outcome-card-body {
    padding: 0.75rem;
}

/* Outcome Options Builder */
.outcome-options-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.outcome-option-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr auto;
    gap: 0.375rem;
    align-items: center;
}

.outcome-option-row .form-input {
    margin: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.outcome-option-row .btn {
    padding: 0.125rem 0.375rem;
    font-size: 0.875rem;
    line-height: 1;
    min-width: auto;
}

.outcome-option-row .outcome-option-value {
    font-family: monospace;
}

/* Number config in outcome cards */
.outcome-number-section .form-input {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.outcome-number-section .form-label {
    margin-bottom: 0.125rem;
}

/* Fix checkbox labels in workflow modal */
.outcome-card-body > div > label,
#wf-task-fields label,
#wf-question-fields label {
    width: fit-content;
    white-space: nowrap;
    min-width: max-content;
}

.outcome-card-body .form-group {
    width: 100%;
}

/* Visibility Conditions Builder */
.conditions-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.condition-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto;
    gap: 0.5rem;
    align-items: center;
}

.condition-row .form-input {
    margin: 0;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
}

.condition-row .condition-operator {
    width: auto;
    min-width: 70px;
}

.condition-value-container {
    min-width: 0;
}

.condition-value-container .form-input {
    width: 100%;
}

.condition-row > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1;
}

/* Dark mode fixes for workflow builder */
@media (prefers-color-scheme: dark) {
    .outcome-variable-card {
        background: var(--admin-card-bg);
        border-color: var(--admin-border);
    }

    .outcome-card-header {
        background: rgba(255, 255, 255, 0.05);
        border-color: var(--admin-border);
    }

    .outcome-card-body {
        background: var(--admin-card-bg);
    }

    .condition-row {
        background: var(--admin-card-bg);
        border-color: var(--admin-border);
    }

    .condition-row .form-input,
    .outcome-option-row .form-input,
    .outcome-card-body .form-input {
        background: var(--admin-bg);
        border-color: var(--admin-border);
        color: var(--admin-text-primary);
    }

    .condition-row .form-input:focus,
    .outcome-option-row .form-input:focus,
    .outcome-card-body .form-input:focus {
        border-color: var(--admin-primary);
    }
}

/* Field Override Indicators */
.field-with-reset {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
}

.field-with-reset .form-input {
    flex: 1;
    min-width: 0;
}

.field-with-reset .form-input.field-overridden {
    border-color: var(--admin-warning, #f59e0b);
    background: rgba(245, 158, 11, 0.05);
}

.field-with-reset .form-input.field-inherited {
    border-color: var(--admin-border);
    background: transparent;
}

.field-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    min-width: 28px;
    padding: 0;
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    background: var(--admin-bg);
    color: var(--admin-text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0.5;
    transition: all 0.15s ease;
}

.field-reset-btn:hover {
    opacity: 1;
    border-color: var(--admin-primary);
    color: var(--admin-primary);
    background: rgba(59, 130, 246, 0.05);
}

.field-reset-btn.has-override {
    opacity: 1;
    border-color: var(--admin-warning, #f59e0b);
    color: var(--admin-warning, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
}

.field-reset-btn.has-override:hover {
    background: rgba(245, 158, 11, 0.2);
}

.field-reset-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    .field-with-reset .form-input.field-overridden {
        background: rgba(245, 158, 11, 0.1);
    }

    .field-reset-btn {
        background: var(--admin-card-bg);
    }

    .field-reset-btn.has-override {
        background: rgba(245, 158, 11, 0.15);
    }
}

/* =============================================================================
   WORK PLAN RENDERER STYLES
   ============================================================================= */

.work-plan-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.work-plan-summary {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.summary-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.summary-stats .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.summary-stats .stat-label {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
    text-transform: uppercase;
}

.summary-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--admin-text-primary);
}

.phase-summary {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.phase-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.phase-badge.phase-check-in {
    background: #dbeafe;
    color: #1e40af;
}

.phase-badge.phase-pre-work {
    background: #fef3c7;
    color: #92400e;
}

/* Phase sections */
.phase-section {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.phase-section h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.phase-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

.phase-check-in-section {
    border-left: 3px solid #3b82f6;
}

.phase-pre-work-section {
    border-left: 3px solid #f59e0b;
}

/* Question cards */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-card {
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.question-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.question-icon {
    font-size: 1.25rem;
}

.question-name {
    font-weight: 500;
    flex: 1;
}

.required-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 0.25rem;
}

.question-description {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: var(--admin-text-secondary);
}

.answer-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.answer-option {
    padding: 0.375rem 0.75rem;
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.answer-option:hover {
    background: var(--admin-primary);
    color: white;
    border-color: var(--admin-primary);
}

/* Task list */
.task-list-section {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.task-list-section h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--admin-bg);
    border-radius: 0.375rem;
}

.task-icon {
    font-size: 1rem;
}

.task-name {
    flex: 1;
}

.task-time {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
}

.optional-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 0.25rem;
}

/* Full tree view */
.full-tree-section {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.full-tree-section summary {
    cursor: pointer;
    font-weight: 500;
    padding: 0.25rem;
}

.tree-container {
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.tree-node {
    margin-left: calc(var(--depth, 0) * 1rem);
    padding: 0.25rem 0;
}

.tree-node.hidden {
    opacity: 0.4;
}

.tree-node-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tree-node-type {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.tree-type-question { background: #dbeafe; color: #1e40af; }
.tree-type-answer { background: #dcfce7; color: #166534; }
.tree-type-service { background: #fef3c7; color: #92400e; }
.tree-type-task { background: #f3e8ff; color: #7c3aed; }

.tree-node-name {
    flex: 1;
}

.visibility-indicator {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
}

.answered-indicator {
    font-size: 0.75rem;
    color: var(--admin-success);
}

/* Error state */
.work-plan-error {
    text-align: center;
    padding: 2rem;
    color: var(--admin-danger);
}

.work-plan-error button {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Dark mode for work plan renderer */
@media (prefers-color-scheme: dark) {
    .phase-badge.phase-check-in {
        background: #1e3a5f;
        color: #93c5fd;
    }
    .phase-badge.phase-pre-work {
        background: #422006;
        color: #fcd34d;
    }
    .required-badge {
        background: #450a0a;
        color: #fca5a5;
    }
    .optional-badge {
        background: #374151;
        color: #9ca3af;
    }
    .tree-type-question { background: #1e3a5f; color: #93c5fd; }
    .tree-type-answer { background: #14532d; color: #86efac; }
    .tree-type-service { background: #422006; color: #fcd34d; }
    .tree-type-task { background: #4c1d95; color: #c4b5fd; }
}
