:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-deep: #040a13;
  --surface: rgba(13, 28, 49, 0.84);
  --surface-strong: #10243d;
  --surface-soft: rgba(21, 42, 70, 0.7);
  --line: rgba(143, 176, 216, 0.14);
  --line-strong: rgba(135, 184, 255, 0.26);
  --text: #f4f8ff;
  --muted: #91a5bf;
  --muted-strong: #bdcce0;
  --cyan: #4fe1ff;
  --blue: #5f8fff;
  --violet: #8f70ff;
  --green: #45dda0;
  --yellow: #ffd469;
  --red: #ff7187;
  --shadow: 0 24px 70px rgba(0, 8, 24, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --sidebar-width: 284px;
  font-family: Inter, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg-deep);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 2%, rgba(95, 143, 255, 0.17), transparent 28rem),
    radial-gradient(circle at 12% 86%, rgba(143, 112, 255, 0.12), transparent 34rem),
    linear-gradient(145deg, #07111f 0%, #081525 50%, #050d18 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(122, 159, 201, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 159, 201, 0.045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(79, 225, 255, 0.72);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.eyebrow,
.section-kicker,
.panel-heading > div > span {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.35;
}

/* Authentication */
.auth-page {
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow-x: hidden;
}

.auth-shell {
  position: relative;
  width: min(100%, 520px);
}

.auth-shell::before,
.auth-shell::after {
  position: absolute;
  z-index: -1;
  width: 240px;
  height: 240px;
  content: "";
  filter: blur(62px);
  border-radius: 999px;
}

.auth-shell::before {
  top: -80px;
  right: 0;
  background: rgba(82, 131, 255, 0.27);
}

.auth-shell::after {
  bottom: -90px;
  left: 0;
  background: rgba(139, 91, 255, 0.2);
}

.auth-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 7vw, 46px);
  border: 1px solid var(--line-strong);
  border-radius: 32px;
  background:
    linear-gradient(150deg, rgba(20, 43, 72, 0.93), rgba(8, 20, 36, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.auth-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 55%;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet));
}

.auth-brand {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid rgba(101, 223, 255, 0.34);
  border-radius: 19px;
  background: linear-gradient(145deg, rgba(79, 225, 255, 0.22), rgba(95, 112, 255, 0.17));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.16), 0 14px 30px rgba(22, 127, 199, 0.18);
}

.auth-brand span {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.06em;
}

.auth-brand i {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 17px;
  height: 17px;
  border: 4px solid #10243d;
  border-radius: 50%;
  background: var(--green);
}

