/* ACP console: sidebar shell on top of the shared app styles. */
:root { --blue: #3987e5; --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b; --surface: #0b0d11; }
body { overflow-x: hidden; }
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 20px 14px; border-right: 1px solid var(--line);
  background: rgba(5, 6, 8, .55); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); animation: drop .7s var(--ease) both; }
.side .brand { padding: 0 8px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .2s, background .2s; }
.side-nav a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.side-nav a:hover { color: var(--fg); background: rgba(255, 255, 255, .04); }
.side-nav a.on { color: var(--fg); background: rgba(255, 255, 255, .09); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
.side-nav a.on svg { stroke-width: 2; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-link { color: var(--muted); font-size: 13px; text-decoration: none; padding: 0 10px; }
.side-link:hover { color: var(--fg); }
.side-foot .pill { align-self: flex-start; }
.main { padding: 32px 36px 80px; min-width: 0; outline: none; }
.page { animation: rise .6s var(--ease) both; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.ph h1 { margin: 0; font: 400 40px/1 "Instrument Serif", serif; letter-spacing: -.02em; }
.ph p { margin: 8px 0 0; color: var(--muted); font-size: 14px; max-width: 640px; }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; }
h2.sec { margin: 0 0 12px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { padding: 16px 18px; }
.tile span { font-size: 12.5px; color: var(--muted); }
.tile b { display: block; margin-top: 6px; font-size: 28px; font-weight: 500; letter-spacing: -.04em; }
.tile b small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 4px; letter-spacing: 0; }
.tile em { display: block; margin-top: 2px; font-style: normal; font-size: 12px; color: var(--muted); }
.panel { padding: 18px; margin-bottom: 14px; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--muted); }
.mono { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; }
.empty-s { padding: 22px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--line); border-radius: 12px; }

/* Tables */
.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .025); }
.tbl tr.click { cursor: pointer; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .btn + .btn { margin-left: 4px; }

/* Status: color + icon dot + label, never color alone */
.st { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st.good { color: #4fd14f; border-color: rgba(12, 163, 12, .35); }
.st.warn { color: var(--warning); border-color: rgba(250, 178, 25, .35); }
.st.serious { color: var(--serious); border-color: rgba(236, 131, 90, .35); }
.st.bad { color: #ff7a7a; border-color: rgba(208, 59, 59, .45); }
.st.info { color: #8fbaf3; border-color: rgba(57, 135, 229, .4); }
.st.live::before { animation: live 1.4s ease-in-out infinite; }

/* Forms */
.form { display: grid; gap: 12px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.form .chk { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: 13.5px; }
.form .chk input { width: 16px; height: 16px; accent-color: #fafafa; }
textarea.code { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; line-height: 1.5; min-height: 220px; white-space: pre; tab-size: 2; }
.hint { font-size: 12px; color: var(--muted); }
.err-t { color: var(--err); font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--fg); font-size: 12.5px; cursor: pointer; }
.chip:hover { background: rgba(255, 255, 255, .08); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { height: 34px; width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* Workflow graph */
.dag-wrap { overflow-x: auto; padding: 6px 2px 2px; }
.dag { display: block; }
.dag .edge { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 1.5; }
.dag .edge.done { stroke: rgba(79, 209, 79, .55); }
.dag .node rect { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .16); stroke-width: 1; rx: 10; transition: stroke .2s, fill .2s; }
.dag .node { cursor: pointer; }
.dag .node:hover rect { fill: rgba(255, 255, 255, .08); }
.dag .node.sel rect { stroke: #fafafa; stroke-width: 1.5; }
.dag .node text { fill: #fafafa; font: 500 12.5px Geist, sans-serif; }
.dag .node text.sub { fill: rgba(250, 250, 250, .55); font: 400 11px "Geist Mono", monospace; }
.dag .node .dot { r: 4; }
.dag .s-succeeded .dot { fill: #4fd14f; } .dag .s-failed .dot { fill: #ff6b6b; } .dag .s-running .dot { fill: #8fbaf3; animation: live 1.2s infinite; }
.dag .s-waiting .dot { fill: var(--warning); animation: live 1.6s infinite; } .dag .s-ready .dot { fill: #8fbaf3; } .dag .s-pending .dot, .dag .s-skipped .dot, .dag .s-cancelled .dot { fill: rgba(255, 255, 255, .3); }
.dag .s-failed rect { stroke: rgba(255, 107, 107, .5); } .dag .s-waiting rect { stroke: rgba(250, 178, 25, .55); }

pre.out { margin: 0; max-height: 280px; overflow: auto; padding: 12px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); font: 12px/1.5 "Geist Mono", monospace; white-space: pre-wrap; word-break: break-word; }

/* Event feed */
.feed { display: flex; flex-direction: column; max-height: 520px; overflow: auto; font-size: 13px; }
.ev { display: grid; grid-template-columns: 78px 64px minmax(0, 1fr); gap: 10px; padding: 7px 4px; border-bottom: 1px solid rgba(255, 255, 255, .045); align-items: baseline; }
.ev time { font: 11.5px "Geist Mono", monospace; color: var(--muted); }
.ev .lv { font: 500 10.5px "Geist Mono", monospace; text-transform: uppercase; letter-spacing: .04em; }
.ev .lv.info { color: #8fbaf3; } .ev .lv.warn { color: var(--warning); } .ev .lv.error { color: #ff7a7a; } .ev .lv.debug { color: var(--muted); }
.ev .m { min-width: 0; overflow-wrap: anywhere; }
.ev .m code { color: var(--muted); font: 11.5px "Geist Mono", monospace; margin-right: 6px; }
.ev.new { animation: evIn .6s var(--ease); }
@keyframes evIn { from { opacity: 0; translate: 0 -6px; background: rgba(57, 135, 229, .12); } }
.ev a { color: inherit; }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 180px; overflow: visible; }
.chart .grid line { stroke: rgba(255, 255, 255, .06); }
.chart .axis text { fill: rgba(250, 250, 250, .5); font: 10.5px "Geist Mono", monospace; }
.chart .bar { fill: var(--blue); }
.chart .bar.hover { fill: #6aa6ef; }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: url(#cgrad); opacity: .5; }
.chart .cross { stroke: rgba(255, 255, 255, .3); stroke-width: 1; }
.chart .pt { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; z-index: 5; padding: 7px 10px; border-radius: 8px; background: #16181d; border: 1px solid var(--line); font-size: 12px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); transform: translate(-50%, -110%); }
.tip b { display: block; font-size: 13px; font-weight: 600; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.chart-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.chart-head .v { font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.chart-head .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
details.tview summary { cursor: pointer; font-size: 12px; color: var(--muted); margin-top: 8px; }

/* Bars in tables (capacity, usage) */
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--blue); transition: width .8s var(--ease); }

/* Modal + toast */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .25s ease both; }
.modal-card { width: min(720px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px; background: #0d0f13; animation: rise .45s var(--ease) both; }
.modal-card h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .4); border: 1px solid rgba(250, 178, 25, .35); font: 12.5px "Geist Mono", monospace; word-break: break-all; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; padding: 10px 16px; border-radius: 10px; background: #fafafa; color: #0a0a0a; font-size: 13.5px; font-weight: 500; pointer-events: none; transition: opacity .3s, transform .45s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #ff7a7a; }

@media (max-width: 1100px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 30; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; }
  .side-nav a { white-space: nowrap; }
  .side-foot { display: none; }
  .main { padding: 22px 16px 64px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
}
