:root {
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --ink: #1d1a14;
  --muted: #6c6558;
  --line: #dbd3c4;
  --accent: #945f18;
  --accent-soft: #efe0c4;
  --danger: #a0382b;
  --danger-soft: #f7ddd7;
  --ok: #2f6f4f;
  --ok-soft: #dff1e8;
  --warn: #8b6b1a;
  --warn-soft: #f7edca;
  --shadow: 0 10px 25px rgba(55, 39, 18, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(148,95,24,0.08), transparent 30%),
    linear-gradient(180deg, #f8f4ec 0%, var(--bg) 100%);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255,253,248,0.92);
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #38240a, #a56a1b);
  color: white; display:flex; align-items:center; justify-content:center; font-weight:700;
}
.brand-title { font-weight: 700; }
.brand-subtitle { font-size: 12px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; }
.nav-link {
  text-decoration: none; color: var(--ink);
  padding: 10px 12px; border-radius: 12px; font-size: 14px;
}
.nav-link.active, .nav-link:hover {
  background: var(--accent-soft);
  color: #5c3708;
}
.main { padding: 28px; }
.page-header {
  margin-bottom: 18px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 30px; }
.page-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.page-header-user {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
}
.header-link {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  font-size: 13px;
}
.header-link:hover {
  background: var(--accent-soft);
  color: #5c3708;
}
.header-link.logout-link {
  border-color: #e3c7c2;
  color: var(--danger);
}
.header-link.logout-link:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.logout-body {
  display: block;
  min-height: 100vh;
}

.logout-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.logout-card {
  width: min(680px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.logout-card h1 {
  margin: 0 0 14px;
  font-size: 30px;
}

.logout-card p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
}

.logout-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; }
.two-col { grid-template-columns: 2fr 1fr; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stat-card { padding: 16px 18px; }
.stat-label { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.dashboard-pulse-board {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid rgba(44, 77, 86, 0.14);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(56, 132, 148, 0.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(35, 109, 74, 0.14), transparent 24%),
    linear-gradient(135deg, #0f1d24 0%, #162b32 52%, #1d3740 100%);
  box-shadow: 0 18px 40px rgba(14, 28, 34, 0.18);
  color: #eef6f7;
}
.dashboard-pulse-gridlines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(153, 214, 226, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(153, 214, 226, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.45), transparent 92%);
  pointer-events: none;
}
.dashboard-pulse-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}
.dashboard-pulse-orb.orb-a {
  width: 180px;
  height: 180px;
  right: -20px;
  top: -28px;
  background: radial-gradient(circle, rgba(92, 228, 255, 0.22), transparent 70%);
}
.dashboard-pulse-orb.orb-b {
  width: 160px;
  height: 160px;
  left: 28%;
  bottom: -54px;
  background: radial-gradient(circle, rgba(89, 255, 178, 0.16), transparent 72%);
}
.dashboard-pulse-copy {
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
}
.dashboard-pulse-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(218, 239, 241, 0.72);
  margin-bottom: 8px;
}
.dashboard-pulse-copy h2 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.05;
}
.dashboard-pulse-copy p {
  margin: 0;
  max-width: 760px;
  color: rgba(226, 240, 242, 0.82);
  font-size: 14px;
}
.dashboard-pulse-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr 1.1fr;
  gap: 16px;
}
.dashboard-pulse-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(231, 243, 245, 0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  backdrop-filter: blur(8px);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.dashboard-pulse-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(143, 240, 255, 0.08), transparent 42%, transparent 65%, rgba(255,255,255,0.05));
  pointer-events: none;
}
.dashboard-pulse-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.dashboard-pulse-chip,
.dashboard-pulse-signal {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
}
.dashboard-pulse-chip {
  color: rgba(223, 243, 246, 0.8);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(219, 240, 242, 0.12);
}
.dashboard-pulse-signal {
  position: relative;
  padding-left: 18px;
  color: #d8f2f4;
}
.dashboard-pulse-signal::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  transform: translateY(-50%);
}
.dashboard-pulse-signal.signal-live::before {
  background: #77ffb2;
  box-shadow: 0 0 12px rgba(119,255,178,0.9);
}
.dashboard-pulse-signal.signal-scan::before {
  background: #81e2ff;
  box-shadow: 0 0 12px rgba(129,226,255,0.88);
}
.dashboard-pulse-signal.signal-hold::before {
  background: #f7d36b;
  box-shadow: 0 0 12px rgba(247,211,107,0.72);
}
.dashboard-pulse-label {
  font-size: 13px;
  color: rgba(220, 239, 242, 0.78);
  margin-bottom: 14px;
}
.dashboard-pulse-value {
  display: block;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-shadow: 0 0 22px rgba(151, 230, 246, 0.12);
}
.dashboard-pulse-meta {
  margin-top: 10px;
  color: rgba(219, 238, 241, 0.72);
  font-size: 13px;
}
.dashboard-pulse-subline {
  margin-top: auto;
  padding-top: 14px;
  color: rgba(219, 238, 241, 0.64);
  font-size: 13px;
}
.dashboard-pulse-delta {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
}
.dashboard-pulse-delta span {
  font-size: 12px;
  color: rgba(224, 240, 243, 0.72);
}
.dashboard-pulse-delta strong {
  font-size: 24px;
  line-height: 1;
}
.dashboard-pulse-delta em {
  font-style: normal;
  font-size: 13px;
  color: rgba(224, 240, 243, 0.72);
}
.dashboard-pulse-delta.tone-up {
  border: 1px solid rgba(78, 199, 138, 0.22);
  background: linear-gradient(180deg, rgba(54, 140, 98, 0.22), rgba(38, 90, 67, 0.16));
}
.dashboard-pulse-delta.tone-up strong {
  color: #8ff0bc;
}
.dashboard-pulse-delta.tone-down {
  border: 1px solid rgba(236, 113, 105, 0.24);
  background: linear-gradient(180deg, rgba(157, 54, 49, 0.28), rgba(110, 34, 31, 0.18));
}
.dashboard-pulse-delta.tone-down strong {
  color: #ffb5ad;
}
.dashboard-pulse-delta.tone-flat {
  border: 1px solid rgba(225, 233, 236, 0.14);
}

