:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #eef3ff;
  --line: #dbe4f0;
  --line-strong: #c6d3e4;
  --ink: #0f172a;
  --muted: #64748b;
  --nav-bg: #0f172a;
  --nav-panel: #111c31;
  --nav-line: rgba(148, 163, 184, 0.18);
  --brand: #2457e0;
  --brand-soft: rgba(36, 87, 224, 0.14);
  --success: #047857;
  --success-soft: rgba(4, 120, 87, 0.12);
  --warning: #c2410c;
  --warning-soft: rgba(194, 65, 12, 0.12);
  --danger: #be123c;
  --danger-soft: rgba(190, 18, 60, 0.12);
  --neutral-soft: rgba(100, 116, 139, 0.14);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --sidebar-width: 268px;
  --sidebar-toggle-size: 32px;
  --radius: 16px;
  --radius-sm: 12px;
  --sans: "Avenir Next", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

button,
input,
table {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.side-nav {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  width: var(--sidebar-width);
  padding: 24px 18px;
  background: linear-gradient(180deg, #0f172a 0%, #111c31 100%);
  color: #e2e8f0;
  transition: transform 220ms ease, box-shadow 220ms ease;
  z-index: 20;
}

.side-nav-footer {
  margin-top: auto;
  padding-top: 12px;
}

.app-shell.sidebar-collapsed .side-nav {
  transform: translateX(calc(-1 * var(--sidebar-width)));
  box-shadow: none;
}

.sidebar-toggle {
  position: fixed;
  top: 26px;
  left: calc(var(--sidebar-width) - (var(--sidebar-toggle-size) / 2));
  z-index: 30;
  width: var(--sidebar-toggle-size);
  height: var(--sidebar-toggle-size);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: #1f3f8b;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: left 220ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.app-shell.sidebar-collapsed .sidebar-toggle {
  left: 18px;
}

.side-brand-card,
.side-account-module {
  border: 1px solid var(--nav-line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.side-brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.side-brand-logo {
  display: block;
  width: 108px;
  height: auto;
  flex: 0 0 auto;
}

.side-brand-copy.compact {
  min-width: 0;
}

.side-brand-copy.compact h1 {
  font-size: 1.45rem;
  line-height: 1;
}

.side-brand-copy.single-line {
  display: flex;
  align-items: center;
}

.side-brand-copy h1,
.page-hero h2,
.card-head h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.side-eyebrow,
.page-eyebrow,
.card-eyebrow,
.metric-label {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-eyebrow {
  color: #94a3b8;
}

.side-caption {
  margin: 6px 0 0;
  color: #94a3b8;
  font-size: 0.87rem;
  line-height: 1.5;
}

.side-account-module {
  display: block;
  padding: 16px;
}

.side-account-name {
  font-weight: 700;
  font-size: 1.02rem;
}

.side-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.side-account-scope {
  margin-top: 10px;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.4;
}

.side-role-badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.role-admin {
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

.role-am {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
}

.role-pm {
  background: rgba(250, 204, 21, 0.16);
  color: #fde68a;
}

.role-bd {
  background: rgba(244, 114, 182, 0.15);
  color: #f9a8d4;
}

.role-om {
  background: rgba(125, 211, 252, 0.14);
  color: #bae6fd;
}

.role-hr {
  background: rgba(253, 224, 71, 0.16);
  color: #fde68a;
}

.side-section {
  display: grid;
  gap: 18px;
  margin-top: 8px;
  min-height: 0;
}

.nav-tree {
  display: grid;
  gap: 18px;
}

.menu-group {
  display: grid;
  gap: 14px;
}

.menu-parent,
.menu-child {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-parent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 28px;
  border-radius: 18px;
  color: #dbe3ef;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.2;
}

.menu-parent.active,
.menu-parent:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.menu-parent-copy {
  display: inline-flex;
  align-items: center;
}

.menu-arrow {
  font-size: 0.82rem;
  transition: transform 180ms ease;
}

.menu-group.open .menu-arrow {
  transform: rotate(0deg);
}

.menu-group:not(.open) .menu-arrow {
  transform: rotate(-90deg);
}

.menu-children {
  display: none;
  padding-left: 28px;
}

.menu-group.open .menu-children {
  display: grid;
  gap: 6px;
}

.menu-child {
  display: block;
  padding: 8px 0 8px 24px;
  color: #cfd6e2;
  font-size: 0.94rem;
  line-height: 1.3;
  position: relative;
}

.menu-child::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.65);
  transform: translateY(-50%);
}

.menu-child:hover {
  color: #ffffff;
}

.menu-child.active {
  color: #ffffff;
  font-weight: 500;
}

.menu-child.active::before {
  background: #ffffff;
}

.content-wrap {
  padding: 36px 30px 36px;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

.app-shell.sidebar-collapsed .content-wrap {
  margin-left: calc(-1 * var(--sidebar-width));
  width: calc(100% + var(--sidebar-width));
  padding-left: 72px;
}

.side-nav-footer .sidebar-logout-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.26) !important;
  color: #f8fafc;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(255, 255, 255, 0.16);
}

.side-nav-footer .sidebar-logout-button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.62) !important;
}

.page-hero {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 18px;
  min-height: 54px;
}

.module-switch {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.module-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #334155;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: none;
}

.module-button.active {
  background: #edf3ff;
  border-color: #c9d7f7;
  color: #1f3f8b;
  box-shadow: inset 0 0 0 1px rgba(36, 87, 224, 0.08);
}

.page-eyebrow,
.card-eyebrow {
  color: #64748b;
}

.page-subtitle {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

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

.btn {
  border-radius: 12px;
  padding: 11px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

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

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(36, 87, 224, 0.18);
}

.btn-ghost {
  background: #ffffff;
  color: #30507d;
  border-color: var(--line-strong);
}

.danger-action {
  color: #be123c;
  border-color: rgba(190, 18, 60, 0.18);
}

.btn-sm {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  box-shadow: none;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.metric-card,
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px 20px;
}

.metric-strip.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric-strip.compact .metric-card {
  padding: 14px 16px;
}

.metric-strip.compact .metric-value {
  font-size: 1.7rem;
}

.metric-strip.compact .metric-sub {
  margin-top: 6px;
  font-size: 0.92rem;
}

.metric-value {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.metric-sub {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.view-root {
  margin-top: 20px;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
  min-width: 0;
}

.page-grid.single-column {
  grid-template-columns: 1fr;
}

.main-card.full-width {
  width: 100%;
  min-width: 0;
}

.card {
  padding: 22px;
  min-width: 0;
}

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

.chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.chip {
  background: var(--surface-strong);
  color: #33507f;
}

.status-summary-card {
  margin: 0 0 14px;
  width: min(100%, 420px);
  padding: 14px 16px;
}

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

.status-summary-cell {
  display: grid;
  gap: 3px;
  min-height: 82px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.status-summary-cell.is-total {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.08) 0%, rgba(37, 99, 235, 0.03) 100%);
  border-color: rgba(37, 99, 235, 0.14);
}

.status-summary-cell.is-valid {
  background: linear-gradient(180deg, rgba(4, 120, 87, 0.08) 0%, rgba(4, 120, 87, 0.03) 100%);
  border-color: rgba(4, 120, 87, 0.12);
}

.status-summary-cell.is-invalid {
  background: linear-gradient(180deg, rgba(190, 18, 60, 0.08) 0%, rgba(190, 18, 60, 0.03) 100%);
  border-color: rgba(190, 18, 60, 0.12);
}

.status-summary-name {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-summary-value {
  font-size: 1.4rem;
  line-height: 1;
  color: #0f172a;
}

.status-summary-meta {
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.3;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 14px;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.table-wrap.is-dragging {
  cursor: grabbing;
}

.table-scroll-strip {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  -webkit-overflow-scrolling: touch;
}

.table-scroll-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.table-scroll-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: #3b4f72;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.table-scroll-strip-fill {
  height: 1px;
}

.table-scroll-strip::-webkit-scrollbar {
  height: 10px;
}

.table-scroll-strip::-webkit-scrollbar-track {
  background: #edf2fb;
  border-radius: 999px;
}

.table-scroll-strip::-webkit-scrollbar-thumb {
  background: #c2d1eb;
  border-radius: 999px;
}

.groupby-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 14px 16px;
}

.groupby-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.batch-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.batch-action-field {
  width: 180px;
}

.batch-action-bar .filter-select {
  height: 36px;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.batch-action-count {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

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

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 650;
}

.pagination-summary,
.pagination-page {
  min-width: 72px;
  text-align: center;
}

.pagination-size,
.pagination-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-select {
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 28px 0 10px;
  font: inherit;
}

.pagination-button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.pagination-button:hover:not(:disabled) {
  background: #f8fbff;
  border-color: #b8c6dc;
}

.pagination-button:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.filter-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  padding: 16px 18px 18px;
}

.filter-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 12px;
  align-items: end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.filter-field > span {
  color: #3f4b60;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.match-select-col {
  width: 54px;
  min-width: 54px;
  text-align: center;
}

.match-select-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
}

.match-row-check,
.trading-row-check,
.match-select-head input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2457e0;
}

.filter-input,
.filter-select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid #ced4da;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  font-size: 15px;
}

