/* =============================================
   Workflow Module Styles
   Extends existing Site.css classes
   =============================================

/* ---- TipTap rich text editor ---- */
.wf-editor-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    border: 1px solid #d0d7e3;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 6px 8px;
    background: #f9fbff;
    max-width: 820px;
    margin: 0 auto;
}

.wf-tb-btn {
    border: none;
    background: transparent;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #3f536c;
    line-height: 1;
    font-size: 0.875rem;
}

.wf-tb-btn:hover {
    background: #e8edf7;
}

.wf-tb-btn.is-active {
    background: #dce7f7;
    color: #1e60c8;
}

.wf-tb-sep {
    display: inline-block;
    width: 1px;
    height: 18px;
    background: #d0d7e3;
    margin: 0 4px;
    vertical-align: middle;
}

.wf-editor-content {
    border: 1px solid #d0d7e3;
    border-radius: 0 0 10px 10px;
    min-height: 220px;
    max-width: 820px;
    margin: 0 auto;
    padding: 12px 14px;
    background: #fff;
    cursor: text;
}

.wf-editor-content:focus-within {
    border-color: #5b8fd9;
    box-shadow: 0 0 0 3px rgba(91, 143, 217, 0.15);
}

.wf-editor-content .ProseMirror {
    outline: none;
    min-height: 190px;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333333;
    line-height: 1.6;
}

.wf-editor-content .ProseMirror p {
    margin: 0 0 8px 0;
}

.wf-editor-content .ProseMirror p:last-child {
    margin-bottom: 0;
}

.wf-editor-content .ProseMirror a {
    color: #1a73e8;
}

.wf-editor-content .ProseMirror img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.wf-editor-content .ProseMirror img.ProseMirror-selectednode {
    outline: 2px solid #5b8fd9;
    outline-offset: 2px;
}

/* ---- Image toolbar (shown when image is selected) ---- */
.wf-img-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    border: 1px solid #d0d7e3;
    border-top: none;
    border-bottom: none;
    padding: 4px 8px;
    background: #f0f4ff;
    max-width: 820px;
    margin: 0 auto;
    font-size: 0.8rem;
}

.wf-img-toolbar .wf-img-label {
    font-size: 0.75rem;
    color: #5a6a7e;
    font-weight: 600;
}

.wf-img-toolbar .wf-img-opt {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.wf-img-toolbar .wf-img-opt:hover {
    background: #e8edf7;
}

.wf-img-toolbar .wf-img-opt.is-active {
    background: #dce7f7;
    color: #1e60c8;
}

.wf-editor-content .ProseMirror blockquote {
    margin: 0 0 8px 16px;
    padding-left: 12px;
    border-left: 3px solid #ccc;
    color: #666;
}

.wf-editor-content .ProseMirror ul,
.wf-editor-content .ProseMirror ol {
    margin: 0 0 8px 0;
    padding-left: 24px;
}

.wf-var-menu {
    min-width: 220px;
}
/* ---- end TipTap editor ---- */

/* Layout */
.wf-container {
    --wf-font-scale: 0.8;
    --wf-surface: #ffffff;
    --wf-surface-soft: #f9fbff;
    --wf-border: #d9e2ef;
    --wf-text: #1f2a37;
    --wf-muted: #66758b;
    --wf-shadow-sm: 0 2px 10px rgba(18, 43, 70, 0.06);
    --wf-shadow-md: 0 10px 28px rgba(18, 43, 70, 0.12);
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 22px;
    color: var(--wf-text);
}

/* Shared page background for all workflow Razor views */
#main {
    background: linear-gradient(180deg, #f9fbff 0%, #f3f8ff 100%);
}

body {
    overflow-x: hidden;
}

/* Typography baseline for workflow module */
.wf-container,
.wf-container .btn,
.wf-container .form-control,
.wf-container .form-select,
.wf-container .table,
.wf-container .badge,
.wf-container .alert {
    font-family: var(--bs-body-font-family), sans-serif;
    font-size: calc(var(--bs-body-font-size, 1rem) * var(--wf-font-scale));
    line-height: var(--bs-body-line-height, 1.5);
}

.wf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--wf-border);
    padding-bottom: 12px;
}

.wf-container h2,
.wf-container .h4,
.wf-container .h5 {
    color: #24364a;
    font-weight: 650;
}

.wf-container h2,
.wf-container .h4 {
    font-size: calc(1.5rem * var(--wf-font-scale));
}

