:root {
  --ink: #17283d;
  --navy: #183652;
  --navy-2: #10283e;
  --paper: #f5f2eb;
  --panel: #fffdf9;
  --line: #ddd8ce;
  --line-dark: #c8c1b5;
  --muted: #6f7d8c;
  --gold: #c98b2d;
  --gold-soft: #f5e6c9;
  --teal: #28786d;
  --teal-soft: #e1f1ed;
  --red: #b94a3c;
  --red-soft: #f7e6e1;
  --blue-soft: #e3edf6;
  --shadow: 0 18px 50px rgba(23, 40, 61, 0.09);
  --radius: 14px;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --serif: "STSong", "Songti SC", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
}

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

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

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

.eyebrow {
  margin: 0;
  color: var(--gold);
  font: 700 10px/1.4 var(--mono);
  letter-spacing: 0.18em;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.8fr);
  background:
    radial-gradient(circle at 12% 10%, rgba(201, 139, 45, 0.2), transparent 34%),
    linear-gradient(135deg, var(--navy-2), #173e5d 62%, #285567);
}

.login-brand {
  padding: clamp(42px, 8vw, 110px);
  display: flex;
  justify-content: center;
  flex-direction: column;
  color: #fff;
}

.brand-seal {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 30px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  font: 800 18px var(--mono);
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.04);
}

.brand-seal.small {
  width: 42px;
  height: 42px;
  margin: 0;
  border: 0;
  background: var(--navy);
  color: var(--gold-soft);
  font-size: 12px;
  box-shadow: none;
}

.login-brand h1 {
  max-width: 760px;
  margin: 8px 0 22px;
  font: 700 clamp(42px, 6vw, 78px)/1.08 var(--serif);
  letter-spacing: -0.04em;
}

.login-copy {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.9;
}

.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 44px;
}

.login-points span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

.login-card {
  align-self: center;
  width: min(430px, calc(100% - 48px));
  margin: 32px auto;
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.login-card h2 {
  margin: 5px 0 2px;
  font: 700 28px/1.2 var(--serif);
}

.login-card label,
.form-field {
  display: grid;
  gap: 7px;
  margin-top: 19px;
  color: #455467;
  font-size: 12px;
  font-weight: 700;
}

.login-card input,
.form-field input,
.form-field select,
.form-field textarea,
.filter-input {
  width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.login-card input,
.form-field input,
.form-field select,
.filter-input {
  height: 42px;
  padding: 0 12px;
}

.form-field textarea {
  min-height: 98px;
  padding: 11px 12px;
  resize: vertical;
}

.login-card input:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.filter-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 139, 45, 0.13);
}

.login-card .btn {
  margin-top: 22px;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.form-error {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 12px;
}

.btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.14s, background 0.14s, border-color 0.14s;
}

.btn:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
}

.btn.primary {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}

.btn.gold {
  border-color: var(--gold);
  background: var(--gold);
  color: #fff;
}

.btn.danger {
  border-color: #d9b8b0;
  color: var(--red);
}

.btn.small {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
}

.btn.wide {
  width: 100%;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 18px;
  border-right: 1px solid #d8d2c7;
  background: #f0ece3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 7px 24px;
}

.brand strong {
  display: block;
  font: 700 19px/1.2 var(--serif);
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 700 8px var(--mono);
  letter-spacing: 0.2em;
}

.nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.6);
}

.nav-item.active {
  background: #fffdf9;
  box-shadow: 0 7px 20px rgba(23, 40, 61, 0.08);
  font-weight: 700;
}

.nav-index {
  color: #9a8d79;
  font: 700 9px var(--mono);
}

.nav-item.active .nav-index {
  color: var(--gold);
}

.sidebar-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid #d8d2c7;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font: 700 12px var(--mono);
}

.user-chip b,
.user-chip small {
  display: block;
}

.user-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.text-button {
  margin-top: 13px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 11px;
}

.main {
  min-width: 0;
  padding: 30px clamp(24px, 3.8vw, 58px) 80px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-dark);
}

