:root {
  color-scheme: light;
  --bg: #f3f6f3;
  --panel: #ffffff;
  --ink: #0f2118;
  --ink-soft: #21382b;
  --muted: #687970;
  --faint: #94a39a;
  --line: #e4ebe6;
  --line-strong: #d3ded7;
  --green: #08b75f;
  --green-bright: #0ac268;
  --green-deep: #057a43;
  --green-soft: #e9f8ef;
  --blue: #2f6fb5;
  --blue-soft: #eaf2ff;
  --indigo: #5b47a8;
  --indigo-soft: #f0edff;
  --amber: #a86b12;
  --amber-soft: #fff6e5;
  --red: #c4453e;
  --red-soft: #fff0ee;
  --sidebar: #0b2016;
  --sidebar-soft: #0e271a;
  --radius: 18px;
  --radius-sm: 11px;
  --shadow: 0 18px 45px -32px rgba(15, 44, 28, 0.34);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

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

svg {
  display: block;
}

::selection {
  background: rgba(10, 194, 104, 0.18);
}

.hidden {
  display: none !important;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  flex: none;
}

.logo-mark i {
  display: block;
  border-radius: 4px;
  background: var(--ink);
}

.logo-mark i:nth-child(1) {
  background: var(--green-bright);
}

.logo-mark i:nth-child(2) {
  border-radius: 50%;
  background: rgba(15, 33, 24, 0.16);
}

.logo-mark i:nth-child(4) {
  border-radius: 50%;
  background: var(--green-bright);
}

.logo-mark-light i {
  background: rgba(255, 255, 255, 0.9);
}

.logo-mark-light i:nth-child(1),
.logo-mark-light i:nth-child(4) {
  background: var(--green-bright);
}

.logo-mark-light i:nth-child(2) {
  background: rgba(255, 255, 255, 0.2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-copy small {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--faint);
}

.brand-on-dark {
  color: #fff;
}

.brand-on-dark .brand-copy small {
  color: rgba(230, 248, 238, 0.42);
}

/* Login */
.login-page {
  min-height: 100vh;
  background: #f6f8f5;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 44px 56px 38px;
  color: #fff;
  background:
    radial-gradient(1000px 600px at 90% 8%, rgba(10, 194, 104, 0.18), transparent 55%),
    radial-gradient(760px 520px at 12% 100%, rgba(25, 87, 55, 0.42), transparent 62%),
    linear-gradient(160deg, #10291c 0%, #081a11 100%);
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(207, 245, 224, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(145deg, rgba(0, 0, 0, 0.7), transparent 68%);
  mask-image: linear-gradient(145deg, rgba(0, 0, 0, 0.7), transparent 68%);
}

.login-brand-top,
.login-brand-copy,
.login-features {
  position: relative;
  z-index: 2;
}

.login-brand-copy {
  max-width: 560px;
  margin-top: clamp(58px, 12vh, 120px);
}

.login-brand-eyebrow {
  margin: 0;
  color: #71d8a1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

.login-brand h1 {
  margin: 22px 0 22px;
  color: #f4fbf7;
  font-size: clamp(42px, 4.5vw, 64px);
  font-weight: 720;
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.login-brand-lead {
  max-width: 450px;
  margin: 0;
  color: rgba(226, 244, 233, 0.62);
  font-size: 15px;
  line-height: 1.85;
}

.login-features {
  display: flex;
  gap: 9px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.login-features li {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(224, 244, 233, 0.7);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.login-art {
  position: absolute;
  right: -54px;
  bottom: 98px;
  z-index: 1;
  width: 430px;
  height: 430px;
  pointer-events: none;
}

.art-card {
  position: relative;
  z-index: 2;
  width: 244px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.035));
  box-shadow:
    0 40px 90px -40px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  transform: rotate(-7deg);
}

.art-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
  color: rgba(227, 247, 236, 0.5);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.art-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.art-live i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(10, 194, 104, 0.16);
}

.art-index {
  font-family: var(--mono);
}

.art-qr {
  padding: 12px;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 16px 34px -22px rgba(0, 0, 0, 0.5);
}

.art-qr svg {
  width: 100%;
  height: auto;
}

.art-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.art-meta div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.art-meta strong {
  color: #eefaf3;
  font-size: 11px;
  font-weight: 600;
}

.art-meta span {
  color: rgba(222, 243, 231, 0.44);
  font-size: 9px;
}

.art-check {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 194, 104, 0.14);
  color: #5ee29c;
}

.art-check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.art-orbit {
  position: absolute;
  border: 1px solid rgba(132, 224, 174, 0.13);
  border-radius: 50%;
}

.art-orbit-a {
  inset: -28px;
}

.art-orbit-b {
  inset: 40px;
}

.art-float {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  background: rgba(17, 48, 32, 0.82);
  box-shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
}

.art-float strong {
  color: #74e4a9;
  font-size: 14px;
  letter-spacing: -0.02em;
}

.art-float span {
  color: rgba(229, 248, 238, 0.46);
  font-size: 9px;
}

.art-float-a {
  right: 5px;
  top: 56px;
  transform: rotate(5deg);
}

.art-float-b {
  left: 24px;
  bottom: 8px;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: rgba(237, 250, 242, 0.68);
  font-size: 9px;
}

.art-float-b i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(10, 194, 104, 0.13);
}

.login-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background:
    radial-gradient(600px 360px at 100% 0%, rgba(10, 183, 95, 0.06), transparent 62%),
    #f7f9f6;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(12, 52, 31, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 52, 31, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
  mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
}

.login-panel-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 382px);
  animation: login-in 0.45s ease both;
}

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

