:root {
  color: #182a3a;
  background: #eef4f7;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: #eef4f7; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }

.boot-screen {
  min-height: 100svh;
  display: grid;
  place-content: center;
  gap: 12px;
  color: #577081;
  text-align: center;
  font-size: 14px;
}
.boot-screen p { margin: 0; }
.boot-screen h1 { margin: 4px 0 0; color: #294958; font-size: 20px; line-height: 1.3; }
.boot-screen .button-row { justify-content: center; }
.boot-error { max-width: 440px; margin: 0 auto; padding: 24px; }
.boot-mark, .brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #067b87;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}
.boot-mark { width: 40px; height: 40px; margin: 0 auto; font-size: 19px; }
.boot-shell {
  display: block;
  padding: 14svh 28px 64px;
  color: #182a3a;
  text-align: left;
}
.boot-shell-inner { width: min(980px, 100%); margin: 0 auto; }
.boot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #254654;
  font-size: 15px;
  font-weight: 800;
}
.boot-brand .boot-mark { flex: 0 0 auto; width: 32px; height: 32px; margin: 0; font-size: 15px; }
.boot-kicker { margin: 42px 0 7px; color: #0a737d; font-size: 12px; font-weight: 800; }
.boot-shell h1 { margin: 0; color: #18313f; font-size: 30px; line-height: 1.25; }
.boot-intro { margin: 9px 0 0; color: #66808f; font-size: 14px; line-height: 1.6; }
.boot-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: 14px; margin-top: 24px; }
.boot-panel { min-height: 156px; padding: 18px; border: 1px solid #d7e3e8; border-radius: 6px; background: #fff; }
.boot-panel h2 { margin: 0; color: #294958; font-size: 14px; }
.boot-panel p { margin: 7px 0 0; color: #6c8593; font-size: 13px; line-height: 1.6; }
.boot-endpoint { display: block; margin-top: 16px; padding: 11px; overflow: hidden; border: 1px solid #d8e7eb; border-radius: 5px; background: #f5fafb; color: #045f6a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.boot-panel .button-row { margin-top: 16px; }
.boot-error .boot-panel:last-child { border-color: #ebc3c7; background: #fffafa; }
.boot-error [data-boot-status] { color: #963941; }

.app-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  border-right: 1px solid #d8e3e9;
  background: #fbfdfe;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 800;
}
.brand small {
  display: block;
  margin-top: 2px;
  color: #748a98;
  font-size: 11px;
  font-weight: 600;
}
.nav {
  display: grid;
  gap: 4px;
  margin-top: 28px;
}
.nav-caption {
  margin: 18px 10px 2px;
  color: #8aa0aa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.nav-link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 5px;
  color: #587080;
  font-size: 14px;
  font-weight: 650;
}
.nav-link:hover { color: #095e6a; background: #e9f4f5; }
.nav-link[aria-current="page"] { color: #fff; background: #067b87; }
.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid #e2ebef;
  color: #708795;
  font-size: 12px;
}
.sidebar-footer a:hover { color: #067b87; }

.workspace { min-width: 0; }
.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid #d8e3e9;
  background: rgba(251, 253, 254, .92);
}
.topbar-title { min-width: 0; }
.topbar-title h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
}
.topbar-title p {
  margin: 4px 0 0;
  overflow: hidden;
  color: #748a98;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: #557080;
  font-size: 13px;
}
.user-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #cce1e5;
  border-radius: 50%;
  background: #e9f5f6;
  color: #066d78;
  font-weight: 800;
}

.page { max-width: 1260px; margin: 0 auto; padding: 28px; }
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h2 { margin: 0; font-size: 22px; line-height: 1.3; }
.page-head p { max-width: 680px; margin: 7px 0 0; color: #66808f; font-size: 14px; line-height: 1.6; }
.grid { display: grid; gap: 14px; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: start; }
.card {
  overflow: hidden;
  border: 1px solid #d7e3e8;
  border-radius: 6px;
  background: #fff;
}
.card-pad { padding: 18px; }
.metric { min-height: 126px; padding: 18px; }
.metric-label { color: #708794; font-size: 12px; font-weight: 700; }
.metric-value { margin-top: 16px; font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: 0; }
.metric-note { margin-top: 9px; color: #8095a0; font-size: 12px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  font-weight: 800;
}
.section-copy { margin: 7px 0 0; color: #6c8593; font-size: 13px; line-height: 1.6; }
.endpoint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 11px;
  border: 1px solid #d8e7eb;
  border-radius: 5px;
  background: #f5fafb;
}
.endpoint code { flex: 1; min-width: 0; overflow: hidden; color: #045f6a; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #cbdbe2;
  border-radius: 5px;
  background: #fff;
  color: #355264;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}
.button:hover { border-color: #78aeb7; color: #056570; }
.button:focus-visible, .nav-link:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(29, 152, 165, .25);
  outline-offset: 2px;
}
.button.primary { border-color: #067b87; background: #067b87; color: #fff; }
.button.primary:hover { border-color: #056873; background: #056873; color: #fff; }
.button.danger { color: #ae3842; }
.button.compact { min-height: 30px; padding: 0 9px; font-size: 12px; }
.button:disabled { opacity: .55; cursor: wait; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.form-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field label { color: #4f6a79; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #cbdce4;
  border-radius: 5px;
  background: #fff;
  color: #223946;
}
.field textarea { min-height: 94px; padding: 10px; resize: vertical; line-height: 1.45; }
.field input::placeholder { color: #9aadb6; }
.form-help { margin: 0; color: #758a97; font-size: 12px; line-height: 1.5; }
.muted { color: #748b97; font-size: 12px; }
.notice-box { margin-top: 16px; padding: 12px; border-left: 3px solid #0a8d99; background: #f2fafb; color: #496675; font-size: 13px; line-height: 1.6; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 660px; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e3ebee; text-align: left; font-size: 13px; }
th { color: #718793; background: #f8fbfc; font-size: 11px; font-weight: 800; }
tbody tr:hover { background: #fbfdfd; }
tbody tr:last-child td { border-bottom: 0; }
.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  background: #e8f6ee;
  color: #26724b;
  font-size: 11px;
  font-weight: 800;
}
.status.off { background: #f8ecec; color: #9c3d45; }
.key-value {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  color: #476574;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.auth-layout { max-width: 456px; margin: 7svh auto; }
.auth-card { padding: 24px; }
.auth-card h2 { margin: 0; font-size: 24px; }
.auth-card > p { margin: 8px 0 22px; color: #6a8391; font-size: 13px; line-height: 1.6; }
.auth-switch { margin-top: 16px; color: #6d8491; font-size: 13px; }
.text-link { color: #05717c; cursor: pointer; font-weight: 750; }
.empty { padding: 38px 18px; color: #718894; text-align: center; font-size: 13px; }
.error-state { display: grid; justify-items: center; gap: 9px; color: #8f3e46; }
.error-state strong { color: #7a3038; font-size: 14px; }
.error-state span { max-width: 520px; line-height: 1.55; }
.channel-update { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #e3ebee; color: #5d7480; font-size: 12px; line-height: 1.5; }
.advanced-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.advanced-link {
  display: block;
  min-height: 64px;
  padding: 13px;
  border: 1px solid #d6e3e8;
  border-radius: 5px;
  color: #345464;
  font-size: 13px;
  font-weight: 750;
}
.advanced-link small { display: block; margin-top: 5px; color: #78909d; font-size: 11px; font-weight: 500; }
.advanced-link:hover { border-color: #72aeb7; color: #056c77; }
.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(390px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid #b8d7dc;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(28, 58, 74, .14);
  color: #294958;
  font-size: 13px;
  line-height: 1.45;
}
.notice.error { border-color: #ebc3c7; color: #963941; }

@media (max-width: 860px) {
  .boot-shell { padding: 42px 16px; }
  .boot-kicker { margin-top: 30px; }
  .boot-grid { grid-template-columns: 1fr; }
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 12px 14px 0; border-right: 0; border-bottom: 1px solid #d8e3e9; }
  .brand { padding: 0; }
  .nav { display: flex; overflow-x: auto; gap: 6px; margin: 12px -14px 0; padding: 0 14px 12px; }
  .nav-link { flex: 0 0 auto; }
  .sidebar-footer { display: none; }
  .topbar { min-height: 60px; padding: 0 16px; }
  .page { padding: 18px 16px 28px; }
  .metrics, .split { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .boot-shell h1 { font-size: 26px; }
  .boot-panel { min-height: 0; }
  .topbar-title p, .user-menu span { display: none; }
  .page-head { display: block; }
  .page-head .button-row { margin-top: 14px; }
  .metric-value { font-size: 25px; }
  .advanced-list { grid-template-columns: 1fr; }
  .auth-layout { margin: 24px auto; padding: 0 14px; }
  .auth-card { padding: 20px; }
}
