@font-face {
  font-family: Inter;
  src: url(/fonts/inter.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --sidebar: #0f1015;
  --panel: #14151b;
  --panel-hover: #191b22;
  --raised: #1e2029;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #eeeef1;
  --text-2: #a2a4b0;
  --text-3: #71737f;
  --accent: #f0a93e;
  --accent-hover: #f7bd62;
  --accent-wash: rgba(240, 169, 62, 0.12);
  --on-accent: #1a1204;
  --green: #4cc38a;
  --green-wash: rgba(76, 195, 138, 0.12);
  --red: #f2766b;
  --red-wash: rgba(242, 118, 107, 0.12);
  --radius: 10px;
  --radius-small: 7px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss03";
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }
.sprite { position: absolute; width: 0; height: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.ring-a, .ring-b, .ring-c { fill: none; stroke: currentColor; }
.ring-a { stroke-width: 4; }
.ring-b { stroke-width: 4; opacity: 0.65; }
.ring-c { stroke-width: 4; opacity: 0.35; }

.icon {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* controls */
label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }

input, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  letter-spacing: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
textarea { display: block; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  background: var(--raised);
  color: var(--text);
  font: 500 14px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:disabled { cursor: default; opacity: 0.45; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { border-color: var(--line-strong); background: none; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.btn-danger { border-color: rgba(242, 118, 107, 0.3); background: var(--red-wash); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: rgba(242, 118, 107, 0.2); }

.btn-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.btn-icon:hover { background: var(--raised); color: var(--text); }
.btn-icon.spinning .icon { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error { color: var(--red); font-size: 13px; }
.link { color: var(--text-2); font-size: 13px; font-weight: 500; }
.link:hover { color: var(--text); }

/* sign-in */
.signin { position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden; padding: 16px; }
.signin-glow {
  position: absolute;
  width: min(120vw, 1000px);
  color: var(--accent);
  opacity: 0.05;
  pointer-events: none;
}
.signin-card {
  position: relative;
  display: grid;
  width: min(100%, 380px);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.signin-logo { width: 36px; color: var(--accent); margin-bottom: 18px; }
.signin-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.signin-card > p:not(.form-error) { margin: 4px 0 22px; color: var(--text-2); }
.signin-card .form-error { margin-top: 8px; }
.signin-card .btn { margin-top: 14px; }

/* frame */
.shell { display: grid; min-height: 100vh; grid-template-columns: 232px minmax(0, 1fr); }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.workspace { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.workspace svg { width: 28px; height: 28px; color: var(--accent); }
.workspace strong, .workspace small { display: block; line-height: 1.25; }
.workspace small { color: var(--text-3); font-size: 12px; }

.nav-label { padding: 14px 10px 6px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--text-2);
  font: 500 14px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item + .nav-item { margin-top: 2px; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item[aria-current="page"] { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.nav-item[aria-current="page"] .icon { color: var(--accent); }

.nav-soon span { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; color: var(--text-3); font-weight: 500; }
.nav-soon em { margin-left: auto; padding: 0 6px; background: var(--raised); border-radius: 4px; color: var(--text-3); font-size: 11px; font-style: normal; line-height: 18px; }
.signout { margin-top: auto; }

.main { display: flex; min-width: 0; flex-direction: column; }
.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 52px;
  padding: 0 24px;
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); }
.crumbs strong { color: var(--text); font-weight: 500; }
.crumbs .icon { width: 13px; height: 13px; }
.topbar-side { display: flex; align-items: center; gap: 10px; }
.admin-badge { display: grid; width: 28px; height: 28px; place-items: center; background: var(--accent); border-radius: 50%; color: var(--on-accent); font-size: 12px; font-weight: 700; }

.content { flex: 1; padding: 28px 24px 56px; }
.page { max-width: 1200px; margin: 0 auto; animation: rise 0.2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.3; }
.page-head p { color: var(--text-2); }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { font-size: 14px; font-weight: 600; }
.panel-head p { color: var(--text-3); font-size: 13px; }
.panel-head p strong { color: var(--text-2); font-weight: 500; }
.empty { padding: 36px 16px; color: var(--text-3); text-align: center; }

/* metrics: one band split by hairlines */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.metric { min-width: 0; padding: 16px 20px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric p { color: var(--text-2); font-size: 13px; }
.metric strong { display: block; margin: 6px 0 4px; overflow: hidden; font-size: 28px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.metric-note { display: flex; align-items: center; gap: 4px; min-height: 20px; color: var(--text-3); font-size: 13px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; }
.delta .icon { width: 13px; height: 13px; stroke-width: 2.25; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 14px; }

.segmented { display: inline-flex; padding: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-small); }
.segmented button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text-3);
  font: 500 13px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--raised); color: var(--text); }

.chart { position: relative; height: 280px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; }
.chart text { fill: var(--text-3); font-family: inherit; font-size: 12px; }
.chart .grid { stroke: var(--line); shape-rendering: crispEdges; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .cross { stroke: var(--line-strong); shape-rendering: crispEdges; }
.chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }

.tooltip {
  position: fixed;
  z-index: 30;
  padding: 6px 10px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--text-2);
  font-size: 12px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
  white-space: nowrap;
}
.tooltip strong { display: block; color: var(--text); font-size: 13px; }

.recent li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent time { flex: none; color: var(--text-3); font-size: 13px; }

.avatar {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}
.avatar-large { width: 44px; height: 44px; font-size: 15px; }
.tint-0 { background: rgba(240, 169, 62, 0.16); color: #f4bd6e; }
.tint-1 { background: rgba(99, 148, 255, 0.16); color: #93b4ff; }
.tint-2 { background: rgba(76, 195, 138, 0.16); color: #7fd9ad; }
.tint-3 { background: rgba(190, 130, 255, 0.16); color: #cca5ff; }
.tint-4 { background: rgba(255, 128, 170, 0.16); color: #ffa5c3; }
.tint-5 { background: rgba(70, 200, 215, 0.16); color: #80dbe6; }

.person { display: flex; min-width: 0; align-items: center; gap: 10px; }
.person strong { display: block; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.person small { display: block; color: var(--text-3); font-size: 12px; line-height: 1.3; }

/* users */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.filters { display: flex; gap: 2px; }
.filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: none;
  color: var(--text-2);
  font: 500 13px Inter, system-ui, sans-serif;
  letter-spacing: inherit;
  cursor: pointer;
}
.filters button:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.filters button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.filters span { color: var(--text-3); }

.search { position: relative; width: min(100%, 280px); }
.search .icon { position: absolute; top: 9px; left: 10px; color: var(--text-3); }
.search input { min-height: 34px; padding: 6px 10px 6px 32px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 9px 16px; color: var(--text-3); font-size: 12px; font-weight: 500; text-align: left; white-space: nowrap; }
td { padding: 9px 16px; border-top: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
td:first-child { color: var(--text); }
td.chevron { width: 36px; padding-left: 0; color: var(--text-3); }
tbody tr { cursor: pointer; transition: background 0.1s; }
tbody tr:hover { background: var(--panel-hover); }
tbody tr:hover td.chevron { color: var(--text); }
.row-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 20px; }
.pill::before { width: 5px; height: 5px; background: currentColor; border-radius: 50%; content: ""; }
.pill-good { background: var(--green-wash); color: var(--green); }
.pill-bad { background: var(--red-wash); color: var(--red); }
.pill-live { background: var(--accent-wash); color: var(--accent); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.pager div { display: flex; gap: 6px; }
.pager .btn { min-height: 30px; padding: 0 10px; font-size: 13px; }

/* updates */
.updates-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.release-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.release-form .wide { grid-column: 1 / -1; }

.timeline li { position: relative; margin-left: 4px; padding: 0 0 20px 20px; border-left: 1px solid var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before {
  position: absolute;
  top: 6px;
  left: -5px;
  width: 9px;
  height: 9px;
  background: var(--panel);
  border: 2px solid var(--text-3);
  border-radius: 50%;
  content: "";
}
.timeline li:first-child::before { background: var(--accent); border-color: var(--accent); }
.timeline-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.timeline .code { color: var(--text-3); font-size: 12px; }
.timeline .note { margin-top: 2px; color: var(--text-2); white-space: pre-line; }
.timeline time { display: block; margin-top: 2px; color: var(--text-3); font-size: 12px; }

/* drawer and confirm */
dialog { padding: 0; border: 0; color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(2px); }

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 380px);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  background: var(--panel);
  border-left: 1px solid var(--line-strong);
}
.drawer[open] { display: flex; flex-direction: column; animation: slide-in 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { font-size: 14px; font-weight: 600; }
.drawer-person { display: flex; align-items: center; gap: 12px; padding: 20px; }
.drawer-person div { min-width: 0; }
.drawer-person strong { display: block; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-person p { color: var(--text-2); }
.drawer dl { padding: 0 20px; }
.drawer dl div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.drawer dt { color: var(--text-3); }
.drawer .form-error { padding: 10px 20px 0; }
.drawer-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line); }

.confirm { width: min(calc(100% - 32px), 400px); padding: 20px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.confirm h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.012em; }
.confirm p { margin-top: 6px; color: var(--text-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  background: var(--raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-weight: 500;
}

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .overview-grid, .updates-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar {
    position: static;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 8px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace { padding: 4px 0; }
  .sidebar nav { display: flex; order: 3; flex-basis: 100%; gap: 2px; overflow-x: auto; }
  .sidebar nav .nav-item { width: auto; margin: 0; white-space: nowrap; }
  .nav-label, .nav-soon { display: none; }
  .signout { width: auto; margin: 0; }
  .topbar { display: none; }
  .content { padding: 20px 16px 40px; }
  .metric { padding: 12px 14px; }
  .metric strong { font-size: 24px; }
  .panel { padding: 14px; }
  .panel-flush { padding: 0; }
  .chart { height: 220px; }
  .search { width: 100%; }
  .release-form { grid-template-columns: 1fr; }
  th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4), th:nth-child(6), td:nth-child(6) { display: none; }
  th:nth-child(5), td:nth-child(5) { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