.topbar h1 {
  margin: 3px 0 0;
  font: 700 30px/1.2 var(--serif);
  letter-spacing: -0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-time {
  color: var(--muted);
  font: 10px var(--mono);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  font-size: 18px;
}

.view-root {
  display: grid;
  gap: 24px;
}

.loading-block,
.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 30px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.kpi:last-child {
  border-right: 0;
}

.kpi-label {
  color: var(--muted);
  font: 700 9px var(--mono);
  letter-spacing: 0.14em;
}

.kpi-value {
  margin-top: 7px;
  font: 800 clamp(24px, 3vw, 34px)/1.1 var(--mono);
  letter-spacing: -0.05em;
}

.kpi-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi.alert .kpi-value {
  color: var(--red);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(290px, 0.7fr);
  gap: 24px;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(23, 40, 61, 0.045);
}

.card-pad {
  padding: 21px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  margin: 0;
  font: 700 18px/1.25 var(--serif);
}

.card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.chart {
  height: 230px;
  display: grid;
  grid-template-columns: repeat(14, minmax(10px, 1fr));
  align-items: end;
  gap: 8px;
  padding: 24px 21px 18px;
}

.chart-col {
  min-width: 0;
  display: grid;
  align-content: end;
  gap: 4px;
  text-align: center;
}

.chart-bars {
  height: 162px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.chart-bar {
  display: block;
  width: min(12px, 42%);
  min-height: 2px;
  border-radius: 4px 4px 1px 1px;
  background: var(--navy);
}

.chart-bar.fetch {
  background: #c8d2dc;
}

.chart-label {
  color: var(--muted);
  font: 8px var(--mono);
  transform: rotate(-45deg);
  transform-origin: center;
}

.legend {
  display: flex;
  gap: 15px;
  color: var(--muted);
  font-size: 10px;
}

.legend span::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--navy);
}

.legend .fetch::before {
  background: #c8d2dc;
}

.activity-list {
  display: grid;
}

.activity-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 19px;
  border-bottom: 1px solid var(--line);
}

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

.activity-time {
  color: var(--muted);
  font: 9px var(--mono);
}

.activity-item b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.source-status-list {
  display: grid;
  gap: 10px;
  padding: 17px;
}

.source-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.source-status b,
.source-status small {
  display: block;
}

.source-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: #aab3bd;
}

.status-dot.ok {
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.data-table-wrap {
  overflow: auto;
}

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

.data-table th {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f8f5ef;
  font: 700 9px var(--mono);
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.14s;
}

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

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

.clickable-row {
  cursor: pointer;
}

.cell-title {
  min-width: 150px;
}

.cell-title b,
.cell-title small {
  display: block;
}

.cell-title small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.number-cell {
  font: 700 12px var(--mono);
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--blue-soft);
  color: var(--navy);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.gold {
  background: var(--gold-soft);
  color: #825919;
}

.pill.green {
  background: var(--teal-soft);
  color: var(--teal);
}

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

.pill.gray {
  background: #eceff2;
  color: #677382;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.toolbar .filter-input {
  width: min(280px, 100%);
}

.toolbar select.filter-input {
  width: auto;
  min-width: 130px;
}

.toolbar-spacer {
  flex: 1;
}

.result-count {
  color: var(--muted);
  font: 10px var(--mono);
}

.link-url {
  max-width: 350px;
  overflow: hidden;
  color: var(--teal);
  font: 10px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.empty-inline {
  padding: 42px 20px;
  color: var(--muted);
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 45, 0.38);
  backdrop-filter: blur(2px);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(720px, 94vw);
  height: 100%;
  overflow: auto;
  padding: 34px;
  background: var(--paper);
  box-shadow: -20px 0 70px rgba(15, 31, 45, 0.22);
  animation: drawer-in 0.2s ease-out;
}

@keyframes drawer-in {
  from {
    transform: translateX(30px);
    opacity: 0.4;
  }
}

.drawer-close,
.modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: var(--panel);
  cursor: pointer;
  font-size: 20px;
}

.drawer-close {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-left: auto;
}

.detail-head {
  margin: 15px 0 24px;
}

.detail-head h2 {
  margin: 4px 0 8px;
  font: 700 29px/1.2 var(--serif);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

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

.detail-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.detail-stat small,
.detail-stat b {
  display: block;
}

.detail-stat small {
  color: var(--muted);
  font: 9px var(--mono);
}

.detail-stat b {
  margin-top: 4px;
  font: 700 17px var(--mono);
}

.detail-section {
  margin-top: 22px;
}

.detail-section > h3 {
  margin: 0 0 10px;
  font: 700 17px var(--serif);
}

.info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.info-item {
  min-width: 0;
  padding: 13px 14px;
  background: var(--panel);
}

.info-item small,
.info-item b {
  display: block;
}

.info-item small {
  color: var(--muted);
  font-size: 10px;
}

.info-item b {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 0;
  border-left: 2px solid #cdd5dc;
  margin-left: 6px;
}

.timeline-item {
  position: relative;
  padding: 0 0 18px 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 5px;
  left: -6px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--navy);
}

