:root {
  --font: "UKIJ Tor", "Segoe UI", Tahoma, sans-serif;
  --bg: #fafafa;
  --panel: #ffffff;
  --line: #f3f4f6;
  --text: #1a202c;
  --muted: #718096;
  /* Bankco primary (green); --purple* kept as aliases for legacy selectors */
  --purple: #22c55e;
  --purple-soft: #dcfce7;
  --purple-deep: #16a34a;
  --lime: #86efac;
  --mint: #dcfce7;
  --mint-text: #166534;
  --sky: #e0f2fe;
  --sky-text: #0369a1;
  --lilac: #dcfce7;
  --lilac-text: #15803d;
  --peach: #ffedd5;
  --peach-text: #c2410c;
  --ok: #22c55e;
  --warn: #d97706;
  --err: #e11d48;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 14px 40px rgba(26, 32, 44, 0.06);
  --shadow-sm: 0 6px 18px rgba(26, 32, 44, 0.04);
  --primary: #22c55e;
  --primary-deep: #16a34a;
}

* { box-sizing: border-box; }
html { direction: rtl; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
.ltr { direction: ltr; unicode-bidi: embed; }

/* UKIJ Tor: avoid faux-bold (font file is regular only) */
body, body * { font-weight: normal !important; }

/* ========== Login ========== */
.login-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: linear-gradient(135deg, #f7f4ff 0%, #f4f5f8 45%, #eef8e8 100%);
}
.login-left {
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}
.login-kicker {
  color: var(--purple);
  font-size: 12px;
  letter-spacing: .08em;
}
.login-left h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.35;
  max-width: 14em;
}
.login-left .lead {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 28em;
}
.login-features { display: grid; gap: 12px; margin-top: 10px; max-width: 420px; }
.feat {
  display: flex; gap: 12px; align-items: center;
  background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.feat-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--purple-soft); color: var(--purple);
  display: grid; place-items: center; flex-shrink: 0;
}
.feat strong { display: block; font-size: 14px; margin-bottom: 2px; }
.feat span { color: var(--muted); font-size: 12px; }

.login-right {
  display: grid; place-items: center; padding: 32px;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.brand-row { display: flex; gap: 12px; align-items: center; margin-bottom: 22px; }
.brand-row .mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--purple); color: #fff;
  display: grid; place-items: center; font-size: 18px;
}
.brand-row h2 { margin: 0; font-size: 22px; }
.brand-row .hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.field-box { margin-bottom: 14px; }
.field-box label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.input-ico {
  display: flex; align-items: center; gap: 10px;
  background: #f7f8fb; border: 1px solid transparent; border-radius: 14px;
  padding: 0 14px; color: var(--muted);
}
.input-ico:focus-within { border-color: var(--purple); background: #fff; box-shadow: 0 0 0 3px rgba(34,197,94,.15); }
.input-ico input {
  border: 0; background: transparent; outline: none;
  width: 100%; padding: 14px 0; font-size: 14px; color: var(--text);
}
.btn-login {
  width: 100%; margin-top: 8px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--purple); color: #fff; border: 0;
  border-radius: 999px; padding: 8px 8px 8px 20px;
  font-size: 15px; cursor: pointer;
}
.btn-login .arrow {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--lime); color: #111;
  display: grid; place-items: center;
}
.btn-login:hover { background: var(--purple-deep); }
.login-foot { text-align: center; margin-top: 16px; color: var(--muted); font-size: 12px; }

