:root {
  --ink: #0c2340;
  --ink-soft: #1d3b5c;
  --teal: #0f766e;
  --teal-deep: #0a5c56;
  --sand: #e8eef4;
  --paper: #f4f7fa;
  --line: rgba(12, 35, 64, 0.12);
  --ok: #1f7a4c;
  --warn: #9a6700;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(12, 35, 64, 0.12);
  --radius: 18px;
  --font-display: "Sora", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Sora", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(12, 35, 64, 0.16), transparent 50%),
    linear-gradient(180deg, #dfe8f1 0%, var(--paper) 45%, #eef3f7 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(12, 35, 64, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 35, 64, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 85%);
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- 登录注册 ---- */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(15, 118, 110, 0.22), transparent 55%),
    radial-gradient(800px 480px at 90% 0%, rgba(12, 35, 64, 0.2), transparent 50%),
    linear-gradient(180deg, #dfe8f1 0%, var(--paper) 55%, #eef3f7 100%);
}

.auth-card {
  width: min(400px, 100%);
  aspect-ratio: 1 / 1;
  padding: 32px 30px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.auth-card .auth-brand {
  margin-bottom: 24px;
}

.auth-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.auth-brand .brand-text,
.brand-text {
  min-width: 0;
  flex: 1;
}

.auth-brand h1 {
  margin: 2px 0 0;
  font-size: 20px;
  line-height: 1.35;
  font-family: var(--font-display);
}

.auth-page-title {
  margin: 0 0 14px;
  font-size: 20px;
  font-family: var(--font-display);
  color: var(--ink);
}

.auth-switch {
  margin: 16px 0 0;
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  color: var(--teal-deep);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.auth-form .btn {
  margin-top: 4px;
  width: 100%;
  border-radius: 8px;
}

#user-pill {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar {
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 14px;
  background:
    linear-gradient(145deg, var(--teal) 0%, var(--ink) 100%);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.35);
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px solid rgba(255,255,255,0.75);
  border-radius: 8px;
  transform: rotate(12deg);
}

.brand-kicker {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  font-family: var(--font-display);
}

.brand h1 {
  margin: 2px 0 0;
  font-size: 16px;
  line-height: 1.35;
  font-family: var(--font-display);
}

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

.agent-item {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.72);
  border-radius: 14px;
  padding: 12px 12px 10px;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.agent-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.35);
}

.agent-item.is-active {
  border-color: rgba(15, 118, 110, 0.55);
  box-shadow: var(--shadow);
  background: #fff;
}

.agent-item.is-reserved {
  opacity: 0.86;
}

.agent-item strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.agent-item small {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  opacity: 0.8;
  font-size: 12px;
  line-height: 1.4;
}

.agent-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-display);
}

.agent-status.live {
  color: var(--ok);
  background: rgba(31, 122, 76, 0.12);
}

.agent-status.soon {
  color: var(--warn);
  background: rgba(154, 103, 0, 0.12);
}

.sidebar-foot {
  margin-top: auto;
  font-size: 13px;
  color: var(--ink-soft);
}

.sidebar-foot a {
  color: var(--teal-deep);
}

.workspace {
  padding: 28px 32px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 16px;
}

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

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  font-family: var(--font-display);
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 30px;
  font-family: var(--font-display);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--line);
  font-size: 13px;
}

.pill.ok { color: var(--ok); }
.pill.bad { color: var(--danger); }
.pill.warn { color: #b45309; }

.kb-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
}

.kb-doc-list li.kb-doc-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.7);
}

.kb-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.kb-check-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}

.kb-doc-check {
  flex-shrink: 0;
  margin-top: 4px;
  width: 16px;
  height: 16px;
}

.kb-doc-main {
  min-width: 0;
  flex: 1;
}

.kb-doc-list li.kb-doc-item strong {
  display: block;
}

.kb-doc-list li.kb-doc-item small {
  display: block;
  margin-top: 4px;
  color: rgba(12, 35, 64, 0.68);
}

.kb-doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.btn.tiny {
  padding: 6px 10px;
  font-size: 12px;
}

