/* Agents Hub styling.
   PART A (global .hub-*): the ORIGINAL hub chrome — used by the Workload › Tasks
   page, which is intentionally kept exactly as before (NOT tune-agent-re-skinned).
   PART B (scoped under .agents-hub): a verbatim port of tune-agent's component
   CSS, applied ONLY to the AI Center pages (Agents / Knowledge / Skills /
   Learnings), whose containers carry the `.agents-hub` class — so those sections
   match tune-agent while Tasks is untouched and nothing collides with buildmidas's
   global .data-table/.btn/.stat-card. */

/* ─────────────── PART A — original hub chrome (global; Tasks page) ─────────── */
.hub-page { padding: 4px 2px 40px; }
.hub-page-intro { font-size: 13px; color: #6b7280; margin: 0 0 16px; max-width: 720px; }
.hub-section-title { font-size: 14px; font-weight: 600; color: #374151; margin: 0 0 8px; }
.hub-suite-tabs { display: flex; gap: 6px; margin: 0 0 18px; border-bottom: 1px solid #eef0f2; }
.hub-suite-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
    border: none; background: none; color: #6b7280; font-size: 13px; font-weight: 600;
    cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.hub-suite-tab:hover { color: #374151; }
.hub-suite-tab.is-active { color: #1a73e8; border-bottom-color: #1a73e8; }
/* Workload action buttons (New task config + Coordinator) live in the page
   HEADER via #hub-workload-actions (styled inline to mirror the SEO Agents
   page's #userFactoryActions exactly) — no body toolbar. */
.hub-loading { display: flex; align-items: center; justify-content: center; padding: 72px 0; }
.hub-spinner { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(26,115,232,0.25);
    border-top-color: #1a73e8; display: inline-block; animation: spin 0.8s linear infinite; }

/* Workload › Schedules page (global-styled, like the Tasks page). The intro
   paragraph + the All/Enabled/Disabled filter chips. (The AI-Center pages have
   their own .agents-hub .hub-page-intro; this global one covers Workload.) */
.hub-page-intro { color: #6b7280; font-size: 14px; margin: 0 0 16px; max-width: 760px; }
.uf-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; }
.uf-filter-chip { padding: 5px 12px; border: 1px solid #d1d5db; border-radius: 9999px;
    background: #fff; color: #374151; font-size: 12px; font-weight: 600; cursor: pointer; }
.uf-filter-chip:hover { background: #f3f4f6; }
.uf-filter-chip.is-active { background: #1a73e8; border-color: #1a73e8; color: #fff; }

/* Navbar notifications bell + unread badge (flag-gated, revealed with hub nav). */
.notif-bell { position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border: none; background: transparent; color: #5f6368;
    border-radius: 50%; cursor: pointer; }
.notif-bell:hover { background: #f1f3f4; color: #1a73e8; }
.notif-bell .material-symbols-outlined { font-size: 22px; }
.notif-bell-badge { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px;
    padding: 0 4px; border-radius: 9999px; background: #c13515; color: #fff; font-size: 10px;
    font-weight: 700; line-height: 16px; text-align: center; box-sizing: border-box; }

/* Notifications page — list of rows. */
.notif-list { display: flex; flex-direction: column; background: #f6f8fa; border-radius: 12px; overflow: hidden; }
.notif-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer;
    border-bottom: 1px solid #eceff3; background: transparent; transition: background 0.12s; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: #eef1f5; }
.notif-row.is-unread { background: #f3f8ff; }
.notif-row.is-unread .notif-title { font-weight: 700; }
.notif-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 14px; color: #1e293b; }
.notif-body { font-size: 12px; color: #6b7280; margin-top: 2px; word-break: break-word; }
.notif-time { font-size: 11px; color: #9ca3af; flex-shrink: 0; white-space: nowrap; margin-top: 2px; }

/* Knowledge file viewer (ported from tune-agent). The renderers mount under
   #knViewer inside the Knowledge page. */
.kn-pdf { width: 100%; height: 600px; border: 1px solid #e5e7eb; border-radius: 8px; }
.kn-text { background: #f9fafb; padding: 12px; border-radius: 8px; overflow: auto; max-height: 480px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.kn-block { max-height: 480px; overflow: auto; }
.kn-img { max-width: 100%; max-height: 600px; display: block; border: 1px solid #e5e7eb; border-radius: 8px; }
.kn-doc { background: #f1f3f4; border-radius: 8px; padding: 8px; }
.kn-xlsx { overflow: auto; margin-bottom: 8px; }
.kn-xlsx table { border-collapse: collapse; font-size: 13px; background: #fff; }
.kn-xlsx td, .kn-xlsx th { border: 1px solid #e5e7eb; padding: 3px 9px; white-space: nowrap; }
.kn-sheet-name { margin: 10px 0 6px; font-size: 13px; font-weight: 600; color: #334155; }
.kn-pptx { overflow: auto; }
.diff-pre { background: #0f172a; color: #cbd5e1; padding: 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; overflow: auto; }
.kn-block.diff-pre { padding: 12px; }
.kn-code { margin: 0; } .kn-code code { background: transparent; padding: 0; }
.j-key { color: #7dd3fc; } .j-str { color: #86efac; } .j-num { color: #fcd34d; } .j-bool { color: #c4b5fd; }
/* Markdown viewer (subset of tune-agent's report-body). */
.agent-report .report-body { font-size: 13px; line-height: 1.6; color: #334155; }
.agent-report .report-body p { margin: 6px 0; }
.agent-report .report-body code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.agent-report .report-body pre { background: #f1f5f9; padding: 10px; border-radius: 8px; overflow: auto; }
.agent-report .report-body table { border-collapse: collapse; width: 100%; border: 1px solid #e0e0e0; border-radius: 10px; margin: 8px 0; font-size: 13px; }
.agent-report .report-body th, .agent-report .report-body td { border: 1px solid #e0e0e0; padding: 6px 10px; text-align: left; }
.agent-report .report-body th { background: #f1f3f4; font-weight: 600; }
.agent-report .report-body h1, .agent-report .report-body h2, .agent-report .report-body h3 { margin: 12px 0 6px; }

/* ─────────────── PART B — tune-agent port (scoped to AI Center) ────────────── */

/* ── page shell ─────────────────────────────────────────────────────── */
.agents-hub .page-header { margin-bottom: 24px; display: flex; justify-content: space-between;
    align-items: flex-start; flex-wrap: wrap; gap: 12px; }
/* Let the title block (h1 + description) flex-shrink so a long description wraps
   WITHIN it instead of pushing the action buttons onto a new line — keeps Upload /
   New pinned top-right at every width. */
.agents-hub .page-header > div:first-child { flex: 1; min-width: 0; }
.agents-hub .page-header h1 { font-size: 1.8em; color: #1e293b; font-weight: 600;
    display: flex; align-items: center; gap: 10px; margin: 0; }
.agents-hub .page-header h1 .material-symbols-outlined { font-size: 32px; color: #3b82f6; }
.agents-hub .page-description { color: #64748b; font-size: 14px; margin-top: 4px; }
/* Inline links in the page description (e.g. "Customize Agents") — match
   tune-agent's global `a` (blue, no underline). buildmidas has no global a-rule. */
.agents-hub .page-description a { color: #1a73e8; text-decoration: none; cursor: pointer; }
/* Header action area (Upload / New) — mirrors tune-agent; pushed right by the
   .page-header space-between. */
.agents-hub .page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex-shrink: 0; }
/* Empty/loading placeholder + content card — verbatim port of tune-agent's
   .empty and .card so Knowledge/Skills match exactly. */
.agents-hub .empty { color: #9ca3af; padding: 40px 24px; text-align: center; font-style: italic; font-size: 14px; }
.agents-hub .card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); margin-bottom: 16px; }

/* ── buttons (pill) ─────────────────────────────────────────────────── */
.agents-hub .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border: 1px solid transparent; border-radius: 9999px;
    background: #1a73e8; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background 0.15s; text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.agents-hub .btn:hover { background: #1557b0; }
.agents-hub .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.agents-hub .btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.agents-hub .btn-secondary:hover { background: #f3f4f6; border-color: #9ca3af; }
.agents-hub .btn-danger { background: #ef4444; }
.agents-hub .btn-danger:hover { background: #dc2626; }
.agents-hub .btn-sm { padding: 6px 12px; font-size: 12px; }
.agents-hub .btn .material-symbols-outlined { font-size: 18px; }
.agents-hub .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.agents-hub .muted { color: #9ca3af; }

/* ── stat cards ─────────────────────────────────────────────────────── */
.agents-hub .stats-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px; margin-bottom: 24px; }
/* Layout, icon, number and label all come from the global .stat-card family
   (styles.css) so hub pages can never drift from My Dashboard's tiles. */
.agents-hub .stat-card.completed { background: #eaf6ec; }
.agents-hub .stat-card.failed { background: #fdecec; }
.agents-hub .stat-card.in-progress { background: #eef4fe; }
.agents-hub .stat-card.pending { background: #f2effe; }
.agents-hub .stat-card.total { background: #f6f8fa; }
.agents-hub .stat-card.warning { background: #fdf3e3; }

/* ── data tables ────────────────────────────────────────────────────── */
.agents-hub .table-container { background: #fff; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow-x: auto; }
/* Capped-height list tables: header stays fixed, only the tbody scrolls (scrollbar
   sits below the header). thead/tbody rows use the same fixed layout so the columns
   stay aligned. Mirrors tune-agent's .table-scroll. */
.agents-hub .table-container.table-scroll thead,
.agents-hub .table-container.table-scroll tbody { display: block; }
.agents-hub .table-container.table-scroll thead tr,
.agents-hub .table-container.table-scroll tbody tr { display: table; width: 100%; table-layout: fixed; }
.agents-hub .table-container.table-scroll tbody { max-height: 60vh; overflow-y: auto; }

/* Thin, rounded scrollbars across the hub (tables, knowledge viewer, modal
   bodies) — mirrors tune-agent's global scrollbar, scoped to .agents-hub so the
   rest of buildmidas keeps its native scrollbars. */
.agents-hub, .agents-hub * { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.18) transparent; }
.agents-hub *::-webkit-scrollbar { width: 8px; height: 8px; }
.agents-hub *::-webkit-scrollbar-track { background: transparent; }
.agents-hub *::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 8px; }
.agents-hub *::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.32); }
.agents-hub *::-webkit-scrollbar-corner { background: transparent; }

/* Capped-height scroll for the Workload tables/lists (Tasks runs, Schedules,
   Notifications). The header stays put (sticky) while the body scrolls; thin
   scrollbar matches the AI-Center pages. Self-contained — these pages aren't
   wrapped in .agents-hub. */
.hub-scroll-cap { max-height: 60vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.18) transparent; }
.hub-scroll-cap::-webkit-scrollbar { width: 8px; height: 8px; }
.hub-scroll-cap::-webkit-scrollbar-track { background: transparent; }
.hub-scroll-cap::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 8px; }
.hub-scroll-cap::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.32); }
/* Table variant: scroll the <tbody> (not the whole container) so the scrollbar
   starts BELOW the header row instead of running alongside the frozen header.
   thead + each body row use fixed layout at width:100% so columns stay aligned.
   Non-table lists (e.g. notifications) keep the container scroll above. */
.hub-scroll-cap:has(> table) { max-height: none; overflow: visible; }
.hub-scroll-cap > table { display: block; }
.hub-scroll-cap > table > thead { display: table; width: 100%; table-layout: fixed; }
.hub-scroll-cap > table > tbody { display: block; max-height: 56vh; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.18) transparent; }
.hub-scroll-cap > table > tbody > tr { display: table; width: 100%; table-layout: fixed; }
.hub-scroll-cap > table > tbody::-webkit-scrollbar { width: 8px; }
.hub-scroll-cap > table > tbody::-webkit-scrollbar-track { background: transparent; }
.hub-scroll-cap > table > tbody::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 8px; }
/* Knowledge/Skills list tables — reuse the SEO/Advertising .uf-configs-table look.
   .hub-scroll-cap forces table-layout:fixed, so give the columns explicit widths
   and size the round-button icons. */
.agents-hub .uf-config-action .material-symbols-outlined { font-size: 18px; }
.agents-hub .kn-table th:nth-child(1), .agents-hub .kn-table td:nth-child(1) { width: 34%; }
.agents-hub .kn-table th:nth-child(2), .agents-hub .kn-table td:nth-child(2) { width: 12%; }
.agents-hub .kn-table th:nth-child(3), .agents-hub .kn-table td:nth-child(3) { width: 22%; }
.agents-hub .kn-table th:nth-child(4), .agents-hub .kn-table td:nth-child(4) { width: 20%; }
.agents-hub .kn-table th:nth-child(5), .agents-hub .kn-table td:nth-child(5) { width: 12%; }
.agents-hub .sk-table th:nth-child(1), .agents-hub .sk-table td:nth-child(1) { width: 24%; }
.agents-hub .sk-table th:nth-child(2), .agents-hub .sk-table td:nth-child(2) { width: 44%; }
.agents-hub .sk-table th:nth-child(3), .agents-hub .sk-table td:nth-child(3) { width: 20%; }
.agents-hub .sk-table th:nth-child(4), .agents-hub .sk-table td:nth-child(4) { width: 12%; }
.agents-hub .lr-table th:nth-child(1), .agents-hub .lr-table td:nth-child(1) { width: 20%; }
.agents-hub .lr-table th:nth-child(2), .agents-hub .lr-table td:nth-child(2) { width: 15%; }
.agents-hub .lr-table th:nth-child(3), .agents-hub .lr-table td:nth-child(3) { width: 53%; }
.agents-hub .lr-table th:nth-child(4), .agents-hub .lr-table td:nth-child(4) { width: 12%; }
.agents-hub table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.agents-hub table.data-table thead { background: #f6f8fa; }
.agents-hub table.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600;
    color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #e5e7eb; }
.agents-hub table.data-table td { padding: 14px 16px; border-bottom: 1px solid #f3f4f6; color: #374151;
    overflow-wrap: anywhere; word-break: break-word; }
.agents-hub table.data-table tbody tr:hover { background: #f9fafb; }
.agents-hub table.data-table tbody tr:last-child td { border-bottom: none; }

/* ── badges ─────────────────────────────────────────────────────────── */
.agents-hub .badge { display: inline-block; padding: 3px 10px; border-radius: 9999px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.agents-hub .badge.queued { background: #f3f4f6; color: #6b7280; }
.agents-hub .badge.running { background: #dbeafe; color: #1d4ed8; }
.agents-hub .badge.paused { background: #fef3c7; color: #b45309; }
.agents-hub .badge.completed, .agents-hub .badge.success { background: #d1fae5; color: #065f46; }
.agents-hub .badge.failed, .agents-hub .badge.cancelled { background: #fecaca; color: #b91c1c; }
.agents-hub .badge.info { background: #dbeafe; color: #1d4ed8; }

/* ── phase dots (runs) ──────────────────────────────────────────────── */
.agents-hub .phase-dots { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; margin-right: 8px; }
.agents-hub .phase-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: #e5e7eb; }
.agents-hub .phase-dots .dot.done { background: #3b82f6; }
.agents-hub .phase-dots .dot.active { background: #3b82f6; animation: dot-pulse 1.1s ease-in-out infinite; }
.agents-hub .phase-label { font-size: 13px; color: #374151; vertical-align: middle; }
@keyframes dot-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.65); } }

/* ── filters bar ────────────────────────────────────────────────────── */
.agents-hub .filters { background: #fff; padding: 16px 20px; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06); display: flex; justify-content: space-between;
    align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.agents-hub .filter-input { padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 20px;
    background: #fff; color: #374151; font-size: 13px; }
.agents-hub .filter-input:focus { outline: none; border-color: #3b82f6; box-shadow: none; }

/* ── form rows (modal/editor) ───────────────────────────────────────── */
.agents-hub .form-row { margin-bottom: 16px; }
.agents-hub .form-row label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
/* Form fields match tune-agent exactly: single-line inputs are full pills,
   textareas are 14px-rounded monospace boxes. */
.agents-hub .form-row input[type=text], .agents-hub .form-row input:not([type]),
.cf-modal .form-row input {
    width: 100%; padding: 10px 16px; border: 1px solid #d1d5db; border-radius: 9999px;
    font-size: 14px; font-family: inherit; box-sizing: border-box; background: #fff; }
.agents-hub .form-row textarea, .cf-modal .form-row textarea {
    width: 100%; padding: 10px 16px; border: 1px solid #d1d5db; border-radius: 14px;
    font-size: 14px; box-sizing: border-box; background: #fff; min-height: 140px; resize: none;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace; line-height: 1.5; }
.agents-hub .form-row input:focus, .agents-hub .form-row textarea:focus,
.cf-modal .form-row input:focus, .cf-modal .form-row textarea:focus { outline: none; border-color: #1a73e8; box-shadow: none; }
.agents-hub .field-hint { display: flex; align-items: flex-start; gap: 7px; margin: 7px 0 0; font-size: 12px; color: #6b7280; line-height: 1.55; }
.agents-hub .field-hint > span:not(.material-symbols-outlined) { min-width: 0; overflow-wrap: break-word; }
.agents-hub .field-hint .material-symbols-outlined { font-size: 16px; color: #9aa0a6; flex-shrink: 0; margin-top: 1px; }

/* Shared modal shell (matches tune-agent's .uf-custom-modal in main.css). Scoped
   under .agents-hub so it overrides buildmidas's global styles.css variant. */
.agents-hub .uf-custom-modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 600px;
    max-height: 90vh; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.agents-hub .uf-custom-modal-header {
    padding: 20px 24px; border-bottom: 1px solid #e5e7eb;
    display: flex; justify-content: space-between; align-items: center; }
.agents-hub .uf-custom-modal-header h2 { margin: 0; font-size: 18px; color: #1e293b; }
.agents-hub .uf-custom-modal-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* ── agent card grid (Agents landing) ───────────────────────────────── */
.agents-hub .agent-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.agents-hub .agent-card { background: #f6f8fa; border-radius: 12px; padding: 20px;
    cursor: pointer; transition: box-shadow 0.2s, transform 0.1s; display: flex; flex-direction: column; }
.agents-hub .agent-card:hover { background: #eef1f5; }
.agents-hub .agent-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.agents-hub .agent-card-header .material-symbols-outlined { color: #3b82f6; font-size: 28px; }
.agents-hub .agent-card-name { font-size: 15px; font-weight: 600; color: #1e293b; }
.agents-hub .agent-card-desc { color: #6b7280; font-size: 13px; line-height: 1.5; min-height: 40px; overflow-wrap: anywhere; }
.agents-hub .agent-card-meta { margin-top: auto; padding-top: 12px; border-top: 1px solid #f3f4f6;
    font-size: 12px; color: #9ca3af; display: flex; justify-content: space-between; align-items: center; }

/* ── customize modal (cf-*) — used by the Agents editor + Skill editor ─ */
.cf-modal-overlay { position: fixed; inset: 0; z-index: 6000; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; padding: 20px; }
.cf-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 820px; max-height: 90vh;
    display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3); overflow: hidden; }
.cf-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e5e7eb; }
.cf-modal-header h2 { font-size: 18px; color: #1e293b; margin: 0; display: flex; align-items: center; gap: 8px; }
.cf-modal-header h2 .material-symbols-outlined { color: #1a73e8; }
.cf-modal-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr; }
.cf-modal-body.cf-single { grid-template-columns: 1fr; }
.cf-tabs { border-right: 1px solid #e5e7eb; padding: 12px 8px; overflow-y: auto; background: #f9fafb; }
.cf-tab { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: none;
    background: transparent; border-radius: 8px; cursor: pointer; color: #5f6368; font-size: 13px; text-align: left; margin-bottom: 2px; }
.cf-tab:hover { background: #f1f3f4; color: #202124; }
.cf-tab.active { background: #e8f0fe; color: #1a73e8; font-weight: 500; }
.cf-tab .material-symbols-outlined { font-size: 18px; }
.cf-tab.active .material-symbols-outlined { color: #1a73e8; }
.cf-tab-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-tab-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; flex-shrink: 0; }
.cf-pane { padding: 20px 24px; overflow-y: auto; }
.cf-pane-header { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f3f4f6; }
.cf-pane-header h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; color: #1e293b; margin: 0 0 4px; }
.cf-pane-header h3 .material-symbols-outlined { color: #1a73e8; font-size: 22px; }
.cf-pane-header p { margin: 4px 0 0; color: #5f6368; font-size: 13px; line-height: 1.55; }
.cf-modal-footer { padding: 16px 24px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 10px; }
.cf-modal .modal-close-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: #f2f2f2;
    color: #636363; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cf-modal .modal-close-btn:hover { background: #e5e5e5; color: #1a1a1a; }
.cf-file-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto;
    border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px; background: #fafbfc; }
.cf-file-list .cf-file-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    cursor: pointer; background: #fff; border: 1px solid #e5e7eb; transition: border-color 0.12s, background 0.12s; }
.cf-file-item:hover { border-color: #c7d2fe; background: #f8faff; }
.cf-file-item.selected { border-color: #1a73e8; background: #eff5ff; }
.cf-toggle-main { flex: 1; min-width: 0; }
.cf-file-name { flex: 1; min-width: 0; font-size: 13px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px;
    border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; background: #fafafa; }
.cf-tools-grid .cf-tool-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; cursor: pointer; }

/* ── suite tab bar (hub-specific; styled to match tune-agent's tab look) ─ */
.agents-hub .hub-suite-tabs { display: flex; gap: 6px; margin: 0 0 20px; border-bottom: 1px solid #e5e7eb; }
.agents-hub .hub-suite-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: none;
    background: none; color: #5f6368; font-size: 13px; font-weight: 600; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; }
.agents-hub .hub-suite-tab:hover { color: #202124; }
.agents-hub .hub-suite-tab.is-active { color: #1a73e8; border-bottom-color: #1a73e8; }

/* loading spinner */
.agents-hub .hub-loading { display: flex; align-items: center; justify-content: center; padding: 72px 0; }
.agents-hub .hub-spinner { width: 24px; height: 24px; border-radius: 50%;
    border: 3px solid rgba(26,115,232,0.25); border-top-color: #1a73e8; display: inline-block; animation: spin 0.8s linear infinite; }

/* ── transitional hub-* helpers (pages not yet fully ported to cf-modal) ─
   Used by the Agents inline editor + Skill editor until they move to tune-agent's
   agent-card + cf-modal pattern. Aligned to tune-agent tokens. */
.agents-hub .hub-page-intro, .agents-hub .hub-muted { color: #6b7280; }
.agents-hub .hub-page-intro { font-size: 14px; margin: 0 0 16px; max-width: 720px; }
.agents-hub .hub-muted { font-size: 12px; }
.agents-hub .hub-section-title { font-size: 14px; font-weight: 600; color: #374151; margin: 0 0 8px; }
.agents-hub .hub-agent-rows { display: flex; flex-direction: column; gap: 10px; }
.agents-hub .hub-agent-row { border-radius: 12px; background: #f6f8fa; overflow: hidden; }
.agents-hub .hub-agent-row.is-open { background: #eef4fe; }
.agents-hub .hub-agent-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; border: none; background: none; cursor: pointer; text-align: left; }
.agents-hub .hub-agent-head:hover { background: #eef1f5; }
.agents-hub .hub-agent-card-icon { color: #3b82f6; font-size: 24px; }
.agents-hub .hub-agent-card-name { font-size: 15px; font-weight: 600; color: #1e293b; }
.agents-hub .hub-agent-caret { margin-left: auto; color: #9ca3af; font-size: 20px; }
.agents-hub .hub-badge { display: inline-block; padding: 2px 8px; border-radius: 9999px; background: #d1fae5; color: #065f46; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.agents-hub .hub-agent-editor { padding: 4px 16px 18px; border-top: 1px solid #f3f4f6; }
.agents-hub .hub-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px 14px; }
.agents-hub .hub-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #374151; cursor: pointer; }
.agents-hub .hub-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.agents-hub .hub-link { color: #1a73e8; font-size: 13px; font-weight: 600; cursor: pointer; }
.agents-hub .hub-link:hover { text-decoration: underline; }

/* attachment chips (Skills) */
.agents-hub .hub-attach-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.agents-hub .hub-attach-chip { display: inline-block; padding: 3px 10px; border-radius: 9999px; border: 1px solid #e5e7eb;
    background: #fff; color: #9ca3af; font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; }
.agents-hub .hub-attach-chip:hover:not(.is-owner) { border-color: #c7d2fe; }
.agents-hub .hub-attach-chip.is-on { background: #eef2ff; border-color: #c7d2fe; color: #4f46e5; }
.agents-hub .hub-attach-chip.is-owner { cursor: default; background: #4f46e5; border-color: #4f46e5; color: #fff; }

/* ── uf-progress stepper (copied from user-factory.js lazy inject so the hub
   run-detail pipeline is styled without depending on the SEO page loading) ─ */
.uf-progress-card { background: #f8fbff; border: none; border-radius: 10px; padding: 14px 16px; }
.uf-progress-card--idle { background: #fafafa; color: #6b7280; font-size: 13px; padding: 10px 14px; }
.uf-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.uf-progress-head-left { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.uf-progress-trigger { color: #6b7280; font-size: 12px; }
.uf-progress-status { margin-left: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 9999px; }
.uf-progress-status--running { background: rgba(26,115,232,0.12); color: #1a73e8; }
.uf-progress-status--queued { background: rgba(107,114,128,0.12); color: #6b7280; }
.uf-progress-head-right { display: flex; align-items: baseline; gap: 4px; font-size: 12px; color: #6b7280; }
.uf-progress-meta { font-size: 12px; color: #374151; }
.uf-progress-meta--eta { color: #6b7280; }
.uf-progress-spinner { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #dbe6f5; border-top-color: #1a73e8; animation: uf-progress-spin 0.9s linear infinite; }
@keyframes uf-progress-spin { to { transform: rotate(360deg); } }
.uf-progress-stepper { display: flex; align-items: flex-start; gap: 0; }
.uf-progress-step { flex: 0 0 auto; min-width: 80px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.uf-progress-step-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; color: #9ca3af; border: 2px solid #d1d5db; }
.uf-progress-step--done .uf-progress-step-icon { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.uf-progress-step--running .uf-progress-step-icon { border: none; background: transparent; width: auto; height: 32px; }
.uf-progress-step--failed .uf-progress-step-icon { background: #c13515; color: #fff; border-color: #c13515; }
.uf-progress-step--skipped .uf-progress-step-icon { opacity: 0.5; }
.uf-progress-step-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(26,115,232,0.25); border-top-color: #1a73e8; animation: uf-progress-spin 0.8s linear infinite; }
.uf-progress-step-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.uf-progress-step-label { font-size: 12px; font-weight: 600; color: #374151; }
.uf-progress-step--queued .uf-progress-step-label, .uf-progress-step--skipped .uf-progress-step-label { color: #6b7280; font-weight: 500; }
.uf-progress-step-meta { font-size: 11px; color: #6b7280; min-height: 14px; }
.uf-progress-step--done .uf-progress-step-meta { color: #1a73e8; }
.uf-progress-step--running .uf-progress-step-meta { color: #1a73e8; font-weight: 500; }
.uf-progress-step--failed .uf-progress-step-meta { color: #c13515; }
.uf-progress-connector { flex: 1 1 auto; height: 2px; background: #e5e7eb; margin: 16px 4px 0; border-radius: 2px; min-width: 24px; }
.uf-progress-connector--done { background: #1a73e8; }

/* uf-btn variant visuals — the SEO page inlines these; the hub uses class-only,
   so define them statically (inline styles still win on the SEO page). */
.uf-btn--primary { padding:8px 16px; border:none; border-radius:9999px; background:#1a73e8; color:#fff; font-size:13px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.uf-btn--primary:hover { background:#1557b0; }
.uf-btn--outline { padding:8px 14px; border:1px solid #d1d5db; border-radius:9999px; background:#fff; color:#374151; font-size:12px; font-weight:600; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
.uf-btn--outline:hover { background:#f3f4f6; }

/* ── Workload › docked Coordinator chat ──────────────────────────────────
   The panel itself (.uf-chat-panel / .uf-chat-toggle / body.uf-chat-open) is
   the global rule in styles.css, reused verbatim from the old SEO page. Only
   the content shift differs: push the Workload page over when the panel opens,
   the same way the SEO page shifts .user-factory-main. */
body.uf-chat-open #page-workload-tasks { margin-right: 380px; transition: margin-right .22s ease; }
@media (max-width: 900px) { body.uf-chat-open #page-workload-tasks { margin-right: 0; } }

/* ── Collapsible "Tasks" parent + nested per-suite rows ───────────────────
   "Tasks" is a nav-item whose chevron expands/collapses the per-suite rows
   nested beneath it; Schedules/Notifications are siblings and unaffected. The
   suite rows are indented so they read as children of Tasks. */
.nav-item.nav-collapse-toggle { cursor: pointer; }
.nav-item.nav-collapse-toggle .nav-collapse-chevron {
    margin-left: auto;
    font-size: 18px;
    color: #9ca3af;
    transition: transform .18s ease;
}
#hub-workload-section.tasks-collapsed .nav-collapse-chevron { transform: rotate(-90deg); }
#hub-workload-section.tasks-collapsed #hub-workload-suites { display: none; }
/* Nested suite rows under Tasks — indented past the Tasks icon. */
.nav-subrows .nav-item.nav-hub-suite { padding-left: 30px; }
.nav-item.nav-hub-suite .nav-text { font-weight: 500; }