.filter-multi {
  position: relative;
}

.filter-multi[open] {
  z-index: 20;
}

.filter-multi-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #ced4da;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.filter-multi-summary::-webkit-details-marker {
  display: none;
}

.filter-multi-summary-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.filter-multi-summary-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1f2937;
  font-size: 15px;
}

.filter-multi-summary-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: #1d4ed8;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.filter-multi-summary-arrow {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: solid #7b8794;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.filter-multi-body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(max(100%, 220px), calc(100vw - 24px));
  min-width: min(max(100%, 220px), calc(100vw - 24px));
  border: 1px solid #d9dee7;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(23, 35, 61, 0.16);
  padding: 14px;
}

.filter-multi-search {
  width: 100%;
  height: 44px;
  margin-bottom: 10px;
  padding: 0 16px;
  border: 1px solid #dee2e6;
  border-radius: 14px;
  background: #fff;
  color: #1f2937;
  font-size: 15px;
}

.filter-multi-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px 8px;
}

.filter-multi-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.filter-multi-cancel {
  border: 0;
  background: transparent;
  color: #2457e0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.filter-multi-cancel:hover {
  color: #1e40af;
}

.filter-multi-hint {
  color: #2563eb;
  font-size: 15px;
  font-weight: 500;
}

.filter-multi-options {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.filter-multi-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 4px;
  color: #1f2937;
  font-size: 15px;
  cursor: pointer;
}