.login-mobile-brand {
  display: none;
  align-items: center;
  margin-bottom: 52px;
}

.login-kicker {
  margin: 0;
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.login-panel h2 {
  margin: 13px 0 9px;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.login-sub {
  margin: 0 0 34px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 51px;
  padding: 0 66px 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.password-field input::placeholder {
  color: #aab6ae;
}

.password-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(8, 183, 95, 0.1);
}

.password-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 39px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.password-toggle:hover {
  background: #f1f6f2;
  color: var(--ink);
}

.form-error {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 51px;
  margin-top: 22px;
  border: 0;
  border-radius: 13px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 18px 30px -20px rgba(15, 33, 24, 0.75);
  transition: background 0.16s ease, transform 0.16s ease;
}

.login-submit:hover {
  background: #183326;
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: 0.66;
  cursor: wait;
}

.login-submit svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 32px;
  color: var(--faint);
  font-size: 11px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 183, 95, 0.12);
}

/* Shell */
.console-page {
  min-height: 100vh;
  background:
    radial-gradient(900px 400px at 100% 0%, rgba(8, 183, 95, 0.045), transparent 55%),
    var(--bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 232px;
  padding: 24px 16px 18px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(340px 240px at 20% -4%, rgba(10, 194, 104, 0.2), transparent 65%),
    linear-gradient(180deg, var(--sidebar-soft) 0%, #081a11 100%);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(205, 244, 224, 0.07) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(160deg, rgba(0, 0, 0, 0.7), transparent 60%);
  mask-image: linear-gradient(160deg, rgba(0, 0, 0, 0.7), transparent 60%);
}

.side-logo {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px;
  text-decoration: none;
}

.side-logo-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.side-logo-copy strong {
  color: #f2faf5;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.side-logo-copy small {
  margin-top: 4px;
  color: rgba(218, 243, 229, 0.36);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.side-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 36px;
}

.side-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: rgba(232, 247, 238, 0.58);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.side-link svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}

.side-link.active {
  background: rgba(255, 255, 255, 0.085);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.side-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 3px;
  height: 16px;
  border-radius: 0 3px 3px 0;
  background: var(--green-bright);
}

.side-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
}

.service-state {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(10, 194, 104, 0.12);
}

.service-state div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.service-state strong {
  color: rgba(238, 250, 243, 0.8);
  font-size: 11.5px;
  font-weight: 600;
}

