:root {
  --blue: #090909;
  --blue-soft: #f4f4f4;
  --blue-mid: #090909;
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #e4e4e4;
  --line-strong: #cfcfcf;
  --text: #0b0b0b;
  --muted: #707070;
  --danger: #a3261d;
  --green: #176b49;
  --amber: #805000;
  --shadow: none;
  --sidebar-width: 216px;
  --topbar-height: 68px;
  --module-height: 58px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

* { box-sizing: border-box; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea { font: inherit; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

a,
button,
input,
select,
textarea { -webkit-tap-highlight-color: transparent; }

/* Login */
.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 38%) minmax(480px, 62%);
  min-height: 100vh;
  overflow: hidden;
  padding: 0;
  background: #fff;
}

.auth-shell::before {
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: flex-end;
  padding: 54px;
  background: #080808;
  color: #fff;
  content: "亿运营统一管理后台\A OPERATIONS CONSOLE";
  white-space: pre;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.9;
  letter-spacing: .12em;
}

.auth-panel {
  align-self: center;
  justify-self: center;
  grid-column: 2;
  grid-row: 1;
  width: min(430px, calc(100% - 72px));
  padding: 44px 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.auth-logo {
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 0 28px;
  object-fit: contain;
  object-position: left center;
  filter: none;
}

.auth-panel h1 {
  margin: 0 0 34px;
  font-size: 30px;
  font-weight: 720;
  line-height: 1.2;
  letter-spacing: -.035em;
  text-align: left;
}

.auth-panel label,
.form-grid label,
.sd-form-grid label,
.sd-card-form label {
  display: grid;
  gap: 9px;
  margin: 0;
  color: #515151;
  font-size: 12px;
  font-weight: 600;
}

.auth-panel label + label { margin-top: 22px; }

input,
select,
textarea {
  width: 100%;
  min-height: 45px;
  border: 0;
  border-bottom: 1px solid #bcbcbc;
  border-radius: 0;
  outline: 0;
  background: #fff;
  color: #111;
  padding: 0 2px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

textarea {
  min-height: 94px;
  padding: 12px 2px;
  resize: vertical;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #111;
  box-shadow: 0 1px 0 #111;
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  height: 16px;
  accent-color: #111;
}

input[type="file"] { padding: 7px 0; }
input[type="file"]::file-selector-button {
  height: 32px;
  margin-right: 10px;
  border: 1px solid #d3d3d3;
  border-radius: 7px;
  background: #fff;
  color: #111;
  padding: 0 12px;
  font-size: 11px;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: #111; }

.error-text { min-height: 20px; margin: 13px 0 0; color: var(--danger); font-size: 12px; }
.auth-panel .primary-button { width: 100%; min-height: 50px; margin-top: 20px; }

/* Shared buttons */
.primary-button,
.ghost-button,
.danger-button,
.success-button,
.small-button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 15px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.primary-button { border-color: #0a0a0a; background: #0a0a0a; color: #fff; }
.primary-button:hover { background: #2b2b2b; }
.ghost-button,
.small-button { border-color: #d9d9d9; background: #fff; color: #111; }
.ghost-button:hover,
.small-button:hover { border-color: #111; background: #fafafa; }
.success-button { border-color: #111; background: #111; color: #fff; }
.danger-button { border-color: #ddc0bd; background: #fff; color: var(--danger); }
.danger-button:hover { border-color: var(--danger); background: #fff8f7; }

/* Application shell */
.admin-app { display: block; min-height: 100vh; background: #fff; }

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: #080808;
  color: #fff;
}

.sidebar-brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid #242424;
}

.sidebar-brand img {
  width: 38px;
  height: 38px;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  filter: none;
}

.sidebar-brand > div { display: grid; gap: 2px; }
.sidebar-brand strong { color: #fff; font-size: 17px; font-weight: 720; }
.sidebar-brand span { color: #767676; font-size: 9px; font-weight: 650; letter-spacing: .16em; }

.sidebar-nav {
  display: block;
  flex: 1;
  overflow: auto;
  padding: 22px 12px 30px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.sidebar-nav > .legacy-admin-menu { display: none !important; }
.project-nav-group { display: grid; gap: 7px; margin: 0 !important; }
.nav-heading { display: block; padding: 0 9px 7px; color: #666; font-size: 10px; font-weight: 650; letter-spacing: .12em; }

.admin-project-button {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #aaa;
  padding: 0 14px;
  text-align: left;
  font-size: 14px;
  transition: color .16s ease, background .16s ease;
}

.admin-project-button > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #595959;
}

.admin-project-button:hover { background: #151515; color: #fff; }
.admin-project-button.is-active { background: #fff; color: #080808; font-weight: 650; }
.admin-project-button.is-active > i { background: #080808; }

.sidebar-status {
  min-height: 62px;
  padding: 0 20px;
  border-top: 1px solid #242424;
  color: #686868;
}
.sidebar-status strong { color: #aaa; }
.sidebar-status i { background: #fff; box-shadow: none; }

.admin-main {
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  background: #fff;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid #e8e8e8;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}

.workspace-title { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.workspace-title span { color: #8a8a8a; }
.workspace-title span::after { margin-left: 9px; color: #c8c8c8; content: "/"; }
.workspace-title strong { color: #111; font-weight: 650; }
.admin-actions { display: flex; align-items: center; gap: 14px; }
.admin-actions span { color: #666; font-size: 12px; }

.project-module-nav {
  position: sticky;
  z-index: 18;
  top: var(--topbar-height);
  display: flex;
  min-height: var(--module-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 56px;
  border-bottom: 1px solid #e4e4e4;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}

.project-module-track { display: flex; min-width: 0; height: var(--module-height); align-items: stretch; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.project-module-track::-webkit-scrollbar { display: none; }
.project-module-track button {
  position: relative;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #777;
  padding: 0 1px;
  font-size: 13px;
}
.project-module-track button::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: #111; content: ""; opacity: 0; transform: scaleX(.25); transition: opacity .16s ease, transform .16s ease; }
.project-module-track button:hover { color: #111; }
.project-module-track button.is-active { color: #111; font-weight: 700; }
.project-module-track button.is-active::after { opacity: 1; transform: scaleX(1); }
.project-node-status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; color: #555; font-size: 11px; }
.project-node-status i { width: 7px; height: 7px; border-radius: 50%; background: #111; }

.content {
  width: 100%;
  max-width: none;
  padding: 44px 56px 76px;
}

.content > * { width: min(100%, 1480px); margin-right: auto; margin-left: auto; }

/* Unified management overview */
.unified-overview { width: 100%; }
.unified-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 40px;
}
.unified-head h1 { margin: 0; color: #080808; font-size: 36px; font-weight: 720; line-height: 1.15; letter-spacing: -.045em; }
.unified-head p { margin: 10px 0 0; color: #727272; font-size: 13px; }

.server-monitor { container-type: inline-size; margin-bottom: 40px; padding: 26px 30px 30px; border: 0; border-radius: 16px; background: #f6f7f7; }
.server-monitor-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.server-monitor-head h2 { margin: 0; font-size: 18px; font-weight: 650; }
.server-monitor-head > div { display: flex; align-items: center; gap: 20px; }
.server-monitor-head time { color: #737b78; font-size: 12px; }
.server-monitor-body { display: grid; grid-template-columns: 1.2fr 1.2fr .95fr 1fr; align-items: center; gap: 28px; }
.server-resource { display: flex; align-items: center; gap: 20px; min-width: 0; --ring-color: #253f36; }
.server-resource[data-tone="warning"] { --ring-color: #b47b29; }
.server-resource[data-tone="danger"] { --ring-color: #bc4b40; }
.server-resource[data-tone="unknown"] { --ring-color: transparent; }
.server-ring { position: relative; width: clamp(84px, 7vw, 112px); flex-shrink: 0; aspect-ratio: 1; }
.server-ring > svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.server-ring circle { fill: none; stroke-width: 6; }
.server-ring-track { stroke: #e3e8e5; }
.server-ring-value { stroke: var(--ring-color); stroke-linecap: butt; }
.server-ring-center { position: absolute; inset: 0; display: grid; place-items: center; color: #52685e; font-size: 24px; }
.server-ring-center svg { width: 28px; height: 28px; }
.server-resource-copy { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.server-monitor .server-label { color: #515d57; font-size: 14px; }
.server-resource-copy > strong, .server-load > strong { display: block; color: #17251e; font-size: 34px; font-weight: 650; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.server-resource-copy small { margin-left: 3px; font-size: 16px; font-weight: 500; color: #6a756f; }
.server-monitor .server-detail { color: #76807a; font-size: 12px; line-height: 1.5; }
.server-load { min-width: 0; }
.server-load > strong { margin: 10px 0 7px; }
.server-runtime { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 16px; font-size: 12px; color: #76807a; }
.server-runtime b { color: #45564c; font-weight: 500; }
.server-services { display: grid; gap: 13px; min-width: 0; padding-left: 26px; border-left: 1px solid #dfe5e1; }
.server-services > .server-label { margin-bottom: 2px; }
.server-service { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: #45564c; }
.server-service > span:last-child { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: #237652; }
.server-service i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.server-service > [data-state="error"] { color: #bc4b40; }
.server-service > [data-state="unknown"] { color: #858d88; }
@container (max-width: 940px) {
  .server-monitor-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
  .server-load { padding-left: 10px; }
  .server-services { padding-left: 0; border-left: 0; }
}
@container (max-width: 460px) {
  .server-monitor-head { align-items: flex-start; gap: 12px; }
  .server-monitor-head > div { align-items: flex-end; flex-direction: column-reverse; gap: 8px; }
  .server-monitor-head time { font-size: 11px; }
  .server-monitor-body { grid-template-columns: 1fr; gap: 28px; }
  .server-resource { justify-content: flex-start; }
  .server-load { padding: 0; }
}

.unified-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 58px;
  border-top: 1px solid #111;
  border-bottom: 1px solid #ddd;
}
.unified-summary article { min-width: 0; min-height: 132px; padding: 24px; border-right: 1px solid #e5e5e5; }
.unified-summary article:last-child { border-right: 0; }
.unified-summary span,
.unified-summary p { color: #777; font-size: 11px; }
.unified-summary strong { display: block; margin: 14px 0 10px; color: #111; font-size: 34px; font-weight: 650; line-height: 1; letter-spacing: -.045em; }
.unified-summary p { margin: 0; }

.unified-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 60px; }
.unified-project { min-width: 0; border-top: 1px solid #111; border-bottom: 1px solid #ddd; }
.unified-project > header { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 24px; }
.unified-project > header > div { display: flex; align-items: flex-start; gap: 20px; }
.unified-project h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.035em; }
.unified-project-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #e8e8e8; }
.unified-project-metrics > div { min-height: 94px; padding: 20px 18px 16px 0; border-right: 1px solid #ededed; border-bottom: 1px solid #ededed; }
.unified-project-metrics > div:nth-child(3n+2),
.unified-project-metrics > div:nth-child(3n+3) { padding-left: 18px; }
.unified-project-metrics > div:nth-child(3n) { border-right: 0; }
.unified-project-metrics span { display: block; color: #858585; font-size: 10px; }
.unified-project-metrics strong { display: block; margin-top: 13px; overflow: hidden; color: #111; font-size: 21px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.unified-project-error { margin: 0; padding: 14px 0; border-bottom: 1px solid #eee; color: var(--danger); font-size: 11px; }
.unified-project > footer { display: flex; min-height: 68px; align-items: center; justify-content: flex-end; gap: 20px; }
.unified-project > footer > span { color: #888; font-size: 10px; }
.unified-project > footer .primary-button { min-width: 130px; }

/* Core admin pages */
.page-head,
.sd-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 0 0 40px;
}

.page-kicker,
.sd-eyebrow {
  display: block;
  margin: 0 0 10px;
  color: #777;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.page-head h2,
.sd-page-head h1 {
  margin: 0;
  color: #0a0a0a;
  font-size: 31px;
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: -.04em;
}

.page-head p,
.sd-page-head p { margin: 9px 0 0; color: #747474; font-size: 13px; line-height: 1.7; }
.overview-head { margin-bottom: 34px; }

.metric-grid,
.sd-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 0 0 48px;
  border-top: 1px solid #111;
  border-bottom: 1px solid #ddd;
}

.metric-card,
.sd-metrics article {
  min-width: 0;
  min-height: 138px;
  padding: 25px 24px;
  border: 0;
  border-right: 1px solid #e5e5e5;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.metric-card:last-child,
.sd-metrics article:last-child { border-right: 0; }
.metric-card::after { display: none; }
.metric-card > span,
.metric-card small,
.sd-metrics span,
.sd-metrics p { color: #747474; font-size: 11px; }
.metric-card strong,
.sd-metrics strong { display: block; margin: 14px 0 10px; color: #111; font-size: 36px; font-weight: 650; line-height: 1; letter-spacing: -.045em; }
.metric-card small,
.sd-metrics p { margin: 0; }

.overview-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .65fr); gap: 46px; }
.overview-side { display: grid; align-content: start; gap: 38px; }
.panel,
.quick-panel,
.health-panel {
  overflow: visible;
  border: 0;
  border-top: 1px solid #111;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.panel-title { display: flex; min-height: 66px; align-items: center; justify-content: space-between; padding: 0; border-bottom: 1px solid #e8e8e8; font-size: 15px; }
.panel-body { padding: 22px 0; }

.quick-actions { display: grid; }
.quick-actions button,
.health-list button {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 0;
  border-bottom: 1px solid #ececec;
  background: #fff;
  color: #111;
  padding: 0;
  text-align: left;
}
.quick-actions button:hover,
.health-list button:hover { background: #fafafa; }
.quick-actions button span { color: #888; font-size: 11px; }

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  border-top: 1px solid #ddd;
}
.toolbar-left,
.toolbar-right { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.toolbar label { margin: 0; }
.toolbar input,
.toolbar select { min-width: 150px; }

.form-grid,
.sd-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 22px;
}
.form-grid .primary-button,
.sd-form-grid .primary-button { width: max-content; min-height: 45px; }
.checkbox-line { display: flex !important; min-height: 45px; align-items: center; gap: 9px !important; }
.config-hints { color: #707070; font-size: 12px; line-height: 1.8; }
.ai-config { display: grid; gap: 46px; }
.ai-connection-status { display: inline-flex; align-items: center; gap: 8px; }

.table-wrap,
.sd-table-wrap {
  width: 100%;
  overflow: auto;
  border: 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  border-radius: 0;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #c8c8c8 transparent;
}

table,
.sd-table-wrap table { width: 100%; min-width: 940px; border-collapse: collapse; }
th,
td,
.sd-table-wrap th,
.sd-table-wrap td {
  height: 54px;
  padding: 12px;
  border-bottom: 1px solid #ececec;
  background: #fff;
  color: #3e3e3e;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
}
th,
.sd-table-wrap th {
  height: 42px;
  background: #f7f7f7;
  color: #777;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .055em;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td,
tr:hover td:last-child { background: #fbfbfb; }
td:last-child,
th:last-child { position: static; background: inherit; }
table code,
.sd-table-wrap code { padding: 3px 6px; border-radius: 5px; background: #f1f1f1; color: #333; font-size: 11px; }
.compact-table { min-width: 620px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { min-height: 30px; padding: 0 9px; border-radius: 7px; font-size: 10px; }
.muted,
.sd-empty { color: #888 !important; }
.sd-empty { padding: 38px !important; text-align: center !important; }
.sd-subtext { margin-top: 5px; color: #949494; font-size: 10px; }

.badge,
.sd-badge { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; color: #555; font-size: 11px; }
.sd-badge i { width: 6px; height: 6px; border-radius: 50%; background: #999; }
.sd-badge[data-tone="success"] { color: var(--green); }
.sd-badge[data-tone="success"] i { background: #1f8a5e; }
.sd-badge[data-tone="danger"] { color: var(--danger); }
.sd-badge[data-tone="danger"] i { background: var(--danger); }
.sd-badge[data-tone="quiet"] { color: #777; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 18px; color: #777; font-size: 11px; }

/* Shop Detective */
.sd-workspace { width: 100%; }
.sd-page-head { margin-bottom: 34px; }
.sd-metrics { margin-bottom: 50px; }
.sd-metrics article { min-height: 142px; }
.sd-metrics strong { font-size: 38px; }

.sd-overview-note {
  display: grid;
  grid-template-columns: minmax(330px, .9fr) minmax(360px, 1.1fr);
  gap: 70px;
  padding: 34px 0;
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}
.sd-overview-note > div { display: flex; gap: 24px; }
.sd-index { color: #aaa; font-size: 11px; font-weight: 700; }
.sd-overview-note h2 { max-width: 420px; margin: 0; font-size: 22px; line-height: 1.4; }
.sd-overview-note p { margin: 2px 0 0; color: #626262; font-size: 13px; line-height: 1.9; }

.sd-section,
.sd-card-creation { margin-top: 50px; border-top: 1px solid #111; }
.sd-section:first-of-type,
.sd-card-creation:first-of-type { margin-top: 0; }
.sd-section + .sd-section { margin-top: 58px; }

.sd-section-head {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}
.sd-section-head h2 { margin: 0; font-size: 20px; font-weight: 680; letter-spacing: -.025em; }
.sd-section-head p { margin: 7px 0 0; color: #777; font-size: 12px; }
.sd-section-head > p { margin: 0; }
.sd-search { display: grid; grid-template-columns: auto 220px; align-items: center; gap: 14px; }
.sd-search > span { color: #777; font-size: 11px; }
.sd-detail { max-width: 340px; overflow: hidden; color: #666; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.sd-card-creation { padding-bottom: 26px; border-bottom: 1px solid #ddd; }
.sd-card-form {
  display: grid;
  grid-template-columns: 170px 170px minmax(250px, 1fr) 168px;
  align-items: end;
  gap: 20px;
}
.sd-card-form .primary-button { min-height: 48px; }
.sd-advanced-fields { grid-column: 1 / -1; margin-top: 4px; border-top: 1px solid #ececec; }
.sd-advanced-fields summary { width: max-content; padding-top: 14px; color: #666; font-size: 11px; cursor: pointer; }
.sd-advanced-fields > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 20px 0 4px; }

.sd-batches-section { margin-top: 40px; }
.sd-batch-list { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.sd-batch-list article {
  display: grid;
  grid-template-columns: minmax(240px, .75fr) minmax(220px, 1fr) minmax(170px, auto) 54px;
  min-height: 72px;
  align-items: center;
  gap: 26px;
  border-bottom: 1px solid #ededed;
}
.sd-batch-list article:last-child { border-bottom: 0; }
.sd-batch-list article > div:first-child { display: grid; gap: 5px; }
.sd-batch-list strong { font-size: 13px; }
.sd-batch-list span { color: #858585; font-size: 11px; }
.sd-batch-list b { text-align: right; font-size: 15px; }
.sd-batch-progress { height: 2px; background: #e3e3e3; }
.sd-batch-progress i { display: block; height: 100%; background: #111; }

.sd-form-section { padding-bottom: 30px; border-bottom: 1px solid #ddd; }
.sd-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sd-rule-form { grid-template-columns: minmax(170px, .7fr) minmax(170px, .7fr) minmax(280px, 1.2fr) auto; }
.sd-update-form { grid-template-columns: minmax(160px, .45fr) minmax(300px, 1fr) auto; }
.sd-update-file { grid-column: 2; }
.sd-update-notes { grid-column: 1 / 3; }
.sd-update-notes textarea { min-height: 94px; }
.sd-check-label { display: flex !important; height: 45px; align-items: center; gap: 9px !important; }
.sd-upload-progress { grid-column: 1 / -1; }
.sd-upload-progress > div { height: 4px; overflow: hidden; background: #e6e6e6; }
.sd-upload-progress i { display: block; width: 0; height: 100%; background: #111; transition: width .2s; }
.sd-upload-progress p { display: flex; justify-content: space-between; margin: 8px 0 0; color: #777; font-size: 11px; }
.sd-upload-progress strong { color: #111; }

.sd-loading { display: grid; min-height: 52vh; place-items: center; align-content: center; color: #111; }
.sd-loading > span { margin-bottom: 10px; color: #888; font-size: 10px; letter-spacing: .13em; }
.sd-loading > strong { font-size: 16px; }
.sd-loading > div { width: 240px; height: 2px; margin-top: 24px; overflow: hidden; background: #e5e5e5; }
.sd-loading > div i { display: block; width: 42%; height: 100%; background: #111; animation: sd-load 1.05s ease-in-out infinite; }
@keyframes sd-load { 0% { transform: translateX(-105%); } 100% { transform: translateX(245%); } }

.sd-error-state { max-width: 620px; margin: 90px auto; padding: 36px 0; border-top: 1px solid #111; border-bottom: 1px solid #ddd; }
.sd-error-state > span { color: var(--danger); font-size: 10px; letter-spacing: .12em; }
.sd-error-state h2 { margin: 14px 0 10px; font-size: 24px; }
.sd-error-state p { margin: 0 0 24px; color: #666; }

/* Dialogs */
.admin-dialog-backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); }
.admin-dialog { overflow: hidden; border: 0; border-radius: var(--radius-lg); background: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, .24); }
.admin-dialog header { padding: 24px 26px 12px; }
.admin-dialog-mark { border-radius: 10px; background: #f6f6f6; color: #111; }
.admin-dialog header span:not(.admin-dialog-mark) { color: #777; }
.admin-dialog p { color: #626262; }
.admin-dialog-actions { padding: 0 26px 24px; }

.sd-step-up,
.sd-generated-codes { padding: 0; border: 0; border-radius: var(--radius-lg); background: transparent; box-shadow: 0 30px 100px rgba(0, 0, 0, .28); }
.sd-step-up::backdrop,
.sd-generated-codes::backdrop { background: rgba(0, 0, 0, .48); backdrop-filter: blur(2px); }
.sd-step-up form,
.sd-generated-codes form { display: grid; width: min(520px, calc(100vw - 40px)); gap: 16px; padding: 34px; border: 0; border-radius: var(--radius-lg); background: #fff; }
.sd-step-up h2,
.sd-generated-codes h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.sd-step-up p,
.sd-generated-codes p { margin: 0; color: #666; font-size: 13px; line-height: 1.7; }
.sd-step-up form > div { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.sd-generated-codes form { width: min(520px, calc(100vw - 40px)); }
.sd-generated-summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }
.sd-generated-summary strong { font-size: 12px; }
.sd-generated-summary span { color: #777; font-size: 11px; }
.sd-generated-codes textarea { width: 100%; height: 180px; padding: 17px; border: 0; border-radius: 10px; background: #f5f5f5; resize: vertical; font: 12px/1.85 ui-monospace, SFMono-Regular, Consolas, monospace; }
.sd-generated-actions { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; }
.sd-generated-actions button { min-height: 48px; }
.sd-generated-close { width: max-content; border: 0; background: transparent; color: #777; padding: 0; font-size: 11px; }

.generated-codes { border-radius: var(--radius-md); background: #f6f6f6; }
.license-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.toast { border: 0; border-radius: 10px; background: #111; color: #fff; box-shadow: 0 16px 50px rgba(0, 0, 0, .2); }

@media (max-width: 1260px) {
  .content { padding-right: 38px; padding-left: 38px; }
  .project-module-nav { padding-right: 38px; padding-left: 38px; }
  .metric-grid,
  .sd-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-card:nth-child(3),
  .sd-metrics article:nth-child(3) { border-right: 0; }
  .metric-card:nth-child(-n+3),
  .sd-metrics article:nth-child(-n+3) { border-bottom: 1px solid #e5e5e5; }
  .sd-card-form { grid-template-columns: 150px 150px minmax(220px, 1fr) 150px; }
  .sd-rule-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .server-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .server-gauges article:nth-child(3) { border-right: 0; }
  .server-gauges article:nth-child(-n+3) { border-bottom: 1px solid #e8e8e8; }
}

@media (max-width: 960px) {
  :root { --sidebar-width: 0px; }
  .admin-app { padding-top: 66px; }
  .sidebar { inset: 0 0 auto; width: 100%; min-height: 66px; height: 66px; flex-direction: row; align-items: center; }
  .sidebar-brand { min-width: 196px; min-height: 66px; border: 0; }
  .sidebar-nav { display: flex; padding: 10px; overflow-x: auto; }
  .project-nav-group { display: flex; align-items: center; }
  .project-nav-group .nav-heading { display: none; }
  .admin-project-button { min-width: max-content; }
  .sidebar-status { display: none; }
  .admin-main { margin-left: 0; }
  .topbar { top: 66px; }
  .project-module-nav { top: calc(66px + var(--topbar-height)); }
  .content { padding: 36px 26px 60px; }
  .project-module-nav { padding: 0 26px; }
  .project-node-status { display: none; }
  .overview-layout { grid-template-columns: 1fr; }
  .unified-projects { grid-template-columns: 1fr; gap: 48px; }
  .sd-overview-note { grid-template-columns: 1fr; gap: 24px; }
  .form-grid,
  .sd-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-card-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sd-card-form .primary-button { width: 100%; }
  .sd-batch-list article { grid-template-columns: minmax(220px, 1fr) 48px; gap: 14px; padding: 14px 0; }
  .sd-batch-progress { grid-row: 2; grid-column: 1 / 3; }
  .sd-batch-list article > span { grid-row: 3; grid-column: 1 / 3; }
}

@media (max-width: 680px) {
  .auth-shell { display: block; padding: 28px; }
  .auth-shell::before { display: none; }
  .auth-panel { width: 100%; max-width: 430px; margin: 10vh auto 0; }
  .sidebar-brand { min-width: 66px; width: 66px; padding: 0 16px; }
  .sidebar-brand > div { display: none; }
  .topbar { height: 58px; padding: 0 16px; }
  .admin-actions span { display: none; }
  .project-module-nav { top: 124px; min-height: 52px; padding: 0 16px; }
  .project-module-track { height: 52px; gap: 22px; }
  .content { padding: 30px 16px 48px; }
  .page-head,
  .sd-page-head,
  .unified-head { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
  .page-head h2,
  .sd-page-head h1 { font-size: 27px; }
  .unified-head h1 { font-size: 29px; }
  .metric-grid,
  .sd-metrics,
  .unified-summary,
  .server-gauges { grid-template-columns: 1fr; }
  .metric-card,
  .sd-metrics article { min-height: 108px; border-right: 0; border-bottom: 1px solid #e5e5e5; }
  .metric-card:last-child,
  .sd-metrics article:last-child { border-bottom: 0; }
  .toolbar,
  .sd-section-head { align-items: stretch; flex-direction: column; }
  .toolbar-left,
  .toolbar-right { display: grid; grid-template-columns: 1fr; }
  .form-grid,
  .sd-form-grid,
  .sd-card-form,
  .sd-rule-form,
  .sd-update-form { grid-template-columns: 1fr; }
  .sd-update-file,
  .sd-update-notes,
  .sd-advanced-fields { grid-column: auto; }
  .sd-advanced-fields > div { grid-template-columns: 1fr; }
  .sd-form-grid .primary-button,
  .form-grid .primary-button { width: 100%; }
  .sd-overview-note > div { gap: 14px; }
  .sd-overview-note h2 { font-size: 19px; }
  .sd-step-up form,
  .sd-generated-codes form { padding: 28px; }
  .sd-generated-summary { align-items: flex-start; flex-direction: column; justify-content: center; }
  .sd-generated-actions { grid-template-columns: 1fr; }
  .server-gauges article,
  .server-gauges article:nth-child(3) { min-height: 112px; border-right: 0; border-bottom: 1px solid #e8e8e8; }
  .unified-summary article { min-height: 108px; border-right: 0; border-bottom: 1px solid #e5e5e5; }
  .unified-project-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unified-project-metrics > div:nth-child(3n) { border-right: 1px solid #ededed; }
  .unified-project-metrics > div:nth-child(odd) { padding-left: 0; }
  .unified-project-metrics > div:nth-child(even) { padding-left: 18px; border-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: .001ms !important; }
  .sd-loading > div i { width: 100%; animation: none; }
}