@media (max-width: 1100px) {
  .dashboard-pulse-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-pulse-card {
    min-height: auto;
  }
}

.panel { margin-bottom: 18px; }
.panel-header { padding: 18px 18px 0; }
.panel-header h2 { margin: 0 0 6px; font-size: 18px; }
.panel-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 18px; }
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.filters label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.filters input, .filters select, .filters button {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  background: white;
}
.filters button {
  background: #22190d;
  color: white;
  border: none;
  cursor: pointer;
  margin-top: auto;
}
.filters-danger { margin-top: 14px; }
.filters .danger-button { background: #a12323; }
.filters .danger-button:hover { background: #861d1d; }
.filter-actions { display: flex; align-items: end; }
.asin-tags-cell {
  display: grid;
  gap: 7px;
  min-width: 180px;
}
.asin-tags-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.asin-tags-editor summary {
  width: fit-content;
  list-style: none;
  cursor: pointer;
  color: #6e4a13;
  font-size: 12px;
  font-weight: 700;
}
.asin-tags-editor summary::-webkit-details-marker { display: none; }
.asin-tags-editor summary:hover { text-decoration: underline; }
.asin-tags-editor[open] summary { margin-bottom: 6px; }
.inline-edit-form {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 220px;
}
.inline-edit-form input {
  width: 150px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 8px;
  font-size: 13px;
}
.inline-edit-form button {
  border: 0;
  border-radius: 9px;
  padding: 7px 9px;
  background: #22190d;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
tr:hover td { background: #fcf8ef; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 8px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-default { background: #ece7db; color: #4c4538; }
.badge-success { background: var(--ok-soft); color: var(--ok); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warn-soft); color: var(--warn); }
.badge-failed { background: var(--danger-soft); color: var(--danger); }
.badge-running { background: var(--warn-soft); color: var(--warn); }
.badge-partial { background: #ede0ff; color: #66419b; }
.subnav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.page-summary { color: var(--muted); font-size: 13px; margin-right: 6px; }
.page-link {
  text-decoration: none; color: var(--ink); padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: white;
}
.page-link.active { background: #21180d; color: white; border-color: #21180d; }
.kv-grid {
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.kv-grid .kv-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 16px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(130, 103, 64, 0.12);
}
.kv-grid .kv-row:last-child {
  border-bottom: none;
}
.kv-grid-wide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 18px;
  font-size: 14px;
}
.kv-grid-wide .kv-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.6);
}
.kv-key { color: var(--muted); }
.kv-grid .kv-key {
  font-size: 13px;
}
.kv-grid .kv-value {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}
.kv-grid-wide .kv-key {
  font-size: 12px;
}
.kv-grid-wide .kv-value {
  font-size: 18px;
  font-weight: 600;
}

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

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

@media (max-width: 640px) {
  .kv-grid-wide {
    grid-template-columns: 1fr;
  }
}
.json-block {
  background: rgba(255,255,255,0.86);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 14px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
}
.empty-state {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,0.5);
}
.chart-list { display: grid; gap: 10px; }
.chart-row {
  display: grid; grid-template-columns: 120px 1fr 90px;
  gap: 12px; align-items: center;
}
.chart-label, .chart-value { font-size: 13px; color: var(--muted); }
.chart-bar { height: 12px; border-radius: 999px; background: #efe7d9; overflow: hidden; }
.chart-fill { height: 100%; background: linear-gradient(90deg, #b37827, #5d3911); }
.trend-chart-card { display: grid; gap: 10px; }
.trend-chart-legend { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.trend-chart-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.trend-chart-chip.chip-order { background: rgba(15, 118, 110, 0.12); color: #0f766e; }
.trend-chart-chip.chip-ads { background: rgba(194, 65, 12, 0.12); color: #c2410c; }
.trend-chart-meta { font-size: 12px; color: var(--muted); }
.trend-chart-svg { width: 100%; height: auto; display: block; border: 1px solid #eadfcd; border-radius: 18px; background: #fffaf2; }
.link-list { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.inline-link:hover { text-decoration: underline; }

.materials-thumb-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  background: #efe6d8;
}

.materials-thumb-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #efe6d8;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  box-sizing: border-box;
}

.ops-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.ops-tool-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247,240,227,0.92));
}

.ops-tool-thumb {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  background: #efe6d8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ops-tool-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ops-tool-thumb-placeholder {
  padding: 10px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.06em;
}

.ops-tool-content h3 {
  margin: 8px 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.ops-tool-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ops-tool-scope,
.ops-tool-meta {
  color: var(--muted);
  font-size: 13px;
}

.ops-tool-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ops-tool-finance {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ops-tool-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.ops-tool-stat {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(148,95,24,0.08);
  border: 1px solid rgba(148,95,24,0.12);
}

.ops-tool-stat span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.ops-tool-stat strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.chat-timeline {
  display: grid;
  gap: 14px;
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.chat-message-user {
  border-left: 5px solid #7a4c12;
}

.chat-message-assistant {
  border-left: 5px solid #28573f;
}

.chat-message-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  background: rgba(245, 241, 232, 0.8);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.chat-role {
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.chat-model,
.chat-time {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
}

.chat-message-body {
  padding: 14px;
}

.chat-text-preview {
  white-space: pre-wrap;
  line-height: 1.7;
}

.chat-json-preview {
  display: grid;
  gap: 14px;
}

.chat-findings {
  display: grid;
  gap: 10px;
}

.chat-findings-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfaf5;
}

.chat-findings-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.chat-findings-meta {
  font-size: 12px;
  color: var(--muted);
}

.chat-json-details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9f5ed;
  overflow: hidden;
}

.chat-json-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.65);
}

.chat-json-details .json-block {
  margin: 0;
  border-radius: 0;
}

.contract-preview-frame {
  display: flex;
  justify-content: center;
  padding: 28px 16px 36px;
  background:
    linear-gradient(180deg, #efe7da 0%, #e6dccb 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow-x: auto;
}

.contract-preview-frame > * {
  width: 210mm;
  min-height: 297mm;
  padding: 18mm 16mm;
  background: #fff;
  color: #111;
  box-shadow: 0 18px 45px rgba(43, 31, 16, 0.18);
  border: 1px solid #ddd2c0;
}

.contract-preview-frame table {
  background: #fff;
}

.contract-doc {
  min-height: calc(297mm - 36mm);
  display: flex;
  flex-direction: column;
}

.contract-doc__header {
  border-bottom: 2px solid #2f271c;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.contract-doc__header-line {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
}

.contract-doc__meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #494033;
}

.contract-doc__section {
  margin-bottom: 14px;
}

.contract-doc__section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 4px solid #6e5325;
}

.contract-doc p {
  margin: 5px 0;
  text-align: justify;
}

.contract-doc__party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contract-doc__party-block {
  padding: 10px 12px;
  border: 1px solid #d9d0bf;
  background: #fcfaf6;
}

.contract-doc__party-name {
  font-weight: 700;
  margin-bottom: 6px;
}

.contract-doc table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}

.contract-doc th,
.contract-doc td {
  border: 1px solid #6b624f;
  padding: 8px 10px;
  text-align: center;
}

.contract-doc th {
  background: #f3ede2;
  font-weight: 700;
}

.contract-doc__signatures {
  margin-top: auto;
  padding-top: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.contract-doc__sign-box {
  min-height: 96px;
}

.contract-doc__sign-title {
  font-weight: 700;
  margin-bottom: 32px;
}

.contract-doc__sign-line {
  border-bottom: 1px solid #2f271c;
  margin-bottom: 14px;
}

.contract-doc__sign-date,
.contract-doc__footer {
  font-size: 12px;
  color: #605646;
}

.contract-doc__footer {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #d6cbb8;
  text-align: center;
}

@media print {
  body {
    display: block;
    background: #fff;
  }
  .sidebar,
  .page-header,
  .panel-header,
  .link-list,
  .filters {
    display: none !important;
  }
  .main,
  .panel,
  .panel-body,
  .contract-preview-frame {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .contract-preview-frame > * {
    width: auto;
    min-height: auto;
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
  }
  @page {
    size: A4;
    margin: 12mm;
  }
}

@media (max-width: 900px) {
  .contract-preview-frame > * {
    width: min(100%, 210mm);
    min-height: auto;
    padding: 14mm 10mm;
  }

  .contract-doc__meta,
  .contract-doc__party-grid,
  .contract-doc__signatures {
    grid-template-columns: 1fr;
    display: grid;
    gap: 12px;
  }
}

@media (max-width: 1100px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .main { padding: 18px; }
  .two-col { grid-template-columns: 1fr; }
  .page-header-tools { justify-content: flex-start; }
}

.share-body {
  display: block;
  min-width: 0;
}

.share-shell {
  width: min(1680px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.share-content {
  width: 100%;
  min-width: 0;
}

.share-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.share-body .page-header h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.08;
}

.share-body .page-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.share-body .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.share-body .panel {
  margin-bottom: 22px;
}

.share-body .panel-body {
  padding: 20px;
}

.share-body .kv-grid {
  grid-template-columns: 160px 1fr;
}

.share-body .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.share-body table {
  min-width: 1420px;
  font-size: 13px;
}

.share-body th,
.share-body td {
  white-space: nowrap;
}

.share-body th:first-child,
.share-body td:first-child,
.share-body th:nth-child(2),
.share-body td:nth-child(2),
.share-body th:nth-child(3),
.share-body td:nth-child(3) {
  position: sticky;
  background: inherit;
}

.share-body th:first-child,
.share-body td:first-child {
  left: 0;
  z-index: 2;
}

.share-body th:nth-child(2),
.share-body td:nth-child(2) {
  left: 72px;
  z-index: 2;
}

.share-body th:nth-child(3),
.share-body td:nth-child(3) {
  left: 280px;
  z-index: 2;
}

.share-body thead th {
  background: #faf4e9;
}

.share-body tbody td {
  background: white;
}

.share-body tr:hover td {
  background: #fcf8ef;
}

@media (max-width: 768px) {
  .share-shell {
    width: calc(100vw - 20px);
    padding: 16px 0 28px;
  }

  .share-header {
    align-items: start;
  }

  .share-body .page-header h1 {
    font-size: 24px;
  }

  .share-body .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .share-body .stat-card {
    padding: 14px;
  }

  .share-body .stat-value {
    font-size: 22px;
  }

  .share-body .panel-header {
    padding: 16px 16px 0;
  }

  .share-body .panel-body {
    padding: 16px;
  }

  .share-body .kv-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .share-body table {
    min-width: 1180px;
    font-size: 12px;
  }

  .share-body th:nth-child(2),
  .share-body td:nth-child(2) {
    left: 68px;
  }

  .share-body th:nth-child(3),
  .share-body td:nth-child(3) {
    left: 240px;
  }
}
