/**
 * EASME Component Styles
 * 
 * Standardized UI components using Tailwind-compatible utility patterns.
 * These classes provide consistent styling for badges, buttons, and form elements
 * while coexisting with the Tailwind CSS framework.
 * 
 * Badge color semantics:
 *   - primary (blue): informational, default
 *   - success (green): ok, active, deployed, connected
 *   - warning (amber): attention needed, stale, pending
 *   - danger (red): error, failed, critical
 *   - neutral (gray): inactive, disabled, muted
 *   - accent (purple): special status (bastion, custom)
 */

/* ============================================================================
   BADGES / TAGS
   ============================================================================ */

/* Base badge - pill-shaped inline element */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 9999px;
    white-space: nowrap;
    vertical-align: middle;
    text-transform: uppercase;
}

/* Badge variants */
.badge-primary {
    background-color: var(--color-info-lt);
    color: var(--color-info);
    border: 1px solid rgba(48,104,160,0.30);
}

.badge-success, .badge-ok {
    background-color: var(--color-success-lt);
    color: var(--color-success);
    border: 1px solid rgba(42,122,74,0.30);
}

.badge-warning, .badge-warn {
    background-color: var(--color-warning-lt);
    color: var(--color-warning);
    border: 1px solid rgba(191,117,24,0.35);
}

.badge-danger, .badge-fail, .badge-error {
    background-color: var(--color-danger-lt);
    color: var(--color-danger);
    border: 1px solid rgba(179,57,40,0.30);
}

.badge-neutral, .badge-muted {
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.badge-info {
    background-color: var(--color-info-lt);
    color: var(--color-info);
    border: 1px solid rgba(48,104,160,0.35);
}

.badge-secondary {
    background-color: var(--bg-muted);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

/* Special badges */
.badge-local {
    background-color: var(--color-success-lt);
    color: var(--color-success);
    border: 1px solid rgba(42,122,74,0.30);
}

.badge-bastion {
    background-color: #f5f3ff;
    color: #5b21b6;
    border: 1px solid #c4b5fd;
}

.badge-scheduler {
    background-color: var(--brand-amber-lt);
    color: var(--brand-amber-dk);
    border: 1px solid rgba(191,117,24,0.35);
}

/* Badge sizes */
.badge-sm {
    padding: 0.0625rem 0.375rem;
    font-size: 0.625rem;
}

.badge-lg {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* Badge with icon */
.badge-icon {
    font-size: 0.875em;
    margin-right: 0.125rem;
}

/* Tag group - horizontal list of badges */
.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.tag-group-vertical {
    flex-direction: column;
    align-items: flex-start;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

/* Base button reset */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary button */
.btn-primary {
    background-color: var(--brand-teal);
    color: var(--text-inverse);
    border-color: var(--brand-teal);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--brand-teal-dk);
    border-color: var(--brand-teal-dk);
}

/* Secondary button (outline) */
.btn-secondary {
    background-color: var(--bg-panel);
    color: var(--text-default);
    border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-subtle);
    border-color: var(--border-strong);
}

/* Success button */
.btn-success {
    background-color: var(--color-success);
    color: var(--text-inverse);
    border-color: var(--color-success);
}

.btn-success:hover:not(:disabled) {
    background-color: #1e5e38;
    border-color: #1e5e38;
}

/* Danger button */
.btn-danger {
    background-color: var(--color-danger);
    color: var(--text-inverse);
    border-color: var(--color-danger);
}

.btn-danger:hover:not(:disabled) {
    background-color: #8c2d1f;
    border-color: #8c2d1f;
}

/* Ghost button (minimal) */
.btn-ghost {
    background-color: transparent;
    color: var(--text-muted);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--bg-subtle);
    color: var(--text-default);
}

/* Link-style button */
.btn-link {
    background-color: transparent;
    color: var(--text-link);
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

.btn-link:hover:not(:disabled) {
    color: var(--text-link-hover);
    text-decoration: underline;
}

/* Button sizes */
.btn-xs {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Icon-only button */
.btn-icon {
    padding: 0.375rem;
    aspect-ratio: 1;
}

.btn-icon.btn-xs {
    padding: 0.125rem;
}

.btn-icon.btn-sm {
    padding: 0.25rem;
}

/* Button group */
.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.btn-group .btn:not(:last-child) {
    border-right-width: 0;
}

/* ============================================================================
   FORM ELEMENTS
   ============================================================================ */

/* Form input base */
.form-input {
    display: block;
    width: 100%;
    padding: 0.08em 0.375em;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-default);
    background-color: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: var(--focus-ring);
}

.form-input:disabled {
    background-color: var(--bg-subtle);
    cursor: not-allowed;
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Form select */
.form-select {
    display: block;
    width: 100%;
    padding: 0.08em 2rem 0.08em 0.375em;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-default);
    background-color: var(--bg-panel);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%235c5650' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    appearance: none;
}

.form-select:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: var(--focus-ring);
}

/* Form checkbox/toggle */
.form-checkbox {
    -webkit-appearance: checkbox;
    appearance: checkbox;
    width: auto;
    height: auto;
    color: var(--brand-teal);
    border: 1px solid var(--border-default);
    border-radius: 0.25rem;
    cursor: pointer;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.form-checkbox:checked {
    background-color: var(--brand-teal);
    border-color: var(--brand-teal);
}

.form-checkbox:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

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

.form-label-required::after {
    content: ' *';
    color: var(--color-danger);
}

/* Form helper text */
.form-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--color-danger);
    margin-top: 0.25rem;
}

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