.panel { display: none; animation: rise .35s ease; }
.panel.is-visible { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.grid-split {
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  align-items: start;
}

.mt { margin-top: 18px; }

.card {
  background: rgba(255,255,255,0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-family: var(--font-display);
}

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

.card-head h3 { margin: 0; }

.muted { color: rgba(12, 35, 64, 0.68); font-size: 14px; }

.dropzone {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
  padding: 22px 16px;
  border: 1.5px dashed rgba(15, 118, 110, 0.45);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255,255,255,0.4));
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.dropzone.is-drag {
  border-color: var(--teal);
  background: rgba(15, 118, 110, 0.1);
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

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

.form-grid-compact {
  margin-top: 10px;
  gap: 10px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.form-grid .full { grid-column: 1 / -1; }
.form-grid .is-hidden { display: none; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.actions-split {
  justify-content: space-between;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--teal) 0%, var(--ink) 120%);
}

.btn.ghost {
  color: var(--ink);
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--line);
}

.btn.danger-ghost {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.28);
}

.btn.danger {
  color: #fff;
  background: linear-gradient(135deg, #b42318 0%, #7a1710 100%);
}

.btn.small { padding: 7px 12px; font-size: 13px; }

.role-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.08);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.users-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

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

.users-list-card .users-list,
.users-list {
  max-height: min(68vh, 640px);
}

.list-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 4px 0 12px;
}

.list-toolbar input {
  flex: 1;
  min-width: 0;
}

.list-toolbar .btn {
  flex-shrink: 0;
}

.empty-state {
  margin-top: 8px;
  padding: 28px 18px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(12, 35, 64, 0.03);
  color: rgba(12, 35, 64, 0.58);
  font-size: 14px;
  text-align: center;
  line-height: 1.6;
}

.multi-check {
  position: relative;
  width: 100%;
}

.multi-check-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.multi-check-trigger:hover {
  border-color: rgba(15, 118, 110, 0.45);
}

.multi-check-caret::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--ink-soft);
}

.multi-check-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.multi-check-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.multi-check-options {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multi-check-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}

.multi-check-option:hover {
  background: rgba(15, 118, 110, 0.08);
}

.multi-check-option input {
  width: auto;
  margin-top: 2px;
  flex-shrink: 0;
}

.multi-check-option .opt-meta {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-soft);
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding: 0.35rem 0;
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

.dept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}

.dept-chips:empty {
  display: none;
}

.dept-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: #0f4c46;
  font-size: 12px;
  line-height: 1.4;
}

.dept-chip small {
  opacity: 0.7;
  font-size: 11px;
}

.uid-howto {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(12, 35, 64, 0.02);
  font-size: 13px;
  line-height: 1.55;
}

.uid-howto summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.uid-howto ol {
  margin: 8px 0 0;
  padding-left: 1.2em;
}

.uid-howto code {
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(12, 35, 64, 0.06);
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.dept-map-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  margin-top: 8px;
}

.dept-map-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(140px, 1.2fr) minmax(140px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.7);
}

.dept-map-row.is-search-hit {
  outline: 2px solid var(--teal);
  background: rgba(15, 118, 110, 0.08);
}

.dept-map-row[hidden],
.dept-map-row.is-search-hidden {
  display: none !important;
}

.dept-map-row strong {
  font-size: 13px;
  line-height: 1.35;
}

.dept-map-row small {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  margin-top: 2px;
}

.dept-map-row input {
  margin: 0;
}

.dept-map-row .pill {
  padding: 4px 8px;
  font-size: 11px;
}

.muted-pill {
  color: var(--ink-soft);
  font-weight: 500;
  max-width: min(420px, 55vw);
  white-space: normal;
  line-height: 1.35;
  border-radius: 12px;
}

.toast {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  background: rgba(31, 122, 76, 0.1);
  color: var(--ok);
  white-space: pre-wrap;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
}

.toast.error {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.push-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 20, 30, 0.45);
}

.push-dialog[hidden] {
  display: none;
}

.push-dialog-card {
  width: min(440px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
}

.push-dialog-card h3 {
  margin: 0;
  font-size: 19px;
  font-family: var(--font-display);
}

.push-dialog-message {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.push-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

body.push-dialog-open {
  overflow: hidden;
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 0;
}

.kv div {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(12, 35, 64, 0.04);
}

.kv dt {
  margin: 0;
  font-size: 12px;
  color: rgba(12, 35, 64, 0.6);
}

.kv dd {
  margin: 4px 0 0;
  font-weight: 600;
  word-break: break-all;
}

.topic-tag-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tags:empty {
  display: none;
}

.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.3;
}

.topic-tag span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-tag-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #2563eb;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.topic-tag-remove:hover {
  background: rgba(37, 99, 235, 0.15);
}

