:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-2: #f8faf7;
  --ink: #13211a;
  --muted: #68756d;
  --line: #e2e8e2;
  --line-strong: #cfd8d0;
  --green: #0b7a3e;
  --green-dark: #075b2e;
  --green-soft: #e7f5ec;
  --blue: #175cd3;
  --blue-soft: #eaf1fd;
  --amber: #b54708;
  --amber-soft: #fff4e5;
  --red: #b42318;
  --red-soft: #fef0ef;
  --slate: #475467;
  --slate-soft: #eef1f4;
  --sidebar: #0d2117;
  --sidebar-2: #102a1d;
  --shadow: 0 1px 2px rgba(19, 33, 26, 0.04), 0 8px 24px rgba(19, 33, 26, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}

code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

.ico {
  flex: none;
  display: inline-block;
  vertical-align: -3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- Layout ---------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
  color: #dbe8df;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 18px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e6b46;
  color: #d9f7e5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: -0.01em;
  color: #f3fbf6;
}

.brand-text small {
  font-size: 11px;
  color: #8eaa9a;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b9cdc1;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f0f9f3;
  text-decoration: none;
}

.nav-item.is-active {
  background: #e9f6ee;
  color: #0b5a30;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.nav-item.is-active .ico {
  opacity: 0.9;
}

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #8eaa9a;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.dot-ok {
  background: #47d18a;
  box-shadow: 0 0 0 3px rgba(71, 209, 138, 0.12);
}

.dot-warn {
  background: #e9a23b;
  box-shadow: 0 0 0 3px rgba(233, 162, 59, 0.12);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(244, 246, 242, 0.85);
  border-bottom: 1px solid rgba(19, 33, 26, 0.06);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title {
  min-width: 0;
}

.topbar-title h1 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.02em;
}

.kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #7b8b81;
  margin-bottom: 3px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  font-size: 12px;
  font-weight: 600;
  color: #415348;
  background: #e9eee9;
  border: 1px solid #dbe2db;
  border-radius: 999px;
  padding: 5px 10px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none !important;
}

.content {
  padding: 26px 28px 52px;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Generic ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  min-width: 0;
}

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

.card-head h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.card-head h3 {
  margin: 0;
}

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

.hint {
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 0;
}

.right {
  text-align: right;
}

.nowrap {
  white-space: nowrap;
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.ml-auto {
  margin-left: auto;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--green-soft);
  opacity: 0.7;
}

.tone-blue::after {
  background: var(--blue-soft);
}

.tone-amber::after {
  background: var(--amber-soft);
}

.tone-slate::after {
  background: var(--slate-soft);
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-soft);
  color: var(--green-dark);
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

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

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

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

.stat-value {
  font-size: 30px;
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  margin-top: 3px;
  position: relative;
  z-index: 1;
}

.stat-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
  position: relative;
  z-index: 1;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #253d30;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #f7faf7;
  border-color: #b9c6bc;
  text-decoration: none;
}

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

.btn:disabled,
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 122, 62, 0.2);
}

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #3f5348;
}

.btn-ghost:hover {
  background: #e9eee9;
  border-color: transparent;
}

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

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

.btn-sm {
  padding: 5px 9px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: #4b5f53;
  border-radius: 9px;
  cursor: pointer;
}

.icon-btn:hover {
  background: #e9eee9;
}

/* ---------- Forms ---------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: #33473b;
}

.field > span em {
  font-style: normal;
  font-weight: 500;
  color: #93a096;
  font-size: 11.5px;
  margin-left: 2px;
}

.field input,
.field select,
textarea,
.filter-bar select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
textarea:focus,
.filter-bar select:focus {
  border-color: #68a986;
  box-shadow: 0 0 0 3px rgba(11, 122, 62, 0.1);
}

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

textarea {
  resize: vertical;
  min-height: 78px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: #405348;
}

.check input {
  margin-top: 2px;
  accent-color: var(--green);
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.secret-field {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  padding: 2px 3px 2px 10px;
}

.secret-field input {
  border: 0;
  padding: 7px 0;
  font-family: var(--mono);
  font-size: 12px;
  background: transparent;
  box-shadow: none;
}

.secret-field input:focus {
  box-shadow: none;
}

/* ---------- Notices ---------- */

.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.flash-ok {
  background: var(--green-soft);
  color: #085c31;
  border-color: #c6e5d2;
}

.flash-error {
  background: var(--red-soft);
  color: #8f1d14;
  border-color: #f1c9c5;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.notice strong {
  display: block;
  margin-bottom: 2px;
}

.notice p {
  margin: 0;
  color: var(--muted);
}

.notice-info {
  background: var(--blue-soft);
  border-color: #d5e3fb;
  color: #174a9c;
}

.notice-info p {
  color: #3b5b8f;
}

.notice-warn {
  background: var(--amber-soft);
  border-color: #f3d7b4;
  color: #8a4609;
}

.notice-error {
  background: var(--red-soft);
  border-color: #f1c9c5;
  color: #8f1d14;
}

/* ---------- Session ---------- */

.session-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dcece2;
  color: var(--green-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}

.session-account strong {
  display: block;
  font-size: 13px;
}

.session-account small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 16px 0;
}

.meta-grid dt {
  font-size: 11px;
  color: var(--muted);
}

.meta-grid dd {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.session-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 500;
}

.quick-links a {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #3f5348;
}

.quick-links a:hover {
  color: var(--green-dark);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
}

.table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #839187;
  font-weight: 650;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 11px 10px;
  border-bottom: 1px solid #edf1ed;
  vertical-align: middle;
}

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

.table tbody tr:hover {
  background: #fafcf9;
}

.table-compact td {
  padding: 9px 10px;
}

.table .strong {
  font-weight: 650;
}

.cell-title {
  font-weight: 600;
}

.cell-sub {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 1px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  background: var(--slate-soft);
  color: var(--slate);
  border: 1px solid transparent;
}

.badge-ok {
  background: var(--green-soft);
  color: #086338;
  border-color: #c9e7d4;
}

.badge-bad,
.badge-error {
  background: var(--red-soft);
  color: #97241a;
  border-color: #f2c9c4;
}

.badge-warn {
  background: var(--amber-soft);
  color: #8a4609;
  border-color: #f3d7b4;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 12px;
  color: var(--green-dark);
  white-space: nowrap;
}

.text-link .ico {
  transition: transform 0.15s ease;
}

.text-link:hover .ico {
  transform: translateX(2px);
}

/* ---------- Empty ---------- */

.empty-state {
  padding: 38px 20px;
  text-align: center;
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4ef;
  color: #6f8a79;
  margin-bottom: 10px;
}

.empty-state h2,
.empty-state h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.empty-state p {
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 12.5px;
  max-width: 420px;
}

/* ---------- Query ---------- */

.query-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.result-card {
  min-height: 420px;
}

.result-empty {
  padding: 100px 24px;
}

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

.result-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.result-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.result-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.result-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 9px 11px;
}

.result-field span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 2px;
}

.result-field strong {
  font-size: 13px;
  font-weight: 650;
  word-break: break-word;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}

.result-error {
  border: 1px solid #f1c9c5;
  background: var(--red-soft);
  color: #8f1d14;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.result-json {
  margin-top: 8px;
}