.timeline-item b {
  display: block;
}

.timeline-item small {
  color: var(--muted);
  font: 9px var(--mono);
}

.entity-list {
  display: grid;
  gap: 8px;
}

.entity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.entity-row b,
.entity-row small {
  display: block;
}

.entity-row small {
  margin-top: 2px;
  color: var(--muted);
}

.followup-form {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.followup-form textarea {
  min-height: 84px;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  resize: vertical;
}

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

.source-card {
  display: grid;
  gap: 16px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.source-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.source-card h3 {
  margin: 0;
  font: 700 17px var(--serif);
}

.source-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.source-card code {
  display: block;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: #f0ece4;
  color: #526171;
  font: 10px/1.6 var(--mono);
  white-space: nowrap;
}

.source-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(70px, 1fr));
  gap: 8px;
  overflow: auto;
  padding: 18px;
}

.stage-card {
  min-height: 95px;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  border-radius: 9px;
  background: #fff;
}

.stage-card small {
  color: var(--muted);
  font: 9px var(--mono);
}

.stage-card b {
  display: block;
  margin-top: 7px;
  font: 800 26px var(--mono);
}

.modal {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 30px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 100px rgba(15, 31, 45, 0.34);
}

.modal::backdrop {
  background: rgba(15, 31, 45, 0.48);
  backdrop-filter: blur(3px);
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-left: auto;
}

.modal h2 {
  margin: 4px 0 3px;
  font: 700 25px var(--serif);
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.form-note {
  margin: 12px 0 0;
  padding: 11px;
  border-radius: 9px;
  background: var(--gold-soft);
  color: #73521d;
  font-size: 11px;
}

.copy-box {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.copy-box input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  font: 10px var(--mono);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 16px;
  border-radius: 9px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s, transform 0.18s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.section-lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-lead h2 {
  margin: 0;
  font: 700 20px var(--serif);
}

.section-lead p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.config-warning {
  display: grid;
  gap: 10px;
  padding: 19px;
  border: 1px solid #e3c89c;
  border-radius: var(--radius);
  background: #fff8ea;
  color: #674d24;
}

.config-warning b {
  font-family: var(--serif);
  font-size: 17px;
}

.config-warning code {
  font: 11px/1.7 var(--mono);
}

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

  .kpi:nth-child(3) {
    border-right: 0;
  }

  .kpi:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

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

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

  .login-brand {
    min-height: 42vh;
    padding: 42px 28px;
  }

  .login-brand h1 {
    font-size: 45px;
  }

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

  .sidebar {
    position: sticky;
    z-index: 20;
    width: 100%;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line-dark);
  }

  .brand {
    padding-bottom: 12px;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-item {
    width: 100%;
    min-height: 34px;
    justify-content: center;
    padding: 0 7px;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
  }

  .nav-index,
  .sidebar-foot {
    display: none;
  }

  .main {
    padding: 22px 16px 70px;
  }

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

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

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

@media (max-width: 620px) {
  .topbar h1 {
    font-size: 25px;
  }

  .refresh-time {
    display: none;
  }

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

  .kpi {
    border-top: 1px solid var(--line);
  }

  .kpi:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .kpi:nth-child(even) {
    border-right: 0;
  }

  .kpi:nth-child(-n + 2) {
    border-top: 0;
  }

  .chart {
    grid-template-columns: repeat(7, minmax(10px, 1fr));
  }

  .chart-col:nth-child(-n + 7) {
    display: none;
  }

  .info-list,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .drawer-panel {
    padding: 22px 18px;
  }

  .modal {
    padding: 22px 18px;
  }
}

/* 高端运营台视觉系统 */
:root {
  --ink: #142230;
  --navy: #10283d;
  --navy-2: #091a28;
  --paper: #f2efe8;
  --panel: #fffefa;
  --line: #ded8ce;
  --line-dark: #c8bfb2;
  --muted: #6c7884;
  --gold: #c99135;
  --gold-soft: #f5e7ce;
  --teal: #277a6e;
  --teal-soft: #e3f2ee;
  --red: #b8493c;
  --red-soft: #f8e8e3;
  --shadow: 0 24px 70px rgba(12, 29, 43, 0.1);
  --radius: 16px;
}

body {
  background:
    radial-gradient(circle at 84% 4%, rgba(196, 145, 57, 0.09), transparent 24%),
    linear-gradient(180deg, #f5f2ec, #efebe3);
}

.login-view {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 23% 18%, rgba(192, 140, 52, 0.19), transparent 27%),
    linear-gradient(135deg, #071725, #0c2537 58%, #132f42);
}

.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, #000, transparent 68%);
  pointer-events: none;
}

.login-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 19, 30, 0.96) 0%, rgba(6, 22, 34, 0.84) 36%, rgba(6, 22, 34, 0.35) 74%, rgba(6, 22, 34, 0.4)),
    linear-gradient(0deg, rgba(5, 18, 28, 0.72), transparent 50%),
    url("/assets/project-dusk.jpg") center / cover no-repeat;
  filter: saturate(0.86) contrast(1.04);
  transform: scale(1.02);
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  z-index: -1;
  background: linear-gradient(transparent, rgba(4, 16, 25, 0.86));
}