/* Form row (horizontal layout) */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.form-row > * {
    flex: 1;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Status indicators */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.status-dot-success { background-color: var(--color-success); }
.status-dot-warning { background-color: var(--color-warning); }
.status-dot-danger { background-color: var(--color-danger); }
.status-dot-neutral { background-color: var(--text-muted); }
.status-dot-info { background-color: var(--color-info); }

/* Animated pulse for active status */
.status-dot-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Connection indicator (larger, for tables) */
.conn-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1rem;
    cursor: help;
}

.conn-dot-unknown { color: var(--text-muted); }
.conn-dot-testing { color: var(--color-warning); animation: pulse 0.5s infinite; }
.conn-dot-ok { color: var(--color-success); }
.conn-dot-warn { color: var(--color-warning); }
.conn-dot-error { color: var(--color-danger); }

/* Divider */
.divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 1rem 0;
}

.divider-vertical {
    width: 1px;
    height: auto;
    margin: 0 0.5rem;
}

/* Card (simple container) */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 1rem;
}

.card-header {
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.card-footer {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* ============================================================================
   VISIBILITY & DISPLAY UTILITIES
   ============================================================================ */

/* Hidden by default - use JavaScript to show */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.collapsed {
    display: none;
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

/* Gap utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* Margin utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.col-span-full { grid-column: 1 / -1; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Width utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-20 { width: 5rem; }   /* 80px for port inputs */
.w-32 { width: 8rem; }
.w-48 { width: 12rem; }

/* Text utilities */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }

/* Path display - for long file paths that need to break */
.path-display {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    word-break: break-all;
    overflow-wrap: break-word;
    padding: 0.25rem 0.5rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}

/* ============================================================================
   MODAL OVERLAY
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    background: var(--bg-panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* ============================================================================
   FORM GRID LAYOUTS
   ============================================================================ */

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.form-subsection {
    padding: 0.75rem;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.field-warning {
    color: var(--color-warning);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ============================================================================
   ADDITIONAL LAYOUT UTILITIES
   ============================================================================ */

/* Flex grow */
.flex-1 { flex: 1; }
.flex-auto { flex: auto; }
.flex-none { flex: none; }

/* Additional margin utilities */
.mt-6 { margin-top: 1.5rem; }
.mb-6 { margin-bottom: 1.5rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }

/* Padding utilities */
.p-0 { padding: 0; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }

/* Block display */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }

/* Form actions container */
.form-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* Progress steps for wizard-style forms */
.progress-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.progress-step.active {
    background: var(--color-info-lt);
    color: var(--color-info);
}

.progress-step.complete {
    background: var(--color-success-lt);
    color: var(--color-success);
}

.progress-step.error {
    background: var(--color-danger-lt);
    color: var(--color-danger);
}

.progress-detail {
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* ============================================================================
   MANIFEST DISPLAY (T-VIEW-001)
   Collapsible sections for experiment transparency
   ============================================================================ */

.manifest-section {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
}

.manifest-section summary {
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    background: var(--bg-page);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    user-select: none;
}

.manifest-section summary:hover {
    background: var(--bg-subtle);
}

.manifest-section[open] summary {
    border-bottom: 1px solid var(--border-light);
}

.manifest-section .table {
    margin: 0;
    font-size: 0.875rem;
}

.manifest-section .table td {
    padding: 0.375rem 0.75rem;
    border-bottom: 1px solid var(--bg-subtle);
}

.manifest-section .table tr:last-child td {
    border-bottom: none;
}

.manifest-section .table td:first-child {
    font-weight: 500;
    color: var(--text-secondary);
    width: 40%;
}

.manifest-section code {
    font-size: 0.75rem;
    background: var(--bg-subtle);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
}

/* ============================================================================
   VALIDATION DISPLAY (T-VIEW-003)
   Pre-flight validation results
   ============================================================================ */

.validation-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--bg-subtle);
}

.validation-check:last-child {
    border-bottom: none;
}

.validation-check.passed {
    color: var(--color-success);
}

.validation-check.failed.error {
    color: var(--color-danger);
    background: var(--color-danger-lt);
}

.validation-check.failed.warning {
    color: var(--color-warning);
    background: var(--color-warning-lt);
}

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

.validation-name {
    font-weight: 500;
    min-width: 140px;
}

.validation-message {
    flex: 1;
    font-size: 0.875rem;
}

/* ============================================================================
   CONFIG PREVIEW (T-VIEW-002)
   Configuration preview before execution
   ============================================================================ */

.config-preview {
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.config-preview h6 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-default);
    margin-bottom: 0.5rem;
}

.config-preview .table {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.confirm-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-warning-lt);
    border: 1px solid rgba(191,117,24,0.35);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.confirm-checkbox input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

/* ============================================================================
   IDENTITY VIEW (extracted from views/identity.php)
   ============================================================================ */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item .label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-item .value {
    font-weight: 500;
}

.fingerprint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================================================
   RUNS VIEW (extracted from views/runs.php)
   ============================================================================ */

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

.runs-header-left h3 {
    margin: 0;
}

.runs-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-default);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-default);
}