.service-state small {
  color: rgba(219, 242, 229, 0.34);
  font-size: 9.5px;
}

.side-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(226, 245, 234, 0.42);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.side-logout:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.side-logout svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  min-height: 100vh;
  width: calc(100% - 232px);
  margin-left: 232px;
  padding: 0 34px 52px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 1340px);
  margin: 0 auto;
  padding: 32px 0 22px;
  border-bottom: 1px solid var(--line);
}

.kicker {
  margin: 0 0 7px;
  color: var(--green-deep);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.topbar h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view {
  width: min(100%, 1340px);
  margin: 24px auto 0;
}

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.ui-btn:hover {
  border-color: #c7d6cc;
  background: #fbfdfb;
}

.ui-btn:active {
  transform: translateY(1px);
}

.ui-btn:disabled {
  opacity: 0.58;
  cursor: wait;
}

.ui-btn svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-btn.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 12px 22px -16px rgba(15, 33, 24, 0.85);
}

.ui-btn.primary:hover {
  border-color: #173426;
  background: #173426;
}

.ui-btn.danger {
  border-color: #efd6d3;
  color: var(--red);
  background: #fff;
}

.ui-btn.danger:hover {
  border-color: #e8c3be;
  background: var(--red-soft);
}

.ui-btn.compact {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11.5px;
}

.ui-btn.icon-only {
  width: 38px;
  padding: 0;
}

.ui-btn.is-loading span {
  opacity: 0.7;
}

/* Overview */
.overview-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 16px;
  color: var(--faint);
  font-size: 11.5px;
}

.overview-meta i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #bcc9c0;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 19px 20px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -44px;
  right: -36px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8, 183, 95, 0.07), transparent 70%);
  pointer-events: none;
}

.stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-deep);
}

.stat-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.stat-icon.indigo {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.stat-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.stat-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-value {
  margin-top: 15px;
  font-size: 33px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  color: var(--faint);
  font-size: 10.5px;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.delta.up {
  background: var(--green-soft);
  color: var(--green-deep);
}

.delta.down {
  background: var(--red-soft);
  color: var(--red);
}

.delta.flat {
  background: #f2f5f2;
  color: var(--faint);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: 15px;
  margin-top: 15px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 21px 0;
}

.panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.5;
}

.legend {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 10.5px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--green-bright);
}

.legend i.light {
  background: #d7e4db;
}

.chart-wrap {
  position: relative;
  padding: 13px 14px 15px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-svg text {
  font-family: var(--font);
}

.chart-empty {
  position: absolute;
  inset: 24px 0 26px;
  display: grid;
  place-items: center;
  color: var(--faint);
  font-size: 11.5px;
  pointer-events: none;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}

.side-panel {
  overflow: hidden;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 19px 13px;
}

.mini-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: #f2f6f3;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.count-chip.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.expiry-list {
  display: flex;
  flex-direction: column;
}

.expiry-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 19px;
  border-top: 1px solid #f0f4f1;
  text-decoration: none;
}

.expiry-item:hover {
  background: #fbfdfb;
}

.expiry-copy {
  min-width: 0;
}

.expiry-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expiry-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expiry-time {
  flex: none;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.expiry-time.expired {
  background: var(--red-soft);
  color: var(--red);
}

.top-list {
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 19px;
  text-decoration: none;
}

.top-item:hover {
  background: #fbfdfb;
}

.rank {
  width: 20px;
  flex: none;
  color: #b8c5bc;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.top-item:nth-child(1) .rank {
  color: var(--green-deep);
}

.top-copy {
  min-width: 0;
  flex: 1;
}

.top-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-copy span {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 9.5px;
}

.top-value {
  flex: none;
  text-align: right;
}

.top-value strong {
  display: block;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.top-value span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
}

.mini-empty {
  padding: 16px 19px 20px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.6;
}

/* Lists */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.list-summary {
  color: var(--muted);
  font-size: 11.5px;
}

.list-summary strong {
  color: var(--ink);
  font-weight: 650;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 11px;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.search-field input {
  width: 220px;
  height: 36px;
  padding: 0 12px 0 31px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.search-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 183, 95, 0.08);
}

.filter-select {
  height: 36px;
  padding: 0 28px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 17px;
  border-bottom: 1px solid var(--line);
  background: #fafcfa;
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 17px;
  border-bottom: 1px solid #eff4f0;
  color: var(--ink);
  font-size: 12px;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fbfdfb;
}

.code-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  text-decoration: none;
}