.brand-seal {
  border-color: rgba(222, 178, 97, 0.6);
  background: linear-gradient(145deg, rgba(213, 164, 80, 0.3), rgba(255, 255, 255, 0.03));
  color: #f4cb83;
  box-shadow:
    inset 0 0 0 6px rgba(255, 255, 255, 0.03),
    0 14px 36px rgba(0, 0, 0, 0.2);
}

.login-brand .eyebrow {
  color: #dfb368;
}

.login-brand h1 {
  max-width: 820px;
  text-shadow: 0 16px 45px rgba(0, 0, 0, 0.36);
}

.login-proof {
  width: min(620px, 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 58px;
  padding-top: 21px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.login-proof small,
.login-proof b {
  display: block;
}

.login-proof small {
  color: #dcb269;
  font: 700 9px var(--mono);
  letter-spacing: 0.17em;
}

.login-proof b {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.login-proof-index {
  color: rgba(255, 255, 255, 0.5);
  font: 700 24px var(--mono);
  white-space: nowrap;
}

.login-card {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(145deg, rgba(20, 45, 64, 0.92), rgba(7, 24, 36, 0.88));
  color: #fff;
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-card h2 {
  color: #fff;
}

.login-card .muted {
  color: rgba(255, 255, 255, 0.54);
}

.login-card label {
  color: rgba(255, 255, 255, 0.7);
}

.login-card input {
  border-color: rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

.login-card input:focus {
  border-color: #d9a950;
  box-shadow: 0 0 0 4px rgba(217, 169, 80, 0.13);
}

.login-hint {
  color: rgba(255, 255, 255, 0.4);
}

.btn.primary {
  border-color: #d3a04a;
  background: linear-gradient(135deg, #d3a04a, #b97d25);
  color: #091722;
  box-shadow: 0 10px 24px rgba(185, 125, 37, 0.18);
}

.btn.primary:hover {
  border-color: #dfb66b;
  background: linear-gradient(135deg, #dfb66b, #c68c32);
}

.sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  background:
    radial-gradient(circle at 10% 6%, rgba(211, 160, 74, 0.14), transparent 25%),
    linear-gradient(180deg, #091b2a, #102c40);
  color: #fff;
}

.brand {
  padding-bottom: 28px;
}

.brand-seal.small {
  border: 1px solid rgba(228, 183, 105, 0.3);
  background: rgba(255, 255, 255, 0.035);
  color: #e5bd78;
}

.brand strong {
  color: #fff;
}

.brand small {
  color: rgba(255, 255, 255, 0.38);
}

.nav {
  gap: 5px;
}

.nav-item {
  position: relative;
  color: rgba(255, 255, 255, 0.58);
  overflow: hidden;
  transition: color 0.16s, background 0.16s, transform 0.16s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.88);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(213, 164, 80, 0.19), rgba(255, 255, 255, 0.045));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(230, 188, 115, 0.12);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: #e0af58;
  box-shadow: 0 0 14px rgba(224, 175, 88, 0.45);
}

.nav-index {
  color: rgba(255, 255, 255, 0.28);
}

.nav-item.active .nav-index {
  color: #e2b76e;
}

.sidebar-foot {
  border-top-color: rgba(255, 255, 255, 0.09);
}

.text-button {
  color: rgba(255, 255, 255, 0.42);
}

.main {
  background:
    radial-gradient(circle at 95% 1%, rgba(197, 144, 54, 0.08), transparent 19%);
}

.topbar {
  border-bottom-color: rgba(124, 112, 95, 0.25);
}

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

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #637365;
  font: 700 9px var(--mono);
  letter-spacing: 0.07em;
}

.system-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31816f;
  box-shadow: 0 0 0 4px rgba(49, 129, 111, 0.12);
  animation: status-pulse 2.6s infinite;
}

@keyframes status-pulse {
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.command-hero {
  position: relative;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
  gap: 34px;
  overflow: hidden;
  padding: 40px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(7, 23, 35, 0.97) 0%, rgba(9, 29, 44, 0.91) 54%, rgba(8, 26, 40, 0.58)),
    url("/assets/project-dusk.jpg") center 54% / cover;
  color: #fff;
  box-shadow: 0 30px 80px rgba(7, 25, 39, 0.2);
}

.command-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(4, 17, 26, 0.6), transparent 45%),
    radial-gradient(circle at 76% 20%, rgba(221, 173, 91, 0.2), transparent 28%);
  pointer-events: none;
}

.command-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, #000 10%, transparent 72%);
}