.filter-multi-option:hover {
  background: #f6f9ff;
}

.filter-multi-option input {
  margin: 0;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.filter-multi-count {
  color: #6b7280;
  font-size: 15px;
}

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

.groupby-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.groupby-label {
  font-weight: 700;
  font-size: 0.88rem;
  color: #111827;
  margin-right: 4px;
}

.group-chip-select {
  width: 150px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 0.84rem;
}

.group-inline-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.groupby-arrow {
  color: #94a3b8;
  font-size: 0.9rem;
}

.group-mini-button {
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  padding: 0 7px;
  font-size: 0.9rem;
}

.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.data-table-wide {
  width: max(100%, 2400px);
  min-width: 2400px;
}

.wish-list-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.wish-list-table th,
.wish-list-table td {
  white-space: normal;
}

.data-table thead {
  background: var(--surface-soft);
}

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.94rem;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child {
  border-left: 1px solid var(--line);
}

.data-table thead th {
  border-top: 1px solid var(--line);
}

.data-table th {
  position: relative;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.data-table th[draggable="true"] {
  cursor: grab;
}

.data-table th[draggable="true"]:active {
  cursor: grabbing;
}

.data-table.is-resizing-columns,
.data-table.is-resizing-columns * {
  cursor: col-resize;
  user-select: none;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 2;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.column-resize-handle::after {
  position: absolute;
  top: 22%;
  right: 3px;
  width: 1px;
  height: 56%;
  background: transparent;
  content: "";
}

.column-resize-handle:hover::after,
.data-table.is-resizing-columns .column-resize-handle::after {
  background: #2f64e8;
}

.column-hide-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  opacity: 0.7;
  padding: 0;
}

.column-hide-button:hover {
  border-color: var(--line);
  background: #eef4ff;
  color: #24416f;
  opacity: 1;
}

.column-selector-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(15 23 42 / 0.28);
}

.column-selector-dialog {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(15 23 42 / 0.22);
  padding: 20px;
}

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

.column-selector-eyebrow {
  margin: 0 0 4px;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.column-selector-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
}

.column-selector-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}

.column-selector-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.column-selector-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #1f2937;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 12px;
}

.column-selector-option:has(input:checked) {
  border-color: #2f64e8;
  background: #eef4ff;
  color: #14377e;
}

.column-selector-option input {
  accent-color: #2f64e8;
}

.column-selector-empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #64748b;
  font-weight: 700;
  padding: 18px;
  text-align: center;
}

.column-selector-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

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

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

.offer-editable-cell {
  cursor: text;
}

.offer-editable-cell:hover {
  outline: 1px dashed #94a3b8;
  outline-offset: 3px;
}

.data-table td.is-inline-editing {
  padding: 5px;
  background: #f8fbff;
}

.inline-cell-editor {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 80px;
  min-height: 30px;
  border: 1px solid #2f64e8;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
  outline: none;
  padding: 7px 9px;
}

input.inline-cell-editor {
  height: 32px;
}

textarea.inline-cell-editor {
  min-height: 44px;
  resize: vertical;
  white-space: normal;
}

.data-table td.is-saving-inline-edit .inline-cell-editor {
  opacity: 0.65;
}

.offer-detail-popover {
  position: relative;
}