.wf-container .h5 {
    font-size: calc(1.25rem * var(--wf-font-scale));
}

/* Bootstrap controls inside workflow forms need hard width override
   because legacy Site.css applies narrow input widths globally. */
.wf-container .form-control,
.wf-container .form-select {
    width: 100% !important;
    box-sizing: border-box;
    margin: 0 !important;
    border-radius: 10px;
    border-color: #c8d4e3;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.wf-container .form-control:focus,
.wf-container .form-select:focus {
    border-color: #5b8fd9;
    box-shadow: 0 0 0 0.2rem rgba(46, 108, 197, 0.15);
}

.wf-container .form-label {
    color: #3f536c;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Prevent legacy link styles from underlining Bootstrap button links */
.wf-container .btn,
.wf-container .btn:hover,
.wf-container .btn:focus {
    text-decoration: none !important;
}

.wf-container .btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.wf-container .btn-sm {
    padding: 0.25rem 0.52rem;
}

.wf-container .btn-primary {
    box-shadow: 0 3px 7px rgba(13, 110, 253, 0.24);
}

.wf-container .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 9px rgba(13, 110, 253, 0.3);
}

/* Yellow glow on save/submit buttons — only shown when form has unsaved changes */
.wf-container button[type="submit"].btn-primary.wf-dirty {
    box-shadow: 0 0 10px #ffd000;
    transition: 0.2s ease;
}

.wf-container button[type="submit"].btn-primary.wf-dirty:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 6px #ffd000,
        0 0 16px #ffd000,
        0 0 28px #ffea00;
}

.wf-container .btn-secondary {
    background: linear-gradient(180deg, #7c8da1 0%, #6d7f95 100%);
    border-color: #6b7d92;
}

.wf-container .btn-secondary:hover,
.wf-container .btn-danger:hover {
    transform: translateY(-1px);
    filter: brightness(0.96);
}

/* Prevent legacy a:visited color from changing Bootstrap button text */
.wf-container a.btn-primary:visited,
.wf-container a.btn-secondary:visited,
.wf-container a.btn-success:visited,
.wf-container a.btn-danger:visited {
    color: #fff !important;
}

/* Keep anchor-button text color consistent in all states */
.wf-container a.btn-primary,
.wf-container a.btn-primary:visited,
.wf-container a.btn-primary:hover,
.wf-container a.btn-primary:focus,
.wf-container a.btn-primary:active,
.wf-container a.btn-secondary,
.wf-container a.btn-secondary:visited,
.wf-container a.btn-secondary:hover,
.wf-container a.btn-secondary:focus,
.wf-container a.btn-secondary:active,
.wf-container a.btn-success,
.wf-container a.btn-success:visited,
.wf-container a.btn-danger,
.wf-container a.btn-danger:visited {
    color: #fff !important;
}

.wf-container .table {
    border-color: var(--wf-border);
    background: var(--wf-surface);
}

.wf-container .table thead th {
    border-bottom-width: 1px;
    border-color: var(--wf-border);
    background: #f4f8fd;
    color: #4a5f79;
    font-weight: 650;
}

.wf-container .table tbody tr {
    transition: background-color 0.18s ease;
}

.wf-container .table-hover tbody tr:hover {
    background-color: #f7fbff;
}

.wf-container .badge {
    font-weight: 600;
}

.wf-container .alert {
    border-radius: 12px;
    border-width: 1px;
}

.wf-status-alert {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-color: #f0d38a;
    background: linear-gradient(180deg, #fff9e8 0%, #fff4d6 100%);
    color: #6f5614;
    box-shadow: var(--wf-shadow-sm);
}

.wf-status-alert-title {
    font-weight: 700;
}

/* Action designer */
.wf-actions-list {
    margin: 15px 0;
}

.wf-action-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
    position: relative;
}

.wf-action-card.wf-action-nested {
    margin-left: 30px;
    border-left: 3px solid #4a90d9;
}

.wf-action-card .wf-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.wf-action-card .wf-action-header .wf-action-type {
    font-weight: bold;
    font-size: calc(12px * var(--wf-font-scale));
    text-transform: uppercase;
    color: #666;
}

.wf-action-card .wf-action-remove {
    color: #d9534f;
    cursor: pointer;
    font-size: calc(14px * var(--wf-font-scale));
    border: none;
    background: none;
    padding: 0 4px;
}

.wf-action-fields {
    display: none;
}

.wf-action-fields.wf-visible {
    display: block;
}

/* Task type specific */
.wf-task-fields,
.wf-email-fields,
.wf-survey-fields {
    display: none;
}

/* Workflow instance timeline */
.wf-timeline {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.wf-timeline-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--wf-border);
    border-left: 4px solid #d7e0ee;
    border-radius: 10px;
    background: var(--wf-surface);
    position: relative;
    box-shadow: var(--wf-shadow-sm);
}