.command-copy,
.command-intelligence {
  position: relative;
  z-index: 2;
}

.command-copy {
  align-self: center;
}

.command-copy h2 {
  margin: 11px 0 16px;
  font: 600 clamp(36px, 4vw, 58px)/1.08 var(--serif);
  letter-spacing: -0.045em;
}

.command-copy h2 em {
  color: #e0af58;
  font-style: normal;
}

.command-copy > p:not(.eyebrow) {
  max-width: 580px;
  margin: 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: 14px;
  line-height: 1.85;
}

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

.btn.ghost-light {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(8px);
}

.btn.ghost-light:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.09);
}

.command-intelligence {
  align-self: stretch;
  display: grid;
  align-content: end;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(16px);
}

.command-score span,
.command-score strong,
.command-score small {
  display: block;
}

.command-score span {
  color: rgba(255, 255, 255, 0.54);
  font: 700 9px var(--mono);
  letter-spacing: 0.11em;
}

.command-score strong {
  margin-top: 2px;
  color: #f0c778;
  font: 800 58px/1 var(--mono);
  letter-spacing: -0.07em;
}

.command-score small {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}

.command-sparkline {
  width: 100%;
  height: 105px;
  overflow: visible;
}

.spark-area {
  fill: url("#spark-fill");
}

.spark-line {
  fill: none;
  stroke: #e2b76e;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 4px 12px rgba(224, 175, 88, 0.22));
}

.spark-dots circle {
  fill: #f5d395;
  stroke: #102b3f;
  stroke-width: 1.5;
}

.command-live {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding-top: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.command-live > i {
  width: 7px;
  height: 7px;
  flex: none;
  margin-top: 8px;
  border-radius: 50%;
  background: #74c6aa;
  box-shadow: 0 0 0 4px rgba(116, 198, 170, 0.12);
}

.command-live small,
.command-live b,
.command-live span {
  display: block;
}

.command-live small {
  color: #cfa75f;
  font: 700 8px var(--mono);
  letter-spacing: 0.13em;
}

.command-live b {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
}

.command-live span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.4);
  font: 9px var(--mono);
}

.kpi-grid {
  gap: 10px;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.kpi {
  position: relative;
  min-height: 142px;
  padding: 19px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, #fffefa, #f9f6ef);
  box-shadow: 0 10px 28px rgba(14, 32, 46, 0.045);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.kpi:hover {
  border-color: #cfc1ac;
  box-shadow: 0 18px 38px rgba(14, 32, 46, 0.08);
  transform: translateY(-2px);
}

.kpi::after {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  width: 34px;
  height: 2px;
  background: var(--gold);
}

.kpi.primary::after {
  width: 54px;
  background: var(--teal);
}

.kpi.alert::after {
  background: var(--red);
}

.kpi-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kpi-index {
  color: #ad9d82;
  font: 700 8px var(--mono);
}

.kpi-value {
  margin-top: 13px;
  font-size: clamp(28px, 3vw, 38px);
}

.card {
  border-color: rgba(198, 188, 174, 0.72);
  border-radius: 16px;
  background: rgba(255, 254, 250, 0.93);
  box-shadow: 0 16px 42px rgba(14, 32, 46, 0.055);
}

.card-head {
  padding: 21px 23px;
}

.card-head h2 {
  font-size: 19px;
}

.activity-item {
  padding: 15px 21px;
}

.activity-time {
  color: #8b8173;
}

.data-table th {
  padding: 11px 15px;
  background: #f5f1e9;
  color: #887d6c;
}

.data-table td {
  padding: 14px 15px;
}

.data-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(219, 186, 129, 0.06), rgba(255, 255, 255, 0));
}