.auth-card h1 {
  margin: 0;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.auth-intro {
  max-width: 410px;
  margin: 15px 0 26px;
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.75;
}

.setup-note,
.setup-locked,
.form-alert {
  display: grid;
  gap: 5px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(79, 225, 255, 0.19);
  border-radius: var(--radius-sm);
  color: var(--muted-strong);
  background: rgba(79, 225, 255, 0.07);
  font-size: 13px;
  line-height: 1.55;
}

.setup-note strong {
  color: var(--cyan);
}

.setup-locked {
  border-color: rgba(255, 212, 105, 0.19);
  background: rgba(255, 212, 105, 0.07);
}

.form-alert {
  border-color: rgba(255, 113, 135, 0.28);
  color: #ffd3da;
  background: rgba(255, 113, 135, 0.1);
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form label {
  margin-top: 5px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text);
  background: rgba(3, 12, 24, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  font-size: 16px;
  appearance: none;
}

.auth-form input:focus {
  border-color: rgba(79, 225, 255, 0.66);
  background: rgba(3, 13, 26, 0.82);
}

.auth-form button {
  min-height: 56px;
  margin-top: 10px;
  border: 0;
  border-radius: 15px;
  color: #061423;
  background: linear-gradient(110deg, var(--cyan), #72b5ff 54%, #a080ff);
  box-shadow: 0 14px 34px rgba(79, 177, 255, 0.24);
  font-weight: 850;
  cursor: pointer;
}

.auth-form button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.auth-boundaries {
  display: grid;
  gap: 8px;
  margin: 25px 0 0;
  padding: 19px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  list-style: none;
}

.auth-boundaries li::before {
  display: inline-block;
  width: 18px;
  color: var(--green);
  content: "✓";
  font-weight: 800;
}

/* Dashboard shell */
.hub-page {
  overflow-x: hidden;
}

.hub-layout {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 620px;
  padding: 25px 18px 20px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(5, 14, 26, 0.82);
  backdrop-filter: blur(22px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 7px 23px;
}

.sidebar-brand > div {
  display: grid;
  gap: 2px;
}

.sidebar-brand strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}

.sidebar-brand small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.09em;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(79, 225, 255, 0.31);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(79, 225, 255, 0.23), rgba(143, 112, 255, 0.15));
  font-size: 20px;
  font-weight: 900;
}

.readonly-banner {
  display: flex;
  min-height: 39px;
  margin: 0 2px 20px;
  padding: 8px 11px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(69, 221, 160, 0.2);
  border-radius: 12px;
  color: #bff9dc;
  background: rgba(69, 221, 160, 0.075);
  font-size: 11px;
  font-weight: 750;
}

.readonly-banner span {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(69, 221, 160, 0.08);
}

.primary-nav {
  display: grid;
  gap: 5px;
}

.nav-item,
.site-switch,
.workspace-site,
.logout-form button {
  border: 0;
  cursor: pointer;
}

.nav-item {
  display: flex;
  min-height: 48px;
  padding: 0 13px;
  align-items: center;
  gap: 12px;
  border-radius: 13px;
  color: var(--muted-strong);
  background: transparent;
  font-size: 14px;
  font-weight: 720;
  text-align: left;
}

.nav-item > span {
  color: #607591;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(91, 133, 184, 0.08);
}

.nav-item.is-active {
  color: #e9fbff;
  background: linear-gradient(100deg, rgba(79, 225, 255, 0.14), rgba(95, 143, 255, 0.07));
  box-shadow: inset 3px 0 var(--cyan);
}

.nav-item.is-active > span {
  color: var(--cyan);
}

.sidebar-sites {
  min-height: 0;
  margin-top: 26px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar-sites > p {
  margin: 0 10px 10px;
  color: #647b98;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.site-switch {
  display: grid;
  width: 100%;
  min-height: 53px;
  padding: 8px 10px;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
}

.site-switch:hover,
.site-switch.is-selected {
  color: var(--text);
  background: rgba(105, 141, 191, 0.09);
}

.site-switch i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53677f;
}

.site-switch i[data-status="healthy"] {
  background: var(--green);
  box-shadow: 0 0 12px rgba(69, 221, 160, 0.65);
}

.site-switch i[data-status="warning"] {
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 212, 105, 0.5);
}

.site-switch > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.site-switch strong,
.site-switch small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-switch strong {
  font-size: 13px;
}

.site-switch small {
  color: var(--muted);
  font-size: 10px;
}

.logout-form {
  margin-top: auto;
  padding-top: 18px;
}

.logout-form button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(8, 20, 36, 0.5);
  font-size: 12px;
  font-weight: 700;
}

.logout-form button:hover {
  border-color: rgba(255, 113, 135, 0.28);
  color: #ffc2cc;
}

.hub-main {
  width: 100%;
  min-width: 0;
  max-width: 1680px;
  padding: 31px clamp(24px, 4vw, 62px) 32px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(29px, 3vw, 44px);
  line-height: 1.13;
  letter-spacing: -0.045em;
}

.topbar > div:first-child > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.last-updated {
  color: var(--muted);
  font-size: 11px;
}

.topbar-actions button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--text);
  background: rgba(18, 42, 69, 0.7);
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.topbar-actions button:hover:not(:disabled) {
  border-color: rgba(79, 225, 255, 0.45);
  background: rgba(30, 58, 91, 0.8);
}

.topbar-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.status-message {
  min-height: 38px;
  margin: 25px 0 26px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted-strong);
  background: rgba(12, 27, 47, 0.55);
  font-size: 12px;
  line-height: 1.45;
}

.status-message[data-kind="loading"] {
  border-color: rgba(95, 143, 255, 0.22);
  color: #bfd0ff;
}

.status-message[data-kind="success"] {
  border-color: rgba(69, 221, 160, 0.2);
  color: #baf5d8;
}

.status-message[data-kind="error"] {
  border-color: rgba(255, 113, 135, 0.24);
  color: #ffc1cc;
}

.view-section {
  animation: section-in 280ms ease both;
}

.section-heading {
  display: flex;
  margin-bottom: 20px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(23px, 2.4vw, 32px);
  letter-spacing: -0.035em;
}

.poc-badge {
  padding: 7px 11px;
  border: 1px solid rgba(79, 225, 255, 0.17);
  border-radius: 999px;
  color: #aeeefd;
  background: rgba(79, 225, 255, 0.07);
  font-size: 10px;
  font-weight: 780;
  white-space: nowrap;
}

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