.offer-detail-trigger {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.offer-detail-trigger::-webkit-details-marker {
  display: none;
}

.offer-detail-popover-body {
  position: fixed;
  z-index: 120;
  top: 0;
  left: 0;
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  padding: 14px;
}

.offer-detail-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.offer-detail-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.offer-detail-grid,
.offer-detail-form {
  display: flex;
  flex-direction: column;
}

.offer-detail-item,
.offer-detail-field {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.offer-detail-item:last-child,
.offer-detail-field:last-child {
  border-bottom: 0;
}

.offer-detail-item span,
.offer-detail-field span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.35;
}

.offer-detail-item strong {
  display: block;
  color: #0f172a;
  font-size: 0.84rem;
  font-weight: 650;
  white-space: normal;
  word-break: break-word;
}

.offer-detail-link {
  color: #1d4ed8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.offer-detail-field input,
.offer-detail-field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  padding: 8px 9px;
  font: inherit;
}

.pure-mode-card {
  background: linear-gradient(180deg, #ffffff 0%, #f6fff9 100%);
  border-color: #cfe7d7;
}

.pure-mode-table-wrap {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.6) 0%, rgba(248, 250, 252, 0.92) 100%);
  border-color: #cfe7d7;
}

.pure-mode-table-wrap .data-table thead {
  background: #f0fbf4;
}

.pure-mode-table-wrap .data-table tbody tr:hover {
  background: #f1fbf5;
}

.pure-mode-table-wrap .group-row td,
.pure-mode-card .group-row td {
  background: #ecf8f0;
  border-bottom-color: #cfe7d7;
  border-right-color: #cfe7d7;
}

.pure-mode-table-wrap .group-row:hover td,
.pure-mode-card .group-row:hover td {
  background: #ecf8f0;
}

.group-row td {
  background: #f5f8fe;
  border-bottom: 1px solid #d6e1f2;
  border-right: 1px solid #d6e1f2;
}

.group-row:hover td {
  background: #f5f8fe;
}

.group-row-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.group-row-label {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.group-row-count {
  margin-left: auto;
  color: #64748b;
  font-size: 0.82rem;
}

.mono {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.88rem;
}

.table-link {
  color: #2457e0;
  font-weight: 700;
  text-decoration: none;
}

.table-link.full-link {
  display: inline-block;
  min-width: 260px;
  white-space: nowrap;
  word-break: normal;
  line-height: 1.45;
}

.table-link:hover {
  text-decoration: underline;
}

.advertiser-config-table .btn {
  white-space: nowrap;
}

.advertiser-config-table th:nth-child(1),
.advertiser-config-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 88px;
  min-width: 88px;
  max-width: 88px;
}

.advertiser-config-table th:nth-child(2),
.advertiser-config-table td:nth-child(2) {
  position: sticky;
  left: 88px;
  z-index: 4;
  width: 280px;
  min-width: 280px;
  max-width: 280px;
}

.advertiser-config-table thead th:nth-child(1),
.advertiser-config-table thead th:nth-child(2) {
  z-index: 6;
  background: var(--surface-soft);
}

.advertiser-config-table tbody td:nth-child(1),
.advertiser-config-table tbody td:nth-child(2) {
  background: #ffffff;
}

.advertiser-config-table tbody tr:hover td:nth-child(1),
.advertiser-config-table tbody tr:hover td:nth-child(2) {
  background: #f8fbff;
}

.trading-market-table {
  min-width: 2550px;
}

.trading-market-table th:nth-child(1),
.trading-market-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 4;
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.trading-market-table th:nth-child(2),
.trading-market-table td:nth-child(2) {
  position: sticky;
  left: 52px;
  z-index: 4;
  width: 96px;
  min-width: 96px;
  max-width: 96px;
}

.trading-market-table thead th:nth-child(1),
.trading-market-table thead th:nth-child(2) {
  z-index: 6;
  background: var(--surface-soft);
}

.trading-market-table tbody td:nth-child(1),
.trading-market-table tbody td:nth-child(2) {
  background: #ffffff;
}

.trading-market-table tbody tr:hover td:nth-child(1),
.trading-market-table tbody tr:hover td:nth-child(2) {
  background: #f8fbff;
}

.trading-detail-cell {
  min-width: 116px;
  max-width: 116px;
  white-space: nowrap;
}

.trading-detail-trigger-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trading-detail-popover {
  position: relative;
  display: inline-block;
}

.trading-detail-popover[open] {
  z-index: 35;
}

.trading-detail-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #bcd0ff;
  background: #ffffff;
  color: #2457e0;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.trading-detail-trigger::-webkit-details-marker {
  display: none;
}

.trading-detail-popover-body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(420px, 56vw);
  max-height: 360px;
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid #d9dee7;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(23, 35, 61, 0.16);
}

.trading-detail-popover-body.is-editing {
  width: min(520px, 62vw);
}

.trading-detail-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.trading-detail-editor-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trading-detail-popover-copy {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.5;
}

.trading-detail-popover-copy p {
  margin: 0;
  white-space: normal;
}

.trading-detail-popover-raw {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.82rem;
  word-break: break-word;
}

.trading-detail-editor {
  min-height: 220px;
  width: 100%;
}

.trading-number-cell {
  font-variant-numeric: tabular-nums;
}

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

.cell-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.match-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  min-width: 420px;
}