.cell-title b {
  font-size: 13px;
}

.cell-title small {
  color: #8b8378;
}

.cell-person,
.cell-doc {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cell-person > span,
.cell-doc > span {
  min-width: 0;
}

.person-avatar {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid #d3c5ae;
  border-radius: 50%;
  background: linear-gradient(145deg, #f9f1e3, #eee1ca);
  color: #8b6428;
  font: 800 11px var(--mono);
  font-style: normal;
}

.cell-doc > i {
  min-width: 38px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
  background: #112f45;
  color: #e4bd77;
  font: 700 8px var(--mono);
  font-style: normal;
  letter-spacing: 0.02em;
}

.pill {
  border: 1px solid rgba(35, 65, 91, 0.05);
}

.drawer-panel {
  background:
    radial-gradient(circle at 100% 0, rgba(199, 148, 60, 0.08), transparent 25%),
    #f2efe8;
  box-shadow: -32px 0 100px rgba(8, 24, 37, 0.3);
}

.detail-head h2 {
  font-size: 34px;
}

.detail-stat,
.info-list,
.entity-row,
.followup-form {
  background: rgba(255, 254, 250, 0.9);
}

.detail-stat {
  box-shadow: 0 7px 20px rgba(14, 32, 46, 0.035);
}

.timeline {
  border-left-color: #c7bda9;
}

.timeline-item::before {
  background: var(--gold);
}

.source-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(198, 188, 174, 0.74);
  background: linear-gradient(145deg, #fffefa, #faf6ef);
  box-shadow: 0 12px 32px rgba(14, 32, 46, 0.045);
}

.source-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--gold), transparent);
}

.stage-card {
  border-top-color: #c9953e;
  background: linear-gradient(180deg, #fffefa, #f8f4ec);
  box-shadow: 0 6px 18px rgba(14, 32, 46, 0.035);
}

.modal {
  background:
    radial-gradient(circle at 100% 0, rgba(199, 145, 53, 0.08), transparent 25%),
    #f6f2ea;
  box-shadow: 0 40px 130px rgba(4, 16, 25, 0.5);
}

.module-banner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(480px, 1.1fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  padding: 30px 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 19px;
  background:
    radial-gradient(circle at 88% 20%, rgba(218, 165, 76, 0.2), transparent 30%),
    linear-gradient(120deg, #0a1c2b, #102d42);
  color: #fff;
  box-shadow: 0 24px 60px rgba(9, 27, 41, 0.16);
}

.module-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000);
}

.module-banner-copy,
.module-banner-stats {
  position: relative;
}

.module-banner-copy h2 {
  margin: 7px 0 9px;
  font: 600 32px/1.15 var(--serif);
}

.module-banner-copy > p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  line-height: 1.8;
}

.module-banner-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px);
}

.module-banner-stats > div {
  padding: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.module-banner-stats > div:last-child {
  border-right: 0;
}

.module-banner-stats small,
.module-banner-stats b,
.module-banner-stats span {
  display: block;
}

.module-banner-stats small {
  color: #d6aa60;
  font: 700 7px var(--mono);
  letter-spacing: 0.08em;
}

.module-banner-stats b {
  margin-top: 6px;
  font: 800 27px var(--mono);
}

.module-banner-stats span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 9px;
}

.access-banner {
  background:
    linear-gradient(105deg, rgba(7, 23, 35, 0.98), rgba(11, 38, 55, 0.84)),
    url("/assets/project-dusk.jpg") center 48% / cover;
}

.access-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 254, 250, 0.88);
  box-shadow: 0 12px 34px rgba(16, 37, 53, 0.05);
}

.access-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.access-tabs button {
  min-width: 150px;
  padding: 11px 15px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #6b756f;
  text-align: left;
  cursor: pointer;
}

.access-tabs button small,
.access-tabs button b {
  display: block;
}

.access-tabs button small {
  color: #a59782;
  font: 700 7px var(--mono);
  letter-spacing: 0.12em;
}

.access-tabs button b {
  margin-top: 4px;
  font-size: 12px;
}

.access-tabs button.active {
  background: linear-gradient(145deg, #102b40, #0b2031);
  color: #fff;
  box-shadow: 0 8px 24px rgba(10, 32, 48, 0.18);
}

.access-tabs button.active small {
  color: #dcb571;
}

.access-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 0 12px;
  color: #65746b;
  font-size: 10px;
}

.access-trust i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2b8877;
  box-shadow: 0 0 0 5px rgba(43, 136, 119, 0.1);
}

