:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697386;
  --line: #dfe7f1;
  --primary: #1457a8;
  --primary-dark: #0b3f7e;
  --danger: #b42318;
  --success: #067647;
  --soft: #eef5ff;
  --shadow: 0 18px 45px rgba(16, 33, 62, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 6px; font-size: 12px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  background: linear-gradient(180deg, #0b2e59, #0f437c);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
}
.brand-title { font-size: 17px; font-weight: 800; }
.brand-subtitle { font-size: 12px; opacity: .75; margin-top: 2px; }
.nav { display: grid; gap: 8px; }
.nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255,255,255,.88);
  transition: .18s ease;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-note {
  margin-top: auto;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}
.sidebar-note p { margin-bottom: 0; opacity: .82; }

.main { margin-left: 268px; padding: 28px; min-height: 100vh; }

.hero, .page-head {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.page-head.compact { padding: 24px; }
.eyebrow { color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .06em; margin: 0 0 6px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 20px; }
p { color: var(--muted); line-height: 1.65; }
.hero-text { max-width: 760px; }
.hero-actions, .form-actions, .card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: var(--soft); border-color: #c8dcf7; color: var(--primary-dark); }
.btn.small { padding: 7px 10px; min-height: 32px; font-size: 13px; border-radius: 10px; }
.btn.disabled { pointer-events: none; opacity: .45; }
.sidebar-sync { width: 100%; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow);
}
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 32px; margin-top: 8px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head p { margin: 6px 0 0; }