.match-detail-card {
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.match-detail-card.tone-success {
  border-color: rgba(4, 120, 87, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f2fbf7 100%);
}

.match-detail-card.tone-info {
  border-color: rgba(29, 78, 216, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.match-detail-card.tone-warning {
  border-color: rgba(194, 65, 12, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
}

.match-detail-card.tone-danger {
  border-color: rgba(190, 18, 60, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff5f8 100%);
}

.match-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.match-detail-label {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.match-detail-card .badge {
  padding: 4px 8px;
  font-size: 0.72rem;
  line-height: 1;
  min-height: 24px;
  align-self: flex-start;
}

.match-detail-note {
  color: #475569;
  font-size: 0.76rem;
  line-height: 1.35;
  white-space: normal;
}

.match-detail-note-strip {
  margin-top: auto;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(203, 213, 225, 0.45);
}

.match-detail-card.tone-success .match-detail-note-strip {
  background: rgba(4, 120, 87, 0.06);
  border-color: rgba(4, 120, 87, 0.1);
}

.match-detail-card.tone-info .match-detail-note-strip {
  background: rgba(29, 78, 216, 0.06);
  border-color: rgba(29, 78, 216, 0.1);
}

.match-detail-card.tone-warning .match-detail-note-strip {
  background: rgba(194, 65, 12, 0.06);
  border-color: rgba(194, 65, 12, 0.1);
}

.match-detail-card.tone-danger .match-detail-note-strip {
  background: rgba(190, 18, 60, 0.06);
  border-color: rgba(190, 18, 60, 0.1);
}

.action-button-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.match-action-panel {
  display: grid;
  gap: 12px;
  min-width: 240px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.match-action-panel.tone-success {
  border-color: rgba(4, 120, 87, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f2fbf7 100%);
}

.match-action-panel.tone-warning {
  border-color: rgba(194, 65, 12, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff8f2 100%);
}

.match-action-panel.tone-danger {
  border-color: rgba(190, 18, 60, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #fff5f8 100%);
}

.match-action-panel.tone-info {
  border-color: rgba(29, 78, 216, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
}

.match-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-action-copy {
  display: grid;
  gap: 4px;
}

.match-ai-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-action-readonly {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.match-action-title {
  color: #0f172a;
  font-size: 0.98rem;
  line-height: 1.2;
}

.match-ai-reason-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-reason-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.8);
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.2;
  white-space: nowrap;
}

.status-stack {
  display: grid;
  gap: 14px;
}

.status-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.status-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.meta-list {
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.meta-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.meta-list dt,
.meta-list dd {
  margin: 0;
  font-size: 0.9rem;
}

.meta-list dt {
  color: var(--muted);
}

.meta-list dd {
  text-align: right;
  font-weight: 600;
}

.badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.info {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.neutral {
  background: var(--neutral-soft);
  color: #475569;
}

.badge-offer-type {
  border: 1px solid transparent;
}

.badge-offer-type-direct {
  background: #e7f7f1;
  border-color: #bfe7d6;
  color: #047857;
}

.badge-offer-type-agency {
  background: #fff4de;
  border-color: #fed7aa;
  color: #b45309;
}

.badge-offer-type-unclassified {
  background: #f1f5f9;
  border-color: #dbe4ef;
  color: #64748b;
}

.badge-offer-type-other {
  background: #edf2ff;
  border-color: #c7d2fe;
  color: #3730a3;
}

.badge-os,
.badge-geo,
.badge-model,
.badge-mmp,
.badge-type {
  border: 1px solid transparent;
}

.badge-os {
  background: #eef4ff;
  border-color: #cddcff;
  color: #2752b3;
}

.badge-os-android {
  background: #eef9f1;
  border-color: #cbe8d3;
  color: #257245;
}

.badge-os-ios {
  background: #edf3ff;
  border-color: #d2dfff;
  color: #345cb3;
}

.offer-kpi-column {
  min-width: 220px;
  width: 220px;
  max-width: 220px;
}

.offer-kpi-cell {
  display: inline-block;
  width: 100%;
  max-width: 220px;
  position: relative;
}

.offer-kpi-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.offer-kpi-clamp {
  flex: 1 1 auto;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  max-height: 2.7em;
  white-space: pre-line;
  word-break: break-word;
  text-align: left;
}

.offer-kpi-more {
  flex: 0 0 auto;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2457e0;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.offer-kpi-popover-body {
  position: fixed;
  z-index: 2000;
  width: min(420px, 48vw);
  min-width: 260px;
  padding: 10px 12px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  color: #334155;
  line-height: 1.5;
  white-space: pre-line;
  word-break: break-word;
  text-align: left;
  max-height: 240px;
  overflow: auto;
}

.badge-geo {
  background: #f5f7fb;
  border-color: #dde4ee;
  color: #475569;
}

.badge-model {
  background: #fff5e8;
  border-color: #f5d6ad;
  color: #a55a08;
}

.badge-mmp {
  background: #eef7ff;
  border-color: #cde0f7;
  color: #295c94;
}

.badge-type {
  background: #f4f1ff;
  border-color: #ded6ff;
  color: #5b4bb5;
}

.badge-traffic-vta,
.badge-traffic-cta,
.badge-traffic-ctv {
  background: #fff9ef;
  border-color: #ead2a5;
  color: #9a6200;
}

.badge-select {
  display: inline-flex;
  align-items: center;
  min-width: 118px;
  height: 40px;
  padding: 0 34px 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.82rem;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  box-shadow: none;
}

.badge-select.success {
  background-color: var(--success-soft);
  border-color: rgba(4, 120, 87, 0.14);
  color: var(--success);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23047857' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.badge-select.danger {
  background-color: var(--danger-soft);
  border-color: rgba(190, 18, 60, 0.12);
  color: var(--danger);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23be123c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.badge-select.badge-type {
  background-color: #f4f1ff;
  border-color: #ded6ff;
  color: #5b4bb5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b4bb5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.badge-select.badge-type.type-online {
  background-color: #eef7ff;
  border-color: #cde0f7;
  color: #295c94;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23295c94' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.badge-select.badge-type.type-offline {
  background-color: #f4f1ff;
  border-color: #ded6ff;
  color: #5b4bb5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%235b4bb5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.editable-period-cell {
  min-width: 120px;
}

.editable-period-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f2d4d;
  cursor: pointer;
}

.editable-period-trigger:focus-visible {
  outline: none;
}

.editable-period-value {
  white-space: nowrap;
}

.editable-period-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid #d9dee7;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.74rem;
  line-height: 1;
  transition: border-color 0.16s ease, color 0.16s ease;
}

.editable-period-trigger:hover .editable-period-icon,
.editable-period-trigger:focus-visible .editable-period-icon {
  border-color: #93c5fd;
  color: #2457e0;
}

.inline-period-input {
  width: 92px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 700;
}

.editable-trading-cell {
  min-width: 120px;
}

.editable-trading-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: text;
}

.editable-trading-icon {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.editable-trading-icon:hover {
  color: #2457e0;
}

.inline-trading-input,
.inline-trading-textarea {
  width: 100%;
  min-width: 96px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 0.84rem;
}

.inline-trading-input {
  height: 38px;
  padding: 0 12px;
  font-weight: 700;
}

.inline-trading-textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}

.trading-badge-select {
  min-width: 88px;
  height: 30px;
  padding: 0 30px 0 12px;
  border-radius: 999px;
  border: 1px solid #f5d6ad;
  background-color: #fff5e8;
  color: #a55a08;
  font-size: 0.78rem;
  font-weight: 700;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23a55a08' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  appearance: none;
  cursor: pointer;
}

.trading-cell-multi {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.trading-cell-multi[open] {
  z-index: 30;
}

.trading-cell-multi-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  list-style: none;
  cursor: pointer;
}

.trading-cell-multi-summary::-webkit-details-marker {
  display: none;
}

.trading-cell-multi-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.trading-cell-multi-summary .filter-multi-summary-arrow {
  width: 8px;
  height: 8px;
  margin-left: 2px;
}

.trading-cell-multi-body {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 148px;
  padding: 10px;
  border: 1px solid #d9dee7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(23, 35, 61, 0.16);
}

.trading-cell-multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  cursor: pointer;
}

.trading-cell-multi-option input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: #2457e0;
}

.offerlist-source-cell {
  min-width: 280px;
}

.offerlist-link-input {
  width: 100%;
  min-width: 240px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #334155;
}

.offerlist-upload-zone {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 240px;
  padding: 12px 14px;
  border: 1px dashed #c9d7f7;
  border-radius: 12px;
  background: #f8fbff;
  cursor: pointer;
}

.offerlist-upload-zone.is-dragover {
  border-color: #2457e0;
  background: #edf3ff;
}

.offerlist-upload-input {
  display: none;
}

.offerlist-upload-title {
  color: #1f3f8b;
  font-weight: 700;
  font-size: 0.86rem;
}

.offerlist-upload-sub {
  color: #64748b;
  font-size: 0.78rem;
}

.offerlist-upload-file {
  margin-top: 8px;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-all;
}

.compact-source-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 360px;
}

.compact-source-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  flex-shrink: 0;
}

.compact-source-tab {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.compact-source-tab.active {
  background: #2457e0;
  color: #fff;
}

.compact-upload-button,
.compact-text-input,
.compact-textarea-input {
  height: 40px;
  min-width: 0;
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #334155;
}

.compact-upload-button {
  padding: 0 14px;
  text-align: left;
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.compact-text-input,
.compact-textarea-input,
.offerlist-textarea,
.config-textarea {
  width: 100%;
}

.compact-text-input {
  padding: 0 12px;
}

.compact-textarea-input {
  min-height: 92px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}

.offerlist-textarea,
.config-textarea {
  min-width: 240px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: #334155;
  line-height: 1.5;
  resize: vertical;
}

.confidence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 10px;
}

.confidence-bar {
  position: relative;
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: #e8eef9;
  overflow: hidden;
}

.confidence-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #2457e0 0%, #3b82f6 100%);
}

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

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

.config-summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.config-summary-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.config-form {
  display: grid;
  gap: 18px;
}

.config-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 22px;
  overflow-x: auto;
}

.config-tab {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 12px 0 10px;
  white-space: nowrap;
}

.config-tab.active {
  border-bottom-color: #2457e0;
  color: #123b91;
}

.config-tab-panel {
  max-width: 980px;
}

.config-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.config-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  max-width: 760px;
}

.config-field {
  display: grid;
  gap: 8px;
}

.config-field label {
  font-weight: 700;
  color: #1f2937;
}

.config-field input,
.config-field select {
  width: 100%;
  max-width: 540px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: #334155;
}

.config-field input[type="file"] {
  height: auto;
  padding: 10px 12px;
}

.config-field textarea {
  width: 100%;
  max-width: 540px;
}

.bot-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

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

.bot-form-grid .config-field input,
.bot-form-grid .config-field select {
  max-width: none;
}

.bot-workspace-table {
  width: 100%;
  min-width: 980px;
}

.empty-cell {
  color: var(--muted);
  font-weight: 600;
  text-align: center !important;
  white-space: normal !important;
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.field-hint,
.upload-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.config-actions {
  display: flex;
  gap: 12px;
}

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

.mapping-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mapping-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  max-width: 760px;
  margin: 18px 0 16px;
  padding: 14px;
  background: #f7faff;
  border: 1px solid #d8e5f6;
  border-radius: 8px;
}

.mapping-setting-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
}

.mapping-setting-label {
  color: #24364f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.mapping-setting-control {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.offerlist-mapping-form .mapping-setting-item input {
  box-sizing: border-box;
  height: 34px;
  border: 1px solid #c7d6ea;
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  padding: 0 11px;
  appearance: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.offerlist-mapping-form .mapping-setting-item input:focus {
  border-color: #2f5be8;
  box-shadow: 0 0 0 3px rgba(47, 91, 232, 0.12);
}

.mapping-sheet-input {
  width: 260px;
}

.mapping-setting-hint {
  color: #91a0b5;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.mapping-row-number-field {
  min-width: 0;
}

.offerlist-mapping-form .mapping-row-number-field input {
  width: 82px;
}

.sheet-group-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.sheet-group-card {
  border: 1px solid #d8e5f6;
  border-radius: 10px;
  background: #fbfdff;
  overflow: hidden;
}

.sheet-group-card.is-invisible {
  border-color: #d5dce8;
  background: #f8fafc;
}

.sheet-group-head {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: #f6f9fe;
  border-bottom: 1px solid #d8e5f6;
}

.sheet-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #17243b;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}

.sheet-group-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.sheet-group-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #42536e;
  font-size: 12px;
  font-weight: 800;
}

.sheet-group-controls input {
  height: 34px;
  border: 1px solid #c7d6ea;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  padding: 0 11px;
}

.sheet-group-controls [name="sheet_name"] {
  width: 220px;
}

.sheet-group-controls [name="header_row_number"] {
  width: 82px;
}

.sheet-group-visibility {
  min-height: 34px;
  border: 1px solid #b9c9ec;
  border-radius: 8px;
  background: #eef4ff;
  color: #1f3f8b;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  white-space: nowrap;
}

.sheet-group-visibility:hover:not(:disabled) {
  border-color: #8aa7e4;
  background: #e5efff;
}

.sheet-group-card.is-invisible .sheet-group-visibility {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}

.sheet-group-card.is-invisible .sheet-group-head {
  background: #f8fafc;
}

.sheet-group-visibility:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.sheet-group-delete {
  min-height: 34px;
  border: 1px solid #f2c8d2;
  border-radius: 8px;
  background: #fff8fa;
  color: #c05a75;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  white-space: nowrap;
}

.sheet-group-delete:hover:not(:disabled) {
  border-color: #e8a8b8;
  background: #fff1f5;
}

.sheet-group-delete:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.sheet-group-body {
  padding: 0 12px 12px;
}

.sheet-group-body.is-collapsed {
  display: none;
}

.add-sheet-group-btn {
  align-self: flex-start;
  margin-top: 14px;
}

.mapping-table-wrap {
  width: 100%;
  margin-top: 14px;
  overflow: auto;
}

.mapping-table {
  min-width: 860px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.mapping-table th,
.mapping-table td {
  vertical-align: middle;
}

.mapping-table th:nth-child(1),
.mapping-table td:nth-child(1) {
  width: 190px;
}

.mapping-table th:nth-child(2),
.mapping-table td:nth-child(2) {
  width: 390px;
}

.mapping-table th:nth-child(3),
.mapping-table td:nth-child(3) {
  width: 280px;
}

.mapping-field-name {
  color: #0f172a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
}

.mapping-description {
  color: #334155;
  line-height: 1.6;
}

.mapping-value-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #0f172a;
}

.global-mapping-table th:nth-child(3),
.global-mapping-table td:nth-child(3) {
  width: 980px;
  white-space: nowrap;
}

.global-mapping-value-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
}