.type-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
}

.type-avatar.type-personal {
  background: var(--green-soft);
  color: var(--green-deep);
}

.type-avatar.type-group {
  background: var(--blue-soft);
  color: var(--blue);
}

.type-avatar.type-qywx {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.type-avatar.type-url {
  background: var(--amber-soft);
  color: var(--amber);
}

.code-copy {
  min-width: 0;
}

.code-name {
  display: block;
  max-width: 230px;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-slug {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.type-badge.type-personal {
  background: var(--green-soft);
  color: var(--green-deep);
}

.type-badge.type-group {
  background: var(--blue-soft);
  color: var(--blue);
}

.type-badge.type-qywx {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.type-badge.type-url {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.active {
  background: var(--green-soft);
  color: var(--green-deep);
}

.status-pill.paused {
  background: #f2f4f2;
  color: var(--faint);
}

.cell-strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-muted {
  color: var(--faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.mini-warn {
  display: block;
  margin-top: 4px;
  color: var(--amber);
  font-size: 9px;
  font-weight: 600;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.icon-btn {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #a0aea5;
  cursor: pointer;
}

.icon-btn:hover {
  background: #f1f6f2;
  color: var(--ink);
}

.icon-btn.danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state {
  padding: 52px 24px;
  text-align: center;
}

.empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f9fbf9;
  color: var(--faint);
}

.empty-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 650;
}

.empty-state p {
  margin: 0 auto 18px;
  max-width: 320px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.7;
}

/* Detail */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 550;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.back-link svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 17px;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-title {
  margin: 0;
  font-size: 25px;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 9px;
  color: var(--faint);
  font-size: 10.5px;
}

.detail-meta .mono {
  font-family: var(--mono);
}

.detail-meta i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c4cfc7;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
}

.alert-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid #f0e0bd;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffbf3, var(--amber-soft));
  color: #7b5a17;
  font-size: 11.5px;
  line-height: 1.6;
}

.alert-strip.danger {
  border-color: #efd3ce;
  background: linear-gradient(180deg, #fff8f7, var(--red-soft));
  color: #8e3630;
}

.alert-strip-copy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.alert-strip-copy svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.alert-strip button {
  flex: none;
  padding: 4px 9px;
  border: 1px solid rgba(122, 90, 23, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 15px;
}

.qr-card {
  padding: 20px;
}

.qr-card-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qr-card-label h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.qr-card-label span {
  color: var(--faint);
  font-size: 9.5px;
}

.qr-frame {
  width: 176px;
  margin: 15px auto 15px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 28px -22px rgba(5, 92, 51, 0.36);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
}

.url-field {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 37px;
  padding: 0 4px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fbf9;
}

.url-field span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-field .icon-btn {
  width: 27px;
  height: 27px;
  flex: none;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 8px;
}

.qr-actions .ui-btn {
  width: 100%;
  height: 35px;
  padding: 0 8px;
  font-size: 11px;
}

.qr-hint {
  margin: 13px 0 0;
  padding-top: 12px;
  border-top: 1px solid #f0f4f1;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
  text-align: center;
}

.fallback-config {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 8px 9px;
  border-radius: 8px;
  background: #f8fbf8;
  color: var(--faint);
  font-size: 9.5px;
}

.fallback-config strong {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fallback-config button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--green-deep);
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
}

.analytics-panel {
  padding: 20px 21px;
}

.analytics-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.analytics-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.analytics-head span {
  color: var(--faint);
  font-size: 9.5px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 19px;
}

.metric {
  padding: 0 18px;
  border-left: 1px solid #eef3ef;
}

.metric:first-child {
  padding-left: 0;
  border-left: 0;
}

.metric label {
  display: block;
  color: var(--faint);
  font-size: 9.5px;
}

.metric strong {
  display: block;
  margin-top: 7px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.analytics-panel {
  display: flex;
  flex-direction: column;
}

.analytics-panel .mini-chart-wrap {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.analytics-panel .mini-chart {
  flex: 1;
  min-height: 58px;
  height: auto;
}

.mini-chart-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f0f4f1;
}

.mini-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 9.5px;
}

.mini-chart {
  display: block;
  width: 100%;
  height: 58px;
  margin-top: 8px;
}

.targets-card {
  margin-top: 15px;
  overflow: hidden;
}

.targets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 15px;
}

.targets-head-copy {
  display: flex;
  align-items: center;
  gap: 9px;
}

.targets-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.targets-head .panel-sub {
  margin: 0;
}

.target-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
}

.target-thumb {
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf7;
  object-fit: cover;
}

.target-thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--faint);
}

.target-thumb.placeholder svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.target-copy {
  min-width: 0;
}

.target-copy strong {
  display: block;
  max-width: 230px;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-copy span {
  display: block;
  max-width: 240px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: #f3f7f4;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.cap-cell {
  min-width: 94px;
}

.cap-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.cap-line strong {
  font-weight: 600;
}

.cap-line span {
  color: var(--faint);
}

.cap-bar {
  width: 70px;
  height: 3px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2ee;
}

.cap-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-bright), #7ee0ad);
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #f3f7f4;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 550;
  white-space: nowrap;
}

