:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: #dce7f4;
  background: #070b11;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --canvas: #070b11;
  --surface: #0c121b;
  --surface-raised: #111a26;
  --surface-hover: #111e2c;
  --line: #1e2d3e;
  --line-strong: #2d4258;
  --text: #dce7f4;
  --muted: #7f91a6;
  --cyan: #19cfff;
  --cyan-dim: #0b7e9d;
  --green: #2be5a3;
  --amber: #f3bf56;
  --red: #ff5f76;
  --violet: #a98cff;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(25, 207, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 207, 255, .025) 1px, transparent 1px);
  background-size: 32px 32px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .38; filter: saturate(.45); }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.55; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(25, 207, 255, .09), transparent 34%);
}
.login-card {
  position: relative;
  width: min(430px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px;
  background: rgba(12, 18, 27, .96);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .44), inset 0 1px rgba(255, 255, 255, .025);
}
.login-card::before,
.hero::before,
.progress-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 42px;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(25, 207, 255, .55);
}
.login-card h1, .hero h1 { margin: 0; letter-spacing: -.035em; }
.login-card h1 { font-size: 28px; }
.login-card p { margin-bottom: 0; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--cyan-dim);
  border-radius: 3px;
  color: var(--cyan);
  background: rgba(25, 207, 255, .06);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.08em;
  box-shadow: inset 0 0 22px rgba(25, 207, 255, .06), 0 0 18px rgba(25, 207, 255, .08);
}
.brand-mark.small { width: 38px; height: 38px; font-size: 13px; }