.access-trust b {
  padding: 3px 6px;
  border-radius: 5px;
  background: #edf4ef;
  color: #267061;
  font: 800 8px var(--mono);
}

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

.access-site-card {
  position: relative;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(198, 188, 174, 0.72);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(201, 145, 53, 0.11), transparent 36%),
    linear-gradient(150deg, #fffefa, #f8f3e9);
  box-shadow: 0 12px 30px rgba(15, 35, 49, 0.045);
}

.access-site-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -32px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(178, 132, 56, 0.13);
  border-radius: 50%;
}

.access-site-card.is-legacy {
  background:
    radial-gradient(circle at 100% 0, rgba(195, 139, 45, 0.18), transparent 40%),
    linear-gradient(150deg, #fffdf6, #f3ead7);
}

.access-site-code {
  width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #102b40;
  color: #e3b86e;
  font: 800 8px var(--mono);
}

.access-site-card > div > span {
  color: #a6844b;
  font: 700 7px var(--mono);
  letter-spacing: 0.12em;
}

.access-site-card h3 {
  margin: 5px 0 6px;
  font: 700 17px var(--serif);
}

.access-site-card p {
  margin: 0;
  color: #747f84;
  font-size: 10px;
  line-height: 1.7;
}

.site-identity {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 4px 7px;
  border: 1px solid rgba(21, 57, 78, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.6);
  color: #6e756f;
  font-size: 8px;
  font-weight: 700;
}

.access-site-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(198, 188, 174, 0.5);
  color: #788285;
  font-size: 9px;
}

.access-site-stats b {
  margin-right: 3px;
  color: #182b3b;
  font: 800 13px var(--mono);
}

.access-site-stats a,
.site-grant-button {
  margin-left: auto;
  color: #8a642b;
  font-weight: 800;
  text-underline-offset: 3px;
}

.site-grant-button {
  border: 0;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.access-site-pills,
.capability-list,
.link-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.access-site-pills span,
.capability-list span,
.link-capabilities span {
  padding: 3px 6px;
  border-radius: 5px;
  background: #f0ece3;
  color: #675f54;
  font-size: 8px;
  font-weight: 700;
}

.link-capabilities {
  margin-top: 6px;
  font-style: normal;
}

.link-capabilities span {
  background: #edf3f0;
  color: #497066;
}

.access-owner-note {
  color: #987039;
  font: 700 9px var(--mono);
}

.access-scope {
  display: block;
  margin-top: 5px;
  color: #8b8378;
}

.access-grant-table select,
.access-grant-table input {
  min-width: 0;
}

.quote-access-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(480px, 1.05fr);
  gap: 28px;
  align-items: center;
  overflow: hidden;
  padding: 32px 34px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 84% 32%, rgba(220, 171, 89, 0.19), transparent 26%),
    linear-gradient(128deg, #071825, #102b40 60%, #0d2436);
  color: #fff;
  box-shadow: 0 24px 64px rgba(8, 25, 39, 0.18);
}

.quote-access-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(90deg, #000, transparent 80%);
}

.quote-access-hero > * {
  position: relative;
}

.quote-access-hero h2 {
  margin: 7px 0 10px;
  font: 600 34px/1.15 var(--serif);
}

.quote-access-hero p:not(.eyebrow) {
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.8;
  font-size: 12px;
}

.quote-policy-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(12px);
}

.quote-policy-grid > div {
  padding: 17px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.quote-policy-grid > div:last-child {
  border-right: 0;
}

.quote-policy-grid small,
.quote-policy-grid b,
.quote-policy-grid span {
  display: block;
}

.quote-policy-grid small {
  color: #dcb06a;
  font: 700 7px var(--mono);
}

.quote-policy-grid b {
  margin: 7px 0 3px;
  font: 800 27px var(--mono);
}

.quote-policy-grid span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 8px;
}

.quote-access-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.quote-compat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgba(182, 164, 137, 0.75);
  border-radius: 15px;
  background: linear-gradient(145deg, #fffefa, #f5efe3);
}

.quote-compat-strip > div {
  position: relative;
  padding: 19px 21px;
  border-right: 1px solid rgba(183, 166, 140, 0.55);
}

.quote-compat-strip > div:last-child {
  border-right: 0;
}

.quote-compat-strip small,
.quote-compat-strip b,
.quote-compat-strip span {
  display: block;
}

.quote-compat-strip small {
  color: #ac7d32;
  font: 800 7px var(--mono);
  letter-spacing: 0.1em;
}

