:root {
  --bg: #f4f6fa; --card: #fff; --ink: #131a26; --muted: #5b6676; --line: #e1e6ee;
  --brand: #2348e0; --brand-dark: #1a37b3; --brand-soft: #eaf0ff; --ok: #177a43; --warn: #8f5b00; --bad: #c12c2c;
  --side: #0f172a; --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
h1 { font-size: 24px; letter-spacing: -.01em; margin: 0 0 4px; } h2 { font-size: 16px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 18px 0 8px; }
a { color: var(--brand); } code { background: #eef1f6; padding: 1px 6px; border-radius: 5px; font-size: 13px; word-break: break-all; }
.muted { color: var(--muted); } .center { text-align: center; padding: 48px 16px; } .hidden { display: none !important; }

.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--side); color: #c5cedc; padding: 22px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { color: #fff; font-weight: 800; font-size: 20px; padding: 0 10px 14px; text-decoration: none; letter-spacing: -.02em; } .logo span { color: #8ea6ff; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7b879b; padding: 12px 10px 4px; }
.side button { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.side button:hover { background: #1c2740; color: #fff; } .side button.on { background: var(--brand); color: #fff; font-weight: 600; }
.who { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid #24304a; font-size: 13px; word-break: break-word; }
.who .org { color: #fff; font-weight: 600; margin-bottom: 6px; } .muted-light { color: #8b97ab; font-size: 12px; }
.meter { height: 6px; background: #24304a; border-radius: 999px; margin: 10px 0 4px; overflow: hidden; } .meter div { height: 100%; background: #8ea6ff; border-radius: 999px; }
.side .linkish { padding: 6px 0 0; text-decoration: underline; width: auto; }
.main { padding: 30px 34px; max-width: 1200px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; } .row > * { flex: 1 1 190px; min-width: 0; } .row > .fit { flex: 0 0 auto; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; } .grid3 .card { margin-bottom: 0; }
label { display: block; font-size: 13px; font-weight: 500; color: #3d4757; margin-bottom: 5px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 4px 0; } label.check input { width: auto; }
input, select, textarea { width: 100%; font: inherit; padding: 9px 12px; border: 1px solid #c8d0dc; border-radius: 9px; background: #fff; color: var(--ink); }
input:disabled, select:disabled { background: #f1f4f8; color: var(--muted); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn { font: inherit; font-weight: 500; padding: 9px 16px; border-radius: 9px; border: 1px solid #c8d0dc; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f4f6fa; } .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--bad); border-color: #e6b8b8; } .btn.small { padding: 4px 10px; font-size: 13px; } .btn:disabled { opacity: .55; cursor: default; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; } tbody tr:last-child td { border-bottom: 0; } tbody tr:hover { background: #fafbfd; }
td.wrap { word-break: break-all; max-width: 340px; } .scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e9edf3; color: #3b4654; }
.pill.active, .pill.completed, .pill.current { background: #dcf3e5; color: var(--ok); } .pill.disabled, .pill.restricted, .pill.running { background: #fdefd1; color: var(--warn); }
.pill.blocked, .pill.suspended, .pill.closed, .pill.failed, .pill.revoked { background: #fbe0e0; color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 26px; color: var(--ink); letter-spacing: -.02em; } .card .stat { background: #f8fafc; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); } .kv:last-child { border: 0; } .kv span { word-break: break-all; }
.step { display: flex; align-items: center; gap: 10px; padding: 6px 0; } .step.done { color: var(--muted); text-decoration: line-through; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c8d0dc; display: inline-grid; place-items: center; font-size: 13px; color: #fff; flex: none; }
.step.done .tick { background: var(--ok); border-color: var(--ok); }
.bars { display: flex; align-items: end; gap: 3px; height: 110px; padding-top: 8px; } .bars div { flex: 1; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.auth { max-width: 420px; margin: 8vh auto; padding: 0 16px; } .auth h1 { font-size: 26px; }
.banner { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: #fdefd1; color: #6b4500; } .banner.bad { background: #fbe0e0; color: #8a1f1f; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal-card { background: #fff; border-radius: 16px; padding: 26px; width: min(720px, 100%); max-height: 90vh; overflow: auto; position: relative; }
.close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--side); color: #fff; padding: 11px 20px; border-radius: 10px; z-index: 20; max-width: 90vw; box-shadow: 0 6px 20px rgba(15, 23, 42, .25); }
.toast.bad { background: var(--bad); } .actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .logo { width: 100%; padding-bottom: 4px; } .nav-group { display: contents; } .nav-title { display: none; } .side button { width: auto; }
  .who { display: none; } .main { padding: 18px; }
}
@media (prefers-reduced-motion: no-preference) { .btn, .side button { transition: background .12s; } }