.global-mapping-expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border: 1px solid #c8d6ea;
  border-radius: 999px;
  background: #ffffff;
  color: #1f3f8b;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.global-mapping-child-row td {
  background: #fbfdff;
}

.global-mapping-child-name {
  padding-left: 38px !important;
  color: #1f3f8b;
}

.global-mapping-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 7px 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  max-height: 74px;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid #e0e9f7;
  border-radius: 12px;
  background: #f8fbff;
}

.global-mapping-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: none;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid #bed2ee;
  border-radius: 999px;
  background: #ffffff;
  color: #17243b;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.global-mapping-pill.source-status {
  background: #fff8ec;
  border-color: #f3d49c;
  color: #7c4a03;
}

.global-mapping-value {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.global-mapping-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #c9d8f0;
  border-radius: 999px;
  background: #f8fbff;
  color: #2f5be8;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  transform: scale(0.86);
  transition: opacity 120ms ease, transform 120ms ease, background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}

.global-mapping-action.danger {
  border-color: #fecdd3;
  background: #fff5f6;
  color: #dc2626;
  font-size: 12px;
}

.global-mapping-pill:hover .global-mapping-action,
.global-mapping-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.global-mapping-action:hover {
  border-color: #8aa7e4;
  background: #eef4ff;
}

