:root {
  --heading: #1a2433;
  --kicker: #3d82d6;
  --text: #243044;
  --muted: #6a7788;
  --empty: #8a96a4;
  --bg: #eef2f7;
  --sidebar: #e4eef8;
  --card: #fff;
  --border: #d5dfea;
  --control: #f3f6fa;
  --hover-border: #b5c5d8;
  --soft: #dde9f7;
  --soft-border: #b7cce6;
  --phase: #f5f8fc;
  --phase-line: #e2eaf3;
  --danger: #c34b4b;
  --danger-bg: #fdeeee;
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.desk {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  padding: 10px;
  gap: 10px;
}

.sidebar {
  position: sticky;
  top: 10px;
  align-self: start;
  height: calc(100vh - 20px);
  background: var(--sidebar);
  border: 0;
  border-radius: 18px;
  padding: 18px 14px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  color: var(--heading);
  font-size: 17px;
  font-weight: 700;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.nav-label {
  margin: 14px 10px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}

.nav-link svg { width: 15px; height: 15px; flex: none; }
.nav-link:hover { background: rgba(255,255,255,0.55); }
.nav-link.is-active {
  border-color: transparent;
  background: #fff;
  color: var(--kicker);
  box-shadow: 0 1px 2px rgba(26, 36, 56, 0.04);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 9px;
  background: #e25555;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.nav-link.is-active .nav-badge {
  background: var(--kicker);
  color: #fff;
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px 6px 4px;
}

.user-menu { position: relative; }

.side-tools {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(26, 36, 56, 0.12);
}

.side-tools[hidden] { display: none; }

.side-link {
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--heading);
  font: 600 14px Inter, "Noto Sans SC", sans-serif;
  text-align: left;
  cursor: pointer;
}

.side-link:hover { background: var(--soft); color: var(--kicker); }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.user-card:hover { background: #f7faff; }

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--kicker);
  font-weight: 700;
}

.user-copy { min-width: 0; }
.user-name { color: var(--heading); font-weight: 700; }
.user-meta { color: var(--muted); font-size: 13px; word-break: break-all; }

.desk-main {
  min-width: 0;
  height: calc(100vh - 20px);
  background: var(--card);
  border-radius: 18px;
  overflow: auto;
}

.navbar {
  height: 52px;
  background: transparent;
  border-bottom: 1px solid var(--phase-line);
}