/* ---------- Records / detail ---------- */

.stat-strip {
  display: flex;
  gap: 24px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.stat-strip div {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-strip strong {
  font-size: 18px;
}

.stat-strip span {
  font-size: 11.5px;
  color: var(--muted);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  padding: 0 10px;
  min-width: 240px;
  flex: 1;
  max-width: 440px;
  color: #8a988f;
}

.search-field input {
  border: 0;
  background: transparent;
  padding: 9px 0;
  width: 100%;
  outline: none;
  box-shadow: none;
}

.filter-bar select {
  width: auto;
  min-width: 118px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 16px;
}

.page-btn {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
}

.page-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-info {
  font-size: 11.5px;
  color: var(--muted);
}

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

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

.detail-title h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.detail-head p {
  margin: 3px 0 0;
}

.field-list {
  margin: 0;
}

.field-list > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1ed;
}

.field-list > div:last-child {
  border-bottom: 0;
}

.field-list dt {
  color: var(--muted);
  font-size: 12px;
}

.field-list dd {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}

.field-list.compact > div {
  grid-template-columns: 110px minmax(0, 1fr);
  padding: 6px 0;
}

.code-block {
  margin: 0;
  background: #0f1e16;
  color: #d8e9dd;
  border-radius: 11px;
  padding: 14px 16px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  max-height: 480px;
  tab-size: 2;
}

/* ---------- Settings / docs ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.settings-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.login-control {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.login-control strong {
  font-size: 13px;
}

.docs-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 980px;
}

.docs-layout h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin: 18px 0 6px;
}

.docs-layout .code-block {
  margin-bottom: 4px;
}

.docs-layout p {
  color: #46594d;
  font-size: 13px;
}

/* ---------- Login ---------- */

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(45, 156, 96, 0.16), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(11, 122, 62, 0.1), transparent 40%),
    #eef2ec;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-wrap {
  width: 100%;
  max-width: 410px;
}

.login-card {
  background: #fff;
  border: 1px solid #dfe7df;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(15, 45, 28, 0.12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
}

.login-brand .brand-mark {
  width: 42px;
  height: 42px;
  background: #0e6b3d;
  color: #e5f8ed;
}

.login-brand strong {
  display: block;
  font-size: 14px;
}

.login-brand small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
}

.login-card h1 {
  font-size: 25px;
  letter-spacing: -0.03em;
  margin: 0 0 4px;
}

.login-card > p {
  font-size: 13px;
}

.login-card form {
  margin-top: 18px;
}

.login-note {
  color: var(--muted);
  font-size: 11.5px;
  margin: 18px 0 0;
  line-height: 1.5;
}

.login-note code {
  font-size: 10.5px;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: #13251b;
  color: #effaf3;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
  max-width: 360px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  background: #6f1d16;
}

/* ---------- Responsive ---------- */

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

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

  .query-grid {
    grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 232px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.24);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 12, 0.38);
    z-index: 25;
  }

  .nav-toggle {
    display: inline-flex !important;
  }

  .topbar {
    padding: 0 16px;
    height: 62px;
  }

  .content {
    padding: 18px 16px 40px;
  }

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

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

  .user-chip {
    display: none;
  }

  .result-empty {
    padding: 60px 20px;
  }
}

@media (max-width: 540px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

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

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .detail-head,
  .card-head {
    flex-wrap: wrap;
  }

  .filter-bar .search-field {
    max-width: none;
    flex-basis: 100%;
  }

  .field-list > div {
    grid-template-columns: 112px minmax(0, 1fr);
  }

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

  .login-card {
    padding: 22px;
  }

  .stat-strip {
    gap: 14px;
    flex-wrap: wrap;
  }
}

/* ---------- Multi-account / stats additions ---------- */

.badge-blue {
  background: var(--blue-soft);
  color: #174a9c;
  border-color: #d5e3fb;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.account-state {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 360px;
  line-height: 1.4;
}

.account-state.error-text,
.error-text {
  color: var(--red);
}

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

.form-grid > .field:last-of-type {
  grid-column: auto;
}

.align-end {
  align-items: flex-end;
}

.mt-14 {
  margin-top: 14px;
}

.mt-18 {
  margin-top: 18px;
}

.big-number {
  font-size: 46px;
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.04em;
  margin: 8px 0 6px;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 190px;
  padding: 12px 4px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
}

.bar {
  width: 100%;
  max-width: 42px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #34a066, var(--green));
  min-height: 3px;
  transition: opacity 0.15s ease;
}

.bar-col:hover .bar {
  opacity: 0.8;
}

.bar-0 { height: 3%; }
.bar-1 { height: 10%; }
.bar-2 { height: 20%; }
.bar-3 { height: 30%; }
.bar-4 { height: 40%; }
.bar-5 { height: 50%; }
.bar-6 { height: 60%; }
.bar-7 { height: 70%; }
.bar-8 { height: 80%; }
.bar-9 { height: 90%; }
.bar-10 { height: 100%; }

.bar-value {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}

.bar-label {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

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

.rank-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1ed;
  font-size: 13px;
}

.rank-list > div:last-child {
  border-bottom: 0;
}

.rank-list strong {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green-dark);
}

@media (max-width: 540px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .bar-chart {
    gap: 5px;
    height: 160px;
  }
}

.bar-empty {
  background: var(--line-strong);
}

.account-cell {
  white-space: nowrap;
}

.account-id-cell {
  word-break: break-all;
}

.account-table td {
  vertical-align: top;
}

.icon-only {
  padding-left: 7px;
  padding-right: 7px;
}

.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13.5px;
  outline: none;
}

.parse-preview {
  margin-top: 16px;
}

.parse-preview .result-fields {
  margin-top: 12px;
}

.parse-preview .result-field strong {
  font-size: 13px;
}

.rules-table .cell-sub {
  white-space: nowrap;
}

.rules-table td:first-child {
  min-width: 120px;
}

/* ---------- Parse coverage ---------- */

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

.category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.category-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

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

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

.category-numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.category-numbers div {
  display: flex;
  flex-direction: column;
}

