:root {
  color-scheme: light;
  --bg: #f4f5fb; --panel: #ffffff; --ink: #0f172a; --muted: #64748b; --line: #e7eaf3; --line2: #f0f2f8;
  --accent: #5b5bf0; --accent2: #8b5cf6; --accent-ink: #ffffff; --accent-soft: #eef0ff;
  --ok: #059669; --ok-soft: #e4f7ef; --warn: #b45309; --warn-soft: #fff3de; --bad: #e11d48; --bad-soft: #ffe8ee;
  --idle: #d8dde9; --c1: #5b5bf0; --c2: #cdd3e4; --c3: #f43f5e; --c4: #14b8a6; --c5: #f59e0b; --c6: #8b5cf6;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px rgba(15,23,42,.05);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 340px at 85% -80px, #e6e9ff 0%, rgba(230,233,255,0) 70%), var(--bg); }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.banner { background: linear-gradient(90deg, #fff8e8, #fff1d6); color: #92580a; text-align: center; padding: 5px 12px; font-weight: 600; font-size: 12px; letter-spacing: .02em; border-bottom: 1px solid #f6e3b8; }
.paused { background: var(--bad); color: #fff; text-align: center; padding: 8px 12px; font-weight: 600; }
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 30px); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 750; font-size: 19px; letter-spacing: -.02em; padding: 2px 10px 22px; display: flex; align-items: center; gap: 10px; }
.brand svg { width: 30px; height: 30px; flex: none; border-radius: 9px; box-shadow: 0 4px 12px rgba(91,91,240,.35); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: #475569; font-weight: 550; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a:hover { background: #f5f6fb; text-decoration: none; color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.nav a .badge { margin-left: auto; }
.badge { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; line-height: 19px; }
.me { margin-top: auto; padding: 12px; border: 1px solid var(--line); border-radius: 14px; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; background: #fafbfe; }
.me .av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.me > div { min-width: 0; } .me b { color: var(--ink); display: block; font-weight: 650; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
main { padding: 0 32px 70px; max-width: 1280px; width: 100%; }
.top { display: flex; align-items: center; gap: 14px; padding: 18px 0 14px; }
.top .search { flex: 1; max-width: 420px; position: relative; } .top .search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.top .search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 12px; background: #fff; }
.top .sp { flex: 1; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -.025em; margin: 6px 0 4px; } h2 { font-size: 15px; font-weight: 650; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 11px; margin: 0 0 8px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g-kpi { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.g-2 { grid-template-columns: 1.6fr 1fr; } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-eq { grid-template-columns: 1fr 1fr; }
.strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 12px; font-size: 12px; color: #475569; font-weight: 550; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px var(--ok-soft); } .dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); } .dot.warn { background: var(--warn); }
.kpi { position: relative; padding: 18px; } .kpi .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); } .kpi .ic svg { width: 18px; height: 18px; }
.kpi .v { font-size: 28px; font-weight: 750; letter-spacing: -.03em; line-height: 1.1; } .kpi .l { color: var(--muted); font-size: 12px; font-weight: 550; margin-bottom: 2px; } .kpi .d { font-size: 12px; margin-top: 6px; color: var(--muted); }
.up { color: var(--ok); font-weight: 600; } .down { color: var(--bad); font-weight: 600; } .flat { color: var(--muted); }
.attn { border-left: 4px solid var(--bad); background: linear-gradient(90deg, #fff5f7, #fff 38%); margin-bottom: 18px; }
.attn.clear { border-left-color: var(--ok); background: linear-gradient(90deg, #f0fbf6, #fff 38%); }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line2); } .row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; } .row .t { font-weight: 650; } .row .m { color: var(--muted); font-size: 12px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 14px; cursor: pointer; font-weight: 600; transition: box-shadow .15s, border-color .15s; }
.btn:hover { border-color: #c9cffb; box-shadow: 0 2px 8px rgba(91,91,240,.12); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 4px 12px rgba(91,91,240,.28); }
.btn.primary:hover { box-shadow: 0 6px 16px rgba(91,91,240,.38); }
.btn.danger { color: var(--bad); } .btn.small { padding: 4px 11px; font-size: 12px; border-radius: 9px; } .btn[disabled] { opacity: .5; cursor: not-allowed; }
.tag { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.t-ok { background: var(--ok-soft); color: var(--ok); } .t-bad { background: var(--bad-soft); color: var(--bad); } .t-warn { background: var(--warn-soft); color: var(--warn); }
.t-idle { background: #f1f3f9; color: #64748b; } .t-acc { background: var(--accent-soft); color: var(--accent); }
.bars .b { display: grid; grid-template-columns: 160px 1fr 56px; gap: 12px; align-items: center; margin: 9px 0; font-size: 13px; }
.bars .track { background: #eef0f7; border-radius: 99px; height: 9px; overflow: hidden; } .bars .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; }
.bars .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 550; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 12px; margin-top: 10px; } .legend i { width: 10px; height: 10px; border-radius: 4px; display: inline-block; margin-right: 6px; }
.seg { display: inline-flex; background: #eceef7; border-radius: 11px; padding: 3px; gap: 2px; } .seg button { border: 0; background: transparent; padding: 5px 13px; cursor: pointer; color: #64748b; border-radius: 9px; font-weight: 600; } .seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.1); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
svg { display: block; width: 100%; height: auto; } svg text { fill: #94a3b8; font-size: 10px; }
.health { display: grid; grid-template-columns: 70px repeat(30, 1fr); gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.health .c { aspect-ratio: 1; border-radius: 4px; background: #34d399; } .health .c.bad { background: var(--bad); } .health .c.miss { background: var(--idle); }
table { width: 100%; border-collapse: collapse; } th { text-align: left; color: #94a3b8; font-weight: 650; font-size: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
td { padding: 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; } tr.click { cursor: pointer; transition: background .12s; } tr.click:hover td { background: #f8f9fe; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; } input, select, textarea { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; } input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid rgba(91,91,240,.15); }
.bulk { position: sticky; top: 8px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-radius: 14px; padding: 10px 14px; display: flex; gap: 10px; align-items: center; margin-bottom: 12px; z-index: 3; box-shadow: 0 10px 24px rgba(91,91,240,.3); } .bulk .btn { color: var(--ink); }
.scroll { overflow-x: auto; }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(540px, 100%); background: #fff; border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(15,23,42,.12); padding: 24px; overflow-y: auto; z-index: 20; }
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.28); backdrop-filter: blur(2px); z-index: 19; }
.modal { position: fixed; z-index: 30; left: 50%; top: 18vh; transform: translateX(-50%); width: min(480px, calc(100% - 24px)); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: 0 24px 70px rgba(15,23,42,.25); }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; z-index: 40; max-width: 360px; box-shadow: 0 12px 30px rgba(15,23,42,.25); }
pre { background: #f7f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 12px; overflow-x: auto; font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 6px 0; }
.tl { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; } .tl div { margin: 0 0 12px; position: relative; } .tl div::before { content: ""; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form { display: grid; gap: 14px; } .form label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; } .form label span { color: var(--muted); font-weight: 400; font-size: 12px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; } .err { color: var(--bad); font-size: 12px; font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; } .switch input { display: none; } .switch .s { width: 42px; height: 24px; border-radius: 99px; background: var(--idle); position: relative; transition: background .15s; } .switch .s::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); transition: transform .15s; } .switch input:checked + .s { background: var(--accent); } .switch input:checked + .s::after { transform: translateX(18px); }
.empty { color: var(--muted); text-align: center; padding: 24px; }
/* rules page */
.card .kpi { padding: 0; } .grid.g-3 .kpi .v { font-size: 22px; }
@media (max-width: 1100px) { .g-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-2, .g-3, .g-eq { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; } .brand { padding: 4px 8px; } .me { display: none; } .nav { flex-direction: row; flex-wrap: wrap; } main { padding: 0 14px 50px; } .g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bars .b { grid-template-columns: 110px 1fr 44px; } .form .two { grid-template-columns: 1fr; } .top .search { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- added for the real app ---- */
.flash { border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; font-weight: 550; }
.flash.ok { background: var(--ok-soft); color: var(--ok); } .flash.bad { background: var(--bad-soft); color: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.me { margin: auto 0 0; } form.me { display: flex; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; } .login .card { width: min(380px, 100%); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; border-radius: 10px 10px 0 0; color: #475569; font-weight: 600; } .tabs a.on { color: var(--accent); border-bottom: 2px solid var(--accent); } .tabs a:hover { text-decoration: none; background: #f5f6fb; }
.seg a { display: inline-block; padding: 6px 14px; border-radius: 9px; color: #64748b; font-weight: 600; } .seg a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15,23,42,.1); } .seg a:hover { text-decoration: none; }
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 8px 14px; margin: 8px 0; } .kv span { color: var(--muted); } .kv b { font-weight: 600; word-break: break-word; }
.epbox { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.form select, .form input, .form textarea { width: 100%; }
.filters input, .filters select { min-width: 150px; }
.bulkbar { position: sticky; bottom: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-top: 10px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); flex-wrap: wrap; }
.health { display: block; } .hrow { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; margin: 5px 0; font-size: 12px; color: var(--muted); } .hcells { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; } .hcells .c { aspect-ratio: 1; border-radius: 4px; background: #34d399; } .hcells .c.bad { background: var(--bad); } .hcells .c.miss { background: var(--idle); }
.preview { background: #fafbfe; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; max-height: 280px; overflow: auto; }
details summary { cursor: pointer; color: var(--accent); font-size: 12px; }
code { background: #f1f3f9; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.card.kpi { padding: 18px; }
/* editors */
.mapgrid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; position: sticky; top: 10px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: grab; user-select: none; border: 1px solid transparent; } .chip:active { cursor: grabbing; } .chip.constant { background: #f1f3f9; color: #475569; }
.param { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.param.over { border-color: var(--accent); background: var(--accent-soft); }
.param .top2 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .param .name { font-weight: 650; font-family: ui-monospace, Menlo, monospace; }
.param .drop { flex: 1; min-width: 180px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 7px 10px; color: var(--muted); } .param .drop input { width: 100%; }
.param .drop.has { border-style: solid; border-color: #c9cffb; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.param .opts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; } .param select, .param input { padding: 5px 8px; font-size: 13px; }
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: #fff; } .rule.off { opacity: .55; }
.rule .rtop { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .rule .rbody { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; } .rule label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; } .rule input[type=text], .rule input[type=number] { min-width: 220px; }
.msg { border-radius: 10px; padding: 8px 12px; margin: 8px 0; } .msg.ok { background: var(--ok-soft); color: var(--ok); } .msg.bad { background: var(--bad-soft); color: var(--bad); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
@media (max-width: 900px) { .mapgrid { grid-template-columns: 1fr; } .chips { position: static; } .kv { grid-template-columns: 1fr; } }
.grid > *, .mapgrid > * { min-width: 0; }
pre { max-width: 100%; }
/* layout fixes: nothing may push the page wider than the window; fields line up in columns */
main { min-width: 0; }
.form { max-width: 980px; }
.form label { align-content: start; }
.form label > span { order: 3; font-size: 12px; color: var(--muted); font-weight: 400; }
.form label > input, .form label > select, .form label > textarea, .form label > div { order: 2; }
.form .two { gap: 16px 18px; }
.form textarea { min-height: 180px; resize: vertical; }
.card.form { padding: 26px; gap: 18px; }
.login .card { text-align: center; padding: 34px 30px; }
.login .brand { justify-content: center; font-size: 24px; padding-bottom: 22px; }
.login .btn.primary { font-size: 15px; }
/* sign-in page */
.login .card { width: min(400px, 100%); margin: 0 auto; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; color: #1f2937; border: 1px solid #d5d9e6; border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 15px; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
.gbtn:hover { text-decoration: none; border-color: #b9c0d8; box-shadow: 0 4px 14px rgba(15,23,42,.1); }
.loginerr { text-align: left; background: var(--bad-soft); color: #9f1239; border: 1px solid #fecdd3; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; display: grid; gap: 3px; font-size: 14px; }
.loginerr b { color: #be123c; }
.gbtn svg { width: 20px; height: 20px; flex: none; }
.loginbody { background: radial-gradient(900px 500px at 50% -10%, #e4e8ff 0%, rgba(228,232,255,0) 70%), radial-gradient(700px 400px at 100% 100%, #ece6ff 0%, rgba(236,230,255,0) 70%), var(--bg); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login .card { width: min(380px, 100%); padding: 40px 32px 30px; border-radius: 24px; box-shadow: 0 24px 60px rgba(63,60,187,.12), 0 2px 6px rgba(15,23,42,.05); }
.login .brand { font-size: 28px; padding-bottom: 28px; }
.gsi { display: flex; justify-content: center; min-height: 44px; }
.login .other { display: block; margin-top: 16px; font-size: 13px; color: var(--muted); }
.login .other:hover { color: var(--accent); }