.metric-card,
.panel,
.site-workspace,
.standards-grid article,
.contract-panel,
.backup-card {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(17, 37, 62, 0.79), rgba(9, 22, 39, 0.72));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.024);
  backdrop-filter: blur(14px);
}

.metric-card {
  position: relative;
  min-height: 152px;
  padding: 21px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.metric-card > span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 700;
}

.metric-card > strong {
  display: block;
  margin: 12px 0 9px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-card > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.metric-card--accent {
  border-color: rgba(79, 225, 255, 0.24);
  background:
    radial-gradient(circle at 90% 0%, rgba(79, 225, 255, 0.16), transparent 55%),
    linear-gradient(145deg, rgba(19, 51, 79, 0.9), rgba(9, 26, 46, 0.76));
}

.metric-card--accent::after {
  position: absolute;
  right: -24px;
  bottom: -28px;
  width: 102px;
  height: 102px;
  content: "";
  border: 18px solid rgba(79, 225, 255, 0.06);
  border-radius: 50%;
}

.metric-card--accent > strong {
  color: var(--cyan);
}

.metric-safe {
  color: var(--green);
}

.overview-grid {
  display: grid;
  margin-top: 14px;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-md);
}

.panel-heading {
  display: flex;
  margin-bottom: 18px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.panel-heading > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-row {
  display: grid;
  min-height: 70px;
  padding: 11px 13px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(135, 176, 221, 0.09);
  border-radius: 14px;
  background: rgba(7, 19, 34, 0.43);
}

.health-row[data-health="healthy"] {
  border-color: rgba(69, 221, 160, 0.13);
}

.health-row[data-health="warning"] {
  border-color: rgba(255, 212, 105, 0.15);
}

.health-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.site-code {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(95, 143, 255, 0.23);
  border-radius: 12px;
  color: #dce8ff;
  background: rgba(95, 143, 255, 0.1);
  font-size: 12px;
  font-weight: 900;
}

.health-identity > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.health-identity strong,
.health-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-identity strong {
  font-size: 13px;
}

.health-identity small {
  color: var(--muted);
  font-size: 10px;
}

.health-checks {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.is-healthy {
  color: var(--green);
}

.is-warning {
  color: var(--yellow);
}

.is-offline {
  color: var(--red);
}

.validation-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 9px;
  list-style: none;
}

.validation-list li {
  display: grid;
  min-height: 69px;
  padding: 11px 12px;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(140, 174, 218, 0.09);
  border-radius: 13px;
  background: rgba(7, 19, 34, 0.35);
}

.validation-list li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--muted);
  background: rgba(120, 148, 184, 0.1);
  font-size: 10px;
  font-weight: 850;
}

.validation-list li.is-done > span {
  color: var(--green);
  background: rgba(69, 221, 160, 0.1);
}

.validation-list li > div {
  display: grid;
  gap: 3px;
}

.validation-list strong {
  font-size: 12px;
}

.validation-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* Sites */
.site-workspace {
  display: grid;
  min-height: 520px;
  overflow: hidden;
  grid-template-columns: 270px minmax(0, 1fr);
  border-radius: var(--radius-lg);
}

.site-workspace-list {
  display: flex;
  padding: 19px 13px;
  flex-direction: column;
  gap: 7px;
  border-right: 1px solid var(--line);
  background: rgba(5, 16, 29, 0.48);
}

.workspace-site {
  display: grid;
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-radius: 14px;
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
}

.workspace-site:hover,
.workspace-site.is-selected {
  color: var(--text);
  background: rgba(95, 143, 255, 0.09);
}

.workspace-site.is-selected {
  box-shadow: inset 3px 0 var(--violet);
}

.workspace-site > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(95, 143, 255, 0.2);
  border-radius: 12px;
  color: #e2eaff;
  background: rgba(95, 143, 255, 0.09);
  font-size: 11px;
  font-weight: 900;
}

.workspace-site > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.workspace-site strong,
.workspace-site small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-site strong {
  font-size: 12px;
}

.workspace-site small {
  color: var(--muted);
  font-size: 9px;
}

.site-workspace-main {
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
}

.selected-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.selected-site-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

#selected-site-code {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(79, 225, 255, 0.25);
  border-radius: 16px;
  color: var(--cyan);
  background: rgba(79, 225, 255, 0.08);
  font-size: 13px;
  font-weight: 900;
}