.expiry-badge.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.expiry-badge.expired {
  background: var(--red-soft);
  color: var(--red);
}

.switch {
  position: relative;
  display: inline-block;
  flex: none;
  vertical-align: middle;
  width: 33px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #dce5df;
  cursor: pointer;
  transition: background 0.16s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 33, 24, 0.2);
  transition: transform 0.16s ease;
}

.switch.on {
  background: var(--green);
}

.switch.on::after {
  transform: translateX(14px);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.channel-panel,
.builder-panel {
  padding-bottom: 8px;
}

.channel-list {
  margin: 0;
  padding: 4px 19px 4px;
  list-style: none;
}

.channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-top: 1px solid #f0f4f1;
}

.channel-row:first-child {
  border-top: 0;
}

.channel-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-name::before {
  content: "#";
  margin-right: 3px;
  color: var(--faint);
  font-family: var(--mono);
}

.channel-stats {
  flex: none;
  color: var(--faint);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.channel-stats strong {
  color: var(--muted);
  font-weight: 600;
}

.builder-panel {
  padding: 19px 20px 18px;
}

.builder-panel h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.builder-panel p {
  margin: 5px 0 13px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.builder-row {
  display: flex;
  gap: 7px;
}

.builder-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.builder-row input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 183, 95, 0.08);
}

.generated-link {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid #dcefe3;
  border-radius: 8px;
  background: #f4fbf6;
}

.generated-link span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-link .icon-btn {
  width: 26px;
  height: 26px;
  flex: none;
}