.topic-tag-field {
  display: block;
}

.topic-tag-input {
  width: 100%;
  margin: 0;
}

.preview {
  margin: 0;
  min-height: 360px;
  max-height: 560px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 16px;
  border-radius: 14px;
  background: #0c2340;
  color: #e8eef4;
  font-size: 13px;
  line-height: 1.7;
  font-family: "Noto Sans SC", ui-monospace, monospace;
  text-indent: 0;
}

textarea.report-editor {
  width: 100%;
  border: 1px solid var(--line);
  resize: vertical;
}

.report-candidates {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
}

.report-candidates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
}

.report-candidate-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}

.report-candidate-item:hover {
  border-color: var(--line);
  background: rgba(15, 118, 110, 0.06);
}

.report-candidate-item strong {
  display: block;
  font-size: 13px;
}

.report-candidate-item small {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 2px;
  line-height: 1.4;
}

.report-candidate-item .cand-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--teal-deep);
  font-style: normal;
}

.report-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
}

.report-list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.7);
}

.report-list li.report-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-list li.is-selected {
  border-color: rgba(15, 118, 110, 0.55);
  background: rgba(15, 118, 110, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.2);
}

.report-list button {
  all: unset;
  cursor: pointer;
  display: block;
  width: 100%;
}

.report-list button.report-item-main {
  flex: 1;
  width: auto;
  min-width: 0;
}

.report-list button.btn-report-delete {
  all: unset;
  box-sizing: border-box;
  flex-shrink: 0;
  width: auto;
  border: 1px solid rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
}

.report-list button.btn-report-delete:hover {
  background: rgba(180, 35, 24, 0.14);
}

.report-list button.btn-report-delete:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.report-list strong {
  display: block;
  font-size: 14px;
}

.report-list span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(12, 35, 64, 0.65);
}

.reserved-hero {
  max-width: 720px;
  position: relative;
  overflow: hidden;
}

.reserved-hero::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -60px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15,118,110,0.2), transparent 70%);
}

.reserved-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-display);
  color: var(--warn);
  background: rgba(154, 103, 0, 0.12);
}

.roadmap {
  margin: 16px 0 22px;
  padding-left: 18px;
  color: var(--ink-soft);
}

.roadmap li { margin: 8px 0; }

.dimension-grid {
  display: grid;
  gap: 10px;
}

.dimension-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
}

.dimension-card.status-warn {
  border-color: rgba(154, 103, 0, 0.35);
  background: rgba(154, 103, 0, 0.06);
}

.dimension-card.status-danger {
  border-color: rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.06);
}

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

.dimension-head span {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.dimension-head em {
  font-style: normal;
  margin-left: 6px;
  color: var(--teal-deep);
}

.dimension-card p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.stats-strip .stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.7);
}

.stats-strip .stat strong {
  display: block;
  font-size: 18px;
  font-family: var(--font-display);
}

.stats-strip .stat span {
  font-size: 12px;
  color: var(--ink-soft);
}

.suggestions h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.suggestions ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
}

.suggestions li { margin: 6px 0; }

.review-split {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.review-split-list,
.review-split-detail {
  min-width: 0;
}

.review-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 72vh;
  overflow: auto;
}

.review-ticket-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.review-ticket-btn:hover,
.review-ticket-btn.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.08);
}

.review-ticket-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}

.review-ticket-meta strong {
  font-family: var(--font-display);
}

.review-ticket-meta span {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.review-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 8px;
  font-size: 13px;
}

.yn-yes { color: var(--ok); }
.yn-no { color: var(--danger); }

.review-score-line {
  margin: 6px 0;
  font-size: 13px;
}

.review-score-line p,
.review-score-summary {
  margin: 4px 0 0;
  color: var(--ink-soft);
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

.review-score-breakdown {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal;
}

.review-score-how {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--ink);
}

.review-score-breakdown ul {
  margin: 0;
  padding-left: 16px;
}

.review-score-breakdown li {
  margin: 3px 0;
}

.review-rubric {
  margin-top: 4px;
}

.review-rubric summary {
  cursor: pointer;
  color: var(--teal-deep);
  font-size: 12px;
}

.review-rubric pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
}

#review-ticket-detail.preview {
  word-break: normal;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  min-width: 0;
  width: 100%;
}

