/* Agents page and agent reports. Uses the tokens from theme.css. */
.agent-notice { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; background: #fff7e6; color: #7a4b00; font-size: 13px; }
.agent-notice.ok { background: #eaf6f0; color: #14684a; }
.agent-notice code { padding: 1px 5px; border-radius: 5px; background: #ffffffaa; font-size: 12px; }

.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 18px; margin-bottom: 20px; }
.agent-card, .agent-form, .agent-reports, .agent-empty, .agent-role-card { padding: 22px 24px; }
.agent-card { display: grid; gap: 16px; align-content: start; }
.agent-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agent-card h3, .agent-role-card h3 { margin: 4px 0 0; font-size: 18px; color: var(--ink, #1d2939); }
.agent-role { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange, #3d23c0); }
.agent-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.agent-facts dt { font-size: 12px; color: var(--muted, #657184); }
.agent-facts dd { margin: 3px 0 0; font-size: 13px; font-weight: 600; color: var(--ink, #1d2939); }
.agent-instructions { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f6f8fa; color: #3d4a5c; font-size: 13px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.agent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.agent-actions button { height: 36px; font-size: 13px; }
.agent-actions .primary:disabled { opacity: .6; cursor: not-allowed; }
.ghost.danger { color: #b42318; }
.agent-runs strong { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted, #657184); font-weight: 600; }
.agent-runs ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.agent-runs li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted, #657184); }
.agent-run-error { flex-basis: 100%; color: #b42318; font-size: 12px; }
.agent-link { border: 0; background: none; padding: 0; color: var(--orange, #3d23c0); font: inherit; font-weight: 600; cursor: pointer; }
.agent-link:hover { text-decoration: underline; }
.agent-empty-runs { margin: 0; font-size: 12px; color: var(--muted, #657184); }

/* Status: coloured dot beside ink text */
.agent-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: #f4f6f8; color: var(--ink, #1d2939); font-size: 11px; font-weight: 600; white-space: nowrap; }
.agent-pill i { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.agent-pill.good i { background: var(--green, #1b8b61); }
.agent-pill.warning i { background: #f79009; }
.agent-pill.critical i { background: #d92d20; }

.agent-empty { margin-bottom: 20px; }
.agent-empty strong { display: block; margin-bottom: 4px; }
.agent-empty p { margin: 0; color: var(--muted, #657184); }

/* Create / edit form */
.agent-form { margin-bottom: 20px; }
.agent-form form { display: grid; gap: 16px; margin-top: 16px; }
.agent-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink, #1d2939); }
.agent-form label small { font-weight: 400; color: var(--muted, #657184); }
.agent-form input:not([type=checkbox]), .agent-form select, .agent-form textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border, #e2e7ed); border-radius: 10px; background: #fff; color: var(--ink, #1d2939); font: inherit; font-weight: 400; }
.agent-form textarea { resize: vertical; line-height: 1.5; }
.agent-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.agent-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.agent-form-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Reports list */
.agent-reports { margin-bottom: 26px; }
.agent-reports ul { display: grid; gap: 4px; margin: 14px 0 0; padding: 0; list-style: none; }
.agent-reports li button { display: grid; gap: 3px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; cursor: pointer; font: inherit; }
.agent-reports li button:hover, .agent-reports li button:focus-visible { border-color: var(--border, #e2e7ed); background: #fafbfc; }
.agent-reports li strong { color: var(--ink, #1d2939); font-size: 14px; }
.agent-reports li span { color: var(--muted, #657184); font-size: 12px; }

/* Role catalog */
.agent-section-title { margin: 0 0 12px; font-size: 16px; color: var(--ink, #1d2939); }
.agent-roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.agent-role-card { display: grid; gap: 6px; align-content: start; }
.agent-role-card p { margin: 0; color: var(--muted, #657184); font-size: 13px; }
.agent-role-card button { justify-self: start; margin-top: 6px; }
.agent-role-card.soon { background: #fafbfc; }
.agent-role-card.soon .agent-role { color: var(--muted, #657184); }

/* Report view */
.report-view { display: grid; gap: 18px; }
.report-back { justify-self: start; }
.report-header { padding: 26px 28px; }
.report-meta { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted, #657184); }
.report-header h2 { margin: 0 0 12px; font-size: 26px; line-height: 1.25; color: var(--ink, #1d2939); }
.report-header p { margin: 0 0 10px; color: #3d4a5c; line-height: 1.6; }
.report-headline { padding: 12px 14px; border-left: 3px solid var(--orange, #3d23c0); border-radius: 0 10px 10px 0; background: var(--accent-soft, #edeafe); color: var(--ink, #1d2939) !important; font-weight: 600; }
.report-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.report-tile { display: grid; gap: 6px; padding: 18px 20px; }
.report-tile span { font-size: 12px; color: var(--muted, #657184); }
.report-tile strong { font-size: 24px; color: var(--ink, #1d2939); }
.report-tile small { font-size: 12px; color: var(--muted, #657184); }
.report-tile small.positive { color: var(--green, #1b8b61); }
.report-tile small.negative { color: #b42318; }
.report-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-section { padding: 22px 24px; }
.report-section h3 { margin: 0 0 12px; font-size: 16px; color: var(--ink, #1d2939); }
.report-section.good h3::before { content: '●'; margin-right: 8px; color: var(--green, #1b8b61); }
.report-section.warn h3::before { content: '●'; margin-right: 8px; color: #f79009; }
.report-section ul, .report-recs { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.report-section li strong { color: var(--ink, #1d2939); font-size: 14px; }
.report-section li p { margin: 4px 0 0; color: #3d4a5c; font-size: 13px; line-height: 1.55; }
.report-recs li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; }
.report-priority { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #f4f6f8; color: var(--ink, #1d2939); }
.report-priority.high { background: #fdecea; color: #a12a1a; }
.report-priority.medium { background: #fff4e0; color: #7a4b00; }
.report-empty { margin: 0; color: var(--muted, #657184); font-size: 13px; }
.report-footnote { margin: 0; color: var(--muted, #657184); font-size: 12px; }

@media (max-width: 900px) {
  .report-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-columns { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .agent-grid { grid-template-columns: 1fr; }
  .agent-card, .agent-form, .agent-reports, .agent-empty, .agent-role-card, .report-section { padding: 18px 16px; }
  .agent-facts { grid-template-columns: 1fr 1fr; }
  .report-header { padding: 20px 18px; }
  .report-header h2 { font-size: 21px; }
}

/* AI connection (workspace Anthropic key) */
.ai-key-card { padding: 20px 24px; margin-bottom: 20px; }
.ai-key-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ai-key-head h3 { margin: 4px 0 8px; font-size: 17px; color: var(--ink, #1d2939); }
.ai-key-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: var(--muted, #657184); font-size: 13px; }
.ai-key-actions { display: flex; gap: 8px; }
.ai-key-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; margin-top: 16px; }
.ai-key-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink, #1d2939); }
.ai-key-form input { min-height: 42px; padding: 9px 12px; border: 1px solid var(--border, #e2e7ed); border-radius: 10px; background: #fff; font: inherit; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.ai-key-form-actions { display: flex; gap: 8px; }
.ai-key-form-actions .primary { height: 42px; }
.ai-key-error { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #a12a1a; font-size: 13px; }
.ai-key-help { grid-column: 1 / -1; margin: 0; color: var(--muted, #657184); font-size: 12px; line-height: 1.55; }
.ai-key-help a { color: var(--orange, #3d23c0); font-weight: 600; }
@media (max-width: 520px) {
  .ai-key-card { padding: 18px 16px; }
  .ai-key-form { grid-template-columns: 1fr; }
}

/* Approvals: posts proposed by agents, waiting for a person */
.approvals { margin-bottom: 24px; }
.approval-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--orange, #3d23c0); color: #fff; font-size: 12px; vertical-align: middle; }
.approval-list { display: grid; gap: 16px; }
.approval-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; padding: 18px; }
.approval-media { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: #f1f3f6; }
.approval-media.empty { display: grid; place-items: center; color: var(--muted, #657184); font-size: 13px; }
.approval-body { display: grid; gap: 12px; align-content: start; min-width: 0; }
.approval-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted, #657184); }
.approval-dests { display: flex; flex-wrap: wrap; gap: 6px; }
.approval-dest { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: #eef3ff; color: #1d3f8f; font-size: 12px; font-weight: 600; }
.approval-dest.instagram { background: #fdeef5; color: #9c1c5c; }
.approval-body label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink, #1d2939); }
.approval-body textarea, .approval-body input[type=datetime-local] { width: 100%; padding: 9px 12px; border: 1px solid var(--border, #e2e7ed); border-radius: 10px; background: #fff; color: var(--ink, #1d2939); font: inherit; font-weight: 400; line-height: 1.5; }
.approval-body input[type=datetime-local] { max-width: 260px; min-height: 42px; }
.approval-reason { margin: 0; padding: 10px 12px; border-radius: 10px; background: #f6f8fa; color: #3d4a5c; font-size: 13px; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.approval-actions .primary:disabled { opacity: .6; }

.agent-destinations { display: grid; gap: 8px; margin: 0; padding: 14px; border: 1px solid var(--border, #e2e7ed); border-radius: 12px; }
.agent-destinations legend { padding: 0 6px; font-size: 13px; font-weight: 600; color: var(--ink, #1d2939); }

@media (max-width: 760px) {
  .approval-card { grid-template-columns: 1fr; }
  .approval-media { max-height: 360px; }
}

/* Video concept approvals */
.approval-title { margin: 0; font-size: 17px; color: var(--ink, #1d2939); }
.approval-details { padding: 10px 12px; border: 1px solid var(--border, #e2e7ed); border-radius: 10px; font-size: 13px; color: #3d4a5c; }
.approval-details summary { cursor: pointer; font-weight: 600; color: var(--ink, #1d2939); }
.approval-details p { margin: 10px 0 0; line-height: 1.55; white-space: pre-wrap; }
.approval-details ol { display: grid; gap: 8px; margin: 10px 0 0; padding-left: 0; list-style: none; }
.approval-details li strong { margin-right: 6px; }
.approval-details li em { display: block; margin-top: 2px; color: var(--muted, #657184); }
.approval-cost { margin: 0; font-size: 12px; color: #7a4b00; }

/* Brands page */
.brand-card { display: grid; gap: 14px; align-content: start; padding: 22px 24px; }
.brand-card-head { display: flex; align-items: center; gap: 12px; }
.brand-card-head h3 { margin: 0; font-size: 18px; color: var(--ink, #1d2939); }
.brand-card-head span { font-size: 12px; color: var(--muted, #657184); }
.brand-card-head .workspace-icon { display: grid; place-items: center; border-radius: 10px; color: #fff; font-weight: 700; }
.brand-facts { display: grid; gap: 10px; margin: 0; }
.brand-facts dt { font-size: 12px; color: var(--muted, #657184); }
.brand-facts dd { margin: 2px 0 0; font-size: 13px; color: var(--ink, #1d2939); white-space: pre-wrap; }
.brand-tags { margin: 0; color: #1d3f8f; font-size: 13px; }
.brand-guard { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fff7e6; color: #7a4b00; font-size: 12px; }
@media (max-width: 520px) { .brand-card { padding: 18px 16px; } }

/* Ads action approvals: a compact badge instead of a media preview */
.approval-card.ads-approval { grid-template-columns: 64px minmax(0, 1fr); }
.approval-media.ads-approval-icon { width: 64px; height: 64px; aspect-ratio: auto; font-size: 15px; font-weight: 800; letter-spacing: .02em; color: var(--orange, #3d23c0); background: var(--accent-soft, #edeafe); }
.ads-approval .approval-body input[type=number] { max-width: 220px; min-height: 42px; padding: 9px 12px; border: 1px solid var(--border, #e2e7ed); border-radius: 10px; font: inherit; }
.ads-approval label small { font-weight: 400; color: var(--muted, #657184); }
@media (max-width: 760px) {
  .approval-card.ads-approval { grid-template-columns: 1fr; }
  .approval-media.ads-approval-icon { width: 48px; height: 48px; font-size: 13px; }
}

/* Brands: visual identity for post templates */
.brand-visual { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.brand-visual img { border-radius: 8px; object-fit: cover; }
.brand-swatch { width: 18px; height: 18px; border-radius: 6px; border: 1px solid #0000001a; }
.brand-logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand-logo-box { width: 84px; height: 84px; flex: none; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: 18px; background: #fff; overflow: hidden; color: var(--muted); font-size: 12px; text-align: center; }
.brand-logo-box img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brand-logo-actions small { flex-basis: 100%; color: var(--muted); }
.brand-logo-upload { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 600; }
.brand-logo-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.brand-visual-fields input[type=color] { height: 42px; padding: 3px; }
.brand-preview { display: grid; gap: 10px; justify-items: start; }
.brand-preview img { width: min(320px, 100%); border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 10px 30px #1d29391a; }