/* Modal */
.modal {
  width: min(92vw, 570px);
  max-height: 90vh;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.modal::backdrop {
  background: rgba(7, 22, 14, 0.46);
  backdrop-filter: blur(3px);
}

.modal-shell {
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 40px 100px -30px rgba(7, 22, 14, 0.55);
  animation: modal-in 0.18s ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 23px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.5;
}

.modal-close {
  width: 29px;
  height: 29px;
  display: grid;
  flex: none;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #f4f7f4;
  color: var(--muted);
  cursor: pointer;
}

.modal-close:hover {
  background: #edf3ee;
  color: var(--ink);
}

.modal-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.modal-body {
  padding: 20px 23px 22px;
}

.modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 23px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input,
.field select {
  height: 40px;
  padding: 0 11px;
}

.field textarea {
  min-height: 68px;
  padding: 9px 11px;
  line-height: 1.6;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #aab7ae;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 183, 95, 0.09);
}

.field input:disabled {
  background: #f6f9f6;
  color: var(--faint);
}

.field-help {
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.slug-input {
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.slug-input:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 183, 95, 0.09);
}

.slug-input > span {
  padding-left: 11px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  white-space: nowrap;
}

.slug-input input {
  height: 38px;
  padding-left: 3px;
  border: 0;
  box-shadow: none !important;
  font-family: var(--mono);
  font-size: 11px;
}

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

.type-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.type-option strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.type-option small {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.type-option:hover {
  border-color: #cddbd2;
}

.type-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 1px var(--green) inset;
}

.upload-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 11px;
  border: 1.5px dashed #ccdbd1;
  border-radius: 11px;
  background: #fafcfa;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.upload-box:hover,
.upload-box.dragover {
  border-color: var(--green);
  background: #f2fbf5;
}

.upload-box input[type="file"] {
  display: none;
}

.upload-preview {
  width: 60px;
  height: 60px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--faint);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-copy {
  min-width: 0;
}

.upload-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
}

.upload-copy span {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}

.upload-copy em {
  display: inline-block;
  margin-top: 5px;
  color: var(--green-deep);
  font-size: 9.5px;
  font-style: normal;
  font-weight: 600;
}

.quick-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-actions button {
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafcfa;
  color: var(--muted);
  font-size: 9.5px;
  cursor: pointer;
}

.quick-actions button:hover {
  border-color: var(--green);
  color: var(--green-deep);
  background: var(--green-soft);
}

.modal-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 10px 11px;
  border-radius: 9px;
  background: #f7faf7;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.6;
}

.modal-note svg {
  width: 14px;
  height: 14px;
  flex: none;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-card {
  padding: 27px 25px 8px;
  text-align: center;
}

.confirm-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  border: 1px solid #f0e0bd;
  border-radius: 15px;
  background: var(--amber-soft);
  color: var(--amber);
}

.confirm-icon.danger {
  border-color: #efd3ce;
  background: var(--red-soft);
  color: var(--red);
}

.confirm-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.confirm-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.confirm-card p {
  margin: 9px auto 18px;
  max-width: 380px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.confirm-card .field {
  max-width: 300px;
  margin: 0 auto 18px;
  text-align: left;
}

.confirm-card .field input {
  text-align: center;
  font-family: var(--mono);
}

/* Toast and loaders */
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 360px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #10271b;
  color: #fff;
  font-size: 11.5px;
  line-height: 1.5;
  box-shadow: 0 20px 40px -22px rgba(7, 22, 14, 0.7);
  animation: toast-in 0.2s ease both;
}

.toast-item.error {
  background: #8f302a;
}

.toast-item svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.boot-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid #dfe9e2;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #ebf0ec 25%, #f7f9f7 37%, #ebf0ec 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

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