.category-numbers b {
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.category-numbers span {
  font-size: 10.5px;
  color: var(--muted);
}

.coverage-line {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.rules-main,
.rules-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.category-section {
  padding-bottom: 10px;
}

.series-block {
  border-top: 1px solid var(--line);
  padding: 14px 0 4px;
}

.series-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.series-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.series-head h3 {
  margin: 0;
  font-size: 14px;
}

.series-head .hint {
  margin: 1px 0 0;
}

.missing-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.missing-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #f3d7b4;
  background: var(--amber-soft);
  color: #8a4609;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.missing-chip span {
  font-weight: 500;
  opacity: 0.75;
}

.missing-chip:hover {
  text-decoration: none;
  border-color: #e5bc83;
}

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

  .rules-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

.raw-body {
  max-height: 480px;
  white-space: pre-wrap;
  word-break: break-word;
}

.raw-json {
  margin-top: 12px;
}

.raw-json > summary {
  cursor: pointer;
  margin-bottom: 8px;
}

.serials-table {
  min-width: 1000px;
}

.serials-table td {
  vertical-align: middle;
}

.category-link {
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.category-link:hover {
  text-decoration: none;
  border-color: #b9c6bc;
  box-shadow: 0 8px 24px rgba(19, 33, 26, 0.08);
}

.category-link-label {
  margin-left: auto;
  font-size: 11.5px;
}

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

.sidebar {
  overflow-y: auto;
}

.nav-parent {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.nav-parent .nav-caret {
  margin-left: auto;
  display: inline-flex;
  transition: transform 0.15s ease;
}

.nav-parent[aria-expanded="true"] .nav-caret {
  transform: rotate(180deg);
}

.subnav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 5px 17px;
  padding-left: 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.subnav[hidden] {
  display: none;
}

.subnav-link {
  color: #9fb7a8;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
  text-decoration: none;
}

.subnav-link:hover {
  color: #eef9f1;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.subnav-link.is-active {
  color: #0b5a30;
  background: #e9f6ee;
  font-weight: 600;
}

@media (max-width: 1220px) {
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 540px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Sidebar navigation polish ---------- */

.sidebar .nav {
  gap: 2px;
}

.sidebar .nav-item {
  min-height: 36px;
  padding: 8px 10px;
}

.nav-parent {
  appearance: none;
  -webkit-appearance: none;
}

.nav-parent .nav-caret {
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  opacity: 0.55;
}

.nav-parent:hover .nav-caret,
.nav-parent[aria-expanded="true"] .nav-caret {
  opacity: 0.9;
}

.subnav {
  gap: 1px;
  margin: 4px 2px 8px 12px;
  padding: 2px 0 2px 9px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.subnav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 29px;
  padding: 5px 7px;
  border-radius: 6px;
  color: #9db4a5;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.005em;
}

.subnav-link .ico {
  opacity: 0.62;
  color: #9db4a5;
}

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

.subnav-link:hover .ico {
  opacity: 0.9;
  color: #c9e6d5;
}

.subnav-link.is-active {
  color: #f1fbf5;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 2px 0 0 #4bd58a;
  font-weight: 600;
}

.subnav-link.is-active .ico {
  opacity: 1;
  color: #62dd9b;
}

.nav-parent.is-active .nav-caret {
  color: #0b5a30;
}

/* ---------- Sidebar visual refresh ---------- */

.sidebar {
  padding: 20px 12px 14px;
}

.sidebar .brand {
  padding: 0 6px 16px;
  margin-bottom: 10px;
}

.sidebar .nav {
  gap: 0;
}

.nav-section + .nav-section {
  margin-top: 7px;
}

.nav-section-label {
  padding: 8px 10px 4px;
  font-size: 9.5px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e8979;
}

.nav-section:first-child .nav-section-label {
  padding-top: 2px;
}

.sidebar .nav-item {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  color: #a8bcaf;
  font-size: 13px;
  font-weight: 500;
  gap: 9px;
}

.sidebar .nav-item .ico {
  opacity: 0.72;
}

.sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #edf8f1;
}

.sidebar .nav-item.is-active {
  background: linear-gradient(
    90deg,
    rgba(75, 213, 138, 0.16),
    rgba(75, 213, 138, 0.035)
  );
  color: #f2fcf6;
  box-shadow: inset 3px 0 0 #4bd58a;
  font-weight: 600;
}

.sidebar .nav-item.is-active .ico {
  color: #6ce39f;
  opacity: 1;
}

.nav-parent .nav-caret {
  width: 18px;
  height: 18px;
  opacity: 0.48;
}

.nav-parent[aria-expanded="true"] .nav-caret {
  opacity: 0.85;
}

.nav-parent.is-active .nav-caret {
  color: #6ce39f;
}

.subnav {
  margin: 3px 0 5px;
  padding: 5px 4px;
  background: rgba(255, 255, 255, 0.032);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  gap: 1px;
}

.subnav-link {
  position: relative;
  min-height: 28px;
  padding: 6px 10px 6px 23px;
  border-radius: 6px;
  color: #93a99b;
  font-size: 12px;
  font-weight: 400;
}

.subnav-link::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: #647d6d;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.subnav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e8f6ed;
}

.subnav-link:hover::before {
  background: #a7c8b4;
}

.subnav-link.is-active {
  background: rgba(75, 213, 138, 0.11);
  color: #f0fbf4;
  box-shadow: none;
  font-weight: 600;
}

.subnav-link.is-active::before {
  background: #58dc94;
  box-shadow: 0 0 0 3px rgba(88, 220, 148, 0.12);
}

.sidebar-foot {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  padding: 10px 10px;
  margin-top: auto;
  font-size: 11px;
}

/* ---------- Premium light admin sidebar ---------- */

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  background:
    radial-gradient(circle at 10% 0%, rgba(20, 140, 78, 0.06), transparent 32%),
    #fbfcfa;
  color: #2c3d32;
  border-right: 1px solid #e6ebe6;
  box-shadow: 8px 0 30px rgba(17, 42, 27, 0.025);
  padding: 20px 14px 14px;
}

.sidebar .brand {
  border-bottom-color: #e8ede8;
  padding: 0 6px 16px;
  margin-bottom: 8px;
}

.sidebar .brand-mark {
  background: linear-gradient(145deg, #11834a, #096336);
  color: #e9fbf1;
  box-shadow: 0 6px 16px rgba(8, 99, 54, 0.2);
}

.sidebar .brand-text strong {
  color: #14251b;
  font-size: 15px;
}

.sidebar .brand-text small {
  color: #7c8c81;
}

.nav-section-label {
  color: #98a69c;
  font-size: 9px;
  letter-spacing: 0.14em;
  padding: 9px 10px 4px;
}

.sidebar .nav-item {
  min-height: 38px;
  padding: 5px 9px;
  border-radius: 10px;
  color: #536458;
  font-size: 13px;
  font-weight: 500;
  gap: 9px;
}

.sidebar .nav-item .ico {
  width: 28px;
  height: 28px;
  padding: 5px;
  box-sizing: border-box;
  border-radius: 8px;
  background: #f0f4f0;
  color: #6d8072;
  opacity: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar .nav-item:hover {
  background: #f1f6f1;
  color: #213c2c;
}

.sidebar .nav-item:hover .ico {
  background: #e9f0ea;
  color: #416650;
}

.sidebar .nav-item.is-active {
  background: #eaf6ef;
  color: #075c31;
  box-shadow: none;
  font-weight: 650;
}

.sidebar .nav-item.is-active .ico {
  background: #0b7a3e;
  color: #f3fff8;
  box-shadow: 0 3px 8px rgba(11, 122, 62, 0.18);
}

.nav-parent .nav-caret {
  color: #8c9a90;
  opacity: 0.7;
}

.nav-parent.is-active .nav-caret {
  color: #0b7a3e;
  opacity: 1;
}

.subnav {
  margin: 4px 1px 7px;
  padding: 5px;
  background: #f3f7f3;
  border: 1px solid #e6ece6;
  border-radius: 11px;
}

.subnav-link {
  min-height: 30px;
  padding: 6px 9px 6px 23px;
  border-radius: 7px;
  color: #677a6c;
  font-size: 12px;
}

.subnav-link::before {
  left: 10px;
  width: 4px;
  height: 4px;
  background: #b0beb3;
}

.subnav-link:hover {
  background: #eaf1eb;
  color: #203d2b;
}

.subnav-link:hover::before {
  background: #6c8a77;
}

.subnav-link.is-active {
  background: #ffffff;
  color: #075c31;
  box-shadow: 0 1px 4px rgba(20, 55, 33, 0.08);
  font-weight: 650;
}

.subnav-link.is-active::before {
  background: #0b7a3e;
  box-shadow: 0 0 0 3px rgba(11, 122, 62, 0.1);
}

.sidebar-foot {
  background: #ffffff;
  border: 1px solid #e6ece6;
  color: #728176;
  border-radius: 10px;
  padding: 10px;
  font-size: 10.5px;
  box-shadow: 0 1px 3px rgba(20, 55, 33, 0.04);
}

.sidebar-foot .dot {
  box-shadow: none;
}

.sidebar .dot-ok {
  background: #29a765;
}

.sidebar .dot-warn {
  background: #dd9a2f;
}

/* Thin scrollbar for the light sidebar */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #dce5dd;
  border-radius: 999px;
}

@media (max-width: 820px) {
  .sidebar {
    width: 252px;
  }
}

.nav-parent .nav-caret .ico {
  width: 14px;
  height: 14px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #8b9b90;
}

.nav-parent.is-active .nav-caret .ico {
  color: #0b7a3e;
  background: transparent;
  box-shadow: none;
}

/* ---------- Floating rules flyout ---------- */

.nav-flyout-wrap {
  position: relative;
}

.rules-flyout {
  position: fixed;
  z-index: 80;
  width: 238px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e2e9e2;
  border-radius: 14px;
  box-shadow:
    0 22px 55px rgba(16, 45, 28, 0.18),
    0 3px 10px rgba(16, 45, 28, 0.06);
  animation: flyout-in 0.14s ease-out;
}

.rules-flyout[hidden] {
  display: none;
}

.rules-flyout::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 18px;
  width: 9px;
  height: 9px;
  background: #ffffff;
  border-left: 1px solid #e2e9e2;
  border-bottom: 1px solid #e2e9e2;
  transform: rotate(45deg);
}

@keyframes flyout-in {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.flyout-head {
  padding: 7px 9px 9px;
}

.flyout-head .kicker {
  margin-bottom: 2px;
}

.flyout-head strong {
  font-size: 13px;
  font-weight: 650;
  color: #1e3326;
}

.flyout-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.flyout-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  color: #4d6255;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}

.flyout-item:hover {
  background: #f2f8f3;
  color: #163d26;
  text-decoration: none;
}

.flyout-icon {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: #f1f6f2;
  color: #607a68;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.flyout-item:hover .flyout-icon {
  background: #e5f2e9;
  color: #0b6b39;
}

.flyout-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  color: #7b8f80;
  display: inline-flex;
}

.flyout-item:hover .flyout-arrow {
  opacity: 1;
  transform: translateX(0);
}

.flyout-item.is-active {
  background: #eaf7ef;
  color: #075c31;
  font-weight: 650;
}

.flyout-item.is-active .flyout-icon {
  background: #0b7a3e;
  color: #ffffff;
}

.flyout-item.is-active .flyout-arrow {
  opacity: 1;
  color: #0b7a3e;
}

.flyout-all {
  margin-top: 6px;
  padding: 9px 9px 7px;
  border-top: 1px solid #edf1ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #0b6b39;
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
}

.flyout-all:hover {
  color: #075c31;
  text-decoration: none;
}

@media (max-width: 820px) {
  .rules-flyout {
    position: static;
    width: 100%;
    margin-top: 4px;
    box-shadow: none;
    animation: none;
  }

  .rules-flyout::before {
    display: none;
  }
}

/* ---------- Dashboard layout ---------- */

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}

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