.navbar-inner {
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  color: var(--kicker);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-sep {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.brand-page {
  color: var(--heading);
  font-weight: 600;
}

.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px 16px 24px;
}

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

.kicker {
  margin: 0 0 6px;
  color: var(--kicker);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.page-head h1 {
  margin: 0;
  color: var(--heading);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.sub {
  margin: 6px 0 0;
  max-width: 42rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--heading);
  font: 600 14px/1.2 Inter, "Noto Sans SC", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { border-color: var(--hover-border); background: var(--phase); }
.btn:focus-visible {
  outline: 2px solid var(--kicker);
  outline-offset: 2px;
}

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

.btn-primary:hover { filter: brightness(1.06); background: var(--kicker); }

#pick { display: none; }

.form-message {
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid #f3c4c6;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
}

.form-message[hidden] { display: none; }
.form-message.is-ok {
  border-color: var(--soft-border);
  background: var(--soft);
  color: var(--kicker);
}

.page-split {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.form-layout,
.result-col,
.widget { min-width: 0; }

.form-section {
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.section-head {
  padding: 10px 14px 0;
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
}

.section-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 10px 14px 14px;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.control.span-2 { grid-column: 1 / -1; }

.control input:not([type="checkbox"]):not([type="file"]),
.control select {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--control);
  color: var(--text);
  font: 15px Inter, "Noto Sans SC", sans-serif;
}

.control input:not([type="checkbox"]):not([type="file"]):focus,
.control select:focus {
  outline: none;
  border-color: var(--kicker);
  background: #fff;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--control);
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.check:has(input:checked) {
  border-color: var(--soft-border);
  background: var(--soft);
  color: var(--kicker);
}

.check input { margin: 0; accent-color: var(--kicker); }

.widget {
  min-height: 280px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.result-block + .result-block {
  margin-top: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.widget-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
}

.widget-head h2 {
  margin: 0;
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
}

.widget-head .hint {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap { overflow-x: auto; width: 100%; max-width: 100%; }
#auditTable { overflow-x: hidden; }
#auditTable table { width: 100%; table-layout: fixed; }
#auditTable th,
#auditTable td { padding: 8px 6px; }

table {
  width: 100%;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.sheet { table-layout: fixed; }
table.sheet th,
table.sheet td {
  overflow: hidden;
  text-overflow: ellipsis;
}
th[data-col] { position: relative; cursor: grab; user-select: none; }
th.is-fixed-col { cursor: default; }
#quoteTable [data-col="act"] {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding-left: 8px;
  padding-right: 8px;
}
#quoteTable [data-col="agents"] { min-width: 220px; }
th.is-sortable { cursor: pointer; }
th.is-sortable::after {
  content: "↕";
  display: inline-block;
  margin-left: 4px;
  color: var(--empty);
  font-size: 11px;
  font-weight: 600;
  opacity: 0.35;
  vertical-align: 1px;
}
th.is-sort-asc::after,
th.is-sort-desc::after {
  color: var(--kicker);
  opacity: 1;
}
th.is-sort-asc::after { content: "↑"; }
th.is-sort-desc::after { content: "↓"; }
tr.filter-row th {
  padding: 4px 6px;
  background: var(--phase);
  cursor: default;
  font-weight: 400;
}
.col-filter {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: 14px Inter, "Noto Sans SC", sans-serif;
  text-align: center;
}
.col-filter:focus {
  outline: none;
  border-color: var(--kicker);
}
th[data-col].is-drop { box-shadow: inset 3px 0 0 var(--kicker); }
.col-resize {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
}
.col-resize:hover,
.col-resize.is-on { background: var(--kicker); }

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--phase);
}

td.num, th.num { text-align: center; font-variant-numeric: tabular-nums; }

.cell-tip {
  position: fixed;
  z-index: 40;
  max-width: min(440px, 72vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: #1a2433;
  color: #fff;
  font: 13px/1.45 Inter, "Noto Sans SC", sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(26, 36, 56, 0.18);
}

.via {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding: 2px 6px;
  border: 1px solid var(--soft-border);
  border-radius: 6px;
  background: var(--soft);
  color: var(--kicker);
  font-size: 13px;
  font-weight: 700;
}

.summary td { color: var(--heading); font-weight: 600; }
tr.zebra-a td { background: #e8f2fa; }
tr.zebra-b td { background: #f7f3ea; }

.empty {
  padding: 36px 16px;
  color: var(--empty);
  text-align: center;
}

@media (max-width: 991px) {
  .page-head { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .page-split { grid-template-columns: minmax(0, 1fr); }
}

.charge-split {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.process-flow {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 2;
}

.process-flow__title {
  margin: 0;
  color: var(--heading);
  font-size: 15px;
  font-weight: 700;
}

.process-flow__hint {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.process-all,
.process-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 30px;
  margin: 0 0 6px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--control);
  color: var(--heading);
  font: 600 14px/1.2 Inter, "Noto Sans SC", sans-serif;
  cursor: pointer;
}

.process-all.is-active {
  border-color: var(--soft-border);
  background: var(--soft);
  color: var(--kicker);
}

.process-phase {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--phase-line);
  border-radius: var(--radius-sm);
  background: var(--phase);
}

.process-phase__name {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.process-node { background: #fff; }

#agentFlow .process-all,
#agentFlow .agent-node {
  height: 40px;
  min-height: 40px;
  padding: 0 10px;
  gap: 8px;
}

#agentFlow .agent-node__text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

#agentFlow .agent-node__cn { flex: none; font-weight: 600; }
#agentFlow .agent-node__dot,
#agentFlow .agent-node__en {
  color: var(--empty);
  font-size: 12px;
  font-weight: 500;
}
#agentFlow .agent-node__dot { flex: none; }
#agentFlow .agent-node__en {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#agentFlow .agent-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--phase);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

#agentFlow .process-all.is-active {
  border-color: var(--kicker);
  background: var(--kicker);
  color: #fff;
}

#agentFlow .agent-node.is-active .agent-node__dot,
#agentFlow .agent-node.is-active .agent-node__en {
  color: rgba(255, 255, 255, 0.7);
}

#agentFlow .process-all.is-active .agent-badge,
#agentFlow .agent-node.is-active .agent-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.check-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-fee-check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 8px 12px;
}

.agent-fee-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}

.agent-fee-check__text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.agent-fee-check__cn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.agent-fee-check__en {
  color: var(--empty);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-fee-check:has(input:checked) .agent-fee-check__en {
  color: rgba(61, 130, 214, 0.72);
}

.agent-payee-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--phase);
  align-items: center;
}

.agent-payee-hint {
  margin-top: 4px;
}
.process-node.is-active {
  border-color: var(--kicker);
  background: var(--kicker);
  color: #fff;
}

.process-count { color: var(--empty); font-size: 13px; }
.process-node.is-active .process-count { color: #d7dee3; }

.cell-edit {
  width: 88px;
  min-height: 28px;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  text-align: center;
  font: 15px Inter, "Noto Sans SC", sans-serif;
}

.cell-edit:focus {
  outline: none;
  border-color: var(--kicker);
}

.tag {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--phase);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tag.fixed { background: var(--soft); color: var(--kicker); }
.tag.off { color: var(--empty); }

td.wrap-cell {
  white-space: normal;
  overflow: visible;
}

.fee-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-width: 100%;
}

.tag.fee-chip {
  font-size: 12px;
  font-weight: 600;
}

.row-actions { display: flex; gap: 6px; justify-content: center; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--heading);
  cursor: pointer;
}

.icon-btn svg { width: 14px; height: 14px; display: block; }
.icon-btn:hover { border-color: var(--hover-border); background: var(--phase); }
.icon-btn:focus-visible {
  outline: 2px solid var(--kicker);
  outline-offset: 2px;
}
.icon-btn.is-danger { color: var(--danger); }
.icon-btn.is-danger:hover { background: var(--danger-bg); border-color: #f3c4c6; }

.btn-select {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--heading);
  font: 600 14px Inter, "Noto Sans SC", sans-serif;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(18, 50, 71, 0.28);
}

.modal[hidden] { display: none; }

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: var(--phase);
  border: 1px solid var(--phase-line);
  border-radius: var(--radius);
}

.filter-actions { display: flex; gap: 8px; padding-bottom: 2px; }
.audit-filters { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }

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

.stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--kicker);
  font: 600 14px Inter, "Noto Sans SC", sans-serif;
  cursor: pointer;
}