.pagination span {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* run status badges
   canonical mapping: status → semantic color
     staging   → info (blue)     — packaged, not yet submitted
     queued    → amber           — submitted, waiting in scheduler
     pending   → neutral         — held/deferred
     running   → info (blue)     — active processes on host
     completed → success (green) — all processes exited 0, output verified
     warning   → warning (amber) — ran but with unexpected conditions
     failed    → danger (red)    — exited non-zero or validation failed
     cancelled → warning (amber) — explicitly stopped
     unknown   → muted gray      — status cannot be determined
*/
.status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-staging {
    background: var(--color-info-lt);
    color: var(--color-info);
}

.status-queued {
    background: var(--brand-amber-lt);
    color: var(--brand-amber-dk);
}

.status-pending {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.status-running {
    background: var(--color-info-lt);
    color: var(--color-info);
}

.status-completed {
    background: var(--color-success-lt);
    color: var(--color-success);
}

.status-warning {
    background: var(--color-warning-lt);
    color: var(--color-warning);
}

.status-failed {
    background: var(--color-danger-lt);
    color: var(--color-danger);
}

.status-cancelled {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.status-unknown {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-style: italic;
}

/* empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state h3 {
    margin-bottom: 0.5rem;
}

/* run row hover */
#runs-table table tbody tr {
    transition: background-color 0.15s ease;
}

#runs-table table tbody tr:hover {
    background: var(--bg-subtle);
}

/* ============================================================================
   QUICK RUN COMPONENT (extracted from partials/quick-run.php)
   ============================================================================ */

.quick-run-component {
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
}

.quick-run-header {
    margin-bottom: 1rem;
}

.quick-run-header h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-default);
}

.quick-run-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.quick-run-form .form-group {
    margin-bottom: 1rem;
}

.quick-run-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-default);
}

.quick-run-form select,
.quick-run-form input[type="text"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-default);
}

