:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d7dde8;
  --primary: #1769e0;
  --primary-dark: #0f55b8;
  --primary-soft: #edf4ff;
  --ok: #16794c;
  --warn: #b25f00;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(31, 41, 55, 0.08);
  --shadow-soft: 0 8px 22px rgba(31, 41, 55, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--primary);
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.nav-button {
  padding: 0;
  color: var(--primary);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}

.nav-button:hover {
  background: transparent;
  box-shadow: none;
}

.page {
  width: min(1160px, calc(100vw - 32px));
  margin: 28px auto 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

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

.panel {
  padding: 28px;
}

h1 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1.25;
}

h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

button,
.button {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  color: #ffffff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:hover,
.button:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(23, 105, 224, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

button:disabled:hover {
  background: var(--primary);
  box-shadow: none;
  transform: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.button.secondary,
button.secondary {
  color: var(--text);
  background: #eef2f7;
}

.button.secondary:hover,
button.secondary:hover {
  background: #dde5f0;
}

.button.secondary:disabled:hover,
button.secondary:disabled:hover {
  background: #eef2f7;
}

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

.stat {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
}

.muted {
  color: var(--muted);
}

.flow {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.flow-item {
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  background: #f3f7ff;
  border-radius: 6px;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font-size: 15px;
  background: #ffffff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(23, 105, 224, 0.7);
  box-shadow: 0 0 0 3px rgba(23, 105, 224, 0.12);
}

.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.plate-field {
  display: block;
}

.plate-picker {
  display: grid;
  gap: 10px;
}

.plate-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 10px repeat(6, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}

.plate-slot {
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  font-size: 18px;
  font-weight: 700;
}

.plate-dot {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
}

.plate-slot.active {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 105, 224, 0.12);
}

.plate-slot.optional {
  color: #69b8a6;
  background: #eefbf7;
  font-size: 13px;
  writing-mode: vertical-rl;
  letter-spacing: 1px;
}

.plate-slot.optional.filled {
  color: var(--text);
  background: #ffffff;
  font-size: 18px;
  writing-mode: horizontal-tb;
  letter-spacing: 0;
}

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

.plate-clear {
  padding: 7px 10px;
  flex: 0 0 auto;
}

.plate-keyboard-overlay {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  background: rgba(15, 23, 42, 0.08);
}

.plate-keyboard-overlay.collapsed {
  display: none;
}

.plate-keyboard-sheet {
  width: 100%;
  max-height: min(58vh, 460px);
  overflow: auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid #d7dde8;
  border-radius: 14px 14px 0 0;
  background: #f3f5f8;
  box-shadow: 0 -10px 28px rgba(31, 41, 55, 0.18);
}

.plate-keyboard-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #c8ced8;
}

.plate-keyboard-title {
  max-width: 920px;
  margin: 0 auto 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.plate-key-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  max-width: 920px;
  margin: 0 auto;
}

.plate-key {
  min-width: 0;
  min-height: 54px;
  padding: 8px 0;
  border: 1px solid #cfd6e2;
  border-radius: 6px;
  color: var(--text);
  background: linear-gradient(#ffffff, #f7f9fc);
  box-shadow: 0 1px 1px rgba(31, 41, 55, 0.08);
  font-size: 20px;
  font-weight: 700;
}

.plate-key:hover,
.plate-key:focus {
  color: #ffffff;
  background: var(--primary);
}

.plate-key-actions {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr minmax(84px, auto);
  gap: 10px;
  max-width: 920px;
  margin-top: 12px;
  margin-right: auto;
  margin-left: auto;
}

.plate-key-actions [data-action="done"] {
  grid-column: 3;
  justify-self: end;
  min-width: 84px;
}

.plate-key-actions [data-action="backspace"] {
  grid-column: 1;
  justify-self: start;
  min-width: 84px;
}

.plate-keyboard-open {
  padding-bottom: min(58vh, 460px);
}

.result {
  min-height: 44px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  background: #f7f9fc;
  color: var(--muted);
  white-space: pre-wrap;
}

.success {
  color: var(--ok);
  background: #edf8f2;
}

.warning {
  color: var(--warn);
  background: #fff7ed;
}

.danger {
  color: var(--danger);
  background: #fff1f0;
}

.smart-bind-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f3f7ff;
}

.smart-bind-panel.hidden {
  display: none;
}

.smart-bind-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.smart-bind-head span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f7ef;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.smart-bind-status {
  color: #344054;
  font-size: 14px;
  line-height: 1.6;
}

.smart-candidate-list {
  display: grid;
  gap: 10px;
}

.smart-candidate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.smart-candidate strong {
  font-size: 18px;
}

.smart-candidate p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f7;
  color: #344054;
  font-size: 12px;
  white-space: nowrap;
}

.tag.danger {
  color: var(--danger);
  background: #fff1f0;
}

.tag.warn {
  color: var(--warn);
  background: #fff7ed;
}

.tag.ok {
  color: var(--ok);
  background: #edf8f2;
}

.section {
  margin-top: 22px;
}

.hidden {
  display: none;
}

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(135deg, #f7faff 0%, #eef4fb 100%),
    var(--bg);
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 60px rgba(31, 41, 55, 0.14);
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

.login-logo {
  height: 42px;
  margin-bottom: 18px;
}

.topbar-logo {
  height: 30px;
}

.login-brand {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.login-card h1 {
  margin-bottom: 22px;
  font-size: 28px;
}

.login-card .result {
  min-height: 0;
  margin-top: 14px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.login-form button {
  width: 100%;
  margin-top: 4px;
  padding: 13px 16px;
}

.login-sms-step {
  display: grid;
  gap: 14px;
}

.login-sms-step p {
  margin: 0;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  padding: 10px 12px;
  color: #475467;
  background: #f6f9ff;
  font-size: 13px;
}

.login-sms-step button.secondary {
  margin-top: 0;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  font-size: 14px;
}

.admin-body {
  background: #f4f7fb;
}

.admin-topbar {
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(215, 221, 232, 0.7);
}

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

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.admin-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 22px;
  width: min(1380px, calc(100vw - 32px));
  margin: 22px auto 48px;
}

.admin-metrics .stat {
  border-top: 3px solid var(--primary);
}

.admin-side {
  position: sticky;
  top: 84px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.admin-menu-group {
  display: grid;
  gap: 4px;
}

.admin-menu-toggle,
.admin-tab {
  width: 100%;
  padding: 12px 13px;
  border-radius: 6px;
  color: #344054;
  background: transparent;
  text-align: left;
  font-weight: 600;
}

.admin-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-menu-toggle:hover,
.admin-menu-group.open > .admin-menu-toggle {
  color: var(--primary);
  background: #f6f9ff;
  box-shadow: none;
}

.admin-menu-chevron {
  color: #98a2b3;
  font-size: 12px;
  transition: transform 0.18s ease;
}

.admin-menu-group.open .admin-menu-chevron {
  transform: rotate(180deg);
}

.admin-menu-items {
  display: none;
  gap: 4px;
  padding: 2px 0 4px 10px;
  border-left: 1px solid #e7edf6;
  margin-left: 12px;
}

.admin-menu-group.open .admin-menu-items {
  display: grid;
}

.admin-menu-items .admin-tab {
  padding: 10px 12px;
  color: #475467;
  font-size: 14px;
}

.admin-root-tab {
  color: #1f2937;
}

.admin-tab:hover,
.admin-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: none;
}

.admin-side-title {
  margin: 12px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-main {
  min-width: 0;
  overflow: hidden;
}

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

.compact-head {
  justify-content: flex-end;
  margin-bottom: 14px;
}

.dashboard-panel {
  position: relative;
  overflow: hidden;
}

.data-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.subtle-button {
  border: 1px solid #dbe4f0;
  padding: 7px 12px;
  color: #475467;
  background: #f6f9fc;
  font-size: 13px;
}

.subtle-button:hover {
  color: var(--primary);
  background: #eef4ff;
  box-shadow: none;
}

.dashboard-panel .business-metrics {
  padding-right: 0;
}

.admin-status {
  margin-top: 0;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.admin-section {
  display: none;
  margin-top: 16px;
}

.admin-section.active {
  display: block;
}

.section-save-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 16px;
  padding: 16px 0 4px;
  border-top: 1px solid #dbe4f0;
}

.section-save-bar .save-state {
  color: var(--muted);
  font-size: 13px;
}

.section-save-bar .admin-save-button {
  min-width: 118px;
}

.section-save-bar .admin-save-button:disabled {
  color: #667085;
  background: #e8edf4;
  opacity: 1;
}

.section-save-bar .admin-save-button:disabled:hover {
  background: #e8edf4;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form textarea,
.config-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.admin-main .panel {
  box-shadow: var(--shadow-soft);
}

.admin-main .panel h2 {
  margin-bottom: 8px;
}

.admin-main .panel > p {
  margin-bottom: 18px;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.help-panel {
  padding: 12px 14px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f3f7ff;
}

.help-panel p {
  margin: 6px 0 0;
  font-size: 13px;
}

.template-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.template-help span {
  font-weight: 700;
}

.template-help code {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 700;
}

.template-field-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.template-field-notes div {
  display: grid;
  gap: 3px;
}

.template-field-notes strong {
  color: #344054;
  font-size: 13px;
}

.template-field-notes span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.derived-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.derived-links > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.derived-links span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.derived-links strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.simple-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.simple-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.02);
}

.simple-card-head,
.simple-switch-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.simple-card p {
  margin: 6px 0 0;
  font-size: 13px;
}

.simple-tags {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.simple-tag-summary {
  display: grid;
  gap: 12px;
}

.simple-tag-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.simple-tag-preview span {
  max-width: 160px;
  overflow: hidden;
  border-radius: 999px;
  padding: 5px 9px;
  color: #475467;
  background: #f2f4f7;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-weight: 500;
}

.simple-switch input {
  width: auto;
}

.sync-card {
  display: grid;
  gap: 14px;
}

.sms-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.sms-summary-card {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.sms-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.sms-summary-card strong {
  display: block;
  margin: 8px 0;
  color: var(--text);
  font-size: 20px;
}

.sms-summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sms-summary-card.ok {
  border-color: #bfe8d2;
  background: #f0fbf5;
}

.sms-summary-card.ok strong {
  color: var(--success);
}

.sms-summary-card.warn {
  border-color: #ffd8a8;
  background: #fff8ec;
}

.sms-summary-card.warn strong {
  color: #b25a00;
}

.sms-summary-card.danger {
  border-color: #ffc9c6;
  background: #fff5f5;
}

.sms-summary-card.danger strong {
  color: var(--danger);
}

.sms-step {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.sms-step-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.sms-step-head > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
}

.sms-step-head h3 {
  margin: 2px 0 4px;
  font-size: 17px;
}

.sms-step-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sms-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sms-mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  font-weight: 800;
}

.sms-mode-card input {
  width: auto;
  margin-top: 2px;
}

.sms-mode-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.sms-scene-card {
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.sms-scene-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid #dbe7fb;
  background: #f3f7ff;
}

.sms-scene-head strong {
  display: block;
  color: #1f2937;
  font-size: 16px;
}

.sms-scene-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sms-scene-head label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  color: #1f6feb;
  font-size: 13px;
  font-weight: 800;
}

.sms-scene-head input {
  width: auto;
}

.sms-scene-card .admin-form {
  padding: 16px;
}

.section-tight {
  margin-top: 12px;
}

.sms-template-card {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f5f8ff;
}

.sms-template-card strong,
.sms-template-card p,
.sms-template-card small {
  display: block;
}

.sms-template-card p {
  margin: 8px 0 6px;
  color: var(--text);
  line-height: 1.7;
}

.sms-template-card small {
  color: var(--muted);
}

.business-board {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

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

.business-metric,
.business-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.business-metric {
  padding: 16px;
}

.business-metric span {
  color: var(--muted);
  font-size: 13px;
}

.business-metric strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
  line-height: 1;
}

.business-metric p {
  margin: 0;
  font-size: 12px;
}

.metric-breakdown {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.metric-breakdown em {
  display: inline-flex;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #475467;
  background: #f3f6fb;
  font-size: 12px;
  font-style: normal;
}

.metric-breakdown b {
  color: var(--text);
}

.business-metric.ok strong {
  color: var(--ok);
}

.business-metric.warn strong {
  color: var(--warn);
}

.business-metric.danger strong {
  color: var(--danger);
}

.business-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}

.business-card {
  overflow: hidden;
  padding: 16px;
}

.business-card h3 {
  margin-bottom: 14px;
}

.rate-list {
  display: grid;
  gap: 14px;
}

.rate-item div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.rate-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f7;
}

.rate-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.rate-item p {
  margin: 6px 0 0;
  font-size: 12px;
}

.mini-stats,
.distribution {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mini-stats span,
.distribution div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.distribution strong {
  margin-top: 8px;
}

.distribution em {
  color: var(--text);
  font-style: normal;
  font-weight: 700;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.trend-day {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  min-height: 92px;
}

.trend-day span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.trend-day div {
  display: flex;
  align-items: end;
  justify-content: center;
  height: 58px;
}

.trend-day i {
  width: 10px;
  border-radius: 999px 999px 0 0;
}

.trend-day .added {
  background: var(--primary);
}

.trend-day .bound {
  background: var(--ok);
}

.trend-day .deleted {
  background: var(--warn);
}

.event-table {
  display: grid;
  gap: 10px;
}

.business-event-list {
  display: grid;
}

.business-event-row {
  display: grid;
  grid-template-columns: 86px 100px minmax(190px, 1.1fr) minmax(260px, 1.4fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-size: 13px;
}

.business-event-row:last-child {
  border-bottom: 0;
}

.business-event-row span,
.business-event-row p,
.business-event-row code,
.business-event-row button {
  min-width: 0;
  margin: 0;
}

.business-event-row span {
  color: var(--muted);
}

.business-event-row strong,
.business-event-row .event-type {
  color: #1f2937;
  font-weight: 800;
  white-space: nowrap;
}

.business-event-row code,
.business-event-row .event-code {
  display: block;
  overflow: hidden;
  padding: 0;
  color: #53627a;
  background: transparent;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-event-row p,
.business-event-row .event-desc {
  overflow: hidden;
  color: #475467;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-detail-button {
  max-width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
}

button.inline-detail-button {
  cursor: pointer;
}

.inline-detail-button.is-truncated {
  border-bottom: 1px dashed #9db2ce;
}

.inline-detail-button.is-truncated:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.delete-detail-table {
  display: grid;
  gap: 8px;
}

.delete-detail-table > div {
  display: grid;
  grid-template-columns: 100px 90px 1fr 1fr minmax(0, 1.5fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.delete-detail-table span,
.delete-detail-table p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.warn-text {
  color: var(--warn);
}

.customer-management-board {
  display: grid;
  gap: 16px;
}

.ops-board {
  display: grid;
  gap: 16px;
}

.ops-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #ffffff;
}

.ops-summary.ok {
  border-color: #b7ebc6;
  background: #f6fffa;
}

.ops-summary.warn {
  border-color: #fde3b4;
  background: #fffaf1;
}

.ops-summary.danger {
  border-color: #ffc9c9;
  background: #fff6f6;
}

.ops-summary strong {
  flex: 1;
  font-size: 16px;
}

.ops-summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: #475467;
  background: #eef2f7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.ok {
  color: #087443;
  background: #e7f8ee;
}

.status-pill.warn {
  color: #a45f00;
  background: #fff2d6;
}

.status-pill.danger {
  color: #b42318;
  background: #ffe4e4;
}

.ops-check-list,
.ops-error-list,
.ops-action-list {
  display: grid;
  gap: 10px;
}

.ops-check-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.ops-check-item strong,
.ops-action-list strong {
  display: block;
  margin-bottom: 4px;
}

.ops-check-item p,
.ops-check-item em,
.ops-error-item p,
.ops-error-item em,
.ops-action-list p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.ops-check-item em,
.ops-error-item em {
  display: block;
  margin-top: 5px;
  font-style: normal;
}

.ops-highlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  padding: 12px;
  background: #f6f9ff;
}

.ops-highlight em {
  color: var(--muted);
  font-style: normal;
}

.ops-error-item,
.ops-action-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.ops-error-item > div,
.ops-action-list article {
  display: grid;
  gap: 6px;
}

.ops-error-item span {
  color: var(--muted);
  font-size: 12px;
}

.ops-error-item.warn {
  border-color: #fde3b4;
}

.ops-error-item.danger {
  border-color: #ffc9c9;
}

.scale-note {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  padding: 10px 12px;
  color: #475467;
  background: #f6f9ff;
  font-size: 13px;
}

.compact-select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.toolbar-input {
  min-height: 36px;
  min-width: 120px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.scale-note strong {
  color: var(--primary);
  white-space: nowrap;
}

.card-title-row,
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title-row {
  margin-bottom: 12px;
}

.card-title-row h3 {
  margin-bottom: 0;
}

.card-title-row span,
.pagination-bar span {
  color: var(--muted);
  font-size: 13px;
}

.customer-filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(120px, 1fr)) auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.customer-filter-bar input,
.customer-filter-bar select {
  margin-top: 0;
}

.pagination-bar {
  justify-content: flex-end;
  margin-top: 12px;
}

.management-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

.management-table-head,
.management-table-row {
  display: grid;
  grid-template-columns: var(--table-columns, repeat(var(--column-count), minmax(110px, 1fr)));
  width: 100%;
  min-width: max(100%, var(--table-min-width, 0px));
}

.management-table-head {
  color: #475467;
  background: #f6f9ff;
  font-size: 12px;
  font-weight: 800;
}

.management-table-head > span,
.management-table-row > span {
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.management-table-row {
  color: #344054;
  font-size: 13px;
}

.management-table-row:last-child > span {
  border-bottom: 0;
}

.management-table-row > span {
  min-height: 42px;
}

.management-table-head > span {
  min-height: 38px;
}

.customer-staff-table .management-table-head,
.customer-staff-table .management-table-row,
.customer-detail-table .management-table-head,
.customer-detail-table .management-table-row,
.customer-operation-table .management-table-head,
.customer-operation-table .management-table-row {
  width: 100%;
  min-width: 0;
}

.customer-operation-table .management-table-row > span:last-child {
  white-space: normal;
  line-height: 1.55;
}

.prospect-leads-table .management-table-head,
.prospect-leads-table .management-table-row {
  grid-template-columns: minmax(112px, 1fr) minmax(86px, .72fr) 92px minmax(118px, 1fr) 96px 120px minmax(170px, 1.35fr) 104px;
  width: 100%;
  min-width: 980px;
  align-items: stretch;
}

.prospect-leads-table .management-table-head span,
.prospect-leads-table .management-table-row > span {
  min-width: 0;
}

.prospect-leads-table .management-table-row > span {
  display: flex;
  align-items: center;
  min-height: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prospect-leads-table .management-table-row > span:nth-child(7) {
  overflow: hidden;
  white-space: nowrap;
}

.prospect-leads-table .tag-list {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow: hidden;
}

.prospect-leads-table .tag-list .tag {
  flex: 0 0 auto;
}

.prospect-inline-tags {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
}

.prospect-inline-tags .tag {
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-more-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  border: 1px solid #bfd0e7;
  border-radius: 999px;
  padding: 0 8px;
  color: var(--primary);
  background: #f5f8ff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.tag-more-button:hover {
  border-color: #8fb4ef;
  background: #eaf2ff;
}

.tag-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.32);
}

.tag-detail-dialog {
  width: min(520px, 100%);
  max-height: min(560px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.22);
}

.tag-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.tag-detail-head strong {
  font-size: 16px;
}

.tag-detail-head button {
  border: 0;
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--primary);
  background: #eef5ff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.tag-detail-body {
  max-height: 430px;
  overflow: auto;
  padding: 16px;
}

.tag-detail-body .tag-list {
  gap: 8px;
}

.text-detail-dialog {
  width: min(640px, 100%);
}

.text-detail-content {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #243044;
  font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.sync-job-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sync-job-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.sync-job-head,
.sync-job-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(92px, 0.78fr) 78px minmax(145px, 1.1fr) 54px 86px 86px minmax(52px, 0.45fr);
  width: 100%;
  align-items: center;
}

.sync-job-head {
  color: #475467;
  background: #f6f9ff;
  font-size: 12px;
  font-weight: 800;
}

.sync-job-head span,
.sync-job-row span {
  min-width: 0;
  padding: 10px 9px;
  border-bottom: 1px solid var(--line);
}

.sync-job-row {
  color: #344054;
  font-size: 13px;
}

.sync-job-row .status-pill {
  padding-right: 7px;
  padding-left: 7px;
}

.sync-job-row:last-child span {
  border-bottom: 0;
}

.mono-cell,
.sync-job-type,
.error-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mono-cell {
  color: #26364d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.error-cell {
  color: #667085;
}

.event-table > div {
  display: grid;
  grid-template-columns: 100px 96px minmax(120px, 1fr) minmax(0, 2fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.event-table span,
.event-table p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.sync-summary > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.sync-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.sync-summary strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.sync-summary p {
  margin: 0;
  font-size: 12px;
}

.advanced-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.advanced-details summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.switch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.switch-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.switch-row input,
.config-row input[type="checkbox"] {
  width: auto;
}

.config-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.config-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.02);
}

.account-card {
  border-color: #cfe0ff;
}

.tag-group-card {
  padding: 0;
  overflow: hidden;
  border-color: #c8d7f0;
}

.tag-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #dbe6f7;
  background: #f6f9ff;
}

.tag-group-head p {
  margin: 8px 0 0;
  font-size: 13px;
}

.tag-group-title {
  font-size: 18px;
  font-weight: 800;
}

.tag-group-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tag-group-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) auto auto;
  gap: 16px;
  align-items: start;
  padding: 16px 16px 0;
}

.tag-group-note {
  margin: 10px 16px 0;
  font-size: 13px;
}

.tag-rule-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.tag-rule-list-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tag-manager {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.tag-manager-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tag-manager-summary > div {
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.tag-manager-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.tag-manager-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.tag-manager-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.tag-group-sidebar,
.tag-group-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tag-group-sidebar {
  position: sticky;
  top: 92px;
  overflow: hidden;
}

.tag-sidebar-title {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 800;
}

.tag-group-list {
  display: grid;
  max-height: 640px;
  overflow: auto;
  padding: 8px;
  gap: 6px;
}

.tag-group-list-item {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.tag-group-list-item:hover {
  background: #f8fafc;
}

.tag-group-list-item.active {
  border-color: #bfd4f6;
  background: #edf5ff;
}

.tag-group-list-main,
.tag-group-list-meta {
  display: grid;
  gap: 5px;
}

.tag-group-list-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.tag-group-list-main small,
.tag-group-list-meta {
  color: var(--muted);
  font-size: 12px;
}

.tag-group-list-meta {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.tag-group-detail {
  overflow: hidden;
}

.tag-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #dbe6f7;
  background: #f6f9ff;
}

.tag-detail-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tag-detail-settings {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.9fr) auto auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.tag-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 22px;
}

.tag-toggle input {
  width: auto;
}

.tag-rule-compact {
  display: grid;
  padding: 16px;
  gap: 10px;
}

.tag-rule-compact-head,
.tag-rule-compact-row {
  display: grid;
  grid-template-columns: minmax(145px, 1.1fr) minmax(145px, 1fr) minmax(120px, 0.75fr) 64px;
  gap: 8px;
  align-items: start;
}

.tag-rule-compact-head {
  padding: 0 4px 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag-rule-compact-row {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tag-rule-compact-row label,
.tag-rule-switches {
  min-width: 0;
}

.tag-rule-compact-row label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.tag-rule-compact-row small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tag-rule-switches {
  display: grid;
  gap: 8px;
  padding-top: 22px;
}

.tag-rule-switches label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.tag-rule-switches input {
  width: auto;
}

.tag-rule-advanced summary {
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.tag-rule-advanced select {
  margin-top: 6px;
}

.tag-rule-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

.tag-rule-empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.config-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.config-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-weight: 700;
}

.order-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 12px;
  font-weight: 800;
}

.config-row,
.mapping-row,
.tag-rule-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.mapping-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.mapping-row {
  grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr);
  align-items: center;
}

.mapping-name {
  display: grid;
  gap: 4px;
}

.mapping-name span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.mapping-name p {
  margin: 0;
  font-size: 13px;
}

.tag-rule-row {
  grid-template-columns: 1.1fr 1fr 0.9fr 1fr;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tag-rule-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.mini-button {
  padding: 8px 10px;
  font-size: 13px;
}

.organization-board,
.organization-grid,
.organization-table,
.org-picker {
  display: grid;
  gap: 12px;
}

.organization-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.organization-metrics {
  margin-top: 16px;
}

.organization-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) repeat(4, minmax(80px, auto));
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  font-size: 13px;
}

.organization-row span {
  color: var(--muted);
}

.organization-conflict-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.organization-conflict-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ffd8bf;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff7ed;
}

.organization-warning {
  border-color: #ffd8bf;
}

.access-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.access-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.access-filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: #475467;
  background: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.access-filter.active {
  color: var(--primary);
  border-color: #b9d1ff;
  background: #eef5ff;
}

.access-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.access-table-head,
.access-table-row {
  display: grid;
  grid-template-columns: 96px minmax(190px, 1.3fr) 110px minmax(150px, 0.9fr) minmax(120px, 0.9fr) minmax(220px, auto);
  min-width: 920px;
  align-items: center;
}

.access-table-head {
  color: #475467;
  background: #f6f9ff;
  font-size: 12px;
  font-weight: 800;
}

.access-table-head span,
.access-table-row > span {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.access-table-row:last-child > span {
  border-bottom: 0;
}

.access-table-row strong,
.access-table-row small {
  display: block;
}

.access-table-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.access-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.access-status.enabled {
  color: #087443;
  background: #e7f8ef;
}

.access-status.disabled {
  color: #8a4b05;
  background: #fff4e5;
}

.access-status.locked {
  color: #974000;
  background: #fff0d4;
}

.access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.access-actions a,
.access-actions button {
  border: 0;
  padding: 0;
  color: var(--primary);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.access-editor,
.access-editor-placeholder {
  margin-top: 12px;
}

.access-editor {
  border-color: #cfe0ff;
  background: #fbfdff;
}

.access-editor-placeholder,
.access-empty {
  border: 1px dashed #cfd8e6;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #f8fafc;
}

.access-empty {
  margin: 12px;
}

.access-row {
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.1fr) minmax(140px, 0.7fr) minmax(120px, auto);
}

.access-remark {
  grid-column: span 3;
}

.org-picker select,
.org-picker input {
  min-height: 36px;
}

.org-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.org-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--primary);
  background: #f5f8ff;
  font-size: 12px;
  font-weight: 700;
}

.org-chip button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
}