.activity-list {
  margin: 0 -4px;
}

.activity-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 8px;
  border-bottom: 1px solid #edf1ed;
  color: var(--ink);
  text-decoration: none;
  border-radius: 7px;
}

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

.activity-row:hover {
  background: #f8fbf8;
  text-decoration: none;
}

.activity-state {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.activity-state.bad {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

.activity-main {
  min-width: 0;
}

.activity-main > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.activity-main strong {
  font-size: 12.5px;
}

.activity-main small {
  color: var(--muted);
  font-size: 11px;
}

.activity-store {
  color: var(--muted);
  font-size: 11px;
}

.activity-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.activity-meta time {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.account-mini-list {
  display: flex;
  flex-direction: column;
}

.account-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #edf1ed;
}

.account-mini:last-child {
  border-bottom: 0;
}

.account-mini .avatar {
  width: 34px;
  height: 34px;
  font-size: 14px;
}

.account-mini-main {
  min-width: 0;
  flex: 1;
}

.account-mini-main strong,
.account-mini-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini-main strong {
  font-size: 12.5px;
}

.account-mini-main small {
  color: var(--muted);
  font-size: 10.5px;
}

.account-mini-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.account-mini-status small {
  color: var(--muted);
  font-size: 10px;
}

.account-mini-status .badge {
  font-size: 9.5px;
  padding: 2px 6px;
}

.card-footline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px solid #edf1ed;
  font-size: 11px;
  color: var(--muted);
}

.cache-rate {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 8px;
}

.cache-rate strong {
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.04em;
}

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

.cache-progress {
  width: 100%;
  height: 7px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  appearance: none;
  background: #eef3ee;
}

.cache-progress::-webkit-progress-bar {
  background: #eef3ee;
  border-radius: 999px;
}

.cache-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #3bbd7b, #0b7a3e);
  border-radius: 999px;
}

.cache-progress::-moz-progress-bar {
  background: #0b7a3e;
  border-radius: 999px;
}

.cache-facts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.cache-facts b {
  color: var(--ink);
  font-size: 12px;
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .dashboard-side {
    grid-template-columns: 1fr;
  }
}

.query-grid {
  margin-bottom: 18px;
}

@media (min-width: 1081px) {
  .query-grid .result-card {
    position: sticky;
    top: 88px;
  }
}

.settings-admin-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.settings-admin-form .form-actions {
  padding-bottom: 1px;
}

@media (max-width: 1100px) {
  .settings-admin-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .settings-admin-form {
    grid-template-columns: 1fr;
  }
}

.docs-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 1120px;
}

.docs-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.docs-toc {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.docs-toc .kicker {
  padding: 0 7px 7px;
}

.docs-toc a {
  padding: 6px 8px;
  border-radius: 7px;
  color: #5e7064;
  font-size: 11.5px;
  text-decoration: none;
}

.docs-toc a:hover {
  background: #f2f7f3;
  color: #075c31;
  text-decoration: none;
}

@media (max-width: 980px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
  }

  .docs-toc .kicker {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .docs-toc {
    grid-template-columns: 1fr 1fr;
  }
}

.settings-tipbox {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #edf1ed;
  display: grid;
  gap: 10px;
}

.settings-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  background: #f8fbf8;
  border: 1px solid #edf2ed;
}

.tip-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf6ef;
  color: #0b7a3e;
  flex: none;
}

.settings-tip strong {
  display: block;
  font-size: 12px;
  color: #2a4031;
}