.quick-run-form .field-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.quick-run-form .field-hint.warn {
    color: var(--color-warning);
}

.quick-run-form .form-inline {
    display: flex;
    align-items: center;
}

.quick-run-form .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.quick-run-form .form-checkbox {
    margin-right: 0.5rem;
    width: auto;
}

.quick-run-form .form-group.hidden {
    display: none;
}

.qr-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.qr-status.loading {
    background: var(--color-info-lt);
    color: var(--color-info);
    border: 1px solid rgba(48,104,160,0.30);
}

.qr-status.success {
    background: var(--color-success-lt);
    color: var(--color-success);
    border: 1px solid rgba(42,122,74,0.30);
}

.qr-status.error {
    background: var(--color-danger-lt);
    color: var(--color-danger);
    border: 1px solid rgba(179,57,40,0.30);
}

/* ============================
   subnav
   ============================ */
.subnav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border, #ddd);
    margin-bottom: 1.5rem;
}

.subnav-item {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--color-text-muted, #666);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.9rem;
    transition: color 0.15s, border-color 0.15s;
}

.subnav-item:hover {
    color: var(--color-text, #333);
    border-bottom-color: var(--color-border, #999);
}

.subnav-item.active {
    color: var(--color-primary, #0066cc);
    border-bottom-color: var(--color-primary, #0066cc);
    font-weight: 500;
}

/* ============================
   stat cards
   ============================ */
.stat-card {
    text-align: center;
    padding: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary, #0066cc);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-text-muted, #666);
    margin-top: 0.25rem;
}

/* ============================================================================
   GUIDED STEPS (breadcrumb trail for multi-step workflows)
   ============================================================================ */

.guided-steps {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9em;
}

.guided-steps a {
    text-decoration: none;
    color: var(--text-muted);
}

.guided-steps a:hover {
    color: var(--text-link);
}

.guided-steps .step-sep {
    color: var(--text-muted);
}

.guided-steps .step-current {
    color: var(--brand-teal);
    font-weight: 500;
}

/* ============================================================================
   HEADING UTILITIES (experiment identity pattern)
   ============================================================================ */

.heading-colon {
    color: var(--text-muted);
}

.heading-subtitle {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ============================================================================
   DETAIL ROW (inline key-value pairs)
   ============================================================================ */

.detail-row {
    display: flex;
    gap: 2rem;
    font-size: 0.9em;
    flex-wrap: wrap;
}

/* ============================================================================
   CARD ACCENTS (left-border emphasis for result panels)
   ============================================================================ */

.card-accent-success {
    border-left: 3px solid var(--color-success);
}

.card-accent-danger {
    border-left: 3px solid var(--color-danger);
}

.card-accent-warning {
    border-left: 3px solid var(--color-warning);
}

/* ============================================================================
   VALIDATION TABLE (pre-flight check results)
   ============================================================================ */

.validation-table {
    width: 100%;
    font-size: 0.85em;
    border-collapse: collapse;
}

.validation-table th {
    text-align: left;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border-default);
}

.validation-table td {
    padding: 0.3rem 0.5rem;
}

.validation-table tr {
    border-bottom: 1px solid var(--border-light);
}

.validation-table tr:last-child {
    border-bottom: none;
}

.validation-table .val-icon {
    width: 2rem;
    text-align: center;
}

/* ============================================================================
   INLINE LIST (compact troubleshooting / detail lists)
   ============================================================================ */

.list-compact {
    font-size: 0.9em;
    margin: 0.25rem 0;
    padding-left: 1.5rem;
}

/* ============================================================================
   HOST SELECTION (system picker for experiment workflow)
   ============================================================================ */

.host-option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.host-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.host-option input[type="radio"] {
    margin-top: 0.3rem;
}

.host-option-body {
    flex: 1;
}

.host-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.host-option-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.host-option-detail {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.host-option-error {
    font-size: 0.85em;
    color: var(--color-danger);
    margin-top: 0.25rem;
}

/* ============================================================================
   FORM ACTIONS BAR (bottom action row with back/submit)
   ============================================================================ */

.form-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

/* ============================================================================
   SSE CONNECTION INDICATOR (T-803)
   Visual feedback for Server-Sent Events connection status
   ============================================================================ */

.sse-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

/* Disconnected: gray, hollow dot */
.sse-disconnected {
    color: var(--text-muted);
    background: var(--bg-subtle);
}

/* Connecting: blue, pulsing */
.sse-connecting {
    color: var(--color-info);
    background: var(--color-info-lt);
    animation: sse-pulse 1s ease-in-out infinite;
}

/* Connected: green, solid */
.sse-connected {
    color: var(--color-success);
    background: var(--color-success-lt);
}

/* Reconnecting: amber, pulsing */
.sse-reconnecting {
    color: var(--color-warning);
    background: var(--color-warning-lt);
    animation: sse-pulse 0.5s ease-in-out infinite;
}

/* Closed: gray */
.sse-closed {
    color: var(--text-muted);
    background: var(--bg-subtle);
}

@keyframes sse-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Inline indicator (for use in toolbars) */
.sse-indicator-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
}

.sse-indicator-inline .sse-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.sse-indicator-inline.sse-disconnected .sse-dot {
    background: var(--text-muted);
}

.sse-indicator-inline.sse-connecting .sse-dot {
    background: var(--color-info);
    animation: sse-pulse 1s ease-in-out infinite;
}

.sse-indicator-inline.sse-connected .sse-dot {
    background: var(--color-success);
}

.sse-indicator-inline.sse-reconnecting .sse-dot {
    background: var(--color-warning);
    animation: sse-pulse 0.5s ease-in-out infinite;
}

.sse-indicator-inline.sse-closed .sse-dot {
    background: var(--text-muted);
}

/* ============================================================================
   FEEDBACK / ERROR MESSAGES (T-804)
   Standardized error, warning, success, and info display
   ============================================================================ */

.feedback {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.feedback-icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.feedback-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feedback-message {
    font-weight: 500;
}

.feedback-details {
    font-size: 0.8125rem;
    opacity: 0.9;
}

.feedback-hint {
    font-size: 0.75rem;
    opacity: 0.8;
    font-style: italic;
}

.feedback-action {
    display: inline;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    color: inherit;
}

.feedback-action:hover {
    opacity: 0.8;
}

.feedback-dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    color: inherit;
    padding: 0;
    margin-left: 0.5rem;
}

.feedback-dismiss:hover {
    opacity: 1;
}

/* Feedback type variants */
.feedback-error {
    background: var(--color-danger-lt);
    color: var(--color-danger);
    border: 1px solid rgba(179,57,40,0.30);
}

.feedback-warning {
    background: var(--color-warning-lt);
    color: var(--color-warning);
    border: 1px solid rgba(191,117,24,0.35);
}

.feedback-success {
    background: var(--color-success-lt);
    color: var(--color-success);
    border: 1px solid rgba(42,122,74,0.30);
}

.feedback-info {
    background: var(--color-info-lt);
    color: var(--color-info);
    border: 1px solid rgba(48,104,160,0.30);
}

/* Toast-style feedback (positioned) */
.feedback-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.feedback-toast {
    animation: feedback-slide-in 0.3s ease-out;
    box-shadow: var(--shadow-lg);
}

@keyframes feedback-slide-in {
    from {
        opacity: 0;
        transform: translateX(1rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feedback-toast.feedback-fade-out {
    animation: feedback-fade-out 0.3s ease-out forwards;
}

@keyframes feedback-fade-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(1rem);
    }
}

/* Inline feedback (for form fields) */
.feedback-inline {
    padding: 0.375rem 0.5rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
    font-size: 0.75rem;
}

.feedback-inline .feedback-icon {
    font-size: 0.875rem;
}

/* Legacy alert compatibility (maps to feedback) */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--color-danger-lt);
    color: var(--color-danger);
    border: 1px solid rgba(179,57,40,0.30);
}

.alert-warning {
    background: var(--color-warning-lt);
    color: var(--color-warning);
    border: 1px solid rgba(191,117,24,0.35);
}

.alert-success {
    background: var(--color-success-lt);
    color: var(--color-success);
    border: 1px solid rgba(42,122,74,0.30);
}

.alert-info {
    background: var(--color-info-lt);
    color: var(--color-info);
    border: 1px solid rgba(48,104,160,0.30);
}