.skeleton-card {
  height: 126px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

.skeleton-card .skeleton {
  height: 12px;
  margin-bottom: 12px;
}

.skeleton-card .skeleton:first-child {
  width: 42%;
}

.skeleton-card .skeleton:nth-child(2) {
  width: 64%;
  height: 30px;
  margin-top: 20px;
}

.skeleton-card .skeleton:last-child {
  width: 34%;
  margin-bottom: 0;
}

.skeleton-block {
  height: 286px;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 20px;
}

.error-state {
  padding: 56px 24px;
  text-align: center;
}

.error-state .empty-icon {
  color: var(--red);
  background: var(--red-soft);
  border-color: #efd3ce;
}

.error-state p {
  color: var(--faint);
  font-size: 11.5px;
}

.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 1px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@media (max-width: 1280px) {
  .login-art {
    opacity: 0.4;
    right: -150px;
  }

  .login-brand-copy {
    max-width: 470px;
  }

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

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

  .side-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .detail-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .login-art {
    display: none;
  }

  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.85fr);
  }

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

  .qr-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 4px 22px;
    align-items: center;
  }

  .qr-card-label {
    grid-column: 1 / -1;
  }

  .qr-frame {
    grid-row: span 4;
    margin: 12px 0;
  }

  .qr-card .url-field {
    align-self: end;
  }

  .qr-card .qr-actions {
    margin-top: 0;
  }

  .qr-hint {
    text-align: left;
    margin-top: 6px;
  }

  .fallback-config {
    margin-top: 4px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    flex-direction: column;
  }

  .login-shell {
    display: block;
    min-height: 100svh;
  }

  .login-brand {
    display: none;
  }

  .login-panel {
    min-height: 100svh;
    align-items: flex-start;
    padding: 30px 22px;
    padding-top: max(68px, 12vh);
  }

  .login-mobile-brand {
    display: flex;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 0;
  }

  .sidebar::before {
    display: none;
  }

  .side-logo {
    padding: 0;
  }

  .side-logo-copy small {
    display: none;
  }

  .side-nav {
    flex-direction: row;
    gap: 2px;
    margin: 0 0 0 auto;
  }

  .side-link {
    height: 34px;
    padding: 0 10px;
    gap: 7px;
    font-size: 12px;
  }

  .side-link svg {
    width: 16px;
    height: 16px;
  }

  .side-link.active::before {
    display: none;
  }

  .side-bottom {
    flex-direction: row;
    align-items: center;
    margin: 0 0 0 2px;
  }

  .service-state {
    display: none;
  }

  .side-logout {
    width: 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .workspace {
    width: 100%;
    margin-left: 0;
    padding: 0 19px 42px;
  }

  .topbar {
    padding: 22px 0 17px;
  }

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

  .view {
    margin-top: 18px;
  }

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

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-value {
    font-size: 28px;
    margin-top: 13px;
  }

  .stat-foot {
    margin-top: 9px;
  }

  .side-stack {
    display: flex;
  }

  .list-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .list-tools {
    width: 100%;
  }

  .search-field {
    flex: 1;
  }

  .search-field input {
    width: 100%;
  }

  .data-table {
    min-width: 760px;
  }

  .detail-header {
    flex-direction: column;
    gap: 14px;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .detail-title {
    font-size: 22px;
  }

  .metric {
    padding: 0 12px;
  }

  .metric strong {
    font-size: 21px;
  }

  .qr-card {
    display: block;
  }

  .qr-frame {
    margin: 15px auto;
  }

  .qr-card .qr-actions {
    margin-top: 8px;
  }

  .qr-hint {
    text-align: center;
  }

  .alert-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .targets-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

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

  .modal {
    width: calc(100vw - 20px);
    max-height: 92vh;
  }

  .modal-shell {
    max-height: 92vh;
    border-radius: 16px;
  }

  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 17px;
    padding-right: 17px;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
    align-items: center;
  }

  .toast-item {
    width: 100%;
  }

  .skeleton-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 430px) {
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }

  .side-logo-copy strong {
    font-size: 14px;
  }

  .side-logo .logo-mark {
    width: 25px;
    height: 25px;
  }

  .side-link {
    padding: 0 8px;
  }

  .topbar-actions .ui-btn {
    flex: 1;
  }

  .topbar-actions .ui-btn.icon-only {
    flex: 0 0 38px;
  }

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

  .stat-card {
    padding: 13px;
  }

  .stat-head {
    font-size: 11px;
  }

  .stat-icon {
    width: 27px;
    height: 27px;
    border-radius: 8px;
  }

  .stat-value {
    font-size: 25px;
  }

  .stat-foot {
    font-size: 9.5px;
  }

  .delta {
    display: none;
  }

  .metric-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 15px;
  }

  .metric:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .qr-card {
    padding: 16px;
  }

  .analytics-panel {
    padding: 16px;
  }

  .login-panel {
    padding-top: 11vh;
  }

  .login-panel h2 {
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-panel-inner,
  .modal-shell,
  .toast-item,
  .skeleton,
  .boot-spinner,
  .is-loading::before {
    animation: none;
  }

  .ui-btn,
  .switch,
  .switch::after,
  .password-field input {
    transition: none;
  }
}