.filter-form, .import-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}
.toolbar-form { display: grid; grid-template-columns: 2fr 1fr 120px 120px auto auto; gap: 10px; align-items: center; }
.field { display: grid; gap: 7px; }
.field span, .field-label { color: #344054; font-size: 13px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #dcecff; border-color: var(--primary); }
.full-row { grid-column: 1 / -1; }
.check-row { grid-column: 1 / -1; display: flex; gap: 22px; flex-wrap: wrap; color: #344054; font-weight: 700; }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
.table-wrap.huge { max-height: 72vh; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 980px; }
th {
  position: sticky; top: 0; z-index: 2;
  background: #0f4c92; color: #fff;
  font-size: 13px; text-align: left; white-space: nowrap;
  padding: 12px 10px;
}
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
  font-size: 13px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
}
tr:nth-child(even) td { background: #fbfdff; }
tr:hover td { background: #f4f9ff; }
.sticky-col { position: sticky; left: 0; z-index: 3; background: #fff; }
th.sticky-col { background: #0c3e79; color: #fff; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 34px; color: var(--muted); }
.action-cell form { display: inline; }
.link { color: var(--primary); font-weight: 800; border: none; background: none; cursor: pointer; padding: 0 8px 0 0; }
.link.danger { color: var(--danger); }

.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 16px; }
.sheet-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow);
}
.sheet-top h2 { margin-bottom: 5px; }
.sheet-top span { color: var(--muted); font-size: 13px; }
.sheet-meta { display: grid; gap: 6px; margin: 18px 0; color: #344054; }
.sheet-meta span { background: #f4f7fb; border-radius: 10px; padding: 8px 10px; }

.edit-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; }
.wide-field:nth-child(5n), .wide-field:has(textarea) { grid-column: span 2; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; color: var(--muted); font-weight: 700; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 20px; }
.result-grid div { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fbfdff; }
.result-grid span { display: block; color: var(--muted); font-size: 12px; }
.result-grid strong { display: block; margin-top: 5px; word-break: break-word; }
.routing-head { align-items: center; }
.routing-head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.routing-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid #c8dcf7;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  min-width: 96px;
  padding: 8px 12px;
}
.routing-status.error {
  background: #fff1f3;
  border-color: #fecdd3;
  color: var(--danger);
}
.routing-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}
.routing-span-2 { grid-column: span 2; }
.routing-route-list {
  display: grid;
  gap: 12px;
}
.route-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  padding: 14px;
}
.route-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.route-card-head span {
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}
.route-line {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
  word-break: break-word;
}
.route-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.route-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 9px;
}
.route-card p { margin: 10px 0 0; }
.tips ul { margin-bottom: 0; line-height: 1.9; color: #344054; }

.flash-wrap { margin-bottom: 16px; display: grid; gap: 10px; }
.flash { padding: 12px 14px; border-radius: 14px; border: 1px solid; font-weight: 700; }
.flash.success { background: #ecfdf3; border-color: #abefc6; color: var(--success); }
.flash.error { background: #fff1f3; border-color: #fecdd3; color: var(--danger); }
.flash.warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }

@media (max-width: 1100px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 18px; }
  .stats-grid, .sheet-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-form, .import-form, .toolbar-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hero, .page-head { display: block; }
  .routing-status { margin-top: 14px; }
  .stats-grid, .sheet-grid, .edit-form .form-grid, .filter-form, .import-form, .toolbar-form, .result-grid, .routing-form { grid-template-columns: 1fr; }
  .wide-field:nth-child(5n), .wide-field:has(textarea), .routing-span-2 { grid-column: span 1; }
}

.route-extra {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.route-segment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  background: rgba(0,0,0,0.02);
  font-size: 13px;
}
.route-segment strong {
  grid-column: 1 / -1;
}

.grid-form { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.grid-form label { color: #344054; font-size: 13px; font-weight: 800; display: grid; gap: 7px; }
.full-width { grid-column: 1 / -1; }
.muted-label { color: #344054; font-size: 13px; font-weight: 800; margin-bottom: 8px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 8px; }
.check-chip { border: 1px solid var(--line); background: #fbfdff; border-radius: 12px; padding: 8px 10px; display: flex !important; align-items: center; gap: 6px !important; font-weight: 700 !important; }
.check-chip input { width: auto; }
.metric-row { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; margin: 14px 0; }
.metric-card { background: #fbfdff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.metric-card span { display:block; color: var(--muted); font-size:13px; }
.metric-card strong { display:block; margin-top:6px; font-size:24px; }
.hint { margin-top: 8px; }


/* ===== Login system and enhanced sidebar styles merged from login version ===== */
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #697386;
  --line: #dfe7f1;
  --primary: #1457a8;
  --primary-dark: #0b3f7e;
  --danger: #b42318;
  --success: #067647;
  --soft: #eef5ff;
  --shadow: 0 18px 45px rgba(16, 33, 62, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
code { background: #eef2f7; padding: 2px 6px; border-radius: 6px; font-size: 12px; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 268px;
  background: linear-gradient(180deg, #0b2e59, #0f437c);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
}
.brand-title { font-size: 17px; font-weight: 800; }
.brand-subtitle { font-size: 12px; opacity: .75; margin-top: 2px; }
.nav { display: grid; gap: 8px; }
.nav a {
  padding: 12px 14px;
  border-radius: 12px;
  color: rgba(255,255,255,.88);
  transition: .18s ease;
}
.nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.sidebar-note {
  margin-top: auto;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.55;
}
.sidebar-note p { margin-bottom: 0; opacity: .82; }

.main { margin-left: 268px; padding: 28px; min-height: 100vh; }

.hero, .page-head {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}
.page-head.compact { padding: 24px; }
.eyebrow { color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .06em; margin: 0 0 6px; }
h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
h2 { margin: 0; font-size: 20px; }
p { color: var(--muted); line-height: 1.65; }
.hero-text { max-width: 760px; }
.hero-actions, .form-actions, .card-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: var(--soft); border-color: #c8dcf7; color: var(--primary-dark); }
.btn.small { padding: 7px 10px; min-height: 32px; font-size: 13px; border-radius: 10px; }
.btn.disabled { pointer-events: none; opacity: .45; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow);
}
.stat-card span { display: block; color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; font-size: 32px; margin-top: 8px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.panel-head p { margin: 6px 0 0; }

.filter-form, .import-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}
.toolbar-form { display: grid; grid-template-columns: 2fr 1fr 120px 120px auto auto; gap: 10px; align-items: center; }
.field { display: grid; gap: 7px; }
.field span, .field-label { color: #344054; font-size: 13px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #dcecff; border-color: var(--primary); }
.full-row { grid-column: 1 / -1; }
.check-row { grid-column: 1 / -1; display: flex; gap: 22px; flex-wrap: wrap; color: #344054; font-weight: 700; }

.table-wrap { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
.table-wrap.huge { max-height: 72vh; }
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 980px; }
th {
  position: sticky; top: 0; z-index: 2;
  background: #0f4c92; color: #fff;
  font-size: 13px; text-align: left; white-space: nowrap;
  padding: 12px 10px;
}
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
  font-size: 13px;
  max-width: 300px;
  white-space: normal;
  word-break: break-word;
}
tr:nth-child(even) td { background: #fbfdff; }
tr:hover td { background: #f4f9ff; }
.sticky-col { position: sticky; left: 0; z-index: 3; background: #fff; }
th.sticky-col { background: #0c3e79; color: #fff; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 34px; color: var(--muted); }
.action-cell form { display: inline; }
.link { color: var(--primary); font-weight: 800; border: none; background: none; cursor: pointer; padding: 0 8px 0 0; }
.link.danger { color: var(--danger); }

.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 16px; }
.sheet-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow);
}
.sheet-top h2 { margin-bottom: 5px; }
.sheet-top span { color: var(--muted); font-size: 13px; }
.sheet-meta { display: grid; gap: 6px; margin: 18px 0; color: #344054; }
.sheet-meta span { background: #f4f7fb; border-radius: 10px; padding: 8px 10px; }

.edit-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 14px; }
.wide-field:nth-child(5n), .wide-field:has(textarea) { grid-column: span 2; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; color: var(--muted); font-weight: 700; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 20px; }
.result-grid div { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fbfdff; }
.result-grid span { display: block; color: var(--muted); font-size: 12px; }
.result-grid strong { display: block; margin-top: 5px; word-break: break-word; }
.tips ul { margin-bottom: 0; line-height: 1.9; color: #344054; }

.flash-wrap { margin-bottom: 16px; display: grid; gap: 10px; }
.flash { padding: 12px 14px; border-radius: 14px; border: 1px solid; font-weight: 700; }
.flash.success { background: #ecfdf3; border-color: #abefc6; color: var(--success); }
.flash.error { background: #fff1f3; border-color: #fecdd3; color: var(--danger); }

@media (max-width: 1100px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 18px; }
  .stats-grid, .sheet-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-form, .import-form, .toolbar-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .hero, .page-head { display: block; }
  .stats-grid, .sheet-grid, .edit-form .form-grid, .filter-form, .import-form, .toolbar-form, .result-grid { grid-template-columns: 1fr; }
  .wide-field:nth-child(5n), .wide-field:has(textarea) { grid-column: span 1; }
}

/* Final UI adjustments according to the database revision brief */
.brand-title { font-size: 15px; line-height: 1.35; }
.brand-mark { font-size: 14px; letter-spacing: -0.03em; }
.clean-head { align-items: center; }
.clean-head h1 { font-size: 28px; }
.clean-head p { margin: 8px 0 0; max-width: 880px; }
.panel-head.simple { align-items: center; }
.panel-head.simple h2 { margin: 0; }
.route-form { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.empty-state {
  border: 1px dashed #c8d4e4;
  background: #f8fbff;
  color: #667085;
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  font-weight: 700;
}
.simple-card { min-height: 138px; display: flex; flex-direction: column; justify-content: space-between; }
.simple-card .sheet-top h2 { margin-bottom: 16px; }
.upload-only-form { grid-template-columns: 1fr; }
.trace-table { min-width: 1180px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #eef5ff;
  color: #0b3f7e;
  font-weight: 800;
  white-space: nowrap;
}
.inline-process-form {
  display: grid;
  grid-template-columns: 150px 150px 220px 160px;
  gap: 8px;
  align-items: end;
}
.inline-process-form .mini-checks {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #344054;
  font-weight: 700;
}
.mini-field span { font-size: 12px; }
.mini-field input, .mini-field select { padding: 8px 9px; border-radius: 10px; font-size: 12px; }
.trace-message { font-weight: 700; color: #344054; margin-bottom: 6px; }
.compact-tips { padding: 18px 22px; }
.compact-tips h2 { font-size: 18px; }

@media (max-width: 1280px) {
  .route-form { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .inline-process-form { grid-template-columns: 1fr 1fr; }
}

/* 2026-05 UI enhancement: logo, sidebar interaction, login system, upload queue */
.sidebar {
  background: radial-gradient(circle at 35% 0%, rgba(36, 214, 229, .24), transparent 34%), linear-gradient(180deg, #081d3d 0%, #0b3266 52%, #0f4c92 100%);
  box-shadow: 18px 0 50px rgba(11, 32, 71, .16);
}
.brand-card {
  align-items: center;
  padding: 14px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.06));
  backdrop-filter: blur(10px);
}
.brand-logo-wrap {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.96);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(0,0,0,.20);
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-copy { min-width: 0; }
.brand-title {
  font-size: 15px;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: .01em;
  text-shadow: 0 2px 12px rgba(0,0,0,.16);
}
.brand-subtitle {
  margin-top: 7px;
  opacity: .82;
  font-size: 12px;
  letter-spacing: .04em;
}
.nav a {
  position: relative;
  padding-left: 18px;
  transform-origin: left center;
  will-change: transform;
}
.nav a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 50%;
  width: 4px;
  height: 0;
  border-radius: 999px;
  background: #26e6f0;
  transform: translateY(-50%);
  transition: height .18s ease;
}
.nav a:hover {
  background: rgba(255,255,255,.14);
  color: #fff;
  transform: scale(1.055);
  font-weight: 900;
}
.nav a:hover::before,
.nav a.active::before { height: 22px; }
.nav a.active {
  background: rgba(255,255,255,.19);
  color: #fff;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.sidebar-user {
  margin-top: auto;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 6px;
  font-size: 13px;
}
.sidebar-user span { opacity: .72; }
.sidebar-user strong { font-size: 15px; word-break: break-all; }
.sidebar-user a { color: #d8efff; font-weight: 800; }
.sidebar-user a:hover { color: #fff; }

.sheet-stats-inline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.sheet-stats-inline span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f2f7ff;
  border: 1px solid #d8e7fb;
  border-radius: 999px;
  padding: 6px 10px;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}
.sheet-stats-inline strong { color: var(--primary-dark); }

.auth-body {
  min-height: 100vh;
  background: linear-gradient(90deg, rgba(7, 25, 55, .78), rgba(10, 53, 105, .32)), url("/static/img/login_bg.jpg") center/cover no-repeat fixed;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 34px;
}
.auth-card {
  width: min(520px, calc(100vw - 44px));
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 30px;
  padding: 34px;
  box-shadow: 0 30px 90px rgba(5, 25, 55, .34);
  backdrop-filter: blur(18px);
}
.register-card { width: min(540px, calc(100vw - 44px)); }
.auth-logo-row {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 34px rgba(17, 50, 96, .20);
}
.auth-logo-row img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-card h1 {
  text-align: center;
  font-size: 28px;
  line-height: 1.25;
  color: #071e41;
  margin-bottom: 8px;
}
.auth-card p {
  text-align: center;
  margin: 0 0 22px;
  color: #475467;
}
.auth-form { display: grid; gap: 15px; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 4px; }
.auth-foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: #667085;
  font-size: 14px;
}
.auth-foot a { color: var(--primary); font-weight: 900; }
.demo-account {
  margin-top: 18px;
  padding: 12px 14px;
  background: #f2f7ff;
  border: 1px dashed #b8d4f7;
  border-radius: 14px;
  color: #344054;
  font-size: 13px;
  line-height: 1.7;
}
.auth-flash { margin: 0 0 16px; }

.upload-panel { padding: 28px 30px; }
.upload-header-row { display: block; }
.file-input-shell {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #cfd8e6;
  border-radius: 16px;
  padding: 10px 12px;
  background: #fff;
}
.file-input-shell strong {
  color: #344054;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-stage {
  border: 1px solid #dce7f5;
  border-radius: 18px;
  padding: 14px;
  background: #f8fbff;
}
.file-stage-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.stage-actions-left,
.stage-actions-right { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stage-summary { color: #344054; font-weight: 900; text-align: center; }
.upload-hint { margin: 10px 0 0; font-size: 13px; }
.selected-file-list {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.selected-file-list.collapsed { display: none; }
.selected-file-row {
  width: 100%;
  border: 1px solid #d5e3f5;
  background: #fff;
  color: #344054;
  border-radius: 14px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.selected-file-row:hover { border-color: #8ab8f0; box-shadow: 0 8px 22px rgba(20, 87, 168, .10); }
.selected-file-row.active { background: #eaf3ff; border-color: #1457a8; color: #0b3f7e; }
.selected-file-row span { font-weight: 900; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.selected-file-row small { color: #667085; }
.selected-file-row b {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #fff1f3;
  color: #b42318;
  font-style: normal;
}
.selected-file-empty {
  padding: 14px;
  color: #667085;
  border: 1px dashed #c8d4e4;
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
}
.trace-wrap { border-radius: 18px; }
.trace-table {
  min-width: 1560px;
  table-layout: fixed;
}
.trace-time-col { width: 170px; }
.trace-name-col { width: 340px; }
.trace-status-col { width: 150px; }
.trace-process-col { width: 620px; }
.trace-result-col { width: 280px; }
.process-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #f8fbff;
  border: 1px solid #dce7f5;
  border-radius: 16px;
  min-width: 580px;
}
.process-card .wide-mini { grid-column: 1 / -1; }
.process-card .mini-checks {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.process-card .process-btn { justify-self: start; }
.process-card input,
.process-card select { min-height: 38px; }
.trace-message { line-height: 1.6; }

@media (max-width: 1100px) {
  .sidebar-user { margin-top: 0; }
  .file-stage-top { grid-template-columns: 1fr; align-items: start; }
  .stage-summary { text-align: left; }
}

/* Row update markers and modified-time sorting enhancement */
.mark-col {
  width: 64px;
  min-width: 64px;
  max-width: 64px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 4;
  background: #fff;
}
th.mark-col {
  background: #0c3e79;
  color: #fff;
  z-index: 5;
}
.excel-row-col {
  left: 64px;
}
td.mark-col form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.change-dot {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 999px;
  background: #1d70f5;
  box-shadow: 0 0 0 4px rgba(29,112,245,.14), 0 2px 8px rgba(29,112,245,.36);
  cursor: pointer;
  padding: 0;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.change-dot:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 6px rgba(29,112,245,.18), 0 4px 14px rgba(29,112,245,.42);
}
tr:hover td.mark-col { background: #f4f9ff; }

/* Fix: keep the Excel row-number header frozen with the rest of the table header during vertical scrolling. */
.table-wrap th.mark-col,
.table-wrap th.excel-row-col {
  position: sticky;
  top: 0;
  background: #0c3e79 !important;
  color: #fff !important;
  background-clip: padding-box;
}
.table-wrap th.mark-col {
  left: 0;
  z-index: 30;
}
.table-wrap th.excel-row-col {
  left: 64px;
  z-index: 29;
}
.table-wrap td.mark-col,
.table-wrap td.excel-row-col {
  position: sticky;
  background: #fff;
  background-clip: padding-box;
}
.table-wrap td.mark-col {
  left: 0;
  z-index: 8;
}
.table-wrap td.excel-row-col {
  left: 64px;
  z-index: 7;
}
.table-wrap .excel-row-col {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  white-space: nowrap;
  text-align: center;
}
.table-wrap tr:nth-child(even) td.mark-col,
.table-wrap tr:nth-child(even) td.excel-row-col {
  background: #fbfdff;
}
.table-wrap tr:hover td.mark-col,
.table-wrap tr:hover td.excel-row-col {
  background: #f4f9ff;
}

/* File upload trace actions: row delete + bulk process/delete */
.btn.danger {
  background: #fff;
  border-color: #fecaca;
  color: #b91c1c;
}
.btn.danger:hover {
  background: #fee2e2;
}
.trace-action-col {
  width: 120px;
}
.trace-delete-form {
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-delete-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff;
  color: #b91c1c;
  cursor: pointer;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.icon-delete-btn:hover {
  transform: scale(1.08);
  background: #fee2e2;
  border-color: #fca5a5;
}
.trace-bulk-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.dashboard-grid {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
}
.action-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  padding: 18px;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.action-card:hover {
  border-color: #8ab8f0;
  box-shadow: 0 12px 26px rgba(20, 87, 168, .10);
}
.action-card strong { font-size: 18px; color: var(--primary-dark); }
.action-card span { color: var(--muted); line-height: 1.5; }
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}
.health-grid div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
  padding: 16px;
}
.health-grid span,
.health-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.health-grid strong {
  display: block;
  margin: 6px 0;
  font-size: 26px;
}
.health-grid .health-text {
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}
.sheet-group {
  margin-bottom: 18px;
}
.sheet-group summary {
  cursor: pointer;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 18px;
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-dark);
}
.sheet-group summary::-webkit-details-marker { display: none; }
.sheet-group .sheet-grid { margin-top: 14px; }
.sheet-desc { margin: 10px 0 0; min-height: 42px; }
.review-table input,
.review-table textarea {
  min-width: 130px;
  padding: 8px 9px;
  border-radius: 10px;
}
.review-table textarea { min-width: 260px; }
.review-table select {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
}
.node-match-cell { min-width: 320px; }
.mini-field { display: grid; gap: 6px; margin-bottom: 8px; }
.mini-field span { font-size: 12px; color: var(--muted); font-weight: 800; }
.warning-text {
  margin-top: 8px;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 800;
}
.llm-status-box {
  border: 1px solid #d8e7fb;
  background: #f2f7ff;
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: grid;
  gap: 4px;
}
.llm-status-box strong { color: var(--primary-dark); }
.llm-status-box span { color: #344054; line-height: 1.55; }

/* Quote review page: compact, business-readable review grid */
.quote-review-wrap {
  max-height: 76vh;
  overflow: auto;
}
.quote-review-wrap .review-table {
  min-width: 2600px;
  table-layout: fixed;
}
.quote-review-wrap th {
  text-align: center;
  font-size: 14px;
}
.quote-review-wrap td {
  max-width: none;
  word-break: normal;
  overflow-wrap: anywhere;
}
.quote-review-wrap .review-table th:nth-child(1),
.quote-review-wrap .review-table td:nth-child(1) { width: 180px; }
.quote-review-wrap .review-table th:nth-child(4),
.quote-review-wrap .review-table td:nth-child(4),
.quote-review-wrap .review-table th:nth-child(5),
.quote-review-wrap .review-table td:nth-child(5) { width: 110px; }
.quote-review-wrap .review-table th:nth-child(8),
.quote-review-wrap .review-table td:nth-child(8),
.quote-review-wrap .review-table th:nth-child(9),
.quote-review-wrap .review-table td:nth-child(9) { width: 260px; }
.quote-review-wrap .review-table th:nth-child(18),
.quote-review-wrap .review-table td:nth-child(18),
.quote-review-wrap .review-table th:nth-child(19),
.quote-review-wrap .review-table td:nth-child(19) { width: 180px; }
.summary-line {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #eef5ff;
  color: #0b3f7e;
  font-weight: 900;
  padding: 4px 10px;
  white-space: nowrap;
}
.evidence-preview {
  max-height: 56px;
  overflow: hidden;
  color: #344054;
  line-height: 1.45;
}
.service-fee-cell {
  max-height: 96px;
  overflow: hidden;
}
.review-dialog {
  width: min(900px, calc(100vw - 72px));
  max-height: 82vh;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(16, 33, 62, 0.24);
}
.review-dialog.wide {
  width: min(1180px, calc(100vw - 72px));
}
.review-dialog::backdrop {
  background: rgba(10, 24, 44, .38);
}
.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #0f4c92;
  color: #fff;
}
.dialog-head button {
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  padding: 7px 10px;
  font-weight: 800;
}
.review-dialog textarea {
  border: 0;
  border-radius: 0;
  min-height: 320px;
  font-family: Consolas, "Courier New", monospace;
}
.review-dialog > p,
.review-dialog .json-viewer,
.review-dialog .subtable-wrap {
  margin: 14px;
}
.json-viewer {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1220;
  color: #dbeafe;
  padding: 14px;
  white-space: pre-wrap;
}
.parse-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px;
}
.parse-preview-meta span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--panel-soft);
  font-size: 12px;
}
.subtable-wrap {
  max-height: 62vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.subtable {
  min-width: 980px;
}
.subtable th {
  background: #174f8f;
}
.subtable td {
  max-width: 220px;
}

.quote-review-panel {
  overflow: visible;
}
.quote-review-list {
  display: grid;
  gap: 16px;
}
.quote-review-card {
  border: 1px solid #dbe7f5;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 54, 100, .08);
  overflow: hidden;
}
.quote-review-card.needs-review {
  border-color: #fed7aa;
}
.quote-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  background: #f8fbff;
  border-bottom: 1px solid #e4edf8;
}
.quote-file-name {
  font-size: 18px;
  font-weight: 900;
  color: #10213e;
  overflow-wrap: anywhere;
}
.quote-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: #66728a;
  font-weight: 700;
}
.quote-card-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 180px;
}
.review-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 900;
  white-space: nowrap;
}
.review-badge.warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.review-badge.info {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #bbf7d0;
}
.quote-card-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(360px, 1fr);
  gap: 0;
}
.quote-card-section {
  padding: 16px 18px;
  border-bottom: 1px solid #e7eef8;
}
.quote-card-section h3 {
  margin: 0 0 12px;
  color: #10213e;
  font-size: 16px;
}
.route-section {
  border-right: 1px solid #e7eef8;
}
.evidence-section {
  grid-column: 1 / -1;
  background: #fcfdff;
}
.field-grid {
  display: grid;
  gap: 12px;
}
.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field-grid.price {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field-grid label > span {
  color: #66728a;
  font-size: 13px;
  font-weight: 900;
}
.airport-info {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #e2ebf8;
  border-radius: 12px;
  background: #f8fbff;
  padding: 9px 10px;
}
.airport-info span {
  color: #66728a;
  font-size: 12px;
  font-weight: 900;
}
.airport-info strong {
  color: #10213e;
  overflow-wrap: anywhere;
}
.quote-review-card input,
.quote-review-card select,
.quote-review-card textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.match-note,
.price-facts {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: #66728a;
  line-height: 1.5;
}
.match-note.warn {
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  padding: 10px 12px;
}
.price-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f7faff;
  border: 1px solid #e2ebf8;
  border-radius: 12px;
  padding: 10px 12px;
}
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.quote-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  background: #f8fbff;
}
.quote-card-actions form {
  margin: 0;
}
.btn.danger {
  border-color: #fecaca;
  background: #fff;
  color: #b91c1c;
}
.no-margin {
  margin-top: 0;
}
.quote-doc-list {
  display: grid;
  gap: 18px;
}
.quote-doc-card {
  overflow: hidden;
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 54, 100, .08);
}
.quote-doc-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #f8fbff;
  border-bottom: 1px solid #e4edf8;
}
.quote-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.quote-head-actions form,
.inline-actions form {
  margin: 0;
}
.quote-summary-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 10px;
  padding: 16px 18px 6px;
}
.metric-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid #e2ebf8;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
}
.metric-card span {
  color: #66728a;
  font-size: 12px;
  font-weight: 900;
}
.metric-card strong {
  color: #10213e;
  font-size: 22px;
}
.metric-card.warn {
  background: #fff7ed;
  border-color: #fed7aa;
}
.quote-summary-text {
  margin: 8px 18px 16px;
  color: #5d6a82;
  line-height: 1.6;
}
.dual-review-box {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 18px 18px;
  padding: 12px 14px;
  border: 1px solid #dbe7f7;
  border-radius: 10px;
  background: #f8fbff;
}
.dual-review-box.needs-review {
  border-color: #fed7aa;
  background: #fffaf4;
}
.dual-review-box h3 {
  margin: 0 0 6px;
  color: #10213e;
  font-size: 16px;
}
.dual-review-box p {
  margin: 0;
  color: #5d6a82;
  line-height: 1.5;
}
.dual-review-box .warn-text {
  margin-top: 6px;
  color: #9a3412;
  font-weight: 800;
}
.quote-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  margin: 14px 0 10px;
}
.quote-section-head h3 {
  margin: 0;
  color: #10213e;
  font-size: 17px;
}
.rate-group-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 12px;
}
.rate-group-card {
  border: 1px solid #e2ebf8;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.rate-group-card.needs-review {
  border-color: #fed7aa;
  background: #fffaf4;
}
.rate-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rate-main strong {
  color: #10213e;
  font-size: 16px;
}
.rate-main p {
  margin: 4px 0 0;
  color: #66728a;
}
.rate-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.rate-facts span {
  min-width: 0;
  border-radius: 9px;
  background: #f8fbff;
  color: #42506a;
  padding: 8px 9px;
  overflow-wrap: anywhere;
}
.quote-secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  border-top: 1px solid #e7eef8;
  padding: 14px 18px;
}
.quote-secondary-grid section {
  min-width: 0;
  border: 1px solid #e2ebf8;
  border-radius: 12px;
  background: #fcfdff;
  padding: 12px;
}
.quote-secondary-grid .quote-section-head {
  padding: 0;
  margin-top: 0;
}
.compact-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.compact-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf3fb;
  padding-bottom: 8px;
}
.compact-list strong,
.compact-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.compact-list span {
  color: #66728a;
}
.raw-row-details {
  border-top: 1px solid #e7eef8;
  background: #f8fbff;
  padding: 12px 18px 16px;
}
.raw-row-details summary {
  cursor: pointer;
  color: #174f8f;
  font-weight: 900;
}
.raw-row-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.raw-row-card {
  display: grid;
  gap: 6px;
  border: 1px solid #e2ebf8;
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}
.raw-row-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.raw-row-card span {
  color: #66728a;
}

@media (max-width: 1100px) {
  .dashboard-grid, .action-grid, .health-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
  .quote-card-grid {
    grid-template-columns: 1fr;
  }
  .route-section {
    border-right: 0;
  }
  .field-grid.price {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .price-facts {
    grid-template-columns: 1fr;
  }
  .quote-summary-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
  .rate-facts {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .quote-secondary-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .dashboard-grid, .action-grid, .health-grid { grid-template-columns: 1fr; }
  .quote-doc-head,
  .quote-card-head {
    display: grid;
  }
  .quote-card-status {
    justify-content: flex-start;
    min-width: 0;
  }
  .field-grid.two,
  .field-grid.price {
    grid-template-columns: 1fr;
  }
  .quote-summary-grid,
  .rate-facts {
    grid-template-columns: 1fr;
  }
  .raw-row-card > div:first-child,
  .compact-list div {
    display: grid;
  }
}