.review-detail-body {
  margin: 0;
  min-height: 360px;
  max-height: 72vh;
  overflow: auto;
  padding: 16px 18px;
  border-radius: 14px;
  background: #0c2340;
  color: #e8eef4;
  font-size: 14px;
  line-height: 1.75;
  font-family: "Noto Sans SC", sans-serif;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  min-width: 0;
  width: 100%;
}

.review-detail-body p {
  margin: 0 0 10px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.75;
}

.review-detail-body p:last-child {
  margin-bottom: 0;
}

.review-detail-body .detail-section-title {
  margin: 14px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  font-family: var(--font-display);
}

.review-detail-body .detail-section-title:first-child {
  margin-top: 0;
}

.review-detail-body .detail-sub {
  padding-left: 12px;
  color: #d7e3ef;
}

textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.is-hidden { display: none !important; }

/* ---- 主控对话 ---- */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.chat-card {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
}

.chat-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-thread {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 16px;
  margin: 8px 0 12px;
  max-height: calc(100vh - 280px);
  min-height: 360px;
}

.chat-bubble {
  max-width: min(720px, 92%);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  animation: chat-in .25s ease;
}

.chat-bubble.user {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(15, 118, 110, 0.12), rgba(255,255,255,0.92));
  border-color: rgba(15, 118, 110, 0.28);
}

.chat-bubble.assistant {
  align-self: flex-start;
}

.chat-bubble.pending {
  opacity: 0.72;
}

.chat-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--teal-deep);
  margin-bottom: 4px;
  font-family: var(--font-display);
}

.chat-content {
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
}

.chat-artifacts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.chat-artifact {
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.chat-artifact.type-error {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(180, 35, 24, 0.06);
}

.chat-artifact-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-artifact-head strong {
  font-size: 14px;
  line-height: 1.35;
}

.chat-artifact-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--teal-deep);
  background: rgba(15, 118, 110, 0.12);
  font-family: var(--font-display);
}

.chat-artifact.type-error .chat-artifact-badge {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.12);
}

.chat-artifact-summary {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.chat-artifact-preview {
  margin-top: 8px;
}

.chat-artifact-preview summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--teal-deep);
  font-weight: 600;
}

.chat-artifact-preview pre {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px;
  border-radius: 10px;
  background: rgba(12, 35, 64, 0.04);
  border: 1px solid var(--line);
  font-family: var(--font-body);
}

.chat-artifact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chat-artifact-actions .btn {
  text-decoration: none;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.chat-composer textarea {
  margin-top: 0;
  min-height: 56px;
}

.chat-side .chat-side-title {
  margin: 18px 0 8px;
  font-size: 14px;
}

.chat-side .roadmap small {
  color: var(--ink-soft);
  word-break: break-all;
}

.chat-side .cite-snip {
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}

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

.dispatch-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
  display: grid;
  place-items: start center;
}

.dispatch-card {
  width: min(1680px, 90%);
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 32px 26px;
}

.dispatch-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.dispatch-card .auth-brand {
  margin-bottom: 0;
}

.dispatch-nav {
  margin: 0;
  flex-shrink: 0;
}

.dispatch-nav .btn {
  text-decoration: none;
}

.dispatch-page .dispatch-nav .btn {
  padding: 10px 18px;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(5, 43, 48, 0.16);
}

.dispatch-setup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0;
  border: none;
  background: transparent;
}

