/* Look and feel follows the DET Finance Test Hub: Salesforce blue/navy, pale-blue canvas, white 12px cards,
   icon chips, status pills, floating Agentforce launcher. */
:root { --ink:#032d60; --accent:#0176d3; --bg:#eef4fa; --line:#d8e1ed; --muted:#52647a; --ok:#2e844a; --warn:#b45f06; --err:#ba0517; --header-h:80px; }
* { box-sizing: border-box; }
[hidden] { display:none !important; }
body { margin:0; font:15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background:var(--bg); color:var(--ink); padding-top:var(--header-h); }

/* fixed to the viewport so it stays put while the page scrolls underneath it. */
header.brand { background:#fff; border-bottom:3px solid var(--accent); padding:0 32px; height:var(--header-h); display:flex; align-items:center; gap:20px;
               position:fixed; top:0; left:0; right:0; z-index:20; }
.brand-logo { height:52px; width:auto; display:block; flex:none; }
.brand-title { border-left:1px solid var(--line); padding-left:20px; min-width:0; }
.brand-title h1 { margin:0; font-size:22px; line-height:1.2; letter-spacing:-.3px; color:var(--ink); }
.sub { margin:2px 0 0; font-size:13px; color:var(--muted); }
.brand-path { margin-left:auto; display:flex; align-items:center; gap:10px; color:var(--muted); }
.logo-chip { display:inline-flex; align-items:center; justify-content:center; background:#fff; border:1px solid var(--line); border-radius:10px; padding:5px 10px; height:40px; }
.logo-chip img { height:100%; width:auto; max-width:90px; object-fit:contain; display:block; }
.brand-path .logo-chip { height:36px; }

/* layout: sidebar fixed to the viewport + scrolling content */
.shell { display:flex; min-height:calc(100vh - var(--header-h)); }
.sidebar { width:280px; flex:none; background:#fff; border-right:1px solid var(--line); display:flex; flex-direction:column; overflow:hidden;
           position:fixed; top:var(--header-h); left:0; height:calc(100vh - var(--header-h)); z-index:5; }
.menu { list-style:none; margin:0; padding:16px 12px; }
.nav { width:100%; display:flex; align-items:center; gap:12px; background:none; border:0; border-left:3px solid transparent; color:var(--ink); font:inherit; font-weight:600;
       text-align:left; padding:11px 14px; border-radius:6px; cursor:pointer; }
.nav:hover { background:#f2f7fc; }
.nav.active { background:#eaf4ff; border-left-color:var(--accent); color:#014486; }
.sidebar svg { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

main { flex:1; min-width:0; padding:28px 32px 24px; margin-left:280px; display:flex; flex-direction:column; min-height:calc(100vh - var(--header-h)); }
.view { flex:1; }
footer.copyright { text-align:center; font-size:11px; color:#768699; padding:28px 0 4px; }

.hero { background:linear-gradient(110deg, #032d60, #0176d3); color:#fff; border-radius:12px; padding:28px 32px; margin-bottom:24px; box-shadow:0 3px 12px #032d6014; }
.hero h2 { margin:0 0 8px; font-size:26px; letter-spacing:-.5px; }
.hero p { margin:0; max-width:820px; color:#e3f0ff; }
.hero .go.primary { background:#fff; color:var(--accent); margin-top:18px; font-weight:650; }
.page-head h2 { margin:0 0 4px; font-size:24px; letter-spacing:-.5px; } .page-head p { margin:0 0 20px; color:var(--muted); }
.section-title { font-size:14px; text-transform:uppercase; letter-spacing:1.2px; color:#46637e; margin:0 0 12px; }

.panel { background:#fff; border:1px solid var(--line); border-radius:12px; padding:22px 28px; box-shadow:0 3px 12px #032d6008; margin-top:24px; }
.panel h3 { font-size:16px; margin:18px 0 4px; } .panel h3:first-child { margin-top:0; }
.panel li { color:#33465d; }
code { background:#eef1f6; padding:0 4px; border-radius:3px; }

/* pills */
.status { font-size:11px; font-weight:650; padding:4px 10px; border-radius:12px; white-space:nowrap; }
.status.ok { color:#276742; background:#e9f6ed; } .status.planned { color:var(--muted); background:#eef1f5; }

/* capability cards (home) */
.capabilities { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:16px; }
.capability { display:flex; flex-direction:column; align-items:flex-start; gap:8px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:18px 20px; }
.capability.active { border-top:3px solid var(--accent); }
.capability h4 { margin:6px 0 0; font-size:17px; } .capability p { margin:0; font-size:13px; color:var(--muted); flex:1; }
.cap-top { display:flex; align-items:center; justify-content:space-between; width:100%; }
.capability .logo-chip { height:44px; min-width:44px; }

button.go { background:var(--accent); color:#fff; border:0; border-radius:6px; padding:11px 16px; font:inherit; font-weight:650; cursor:pointer; }
button.go:hover:not(:disabled) { filter:brightness(1.08); }
button.go:focus-visible, .nav:focus-visible, .agent-launcher:focus-visible, button.btn:focus-visible { outline:3px solid #91c6ff; outline-offset:2px; }
button.go.primary { margin-top:14px; } button.go.danger { background:var(--err); }
button.go.secondary { background:#fff; color:var(--accent); border:1px solid var(--accent); }
button.go:disabled { opacity:.55; cursor:not-allowed; }
.capability button.go { margin-top:6px; font-size:13px; padding:8px 14px; }
a.btn, button.btn { background:#eaf4ff; color:var(--accent); text-decoration:none; border:0; cursor:pointer; padding:7px 13px; border-radius:6px;
                    font-size:14px; font-weight:650; font-family:inherit; line-height:21px; }
a.btn:hover, button.btn:hover { background:var(--accent); color:#fff; }

/* scenarios: list on the left, jobs pinned on the right */
.workspace-grid { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:24px; align-items:start; }
.tiles-col { min-width:0; }
/* catalog bar: one card; Section and Folder share a row (1fr / 2fr), File spans the row below, the count and Run all sit under that.
   Every control has the same height, border and radius so the edges line up with each other and with the tiles. */
.catalog-bar { display:grid; grid-template-columns:minmax(150px,1fr) minmax(0,2fr); gap:16px; align-items:end; background:#fff; border:1px solid var(--line);
               border-radius:12px; padding:16px 20px; margin-bottom:12px; box-shadow:0 3px 12px #032d6008; }
.field.wide { grid-column:1 / -1; }
.field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.field > label { font-size:12px; font-weight:650; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.control { width:100%; height:44px; font:inherit; font-size:15px; color:var(--ink); background:#fff; border:1px solid #c6d2df; border-radius:6px; padding:0 40px 0 12px; text-align:left;
           appearance:none; -webkit-appearance:none; cursor:pointer; line-height:42px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
           background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2352647a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
           background-repeat:no-repeat; background-position:right 14px center; }
.control:hover:not(:disabled) { border-color:var(--accent); }
.control:focus-visible, .combo-list:focus-visible { outline:3px solid #91c6ff; outline-offset:1px; border-color:var(--accent); }
.control:disabled { background-color:#f4f5f7; color:#8592a1; cursor:not-allowed; }
.combo { position:relative; }
.combo .control, #section { display:block; }
.combo-text { display:block; overflow:hidden; text-overflow:ellipsis; white-space:pre; }
.combo-list { position:absolute; z-index:15; top:calc(100% + 4px); left:0; right:0; max-height:min(420px, 60vh); overflow-y:auto; margin:0; padding:6px; list-style:none; background:#fff;
              border:1px solid #c6d2df; border-radius:8px; box-shadow:0 10px 30px #032d6026; }
.opt { padding:9px 12px; border-radius:6px; cursor:pointer; }
.opt + .opt { margin-top:2px; }
.opt.active, .opt:hover { background:#eaf4ff; }
.opt[aria-selected="true"] { box-shadow:inset 3px 0 0 var(--accent); }
.opt-top { display:flex; align-items:flex-start; gap:10px; min-width:0; }
.opt-name { font-weight:650; min-width:0; flex:1; overflow-wrap:anywhere; }
.opt-desc { margin:3px 0 0; font-size:13px; color:var(--muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.bar-foot { grid-column:1 / -1; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:14px; border-top:1px solid var(--line); }
.bar-foot .go { height:44px; padding:0 18px; }
.scen-count { margin:0; font-weight:650; }
.retry { margin-left:8px; }
.scen-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.scen { background:#fff; border:1px solid var(--line); border-radius:10px; padding:12px 16px; display:flex; align-items:flex-start; gap:16px; box-shadow:0 3px 12px #032d6008; }
.scen-main { flex:1; min-width:0; }
.scen-top { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.scen-name { font-weight:650; margin-top:6px; }
.scen-desc { margin:4px 0 0; font-size:14px; color:#33465d; }
.scen-meta { margin-top:4px; font-size:12px; color:var(--muted); }
.scen .btn { flex:none; min-width:72px; }
.scen.upcoming { background:#f6f7f9; box-shadow:none; color:#8592a1; }
.scen.upcoming .scen-name, .scen.upcoming .scen-desc { color:#8592a1; }

/* jobs column */
.jobs-col { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px 20px; min-height:160px; position:sticky; top:calc(var(--header-h) + 16px); }
.jobs-col h2 { font-size:16px; margin:0 0 12px; }
.jobs-empty { color:var(--muted); font-size:13px; background:#f4f8fc; padding:12px 14px; border-radius:8px; margin:0; }
.tiles-col .jobs-empty { margin-top:10px; }
.job { background:#fff; border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:12px; border-left:5px solid var(--accent); }
.job.ok { border-left-color:var(--ok); } .job.warn { border-left-color:var(--warn); } .job.err { border-left-color:var(--err); }
.job-head { display:flex; gap:14px; align-items:baseline; flex-wrap:wrap; }
.job-id { font:600 13px ui-monospace, Menlo, monospace; background:#eef1f6; padding:2px 8px; border-radius:4px; }
.job-title { font-weight:650; } .job-state { margin-left:auto; font-size:12px; font-weight:650; padding:3px 10px; border-radius:12px; background:#eaf4ff; color:#014486; }
.job.ok .job-state { color:#276742; background:#e9f6ed; } .job.warn .job-state { color:var(--warn); background:#fff3e0; } .job.err .job-state { color:var(--err); background:#fdecea; }
.bar { height:10px; background:#e3e9f2; border-radius:6px; overflow:hidden; margin:10px 0 6px; }
.fill { height:100%; width:0; background:var(--accent); border-radius:6px; transition:width .5s ease; }
.job.ok .fill { background:var(--ok); } .job.warn .fill { background:var(--warn); } .job.err .fill { background:var(--err); }
.job.running .fill { background-image:linear-gradient(90deg, #ffffff00, #ffffff55, #ffffff00); background-size:200% 100%; animation:shine 1.4s linear infinite; }
@keyframes shine { to { background-position:-200% 0; } }
.stage { font-size:14px; color:#33465d; } .job.err .stage { color:var(--err); white-space:pre-wrap; overflow-wrap:anywhere; }
.counts { display:flex; gap:8px; margin-top:8px; } .counts:empty { display:none; }
.count { font-size:13px; font-weight:650; padding:2px 10px; border-radius:12px; }
.count.pass { background:#e9f6ed; color:#276742; } .count.fail { background:#fff3e0; color:var(--warn); } .count.skip { background:#eef1f5; color:var(--muted); }
.actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:10px; } .actions:empty { display:none; }

/* reload warning */
.modal-backdrop { position:fixed; inset:0; background:#032d6099; display:flex; align-items:center; justify-content:center; z-index:40; }
.modal { background:#fff; border-radius:12px; padding:24px 28px; max-width:480px; box-shadow:0 10px 40px #0006; }
.modal h3 { margin:0 0 8px; color:var(--err); } .modal ul { padding-left:20px; }
.modal-actions { display:flex; gap:12px; justify-content:flex-end; margin-top:16px; }
.modal-actions .go { margin:0; }

/* Agentforce placeholder (upcoming feature, no backend) */
.agent-launcher { position:fixed; right:28px; bottom:24px; z-index:30; display:flex; align-items:center; gap:12px; padding:12px 22px 12px 14px; border:0; border-radius:16px; cursor:pointer;
                  background:linear-gradient(110deg, #032dca, #0176d3); color:#fff; font:inherit; font-size:16px; font-weight:650; box-shadow:0 5px 20px #032d6030; }
.agent-launcher img { width:36px; height:36px; display:block; } .agent-launcher:hover { filter:brightness(.95); }
.agent-panel { position:fixed; right:20px; bottom:20px; z-index:35; width:420px; max-width:calc(100vw - 16px); height:560px; max-height:calc(100dvh - 40px);
               background:#fff; border:1px solid var(--line); border-radius:10px; box-shadow:0 12px 48px #032d6033; display:flex; flex-direction:column; overflow:hidden; }
.agent-panel.expanded { width:min(760px, calc(100vw - 40px)); height:calc(100dvh - 40px); }
.agent-head { display:flex; align-items:center; justify-content:space-between; padding:12px 20px; border-bottom:1px solid #e5e5e5; }
.agent-head h2 { margin:0; font-size:20px; font-weight:400; }
.agent-actions button { background:none; border:0; color:var(--ink); font-size:22px; padding:4px 10px; border-radius:6px; cursor:pointer; } .agent-actions button:hover { background:var(--bg); }
.agent-body { flex:1; padding:28px 24px; overflow:auto; } .agent-body h3 { margin:14px 0 6px; font-size:18px; font-weight:500; color:#4a4a4a; } .agent-body p { margin:0; color:#4a4a4a; }
.agent-avatar { width:44px; height:44px; display:block; margin-bottom:12px; }
.agent-composer { display:flex; align-items:center; gap:8px; margin:10px 16px 16px; padding:6px 8px 6px 20px; border:1px solid #c9c9c9; border-radius:30px; background:#fafafa; }
.agent-composer input { flex:1; border:0; background:transparent; font:inherit; padding:8px 0; } .agent-composer input:focus { outline:none; }
.agent-composer button { border:0; border-radius:50%; width:38px; height:38px; display:grid; place-items:center; background:#f3f3f3; color:#9a9a9a; }

/* left panel: Snowflake environment */
.side-env { border-top:1px solid var(--line); padding:12px 12px 14px; }
.side-env h3 { margin:0 0 8px; font-size:12px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.env-now { display:flex; align-items:center; gap:8px; font-weight:650; } .env-now img { width:20px; height:20px; object-fit:contain; }
.env-now .chip { margin-left:auto; }
.env-note { margin:6px 0 0; font-size:12px; color:var(--muted); line-height:1.4; }

/* left panel: jobs in this session */
.side-jobs { flex:1; min-height:0; overflow-y:auto; border-top:1px solid var(--line); padding:12px 12px 16px; }
.side-jobs h3 { margin:0 0 8px; font-size:12px; letter-spacing:.04em; text-transform:uppercase; color:var(--muted); }
.side-empty { font-size:13px; color:var(--muted); margin:0; }
.jrow { border:1px solid var(--line); border-radius:8px; padding:8px 10px; margin-bottom:8px; background:#fff; display:flex; flex-direction:column; gap:2px; }
.jrow-head { display:flex; gap:8px; align-items:center; justify-content:space-between; }
.jrow-title { font-weight:650; font-size:13px; color:var(--ink); overflow-wrap:anywhere; }
.jrow-meta { font:12px ui-monospace, Menlo, monospace; color:var(--muted); margin-top:2px; }
.chip { font-size:11px; font-weight:650; padding:2px 8px; border-radius:10px; white-space:nowrap; background:#eef1f5; color:var(--muted); }
.chip.loaded, .chip.passed { background:#e9f6ed; color:#276742; } .chip.ready, .chip.failed { background:#fff4e0; color:#8a5300; }
.chip.running { background:#eaf4ff; color:#014486; } .chip.error { background:#fdecea; color:var(--err); }

@media (max-width:1100px) { .workspace-grid { grid-template-columns:1fr; } .jobs-col { position:static; } }
@media (max-width:640px) { .catalog-bar { grid-template-columns:1fr; } }
@media (max-width:900px) { .brand-path { display:none; } }
@media (max-width:760px) { :root { --header-h:72px; } .brand-title .sub { display:none; } .shell { flex-direction:column; }
                           .sidebar { width:auto; height:auto; position:static; border-right:0; border-bottom:1px solid var(--line); overflow:visible; }
                           main { margin-left:0; padding:20px 16px; } .menu { display:flex; padding:8px; } .agent-launcher { right:14px; bottom:14px; }
                           .side-jobs { display:none; } }