.settings-tip p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

/* ---------- Login error states ---------- */

.login-card {
  max-width: 420px;
}

.login-alert {
  display: block;
  padding: 0;
  margin: 14px 0 2px;
  border: 0;
  background: transparent;
  color: #b42318;
  animation: login-alert-in 0.2s ease-out;
}

.login-alert[hidden] {
  display: none;
}

.login-alert-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fde4e0;
  color: #b42318;
  flex: none;
}

.login-alert strong {
  display: inline;
  font-size: 12.5px;
  line-height: 1.5;
}

.login-alert strong::after {
  content: "：";
}

.login-alert p {
  display: inline;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #b42318;
}

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

.login-alert.is-shaking {
  animation: login-shake 0.28s ease-in-out;
}

@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 56px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #708077;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
}

.password-toggle:hover {
  background: #f0f5f0;
  color: #0b6b39;
}

.field input.is-invalid {
  border-color: #d9534f;
  background: #fffafa;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.login-caps {
  margin: -5px 0 0;
  color: #9a5b00;
  font-size: 11px;
  font-weight: 600;
}

.login-caps[hidden] {
  display: none;
}

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

/* ============================================================
   Unified admin UI layer
   Controlled surfaces, spacing, controls and table density.
   ============================================================ */

:root {
  --control-height: 40px;
  --control-radius: 9px;
  --control-border: #d7e0d8;
  --control-border-hover: #b7c7ba;
  --control-placeholder: #9ba89e;
  --focus-ring: 0 0 0 3px rgba(11, 122, 62, 0.1);
  --card-border: #e4eae4;
  --card-pad: 20px;
  --gap-page: 18px;
}

/* ---------- Cards and page rhythm ---------- */

.card {
  border-color: var(--card-border);
  border-radius: 15px;
  padding: var(--card-pad);
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.03), 0 6px 20px rgba(19, 33, 26, 0.035);
}

.card-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.card-head h2 {
  font-size: 16.5px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.card-head .kicker {
  margin-bottom: 3px;
}

.grid-2,
.stat-grid,
.dashboard-grid,
.query-grid,
.settings-grid,
.rules-layout {
  gap: var(--gap-page);
}

.stat-grid,
.grid-2,
.dashboard-grid,
.rules-layout {
  margin-bottom: var(--gap-page);
}

.stat-strip {
  gap: 26px;
  padding: 13px 20px;
  border-color: var(--card-border);
  border-radius: 11px;
  margin-bottom: var(--gap-page);
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.03);
}

.stat-strip strong {
  font-size: 19px;
  letter-spacing: -0.02em;
}

.stat-strip span {
  font-size: 11.5px;
}

/* ---------- Text fields ---------- */

.field {
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #3c5144;
  min-width: 0;
}

.field > span {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1.45;
}