.global-mapping-action.danger:hover {
  border-color: #fda4af;
  background: #ffe9ed;
}

.global-mapping-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.global-mapping-add-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.empty-cell-inline {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.global-mapping-loading {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.app-shell.auth-screen {
  display: block;
}

.app-shell.auth-screen .side-nav,
.app-shell.auth-screen .sidebar-toggle {
  display: none;
}

.app-shell.auth-screen .page-hero,
.app-shell.auth-screen .metric-strip {
  display: none !important;
}

.app-shell.auth-screen .content-wrap {
  min-height: 100vh;
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-shell.auth-screen .view-root {
  width: 100%;
  margin-top: 0;
}

.login-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-shell {
  width: min(760px, 96vw);
  border: 1px solid #dbe2ec;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.1);
}

.brand-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(920px 360px at -10% 0%, rgba(233, 200, 71, 0.24), transparent 55%),
    radial-gradient(740px 300px at 110% 110%, rgba(168, 180, 74, 0.22), transparent 56%),
    linear-gradient(145deg, #f6f8fc 0%, #eef3fb 100%);
  border-bottom: 1px solid #e3e8f2;
  padding: 28px 24px;
}

.brand-strip {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 12px;
  padding: 12px 16px;
  width: fit-content;
}

.brand-strip img {
  width: 210px;
  height: auto;
  max-height: 58px;
  object-fit: contain;
}

.brand-strip .title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  color: #111827;
}

.login-panel {
  padding: 30px 30px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.panel-title {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 800;
  color: #111827;
}

.panel-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: #6b7280;
}

.login-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(190, 18, 60, 0.18);
  border-radius: 12px;
  background: rgba(190, 18, 60, 0.08);
  color: #be123c;
  font-size: 0.92rem;
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field label {
  font-size: 15px;
  font-weight: 700;
}

.login-field input {
  min-height: 50px;
  border-radius: 12px;
  font-size: 16px;
  border: 1px solid #cfd8e6;
  padding: 0 14px;
}

.login-form .btn {
  min-height: 50px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

@media (max-width: 1180px) {
  .metric-strip,
  .page-grid {
    grid-template-columns: 1fr;
  }

  .config-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

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

  .side-nav {
    position: relative;
    width: auto;
    height: auto;
    transform: none !important;
  }

  .sidebar-toggle {
    display: none;
  }

  .content-wrap {
    margin-left: 0;
    width: 100%;
    padding: 22px 16px 28px;
  }

  .page-hero {
    flex-direction: column;
  }

  .brand-hero {
    padding: 20px 14px;
  }

  .brand-strip {
    padding: 10px 12px;
  }

  .brand-strip img {
    width: 170px;
    max-height: 46px;
  }

  .brand-strip .title {
    font-size: 34px;
  }

  .login-panel {
    padding: 20px 16px;
  }

  .status-summary-card {
    width: 100%;
  }

  .status-summary-grid {
    grid-template-columns: 1fr;
  }
}