/* ========== Shell: top nav ========== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topnav {
  position: sticky; top: 0; z-index: 40;
  margin: 12px 16px 0;
  padding: 0 18px;
  min-height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(236,238,243,.95);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(28, 28, 30, 0.05);
}
.topnav-left {
  display: flex; align-items: center; gap: 8px 28px; min-width: 0; flex: 1;
}
.logo {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 6px 0;
}
.logo-mark {
  width: 36px; height: 36px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  transform: rotate(45deg);
}
.logo-mark i {
  display: block; border-radius: 2px; background: #1c1c1e;
}
.logo-mark i:nth-child(2) { background: var(--purple); }
.logo-mark i:nth-child(3) { background: var(--lime); }
.logo-text { display: flex; flex-direction: column; gap: 1px; }
.logo-text strong {
  font-size: 14px; color: var(--text); line-height: 1.2;
  transform: none;
}
.logo-text small {
  font-size: 11px; color: var(--muted); line-height: 1.2;
}

.nav-links {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  min-width: 0;
}
.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 22px 14px;
  color: #8b90a5;
  font-size: 15px;
  white-space: nowrap;
  transition: color .18s ease;
  border-radius: 0;
  background: transparent;
}
.nav-links a:hover { color: var(--purple); background: transparent; }
.nav-links a.active {
  color: var(--purple-deep);
  background: transparent;
  box-shadow: none;
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  inset-inline: 14px;
  bottom: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--purple);
}
.nav-links .nav-ico {
  width: 18px; height: 18px; flex-shrink: 0;
  opacity: .72;
  color: inherit;
}
.nav-links a:hover .nav-ico { opacity: .95; }
.nav-links a.active .nav-ico { opacity: 1; color: var(--purple); }
.nav-links a .badge-num {
  margin-inline-start: 2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--purple); color: #fff;
  font-size: 11px; display: inline-grid; place-items: center;
}
.nav-links a.active .badge-num {
  background: var(--purple-deep);
}

.topnav-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: #f2f3f7;
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 210px;
  color: #a0a5b4;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-box:focus-within {
  background: #fff;
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
  color: var(--purple);
}
.search-box input {
  border: 0; background: transparent; outline: none;
  width: 150px; font-size: 13px; color: var(--text);
}
.search-box input::placeholder { color: #a8adc0; }

.nav-tools {
  display: flex; align-items: center; gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f2f3f7;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: #6b7280;
  display: inline-grid; place-items: center; cursor: pointer;
  position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #fff; color: var(--purple); }
.icon-btn .dot {
  position: absolute; top: 8px; inset-inline-end: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px #f2f3f7;
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
  font: inherit; color: inherit;
}
.user-chip:hover {
  border-color: rgba(34,197,94,.35);
  box-shadow: 0 4px 14px rgba(34,197,94,.12);
}
.user-chip .av,
.user-chip .av-img {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: var(--purple);
  display: grid; place-items: center; font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(34,197,94,.12);
  object-fit: cover; flex-shrink: 0;
}
.user-chip .meta { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.user-chip .meta span { font-size: 13px; color: var(--text); }
.user-chip .meta small { font-size: 11px; color: var(--muted); }

/* Profile modal */
.modal-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(17, 17, 24, 0.42);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none !important; }
.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(17, 17, 24, 0.18);
  border: 1px solid rgba(236,238,243,.9);
  overflow: hidden;
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 20px 22px 12px;
}
.modal-head h3 { margin: 0 0 4px; font-size: 18px; }
.modal-head p { margin: 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 8px 22px 22px; }
.modal-divider {
  margin: 18px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.modal-foot {
  display: flex; justify-content: flex-start; gap: 10px; flex-wrap: wrap;
  margin-top: 18px;
}
.profile-avatar-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.profile-avatar-preview {
  width: 78px; height: 78px; border-radius: 50%;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  color: var(--purple);
  display: grid; place-items: center; font-size: 28px;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(34,197,94,.18);
}
.profile-avatar-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile-avatar-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.profile-avatar-actions .hint {
  width: 100%; color: var(--muted); font-size: 12px;
}
.modal-body label {
  display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted);
}
.modal-card-wide { width: min(640px, 100%); }
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input:not([type]),
.modal-body input.ltr,
.modal-body select {
  width: 100%;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font-size: 13px; background: #fff;
}
.modal-body input:focus,
.modal-body select:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}
.modal-body input:disabled {
  background: #f4f5f8; color: #8b90a0; cursor: not-allowed;
}

/* Shops page */
.stat-mini a.sm { color: inherit; transition: transform .15s, box-shadow .15s; }
.stat-mini a.sm:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(28, 28, 30, 0.06);
}
.shops-panel .chip.on {
  background: var(--purple-soft);
  color: var(--purple-deep);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2);
}
.shop-cell {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.shop-av {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
  color: var(--purple-deep);
}
.shop-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 16em;
}
.shops-table .actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.amt-chips .chip .n {
  display: inline-block;
  margin-top: 0;
  margin-inline-start: 6px;
  font-size: 11px;
  opacity: .75;
}

