/* ===================================================================
   AI Hub — Shared Styles
   Base layout, toolbar, cards, badges, tags, modals, forms,
   toast notifications, confirm dialog, detail drawer, animations
   =================================================================== */

/* ---------- shared layout ---------- */
.aihub-grid {
    display: grid;
    gap: 16px;
}

/* ---------- summary stats bar ---------- */
.aihub-summary-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.aihub-summary-stat {
    flex: 1;
    min-width: 130px;
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color 0.2s;
}

.aihub-summary-stat:hover {
    border-color: var(--accent-primary);
}

.aihub-summary-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.aihub-summary-stat-icon.blue   { background: rgba(37, 99, 235, 0.1); color: #60a5fa; }
.aihub-summary-stat-icon.green  { background: rgba(16, 185, 129, 0.1); color: #34d399; }
.aihub-summary-stat-icon.yellow { background: rgba(245, 158, 11, 0.1); color: #fbbf24; }
.aihub-summary-stat-icon.red    { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.aihub-summary-stat-icon.purple { background: rgba(139, 92, 246, 0.1); color: #a78bfa; }

.aihub-summary-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
}

.aihub-summary-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ---------- search / filter bar ---------- */
.aihub-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.aihub-search {
    flex: 1;
    min-width: 200px;
    padding: 9px 14px 9px 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.aihub-search:focus {
    border-color: var(--accent-primary);
}

.aihub-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.aihub-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.aihub-filter-btn {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.aihub-filter-btn:hover,
.aihub-filter-btn.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.08);
}

.aihub-add-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: var(--accent-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.aihub-add-btn:hover {
    opacity: 0.88;
}

/* ---------- card base ---------- */
.aihub-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.aihub-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 4px 20px rgba(0, 0, 0, 0.12);
}

.aihub-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.aihub-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.aihub-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    line-height: 1.3;
}

.aihub-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ---------- card action bar ---------- */
.aihub-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.aihub-card-actions .aihub-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.aihub-card-actions .aihub-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--text-muted);
}

.aihub-card-actions .aihub-action-btn.edit:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: rgba(37, 99, 235, 0.06);
}

.aihub-card-actions .aihub-action-btn.toggle-active:hover {
    color: #34d399;
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.06);
}

.aihub-card-actions .aihub-action-btn.toggle-inactive:hover {
    color: #fbbf24;
    border-color: #fbbf24;
    background: rgba(245, 158, 11, 0.06);
}

.aihub-card-actions .aihub-action-btn.delete:hover {
    color: #f87171;
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.06);
}

.aihub-card-actions .aihub-action-btn.duplicate:hover {
    color: #a78bfa;
    border-color: #a78bfa;
    background: rgba(139, 92, 246, 0.06);
}

.aihub-card-actions .aihub-action-btn.run:hover {
    color: #34d399;
    border-color: #34d399;
    background: rgba(16, 185, 129, 0.06);
}

.aihub-card-actions .aihub-action-btn[disabled],
.aihub-card-actions .aihub-action-btn[disabled]:hover {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--text-muted);
    border-color: var(--border);
    background: transparent;
}