.wf-timeline-item.wf-status-completed {
    border-left-color: #5cb85c;
}

.wf-timeline-item.wf-status-active {
    border-left-color: #f0ad4e;
}

.wf-timeline-item.wf-status-scheduled {
    border-left-color: #5bc0de;
}

.wf-timeline-item .wf-timeline-title {
    font-weight: bold;
    font-size: calc(1rem * var(--wf-font-scale));
}

.wf-timeline-item .wf-timeline-meta {
    font-size: calc(0.875rem * var(--wf-font-scale));
    color: var(--wf-muted);
    margin-top: 3px;
}

/* Task cards */
.wf-task-card {
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--wf-surface);
    box-shadow: var(--wf-shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.wf-task-card:hover {
    transform: translateY(-1px);
    border-color: #c8d8ec;
    box-shadow: var(--wf-shadow-md);
}

.wf-task-card .wf-task-title {
    font-weight: bold;
    font-size: calc(1rem * var(--wf-font-scale));
    margin-bottom: 5px;
}

.wf-task-card .wf-task-meta {
    font-size: calc(0.875rem * var(--wf-font-scale));
    color: var(--wf-muted);
}

.wf-task-card .wf-task-description {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid #e6edf6;
    font-size: calc(0.9375rem * var(--wf-font-scale));
    line-height: 1.5;
}

.wf-task-card .wf-task-actions {
    margin-top: 10px;
    text-align: right;
}

/* Overdue task row */
.wf-row-overdue {
    background-color: #fff5f5 !important;
}

.wf-row-overdue td:first-child {
    border-left: 3px solid #cf3347;
}

/* Task due date warning */
.wf-overdue {
    color: #cf3347;
    font-weight: bold;
}

.wf-task-card-overdue {
    border-left: 4px solid #cf3347;
    background-color: #fff5f5;
}


/* Survey */
.wf-survey-section {
    margin-bottom: 20px;
}

.wf-survey-field {
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #dfe7f2;
    border-radius: 10px;
    background: #fbfdff;
}

.wf-survey-field label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.wf-survey-field .wf-required {
    color: #d9534f;
}

.wf-survey-field .wf-survey-explanation {
    font-weight: normal;
    color: #555;
    margin-top: -2px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.wf-survey-separator {
    margin-bottom: 15px;
    padding: 10px 0 4px;
    border-top: 2px solid #dee2e6;
}

.wf-survey-separator-label {
    font-weight: bold;
    font-size: 1.05em;
    color: #1a2234;
}

.wf-survey-separator .wf-survey-explanation {
    font-weight: normal;
    color: #555;
    margin-top: 4px;
    white-space: pre-wrap;
}

.wf-survey-field .wf-rating-group {
    display: flex;
    gap: 8px;
}

.wf-survey-field .wf-rating-group label {
    font-weight: normal;
    cursor: pointer;
}

/* Multiple choice grid */
.sv-grid-table { border-collapse: separate; border-spacing: 0; }
.sv-grid-table thead th {
    background: #f0f4fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    padding: 8px 14px;
    white-space: nowrap;
}
.sv-grid-table tbody td:first-child {
    font-weight: 500;
    padding: 10px 14px;
    min-width: 120px;
}
.sv-grid-table tbody td { padding: 6px 10px; vertical-align: middle; }
.sv-grid-table tbody tr:nth-child(odd) td { background: #f7f9fc; }
.sv-grid-table tbody tr:nth-child(even) td { background: #ffffff; }
.sv-grid-table tbody td:not(:first-child) { cursor: pointer; transition: background 0.12s; }
.sv-grid-table tbody tr:hover td:not(:first-child) { background: #e8f0fe; }
.sv-grid-radio {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #3b6fd4;
    display: block;
    margin: 0 auto;
}
.sv-grid-row-invalid > td { background-color: #fff3f3 !important; }
.sv-grid-row-invalid > td:first-child { border-left: 3px solid #dc3545; }

/* Survey photo upload */
.sv-photo-upload {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.sv-photo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #d0d7e3;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-shrink: 0;
}

.sv-photo-img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    object-position: center 20%;
}

.sv-photo-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
}

/* Survey builder */
.wf-field-card {
    border: 1px solid #dce6f3;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #f9fcff;
    box-shadow: var(--wf-shadow-sm);
}

.wf-field-card .wf-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wf-options-list {
    margin-top: 8px;
    padding-left: 20px;
}

.wf-options-list .wf-option-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 4px;
}

/* Tabs for navigation */
.wf-tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}

.wf-tabs a {
    padding: 8px 16px;
    text-decoration: none;
    color: #666;
    font-size: calc(13px * var(--wf-font-scale));
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.wf-tabs a:hover {
    color: #333;
}

.wf-tabs a.wf-active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
    font-weight: bold;
}

/* Assignee picker */
.wf-assignee-list {
    margin-top: 5px;
}

.wf-assignee-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e8e8e8;
    border-radius: 3px;
    font-size: calc(11px * var(--wf-font-scale));
    margin: 2px 4px 2px 0;
}

.wf-assignee-tag .wf-remove-assignee {
    cursor: pointer;
    margin-left: 4px;
    color: #999;
}

/* Survey results */
.wf-results-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.wf-results-stat {
    text-align: center;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f8fbff 0%, #f2f7fe 100%);
    border-radius: 12px;
    border: 1px solid #dfebfa;
    box-shadow: var(--wf-shadow-sm);
}

.wf-results-stat .wf-stat-value {
    font-size: calc(24px * var(--wf-font-scale));
    font-weight: bold;
    color: #333;
}

.wf-results-stat .wf-stat-label {
    font-size: calc(0.875rem * var(--wf-font-scale));
    color: #888;
    margin-top: 3px;
}

.wf-rating-bar {
    display: inline-block;
    height: 8px;
    background: #4a90d9;
    border-radius: 4px;
}

.wf-rating-bar-bg {
    display: inline-block;
    width: 100px;
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    position: relative;
}

/* ---- Survey results question summary ---- */
.wf-question-card {
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
    background: var(--wf-surface);
    box-shadow: var(--wf-shadow-sm);
}

.wf-question-card h4 {
    font-size: calc(1rem * var(--wf-font-scale));
    font-weight: 600;
    margin-bottom: 4px;
}

.wf-question-type-badge {
    display: inline-block;
    font-size: calc(0.75rem * var(--wf-font-scale));
    color: var(--wf-muted);
    margin-bottom: 10px;
}

.wf-question-response-count {
    font-size: calc(0.8rem * var(--wf-font-scale));
    color: var(--wf-muted);
    margin-bottom: 10px;
}

.wf-chart-container {
    max-width: 500px;
    margin-top: 8px;
}

.wf-latest-answers {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wf-latest-answers li {
    padding: 8px 12px;
    border-bottom: 1px solid #eef2f8;
    font-size: calc(0.9rem * var(--wf-font-scale));
    line-height: 1.5;
}

.wf-latest-answers li:last-child {
    border-bottom: none;
}

.wf-photo-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.wf-photo-gallery img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}

/* ---- Compact summary cards ---- */
.wf-actions-compact {
    position: relative;
    margin: 15px 0;
    overflow: visible;
}

.wf-connector-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.wf-summary-card {
    position: relative;
    z-index: 1;
    overflow: visible;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid #d8e2ef;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #fff;
    box-shadow: var(--wf-shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.wf-summary-card:hover {
    transform: translateY(-1px);
    border-color: #bfd1e9;
    box-shadow: var(--wf-shadow-md);
    background: #fff;
    z-index: 20;
}

.wf-summary-card:focus-within {
    z-index: 30;
}

.wf-summary-children {
    margin-left: 36px;
    overflow: visible;
}

.wf-summary-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(14px * var(--wf-font-scale));
    flex-shrink: 0;
    font-family: "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

.wf-summary-icon .bi {
    font-size: calc(1rem * var(--wf-font-scale));
    line-height: 1;
}

.wf-icon-task {
    background: #c9f7d5;
    color: #0f6b2f;
}

.wf-icon-email {
    background: #c7ebff;
    color: #0a5c89;
}

.wf-icon-survey {
    background: #ffe0ad;
    color: #8a4b00;
}

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

.wf-summary-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
    font-size: calc(1rem * var(--wf-font-scale));
    color: #333;
}

.wf-summary-meta {
    font-size: calc(0.875rem * var(--wf-font-scale));
    color: var(--wf-muted);
    margin-top: 2px;
}

.wf-summary-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

/* ---- Dropdown menu ---- */
.wf-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.wf-dropdown.wf-open {
    z-index: 40;
}

.wf-dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    border: 1px solid #d6e2f0;
    border-radius: 10px;
    box-shadow: var(--wf-shadow-md);
    min-width: 132px;
    padding: 6px;
    z-index: 4000;
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.wf-dropdown.wf-open .wf-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.wf-dropdown-menu a,
.wf-dropdown-menu button {
    display: block;
    width: 100%;
    padding: 7px 10px;
    font-size: calc(0.875rem * var(--wf-font-scale));
    text-align: left;
    text-decoration: none;
    color: #333;
    background: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.wf-dropdown-menu a:hover,
.wf-dropdown-menu button:hover {
    background: #f0f6ff;
}

.wf-dropdown-item-danger {
    color: #d9534f !important;
}

.wf-dropdown-item-danger:hover {
    background: #fdeced !important;
}

/* ---- Survey Editor (Edit page) ---- */
.sv-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.sv-page-header h2 {
    margin-bottom: 2px;
    font-size: 1.35rem;
}

.sv-subtitle {
    font-size: 0.8rem;
    color: var(--wf-muted);
}

/* Tabs */
.sv-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 16px;
    gap: 0;
}

.sv-tab {
    padding: 9px 20px;
    text-decoration: none !important;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sv-tab:hover {
    color: #334155;
}

.sv-tab.sv-tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

.sv-tab .bi-check-circle-fill {
    font-size: 0.78rem;
}

/* Section card */
.sv-section-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--wf-shadow-sm);
}

.sv-section-header {
    margin-bottom: 8px;
}

.sv-section-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sv-section-emoji {
    font-size: 1.15em;
}

.sv-section-name {
    font-weight: 650;
    font-size: 0.95rem;
    color: #1e293b;
}

.sv-section-desc {
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Field icon backgrounds (matching wf-icon-* pattern) */
.sv-icon-text {
    background: #c7ebff;
    color: #0a5c89;
}

.sv-icon-rating {
    background: #ffe0ad;
    color: #8a4b00;
}

.sv-icon-select {
    background: #c9f7d5;
    color: #0f6b2f;
}

/* Required asterisk in field title */
.sv-required-mark {
    color: #dc2626;
    font-weight: 700;
}

/* Drag handle inside summary card */
.wf-summary-card .sv-drag-handle {
    cursor: grab;
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

.wf-summary-card .sv-drag-handle:hover {
    color: #94a3b8;
}

/* Field editor (expanded below card) */
.sv-field-editor {
    padding: 14px 18px;
    margin-bottom: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

/* Pull editor flush against its card above */
.sv-field-item .wf-summary-card + .sv-field-editor {
    margin-top: -8px;
}

/* Options list inside editor */
.sv-options-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sv-option-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sv-option-row .form-control {
    flex: 1;
}

.sv-option-input-wrap {
    flex: 1;
}

.sv-option-row .btn {
    margin-top: 1px;
}

@media (max-width: 767.98px) {
    .wf-container {
        padding: 14px 12px;
    }

    .wf-summary-children {
        margin-left: 16px;
        padding-left: 10px;
    }

    .wf-results-summary {
        flex-wrap: wrap;
        gap: 12px;
    }

    .wf-task-card .wf-task-actions {
        text-align: left;
    }

    .wf-chart-container {
        max-width: 100%;
    }

    .sv-tabs {
        gap: 0;
    }

    .sv-tab {
        padding: 8px 14px;
        font-size: calc(0.82rem * var(--wf-font-scale));
    }

    .sv-field-label {
        max-width: 180px;
    }
}

/* Stage action card */
.wf-stage-container {
    border: 2px solid #28a745;
    border-radius: 8px;
    background: #f0fff4;
    padding: 8px 12px 12px 12px;
    margin-bottom: 12px;
}

.wf-icon-stage {
    background: #28a745;
    color: #fff;
}

/* Separator between regular and post-stage children */
.wf-stage-separator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 8px 0;
    color: #28a745;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wf-stage-separator::before,
.wf-stage-separator::after {
    content: '';
    flex: 1;
    height: 2px;
    background: #28a745;
    border-radius: 1px;
}