.logout-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: #f2f3f7; color: #6b7280;
  display: inline-grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s;
}
.logout-btn:hover { background: #ffe8ee; color: var(--err); }

.content {
  padding: 20px 16px 40px;
  flex: 1;
  width: 100%;
  max-width: none;
  margin: 0;
}

/* Page head / welcome */
.welcome {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.welcome .date { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.welcome h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.welcome-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .av {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #fff; margin-inline-start: -8px;
  background: var(--purple-soft); color: var(--purple);
  display: grid; place-items: center; font-size: 12px;
}
.avatar-stack .av:first-child { margin-inline-start: 0; }
.avatar-stack .more {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid #fff; margin-inline-start: -8px;
  background: #111; color: #fff;
  display: grid; place-items: center; font-size: 11px;
}
.welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head .ph-text { min-width: 0; flex: 1; }
.page-head h1 { margin: 0 0 6px; font-size: 26px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-head .ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.layout-2 {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.layout-2 > .panel { margin-bottom: 0; }
.layout-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 16px;
  align-items: start;
}
.layout-detail > .panel { margin-bottom: 0; }

.stat-mini {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-mini .sm {
  background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(236,238,243,.8);
}
.stat-mini .sm .l { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stat-mini .sm .v { font-size: 22px; direction: ltr; text-align: right; }

.detail-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
  background: #fff; border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.detail-hero .title { font-size: 18px; margin: 0 0 4px; }
.detail-hero .sub { color: var(--muted); font-size: 13px; margin: 0; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.toggle {
  position: relative; width: 46px; height: 26px; border-radius: 999px;
  border: 0; cursor: pointer; background: #d6d8e0; padding: 0;
}
.toggle.on { background: var(--purple); }
.toggle::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  transition: inset-inline-start .15s;
}
.toggle.on::after { inset-inline-start: 23px; }

.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.svc-card {
  background: #fff; border-radius: 16px; padding: 16px;
  border: 1px solid rgba(236,238,243,.8); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.svc-card .name { font-size: 14px; margin-bottom: 4px; }
.svc-card .meta { color: var(--muted); font-size: 12px; }

.table-wrap { width: 100%; overflow-x: auto; }

.chip.soft {
  min-width: auto; padding: 8px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
}
.chip.soft .n { margin: 0; opacity: 1; background: rgba(0,0,0,.06);
  border-radius: 999px; padding: 2px 8px; font-size: 11px; }
.chip.soft.active .n { background: rgba(200,255,0,.35); color: #222; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple);
  display: grid; place-items: center; flex-shrink: 0; font-size: 12px;
}
.user-cell .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 16px; font-size: 13px;
  cursor: pointer; background: var(--purple); color: #fff;
}
.btn:hover { background: var(--purple-deep); }
.btn-lime { background: var(--lime); color: #111; }
.btn-lime:hover { filter: brightness(.96); }
.btn-ghost {
  background: #fff; color: #333; border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: #bbb; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; }
.btn-danger { background: var(--err); color: #fff; }

.flash {
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.flash.ok { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.flash.err { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Side rail (~Bankco right column) + main boards */
.dash-top {
  direction: ltr;
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 16px;
}
.dash-side {
  direction: rtl;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.dash-side > .panel { margin-bottom: 0; }
.dash-main {
  direction: rtl;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* KPI ranking cards — default expanded */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.kpi-cards {
  --g1: #fffbf0;
  --g2: #ffdd87;
  --accent: #ea9518;
  --shadow: #b1985e;
  --split-a: #ffe8a0;
  --split-b: #f7b733;

  position: relative;
  display: block;
  height: 270px;
  background: none;
  overflow: hidden;
  transition: height .45s ease, transform .25s ease;
}
.kpi-cards:hover {
  transform: translateY(-3px);
}
.kpi-cards:hover .kpi-outline {
  box-shadow: 0 10px 18px var(--shadow);
}
.kpi-cards.mint { --g1: #f3fff0; --g2: #b8f0a8; --accent: #22a06b; --shadow: #8cbc7a; --split-a: #d4f5c8; --split-b: #4ade80; }
.kpi-cards.sky { --g1: #f0f7ff; --g2: #9ec5ff; --accent: #2f6fbf; --shadow: #7aa3d4; --split-a: #c9e0ff; --split-b: #60a5fa; }
.kpi-cards.lilac { --g1: #f7f2ff; --g2: #c4b5fd; --accent: #6b4fd6; --shadow: #9b8cd4; --split-a: #ddd0ff; --split-b: #a78bfa; }
.kpi-cards.peach { --g1: #fff7f0; --g2: #fdba74; --accent: #c46a22; --shadow: #d4a078; --split-a: #ffe0c4; --split-b: #fb923c; }

.kpi-outline {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 150px;
  border-radius: 25px;
  background: linear-gradient(45deg, var(--g1), var(--g2));
  box-shadow: 0 8px 16px rgba(177, 152, 94, 0.18);
  overflow: hidden;
  transition: box-shadow .45s ease;
}
.kpi-trophy {
  position: absolute;
  inset-inline-end: -8px;
  top: 0;
  opacity: .95;
  pointer-events: none;
}
.kpi-rank {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 10px 16px 0;
  color: var(--accent);
  font-size: clamp(28px, 2.8vw, 42px);
  letter-spacing: -.03em;
  direction: ltr;
  text-align: start;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-split {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 96px;
  width: 70%;
  height: 8px;
  border-radius: 999px;
  background-image: linear-gradient(
    to right,
    transparent 8%,
    var(--split-a) 22%,
    var(--split-b) 50%,
    var(--split-a) 78%,
    transparent 92%
  );
  z-index: 1;
}
.kpi-avatar {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 16px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  display: grid;
  place-items: center;
  color: #6b7578;
  z-index: 2;
}
.kpi-avatar svg { width: 14px; height: 14px; }
.kpi-uname {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 48px;
  inset-inline-end: 12px;
  margin: 0;
  color: #6b7578;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 2;
}

.kpi-detail {
  position: relative;
  z-index: 1;
  top: -20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: 100%;
  height: 120px;
  padding: 28px 10px 12px;
  background: #fff;
  border-radius: 0 0 25px 25px;
  box-shadow: 0 10px 20px rgba(28, 28, 30, 0.05);
  overflow: hidden;
}
.kpi-medal {
  flex-shrink: 0;
  margin-inline-start: 4px;
}
.kpi-grades {
  position: relative;
  min-width: 0;
  padding-inline-start: 8px;
}
.kpi-grades-ico {
  display: block;
  color: var(--accent);
  margin-bottom: 2px;
}
.kpi-grades-label {
  display: block;
  color: #424c50;
  font-size: 12px;
  letter-spacing: .04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-grades-num {
  display: block;
  margin-top: 2px;
  color: var(--accent);
  font-size: 24px;
  letter-spacing: -.02em;
}

/* Cards / panels */
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(236,238,243,.8);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.panel-head h3 { margin: 0; font-size: 16px; }

/* Dashboard board under KPI: Summary+Efficiency row, then full-width table */
.dash-board {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
}
.dash-board > .bc-sum-row,
.dash-board > .panel {
  width: 100%;
  min-width: 0;
}
.dash-board > .panel {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}
.dash-board > .panel .panel-head { flex-shrink: 0; }
.dash-board > .panel .chart-wrap,
.dash-board > .panel .perf-chart-block,
.dash-board > .panel .timeline,
.dash-board > .panel .table-wrap,
.dash-board > .panel .empty {
  flex: 1 1 auto;
  min-height: 0;
}
.dash-board > .panel .timeline-track {
  min-height: 120px;
  height: 100%;
}
.dash-board > .panel .table-wrap {
  overflow: auto;
}
.dash-col {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.dash-col > .panel { margin-bottom: 0; height: 100%; }

.welcome {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  margin-bottom: 18px;
}
.welcome h1 {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--text);
}

/* Performance weekly stats (reference layout) */
.perf-card {
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 42%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.perf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.perf-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.perf-title h3 { margin: 0; font-size: 16px; color: #1f2329; }
.perf-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}
.perf-more {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  color: #9aa0b0; background: transparent;
  transition: background .15s, color .15s;
}
.perf-more:hover { background: #eef2ff; color: #3b82f6; }

.perf-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.perf-mini-card {
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 6px 16px rgba(28, 28, 30, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.pm-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pm-ico {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
}
.pm-ico svg { width: 18px; height: 18px; }
.perf-mini-card.blue .pm-ico { background: #e8f1ff; color: #3b82f6; }
.perf-mini-card.cyan .pm-ico { background: #e6faf8; color: #14b8a6; }
.perf-mini-card.orange .pm-ico { background: #fff1e6; color: #f59e0b; }
.pm-text { min-width: 0; flex: 1; }
.pm-label {
  font-size: 12px; color: #8b90a0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-value {
  margin-top: 4px;
  font-size: 26px;
  color: #1f2329;
  letter-spacing: -.02em;
}
.pm-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #8b90a0;
}
.pm-grow { color: #14b8a6; }
.pm-grow.down { color: #f43f5e; }

.perf-chart-block {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  padding: 14px 12px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.perf-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.perf-chart-head h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #1f2329;
}
.perf-chart-head p {
  margin: 0;
  font-size: 12px;
  color: #8b90a0;
}
.perf-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f4f6fa;
  border-radius: 10px;
  padding: 3px;
}
.perf-tabs button {
  border: 0;
  background: transparent;
  color: #8b90a0;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.perf-tabs button.on {
  background: #fff;
  color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 180px;
  padding: 8px 4px 0;
  background:
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent 35px,
      rgba(148, 163, 184, 0.18) 35px,
      rgba(148, 163, 184, 0.18) 36px
    );
  border-radius: 10px;
}
.bar-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: 100%;
  min-width: 0;
}
.bar-track {
  width: 18px;
  height: 140px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bar-track > i {
  display: block;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #60a5fa, #3b82f6);
  transition: height .35s ease;
}
.bar-col span {
  font-size: 11px;
  color: #8b90a0;
  white-space: nowrap;
}
.bar-tip {
  position: absolute;
  bottom: calc(8px + 11px + 140px * (var(--h, 40) / 100) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #3b82f6;
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
  white-space: nowrap;
  z-index: 2;
}
.bar-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #3b82f6;
}
.bar-col.peak .bar-tip,
.bar-col:hover .bar-tip { opacity: 1; }

@media (max-width: 1100px) {
  .perf-mini { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline { position: relative; padding-top: 4px; }
.timeline-hours {
  display: grid; grid-template-columns: repeat(5, 1fr);
  color: var(--muted); font-size: 11px; margin-bottom: 12px;
  direction: ltr; text-align: center;
}
.timeline-track {
  position: relative; height: 128px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(124,108,240,.06), transparent 30%, transparent 70%, rgba(124,108,240,.05)),
    repeating-linear-gradient(90deg, #f3f4f8 0 1px, transparent 1px 20%);
  border: 1px solid #f0f1f5;
}
.timeline-now {
  position: absolute; top: 8px; bottom: 8px; width: 0;
  border-inline-start: 2px dashed var(--purple);
  z-index: 2;
}
.timeline-now::before {
  content: "";
  position: absolute; top: -4px; inset-inline-start: -5px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--purple);
  box-shadow: 0 0 0 4px rgba(124,108,240,.18);
}
.tl-item {
  position: absolute; top: 22px; height: 36px;
  border-radius: 12px; padding: 0 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #fff; white-space: nowrap; overflow: hidden;
  background: linear-gradient(135deg, #8b7cf5, #6a5ae0);
  box-shadow: 0 8px 18px rgba(124,108,240,.28);
  transition: transform .15s ease;
}
.tl-item:hover { transform: translateY(-2px); }
.tl-item.alt {
  top: 72px;
  background: linear-gradient(135deg, #2a2a2e, #111);
  box-shadow: 0 8px 18px rgba(17,17,17,.18);
}
.tl-item.ok { background: linear-gradient(135deg, #34c77b, #1f9d5c); box-shadow: 0 8px 18px rgba(34,160,107,.22); }
.tl-item.err { background: linear-gradient(135deg, #f0718a, #e11d48); }

/* Leaderboard */
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 10px;
  border-radius: 14px;
  transition: background .15s;
}
.lb-row:hover { background: #f7f8fc; }
.lb-rank {
  width: 24px; color: var(--muted); font-size: 13px; text-align: center;
}
.lb-rank.top { color: #fff; background: var(--purple); border-radius: 8px; height: 24px; display: grid; place-items: center; }
.lb-av {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #efeafc, #d9d0ff);
  color: var(--purple);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(124,108,240,.12);
}
.lb-main { flex: 1; min-width: 0; }
.lb-main strong {
  display: block; font-size: 14px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-main span { color: var(--muted); font-size: 12px; }
.lb-score {
  text-align: center; min-width: 44px;
}
.lb-score b { display: block; font-size: 14px; direction: ltr; }
.lb-score small { color: var(--muted); font-size: 11px; }
.lb-meter {
  width: 54px; height: 6px; border-radius: 999px; background: #eef0f5; overflow: hidden;
}
/* Quick entry — reference “快速访问” list */
.quick-entry {
  padding: 20px 18px 12px;
}
.quick-entry .panel-head {
  margin-bottom: 6px;
  padding: 0 4px;
}
.quick-entry .panel-head h3 {
  font-size: 17px;
  color: #1f2329;
}
.qe-edit {
  color: var(--purple);
  font-size: 14px;
  transition: color .15s;
}
.qe-edit:hover { color: var(--purple-deep); }
.qe-list {
  display: flex;
  flex-direction: column;
}
.qe-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 8px;
  border-radius: 12px;
  color: inherit;
  transition: background .15s ease;
}
.qe-link:hover { background: #f7f8fc; }
.qe-link:hover .qe-more { color: #8b90a0; }
.qe-ico {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(28, 28, 30, 0.08);
}
.qe-ico svg { width: 22px; height: 22px; }
.qe-ico.blue { background: linear-gradient(145deg, #5b9cff, #3b82f6); }
.qe-ico.orange { background: linear-gradient(145deg, #ffb04a, #f59e0b); }
.qe-ico.green { background: linear-gradient(145deg, #4ade80, #22c55e); }
.qe-ico.red { background: linear-gradient(145deg, #fb7185, #ef4444); }
.qe-ico.violet { background: linear-gradient(145deg, #a78bfa, #7c6cf0); }
.qe-ico.cyan { background: linear-gradient(145deg, #67e8f9, #38bdf8); }
.qe-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.qe-text strong {
  font-size: 15px;
  color: #1f2329;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qe-text small {
  color: #8b90a0; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qe-more {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  color: #c5c9d4;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.qe-link:hover .qe-more { background: rgba(0,0,0,.03); }

.lb-meter > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), #a78bfa);
  width: var(--p, 0%);
}

.dash-table.panel { padding-bottom: 8px; }
.dash-table table.data th { background: transparent; border-bottom: 1px solid var(--line); }
.dash-table table.data td { border-bottom: 1px solid #f3f4f8; }
.dash-table .project-cell .t { font-size: 14px; margin-bottom: 2px; }
.dash-table .project-cell .s { color: var(--muted); font-size: 12px; }

/* Chips / filters */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 16px;
  padding: 12px 14px; min-width: 120px; color: #444; display: block;
}
a.chip:hover { border-color: var(--purple); color: var(--purple); }
.chip.active { background: #111; border-color: #111; color: #fff; }
.chip .n { display: block; margin-top: 6px; font-size: 12px; opacity: .7; }
.chip.active .n { color: var(--lime); opacity: 1; }

.filter-bar, .toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 140px; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea,
.form-grid input, .form-grid select, .form-grid textarea,
.toolbar input, .toolbar select {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; font-size: 13px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus,
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,108,240,.15);
}
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td {
  padding: 14px 10px; border-bottom: 1px solid var(--line);
  text-align: right; vertical-align: middle;
}
table.data th { color: var(--muted); font-size: 12px; background: #fafbfe; }
table.data tr:hover td { background: #fcfcff; }
table.data .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
table.data input {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  font-size: 13px; background: #fff;
}

.badge {
  display: inline-flex; align-items: center; padding: 5px 12px;
  border-radius: 999px; font-size: 12px; background: #f3f4f8; color: #444;
}
.badge.ok { background: #e7f8ef; color: #1f8a55; }
.badge.warn { background: #fff1e4; color: #c46a22; }
.badge.err { background: #ffe8ee; color: #c0254c; }
.badge.off { background: #f3f4f6; color: #6b7280; }
.badge.lime { background: rgba(200,255,0,.35); color: #3f4500; }
.badge.sky { background: var(--sky); color: var(--sky-text); }

.pager {
  display: flex; gap: 6px; align-items: center; justify-content: flex-start;
  margin-top: 16px; color: var(--muted); font-size: 13px;
}
.pager a, .pager span.pg {
  min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: inline-grid; place-items: center;
}
.pager a:hover { border-color: var(--purple); color: var(--purple); }
.pager .active { background: var(--purple); color: #fff; border-color: var(--purple); }
.pager .disabled { opacity: .35; pointer-events: none; }

.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.switch-row:last-child { border-bottom: none; }

.assignees { display: flex; }
.assignees .av {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #fff; margin-inline-start: -6px;
  background: var(--purple-soft); color: var(--purple);
  display: grid; place-items: center; font-size: 11px;
}
.assignees .av:first-child { margin-inline-start: 0; }

.more-btn {
  width: 30px; height: 30px; border-radius: 8px; border: 0;
  background: transparent; color: #999; cursor: pointer;
}
.more-btn:hover { background: #f3f4f8; color: #333; }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px 16px;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(236,238,243,.8);
}
.stat .label { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.stat .value { font-size: 28px; direction: ltr; text-align: right; }
.stat .hint { margin-top: 6px; font-size: 12px; color: var(--muted); }

.hero-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 16px; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.hero-banner .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 0 4px rgba(200,255,0,.3);
}
.hero-banner h3 { margin: 0 0 4px; font-size: 16px; }
.hero-banner p { margin: 0; color: var(--muted); font-size: 13px; }

.mobile-nav-toggle { display: none; }

@media (max-width: 1280px) {
  .dash-top { grid-template-columns: minmax(280px, 300px) minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 1200px) {
  .dash-layout, .layout-2, .layout-detail { grid-template-columns: 1fr; }
  .dash-top { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-cards { height: auto; min-height: 250px; }
  .stat-grid, .stat-mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .logo-text small { display: none; }
  .user-chip .meta { display: none; }
  .search-box { min-width: 160px; }
  .search-box input { width: 100px; }
}
/* —— Settings center (专业分区布局) —— */
.cfg-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: calc(100vh - 160px);
}
.cfg-nav {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px 10px 12px;
  box-shadow: var(--shadow-sm);
}
.cfg-nav__label {
  padding: 4px 12px 10px;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.cfg-nav__list { display: grid; gap: 4px; }
.cfg-nav__item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.cfg-nav__item:hover { background: #f6f7fb; }
.cfg-nav__item.on {
  background: #f0f4ff;
  border-color: #d9e4ff;
}
.cfg-nav__zh {
  font-size: 14px;
  color: #222;
  line-height: 1.3;
}
.cfg-nav__item.on .cfg-nav__zh { color: #2f5fd0; }
.cfg-nav__tip {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cfg-nav__foot {
  margin-top: 12px;
  padding: 12px 12px 4px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.cfg-nav__foot a {
  font-size: 12px;
  color: #2f5fd0;
}
.cfg-workspace { min-width: 0; padding-bottom: 88px; }
.cfg-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 4px 2px 2px;
}
.cfg-hero__title {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: #16181d;
  line-height: 1.3;
}
.cfg-hero__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52em;
}
.cfg-hero__ug {
  display: block;
  margin-top: 4px;
  opacity: 0.85;
}
.cfg-form { display: grid; gap: 14px; }
.cfg-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 8px;
  box-shadow: var(--shadow-sm);
}
.cfg-card--soft {
  background: #fafbfd;
  box-shadow: none;
}
.cfg-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f1f5;
}
.cfg-card__head h3 {
  margin: 0;
  font-size: 15px;
  color: #1c1f26;
}
.cfg-card__meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.cfg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 20px;
}
.cfg-grid__cell--full { grid-column: 1 / -1; }
.cfg-field {
  padding: 10px 0 14px;
}
.cfg-field--compact { padding: 6px 0 10px; }
.cfg-field__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}
.cfg-field__label {
  margin: 0;
  font-size: 13px;
  color: #4a5160;
  line-height: 1.35;
}
.cfg-opt {
  font-size: 11px;
  color: #9aa1b2;
  background: #f1f2f6;
  border-radius: 999px;
  padding: 1px 8px;
}
.cfg-input,
.cfg-field textarea,
.cfg-field select,
.cfg-field input[type="text"],
.cfg-field input[type="url"],
.cfg-field input[type="tel"],
.cfg-field input[type="number"],
.cfg-field input[type="password"] {
  width: 100%;
  border: 1px solid #e4e7ee;
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cfg-field textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.cfg-field select { height: 42px; }
.cfg-input:focus,
.cfg-field textarea:focus,
.cfg-field select:focus,
.cfg-field input:focus {
  border-color: #8eb0f5;
  box-shadow: 0 0 0 3px rgba(47, 95, 208, 0.12);
}
.cfg-hint {
  margin: 7px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.cfg-field--toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
}
.cfg-tips { padding-bottom: 14px; }
.cfg-sticky {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  margin-top: 4px;
}
.cfg-sticky__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(28, 28, 30, 0.1);
  backdrop-filter: blur(10px);
}
.cfg-sticky__hint {
  font-size: 12px;
  color: var(--muted);
}
.cfg-sticky__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.cfg-status { display: grid; gap: 14px; }
.cfg-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding-bottom: 14px;
}
.cfg-stat {
  border: 1px solid #eef0f5;
  background: #fbfcfe;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 6px;
  min-height: 108px;
  align-content: start;
}
.cfg-stat__k {
  font-size: 12px;
  color: var(--muted);
}
.cfg-stat__v {
  font-size: 14px;
  color: #222;
  line-height: 1.4;
  min-height: 1.4em;
}
.cfg-stat__a {
  font-size: 12px;
  color: #2f5fd0;
  margin-top: 4px;
}
.cfg-callout {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f7fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid #e8eef8;
}
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: start;
}
.settings-grid { grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.amt-carrier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  direction: ltr;
}
.amt-carrier-tab {
  padding: 8px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e6e8ef;
  color: #3a3d4d;
  font-size: 14px;
}
.amt-carrier-tab.on {
  background: #3b6cff;
  border-color: #3b6cff;
  color: #fff;
}
.amt-fee-note {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}
.amt-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
  direction: ltr;
}
.amt-card {
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(36, 49, 91, 0.07);
  border: 1px solid rgba(236, 238, 246, 0.9);
  overflow: hidden;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.amt-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(36, 49, 91, 0.1);
}
.amt-card.is-off { opacity: 0.45; }
.amt-card__face {
  flex: 1;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, #fff 0%, #f8f9ff 100%);
  color: #1e2a52;
  font-size: 34px;
  letter-spacing: -0.03em;
  padding: 28px 10px 18px;
  cursor: pointer;
  width: 100%;
  min-height: 112px;
}
.amt-card--rule .amt-card__face {
  font-size: 20px;
  letter-spacing: 0;
  cursor: default;
  color: #3b4a86;
}
.amt-card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f4f5f8;
  padding: 12px 14px;
  font-size: 13px;
  color: #8b90a0;
  min-height: 48px;
}
.amt-card__foot b {
  color: #e23b3b;
  font-size: 18px;
}
.amt-card__foot form { margin: 0; margin-inline-start: auto; }
.amt-card__foot .toggle { width: 36px; height: 20px; }
.amt-card__foot .toggle::after { width: 14px; height: 14px; top: 3px; }
.amt-card__foot .toggle.on::after { inset-inline-start: 18px; }

.carrier-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  direction: ltr;
}
.carrier-card {
  background: #f7f9fc;
  border: 1px solid #e6ebf4;
  border-radius: 16px;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.carrier-card h4 {
  margin: 0;
  font-size: 15px;
  text-align: center;
  color: #2f5fd0;
}
.carrier-card .field-box label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.carrier-card .field-box input,
.carrier-card .field-box select {
  width: 100%;
}
.field-box label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.settings-form .opt {
  margin-inline-start: 6px;
  font-size: 11px;
  color: #a0a4b8;
  font-weight: normal;
}
.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.settings-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.settings-tips {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}
.settings-tips li { margin-bottom: 10px; }
.settings-tips code {
  font-size: 12px;
  background: #f3f4f8;
  padding: 1px 6px;
  border-radius: 6px;
}
.settings-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f7fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.secret-row input { flex: 1; min-width: 0; }
/* 与业务矩阵 .toggle 同款；checkbox 隐藏，由 label 切换 */
.settings-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  min-height: 26px;
}
.settings-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  clip: rect(0, 0, 0, 0);
}
.settings-switch .toggle {
  flex-shrink: 0;
  pointer-events: none;
  display: inline-block;
  vertical-align: middle;
}
.settings-switch input:checked + .toggle { background: var(--purple); }
.settings-switch input:checked + .toggle::after { inset-inline-start: 23px; }
.settings-switch .toggle-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1;
}

@media (max-width: 900px) {
  .topnav {
    margin: 8px 10px 0;
    padding: 10px 12px;
    min-height: auto;
    flex-wrap: wrap;
    border-radius: 18px;
  }
  .topnav-left { width: 100%; flex-wrap: wrap; gap: 8px 14px; }
  .nav-links { width: 100%; }
  .nav-links a { padding: 12px 10px; }
  .nav-links a.active::after { bottom: 6px; }
  .topnav-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .search-box { flex: 1; min-width: 0; }
  .search-box input { width: 100%; }
  .content { padding: 16px; }
  .login-stage { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .kpi-grid { grid-template-columns: 1fr; }
  .stat-grid, .stat-mini { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-aside { position: static; }
  .settings-grid { grid-template-columns: 1fr; }
  .cfg-shell { grid-template-columns: 1fr; }
  .cfg-nav { position: static; }
  .cfg-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .cfg-nav__item { min-width: 140px; flex: 1 1 140px; }
  .cfg-nav__tip { display: none; }
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-workspace { padding-bottom: 100px; }
  .carrier-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .carrier-row { grid-template-columns: 1fr; }
  .cfg-status-grid { grid-template-columns: 1fr; }
  .cfg-sticky__inner { flex-direction: column; align-items: stretch; }
  .cfg-sticky__btns { width: 100%; }
  .cfg-sticky__btns .btn { flex: 1; text-align: center; }
}