.link-icon svg {
  width: 16px;
  height: 16px;
}

.link-icon:hover { color: var(--heading); }

.stat-chip {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #eef2f1;
  color: var(--heading);
  font: 600 14px Inter, "Noto Sans SC", sans-serif;
  cursor: pointer;
}

.stat-chip:nth-child(2) { background: #e8f1fb; }
.stat-chip:nth-child(3) { background: #f8efe3; }
.stat-chip:nth-child(4) { background: #f8e8ea; }
.stat-chip:nth-child(5) { background: #e8eef8; }

.stat-chip.is-active {
  border-color: transparent;
  background: var(--kicker);
  color: #fff;
}

.stat-chip .n { margin-left: 6px; color: inherit; opacity: 0.75; }

.row-link {
  color: var(--kicker);
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.board-row { cursor: pointer; }
.board-row:hover td { background: var(--soft); }

.money-link {
  color: var(--heading);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 16;
  background: rgba(18, 50, 71, 0.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}

.drawer-mask.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 17;
  display: flex;
  flex-direction: column;
  width: min(980px, 88vw);
  height: 100vh;
  overflow: hidden;
  background: var(--card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(18, 50, 71, 0.08);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.32s ease, visibility 0.32s ease;
}

.drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer.is-resizing {
  transition: none;
  user-select: none;
}

.drawer-resizer {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
}

.drawer-resizer::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: #c8d6e6;
}

.drawer-resizer:hover::after,
.drawer.is-resizing .drawer-resizer::after {
  width: 1px;
  background: #adc0d4;
}

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  background: #f5f7fb;
}

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

body:not(.is-authed) .desk { display: none !important; }
body:not(.is-authed) #loginGate { display: grid !important; }
body.is-authed #loginGate { display: none !important; }

.login-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.92) 0%, rgba(232, 242, 252, 0.55) 36%, transparent 62%),
    linear-gradient(165deg, #eef5fc 0%, #d7e7f8 52%, #c4dbf4 100%);
}

.login-stage {
  position: relative;
  width: min(520px, 78%);
  height: min(520px, 62vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-rings span {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(90, 132, 176, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.login-rings span:nth-child(1) { width: 58%; height: 58%; }
.login-rings span:nth-child(2) { width: 74%; height: 74%; }
.login-rings span:nth-child(3) { width: 90%; height: 90%; }
.login-rings span:nth-child(4) { width: 108%; height: 108%; border-color: rgba(90, 132, 176, 0.14); }

.login-logo {
  position: relative;
  z-index: 1;
  width: min(340px, 68%);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(61, 130, 214, 0.14));
}

.login-hero-title {
  position: relative;
  z-index: 1;
  margin: 18px 0 6px;
  color: var(--heading);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.login-hero-title span { color: var(--kicker); }
.login-hero-sub {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.login-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: #f4f7fb;
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 28px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(26, 36, 56, 0.10);
}

.login-card h2 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 28px;
}

.login-card .sub { max-width: none; margin-bottom: 18px; }

.remember {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

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

.login-submit {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
}

@media (max-width: 860px) {
  .login-gate { grid-template-columns: 1fr; }
  .login-hero { min-height: 40vh; }
  .login-stage { width: min(280px, 70%); height: 220px; }
  .login-logo { width: min(168px, 70%); }
}

.drawer-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  margin: 2px 0 0;
  color: var(--heading);
  font-size: 20px;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px 24px;
}

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.kv div {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--phase);
}

.kv b { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.kv span { color: var(--heading); font-weight: 600; }

.modal-card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal-card.is-wide { width: min(860px, 100%); }
.modal-card.is-wide .modal-body { max-height: 70vh; overflow: auto; }

.import-card { width: min(460px, 100%); }
.import-log-card { width: min(880px, 100%); }
#importLogBody { overflow-x: auto; }
#importLogBody table.sheet [data-col="time"] {
  min-width: 172px;
  overflow: visible;
  text-overflow: clip;
}

.valid-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.valid-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--phase);
}

.valid-row.is-ok { border-color: #b7d7c4; background: #f3faf5; }
.valid-row.is-bad { border-color: #e3b6b6; background: var(--danger-bg); }
.valid-row.is-final { font-size: 15px; }
.valid-mark {
  flex: 0 0 22px;
  color: var(--empty);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.valid-row.is-ok .valid-mark { color: #2f8f55; }
.valid-row.is-bad .valid-mark { color: var(--danger); }
.valid-row strong { display: block; color: var(--heading); }
.valid-row p { margin: 4px 0 0; color: var(--danger); font-size: 13px; font-weight: 500; }
.valid-summary { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.import-validate-foot { display: flex; justify-content: flex-end; margin-top: 12px; }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 168px;
  padding: 24px 16px;
  border: 1.5px dashed var(--soft-border);
  border-radius: 12px;
  background: var(--phase);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  font-weight: 500;
}

.drop-zone strong {
  color: var(--heading);
  font-size: 16px;
}

.drop-zone.is-over {
  border-color: var(--kicker);
  background: var(--soft);
  color: var(--kicker);
}

.drop-zone.is-over strong { color: var(--kicker); }

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
}

.modal-head { border-bottom: 1px solid var(--border); }
.modal-foot { border-top: 1px solid var(--border); justify-content: flex-end; }
.modal-head h2 { margin: 0; color: var(--heading); font-size: 17px; }
.modal-x { border: 0; background: transparent; color: var(--muted); }
.modal-x:hover { background: var(--phase); color: var(--heading); }
.modal-body { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.modal-body .span-2 { grid-column: 1 / -1; }
.modal-body.import-body {
  display: block;
}
.modal-body.import-body .drop-zone {
  width: 100%;
}

@media (max-width: 991px) {
  .page-head { flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .page-split { grid-template-columns: minmax(0, 1fr); }
  .desk { grid-template-columns: 1fr; padding: 8px; }
  .sidebar { position: static; height: auto; overflow: visible; }
  .charge-split { grid-template-columns: 1fr; }
  .process-flow { position: static; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
}

.file-visible {
  display: block;
  width: 100%;
  padding: 6px 0;
  color: var(--text);
  font: 14px Inter, "Noto Sans SC", sans-serif;
}

.attach-drop {
  position: relative;
  width: 100%;
  min-height: 118px;
  box-sizing: border-box;
}

.attach-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.attach-names.has-files {
  color: var(--kicker);
}

.file-hint {
  margin: 0;
  color: var(--empty);
  font-size: 13px;
  font-weight: 500;
}

.file-link {
  color: var(--kicker);
  font-weight: 700;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.file-link:hover { color: var(--heading); }

.preview-modal {
  align-items: center;
  z-index: 24;
}

.preview-card {
  width: min(720px, 100%);
}

.preview-body {
  display: block;
  padding: 12px;
  max-height: min(72vh, 580px);
  overflow: auto;
  background: var(--phase);
}

.preview-img {
  display: block;
  max-width: 100%;
  max-height: min(64vh, 520px);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.preview-frame {
  width: 100%;
  height: min(64vh, 520px);
  border: 0;
  border-radius: 8px;
  background: #fff;
}

.preview-empty {
  margin: 24px 8px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .section-body { grid-template-columns: 1fr; }
  .control.span-2 { grid-column: auto; }
  .modal-body { grid-template-columns: 1fr; }
}

.range-wrap { position: relative; }
.range-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border: 1px solid #b7cce6;
  border-radius: 999px;
  background: #fff;
  color: var(--heading);
  font: 600 13px Inter, "Noto Sans SC", sans-serif;
  box-shadow: 0 1px 0 rgba(30, 77, 123, 0.04);
  cursor: pointer;
}
.range-btn svg { width: 15px; height: 15px; color: var(--kicker); }
.range-btn .range-caret { width: 12px; height: 12px; color: var(--muted); }
.range-btn.is-open,
.range-btn:hover { border-color: var(--kicker); }
.range-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: none;
  width: min(720px, calc(100vw - 40px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(26, 36, 51, 0.14);
  overflow: hidden;
}
.range-pop.is-open { display: flex; }
.range-presets {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 120px;
  padding: 12px 10px;
  background: #f4f8fc;
  border-right: 1px solid var(--border);
}
.range-presets button {
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: 600 13px Inter, "Noto Sans SC", sans-serif;
  cursor: pointer;
}
.range-presets button.is-on,
.range-presets button:hover { background: #fff; color: var(--kicker); }
.range-board { flex: 1; padding: 12px 14px 12px; }
.range-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.range-nav button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--heading);
  cursor: pointer;
}
.range-months { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.range-month h3 {
  margin: 0 0 8px;
  text-align: center;
  color: var(--heading);
  font-size: 13px;
}
.range-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.range-grid b,
.range-grid button {
  display: grid;
  place-items: center;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--heading);
  font: 600 12px Inter, sans-serif;
}
.range-grid b { color: var(--empty); font-weight: 700; }
.range-grid button { border-radius: 8px; cursor: pointer; }
.range-grid button:hover { background: #e8f2fa; }
.range-grid button.is-mute { color: #c5ced8; }
.range-grid button.is-start,
.range-grid button.is-end { background: #3d82d6; color: #fff; }
.range-grid button.is-mid { background: #d7e8f8; color: var(--heading); border-radius: 0; }
.range-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--phase-line);
}
.range-foot span { color: var(--muted); font-size: 12px; }
.range-foot-act { display: flex; gap: 8px; }

.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.report-kpi {
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.report-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.report-kpi strong {
  display: block;
  margin: 8px 0 6px;
  color: var(--heading);
  font-size: 26px;
  letter-spacing: -0.04em;
}
.report-delta {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.report-delta.up { background: #e7f7ee; color: #1f8a4c; }
.report-delta.down { background: #fdeeee; color: #c34b4b; }
.report-delta.flat { background: var(--phase); color: var(--muted); }
.report-spark { display: block; width: 100%; height: 28px; }

.report-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.report-head h2 { margin: 0; font-size: 15px; }
.report-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.report-metrics { display: flex; gap: 4px; }
.report-metrics button {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: 600 12px Inter, "Noto Sans SC", sans-serif;
  cursor: pointer;
}
.report-metrics button.is-on { background: #123247; color: #fff; border-color: #123247; }

.report-spine {
  display: flex;
  align-items: end;
  gap: 2px;
  height: 168px;
  padding: 8px 0 0;
}
.report-spine-col {
  flex: 1;
  min-width: 6px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  cursor: crosshair;
}
.report-spine-col i {
  width: 100%;
  max-width: 18px;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #c5d8ec;
}
.report-spine-col.has i { background: linear-gradient(180deg, #7eb8e8, #2f6fbe); }
.report-spine-col:hover i { background: #123247; }
.report-tip {
  position: fixed;
  z-index: 80;
  min-width: 148px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #123247;
  color: #fff;
  box-shadow: 0 10px 24px rgba(18, 50, 71, 0.22);
  pointer-events: none;
}
.report-tip em {
  display: block;
  color: #9db4c6;
  font-size: 11px;
  font-style: normal;
}
.report-tip b {
  display: block;
  margin: 3px 0 2px;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.report-tip span {
  display: block;
  color: #c5d4e0;
  font-size: 11px;
}
.report-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--empty);
  font-size: 11px;
}

.report-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; }
.report-share {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 99px;
  margin: 8px 0 14px;
  background: var(--phase);
}
.report-share i { display: block; height: 100%; }
.report-origin { display: flex; flex-direction: column; gap: 10px; }
.report-origin-row,
.report-mix-row,
.report-agent-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
}
.report-mix-row { grid-template-columns: minmax(0, 1fr) 92px auto; }
.report-agent-row { grid-template-columns: 72px 1fr auto; }
.report-port { color: #1e4d7b; font-weight: 800; letter-spacing: 0.04em; }
.report-track { height: 8px; border-radius: 99px; background: #eef3f8; overflow: hidden; }
.report-track i { display: block; height: 100%; border-radius: inherit; background: #3d82d6; }
.report-mix-row b,
.report-agent-row b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-pct { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .report-kpis,
  .report-split,
  .range-months { grid-template-columns: 1fr; }
  .range-pop { width: min(420px, calc(100vw - 24px)); flex-direction: column; }
  .range-presets { width: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
}
