/* DCC Agent Office console. System fonts only: the page makes no request to any other host. */
:root {
  --ground: #EEF2F4; --panel: #FFFFFF; --panel-2: #F6F9FA; --sunk: #E6ECEF;
  --ink: #0F171E; --ink-2: #3A4855; --muted: #66767F; --faint: #93A1A9;
  --line: #D4DDE2; --line-2: #E5EBEE;
  --accent: #0D5B60; --accent-ink: #FFFFFF; --accent-soft: #DDEEEE;
  --ok: #17684A; --ok-bg: #DFF1E8; --warn: #9A5B06; --warn-bg: #FBEEDB;
  --bad: #9B1C31; --bad-bg: #F8E3E6; --info: #3D5D78; --info-bg: #E3ECF3;
  --gold: #C98A12;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(15,23,30,.05), 0 6px 18px -12px rgba(15,23,30,.25);
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0B1116; --panel: #131C23; --panel-2: #18222A; --sunk: #0F171D;
    --ink: #E3EAEF; --ink-2: #B4C1CA; --muted: #8697A2; --faint: #647580;
    --line: #26333C; --line-2: #1D2830;
    --accent: #4DB5BA; --accent-ink: #062427; --accent-soft: #123134;
    --ok: #5BC596; --ok-bg: #0F2A20; --warn: #E6A955; --warn-bg: #2B1F0E;
    --bad: #EE7D8E; --bad-bg: #2C131A; --info: #8FB3D1; --info-bg: #15222D;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.9);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--ink); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
.boot { padding: 48px; color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px; }
.brand-mark i { background: var(--accent-soft); border-radius: 2px; }
.brand-mark i:last-child { background: var(--gold); }
.brand b { display: block; font-size: 14px; letter-spacing: .01em; }
.brand span { display: block; font-size: 11.5px; color: var(--muted); }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--radius); color: var(--ink-2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav .count { background: var(--warn-bg); color: var(--warn); font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 10px; }
.nav-sep { height: 1px; background: var(--line-2); margin: 10px 6px; }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 6px 10px 2px; }
.who { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--muted); display: grid; gap: 6px; }
.who b { color: var(--ink-2); font-weight: 600; word-break: break-all; }
.main { padding: 26px 32px 64px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { font-size: 23px; font-weight: 650; }
.head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }

/* ---------- blocks ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel + .panel, .grid + .panel, .panel + .grid { margin-top: 16px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.panel-h h2 { font-size: 14.5px; font-weight: 650; }
.panel-h .sub { color: var(--muted); font-size: 12.5px; }
.panel-b { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.stat { background: var(--panel); padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); } .stat.ok b { color: var(--ok); }
.empty { padding: 26px 16px; color: var(--muted); text-align: center; }
.note { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px; color: var(--ink-2); }
.note.warn { border-left-color: var(--gold); }
.note.bad { border-left-color: var(--bad); }
.note b { color: var(--ink); }

/* ---------- tables ---------- */
.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.clip { max-width: 440px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- pills ---------- */
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 10px; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=password], input:not([type]), select, textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 380px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 7px 14px; border-radius: var(--radius); font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ok { color: var(--ok); border-color: var(--ok); background: transparent; }
.btn.ok:hover { background: var(--ok-bg); }
.btn.small { padding: 3px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- trace ---------- */
.run { border-top: 1px solid var(--line-2); padding: 12px 16px; }
.run:first-child { border-top: 0; }
.run.d1 { margin-left: 26px; border-left: 2px solid var(--accent-soft); }
.run.d2 { margin-left: 52px; border-left: 2px solid var(--accent-soft); }
.run.d3 { margin-left: 78px; border-left: 2px solid var(--accent-soft); }
.run-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.run-h b { font-size: 14px; }
.run-h .meta { color: var(--muted); font-size: 12.5px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps li { display: grid; grid-template-columns: 26px 84px 1fr; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13.5px; }
.steps .seq { color: var(--faint); font-family: var(--mono); font-size: 11.5px; text-align: right; }
.steps details { grid-column: 3; }
.steps summary { cursor: pointer; color: var(--muted); font-size: 12px; }
pre.box { background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; max-height: 420px; overflow-y: auto; }
.answer { white-space: pre-wrap; line-height: 1.6; }

/* ---------- approval ---------- */
.appr { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.appr + .appr { margin-top: 14px; }
.appr-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.appr-b { padding: 14px 16px; display: grid; gap: 12px; }
.mail { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mail-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.mail-row span { color: var(--muted); }
.mail-body { padding: 12px; white-space: pre-wrap; line-height: 1.6; background: var(--panel-2); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- gate (sign-in) ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 30px 30px 24px; }
.gate-card h1 { font-size: 21px; margin: 14px 0 6px; }
.gate-card p { color: var(--ink-2); margin: 0 0 18px; }
.gate-card .btn.primary { width: 100%; padding: 10px 14px; }
.gate-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); }
.gate details { margin-top: 16px; }
.gate summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-top: 8px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: var(--panel); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 420px; z-index: 50; }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav-sep, .nav-label, .who { display: none; }
  .main { padding: 18px 16px 48px; }
  .steps li { grid-template-columns: 22px 1fr; }
  .steps li .pill { grid-column: 2; justify-self: start; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