.field > span em {
  font-size: 11px;
  font-weight: 500;
  color: #93a096;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.filter-bar select,
.search-field,
.secret-field {
  height: var(--control-height);
  min-height: var(--control-height);
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background-color: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select {
  width: 100%;
  padding: 0 11px;
}

.field select,
.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7c71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  cursor: pointer;
}

.field textarea,
textarea {
  width: 100%;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: #fff;
  padding: 10px 11px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:hover:not(:focus):not([readonly]),
.field select:hover:not(:focus),
.field textarea:hover:not(:focus) {
  border-color: var(--control-border-hover);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
textarea:focus,
.filter-bar select:focus {
  border-color: #5fa67d;
  box-shadow: var(--focus-ring);
}

.field input::placeholder,
.field textarea::placeholder,
textarea::placeholder,
.search-field input::placeholder {
  color: var(--control-placeholder);
  font-weight: 400;
}

.field input[readonly] {
  background: #f6f8f6;
  color: #5e7064;
  cursor: default;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f4f6f4;
  color: #98a49b;
  cursor: not-allowed;
}

.field input[type="checkbox"],
.check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}

.check {
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.check input {
  margin-top: 0;
}

/* Search field wrapper */

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  min-width: 220px;
  flex: 1;
  max-width: 460px;
  color: #7a8c7f;
}

.search-field:focus-within {
  border-color: #5fa67d;
  box-shadow: var(--focus-ring);
}

.search-field input {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.search-field input:focus {
  box-shadow: none;
}

/* Secret / API key field */

.secret-field {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px 0 10px;
}

.secret-field input {
  flex: 1;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12.5px;
}

.secret-field input:focus {
  box-shadow: none;
}

/* Filter bar */

.filter-bar {
  gap: 9px;
  margin-bottom: 18px;
}

.filter-bar select {
  width: auto;
  min-width: 132px;
  padding: 0 32px 0 11px;
}

.filter-bar .btn {
  height: var(--control-height);
}

/* Form layout */

.form-grid {
  gap: 14px;
}

.form-actions {
  gap: 9px;
}

.stack {
  gap: 14px;
}

.form-section {
  padding: 4px 0 18px;
  border-bottom: 1px solid #edf1ed;
  margin-bottom: 18px;
}

.form-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

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

.form-section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.form-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.mapping-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
}

.mapping-grid .field:last-child {
  grid-column: 1 / -1;
}

.mapping-grid textarea {
  min-height: 150px;
  font-family: var(--mono);
  font-size: 12px;
}

/* ---------- Buttons ---------- */

.btn {
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  gap: 7px;
  border-color: var(--control-border);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  border-color: var(--control-border-hover);
}

.btn:focus-visible,
.icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(11, 122, 62, 0.14);
}

.btn-primary {
  background: #0b7a3e;
  border-color: #0b7a3e;
  box-shadow: 0 1px 2px rgba(11, 122, 62, 0.16);
}

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

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-ghost:hover {
  background: #eef3ee;
  border-color: transparent;
}

.btn-danger-ghost {
  border-color: #eccac6;
  background: #fff;
}

.btn-danger-ghost:hover {
  background: #fdf1ef;
  border-color: #e7b8b2;
}

.btn-sm {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11.5px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

/* ---------- Tables ---------- */

.table {
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 8px 11px;
  color: #89968d;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.075em;
}

.table td {
  padding: 11px;
  border-bottom-color: #edf1ed;
}

.table-compact td {
  padding: 8px 11px;
}

.table tbody tr:hover {
  background: #f9fbf9;
}

/* ---------- Small surfaces ---------- */

.notice {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
}

.notice p {
  font-size: 11.5px;
}

.code-block {
  border-radius: 10px;
}

.empty-state {
  padding: 44px 22px;
}

.kicker {
  font-size: 9.5px;
  letter-spacing: 0.11em;
}

.hint {
  font-size: 11.5px;
  line-height: 1.55;
}

/* Login controls stay slightly larger for touch */

.login-card .field input {
  height: 44px;
  min-height: 44px;
  font-size: 14px;
}

.login-card .field {
  font-size: 12.5px;
  gap: 7px;
}

.login-card .btn-block {
  height: 44px;
  min-height: 44px;
}

@media (max-width: 900px) {
  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .mapping-grid .field:last-child {
    grid-column: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --card-pad: 16px;
  }

  .content {
    padding: 18px 16px 40px;
  }

  .stat-strip {
    flex-wrap: wrap;
    gap: 12px 20px;
  }

  .search-field {
    max-width: none;
    min-width: 0;
  }
}

.password-field input {
  padding-right: 56px;
}

.field input.is-invalid,
.login-card .field input.is-invalid {
  border-color: #d9534f;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.08);
}

.field input.is-invalid:focus,
.login-card .field input.is-invalid:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.detail-grid {
  align-items: start;
}

.mapping-grid textarea {
  height: 136px;
  min-height: 136px;
}

.account-note-cell {
  max-width: 180px;
  color: #607267;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
}

@media (max-width: 720px) {
  .account-identity-grid {
    grid-template-columns: 1fr;
  }
}

.cookie-dir {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 11px;
  color: #52675a;
}

.security-section {
  border-top: 1px solid #edf1ed;
  padding-top: 16px;
}

.security-section .form-section-head {
  margin-bottom: 12px;
}

.security-section .form-section-head h2 {
  font-size: 14px;
}

.security-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

@media (max-width: 620px) {
  .security-grid {
    grid-template-columns: 1fr;
  }
}

.security-pairs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.security-birthday {
  max-width: 320px;
}

/* ============================================================
   Buttons and select menus
   ============================================================ */

:root {
  --btn-height: 38px;
  --btn-radius: 9px;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d7165' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.btn {
  height: var(--btn-height);
  min-height: var(--btn-height);
  padding: 0 14px;
  border-radius: var(--btn-radius);
  font-size: 12.5px;
  font-weight: 650;
  gap: 7px;
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.04);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.btn:not(.btn-primary):not(.btn-ghost):not(.btn-danger-ghost) {
  background: linear-gradient(180deg, #ffffff, #fafcfa);
  border-color: #d5ded6;
  color: #293e31;
}

.btn:not(.btn-primary):not(.btn-ghost):not(.btn-danger-ghost):hover {
  background: #ffffff;
  border-color: #b6c7ba;
  box-shadow: 0 3px 8px rgba(19, 33, 26, 0.07);
}

.btn-primary {
  background: linear-gradient(180deg, #0f8b4a 0%, #096b37 100%);
  border-color: #096b37;
  color: #ffffff;
  box-shadow:
    0 2px 5px rgba(9, 107, 55, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #109b53 0%, #0a743c 100%);
  border-color: #0a743c;
  box-shadow:
    0 4px 10px rgba(9, 107, 55, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: linear-gradient(180deg, #0a743c, #075b2e);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.16);
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #566b5d;
}

.btn-ghost:hover {
  background: #eef4ef;
  border-color: transparent;
  color: #183d27;
  box-shadow: none;
}

.btn-danger-ghost {
  background: #fff;
  border-color: #eccac6;
  color: #b42318;
}

.btn-danger-ghost:hover {
  background: #fff5f3;
  border-color: #e3b3ad;
  box-shadow: 0 2px 6px rgba(180, 35, 24, 0.07);
}

.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(11, 122, 62, 0.16),
    0 1px 2px rgba(19, 33, 26, 0.06);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.48;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.btn-sm {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11.5px;
}

.btn-sm .ico {
  width: 14px;
  height: 14px;
}

.btn.icon-only,
.btn-sm.icon-only {
  width: 32px;
  min-width: 32px;
  padding: 0;
  justify-content: center;
}

.btn-sm.icon-only {
  width: 30px;
  min-width: 30px;
}

.row-actions {
  gap: 5px;
}

.account-table .row-actions {
  flex-wrap: nowrap;
}

/* Select menus */

.field select,
.filter-bar select {
  height: 40px;
  min-height: 40px;
  border-color: #d5ded6;
  border-radius: var(--btn-radius);
  padding: 0 36px 0 11px;
  font-size: 13px;
  font-weight: 500;
  color: #263b2e;
  background-color: #ffffff;
  background-image: var(--select-arrow), linear-gradient(180deg, #ffffff, #fbfcfb);
  background-repeat: no-repeat;
  background-position: right 11px center, 0 0;
  background-size: 14px 14px, 100% 100%;
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.03);
  cursor: pointer;
}

.field select:hover,
.filter-bar select:hover {
  border-color: #b6c7ba;
  background-image: var(--select-arrow), linear-gradient(180deg, #ffffff, #f8fbf8);
}

.field select:focus,
.filter-bar select:focus {
  border-color: #5fa67d;
  box-shadow: var(--focus-ring);
}

.field select:disabled,
.filter-bar select:disabled {
  color: #97a39a;
  background-color: #f4f6f4;
  cursor: not-allowed;
}

.field select option,
.filter-bar select option {
  color: #263b2e;
  background: #ffffff;
  font-size: 13px;
}

.login-card .btn-block {
  height: 44px;
  min-height: 44px;
}

.account-table .btn-ghost.icon-only {
  background: #f7faf7;
  border-color: #edf2ed;
  color: #4d6355;
}

.account-table .btn-ghost.icon-only:hover {
  background: #eaf4ed;
  border-color: #d4e4d8;
  color: #0b6b39;
}

.account-table .btn-danger-ghost.icon-only {
  background: #fffafa;
  border-color: #f1d7d3;
}

/* ============================================================
   Birthday date picker
   ============================================================ */

.field input.flatpickr-input:not([type="hidden"]),
.field input[data-datepicker]:not([type="hidden"]) {
  padding-right: 38px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235d7165' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 18px 18px;
  cursor: pointer;
}

.flatpickr-calendar {
  width: 324px;
  padding: 8px;
  border: 1px solid #dfe7e1;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 20px 48px rgba(16, 45, 28, 0.16),
    0 3px 10px rgba(16, 45, 28, 0.06);
  font-family: var(--font);
  font-size: 13px;
  color: #263b2e;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  border-bottom-color: #ffffff;
}

.flatpickr-calendar.arrowBottom::before,
.flatpickr-calendar.arrowBottom::after {
  border-top-color: #ffffff;
}

.flatpickr-months {
  height: 42px;
}

.flatpickr-months .flatpickr-month {
  height: 42px;
  color: #1d3325;
}

.flatpickr-current-month {
  padding-top: 9px;
  font-size: 14px;
  font-weight: 650;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  font-size: 14px;
  font-weight: 650;
  color: #1d3325;
  padding: 2px 4px;
  border-radius: 6px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background: #eef6f0;
}

.flatpickr-current-month input.cur-year {
  font-size: 14px;
  font-weight: 650;
  color: #1d3325;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  top: 7px;
  padding: 6px;
  border-radius: 7px;
  color: #5b7163;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: #eef6f0;
  color: #0b7a3e;
}

.flatpickr-weekdays {
  height: 30px;
  margin-top: 2px;
}

span.flatpickr-weekday {
  color: #8b9b90;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.flatpickr-days,
.dayContainer {
  width: 308px;
  min-width: 308px;
  max-width: 308px;
}

.flatpickr-day {
  flex-basis: 40px;
  max-width: 40px;
  height: 39px;
  line-height: 37px;
  margin: 1px 2px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #334a3c;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
  background: #eaf6ef;
  border-color: #eaf6ef;
  color: #075c31;
}

.flatpickr-day.today {
  border-color: #8fc5a4;
  color: #0b6b39;
  font-weight: 650;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected:focus {
  background: #0b7a3e;
  border-color: #0b7a3e;
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 3px 8px rgba(11, 122, 62, 0.22);
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #c1ccc4;
}

.flatpickr-day.flatpickr-disabled {
  color: #d7dfd9;
}

.flatpickr-day.flatpickr-disabled:hover {
  background: transparent;
  color: #d7dfd9;
}

.flatpickr-calendar .numInputWrapper span {
  border-radius: 4px;
}

.flatpickr-calendar .numInputWrapper span:hover {
  background: #eaf6ef;
}

@media (max-width: 420px) {
  .flatpickr-calendar {
    width: min(324px, calc(100vw - 24px));
  }

  .flatpickr-days,
  .dayContainer {
    width: min(308px, calc(100vw - 40px));
    min-width: min(308px, calc(100vw - 40px));
    max-width: min(308px, calc(100vw - 40px));
  }
}

/* Account security details dialog */

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid #d6e4f8;
  border-radius: 999px;
  background: #eef5ff;
  color: #175cd3;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.security-badge .ico {
  opacity: 0.7;
}

.security-badge:hover {
  background: #e3efff;
  border-color: #bcd5f5;
  box-shadow: 0 2px 6px rgba(23, 92, 211, 0.1);
}

.security-dialog {
  width: min(580px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  border: 1px solid #e1e9e3;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 40, 25, 0.24);
  color: #263b2e;
}

.security-dialog::backdrop {
  background: rgba(14, 32, 21, 0.46);
  backdrop-filter: blur(2px);
}

.security-dialog[open] {
  animation: security-dialog-in 0.16s ease-out;
}

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

.security-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 15px;
  border-bottom: 1px solid #edf1ed;
}

.security-dialog-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.security-dialog-head p {
  margin: 4px 0 0;
  font-size: 12px;
}

.security-dialog-body {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 6px 20px 20px;
}

.security-dialog-meta {
  padding: 14px 0 4px;
}

.security-dialog-birthday {
  color: #4f6457;
  font-size: 12.5px;
  font-weight: 600;
}

.security-answer-list {
  display: flex;
  flex-direction: column;
}

.security-answer-item {
  padding: 13px 0 12px;
  border-bottom: 1px solid #edf1ed;
}

.security-answer-item:last-child {
  border-bottom: 0;
}

.security-question {
  margin-bottom: 6px;
  color: #687b6f;
  font-size: 11.5px;
  font-weight: 600;
}

.security-answer {
  padding: 9px 11px;
  border: 1px solid #e5ece6;
  border-radius: 8px;
  background: #f8fbf8;
  color: #203a2a;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .security-dialog-body {
    padding: 4px 16px 16px;
  }
  .security-dialog-head {
    padding: 16px 16px 13px;
  }
}

/* ============================================================
   Custom select menus
   ============================================================ */

.ui-select {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
}

.field .ui-select,
.field .ui-select-trigger {
  width: 100%;
}

.filter-bar .ui-select {
  min-width: 132px;
}

.filter-bar .ui-select-trigger {
  min-width: 132px;
  width: auto;
}

.ui-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}

.ui-select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  min-height: 40px;
  padding: 0 36px 0 11px;
  border: 1px solid #d5ded6;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #fbfcfb);
  color: #263b2e;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ui-select-trigger:hover {
  border-color: #b6c7ba;
  background: linear-gradient(180deg, #ffffff, #f8fbf8);
}

.ui-select.is-open .ui-select-trigger,
.ui-select-trigger:focus-visible {
  outline: none;
  border-color: #5fa67d;
  box-shadow: 0 0 0 3px rgba(11, 122, 62, 0.1);
}

.ui-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.5px solid #5d7165;
  border-bottom: 1.5px solid #5d7165;
  transform: rotate(45deg);
  transition: transform 0.15s ease, margin-top 0.15s ease;
}

.ui-select.is-open .ui-select-arrow {
  transform: rotate(-135deg);
  margin-top: -1px;
}

.ui-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  min-width: 100%;
  width: max-content;
  max-width: min(380px, calc(100vw - 24px));
  max-height: 300px;
  overflow: auto;
  padding: 5px;
  border: 1px solid #dfe7e1;
  border-radius: 11px;
  background: #ffffff;
  box-shadow:
    0 18px 45px rgba(16, 45, 28, 0.16),
    0 3px 10px rgba(16, 45, 28, 0.05);
  animation: ui-select-in 0.12s ease-out;
}

.ui-select-menu[hidden] {
  display: none;
}

.ui-select-menu.is-up {
  top: auto;
  bottom: calc(100% + 6px);
}

@keyframes ui-select-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ui-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #3c5144;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.ui-select-option:hover,
.ui-select-option.is-active {
  background: #f1f8f3;
  color: #183d27;
}

.ui-select-option.is-selected {
  background: #eaf7ef;
  color: #075c31;
  font-weight: 650;
}

.ui-select-option.is-selected::after {
  content: "✓";
  margin-left: auto;
  color: #0b7a3e;
  font-size: 12px;
  font-weight: 700;
}

.ui-select-option:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ui-select-option-label {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .filter-bar .ui-select,
  .filter-bar .ui-select-trigger {
    width: 100%;
    min-width: 0;
  }

  .filter-bar .ui-select-menu {
    width: 100%;
    max-width: calc(100vw - 24px);
  }
}

/* API key secret field */

.field .secret-field,
.secret-field {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 11px;
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(19, 33, 26, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field .secret-field:focus-within,
.secret-field:focus-within {
  border-color: #5fa67d;
  box-shadow: var(--focus-ring);
}

.field .secret-field input,
.secret-field input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.015em;
}

.field .secret-field input:focus,
.secret-field input:focus {
  border: 0;
  box-shadow: none;
}

.field .secret-field input[readonly],
.secret-field input[readonly] {
  background: transparent;
  color: #3d5245;
  cursor: text;
}

.secret-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  padding-left: 5px;
  border-left: 1px solid #edf1ed;
}

.secret-action {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: #607467;
}

.secret-action:hover {
  background: #eef6f0;
  color: #0b6b39;
}

.secret-action.is-active {
  background: #e9f6ee;
  color: #0b6b39;
}

/* The generic .field input rule is more specific than .secret-field input.
   Override it explicitly so the key field has only the outer control border. */
.field .secret-field input:not([type="checkbox"]):not([type="radio"]) {
  flex: 1;
  width: auto;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.015em;
}

.field .secret-field input:not([type="checkbox"]):not([type="radio"]):focus {
  border: 0 !important;
  box-shadow: none !important;
}

.field .secret-field input[readonly]:not([type="checkbox"]):not([type="radio"]) {
  background: transparent !important;
  color: #3d5245;
  cursor: text;
}

/* Flatpickr year stepper */

.flatpickr-current-month {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.flatpickr-current-month .cur-month {
  margin-right: 0;
  font-size: 14px;
  font-weight: 650;
  color: #1d3325;
}

.flatpickr-current-month .numInputWrapper {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  width: auto;
  height: 30px;
  padding: 0 2px;
  border: 1px solid #e4ece6;
  border-radius: 8px;
  background: #f5f9f6;
}

.flatpickr-current-month input.cur-year {
  width: 50px;
  height: 26px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #1d3325;
  font-size: 14px;
  font-weight: 650;
  text-align: center;
  cursor: default;
  -moz-appearance: textfield;
  appearance: textfield;
}

.flatpickr-current-month input.cur-year::-webkit-inner-spin-button,
.flatpickr-current-month input.cur-year::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.flatpickr-current-month .numInputWrapper span {
  display: none;
}

.flatpickr-year-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #637a6a;
  font: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.flatpickr-year-step:hover,
.flatpickr-year-step:focus-visible {
  background: #e3f1e7;
  color: #0b6b39;
  outline: none;
}

/* Keep the mobile shell single-column after the desktop sidebar width override */
@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .main {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
}

.records-table {
  min-width: 900px;
}

.logs-table {
  min-width: 1040px;
}

.account-table {
  min-width: 860px;
}

.btn-toggle-stop {
  background: #fff8ed;
  border-color: #efdcc1;
  color: #a35a00;
}

.btn-toggle-stop:hover {
  background: #fff1dc;
  border-color: #e6c79e;
  color: #8a4a00;
}

.btn.btn-toggle-stop {
  background: #fff8ed !important;
  border-color: #efdcc1 !important;
  color: #a35a00 !important;
  box-shadow: none;
}

.btn.btn-toggle-stop:hover {
  background: #fff1dc !important;
  border-color: #e6c79e !important;
  color: #8a4a00 !important;
}

.login-duration-cell {
  color: #0b6b39;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.login-duration-cell.is-empty {
  color: var(--muted);
  font-weight: 400;
}

.account-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.account-status-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #66766b;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.account-status-item.is-sub {
  color: #8a978f;
  font-size: 10.5px;
  font-weight: 500;
}

.account-status-item.is-ok {
  color: #0b6b39;
}

.account-status-item.is-bad {
  color: #b42318;
}

.account-status-item.is-warn {
  color: #a15c00;
}

.account-status-item.is-off {
  color: #7e8c83;
}

.account-status-item.is-neutral {
  color: #8a978f;
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(102, 118, 107, 0.12);
}

.account-status-item.is-sub .status-dot {
  width: 5px;
  height: 5px;
  flex-basis: 5px;
  box-shadow: none;
  opacity: 0.85;
}

.account-status-item.is-ok .status-dot {
  box-shadow: 0 0 0 2px rgba(11, 107, 57, 0.12);
}

.account-status-item.is-bad .status-dot {
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.1);
}

.account-status-item.is-warn .status-dot {
  box-shadow: 0 0 0 2px rgba(161, 92, 0, 0.11);
}

.btn-primary:disabled {
  background: #f1f5f2 !important;
  border-color: #e1e8e3 !important;
  color: #96a39a !important;
  box-shadow: none !important;
  opacity: 1;
}

.login-record {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 128px;
}

.login-record-main {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.login-record-time {
  color: #203a2a;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.login-record-time.is-empty {
  color: var(--muted);
  font-weight: 400;
}

.login-record-duration {
  color: #0b6b39;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.login-record-duration.is-empty {
  color: var(--muted);
  font-weight: 400;
}

.login-record-sub {
  color: #8a978f;
  font-size: 10.5px;
  white-space: nowrap;
}

.account-table .account-id-cell {
  white-space: nowrap;
  font-size: 11px;
}

.account-table .row-actions {
  gap: 3px;
}

.region-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 8px;
}

.region-map-list {
  max-height: 250px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid #e8eee9;
  border-radius: 9px;
}

.region-map-list .table {
  margin: 0;
}

.region-map-list .table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faf7;
}

@media (max-width: 620px) {
  .region-form-grid {
    grid-template-columns: 1fr;
  }
}

.query-default-store {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid #e6ede7;
  border-radius: 8px;
  background: #f8fbf8;
  color: #5e6f63;
  font-size: 11.5px;
}

.query-default-store strong {
  color: #263b2e;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.query-default-store .hint {
  margin: 0;
  font-size: 10.5px;
}

.query-serial-error {
  margin: 6px 0 0;
  color: #b42318;
  font-size: 11.5px;
  line-height: 1.45;
}

#query-serial {
  text-transform: uppercase;
}

#query-serial::placeholder {
  text-transform: none;
}

.query-mode-switch {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 14px;
  padding: 3px;
  border: 1px solid #e1e9e3;
  border-radius: 9px;
  background: #f5f9f6;
}

.query-mode-btn {
  padding: 6px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7c71;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.query-mode-btn.is-active {
  background: #ffffff;
  color: #0b6b39;
  box-shadow: 0 1px 3px rgba(20, 50, 30, 0.1);
}

#query-batch {
  min-height: 132px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.batch-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.batch-result-head h2 {
  margin: 3px 0 4px;
}

.batch-progress {
  margin: 0;
  color: #687b6f;
  font-size: 12px;
}

.batch-table {
  min-width: 850px;
}

.batch-table td {
  vertical-align: middle;
}

.batch-table .batch-device {
  min-width: 130px;
  font-weight: 600;
}

.batch-table .batch-serial {
  font-family: var(--mono);
  font-weight: 650;
  white-space: nowrap;
}

.batch-error-text {
  display: block;
  max-width: 190px;
  margin-top: 3px;
  color: #8b2b22;
  font-size: 10.5px;
  white-space: normal;
}

.batch-status-wait {
  color: #8a978f;
}

@media (max-width: 620px) {
  .batch-result-head {
    flex-direction: column;
  }
}

.batch-table {
  min-width: 0;
}

.batch-table .batch-device strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}

.batch-parse {
  display: block;
  margin-top: 3px;
  color: #75867a;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
}

.batch-table td:nth-child(3) {
  min-width: 180px;
}

.batch-concurrency {
  max-width: 220px;
}

.batch-part {
  margin-top: 5px;
  padding: 5px 7px;
  border: 1px solid #e5ece6;
  border-radius: 6px;
  background: #f7faf7;
  white-space: normal;
}

.batch-part-label {
  display: block;
  margin-bottom: 2px;
  color: #8a978f;
  font-size: 9.5px;
}

.batch-part code {
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b5f52;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.batch-rule-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 10.5px;
}

.batch-rule-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.batch-rule-links .batch-rule-link {
  margin-top: 0;
}

.account-query-count {
  margin-top: 3px;
  color: #7e8c83;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gap-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 7px;
  border: 1px solid #f0d7b4;
  border-radius: 999px;
  background: #fff8ed;
  color: #965400;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.gap-badge:hover {
  background: #fff1dc;
  border-color: #e6c79e;
}

.gap-section {
  border-color: #f0e1c8 !important;
  background: #fffdf8;
}

.gap-samples {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.gap-sample {
  padding: 8px 10px;
  border: 1px solid #eee3ce;
  border-radius: 8px;
  background: #ffffff;
}

.gap-sample-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 11.5px;
}

.gap-part {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5a4b36;
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.gap-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.gap-field {
  padding: 2px 6px;
  border-radius: 5px;
  background: #fff7e8;
  color: #8a5a12;
  font-size: 10px;
}

.gap-field b {
  margin-left: 3px;
  font-family: var(--mono);
}