/* ---------- badges ---------- */
.aihub-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.aihub-badge-active,
.aihub-badge-online {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.aihub-badge-draft,
.aihub-badge-staging,
.aihub-badge-paused {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.aihub-badge-disabled,
.aihub-badge-offline,
.aihub-badge-error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.aihub-badge-maintenance,
.aihub-badge-approval {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
}

.aihub-badge-dev {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.aihub-badge-production {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

/* ---------- pills / tags ---------- */
.aihub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.aihub-tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    background: var(--bg-hover);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* ---------- meta row ---------- */
.aihub-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.aihub-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.aihub-meta-item i {
    font-size: 11px;
    opacity: 0.7;
}

/* ---------- progress bar ---------- */
.aihub-progress-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--bg-hover);
    overflow: hidden;
    flex: 1;
    min-width: 60px;
}

.aihub-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.aihub-progress-fill.green  { background: #34d399; }
.aihub-progress-fill.yellow { background: #fbbf24; }
.aihub-progress-fill.red    { background: #f87171; }

/* ---------- empty state ---------- */
.aihub-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.aihub-empty i {
    font-size: 40px;
    opacity: 0.2;
}

/* ---------- sub-tab navigation ---------- */
.aihub-subtab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.aihub-subtab {
    padding: 8px 18px;
    border-radius: 6px 6px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aihub-subtab:hover {
    color: var(--text-main);
    background: var(--bg-hover);
}

.aihub-subtab.active {
    color: var(--accent-primary);
    background: var(--bg-sidebar);
    border-color: var(--border-color);
    border-bottom-color: var(--bg-sidebar);
}

.aihub-subtab-content {
    display: none;
}

.aihub-subtab-content.active {
    display: block;
}

/* ---------- run history table ---------- */
.aihub-run-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.aihub-run-table th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--bg-sidebar);
}

.aihub-run-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-main);
    vertical-align: top;
}

.aihub-run-table tr:hover td {
    background: var(--bg-hover);
}

.aihub-run-row td {
    cursor: pointer;
}

.aihub-run-detail {
    display: none;
    background: rgba(0,0,0,0.2);
}

.aihub-run-detail.open {
    display: table-row;
}

.aihub-run-detail td {
    padding: 12px 16px;
    cursor: default;
}

.aihub-run-detail pre {
    margin: 0;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-muted);
    max-height: 180px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
}

/* ---------- template cards ---------- */
.aihub-tpl-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}

.aihub-tpl-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 4px 20px rgba(0,0,0,0.12);
}

.aihub-tpl-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent-primary);
    flex-shrink: 0;
}

