/* OSS 2.0 - self-contained stylesheet (no CDN needed) */
:root {
  --ink: oklch(0.27 0.03 232);
  --ink-2: oklch(0.34 0.035 232);
  --bg: oklch(0.985 0.004 224);
  --card: oklch(1 0 0);
  --line: oklch(0.91 0.01 224);
  --muted: oklch(0.52 0.03 224);
  --text: oklch(0.26 0.02 224);
  --primary: oklch(0.52 0.12 232);
  --primary-soft: oklch(0.94 0.03 228);
  --good: oklch(0.56 0.13 155);
  --warn: oklch(0.70 0.15 70);
  --bad: oklch(0.56 0.18 28);
  --signal: oklch(0.80 0.14 85);
  --radius: 10px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* shell */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.rail { background: var(--ink); color: oklch(0.9 0.01 224); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: baseline; gap: 8px; padding: 0 10px 18px; }
.brand b { font-size: 26px; letter-spacing: -0.02em; color: #fff; }
.brand span { font-size: 13px; color: var(--signal); font-weight: 600; letter-spacing: .08em; }
.rail a { color: inherit; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.rail a:hover { background: var(--ink-2); text-decoration: none; }
.rail a.on { background: var(--primary); color: #fff; }
.rail .sep { flex: 1; }
.rail .who { font-size: 13px; padding: 8px 10px; color: oklch(0.75 0.02 224); }
.rail form button { all: unset; cursor: pointer; padding: 8px 10px; font-size: 14px; color: oklch(0.8 0.02 224); }
.main { padding: 28px 36px 60px; max-width: 1500px; width: 100%; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; } .rail .sep { display: none; } .main { padding: 18px; } }

/* headings */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin: 0 0 12px; }
.kicker { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: 600 14px var(--font); cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--primary); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }

/* cards & grid */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g2, .g3 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }

/* hero numbers */
.hero { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 0; background: var(--ink); color: #fff; border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.hero > div { padding: 22px 24px; border-right: 1px solid var(--ink-2); }
.hero > div:last-child { border-right: 0; }
.hero .big { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .mid { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero .lab { font-size: 13px; color: oklch(0.78 0.02 224); margin-top: 6px; }
.hero .lead .big { color: var(--signal); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr 1fr; } }

/* pipeline = fibre route */
.route { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); position: relative; padding-top: 6px; }
.route::before { content: ""; position: absolute; left: 4%; right: 4%; top: 49px; height: 3px; background: linear-gradient(90deg, var(--primary), var(--signal)); border-radius: 3px; }
.stop { text-align: center; position: relative; padding: 0 4px; color: inherit; }
.stop:hover { text-decoration: none; }
.stop .n { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stop .dot { width: 16px; height: 16px; border-radius: 50%; margin: 6px auto 8px; background: var(--card); border: 3px solid var(--primary); position: relative; z-index: 1; }
.stop.has .dot { background: var(--primary); }
.stop .l { font-size: 13px; color: var(--muted); line-height: 1.25; }
.stop:hover .l { color: var(--primary); }
@media (max-width: 1100px) { .route { grid-template-columns: repeat(5, 1fr); row-gap: 16px; } .route::before { display: none; } }

/* tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: oklch(0.975 0.008 228); }
.ref { font-weight: 600; white-space: nowrap; }
.clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chips */
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--primary-soft); color: var(--ink); white-space: nowrap; }
.st-executable { background: oklch(0.93 0.06 155); color: oklch(0.35 0.09 155); }
.st-completed { background: oklch(0.92 0.03 232); color: oklch(0.38 0.06 232); }
.st-pending, .st-non-executable { background: oklch(0.95 0.08 85); color: oklch(0.42 0.09 70); }
.st-cancelled, .st-terminated, .st-discontinuance { background: oklch(0.94 0.04 28); color: oklch(0.45 0.13 28); }
.st-renewed, .st-termination-requested { background: oklch(0.94 0.03 300); color: oklch(0.42 0.1 300); }
.late { color: var(--bad); font-weight: 600; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
input[type=text], input[type=search], input[type=date], input[type=datetime-local], input[type=number], input[type=password], select, textarea {
  font: 14px var(--font); padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); width: 100%;
}
.filters input, .filters select { width: auto; }
.filters input[type=search] { min-width: 280px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: var(--primary); }

/* forms */
.form-section { margin-bottom: 18px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.fields .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .fields { grid-template-columns: 1fr; } }
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--muted); }
.errorlist { color: var(--bad); margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
.check label { display: inline; font-weight: 500; color: var(--text); }
.check input { width: auto; }

/* detail */
.kv { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; word-break: break-word; }
.trace { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 6px; }
.trace .m { flex: 1 0 82px; text-align: center; position: relative; font-size: 13px; color: var(--muted); }
.trace .m::before { content: ""; position: absolute; top: 8px; left: 0; right: 0; height: 3px; background: var(--line); }
.trace .m:first-child::before { left: 50%; } .trace .m:last-child::before { right: 50%; }
.trace .m.done::before { background: var(--primary); }
.trace .m i { display: block; width: 18px; height: 18px; border-radius: 50%; margin: 0 auto 6px; border: 3px solid var(--line); background: var(--card); position: relative; }
.trace .m.done i { border-color: var(--primary); background: var(--primary); }
.trace .m.done { color: var(--text); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 3px solid var(--primary-soft); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 15px; width: 11px; height: 11px; border-radius: 50%; background: var(--primary); }
.timeline .when { font-size: 13px; color: var(--muted); }
.note { white-space: pre-wrap; }

/* messages */
.msgs { list-style: none; padding: 0; margin: 0 0 16px; }
.msgs li { padding: 10px 14px; border-radius: 8px; margin-bottom: 6px; background: var(--primary-soft); }
.msgs li.success { background: oklch(0.94 0.05 155); }
.msgs li.error { background: oklch(0.94 0.04 28); }

/* pager */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--ink); }
.login .card { width: 360px; }
.login .brand b { color: var(--ink); }
.login .brand span { color: var(--primary); }
pre.log { background: var(--ink); color: oklch(0.92 0.01 224); padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