label {
  display: grid;
  gap: 7px;
  color: #9dafc2;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
}
input, select {
  min-height: 42px;
  padding: 9px 11px;
  color: var(--text);
  background: #080d14;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  outline: none;
  transition: border-color .14s, box-shadow .14s, background .14s;
}
input::placeholder { color: #526174; }
input:focus, select:focus {
  background: #0a111a;
  border-color: var(--cyan-dim);
  box-shadow: 0 0 0 2px rgba(25, 207, 255, .09), inset 3px 0 var(--cyan);
}
select { cursor: pointer; }

button {
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
  transition: border-color .12s, color .12s, background .12s, transform .12s;
}
button:active:not(:disabled) { transform: translateY(1px); }
.primary { color: #021117; background: var(--cyan); border-color: var(--cyan); }
.primary:hover:not(:disabled) { background: #6ee4ff; border-color: #6ee4ff; }
.secondary { color: #a9dcec; background: #0d2631; border-color: #16485a; }
.secondary:hover:not(:disabled) { color: #d5f7ff; background: #113442; border-color: var(--cyan-dim); }
.ghost { color: #91a3b7; background: transparent; border-color: var(--line); }
.ghost:hover:not(:disabled) { color: var(--text); background: #111a25; border-color: var(--line-strong); }
.wide { width: 100%; }
.danger-text { color: var(--red); }
.error-text { min-height: 18px; margin: 0; color: var(--red); font-family: var(--font-mono); font-size: 11px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 62px;
  padding: 10px clamp(16px, 3vw, 42px);
  background: rgba(7, 11, 17, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand-row, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.brand-row div:last-child { display: grid; gap: 3px; }
.brand-row strong { letter-spacing: -.015em; }
.brand-row span { color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .045em; }
.system-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #8da194;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.system-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(43, 229, 163, .68); }

.container { width: min(1500px, calc(100% - 30px)); margin: 22px auto 56px; display: grid; gap: 14px; }
.card {
  background: rgba(12, 18, 27, .95);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, .14), inset 0 1px rgba(255, 255, 255, .018);
}
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, .75fr) minmax(540px, 1.25fr);
  gap: 28px;
  align-items: end;
  padding: 22px;
}
.hero h1 { color: #eff7ff; font-size: clamp(24px, 2.4vw, 34px); }
.hero p { margin-bottom: 0; }
.group-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.group-form input { font-family: var(--font-mono); }
.grow { flex: 1; }
.profile-select { width: min(320px, 100%); }
.store-seed { width: min(210px, 100%); }
.notice {
  padding: 12px 15px;
  color: var(--amber);
  background: rgba(243, 191, 86, .075);
  border: 1px solid rgba(243, 191, 86, .28);
  border-left: 3px solid var(--amber);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.notice.error { color: var(--red); background: rgba(255, 95, 118, .075); border-color: rgba(255, 95, 118, .3); border-left-color: var(--red); }
.recovery-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  border-color: #265469;
  background: linear-gradient(90deg, rgba(25, 207, 255, .055), rgba(12, 18, 27, .95) 45%);
}
.recovery-card h2 { margin: 0; font-size: 17px; }
.recovery-card p:last-child { margin: 6px 0 0; }
.recovery-actions { display: flex; flex: 0 0 auto; gap: 8px; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; }
.stat {
  position: relative;
  min-height: 91px;
  padding: 13px 14px 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  align-items: end;
  border-left: 2px solid var(--line-strong);
}
.stat::after { content: ""; position: absolute; top: 10px; right: 10px; width: 4px; height: 4px; background: #53657a; }
.stat span { align-self: start; color: var(--muted); font-size: 11px; font-weight: 650; }
.stat strong { grid-row: 2; color: #edf6ff; font-family: var(--font-mono); font-size: 28px; line-height: 1; letter-spacing: -.06em; }
.stat small { grid-row: 2; align-self: end; color: #506176; font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; }
.stat.success { border-left-color: var(--green); }
.stat.info { border-left-color: var(--cyan); }
.stat.warning { border-left-color: var(--amber); }
.stat.danger { border-left-color: var(--red); }
.stat.success strong { color: var(--green); }
.stat.info strong { color: var(--cyan); }
.stat.warning strong { color: var(--amber); }
.stat.danger strong { color: var(--red); }

.progress-card { position: relative; padding: 18px 20px; }
.progress-heading, .progress-meta { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.progress-heading h2 { margin: 0; font-size: 17px; }
.progress-heading > strong { color: var(--cyan); font-family: var(--font-mono); font-size: 26px; }
.progress-track { height: 8px; margin: 15px 0 10px; overflow: hidden; background: #05080d; border: 1px solid #1c2b3a; border-radius: 1px; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); box-shadow: 0 0 14px rgba(25, 207, 255, .35); transition: width .25s ease; }
.progress-meta { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.queue-controls { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }

.table-card { overflow: hidden; }
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #0a1018; border-bottom: 1px solid var(--line); }
.select-all { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.select-all input, tbody input { min-height: auto; width: 16px; height: 16px; accent-color: var(--cyan); }
.select-all span { color: var(--muted); font-weight: 600; }
.search { flex: 1; min-width: 180px; }
.actions { display: flex; gap: 7px; }
.table-scroll { overflow: auto; max-height: 640px; scrollbar-color: #344a60 #090e15; scrollbar-width: thin; }
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #090e15; }
.table-scroll::-webkit-scrollbar-thumb { background: #2a3d51; border: 2px solid #090e15; }
table { width: 100%; border-collapse: collapse; min-width: 1440px; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 12px;
  color: #71859a;
  background: #0d151f;
  border-bottom: 1px solid var(--line-strong);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .085em;
  text-transform: uppercase;
}
td { padding: 10px 12px; border-bottom: 1px solid #152231; font-size: 12px; vertical-align: middle; }
td:nth-child(3), td:nth-child(7) { color: #9aacc0; font-family: var(--font-mono); font-size: 10px; }
.pin-action, .restart-action { min-height: 30px; padding: 5px 9px; white-space: nowrap; }
.row-actions, .method-list { display: flex; flex-wrap: wrap; gap: 5px; }
.method-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 6px;
  border: 1px solid #2a3d51;
  border-radius: 2px;
  color: #8fa2b7;
  background: #0d151f;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.method-badge.active { color: var(--cyan); border-color: rgba(25, 207, 255, .45); box-shadow: inset 0 0 12px rgba(25, 207, 255, .05); }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, .009); }
tbody tr:hover { background: var(--surface-hover); box-shadow: inset 2px 0 var(--cyan-dim); }
.location-name { display: grid; gap: 3px; }
.location-name strong { color: #dce8f4; font-size: 12px; }
.location-name span { color: #63768b; font-family: var(--font-mono); font-size: 9px; }
.gbp-status { display: grid; gap: 4px; min-width: 170px; }
.gbp-status > span:not(.badge) { color: var(--muted); font-family: var(--font-mono); font-size: 9px; white-space: nowrap; }
.gbp-status .source-warning { color: var(--amber); }
.empty { padding: 52px; color: var(--muted); font-family: var(--font-mono); text-align: center; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 3px 7px;
  border: 1px solid #2b3b4d;
  border-radius: 2px;
  background: #121b26;
  color: #8799ad;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .025em;
  white-space: nowrap;
  text-transform: uppercase;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.badge.success { color: var(--green); border-color: rgba(43, 229, 163, .3); background: rgba(43, 229, 163, .06); }
.badge.info { color: var(--cyan); border-color: rgba(25, 207, 255, .3); background: rgba(25, 207, 255, .06); }
.badge.warning { color: var(--amber); border-color: rgba(243, 191, 86, .3); background: rgba(243, 191, 86, .06); }
.badge.danger { color: var(--red); border-color: rgba(255, 95, 118, .3); background: rgba(255, 95, 118, .06); }
.badge.processing { color: var(--violet); border-color: rgba(169, 140, 255, .3); background: rgba(169, 140, 255, .06); }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; color: var(--muted); background: #0a1018; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; }
.table-footer div { display: flex; gap: 5px; }
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(430px, calc(100% - 36px));
  padding: 12px 14px;
  color: #dff9ff;
  background: #0d2029;
  border: 1px solid #246174;
  border-left: 3px solid var(--cyan);
  border-radius: 3px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
  font-family: var(--font-mono);
  font-size: 11px;
}
.toast.error { color: #ffe0e5; background: #271117; border-color: #6a2935; border-left-color: var(--red); }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; align-items: stretch; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .toolbar { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 16px, 1500px); margin-top: 10px; }
  .topbar { padding-inline: 10px; }
  .system-state { display: none; }
  .hero { padding: 17px; }
  .group-form, .toolbar { align-items: stretch; flex-direction: column; }
  .search { order: initial; width: 100%; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .primary { grid-column: 1 / -1; }
  .recovery-card { align-items: stretch; flex-direction: column; }
  .recovery-actions, .queue-controls { flex-wrap: wrap; justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .table-footer { align-items: flex-start; flex-direction: column; }
  .table-footer div { flex-wrap: wrap; }
}
@media (max-width: 440px) {
  .login-card { padding: 24px 20px; }
  .brand-row span { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { min-height: 84px; }
  .progress-heading { align-items: flex-start; }
  .progress-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