/* ---------- health status cards ---------- */
.aihub-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.aihub-health-card {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.aihub-health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.aihub-health-dot.connected { background: #34d399; box-shadow: 0 0 6px #34d39966; }
.aihub-health-dot.error     { background: #f87171; box-shadow: 0 0 6px #f8717166; }
.aihub-health-dot.untested  { background: #fbbf24; box-shadow: 0 0 6px #fbbf2466; }

/* ========== EXTERNAL MCP TOOL CHIPS ========== */
.aihub-ext-tool-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.aihub-ext-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--bg-surface, #1e2a3a);
    border: 1px solid var(--border, #334155);
    border-radius: 12px;
    font-size: 10px;
    color: var(--text-muted, #94a3b8);
    cursor: default;
    transition: border-color .15s, color .15s;
}
.aihub-ext-tool-chip:hover {
    border-color: #8b5cf6;
    color: #c4b5fd;
}

/* ========== MODAL / DRAWER ========== */
.aihub-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aihub-fadeIn 0.2s ease;
}

.aihub-modal {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 600px;
    max-width: 94vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: aihub-slideUp 0.25s ease;
}

.aihub-modal.wide {
    width: 720px;
}

.aihub-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aihub-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aihub-modal-header h3 i {
    font-size: 18px;
    color: var(--accent-primary);
}

.aihub-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.aihub-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.aihub-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.aihub-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------- form controls ---------- */
.aihub-form-group {
    margin-bottom: 18px;
}

.aihub-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.aihub-form-group label .required {
    color: #f87171;
    margin-left: 2px;
}

.aihub-input,
.aihub-select,
.aihub-textarea {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.aihub-input:focus,
.aihub-select:focus,
.aihub-textarea:focus {
    border-color: var(--accent-primary);
}

.aihub-textarea {
    min-height: 70px;
    resize: vertical;
}

.aihub-select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.aihub-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.aihub-form-row .aihub-form-group {
    margin-bottom: 0;
}

/* multi-tag input */
.aihub-tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    min-height: 40px;
    cursor: text;
    transition: border-color 0.2s;
}

.aihub-tag-input-wrap:focus-within {
    border-color: var(--accent-primary);
}

.aihub-tag-input-wrap .aihub-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.aihub-tag-input-wrap .aihub-tag-pill .remove-tag {
    cursor: pointer;
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

.aihub-tag-input-wrap .remove-tag:hover {
    opacity: 1;
}

.aihub-tag-input-wrap input {
    border: none;
    background: transparent;
    color: var(--text-main);
    font-size: 12px;
    outline: none;
    flex: 1;
    min-width: 80px;
    padding: 0;
}

.aihub-tag-input-wrap input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* ---------- checkbox chips ---------- */
.aihub-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aihub-chip {
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.aihub-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.aihub-chip.selected {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 500;
}

/* ---------- buttons ---------- */
.aihub-btn {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    white-space: nowrap;
}

.aihub-btn-primary {
    background: var(--accent-primary);
    color: #fff;
}

.aihub-btn-primary:hover {
    opacity: 0.88;
}

.aihub-btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.aihub-btn-outline:hover {
    background: var(--bg-hover);
}

.aihub-btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.aihub-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.aihub-btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.aihub-btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
}

/* ---------- toast notification ---------- */
.aihub-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.aihub-toast {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-main);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    animation: aihub-slideIn 0.3s ease;
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
}

.aihub-toast.success { border-left: 3px solid #34d399; }
.aihub-toast.error   { border-left: 3px solid #f87171; }
.aihub-toast.warning { border-left: 3px solid #fbbf24; }
.aihub-toast.info    { border-left: 3px solid #60a5fa; }

.aihub-toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.aihub-toast.success .aihub-toast-icon { color: #34d399; }
.aihub-toast.error   .aihub-toast-icon { color: #f87171; }
.aihub-toast.warning .aihub-toast-icon { color: #fbbf24; }
.aihub-toast.info    .aihub-toast-icon { color: #60a5fa; }

.aihub-toast-exit {
    animation: aihub-slideOut 0.25s ease forwards;
}

/* ---------- confirm dialog ---------- */
.aihub-confirm-body {
    text-align: center;
    padding: 20px 0;
}

.aihub-confirm-body .confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}

.aihub-confirm-body .confirm-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

.aihub-confirm-body .confirm-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.aihub-confirm-body h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 8px;
}

.aihub-confirm-body p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---------- detail drawer ---------- */
.aihub-detail-section {
    margin-bottom: 20px;
}

.aihub-detail-section h5 {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.aihub-detail-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
}

.aihub-detail-row:last-child {
    border-bottom: none;
}

.aihub-detail-label {
    width: 140px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 500;
}

.aihub-detail-value {
    color: var(--text-main);
    flex: 1;
}

/* ---------- output / log viewer ---------- */
.aihub-output-log {
    background: #0d0d0d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #a1a1aa;
    max-height: 180px;
    overflow-y: auto;
    line-height: 1.7;
    white-space: pre-wrap;
}

.aihub-output-log .log-time    { color: #6b7280; }
.aihub-output-log .log-success { color: #34d399; }
.aihub-output-log .log-error   { color: #f87171; }
.aihub-output-log .log-info    { color: #60a5fa; }

/* ---------- animations ---------- */
@keyframes aihub-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes aihub-slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aihub-slideIn {
    from { opacity: 0; transform: translateX(80px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes aihub-slideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(80px); }
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
    .aihub-grid {
        grid-template-columns: 1fr !important;
    }

    .aihub-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .aihub-stats-row {
        grid-template-columns: 1fr;
    }

    .aihub-modal {
        width: 98vw;
        max-height: 95vh;
    }

    .aihub-form-row {
        grid-template-columns: 1fr;
    }

    .aihub-summary-bar {
        flex-direction: column;
    }

    .aihub-card-actions {
        flex-wrap: wrap;
    }
}

/* ---------- Phase 7: Step-log execution timeline ---------- */
.wf-step-clickable {
    cursor: pointer;
}
.wf-step-clickable:hover td {
    background: var(--bg-hover, rgba(255,255,255,0.04));
}
.wf-step-detail-body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 8px 0 4px;
}
.wf-step-detail-section {
    flex: 1;
    min-width: 200px;
}
.wf-step-detail-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.wf-step-detail-pre {
    margin: 0;
    padding: 8px 10px;
    background: var(--bg-input, #1a1a2e);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 10px;
    color: var(--text-primary, #e2e8f0);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 260px;
    overflow-y: auto;
}
.wf-step-detail-error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