.quote-compat-strip b {
  margin: 6px 0 4px;
  color: #172b3b;
  font: 700 14px var(--serif);
}

.quote-compat-strip span {
  color: #7c837e;
  font-size: 9px;
  line-height: 1.6;
}

.grant-site-note {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(130px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 3px;
  padding: 11px 12px;
  border: 1px solid rgba(31, 83, 101, 0.12);
  border-radius: 9px;
  background: #f2f7f5;
}

.grant-site-note b {
  color: #1e5c50;
  font-size: 9px;
}

.grant-site-note span {
  color: #63746d;
  font-size: 9px;
  line-height: 1.7;
}

.permission-editor {
  display: grid;
  gap: 9px;
  margin: 20px 0;
}

.permission-site-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr);
  gap: 18px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid #ded8ce;
  border-radius: 11px;
  background: rgba(255, 254, 250, 0.72);
}

.permission-site-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.permission-site-title > i {
  width: 37px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 6px;
  background: #102b40;
  color: #e2b66c;
  font: 800 8px var(--mono);
  font-style: normal;
}

.permission-site-title b,
.permission-site-title small {
  display: block;
}

.permission-site-title small {
  margin-top: 3px;
  color: #7b847f;
  font-size: 9px;
}

.permission-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.permission-checks label {
  position: relative;
  cursor: pointer;
}

.permission-checks input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.permission-checks label span {
  min-height: 28px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid #d9d2c7;
  border-radius: 7px;
  background: #fbf8f2;
  color: #7a817d;
  font-size: 9px;
  font-weight: 700;
  transition: 0.15s ease;
}

.permission-checks input:checked + span {
  border-color: rgba(34, 104, 91, 0.3);
  background: #e8f2ee;
  color: #256e60;
  box-shadow: inset 0 0 0 1px rgba(34, 104, 91, 0.06);
}

.permission-block {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #ddd6ca;
  border-radius: 12px;
  background: rgba(255, 254, 250, 0.66);
}

.permission-block.compact {
  margin: 14px 0;
}

.permission-block > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.permission-block > div:first-child small {
  color: #858b86;
  font-size: 9px;
}

.customer-abilities label span {
  min-width: 86px;
}

.link-abilities label span {
  min-width: 70px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

@media (max-width: 1180px) {
  .command-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  }

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

  .kpi {
    border: 1px solid var(--line);
  }
}

@media (max-width: 900px) {
  .sidebar {
    background: linear-gradient(90deg, #091b2a, #102c40);
  }

  .login-brand::before {
    background:
      linear-gradient(0deg, rgba(5, 18, 28, 0.9), rgba(5, 18, 28, 0.3)),
      url("/assets/project-dusk.jpg") center / cover no-repeat;
  }

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

  .command-intelligence {
    min-height: 240px;
  }

  .module-banner {
    grid-template-columns: 1fr;
  }

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

  .access-commandbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .access-tabs button {
    min-width: 0;
  }

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

  .quote-access-actions {
    justify-content: flex-start;
  }

  .quote-compat-strip {
    grid-template-columns: 1fr;
  }

  .quote-compat-strip > div {
    border-right: 0;
    border-bottom: 1px solid rgba(183, 166, 140, 0.55);
  }

  .quote-compat-strip > div:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .command-hero {
    min-height: 0;
    padding: 28px 22px;
    border-radius: 17px;
  }

  .command-copy h2 {
    font-size: 38px;
  }

  .command-intelligence {
    padding: 18px;
  }

  .command-score strong {
    font-size: 48px;
  }

  .kpi-grid {
    gap: 8px;
  }

  .kpi {
    min-height: 126px;
    padding: 17px;
    border: 1px solid var(--line);
  }

  .system-status {
    display: none;
  }

  .module-banner {
    padding: 24px 20px;
  }

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

  .module-banner-stats > div:nth-child(2) {
    border-right: 0;
  }

  .module-banner-stats > div:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .access-site-grid {
    grid-template-columns: 1fr;
  }

  .access-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .access-trust {
    display: none;
  }

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

  .permission-block > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .quote-access-hero {
    padding: 25px 20px;
  }

  .quote-access-hero h2 {
    font-size: 28px;
  }

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

  .quote-policy-grid > div:nth-child(2) {
    border-right: 0;
  }

  .quote-policy-grid > div:nth-child(n + 3) {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .quote-access-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .grant-site-note {
    grid-template-columns: 1fr;
  }
}
