:root {
  color-scheme: dark;
  --ink: #f2f1eb;
  --ink-dark: #050605;
  --muted: #979b91;
  --line: rgba(242, 241, 235, .14);
  --paper: #090a08;
  --white: #10110e;
  --purple: #d8ed3f;
  --purple-soft: rgba(216, 237, 63, .1);
  --coral: #e8a963;
  --mint: #d8ed3f;
  --shadow: 0 18px 45px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #050605; font-family: "Archivo", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; background: #080908; color: white; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; margin: 0 8px 36px; }
.brand img { width: 78px; height: auto; object-fit: contain; }
.brand-divider { width: 1px; height: 26px; background: rgba(242,241,235,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font: 600 16px Archivo; letter-spacing: -.6px; }
.brand small { margin-top: 3px; color: #a9ada3; font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px; }
.nav { display: grid; gap: 6px; }
.nav-item { width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; text-align: left; color: #aaa4b5; background: transparent; display: flex; gap: 12px; align-items: center; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(216,237,63,.055); }
.nav-item.active { box-shadow: inset 2px 0 var(--purple); }
.sidebar-section { margin-top: 34px; min-height: 0; overflow: auto; }
.eyebrow { margin: 0 0 8px; color: #96919e; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.agent-list { display: grid; gap: 7px; }
.agent-row { display: flex; align-items: center; gap: 9px; padding: 6px 4px; color: #d4d0da; font-size: 12px; }
.agent-row span:first-child, .agent-avatar { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; color: white; font-size: 10px; font-weight: 700; flex: none; }
.agent-row i { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #58c6a8; }
.system-card { margin-top: auto; padding: 12px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(216,237,63,.16); border-radius: 12px; background: rgba(216,237,63,.035); }
.system-card strong, .system-card small { display: block; font-size: 11px; }
.system-card small { color: #9f99ab; margin-top: 3px; }
.system-card.offline { border-color: rgba(240,140,120,.25); background: rgba(240,140,120,.05); }
.system-card.offline .pulse { background: #f08c78; box-shadow: 0 0 0 4px rgba(240,140,120,.08); }
.system-card.warning .pulse { background: #e6bf71; box-shadow: 0 0 0 4px rgba(230,191,113,.08); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 7px var(--purple), 0 0 0 5px rgba(216,237,63,.08); }

main { position: relative; isolation: isolate; min-width: 0; padding: 34px 38px 48px; overflow: hidden; background: radial-gradient(circle at 78% 16%, rgba(174,196,31,.07), transparent 27%), linear-gradient(118deg,#050605 0%,#090a08 48%,#030403 100%); }
main::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .13; pointer-events: none; background-image: linear-gradient(rgba(216,237,63,.09) 1px,transparent 1px),linear-gradient(90deg,rgba(216,237,63,.09) 1px,transparent 1px); background-size: 12.5% 16.66%; mask-image: radial-gradient(circle at 74% 32%,#000,transparent 63%); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
h1, h2, h3 { font-family: Archivo, Arial, sans-serif; }
h1 { margin: 0; font-size: 28px; letter-spacing: -.8px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle { width: 42px; height: 42px; flex: none; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: rgba(12,13,11,.82); font-size: 17px; transition: .2s; }
.theme-toggle:hover { color: var(--purple); border-color: rgba(216,237,63,.45); transform: rotate(8deg); }
.search { height: 42px; min-width: 240px; padding: 0 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(12,13,11,.82); display: flex; align-items: center; gap: 8px; }
.search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search input::placeholder { color: #aaa6ae; }
.primary-button, .secondary-button, .danger-button { min-height: 42px; padding: 0 18px; border-radius: 999px; border: 0; font-weight: 700; }
.primary-button { color: #090a08; background: linear-gradient(105deg,#dced49,#cfe236); box-shadow: 0 8px 25px rgba(216,237,63,.08); }
.primary-button:hover { background: #e2f44c; box-shadow: 0 0 24px rgba(216,237,63,.2); }
.secondary-button { color: var(--ink); border: 1px solid var(--line); background: #0c0d0b; }
.danger-button { color: #c85242; background: #fff0ed; }

.summary { margin: 28px 0; display: grid; grid-template-columns: 155px 155px 155px minmax(260px, 1fr); gap: 12px; }
.view-panel[hidden] { display: none; }
.view-panel { animation: view-in .22s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-intro { margin: 48px 0 28px; max-width: 760px; }
.page-intro-actions { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.page-intro-actions > div:first-child { max-width: 760px; }
.config-actions { display: flex; gap: 8px; flex: none; }
.page-intro h2 { margin: 0; font-size: clamp(32px,4.2vw,58px); line-height: .98; letter-spacing: -.055em; }
.page-intro h2 em { color: var(--purple); font: 400 1.08em "Instrument Serif",serif; }
.page-intro > p:last-child { max-width: 620px; margin: 18px 0 0; color: var(--muted); line-height: 1.6; }
.agents-workspace { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.agent-profile { min-height: 230px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg,rgba(15,16,13,.96),rgba(5,6,5,.98)); display: flex; flex-direction: column; }
.agent-profile-top { display: flex; align-items: center; gap: 12px; }
.agent-profile .agent-avatar { width: 40px; height: 40px; border-radius: 12px; }
.agent-profile h3 { margin: 0; font-size: 15px; }.agent-profile small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.agent-profile > p { color: var(--muted); font-size: 11px; line-height: 1.6; }
.agent-profile footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: #b8bbb2; font-size: 9px; }
.agent-profile footer span:last-child { color: var(--purple); }
.configure-agent { min-height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: transparent; font-size: 9px; font-weight: 700; }
.configure-agent:hover { color: var(--purple); border-color: currentColor; }
.agent-status { display: inline-flex; align-items: center; gap: 5px; }.agent-status::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 7px rgba(216,237,63,.5); }.agent-status.inactive { color: var(--muted); }.agent-status.inactive::before { background: var(--muted); box-shadow: none; }
.memory-layout { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.memory-card { min-height: 205px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg,rgba(15,16,13,.96),rgba(5,6,5,.98)); }
.memory-card.featured { grid-column: 1/-1; min-height: 150px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; border-color: rgba(216,237,63,.25); background: radial-gradient(circle at 90% 50%,rgba(216,237,63,.08),transparent 34%),#0b0d09; }
.memory-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--purple); background: rgba(216,237,63,.08); font-size: 22px; }
.memory-card small,.report-panel small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .13em; }
.memory-card h3 { margin: 12px 0 8px; font-size: 17px; }.memory-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.memory-card.featured h3 { margin: 6px 0; }.memory-card.featured > strong { padding: 7px 11px; border-radius: 999px; color: #11120f; background: var(--purple); font-size: 9px; }
.memory-number { color: var(--purple); font-size: 10px; letter-spacing: .15em; }
.governance-note { margin-top: 12px; padding: 16px 20px; border: 1px solid rgba(216,237,63,.18); border-radius: 13px; display: flex; gap: 12px; align-items: center; color: #c6c8c0; background: rgba(216,237,63,.025); font-size: 11px; }.governance-note span { color: var(--purple); }.governance-note p { margin: 0; }
.report-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.report-metrics article { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(145deg,rgba(15,16,13,.96),rgba(5,6,5,.98)); }
.report-metrics small,.report-metrics span { display: block; color: var(--muted); font-size: 9px; }.report-metrics strong { display: block; margin: 10px 0 5px; font-size: 30px; }
.reports-grid { margin-top: 12px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.report-panel { min-height: 310px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg,rgba(15,16,13,.96),rgba(5,6,5,.98)); }
.report-panel header { display: flex; justify-content: space-between; align-items: start; }.report-panel h3 { margin: 6px 0 0; font-size: 16px; }.report-panel header > span { padding: 5px 8px; border-radius: 999px; color: var(--purple); background: rgba(216,237,63,.08); font-size: 8px; }
.bar-chart { height: 205px; margin-top: 28px; padding-top: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: end; justify-content: space-around; gap: 12px; }
.bar-item { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }.bar-item i { width: min(52px,75%); min-height: 4px; border-radius: 7px 7px 0 0; background: linear-gradient(180deg,var(--purple),#718019); box-shadow: 0 0 15px rgba(216,237,63,.08); }.bar-item strong { color: var(--ink); font-size: 11px; }
.provider-chart { margin-top: 26px; display: grid; gap: 14px; }.provider-row { display: grid; grid-template-columns: 105px 1fr 24px; gap: 10px; align-items: center; font-size: 9px; }.provider-track { height: 6px; border-radius: 999px; overflow: hidden; background: rgba(242,241,235,.07); }.provider-track i { display: block; height: 100%; border-radius: inherit; background: var(--purple); }
.summary article { min-height: 78px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg,rgba(15,16,13,.96),rgba(5,6,5,.98)); display: flex; align-items: center; gap: 12px; }
.summary strong, .summary small { display: block; }
.summary article > div > strong { font: 700 22px Archivo; }
.summary small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.metric-icon { width: 31px; height: 31px; border-radius: 10px; display: grid; place-items: center; }
.metric-icon.violet { color: var(--purple); background: var(--purple-soft); }
.metric-icon.coral { color: var(--coral); background: #ffebe6; }
.metric-icon.mint { color: var(--mint); background: rgba(216,237,63,.1); }
.summary .brief { color: #d9dbd4; background: radial-gradient(circle at 90% 40%,rgba(216,237,63,.09),transparent 40%), #0b0d09; border: 1px solid rgba(216,237,63,.16); }
.brief > span { color: var(--purple); font-size: 23px; text-shadow: 0 0 14px rgba(216,237,63,.4); }
.brief p { margin: 0; font-size: 12px; line-height: 1.45; }

.board-heading { display: flex; justify-content: space-between; align-items: end; margin: 0 2px 16px; }
.board-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.04em; }
.board-heading h2 em { color: var(--purple); font: 400 1.15em "Instrument Serif", serif; }
.section-kicker { margin: 0 0 7px !important; color: #b8c34b !important; font-size: 8px !important; font-weight: 700; letter-spacing: .24em; }
.board-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.dot.high { background: #f08c68; }.dot.medium { background: #d8ed3f; }.dot.low { background: #8f9389; }
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.column { min-height: 490px; padding: 10px; border: 1px solid rgba(242,241,235,.1); border-radius: 16px; background: rgba(7,8,6,.74); transition: .15s; }
.column.drag-over { border-color: var(--purple); background: rgba(216,237,63,.045); }
.column-header { padding: 4px 3px 12px; display: flex; align-items: center; gap: 8px; }
.column-header h3 { margin: 0; font-size: 12px; }
.column-count { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 7px; display: grid; place-items: center; background: #151712; color: #c3c6bd; font-size: 10px; }
.column-accent { width: 7px; height: 7px; border-radius: 50%; }
.column[data-status="backlog"] .column-accent { background: #97939d; }
.column[data-status="doing"] .column-accent { background: var(--purple); box-shadow: 0 0 8px rgba(216,237,63,.7); }
.column[data-status="review"] .column-accent { background: var(--coral); }
.column[data-status="done"] .column-accent { background: #9bab37; }
.column-body { min-height: 430px; display: grid; align-content: start; gap: 9px; }
.task-card { padding: 14px; border: 1px solid rgba(242,241,235,.14); border-radius: 13px; background: linear-gradient(145deg,rgba(15,16,13,.98),rgba(7,8,6,.99)); box-shadow: 0 7px 20px rgba(0,0,0,.18); cursor: grab; }
.task-card:hover { transform: translateY(-2px); border-color: rgba(216,237,63,.35); box-shadow: var(--shadow), 0 0 22px rgba(216,237,63,.035); }
.task-card.dragging { opacity: .45; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.priority-pill { padding: 4px 7px; border-radius: 6px; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.priority-pill.high { color: #f2b09c; background: rgba(240,140,104,.12); }.priority-pill.medium { color: #d8ed3f; background: rgba(216,237,63,.09); }.priority-pill.low { color: #afb2aa; background: rgba(175,178,170,.09); }
.more-button { border: 0; color: #aaa5ae; background: transparent; letter-spacing: 1px; }
.task-card h3 { margin: 11px 0 6px; font-size: 13px; line-height: 1.35; }
.description { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { min-height: 25px; margin: 11px 0; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 9px; }
.card-meta { flex-wrap: wrap; }
.card-meta span:not(:empty) { padding: 4px 6px; border-radius: 6px; background: rgba(242,241,235,.055); }
.task-card footer { padding-top: 10px; border-top: 1px solid rgba(242,241,235,.08); display: flex; align-items: center; gap: 7px; }
.agent-name { color: #b6b8b1; font-size: 9px; }
.arrow { margin-left: auto; color: #aaa5ae; }
.empty-state { padding: 26px 12px; border: 1px dashed rgba(242,241,235,.13); border-radius: 12px; color: #777b72; text-align: center; font-size: 10px; }

dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); background: linear-gradient(145deg,#0d0e0c,#050605); border: 1px solid rgba(242,241,235,.15); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(4px); }
#cardForm { padding: 26px; overflow: auto; }
.dialog-header { display: flex; justify-content: space-between; margin-bottom: 22px; }
.dialog-header h2 { margin: 0; font-size: 21px; }
.icon-button { width: 34px; height: 34px; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; background: #10120e; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 15px; }
.field label:not(.upload-zone) { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; outline: none; background: #0b0c0a; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.upload-zone { min-height: 78px; border: 1px dashed rgba(216,237,63,.28); border-radius: 11px; display: flex; justify-content: center; align-items: center; gap: 8px; color: #d4d5cf; background: rgba(216,237,63,.025); cursor: pointer; }
.upload-zone span { color: var(--purple); font-size: 20px; }.upload-zone strong { font-size: 11px; }.upload-zone small { color: var(--muted); font-size: 9px; }
.attachment-list { margin-top: 8px; display: grid; gap: 6px; }
.attachment-item { padding: 8px 10px; border-radius: 8px; background: #10120e; display: flex; align-items: center; gap: 8px; font-size: 10px; }
.attachment-item a { min-width: 0; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-item small { margin-left: auto; color: var(--muted); flex: none; }
.attachment-item button { border: 0; color: #b65b4e; background: transparent; }
.attachment-item.generated span { color: var(--purple); }
.execution-panel { margin-top: 18px; padding: 16px; border: 1px solid rgba(216,237,63,.18); border-radius: 13px; background: rgba(216,237,63,.025); }
.execution-heading,.run-summary,.execution-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.execution-heading h3 { margin: 3px 0 0; font-size: 14px; }
.execution-panel > p { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.backend-status,.run-status { padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.backend-status.checking { color: var(--muted); background: rgba(242,241,235,.06); }
.backend-status.online,.run-status.completed { color: var(--purple); background: rgba(216,237,63,.1); }
.backend-status.warning,.run-status.queued { color: #e6bf71; background: rgba(230,191,113,.1); }
.backend-status.offline,.run-status.failed,.run-status.cancelled { color: #f08c78; background: rgba(240,140,120,.1); }
.run-status.running { color: #8cc5ff; background: rgba(90,160,230,.12); }
.run-details { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.run-summary small { color: var(--muted); font-size: 9px; }
.run-details pre { max-height: 170px; margin: 10px 0; padding: 11px; border-radius: 9px; overflow: auto; white-space: pre-wrap; color: #cdd0c7; background: rgba(0,0,0,.25); font: 10px/1.55 Archivo,sans-serif; }
.execution-actions { margin-top: 13px; justify-content: flex-end; }
.execute-button { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; color: #11120f; background: var(--purple); font-size: 10px; font-weight: 800; }
.execute-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 18px rgba(216,237,63,.2); }
.execute-button:disabled { opacity: .42; cursor: not-allowed; }
.run-pill.queued,.run-pill.running { color: #8cc5ff; }
.run-pill.completed { color: var(--purple); }
.run-pill.failed,.run-pill.cancelled { color: #f08c78; }
.dialog-actions { margin-top: 22px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 9px; }
.config-dialog { width: min(760px,calc(100vw - 32px)); }
.config-dialog form { max-height: calc(100vh - 40px); padding: 26px; overflow-y: auto; }
.config-notice { margin: -4px 0 20px; padding: 13px 15px; border: 1px solid rgba(216,237,63,.18); border-radius: 11px; display: flex; align-items: center; gap: 10px; color: #c5c8bf; background: rgba(216,237,63,.03); }
.config-notice span { color: var(--purple); font-size: 18px; }.config-notice p { margin: 0; font-size: 10px; line-height: 1.5; }
.field > small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.config-fieldset { margin: 0 0 16px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.config-fieldset legend { padding: 0 6px; font-size: 11px; font-weight: 700; }
.permission-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.permission-option { padding: 9px; border: 1px solid var(--line); border-radius: 9px; display: flex; align-items: center; gap: 7px; color: var(--muted); background: rgba(242,241,235,.025); font-size: 9px; cursor: pointer; }
.permission-option:has(input:checked) { color: var(--ink); border-color: rgba(216,237,63,.35); background: rgba(216,237,63,.06); }.permission-option input { accent-color: var(--purple); }
.toggle-row { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; display: flex; gap: 11px; align-items: center; cursor: pointer; }.toggle-row input { accent-color: var(--purple); }.toggle-row strong,.toggle-row small { display:block; }.toggle-row strong { font-size: 11px; }.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.config-dialog-actions { position: sticky; bottom: -26px; margin: 22px -26px -26px; padding: 15px 26px; border-top: 1px solid var(--line); background: rgba(7,8,6,.94); backdrop-filter: blur(12px); }

@media (max-width: 1050px) { .summary { grid-template-columns: repeat(3, 1fr); }.summary .brief { grid-column: 1 / -1; }.board { grid-template-columns: repeat(4, 270px); }.agents-workspace { grid-template-columns: repeat(2,1fr); }.report-metrics { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 720px) { .shell { display: block; }.sidebar { position: static; width: 100%; height: auto; padding: 18px; }.brand { margin-bottom: 15px; }.nav { grid-template-columns: repeat(4, 1fr); }.nav-item { justify-content: center; font-size: 0; }.nav-item span { font-size: 16px; }.sidebar-section, .system-card { display: none; } main { padding: 22px 16px; }.topbar { align-items: flex-start; }.top-actions { display: grid; grid-template-columns: 1fr 42px; align-items: start; }.top-actions .primary-button { grid-column: 1/-1; grid-row: 1; }.search { min-width: 0; }.summary { grid-template-columns: repeat(3, 1fr); }.summary article { padding: 10px; }.summary .metric-icon { display: none; }.board-heading { align-items: start; }.legend { display: none; }.form-grid { grid-template-columns: 1fr; }.upload-zone { padding: 12px; flex-direction: column; text-align: center; }.dialog-actions { grid-template-columns: 1fr 1fr; }.dialog-actions span { display: none; }.agents-workspace,.memory-layout,.reports-grid { grid-template-columns: 1fr; }.memory-card.featured { grid-template-columns: auto 1fr; }.memory-card.featured > strong { grid-column: 2; justify-self: start; }.report-metrics { grid-template-columns: repeat(2,1fr); }.page-intro { margin-top: 36px; }.page-intro-actions { align-items: start; flex-direction: column; }.config-actions { width:100%; flex-wrap:wrap; }.permission-grid { grid-template-columns:repeat(2,1fr); }.config-dialog-actions { grid-template-columns:1fr 1fr; }.config-dialog-actions span { display:none; } }

/* Tema claro: mantém o lime da marca e inverte superfícies e contraste. */
html[data-theme="dark"] { color-scheme:dark; }
html[data-theme="light"] { color-scheme:light; --ink:#0c0d0b; --ink-dark:#f2f1eb; --muted:#62665d; --line:rgba(12,13,11,.14); --paper:#f2f1eb; --white:#fff; --purple:#667313; --purple-soft:rgba(102,115,19,.12); --mint:#667313; --shadow:0 18px 45px rgba(31,35,25,.1); }
html[data-theme="light"] body { background:#f2f1eb; }
html[data-theme="light"] .sidebar { color:#0c0d0b; background:#eeede6; border-right-color:rgba(12,13,11,.13); }
html[data-theme="light"] .brand { color:#0c0d0b; } html[data-theme="light"] .brand img { filter:brightness(0); } html[data-theme="light"] .brand-divider { background:rgba(12,13,11,.18); }
html[data-theme="light"] .nav-item { color:#55594f; } html[data-theme="light"] .nav-item:hover,html[data-theme="light"] .nav-item.active { color:#0c0d0b; background:rgba(102,115,19,.15); }
html[data-theme="light"] .agent-row { color:#363a32; } html[data-theme="light"] .system-card { background:rgba(216,237,63,.18); border-color:rgba(113,128,25,.28); }
html[data-theme="light"] main { background:radial-gradient(circle at 78% 16%,rgba(174,196,31,.13),transparent 27%),linear-gradient(118deg,#f2f1eb,#faf9f4 48%,#ecebe4); }
html[data-theme="light"] main::before { opacity:.2; background-image:linear-gradient(rgba(70,78,35,.11) 1px,transparent 1px),linear-gradient(90deg,rgba(70,78,35,.11) 1px,transparent 1px); }
html[data-theme="light"] .search,html[data-theme="light"] .theme-toggle { background:rgba(255,255,255,.8); }
html[data-theme="light"] .primary-button { color:#fff; background:linear-gradient(105deg,#75831c,#5f6b10); box-shadow:0 8px 22px rgba(75,86,12,.14); }
html[data-theme="light"] .primary-button:hover { background:#56620b; box-shadow:0 0 20px rgba(75,86,12,.2); }
html[data-theme="light"] .section-kicker { color:#667313!important; }
html[data-theme="light"] .dot.medium { background:#667313; } html[data-theme="light"] .brief > span { color:#667313; text-shadow:none; }
html[data-theme="light"] .column[data-status="doing"] .column-accent { background:#667313; box-shadow:0 0 6px rgba(102,115,19,.35); }
html[data-theme="light"] .summary article,html[data-theme="light"] .task-card,html[data-theme="light"] .agent-profile,html[data-theme="light"] .memory-card,html[data-theme="light"] .report-metrics article,html[data-theme="light"] .report-panel { background:rgba(255,255,255,.88); }
html[data-theme="light"] .summary .brief,html[data-theme="light"] .memory-card.featured { color:#34372f; background:radial-gradient(circle at 90% 40%,rgba(216,237,63,.3),transparent 44%),#fff; }
html[data-theme="light"] .column { background:rgba(231,230,221,.7); } html[data-theme="light"] .column-count { color:#55594f; background:#fff; }
html[data-theme="light"] .task-card { color:#0c0d0b; border-color:rgba(12,13,11,.13); }
html[data-theme="light"] .task-card footer { border-top-color:rgba(12,13,11,.08); } html[data-theme="light"] .agent-name { color:#454840; } html[data-theme="light"] .card-meta span:not(:empty) { background:rgba(12,13,11,.055); }
html[data-theme="light"] dialog { color:#0c0d0b; background:linear-gradient(145deg,#fff,#f2f1eb); } html[data-theme="light"] .icon-button,html[data-theme="light"] .field input,html[data-theme="light"] .field select,html[data-theme="light"] .field textarea { color:#0c0d0b; background:#fff; }
html[data-theme="light"] .upload-zone { color:#31342e; background:rgba(216,237,63,.09); } html[data-theme="light"] .attachment-item { background:#e8e7df; }
html[data-theme="light"] .execution-panel { background:rgba(102,115,19,.045); border-color:rgba(102,115,19,.22); } html[data-theme="light"] .run-details pre { color:#32362e; background:rgba(12,13,11,.045); }
html[data-theme="light"] .secondary-button { color:#0c0d0b; background:#fff; } html[data-theme="light"] .governance-note { color:#42463d; background:rgba(216,237,63,.12); }
html[data-theme="light"] .config-notice { color:#42463d; background:rgba(102,115,19,.07); border-color:rgba(102,115,19,.2); }
html[data-theme="light"] .config-dialog-actions { background:rgba(242,241,235,.94); }
html[data-theme="light"] .bar-item strong { color:#0c0d0b; } html[data-theme="light"] .provider-track { background:rgba(12,13,11,.09); }

/* --- LOGIN REVBRAIN OPS (PADRÃO COPILOTO) --- */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070806;
  padding: 24px;
  overflow-x: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.auth-overlay[hidden] {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}
.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(241, 240, 233, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 240, 233, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 50%, #000 40%, transparent 85%);
  pointer-events: none;
}
.orb {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 237, 63, 0.12), transparent 70%);
  filter: blur(50px);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  background: #121411;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: clamp(28px, 6vw, 44px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(216, 237, 63, 0.06);
}
.logo-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-logo {
  display: block;
  text-decoration: none;
}
.brand-logo img {
  height: 20px;
  width: auto;
  display: block;
}
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: monospace, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--lime, #d8ed3f);
  background: rgba(216, 237, 63, 0.1);
  border: 1px solid rgba(216, 237, 63, 0.25);
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge-status span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lime, #d8ed3f);
  box-shadow: 0 0 8px var(--lime, #d8ed3f);
}
.card-hero h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: #fff;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-family: monospace, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #a4a99d;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.input-control {
  width: 100%;
  height: 48px;
  background: #181b16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  font-family: Archivo, sans-serif;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
}
.input-control:focus {
  border-color: var(--lime, #d8ed3f);
  background: #1d211b;
  box-shadow: 0 0 16px rgba(216, 237, 63, 0.2);
}
#loginTotp {
  letter-spacing: 0.4em;
  font-family: monospace, sans-serif;
  font-size: 18px;
  text-align: center;
}
.btn-submit {
  width: 100%;
  height: 50px;
  background: var(--lime, #d8ed3f);
  color: #0c0d0b;
  border: none;
  border-radius: 12px;
  font-family: Archivo, sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(216, 237, 63, 0.3);
}
.btn-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(216, 237, 63, 0.5);
}
.error-box {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.35);
  color: #ff6b6b;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.success-box {
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.35);
  color: #2ecc71;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-aux-links {
  margin-top: 16px;
  text-align: center;
}
.link-btn {
  background: none;
  border: none;
  color: #a4a99d;
  font-family: monospace, sans-serif;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}
.link-btn:hover {
  color: var(--lime, #d8ed3f);
}
.card-foot {
  margin-top: 26px;
  text-align: center;
  font-family: monospace, sans-serif;
  font-size: 11px;
  color: #64685e;
}

/* Perfil no sidebar */
.user-profile {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--purple);
  color: #0c0d0b;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-info strong {
  display: block;
  font-size: 12px;
  color: var(--ink);
}
.user-info small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.security-button {
  background: rgba(216, 237, 63, 0.08);
  border: 1px solid rgba(216, 237, 63, 0.25);
  color: var(--lime, #d8ed3f);
  font-size: 10px;
  font-family: inherit;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.security-button:hover {
  background: rgba(216, 237, 63, 0.18);
  box-shadow: 0 0 12px rgba(216, 237, 63, 0.2);
}
.security-button.active {
  background: rgba(46, 204, 113, 0.1);
  border-color: rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}
.logout-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-family: inherit;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.logout-button:hover {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

/* Modal 2FA */
.modal-2fa-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-guide p {
  font-size: 13px;
  color: var(--ink);
  margin: 0;
}
.qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: #ffffff;
  border-radius: 16px;
  width: fit-content;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.qr-container img {
  width: 180px;
  height: 180px;
  display: block;
}
.manual-secret-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}
.manual-secret-box small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}
.secret-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.secret-row code {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--lime, #d8ed3f);
  background: #181b16;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(216, 237, 63, 0.2);
}
.copy-btn {
  background: var(--lime, #d8ed3f);
  color: #0c0d0b;
  border: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-btn:hover {
  filter: brightness(1.1);
}