.dispatch-setup > label,
.dispatch-setup > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.dispatch-panel {
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.dispatch-filter {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.dispatch-filter label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.dl-batch-picker {
  position: relative;
}

.dl-batch-search {
  max-width: none;
  width: 100%;
}

.dl-batch-panel {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dl-batch-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.dl-batch-option:hover,
.dl-batch-option.is-on {
  background: rgba(15, 118, 110, 0.1);
}

.dl-batch-option small {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 12px;
}

.dl-log-row {
  cursor: pointer;
}

.dl-log-row.is-on {
  outline: 2px solid var(--teal);
  background: rgba(15, 118, 110, 0.08);
}

.dl-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin-bottom: 14px;
}

.dl-detail-meta div {
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.dl-detail-meta strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dl-detail-wide {
  grid-column: 1 / -1;
}

.dispatch-main-actions {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dispatch-page .btn,
.dispatch-page a.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #0a6b63 0%, #052b30 100%);
  box-shadow: 0 8px 18px rgba(5, 43, 48, 0.22);
}

.dispatch-page .btn.ghost,
.dispatch-page .btn.primary,
.dispatch-page .btn.small {
  color: #fff;
  background: linear-gradient(90deg, #0a6b63 0%, #052b30 100%);
  border: none;
}

.dispatch-page .btn.danger {
  color: #fff;
  background: linear-gradient(90deg, #d32f2f 0%, #8b1515 100%);
  box-shadow: 0 4px 10px rgba(139, 21, 21, 0.28);
}

.dispatch-page .btn.small {
  padding: 8px 16px;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(5, 43, 48, 0.18);
}

.dispatch-page .dept-map-row .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #0a6b63 0%, #052b30 100%);
  border: none;
  box-shadow: 0 4px 10px rgba(5, 43, 48, 0.18);
}

.dispatch-page .dept-map-row .pill.ok {
  color: #fff;
}

.dispatch-page .btn-dept-remove {
  min-width: 88px;
  background: linear-gradient(90deg, #d32f2f 0%, #8b1515 100%) !important;
  box-shadow: 0 4px 10px rgba(139, 21, 21, 0.28);
}

.dispatch-file-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 0;
}

.dispatch-page .dispatch-channel-pills {
  gap: 10px;
  margin-top: 0;
}

.dispatch-page .dispatch-channel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #0a6b63 0%, #052b30 100%);
  border: none;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(5, 43, 48, 0.18);
  cursor: pointer;
  opacity: 0.42;
}

.dispatch-page .dispatch-channel-btn:has(input:checked) {
  opacity: 1;
}

.dispatch-page .dispatch-channel-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.op-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.op-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.op-ok {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1f8a70;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.op-ok[hidden] {
  display: none !important;
}

.dispatch-dept-block {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dispatch-dept-block h3 {
  margin: 0;
  font-size: 16px;
}

.dispatch-dept-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.contact-search {
  flex: 1;
  min-width: 160px;
  max-width: 380px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
}

.dispatch-card .dept-map-list {
  max-height: 320px;
  margin-top: 12px;
  gap: 10px;
}

.dispatch-card .dl-list-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 180px;
}

.dispatch-card .dl-list-panel #dl-list {
  flex: 1;
  max-height: none;
  overflow: auto;
}

.dispatch-card .dl-detail-panel {
  flex-shrink: 0;
}

.dispatch-card:has(#contact-list) {
  height: calc(100vh - 48px);
  height: calc(100dvh - 48px);
  min-height: 640px;
}

.dispatch-card:has(#contact-list) .dispatch-dept-block {
  flex: 1;
  min-height: 0;
}

.dispatch-card:has(#contact-list) #contact-list.dept-map-list {
  flex: 1;
  max-height: none;
  min-height: 0;
  overflow: auto;
}

.dispatch-page .dept-map-row {
  grid-template-columns: minmax(160px, 1.2fr) minmax(140px, 1.1fr) minmax(140px, 1.1fr) auto auto;
}

.dispatch-page #contact-list .dept-map-row {
  grid-template-columns: auto minmax(160px, 1.2fr) minmax(140px, 1.1fr) minmax(140px, 1.1fr) auto auto;
}

.dispatch-page #contact-list .dept-row-check {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: #0a6b63;
  cursor: pointer;
}

.dispatch-card .contact-batch-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 4px;
  flex-shrink: 0;
}

.contact-batch-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dispatch-page .dispatch-dept-actions .btn {
  min-width: 88px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(5, 43, 48, 0.18);
}

.dispatch-page .contact-batch-actions .btn {
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  box-shadow: 0 4px 10px rgba(5, 43, 48, 0.18);
}

.dispatch-page #contact-list .btn,
.dispatch-page #contact-list .pill {
  min-width: 64px;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.contact-check-all {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(12, 35, 64, 0.06);
}

.contact-check-all input,
.contact-check-all input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  border: 1px solid rgba(12, 35, 64, 0.28);
  border-radius: 4px;
  background: #fff;
  accent-color: #0a6b63;
  cursor: pointer;
}

.contact-check-all:has(input:checked) {
  border-color: #0a6b63;
  background: rgba(10, 107, 99, 0.08);
  color: #052b30;
}

.dispatch-page .dept-count-row {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.dispatch-page #dispatch-dl-list .dept-map-row {
  grid-template-columns: minmax(200px, 1.4fr) minmax(160px, 1fr);
}

.dispatch-dept-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.dispatch-dept-name input {
  margin: 0;
  font-weight: 600;
}

