/* Scenario admin root: vertical layout */
.scenario-admin-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

/* Scrollable list of scenarios (~5 rows) */
.scenario-list-scroll {
    max-height: 220px;     /* tweak to taste; around 5 rows */
    overflow-y: auto;
}

/* Blanket dark-theme for ALL inputs inside scenario admin */
.scenario-admin-root input[type="text"],
.scenario-admin-root input[type="number"],
.scenario-admin-root input[type="url"],
.scenario-admin-root input[type="email"],
.scenario-admin-root textarea,
.scenario-admin-root select {
    background: #0f172a;
    border: 1px solid #475569;
    color: #f1f5f9;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.875rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.scenario-admin-root input[type="text"]:focus,
.scenario-admin-root input[type="number"]:focus,
.scenario-admin-root textarea:focus,
.scenario-admin-root select:focus {
    border-color: #3b82f6;
}
.scenario-admin-root input::placeholder,
.scenario-admin-root textarea::placeholder {
    color: #64748b;
}
.scenario-admin-root input[type="checkbox"] {
    accent-color: #3b82f6;
}

/* Inputs sizing */
.scenario-name-input,
.scenario-desc-input {
    width: 100%;
}

.scenario-json-input {
    width: 100%;
    flex: 1 1 auto;
}

.scenario-form-row {
    margin-bottom: 8px;
}

.scenario-form-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: #9ca3af;
}

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

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

.scenario-detail-header h3 {
    margin: 0;
}

.scenario-detail-actions {
    display: flex;
    gap: 8px;
}

.services-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.services-list {
    flex: 0 0 auto;
    min-width: 0;
}

.services-detail {
    flex: 1 1 auto;
    min-width: 0;
}

.svc-attrs-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.svc-attrs-table th,
.svc-attrs-table td {
    vertical-align: top;
}

.svc-attrs-json-container {
    margin-top: 8px;
}

.scheduled-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
}

.scheduled-list {
    flex: 0 0 auto;
    min-width: 0;
}

.scheduled-detail {
    flex: 1 1 auto;
    min-width: 0;
}

.scenario-detail-section {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* Editor uses full height inside the bottom detail section */
.scenario-editor {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;   /* instead of height: 100% */
    min-height: 0;
}

/* Tab content stretches under the tab header and scrolls */
.scenario-tabs-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* Each tab panel fills the available height inside .scenario-tabs-content */
.scenario-tab-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0; /* needed so children can scroll */
}

/* Raw JSON tab: let the row with the textarea take all remaining space */
.raw-json-row {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.raw-json-row .scenario-json-input {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    resize: none; /* or 'vertical' if you prefer manual resize */
}

.usecase-step-editor {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.step-tabs-header {
    margin-bottom: 8px;
}

.step-tabs-content {
    flex: 1 1 auto;
    min-height: 0;
}

/* --- Generic tab strip styling --- */
.scenario-tabs-header,
.usecase-tabs-header,
.step-tabs-header {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid #334155;
    margin-bottom: 8px;
}

.save-status-dot {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.8rem;
    vertical-align: middle;
}

.save-status-dot.save-status-clean {
    color: #2ecc71; /* green */
}

.save-status-dot.save-status-dirty {
    color: #e74c3c; /* red */
}

.spans-layout {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: flex-start;
}

.spans-list {
    flex: 0 0 40%;
    min-width: 260px;
}

.spans-detail {
    flex: 1 1 auto;
}

.duration-editor {
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 8px;
}
.duration-fields label {
    font-size: 0.9rem;
}

.usecase-flow-host { margin-bottom: 12px; }
.usecase-flow-diagram-header { font-weight: 600; margin: 6px 0; }
.usecase-steps-layout.usecase-steps-layout--no-list {
    display: block; /* overrides any flex layout expectations */
}

.usecase-steps-layout.usecase-steps-layout--no-list .usecase-step-detail {
    width: 100%;
}

.scenario-list-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================================
   Loadgen scenario admin – page layout & components
   ============================================================ */
.loadgen-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: #020617;
    border-bottom: 1px solid #1e293b;
}
.loadgen-header-left { display: flex; align-items: center; gap: 0.75rem; }
.loadgen-back-link {
    font-size: 0.875rem;
    color: #60a5fa;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}
.loadgen-back-link:hover { color: #93c5fd; }
.loadgen-root {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem 0;
}
.loadgen-list-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    padding: 1.25rem;
}
.loadgen-detail-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    padding: 1.25rem;
}
.loadgen-table-th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.loadgen-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #475569;
    background: #475569;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.loadgen-btn:hover { background: #64748b; border-color: #64748b; }
.loadgen-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.loadgen-btn--danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.loadgen-btn--danger:hover { background: #ef4444; border-color: #ef4444; }
.loadgen-btn--success {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
.loadgen-btn--success:hover { background: #10b981; border-color: #10b981; }
.loadgen-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    border: 1px solid;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.loadgen-btn-icon--success {
    background: #059669;
    border-color: #059669;
    color: #fff;
}
.loadgen-btn-icon--success:hover:not(:disabled) { background: #10b981; border-color: #10b981; }
.loadgen-btn-icon--danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}
.loadgen-btn-icon--danger:hover:not(:disabled) { background: #ef4444; border-color: #ef4444; }
.loadgen-btn-icon--secondary {
    background: #475569;
    border-color: #475569;
    color: #e2e8f0;
}
.loadgen-btn-icon--secondary:hover { background: #64748b; border-color: #64748b; }
.loadgen-btn-icon:disabled { opacity: 0.4; cursor: not-allowed; }
.loadgen-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid #475569;
    color: #f1f5f9;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.loadgen-input:focus { border-color: #3b82f6; }
.loadgen-table {
    width: 100%;
    font-size: 0.875rem;
}
.loadgen-table thead tr { border-bottom: 1px solid #334155; }
.loadgen-table tbody tr:nth-child(odd)  { background-color: rgba(255,255,255,0.03) !important; }
.loadgen-table tbody tr:nth-child(even) { background-color: rgba(255,255,255,0.06) !important; }
.loadgen-table tbody tr:hover           { background-color: rgba(255,255,255,0.12) !important; }
.loadgen-table tr.row-selected td       { background: rgba(30, 64, 175, 0.15); }
.loadgen-heading { font-size: 0.875rem; font-weight: 600; color: #e2e8f0; }

/* Loadgen scenario editor – page/layout (same values as admin-* in styles.css, separated for loadgen) */
.loadgen-body {
    background: #0f172a;
    color: #e4e4e4;
    padding: 20px 24px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
}
.loadgen-page-title {
    font-family: var(--display-font);
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}
.loadgen-status-muted { font-size: 0.75rem; color: #94a3b8; }
.loadgen-status { font-size: 0.875rem; color: #94a3b8; }

/* Loadgen scenario editor – save/delete buttons and help (same values as admin-* in styles.css) */
.loadgen-save-button {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #475569;
    background: #475569;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.loadgen-save-button:hover { background: #64748b; border-color: #64748b; }
.loadgen-delete-button {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid #dc2626;
    background: #dc2626;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.loadgen-delete-button:hover { background: #ef4444; border-color: #ef4444; }
.loadgen-help {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
}

/* Checkbox accent in scenario editor */
.scenario-form-row input[type="checkbox"] { accent-color: #3b82f6; }

/* Scenario table action buttons row */
.scenario-action-btns { display: flex; align-items: center; gap: 0.375rem; }