.selected-site-header h3 {
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-site-header p {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-site-header a {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(79, 225, 255, 0.22);
  border-radius: 12px;
  color: #c9f6ff;
  background: rgba(79, 225, 255, 0.07);
  font-size: 11px;
  font-weight: 780;
  text-decoration: none;
}

.selected-site-header a:hover {
  border-color: rgba(79, 225, 255, 0.48);
  background: rgba(79, 225, 255, 0.11);
}

.module-preview-grid {
  display: grid;
  margin: 27px 0 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.module-preview-grid article {
  display: grid;
  min-height: 92px;
  padding: 13px;
  gap: 4px;
  border: 1px solid rgba(140, 174, 218, 0.09);
  border-radius: 14px;
  background: rgba(5, 16, 29, 0.43);
}

.module-preview-grid article > span {
  color: var(--violet);
  font-size: 9px;
  font-weight: 900;
}

.module-preview-grid article > strong {
  align-self: end;
  font-size: 12px;
}

.module-preview-grid article > small {
  color: var(--muted);
  font-size: 9px;
}

.disabled-copy {
  color: #cead63 !important;
}

.snapshot-panel {
  padding: 20px;
  border: 1px solid rgba(143, 112, 255, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% -15%, rgba(143, 112, 255, 0.13), transparent 40%),
    rgba(7, 18, 34, 0.52);
}

#snapshot-freshness[data-stale="false"] {
  color: var(--green);
}

#snapshot-freshness[data-stale="true"] {
  color: var(--yellow);
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.snapshot-grid > div {
  min-height: 81px;
  padding: 13px;
  border: 1px solid rgba(141, 170, 210, 0.09);
  border-radius: 13px;
  background: rgba(5, 15, 28, 0.42);
}

.snapshot-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.snapshot-grid strong {
  display: block;
  margin-top: 9px;
  color: #d8ccff;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.snapshot-note {
  margin: 15px 1px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

/* Standards and backups */
.standards-grid,
.backup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.standards-grid article,
.backup-card {
  min-height: 205px;
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius-md);
}

.standards-grid article > span,
.backup-card > span {
  color: var(--cyan);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.standards-grid h3,
.backup-card h3 {
  margin: 30px 0 9px;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.standards-grid p,
.backup-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.contract-panel {
  display: grid;
  margin-top: 14px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
}

.contract-panel > div {
  display: grid;
  min-height: 56px;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.contract-panel > div:last-child {
  border-bottom: 0;
}

.contract-panel span {
  color: var(--muted);
  font-size: 11px;
}

.contract-panel code {
  overflow-wrap: anywhere;
  color: #cbd7ff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.backup-card {
  position: relative;
  overflow: hidden;
}

.backup-card.is-complete {
  border-color: rgba(69, 221, 160, 0.16);
}

.backup-card.is-complete::after {
  position: absolute;
  top: 18px;
  right: 19px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  content: "✓";
  border-radius: 9px;
  color: var(--green);
  background: rgba(69, 221, 160, 0.09);
  font-size: 12px;
  font-weight: 900;
}

.backup-card > strong {
  display: block;
  margin-top: 21px;
  color: #b9c9de;
  font-size: 10px;
  line-height: 1.55;
}

.backup-card.is-complete > strong {
  color: #a9ebca;
}

.hub-footer {
  display: flex;
  margin-top: 30px;
  padding-top: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: #607590;
  font-size: 9px;
  letter-spacing: 0.04em;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 244px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .site-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .module-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hub-layout {
    display: block;
  }

  .sidebar {
    position: relative;
    z-index: 10;
    display: grid;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: max(13px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand logout"
      "nav nav";
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 14, 26, 0.96);
  }

  .sidebar-brand {
    grid-area: brand;
    padding: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .readonly-banner {
    display: none;
  }

  .primary-nav {
    display: flex;
    margin: 0 -2px;
    grid-area: nav;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    min-width: max-content;
    min-height: 39px;
    padding: 0 12px;
    justify-content: center;
    flex: 1 0 auto;
    font-size: 12px;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -2px var(--cyan);
  }

  .sidebar-sites {
    display: none;
  }

  .logout-form {
    display: block;
    margin: 0;
    padding: 0;
    grid-area: logout;
    align-self: center;
  }

  .logout-form button {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
  }

  .hub-main {
    padding: 23px max(15px, env(safe-area-inset-right)) max(26px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .site-workspace {
    display: block;
  }

  .site-workspace-list {
    display: flex;
    padding: 12px;
    flex-direction: row;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-workspace-list::-webkit-scrollbar {
    display: none;
  }

  .workspace-site {
    min-width: 180px;
  }
}

@media (max-width: 560px) {
  .auth-page {
    display: block;
  }

  .auth-card {
    padding: 27px 21px;
    border-radius: 25px;
  }

  .auth-shell::before,
  .auth-shell::after {
    display: none;
  }

  .auth-brand {
    width: 56px;
    height: 56px;
    margin-bottom: 23px;
    border-radius: 17px;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand logout"
      "nav nav";
  }

  .sidebar-brand strong {
    font-size: 14px;
  }

  .sidebar-brand small {
    font-size: 9px;
  }

  .nav-item {
    min-width: 99px;
    padding: 0 9px;
  }

  .nav-item > span {
    display: none;
  }

  .topbar h1 {
    font-size: 29px;
  }

  .last-updated {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-message {
    margin: 20px 0 22px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 23px;
  }

  .poc-badge {
    font-size: 8px;
  }

  .metric-grid,
  .standards-grid,
  .backup-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 128px;
  }

  .metric-card > strong {
    font-size: 32px;
  }

  .panel {
    padding: 17px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .panel-heading > small {
    text-align: left;
  }

  .health-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .health-checks {
    padding-left: 55px;
    align-items: flex-start;
  }

  .site-workspace {
    border-radius: 20px;
  }

  .site-workspace-list {
    padding: 9px;
  }

  .workspace-site {
    min-width: 158px;
  }

  .site-workspace-main {
    padding: 18px 14px 15px;
  }

  .selected-site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .selected-site-header a {
    width: 100%;
  }

  .module-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-panel {
    padding: 16px 12px;
  }

  .snapshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .snapshot-grid strong {
    font-size: 21px;
  }

  .standards-grid article,
  .backup-card {
    min-height: 180px;
  }

  .contract-panel {
    padding: 8px 14px;
  }

  .contract-panel > div {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 0;
  }

  .hub-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 370px) {
  .hub-main {
    padding-right: 11px;
    padding-left: 11px;
  }

  .metric-grid,
  .module-preview-grid,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* HTCESHI light admin theme: calm white surfaces and familiar controls. */
:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --bg-deep: #eef2f6;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #172033;
  --muted: #68758a;
  --muted-strong: #46546a;
  --cyan: #2563eb;
  --blue: #2563eb;
  --violet: #5b55d6;
  --green: #16865b;
  --yellow: #a16207;
  --red: #c43d57;
  --shadow: 0 18px 46px rgba(30, 41, 59, 0.11);
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

html,
body,
.hub-page,
.auth-page {
  min-width: 0;
  color: var(--text);
  background: #f5f7fa;
}

body {
  background-image: none;
}

body::before {
  display: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline-color: rgba(37, 99, 235, 0.55);
}

.eyebrow,
.section-kicker,
.panel-heading > div > span {
  color: #2563eb;
}

/* Login */
.auth-page {
  background: #f3f6fa;
}

.auth-shell::before {
  background: rgba(191, 219, 254, 0.7);
}

.auth-shell::after {
  background: rgba(224, 231, 255, 0.72);
}

.auth-card {
  border-color: #dfe6ef;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 22px 55px rgba(30, 41, 59, 0.12);
  backdrop-filter: none;
}

.auth-card::after {
  width: 100%;
  height: 4px;
  background: #2563eb;
}

.auth-brand,
.brand-mark {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: none;
}

.auth-brand i {
  border-color: #ffffff;
  background: #22a06b;
}

.auth-card h1,
.topbar h1,
.section-heading h2,
.panel-heading h3 {
  color: #172033;
}

.setup-note,
.setup-locked {
  border-color: #dbeafe;
  color: #46546a;
  background: #eff6ff;
}

.form-alert {
  border-color: #fecdd3;
  color: #9f1239;
  background: #fff1f2;
}

.auth-form label {
  color: #46546a;
}

.auth-form input {
  border-color: #cbd5e1;
  border-radius: 11px;
  color: #172033;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.auth-form input:hover {
  border-color: #94a3b8;
}

.auth-form input:focus {
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-form button {
  border-radius: 11px;
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.auth-form button:hover {
  background: #1d4ed8;
  filter: none;
}

.auth-boundaries {
  border-color: #e2e8f0;
  color: #68758a;
}

.auth-boundaries li::before {
  color: #16865b;
}

/* Dashboard shell */
.hub-layout {
  background: #f5f7fa;
}

.sidebar {
  border-color: #e2e8f0;
  background: #ffffff;
  box-shadow: 4px 0 18px rgba(15, 23, 42, 0.035);
  backdrop-filter: none;
}

.readonly-banner {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.readonly-banner span {
  background: #16a36a;
  box-shadow: 0 0 0 4px rgba(22, 163, 106, 0.1);
}

.nav-item {
  color: #526177;
}

.nav-item > span,
.sidebar-sites > p {
  color: #7b8798;
}

.nav-item:hover {
  color: #172033;
  background: #f1f5f9;
}

.nav-item.is-active {
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: inset 3px 0 #2563eb;
}

.nav-item.is-active > span {
  color: #2563eb;
}

.site-switch {
  color: #526177;
}

.site-switch:hover,
.site-switch.is-selected {
  color: #172033;
  background: #f1f5f9;
}

.site-switch i[data-status="healthy"] {
  background: #16a36a;
  box-shadow: 0 0 0 4px rgba(22, 163, 106, 0.1);
}

.logout-form button {
  border-color: #d7dee8;
  color: #526177;
  background: #ffffff;
}

.logout-form button:hover {
  border-color: #fda4af;
  color: #be123c;
  background: #fff1f2;
}

.hub-main {
  background: #f5f7fa;
}

.topbar-actions button {
  border-color: #cbd5e1;
  color: #334155;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.topbar-actions button:hover:not(:disabled) {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}

.status-message {
  border-color: #dbe3ed;
  color: #46546a;
  background: #ffffff;
}

.status-message[data-kind="loading"] {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.status-message[data-kind="success"] {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.status-message[data-kind="error"] {
  border-color: #fecdd3;
  color: #9f1239;
  background: #fff1f2;
}

.poc-badge {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.metric-card,
.panel,
.site-workspace,
.standards-grid article,
.contract-panel,
.backup-card {
  border-color: #e1e7ef;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.045);
  backdrop-filter: none;
}

.metric-card--accent {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.metric-card--accent::after {
  display: none;
}

.metric-card--accent > strong {
  color: #2563eb;
}

.metric-safe,
.is-healthy,
#snapshot-freshness[data-stale="false"] {
  color: #16865b;
}

.is-warning,
#snapshot-freshness[data-stale="true"] {
  color: #a16207;
}

.is-offline {
  color: #c43d57;
}

.health-row,
.validation-list li,
.module-preview-grid article,
.snapshot-grid > div {
  border-color: #e7ecf2;
  background: #f8fafc;
}

.health-row[data-health="healthy"] {
  border-color: #ccebdc;
}

.health-row[data-health="warning"] {
  border-color: #f5dfad;
}

.site-code,
.workspace-site > span {
  border-color: #c7d7fe;
  color: #1e40af;
  background: #eef2ff;
}

.validation-list li > span {
  color: #526177;
  background: #edf1f6;
}

.validation-list li.is-done > span {
  color: #16865b;
  background: #e8f7ef;
}

.site-workspace-list {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.workspace-site {
  color: #526177;
}

.workspace-site:hover,
.workspace-site.is-selected {
  color: #172033;
  background: #eaf2ff;
}

.workspace-site.is-selected {
  box-shadow: inset 3px 0 #2563eb;
}

#selected-site-code {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.selected-site-header a {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
}

.selected-site-header a:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.disabled-copy {
  color: #9a6700 !important;
}

.snapshot-panel {
  border-color: #d9e2ef;
  background: #f8fafc;
}

.snapshot-grid strong {
  color: #334155;
}

.contract-panel code {
  color: #334155;
}

.backup-card.is-complete {
  border-color: #ccebdc;
}

.backup-card.is-complete::after {
  color: #16865b;
  background: #e8f7ef;
}

.backup-card > strong {
  color: #526177;
}

.backup-card.is-complete > strong {
  color: #16734f;
}

.hub-footer {
  border-color: #e2e8f0;
  color: #7b8798;
}

.logout-form button,
.topbar-actions button,
.selected-site-header a {
  min-height: 44px;
}

@media (max-width: 820px) {
  .sidebar {
    border-bottom-color: #e2e8f0;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
  }

  .primary-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: visible;
  }

  .nav-item {
    min-width: 0;
    min-height: 44px;
    padding-inline: 8px;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -2px #2563eb;
  }

  .logout-form button {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .primary-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-item {
    min-width: 0;
    min-height: 44px;
  }
}