.dispatch-log {
  margin-top: 0;
  min-height: 140px;
  flex: 1;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 6px;
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    max-height: none;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .agent-nav { flex-direction: row; overflow-x: auto; }
  .agent-item { min-width: 220px; }
  .grid-2, .form-grid, .form-grid-3, .chat-layout, .users-layout, .grid-split, .review-split {
    grid-template-columns: 1fr;
  }
  .workspace { padding: 20px 16px 32px; }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar h2 { font-size: 24px; }
  .topbar-meta { justify-content: flex-start; }
  .chat-card { min-height: auto; }
  .chat-thread { max-height: 48vh; min-height: 240px; }
  .muted-pill { max-width: none; }
  .dl-detail-meta {
    grid-template-columns: 1fr;
  }
  .dispatch-page .dept-map-row,
  .dispatch-page #contact-list .dept-map-row {
    grid-template-columns: auto 1fr;
  }
  .dispatch-header,
  .dispatch-setup,
  .dispatch-filter {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
  .dispatch-card {
    width: 100%;
    padding: 22px 18px 20px;
  }
  .settings-columns {
    grid-template-columns: 1fr;
  }
}

/* ---- 推送系统登录 / 四标签导航 / 设置页（2026-11-18） ---- */
.dispatch-header-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.dispatch-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dispatch-page .dispatch-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(5, 43, 48, 0.08);
  transition: transform .15s ease, box-shadow .15s ease;
}

.dispatch-page .dispatch-tab:hover {
  transform: translateY(-1px);
}

.dispatch-page .dispatch-tab.is-active {
  color: #fff;
  background: linear-gradient(90deg, #0a6b63 0%, #052b30 100%);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(5, 43, 48, 0.22);
}

.dispatch-user {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.dispatch-user strong {
  color: var(--ink);
  font-weight: 700;
}

.settings-card {
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
}

.settings-key-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-key-head h3 {
  margin: 0;
}

.settings-key-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  max-width: 460px;
}

.settings-key-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  text-align: right;
}

.settings-key-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.settings-key-form > label {
  font-size: 13px;
  color: var(--ink-soft);
}

.settings-key-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-key-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.04em;
}

.settings-note {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.settings-key-message {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--danger);
}

.settings-key-message.is-ok {
  color: var(--ok);
}

.key-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.key-state-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(12, 35, 64, 0.08);
}

.key-state-badge.is-ok {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.key-state-badge.is-ok::before {
  box-shadow: 0 0 0 3px rgba(31, 122, 76, 0.18);
}

.key-state-badge.is-error {
  color: #b42318;
  background: #fee4e2;
  border-color: #fda29b;
}

.key-state-badge.is-error::before {
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.16);
}

.key-state-badge.is-pending {
  color: var(--ink-soft);
  background: rgba(12, 35, 64, 0.06);
  border-color: rgba(12, 35, 64, 0.14);
}

.settings-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
  flex: 1;
}

.settings-columns > .dispatch-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.settings-profile-form,
.settings-password-form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  max-width: none;
  margin-top: 14px;
}

.settings-fields {
  display: grid;
  gap: 12px 16px;
}

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

.settings-password-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-password-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.settings-field-wide {
  grid-column: 1 / -1;
}

.settings-field input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.settings-field input[readonly] {
  background: rgba(12, 35, 64, 0.04);
  color: var(--ink-soft);
}

.settings-profile-actions,
.settings-password-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  margin-top: auto;
}

.settings-profile-actions {
  justify-content: space-between;
}

.settings-profile-actions .btn.small,
.settings-password-actions .btn.small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
}

.auth-message {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.auth-message.is-error {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.auth-message.is-ok {
  border-color: rgba(31, 122, 76, 0.18);
  background: rgba(31, 122, 76, 0.08);
  color: var(--ok);
}

.auth-form-note {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 820px) {
  .dispatch-header-side {
    flex-direction: column;
    align-items: stretch;
  }
  .dispatch-tabs {
    justify-content: flex-start;
  }
  .dispatch-user {
    align-self: flex-end;
  }
  .settings-key-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .settings-key-state {
    align-items: flex-start;
    max-width: none;
  }
  .settings-key-status {
    text-align: left;
  }
  .settings-key-row {
    flex-direction: column;
    align-items: stretch;
  }
  .settings-profile-fields,
  .settings-password-fields {
    grid-template-columns: 1fr;
  }
}