.ok-text {
  color: var(--success) !important;
  font-weight: 700;
}

.danger-button {
  color: var(--danger);
  background: #fff1f0;
}

.danger-button:hover {
  color: #ffffff;
  background: var(--danger);
}

.preview-box {
  min-height: 90px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  line-height: 1.8;
}

.sidebar-body {
  background: #ffffff;
}

.sidebar-page {
  width: min(760px, calc(100vw - 24px));
  margin: 16px auto 28px;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-head h1 {
  font-size: 22px;
}

.profile-panel {
  margin-top: 14px;
}

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

.profile-summary > div,
.vehicle-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.profile-summary > div {
  padding: 12px;
}

.profile-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.vehicle-cards {
  display: grid;
  gap: 12px;
}

.vehicle-card {
  padding: 14px;
}

.vehicle-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.vehicle-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.vehicle-card dl > div {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
}

.vehicle-card dt {
  color: var(--muted);
}

.vehicle-card dd {
  margin: 0;
  word-break: break-all;
}

.bind-body {
  min-height: 100vh;
  color: #172033;
  background:
    linear-gradient(180deg, #eaf7f2 0%, #f5f8fc 34%, #ffffff 100%);
}

.bind-hero {
  position: relative;
  overflow: hidden;
  min-height: 292px;
  padding: calc(18px + env(safe-area-inset-top)) 20px 76px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(21, 128, 96, 0.96) 0%, rgba(28, 103, 208, 0.94) 58%, rgba(36, 65, 122, 0.98) 100%);
}

.bind-hero::before,
.bind-hero::after {
  content: "";
  position: absolute;
  left: -12%;
  right: -12%;
  pointer-events: none;
}

.bind-hero::before {
  bottom: 28px;
  height: 70px;
  transform: rotate(-5deg);
  background: rgba(255, 255, 255, 0.1);
}

.bind-hero::after {
  bottom: -46px;
  height: 110px;
  border-radius: 50% 50% 0 0;
  background: #f5f8fc;
}

.bind-hero-top,
.bind-hero-content {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  margin: 0 auto;
}

.bind-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bind-logo {
  width: 98px;
  max-width: 38vw;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.94;
}

.wechat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(13, 48, 102, 0.16);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.bind-hero-content {
  margin-top: 36px;
}

.bind-kicker {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #173b2e;
  background: #c8f4df;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.bind-hero h1 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 31px;
  line-height: 1.18;
}

.bind-hero p:not(.bind-kicker) {
  width: min(360px, 100%);
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  line-height: 1.7;
}

.bind-road {
  position: absolute;
  z-index: 1;
  right: max(12px, calc((100vw - 460px) / 2));
  bottom: 40px;
  width: 158px;
  height: 54px;
  transform: skewX(-13deg);
  border-radius: 14px 14px 0 0;
  background: rgba(14, 28, 58, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.bind-road span {
  position: absolute;
  top: 26px;
  width: 26px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.bind-road span:nth-child(1) {
  left: 22px;
}

.bind-road span:nth-child(2) {
  left: 68px;
}

.bind-road span:nth-child(3) {
  left: 114px;
}

.bind-page {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100vw - 28px));
  margin: -54px auto 34px;
}

.bind-shell {
  display: grid;
  gap: 14px;
}

.bind-card {
  border: 1px solid rgba(215, 221, 232, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(33, 49, 77, 0.12);
}

.bind-form-card {
  padding: 18px;
}

.bind-entry-shell {
  width: 100%;
}

.bind-entry-card {
  padding: 20px;
}

.bind-entry-status {
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f3f7ff;
  padding: 14px 15px;
  color: #1f3b68;
  font-weight: 800;
  line-height: 1.6;
}

.bind-entry-status.success {
  border-color: #bfe8d2;
  background: #f0fbf5;
  color: #0d5f4b;
}

.bind-entry-status.danger {
  border-color: #ffd1d1;
  background: #fff1f1;
  color: #b42318;
}

.bind-entry-actions {
  display: grid;
  margin-top: 14px;
}

.bind-entry-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.bind-entry-actions .button.hidden {
  display: none;
}

.bind-entry-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e4eaf2;
  color: #667085;
  font-size: 14px;
  line-height: 1.7;
}

.bind-entry-note strong {
  display: block;
  margin-bottom: 4px;
  color: #233044;
}

.bind-entry-note p {
  margin: 0;
}

.bind-body .form {
  gap: 16px;
}

.bind-body label,
.bind-body .field-label {
  color: #233044;
  font-size: 15px;
  font-weight: 800;
}

.bind-body input {
  height: 48px;
  border-color: #d9e2ee;
  border-radius: 8px;
  padding: 12px 13px;
  color: #172033;
  background: #fbfcfe;
  font-size: 16px;
}

.bind-body input::placeholder {
  color: #98a2b3;
}

.bind-body input:focus,
.bind-body select:focus {
  border-color: #1aa06d;
  box-shadow: 0 0 0 4px rgba(26, 160, 109, 0.13);
}

.bind-body button,
.bind-body .button {
  min-height: 46px;
  border-radius: 8px;
  background: #1769e0;
  box-shadow: 0 10px 18px rgba(23, 105, 224, 0.18);
  font-size: 15px;
}

.bind-body button:hover,
.bind-body .button:hover {
  background: #125bc4;
}

.bind-body button[type="submit"] {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
  background: linear-gradient(135deg, #158060 0%, #1769e0 100%);
  box-shadow: 0 14px 24px rgba(22, 121, 76, 0.2);
}

.bind-body button[type="submit"]:hover {
  background: linear-gradient(135deg, #0f6f52 0%, #125bc4 100%);
}

.bind-body button.secondary,
.bind-body .button.secondary {
  color: #344054;
  background: #eef3f8;
  box-shadow: none;
}

.bind-body button.secondary:hover,
.bind-body .button.secondary:hover {
  background: #e2eaf3;
}

.bind-body .inline {
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.bind-body .plate-picker {
  gap: 9px;
  padding: 12px;
  border: 1px solid #d9e2ee;
  border-radius: 8px;
  background: #fbfcfe;
}

.bind-body .plate-slots {
  grid-template-columns: repeat(2, minmax(0, 1fr)) 9px repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.bind-body .plate-slot {
  height: 42px;
  border-color: #d4dfeb;
  border-radius: 7px;
  color: #172033;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.04);
}

.bind-body .plate-slot.active {
  border-color: #1aa06d;
  color: #0d5f4b;
  box-shadow: 0 0 0 3px rgba(26, 160, 109, 0.13);
}

.bind-body .plate-slot.optional {
  color: #0d7d61;
  background: #eaf8f1;
}

.bind-body .plate-dot {
  color: #98a2b3;
}

.bind-body .plate-keyboard-overlay {
  background: rgba(23, 32, 51, 0.18);
}

.bind-body .plate-keyboard-sheet {
  border-top: 1px solid #d8e6df;
  background:
    linear-gradient(180deg, #f7fbf8 0%, #edf4f1 100%);
  box-shadow: 0 -14px 34px rgba(28, 45, 67, 0.18);
}

.bind-body .plate-keyboard-handle {
  background: #bfd2cb;
}

.bind-body .plate-keyboard-title {
  color: #52685f;
  font-weight: 700;
}

.bind-body .plate-key {
  border-color: #d6e2dc;
  border-radius: 8px;
  color: #172033;
  background: linear-gradient(#ffffff, #f8fbf9);
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.05);
}

.bind-body .plate-key:hover,
.bind-body .plate-key:focus {
  color: #0d5f4b;
  background: #dff7ec;
  border-color: #9ed8bd;
  box-shadow: 0 0 0 3px rgba(26, 160, 109, 0.12);
}

.bind-body .plate-key-actions button {
  min-height: 42px;
  border: 1px solid #d6e2dc;
  color: #344054;
  background: #ffffff;
  box-shadow: none;
}

.bind-body .plate-key-actions button:hover {
  color: #0d5f4b;
  background: #eef8f3;
}

.bind-body .plate-key-actions {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.bind-body .plate-key-actions [data-action="done"] {
  grid-column: 6 / span 2;
  border-color: #158060;
  color: #ffffff;
  background: #158060;
  justify-self: stretch;
}

.bind-body .plate-key-actions [data-action="done"]:hover {
  color: #ffffff;
  background: #0f6f52;
}

.bind-body .plate-key-actions [data-action="backspace"] {
  grid-column: 2 / span 2;
  justify-self: stretch;
}

.bind-body .smart-bind-panel {
  margin: 0 0 16px;
  border-color: #bfe8d2;
  background: #f0fbf5;
}

.bind-body .smart-bind-head span {
  color: #0d5f4b;
  background: #d7f5e6;
}

.bind-body .smart-candidate {
  border-color: #d7e8df;
  border-radius: 8px;
}

.bind-body .result {
  min-height: 0;
  margin-top: 14px;
  border-radius: 8px;
  line-height: 1.65;
}

.bind-body .result:empty {
  display: none;
}

.bind-helper-card {
  padding: 16px;
}

.bind-helper-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.bind-helper-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  color: #0d5f4b;
  background: #dff7ec;
  font-size: 13px;
  font-weight: 900;
}

.bind-helper-card h2 {
  margin: 0 0 4px;
  color: #172033;
  font-size: 17px;
}

.bind-helper-card p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
}

.bind-body #seedVehicles {
  gap: 9px;
  margin-top: 14px;
}

.seed-vehicle-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e8f0;
  border-radius: 8px;
  background: #fbfcfe;
}

.seed-vehicle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.seed-vehicle-top strong {
  font-size: 18px;
  letter-spacing: 0.5px;
}

.seed-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #0d5f4b;
  background: #dff7ec;
  font-size: 12px;
  font-weight: 800;
}

.seed-status.warn {
  color: #9a4a00;
  background: #fff1d6;
}

.seed-status.danger {
  color: #b42318;
  background: #ffe4e2;
}

.seed-vehicle-meta {
  display: grid;
  gap: 5px;
  color: #667085;
  font-size: 13px;
  line-height: 1.5;
}

.seed-vehicle-meta span {
  overflow-wrap: anywhere;
}

.bind-footer {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.qr-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  height: 120px;
  margin-top: 12px;
  object-fit: contain;
  width: 120px;
}

.qr-analyzer,
.qr-analysis-layout {
  align-items: flex-start;
  display: flex;
  gap: 16px;
}

.qr-analyzer {
  justify-content: space-between;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.qr-analyzer p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.upload-button {
  cursor: pointer;
}

.upload-button input {
  display: none;
}

.analysis-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.analysis-list div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px;
}

.analysis-list dt {
  color: var(--muted);
}

.analysis-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

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

  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px;
  }

  .smart-candidate {
    grid-template-columns: 1fr;
  }

  .smart-candidate button {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  .plate-slots {
    gap: 4px;
  }

  .plate-slot {
    height: 42px;
    font-size: 16px;
  }

  .plate-slot.optional {
    font-size: 12px;
  }

  .plate-key-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
  }

  .plate-key {
    min-height: 48px;
    font-size: 18px;
  }

  .profile-summary {
    grid-template-columns: 1fr;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
    grid-template-columns: 1fr;
  }

  .admin-menu-items {
    margin-left: 8px;
  }

  .admin-form.two-col,
  .business-metrics,
  .business-grid,
  .customer-filter-bar,
  .config-row,
  .tag-group-settings,
  .tag-manager-summary,
  .tag-manager-layout,
  .tag-detail-settings,
  .tag-rule-compact-head,
  .tag-rule-compact-row,
  .sms-summary,
  .sms-mode-grid,
  .mapping-row,
  .tag-rule-row,
  .sync-summary,
  .derived-links,
  .simple-tags,
  .template-field-notes {
    grid-template-columns: 1fr;
  }

  .tag-group-sidebar {
    position: static;
  }

  .tag-detail-head {
    flex-direction: column;
  }

  .tag-rule-compact-head {
    display: none;
  }

  .tag-rule-switches,
  .tag-rule-actions {
    padding-top: 0;
  }

  .derived-links button {
    justify-self: stretch;
  }

  .section-head {
    flex-direction: column;
  }

  .section-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .login-card {
    padding: 28px 22px;
  }

  .simple-card-head,
  .simple-switch-card,
  .tag-group-head {
    flex-direction: column;
  }

  .tag-group-actions {
    justify-content: flex-start;
  }

  .scale-note,
  .card-title-row,
  .pagination-bar,
  .ops-summary,
  .ops-highlight {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-check-item {
    grid-template-columns: 1fr;
  }

  .event-table > div,
  .delete-detail-table > div {
    grid-template-columns: 1fr;
  }

  .business-event-row {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .business-event-row code,
  .business-event-row p,
  .business-event-row .event-code,
  .business-event-row .event-desc {
    grid-column: 1 / -1;
  }

  .trend-bars {
    grid-template-columns: 1fr;
  }
}
