:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #d5dde6;
  --line-strong: #bdc9d6;
  --text: #111827;
  --muted: #637083;
  --brand: #0f6b55;
  --brand-dark: #094b3c;
  --accent: #a56b1f;
  --accent-soft: #f7ead3;
  --danger: #b42318;
  --ok: #16704a;
  --success: #16704a;
  --primary: #0f6b55;
  --ink: #071f1a;
  --shadow: 0 18px 45px rgba(25, 36, 50, 0.08);
  --shadow-soft: 0 8px 24px rgba(25, 36, 50, 0.06);
}

/* V57 boss cockpit refresh */
body {
  background: #f3f7f6;
}

.layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background: linear-gradient(180deg, #00342e 0%, #012822 52%, #001c18 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 18px 0 42px rgba(4, 29, 25, 0.12);
}

.brand {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 58px;
  padding: 4px 8px 22px 64px;
}

.brand::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #48d99d, #0f8b6d);
  box-shadow: 0 10px 20px rgba(18, 144, 105, 0.26);
}

.brand::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 13px;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  box-shadow: 6px 6px 0 -3px #ffffff;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: rgba(230, 247, 241, 0.66);
}

.nav {
  gap: 9px;
  margin-top: 22px;
}

.nav button {
  position: relative;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px 0 42px;
  color: rgba(236, 248, 244, 0.82);
}

.nav button::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(236, 248, 244, 0.72);
  border-radius: 4px;
  transform: translateY(-50%);
}

.nav button:hover,
.nav button.active {
  background: linear-gradient(90deg, rgba(20, 149, 112, 0.95), rgba(12, 114, 92, 0.95));
  border-color: rgba(116, 231, 181, 0.34);
  color: #ffffff;
}

.nav button.active {
  box-shadow: inset 3px 0 0 #f1c15d, 0 14px 26px rgba(4, 83, 67, 0.22);
}

.nav button.active::before {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.main {
  background: #f5f8f7;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.topbar {
  height: 62px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(214, 224, 221, 0.78);
}

.topbar h2 {
  font-size: 18px;
}

.content {
  flex: 1 0 auto;
  padding: 24px 30px 42px;
}

.record-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  padding: 14px 20px 20px;
  color: #6b7c76;
  font-size: 12px;
  line-height: 1.6;
}

.record-footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #526b64;
  text-decoration: none;
}

.record-footer a:hover {
  color: #0f6b55;
  text-decoration: underline;
}

.record-footer span {
  width: 1px;
  height: 12px;
  background: #ccd8d4;
}

.record-footer img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.dashboard-page {
  max-width: none;
}

.dashboard-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.dashboard-titlebar h1 {
  margin: 0;
  color: #081f1a;
  font-size: 28px;
  line-height: 1.15;
}

.dashboard-titlebar span,
.dashboard-titlebar em {
  display: block;
  margin-top: 8px;
  color: #55716a;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.dashboard-toolbar {
  position: static;
  top: auto;
  margin-bottom: 18px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.dashboard-toolbar .toolbar-left,
.dashboard-toolbar .toolbar-right {
  gap: 8px;
}

.dashboard-toolbar .input,
.dashboard-toolbar .btn {
  border-color: #dbe5e2;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 45, 39, 0.04);
}

.dashboard-toolbar .btn.primary,
.analysis-submit {
  background: linear-gradient(180deg, #0b8769, #08745c);
  box-shadow: 0 12px 24px rgba(9, 116, 92, 0.22);
}

.dashboard-hero {
  grid-template-columns: minmax(240px, 1.1fr) minmax(420px, 1.25fr) minmax(220px, 0.5fr);
  min-height: 172px;
  margin-bottom: 18px;
  padding: 28px 32px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(14, 126, 96, 0.98), rgba(4, 72, 63, 0.99)),
    radial-gradient(circle at 72% 60%, rgba(64, 222, 163, 0.22), transparent 34%);
  box-shadow: 0 26px 52px rgba(8, 73, 61, 0.24);
}

.dashboard-hero::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.16;
}

.dashboard-hero::after {
  display: none;
}

.hero-copy span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.dashboard-hero strong {
  font-size: 34px;
  letter-spacing: 0;
}

.hero-copy em {
  color: rgba(235, 255, 249, 0.68);
}

.hero-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-kpis div,
.hero-profit {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-kpis div {
  min-height: 104px;
  padding: 16px 18px;
}

.hero-kpis strong {
  font-size: 24px;
}

.hero-profit {
  min-width: 0;
}

.hero-profit strong {
  font-size: 30px;
}

.dashboard-cards {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.dashboard-cards .metric,
.analysis-kpi {
  position: relative;
  min-height: 108px;
  border: 1px solid rgba(218, 227, 224, 0.92);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(16, 41, 35, 0.07);
}

.dashboard-cards .metric::before {
  display: none;
}

.dashboard-cards .metric::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 139, 109, 0.16), rgba(45, 155, 226, 0.13));
  transform: translateY(-50%);
}

.metric span,
.analysis-kpi span {
  color: #405b54;
}

.metric strong,
.analysis-kpi strong {
  color: #071f1a;
  font-size: 25px;
}

.metric.good strong,
.analysis-kpi.up strong,
.analysis-kpi.up em {
  color: #08745c;
}

.metric.warn strong,
.analysis-kpi.down strong,
.analysis-kpi.down em {
  color: #c06317;
}

.analysis-panel {
  margin-top: 22px;
  border: 1px solid rgba(214, 224, 221, 0.88);
  border-radius: 16px;
  padding: 18px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(18, 48, 40, 0.07);
}

.analysis-head {
  align-items: center;
}

.analysis-head span {
  color: #08745c;
}

.analysis-head h3 {
  font-size: 22px;
}

.analysis-controls {
  grid-template-columns: 130px minmax(160px, 1.2fr) minmax(160px, 1.2fr) 130px minmax(150px, 1fr) minmax(150px, 1fr) minmax(140px, 1fr) 150px;
  padding: 14px;
  border: 1px solid #e1e9e7;
  border-radius: 14px;
  background: #f8fbfa;
}

.analysis-summary {
  border-radius: 14px;
  background: #ffffff;
}

.analysis-summary strong {
  font-size: 22px;
}

.analysis-chart-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.analysis-table-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.analysis-chart-card,
.analysis-report-panel {
  border: 1px solid rgba(216, 226, 223, 0.92);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(17, 45, 38, 0.06);
}

.analysis-chart-card {
  padding: 16px;
}

.analysis-bars {
  height: 250px;
  gap: 10px;
  padding: 12px 10px 0;
  border-radius: 14px;
  background:
    repeating-linear-gradient(180deg, transparent 0 48px, rgba(226, 235, 232, 0.75) 49px 50px),
    #fbfdfc;
}

.analysis-day-bar i {
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #0f8b6d, #2f6eea);
  box-shadow: 0 8px 18px rgba(29, 114, 171, 0.22);
}

.analysis-report-panel {
  padding: 18px;
}

.analysis-report-panel p {
  margin: 0 0 14px;
  border-radius: 12px;
  padding: 13px 14px;
  background: #eef8f4;
  color: #073d32;
  font-weight: 900;
}

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

.analysis-report-grid div {
  border: 1px solid #e0e9e6;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.analysis-report-grid strong,
.analysis-report-grid em {
  display: block;
}

.analysis-report-grid strong {
  margin-bottom: 10px;
  color: #0b322b;
}

.analysis-report-grid em {
  position: relative;
  padding: 8px 0 8px 18px;
  color: #405b54;
  font-style: normal;
  font-weight: 700;
}

.analysis-report-grid em::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f8b6d;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.visual-panel {
  border-color: rgba(216, 226, 223, 0.92);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(17, 45, 38, 0.07);
}

.dashboard-panel::before {
  height: 0;
}

.shop-compare-panel,
.detail-panel {
  grid-column: span 7;
}

.staff-panel,
.quality-panel {
  grid-column: span 5;
}

.material-panel,
.risk-panel,
.cost-panel {
  grid-column: span 4;
}

.visual-head h3 {
  color: #0b1f1b;
  font-size: 18px;
}

.visual-head span {
  background: #eef6f3;
  color: #668078;
}

.compare-row {
  grid-template-columns: 118px 1fr 64px;
}

.compare-track,
.rank-track {
  height: 8px;
  background: #edf4f2;
}

.compare-track .sales {
  background: linear-gradient(90deg, #2f6eea, #83b7ff);
}

.compare-track .orders {
  background: linear-gradient(90deg, #f0b64f, #f8d88b);
}

.compare-track .profit,
.rank-track .profit {
  background: linear-gradient(90deg, #0b8769, #36c690);
}

.detail-metrics span,
.detail-table-card,
.quality-card,
.risk-order,
.staff-card {
  border-color: #e0e8e6;
  border-radius: 12px;
  background: #ffffff;
}

@media (max-width: 1180px) {
  .hero-kpis,
  .dashboard-cards,
  .analysis-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero,
  .analysis-chart-grid,
  .analysis-table-grid,
  .analysis-report-grid {
    grid-template-columns: 1fr;
  }

  .shop-compare-panel,
  .detail-panel,
  .staff-panel,
  .quality-panel,
  .material-panel,
  .risk-panel,
  .cost-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .sidebar {
    height: auto;
  }

  .dashboard-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-titlebar h1 {
    font-size: 24px;
  }

  .dashboard-toolbar .toolbar-left,
  .dashboard-toolbar .toolbar-right {
    width: 100%;
  }

  .dashboard-toolbar .input,
  .dashboard-toolbar .btn {
    flex: 1 1 140px;
  }

  .dashboard-hero,
  .analysis-panel,
  .visual-panel {
    border-radius: 14px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

button {
  border: 0;
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(135deg, #e7edf2, #f7f1e8);
}

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

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
}

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

.sidebar {
  background: linear-gradient(180deg, #061b17, #0d2a24 56%, #0b201d);
  color: #ecf6f2;
  padding: 22px 14px;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0;
}

.brand span {
  display: block;
  margin-top: 5px;
  color: #adc1ba;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 7px;
  margin-top: 20px;
}

.nav button {
  width: 100%;
  text-align: left;
  color: #dce9e5;
  background: transparent;
  border-radius: 6px;
  padding: 11px 12px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.nav button:hover,
.nav button.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav button.active {
  box-shadow: inset 3px 0 0 #d7a45b;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.content {
  padding: 22px 28px 38px;
}

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

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) repeat(4, minmax(140px, 1fr));
  gap: 10px;
  align-items: end;
  flex: 1;
  min-width: 0;
}

.filter-field {
  display: grid;
  gap: 5px;
}

.filter-field span {
  color: var(--muted);
  font-size: 12px;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.filter-actions .checkline,
.filter-actions .btn {
  white-space: nowrap;
  min-width: max-content;
}

.more-filter-panel {
  display: grid;
  grid-template-columns: minmax(240px, 420px);
  gap: 10px;
  margin: -4px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.completion-filter {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff7e6;
  color: #7a4a0a;
  font-weight: 700;
}

.loss-filter {
  background: #fff1f0;
  color: var(--danger);
}

.aftersale-filter {
  background: #edf7f3;
  color: var(--brand);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

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

.field label {
  color: var(--muted);
  font-size: 12px;
}

.person-cell {
  display: grid;
  gap: 3px;
  min-width: 104px;
}

.person-cell strong {
  color: var(--text);
  font-size: 13px;
}

.person-cell span {
  color: var(--muted);
  font-size: 12px;
}

.input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.input:focus,
select:focus,
textarea:focus {
  border-color: #2f8a73;
  box-shadow: 0 0 0 3px rgba(15, 107, 85, 0.13);
}

textarea {
  min-height: 78px;
  resize: vertical;
}

.btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  background: #e8edf2;
  color: var(--text);
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 107, 85, 0.18);
}

.btn.primary:hover {
  background: var(--brand-dark);
}

.btn.danger {
  background: #fde8e7;
  color: var(--danger);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-page {
  max-width: 1880px;
}

.dashboard-toolbar {
  align-items: stretch;
  position: sticky;
  top: 57px;
  z-index: 8;
  margin-bottom: 16px;
  border: 1px solid rgba(213, 221, 230, 0.72);
  border-radius: 12px;
  padding: 10px;
  background: rgba(247, 250, 251, 0.82);
  box-shadow: 0 16px 34px rgba(25, 36, 50, 0.07);
  backdrop-filter: blur(10px);
}

.dashboard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.8fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 178px;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 30px 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(118deg, rgba(14, 115, 89, 0.98), rgba(8, 61, 56, 0.98) 46%, rgba(6, 25, 22, 0.99)),
    linear-gradient(90deg, rgba(215, 164, 91, 0.16), rgba(37, 99, 235, 0.11));
  color: #f7fbfa;
  box-shadow: 0 30px 70px rgba(8, 26, 33, 0.2);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto 28px 18px 28px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(215, 164, 91, 0.7), transparent);
  pointer-events: none;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.18;
  pointer-events: none;
}

.hero-copy,
.hero-kpis,
.hero-profit {
  position: relative;
  z-index: 1;
}

.dashboard-hero span,
.dashboard-hero em,
.hero-profit span {
  display: block;
  color: rgba(247, 251, 250, 0.72);
  font-style: normal;
}

.dashboard-hero strong {
  display: block;
  margin-top: 6px;
  font-size: 40px;
  line-height: 1.15;
}

.dashboard-hero em {
  margin-top: 8px;
  font-size: 13px;
}

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

.hero-kpis div {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-kpis strong {
  margin: 0;
  color: #ffffff;
  font-size: 24px;
  white-space: nowrap;
}

.hero-profit {
  min-width: 240px;
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.hero-profit strong {
  color: #ffffff;
  font-size: 40px;
}

.dashboard-cards {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 16px;
  box-shadow: var(--shadow);
}

.dashboard-cards .metric {
  position: relative;
  overflow: hidden;
  min-height: 96px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
    linear-gradient(135deg, rgba(15, 107, 85, 0.05), rgba(215, 164, 91, 0.04));
  box-shadow: 0 16px 36px rgba(25, 36, 50, 0.07);
}

.dashboard-cards .metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #0f6b55, #2563eb, #d7a45b);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.1;
}

.metric.good strong {
  color: var(--ok);
}

.metric.warn strong {
  color: var(--accent);
}

.analysis-panel {
  margin: 0 0 18px;
  border: 1px solid rgba(213, 221, 230, 0.86);
  border-radius: 12px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 250, 0.98)),
    linear-gradient(135deg, rgba(15, 107, 85, 0.05), rgba(37, 99, 235, 0.04), rgba(215, 164, 91, 0.05));
  box-shadow: 0 18px 44px rgba(25, 36, 50, 0.08);
}

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

.analysis-head span {
  display: block;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.analysis-head h3 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 20px;
}

.analysis-head em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  text-align: right;
}

.analysis-controls {
  display: grid;
  grid-template-columns: 130px minmax(140px, 1fr) minmax(140px, 1fr) 120px 150px 150px 150px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.analysis-submit {
  min-height: 42px;
}

.analysis-empty {
  border: 1px dashed rgba(148, 163, 184, 0.55);
  border-radius: 10px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 700;
}

.analysis-result {
  display: grid;
  gap: 14px;
}

.analysis-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(213, 221, 230, 0.8);
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.analysis-summary span,
.analysis-summary em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.analysis-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
}

.analysis-kpis {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.analysis-kpi {
  min-height: 94px;
  box-shadow: none;
}

.analysis-kpi em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.analysis-kpi.up em,
.analysis-kpi.up strong {
  color: var(--ok);
}

.analysis-kpi.down em,
.analysis-kpi.down strong {
  color: var(--danger);
}

.promotion-guard {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(213, 221, 230, 0.88);
  border-radius: 12px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(15, 107, 85, 0.06), rgba(37, 99, 235, 0.04)),
    #ffffff;
}

.promotion-guard.good {
  border-color: rgba(15, 107, 85, 0.22);
}

.promotion-guard.warn {
  border-color: rgba(215, 164, 91, 0.36);
  background:
    linear-gradient(135deg, rgba(215, 164, 91, 0.11), rgba(255, 255, 255, 0.86)),
    #ffffff;
}

.promotion-guard.danger {
  border-color: rgba(180, 35, 24, 0.32);
  background:
    linear-gradient(135deg, rgba(180, 35, 24, 0.10), rgba(255, 255, 255, 0.86)),
    #ffffff;
}

.promotion-guard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.promotion-guard-head span,
.promotion-guard-head em,
.promotion-guard-grid em,
.promotion-watch-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.promotion-guard-head strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  font-size: 20px;
}

.promotion-guard-head b {
  min-width: 92px;
  text-align: right;
  color: var(--brand-dark);
  font-size: 28px;
}

.promotion-guard.warn .promotion-guard-head b {
  color: #9a5d00;
}

.promotion-guard.danger .promotion-guard-head b {
  color: var(--danger);
}

.promotion-guard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.promotion-guard-grid span {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(213, 221, 230, 0.88);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.promotion-guard-grid b {
  color: var(--ink);
  font-size: 16px;
}

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

.promotion-watch-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(220px, 1.5fr) 90px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(213, 221, 230, 0.86);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.promotion-watch-row:hover {
  border-color: rgba(15, 107, 85, 0.34);
  box-shadow: 0 10px 24px rgba(25, 36, 50, 0.08);
}

.promotion-watch-row strong,
.promotion-watch-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.promotion-watch-row b {
  text-align: right;
  color: var(--brand-dark);
}

.promotion-watch-empty {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.analysis-chart-grid,
.analysis-table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.analysis-chart-card {
  border: 1px solid rgba(213, 221, 230, 0.86);
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.analysis-bars {
  height: 260px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.analysis-day-bar {
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  align-items: end;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.analysis-day-bar i {
  display: block;
  width: 100%;
  min-height: 6px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #0f6b55, #2563eb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.analysis-day-bar:hover i {
  filter: brightness(1.08);
}

.analysis-day-bar i.loss {
  background: linear-gradient(180deg, #b45309, #dc2626);
}

.analysis-day-bar b,
.analysis-day-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
}

.analysis-day-bar b {
  color: var(--ink);
}

.analysis-day-bar span {
  color: var(--muted);
}

.compact-table table {
  font-size: 13px;
}

.linklike {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.linklike:hover {
  text-decoration: underline;
}

.analysis-rank-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.analysis-rank-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
}

.analysis-rank-row > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #edf7f2;
  color: var(--brand);
  font-weight: 900;
}

.analysis-rank-row strong,
.analysis-rank-row em {
  display: block;
}

.analysis-rank-row em {
  margin: 2px 0 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.analysis-rank-row b {
  color: var(--ink);
  white-space: nowrap;
}

.diagnosis-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
  margin: 0 0 18px;
}

.diagnosis-main,
.diagnosis-side {
  border: 1px solid rgba(213, 221, 230, 0.82);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 250, 0.98)),
    linear-gradient(135deg, rgba(15, 107, 85, 0.05), rgba(37, 99, 235, 0.04), rgba(215, 164, 91, 0.05));
  box-shadow: 0 18px 44px rgba(25, 36, 50, 0.08);
}

.diagnosis-main {
  padding: 20px;
}

.diagnosis-side {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.diagnosis-head span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.diagnosis-head strong {
  color: var(--ink);
  font-size: 18px;
}

.diagnosis-main p {
  margin: 0 0 16px;
  color: #253244;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.65;
}

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

.diagnosis-metric {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(213, 221, 230, 0.9);
  border-radius: 10px;
  padding: 14px;
  background: #ffffff;
}

.diagnosis-metric span,
.diagnosis-metric em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.diagnosis-metric strong {
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
}

.diagnosis-metric.up strong {
  color: var(--ok);
}

.diagnosis-metric.down strong {
  color: var(--danger);
}

.diagnosis-metric.flat strong {
  color: #475569;
}

.diagnosis-block,
.seven-trend {
  border: 1px solid rgba(213, 221, 230, 0.8);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
}

.diagnosis-block h3,
.seven-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.diagnosis-block ul {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.diagnosis-block li {
  position: relative;
  padding-left: 16px;
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
}

.diagnosis-block li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--brand);
}

.action-block li::before {
  background: var(--accent);
}

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

.seven-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.seven-bars {
  height: 156px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.seven-bar {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 5px;
  align-items: end;
  text-align: center;
  min-width: 0;
}

.seven-bar i {
  width: 100%;
  min-height: 8px;
  display: block;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #0f6b55, #2563eb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.seven-bar b,
.seven-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.seven-bar b {
  color: var(--ink);
}

.seven-bar span {
  color: var(--muted);
}

.visual-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.insight-fold > summary {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-dark);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.insight-fold {
  grid-column: 1 / -1;
}

.insight-fold > summary {
  margin-bottom: 14px;
}

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

.insight-fold-grid .visual-panel {
  margin: 0;
  grid-column: auto;
}

.visual-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 18px 44px rgba(25, 36, 50, 0.08);
  min-height: 210px;
}

.dashboard-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 252, 253, 0.97)),
    linear-gradient(135deg, rgba(15, 107, 85, 0.035), rgba(37, 99, 235, 0.03), rgba(215, 164, 91, 0.04));
}

.dashboard-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 4px;
  background: linear-gradient(90deg, #0f6b55, #2563eb, #d7a45b, #dc2626);
}


.shop-compare-panel {
  grid-column: span 7;
}

.staff-panel {
  grid-column: span 5;
}

.detail-panel {
  grid-column: 1 / -1;
}

.quality-panel,
.material-panel,
.risk-panel,
.cost-panel {
  grid-column: span 6;
}

.risk-panel,
.material-panel,
.staff-panel,
.cost-panel {
  min-height: 260px;
}

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

.detail-metrics span {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid #dde7e4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f6faf9);
  color: var(--muted);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
}

.detail-metrics b {
  color: var(--text);
  font-size: 17px;
}

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

.detail-table-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.detail-table-card h3 {
  margin: 0 0 10px;
  color: #101d19;
  font-size: 15px;
}

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

.visual-head h3 {
  margin: 0;
  color: #101d19;
  font-size: 18px;
}

.visual-head span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: #edf4f1;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.row-actions .delete-order {
  margin-left: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
}

.status-normal {
  color: #0f6b55;
  background: #e7f5ef;
}

.status-before-refund {
  color: #275276;
  background: #e7f0f8;
}

.status-after-refund {
  color: #a45b11;
  background: #fff1d9;
}

.status-partial-refund {
  color: #7a4a0a;
  background: #fff7d6;
}

.status-resend {
  color: #5b3aa5;
  background: #efe9ff;
}

.status-other {
  color: #475569;
  background: #edf2f7;
}

.quality-stack {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
  box-shadow: inset 0 0 0 1px rgba(15, 31, 26, 0.06);
}

.quality-seg {
  display: block;
  min-width: 5px;
  transform-origin: left;
  animation: widthGrow 520ms ease-out both;
}

.quality-aboveNormal {
  background: #0f6b55;
}

.quality-between {
  background: #2563eb;
}

.quality-belowVolume {
  background: #d7a45b;
}

.quality-loss {
  background: #dc2626;
}

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

.quality-card {
  border: 1px solid #dce3eb;
  border-radius: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
}

.quality-card span,
.quality-card em,
.quality-card small {
  display: block;
}

.quality-card span {
  color: #31423d;
  font-weight: 800;
}

.quality-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: 28px;
  line-height: 1;
}

.quality-card em,
.quality-card small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.quality-card.quality-aboveNormal strong {
  color: #0f6b55;
}

.quality-card.quality-between strong {
  color: #2563eb;
}

.quality-card.quality-belowVolume strong {
  color: #a56b1f;
}

.quality-card.quality-loss strong {
  color: #dc2626;
}

.risk-note {
  margin-top: 12px;
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff4db;
  color: #8a4b08;
  font-weight: 700;
}

.compare-bars,
.rank-list,
.risk-list,
.staff-grid {
  display: grid;
  gap: 11px;
}

.compare-row {
  display: grid;
  grid-template-columns: 100px 1fr 58px;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #edf1f4;
}

.compare-row:last-child {
  border-bottom: 0;
}

.compare-name {
  display: grid;
  gap: 4px;
  overflow: hidden;
  color: #21332d;
  font-weight: 800;
}

.compare-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-name em {
  color: var(--brand);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.compare-lines {
  display: grid;
  gap: 7px;
}

.compare-line {
  display: grid;
  grid-template-columns: 34px 1fr 92px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.compare-track,
.rank-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}

.compare-track i,
.rank-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: left;
  animation: widthGrow 520ms ease-out both;
}

.compare-track .sales {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.rank-track .sales {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.compare-track .orders {
  background: linear-gradient(90deg, #d7a45b, #f4c56a);
}

.compare-track .profit,
.rank-track .profit {
  background: linear-gradient(90deg, #0f6b55, #34d399);
}

.compare-track .loss,
.rank-track .loss {
  background: linear-gradient(90deg, #b42318, #ef4444);
}

.compare-line b,
.compare-rate {
  color: #263a34;
  font-weight: 800;
  text-align: right;
}

.danger-text {
  color: var(--danger) !important;
}

.good-text {
  color: var(--success) !important;
}

.risk-order {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto 90px;
  gap: 12px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #dce3eb;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f9fbfb);
}

.risk-order strong,
.risk-order span,
.risk-money b,
.risk-money span {
  display: block;
}

.risk-order strong {
  color: #1f2a37;
}

.risk-order span,
.risk-money span {
  color: var(--muted);
  font-size: 12px;
}

.risk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.risk-tags em {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #fff4db;
  color: #8a4b08;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.risk-money {
  text-align: right;
}

.risk-money b {
  font-size: 17px;
}

.rank-row {
  display: grid;
  grid-template-columns: 30px 1fr 92px;
  gap: 10px;
  align-items: center;
}

.rank-no {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #10251f;
  color: #fff;
  font-weight: 800;
}

.rank-row strong,
.rank-row em {
  display: block;
}

.rank-row strong {
  margin-bottom: 3px;
  color: #21332d;
}

.rank-row em {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.rank-row b {
  text-align: right;
  color: #0f6b55;
  font-size: 16px;
}

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

.staff-card {
  border: 1px solid #dce3eb;
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
}

.staff-card span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #e8f1ee;
  color: #0f6b55;
  font-weight: 800;
}

.staff-card strong,
.staff-card em,
.staff-card b {
  display: block;
}

.staff-card strong {
  margin-top: 8px;
  color: #1f2a37;
}

.staff-card em {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.staff-card b {
  margin-top: 7px;
  color: #0f6b55;
  text-align: right;
}

.trend-panel {
  grid-row: span 2;
}

.trend-svg {
  width: 100%;
  height: 190px;
  display: block;
}

.trend-svg line {
  stroke: #d7e0dc;
  stroke-width: 2;
}

.trend-bars rect {
  fill: rgba(15, 103, 76, 0.18);
  animation: barGrow 520ms ease-out both;
  transform-origin: bottom;
  transform-box: fill-box;
}

.trend-svg polyline {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: lineDraw 820ms ease-out forwards;
}

.trend-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.stack-bar {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f0;
}

.stack-seg {
  display: block;
  min-width: 3px;
  transform-origin: left;
  animation: widthGrow 520ms ease-out both;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  color: #344841;
  font-size: 13px;
}

.legend-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-list i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 11px;
  border-radius: 999px;
  background: #edf2f0;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transform-origin: left;
  animation: widthGrow 520ms ease-out both;
}

.bar-value {
  text-align: right;
  color: #263a34;
  font-weight: 700;
}

.seg-0 {
  background: #0f674c;
}

.seg-1 {
  background: #2563eb;
}

.seg-2 {
  background: #b7791f;
}

.seg-3 {
  background: #8b5cf6;
}

.seg-4 {
  background: #dc2626;
}

.empty-chart {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

@keyframes widthGrow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes barGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes lineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #eef3f1;
  color: #33433e;
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:last-child td {
  border-bottom: 0;
}

.money-cell {
  display: grid;
  gap: 3px;
}

.money-cell strong {
  font-size: 13px;
}

.money-cell span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.table-titlebar h3 {
  margin: 0;
}

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

.pagination-size select {
  width: 76px;
}

.pagination {
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

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

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.item-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr 1.2fr 0.9fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #fbfcfd;
}

.item-row.staff-item-row {
  grid-template-columns: 1fr 1fr 0.8fr 1.2fr 0.9fr 1fr auto;
}

.item-row.missing-cost-row {
  border-color: #ef4444;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.material-picker {
  display: grid;
  gap: 6px;
}

.material-select {
  min-width: 150px;
}

.shop-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.shop-selected {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 10px;
  border: 1px solid #b9d8cd;
  border-radius: 8px;
  padding: 0 14px;
  background: #e8f6f1;
  color: #174439;
  font-weight: 800;
}

.shop-selected.empty {
  border-color: #f0c36d;
  background: #fff4db;
  color: #8a4b08;
}

.shop-selected strong {
  margin-left: 6px;
  font-size: 16px;
}

.shop-picker-safe .shop-chip {
  min-width: 82px;
  min-height: 44px;
  text-align: center;
}

.shop-chip {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 16px;
  color: #10201b;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

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

.shop-chip.active {
  border-color: #10201b;
  box-shadow: 0 0 0 3px rgba(15, 103, 76, 0.16);
}

.shop-color-0 {
  background: #dff6ed;
}

.shop-color-1 {
  background: #e5edff;
}

.shop-color-2 {
  background: #fff0cf;
}

.shop-color-3 {
  background: #f0e8ff;
}

.shop-color-4 {
  background: #ffe5e5;
}

.shop-color-5 {
  background: #dcf5ff;
}

.shop-color-6 {
  background: #eceff3;
}

.shop-color-7 {
  background: #e9f8d8;
}

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

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

.badge.ok {
  background: #e7f4ee;
  color: var(--ok);
}

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

.error,
.notice {
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.error {
  background: #fde8e7;
  color: var(--danger);
}

.notice {
  background: #e7f4ee;
  color: #165f43;
}

.notice.warn {
  background: #fff4db;
  color: #8a4b08;
}

.summary-line {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
}

.dashboard-summary-panel {
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fbfb);
  box-shadow: 0 16px 34px rgba(25, 36, 50, 0.07);
}

.dashboard-summary-panel .summary-line span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 11px;
  background: #eef5f2;
  color: #33433e;
  font-weight: 700;
}

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

.dashboard-table-grid .panel {
  margin: 0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(25, 36, 50, 0.06);
}

.dashboard-table-grid .panel:nth-child(5) {
  grid-column: 1 / -1;
}

.expense-page {
  display: grid;
  gap: 14px;
  max-width: 1880px;
}

.reconcile-page,
.reconcile-result {
  display: grid;
  gap: 14px;
}

.reconcile-upload {
  border-color: #c7d8d2;
}

.reconcile-submit {
  display: flex;
  align-items: end;
}

.reconcile-submit .btn {
  width: 100%;
}

.reconcile-note {
  margin: 14px 0 0;
}

.reconcile-upload-status {
  min-height: 22px;
  margin-top: 10px;
  font-weight: 700;
}

.reconcile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(9, 75, 60, 0.94), rgba(15, 107, 85, 0.88)),
    #0b2a23;
  color: #f5fbf8;
}

.reconcile-hero span,
.reconcile-hero em {
  display: block;
  color: #cfe1dc;
  font-style: normal;
}

.reconcile-hero strong {
  display: block;
  margin: 4px 0;
  font-size: 20px;
}

.reconcile-cards {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.reconcile-filter-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.reconcile-filter-card:hover {
  border-color: #95b8aa;
  box-shadow: 0 12px 28px rgba(15, 107, 85, 0.12);
}

.reconcile-filter-card.active {
  border-color: #0f6b55;
  box-shadow: inset 0 0 0 2px rgba(15, 107, 85, 0.18), 0 14px 30px rgba(15, 107, 85, 0.16);
}

.reconcile-section .table-titlebar {
  align-items: flex-start;
}

.reconcile-section .table-titlebar p {
  margin: 4px 0 0;
}

.reconcile-remark {
  max-width: 360px;
  white-space: normal;
}

.reconcile-aftersale-row td {
  background: #fff7ed;
}

.low-value-panel {
  border-color: #f0c36d;
}

.low-value-action {
  display: grid;
  grid-template-columns: 96px auto;
  gap: 8px;
  align-items: center;
}

.expense-hero {
  min-height: 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 22px 26px;
  color: #f6fffb;
  background:
    linear-gradient(120deg, rgba(15, 107, 85, 0.96), rgba(7, 31, 26, 0.98)),
    linear-gradient(90deg, rgba(215, 164, 91, 0.18), transparent 52%);
  box-shadow: 0 18px 44px rgba(7, 31, 26, 0.16);
}

.expense-hero span,
.expense-hero strong,
.expense-hero em {
  display: block;
}

.expense-hero span {
  color: rgba(246, 255, 251, 0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.expense-hero strong {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1;
}

.expense-hero em {
  margin-top: 9px;
  color: rgba(246, 255, 251, 0.76);
  font-style: normal;
}

.expense-month {
  display: grid;
  gap: 7px;
}

.expense-month input {
  background: rgba(255, 255, 255, 0.94);
}

.expense-cards {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.expense-panel {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, #0f6b55, #2563eb, #d7a45b) 1;
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.expense-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-titlebar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-titlebar h3 {
  margin: 0;
}

.section-titlebar span {
  color: var(--muted);
  font-size: 12px;
}

.expense-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
}

.expense-shop-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 170px;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdfd, #f5f8f8);
}

.expense-shop-title,
.expense-shop-input {
  display: grid;
  gap: 3px;
}

.expense-shop-title strong {
  color: #14231f;
  font-weight: 800;
}

.expense-shop-title em,
.expense-shop-input small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.expense-other-grid {
  display: grid;
  gap: 10px;
}

.expense-other-row {
  display: grid;
  grid-template-columns: 76px minmax(180px, 1fr) 150px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfb;
}

.expense-other-row span {
  color: #33433e;
  font-weight: 800;
}

.expense-footer {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.quote-page {
  max-width: 1680px;
}

.quote-workspace {
  display: grid;
  grid-template-columns: minmax(380px, 0.72fr) minmax(520px, 1fr);
  gap: 18px;
  align-items: start;
}

.quote-surface {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.quote-editor {
  position: sticky;
  top: 82px;
}

.quote-surface-head,
.quote-size-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quote-surface-head h3,
.quote-size-head h3 {
  margin: 0;
  font-size: 17px;
}

.quote-state {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eef6f3;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.quote-field-grid .field label,
.quote-item-row .field label {
  color: #526174;
  font-weight: 700;
}

.quote-size-head {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quote-item-row {
  display: grid;
  grid-template-columns: 1fr 1fr 0.72fr 0.82fr auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #dce3eb;
  border-radius: 8px;
  background: var(--panel-soft);
}

.quote-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.quote-result-wrap {
  display: grid;
  gap: 16px;
}

.quote-empty,
.quote-loading {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.quote-logistics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.quote-logistics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f6f9fb);
  padding: 12px;
}

.quote-logistics span,
.quote-logistics strong {
  display: block;
}

.quote-logistics strong {
  margin-top: 5px;
  line-height: 1.45;
}

.quote-history {
  display: grid;
  gap: 8px 12px;
  margin-bottom: 14px;
  border: 1px solid #d7e5df;
  border-radius: 8px;
  padding: 11px 12px;
  background: #f2f8f5;
  color: #27463d;
}

.quote-history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.quote-history strong {
  color: var(--brand-dark);
}

.quote-scenario-grid {
  display: grid;
  gap: 8px;
}

.quote-history-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #ffffff;
  color: #36564d;
  font-weight: 700;
}

.quote-deal-price {
  display: grid;
  grid-template-columns: 116px minmax(120px, auto) 1fr;
  gap: 10px;
  align-items: center;
}

.quote-deal-price span,
.quote-deal-price em,
.quote-history small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.quote-deal-price strong {
  font-size: 24px;
}

.quote-history.muted {
  color: var(--muted);
  background: #f7f9fb;
  border-color: var(--line);
}

@media (max-width: 760px) {
  .quote-deal-price {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.quote-ai-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid #bbdfd2;
  border-radius: 8px;
  padding: 12px;
  background: #f4fbf8;
}

.quote-ai-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.quote-ai-head strong,
.quote-ai-head span {
  display: block;
}

.quote-ai-head span,
.quote-ai-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.quote-ai-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quote-ai-rule {
  display: grid;
  gap: 5px;
  border: 1px solid #d5e8df;
  border-radius: 8px;
  padding: 10px;
  background: #ffffff;
}

.quote-ai-rule span,
.quote-ai-rule small,
.quote-ai-rule p {
  color: var(--muted);
  font-size: 12px;
}

.quote-ai-rule strong {
  color: var(--brand);
  font-size: 24px;
}

.quote-ai-rule p {
  margin: 0;
  line-height: 1.5;
}

.quote-ai-snippets {
  display: grid;
  gap: 7px;
}

.quote-ai-snippets span {
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
}

.quote-warnings {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.quote-warnings span {
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff4db;
  color: #8a4b08;
}

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

.quote-mode-card {
  border: 1px solid #d5dde6;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fafb);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(18, 31, 45, 0.06);
}

.quote-mode-card.volume {
  border-color: #dcc8a8;
  background: linear-gradient(180deg, #fffdf9, #fbf6ee);
}

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

.quote-mode-head span {
  font-weight: 700;
  color: #1f2a37;
}

.quote-mode-head strong {
  color: var(--brand);
  font-size: 30px;
  line-height: 1;
}

.quote-mode-card.volume .quote-mode-head strong {
  color: var(--accent);
}

.quote-unit {
  color: var(--muted);
  font-weight: 700;
}

.quote-suggestion {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid #d7e5df;
  border-radius: 8px;
  padding: 10px;
  background: #f2f8f5;
}

.quote-suggestion span,
.quote-suggestion em {
  color: var(--muted);
  font-style: normal;
  font-weight: 700;
}

.quote-suggestion strong {
  grid-row: span 2;
  color: var(--brand);
  font-size: 24px;
}

.quote-mode-card textarea {
  width: 100%;
  min-height: 112px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #ffffff;
  resize: vertical;
  font-weight: 700;
}

.quote-mode-detail,
.quote-detail-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.quote-admin-panel {
  box-shadow: var(--shadow-soft);
}

.ai-cards {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  margin-bottom: 16px;
}

.ai-panel {
  margin-bottom: 16px;
}

.ai-note {
  margin: -4px 0 14px;
}

.ai-export-grid {
  align-items: end;
}

.ai-export-action {
  align-self: end;
}

.ai-json-input {
  min-height: 180px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.ai-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ai-result-list {
  display: grid;
  gap: 12px;
}

.ai-result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

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

.ai-result-head strong,
.ai-result-head span {
  display: block;
}

.ai-json-preview {
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.36);
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(18, 31, 45, 0.22);
  padding: 18px;
}

.modal.modal-narrow {
  width: min(460px, 100%);
}

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

.modal-head h3 {
  margin: 0;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

  .grid.two,
  .grid.three,
  .grid.four,
  .cards,
  .visual-grid,
  .dashboard-grid,
  .dashboard-table-grid,
  .diagnosis-panel,
  .analysis-controls,
  .analysis-chart-grid,
  .analysis-table-grid,
  .insight-fold-grid,
  .quote-workspace,
  .quote-logistics,
  .quote-modes {
    grid-template-columns: 1fr;
  }

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

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

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

  .dashboard-cards,
  .analysis-kpis,
  .diagnosis-grid,
  .quality-grid,
  .staff-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-compare-panel,
  .staff-panel,
  .detail-panel,
  .quality-panel,
  .material-panel,
  .risk-panel,
  .cost-panel {
    grid-column: 1 / -1;
  }

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

  .detail-table-grid {
    grid-template-columns: 1fr;
  }

  .quote-editor {
    position: static;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .more-filter-panel {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    grid-column: 1 / -1;
  }

  .filter-actions .checkline,
  .filter-actions .btn {
    min-width: 0;
  }

  .trend-panel {
    grid-row: auto;
  }

  .bar-row {
    grid-template-columns: 78px 1fr 64px;
  }

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

  .quote-item-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 14px 16px;
    flex-direction: column;
  }

  .content {
    padding: 16px;
  }

  .quote-field-grid,
  .quote-item-row,
  .dashboard-cards,
  .analysis-kpis,
  .hero-kpis,
  .quality-grid,
  .staff-grid,
  .diagnosis-grid,
  .detail-metrics,
  .detail-table-grid,
  .dashboard-table-grid {
    grid-template-columns: 1fr;
  }

  .compare-row,
  .risk-order,
  .rank-row,
  .analysis-summary,
  .analysis-rank-row,
  .expense-shop-row,
  .expense-other-row {
    grid-template-columns: 1fr;
  }

  .analysis-head,
  .analysis-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .analysis-head em {
    text-align: left;
  }

  .expense-shop-grid {
    grid-template-columns: 1fr;
  }

  .expense-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .compare-line {
    grid-template-columns: 34px 1fr 76px;
  }

  .compare-rate,
  .rank-row b,
  .risk-money {
    text-align: left;
  }

  .quote-surface-head,
  .quote-size-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.mono-input {
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0;
}

.setting-note {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 0;
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
    background: #f3f6f8;
  }

  .layout {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 10px 10px 8px;
    background: #06241e;
  }

  .brand {
    padding: 4px 6px 8px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand span {
    display: none;
  }

  .nav {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: 84px;
    min-height: 40px;
    padding: 9px 12px;
    text-align: center;
    white-space: nowrap;
  }

  .nav button.active {
    box-shadow: inset 0 -3px 0 #d7a45b;
  }

  .topbar {
    min-height: 54px;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .userbox {
    gap: 6px;
    font-size: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .content {
    padding: 12px 10px 24px;
  }

  .panel,
  .quote-surface,
  .visual-panel,
  .metric,
  .quote-mode-card {
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(18, 31, 45, 0.06);
  }

  .panel,
  .quote-surface,
  .visual-panel {
    padding: 14px;
  }

  .toolbar,
  .toolbar-left,
  .toolbar-right,
  .filter-actions {
    align-items: stretch;
    width: 100%;
  }

  .filter-grid,
  .more-filter-panel,
  .grid.two,
  .grid.three,
  .grid.four,
  .quote-field-grid,
  .quote-item-row,
  .item-row,
  .item-row.staff-item-row,
  .dashboard-cards,
  .quality-grid,
  .staff-grid,
  .detail-metrics,
  .detail-table-grid,
  .quote-logistics,
  .quote-modes {
    grid-template-columns: 1fr;
  }

  .filter-actions .checkline,
  .filter-actions .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .input,
  select,
  textarea,
  .btn {
    min-height: 44px;
    font-size: 16px;
  }

  .btn.small {
    min-height: 38px;
    font-size: 14px;
  }

  .shop-picker {
    gap: 8px;
  }

  .shop-chip,
  .shop-picker-safe .shop-chip {
    min-width: calc(50% - 4px);
    min-height: 46px;
  }

  .quote-workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quote-editor {
    position: static;
  }

  .quote-mode-head strong {
    font-size: 28px;
  }

  .quote-mode-card textarea {
    min-height: 96px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table {
    min-width: 720px;
  }

  .risk-order {
    margin: 0 auto;
  }

  .compare-row,
  .rank-row {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: calc(100vh - 20px);
    padding: 14px;
  }
}

/* V57 final dashboard overrides: keep this block last. */
body {
  background: #f3f7f6;
}

.layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px;
  background: linear-gradient(180deg, #00342e 0%, #012822 54%, #001c18 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08), 18px 0 42px rgba(4, 29, 25, 0.12);
}

.brand {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 62px;
  padding: 4px 8px 22px 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #48d99d, #0f8b6d);
  box-shadow: 0 10px 20px rgba(18, 144, 105, 0.26);
}

.brand::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 14px;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 4px;
  box-shadow: 6px 6px 0 -3px #ffffff;
}

.brand strong {
  font-size: 18px;
}

.brand span {
  color: rgba(230, 247, 241, 0.66);
}

.nav {
  gap: 9px;
  margin-top: 22px;
}

.nav button {
  position: relative;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px 0 42px;
  color: rgba(236, 248, 244, 0.84);
}

.nav button::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(236, 248, 244, 0.72);
  border-radius: 4px;
  transform: translateY(-50%);
}

.nav button:hover,
.nav button.active {
  background: linear-gradient(90deg, rgba(20, 149, 112, 0.95), rgba(12, 114, 92, 0.95));
  border-color: rgba(116, 231, 181, 0.34);
  color: #ffffff;
}

.nav button.active {
  box-shadow: inset 3px 0 0 #f1c15d, 0 14px 26px rgba(4, 83, 67, 0.22);
}

.main {
  background: #f5f8f7;
}

.topbar {
  height: 62px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(214, 224, 221, 0.78);
}

.content {
  padding: 24px 30px 42px;
}

.dashboard-page {
  max-width: none;
}

.dashboard-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.dashboard-titlebar h1 {
  margin: 0;
  color: #081f1a;
  font-size: 28px;
  line-height: 1.15;
}

.dashboard-titlebar span,
.dashboard-titlebar em {
  display: block;
  margin-top: 8px;
  color: #55716a;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.dashboard-toolbar {
  position: static;
  top: auto;
  margin-bottom: 18px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.dashboard-toolbar .toolbar-left,
.dashboard-toolbar .toolbar-right {
  gap: 8px;
}

.dashboard-toolbar .input,
.dashboard-toolbar .btn {
  border-color: #dbe5e2;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(20, 45, 39, 0.04);
}

.dashboard-toolbar .btn.primary,
.analysis-submit {
  background: linear-gradient(180deg, #0b8769, #08745c);
  box-shadow: 0 12px 24px rgba(9, 116, 92, 0.22);
}

.dashboard-hero {
  grid-template-columns: minmax(240px, 1.1fr) minmax(420px, 1.25fr) minmax(220px, 0.5fr);
  min-height: 172px;
  margin-bottom: 18px;
  padding: 28px 32px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(14, 126, 96, 0.98), rgba(4, 72, 63, 0.99)),
    radial-gradient(circle at 72% 60%, rgba(64, 222, 163, 0.22), transparent 34%);
  box-shadow: 0 26px 52px rgba(8, 73, 61, 0.24);
}

.dashboard-hero::after {
  display: none;
}

.dashboard-hero strong {
  font-size: 34px;
  letter-spacing: 0;
}

.hero-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-kpis div,
.hero-profit {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-kpis div {
  min-height: 104px;
  padding: 16px 18px;
}

.hero-profit {
  min-width: 0;
}

.hero-profit strong {
  font-size: 30px;
}

.dashboard-cards {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.dashboard-cards .metric,
.analysis-kpi {
  position: relative;
  min-height: 108px;
  border: 1px solid rgba(218, 227, 224, 0.92);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 16px 32px rgba(16, 41, 35, 0.07);
}

.dashboard-cards .metric::before {
  display: none;
}

.dashboard-cards .metric::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15, 139, 109, 0.16), rgba(45, 155, 226, 0.13));
  transform: translateY(-50%);
}

.analysis-panel,
.analysis-chart-card,
.analysis-report-panel,
.visual-panel {
  border: 1px solid rgba(216, 226, 223, 0.92);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(17, 45, 38, 0.07);
}

.analysis-panel {
  margin-top: 22px;
  padding: 18px;
}

.analysis-controls {
  grid-template-columns: 130px minmax(160px, 1.2fr) minmax(160px, 1.2fr) 130px minmax(150px, 1fr) minmax(150px, 1fr) minmax(140px, 1fr) 150px;
  padding: 14px;
  border: 1px solid #e1e9e7;
  border-radius: 14px;
  background: #f8fbfa;
}

.analysis-chart-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.analysis-table-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.analysis-bars {
  height: 250px;
  gap: 10px;
  padding: 12px 10px 0;
  border-radius: 14px;
  background:
    repeating-linear-gradient(180deg, transparent 0 48px, rgba(226, 235, 232, 0.75) 49px 50px),
    #fbfdfc;
}

.analysis-day-bar i {
  background: linear-gradient(180deg, #0f8b6d, #2f6eea);
  box-shadow: 0 8px 18px rgba(29, 114, 171, 0.22);
}

.analysis-report-panel {
  padding: 18px;
}

.analysis-report-panel p {
  margin: 0 0 14px;
  border-radius: 12px;
  padding: 13px 14px;
  background: #eef8f4;
  color: #073d32;
  font-weight: 900;
}

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

.analysis-report-grid div {
  border: 1px solid #e0e9e6;
  border-radius: 12px;
  padding: 14px;
  background: #ffffff;
}

.analysis-report-grid strong,
.analysis-report-grid em {
  display: block;
}

.analysis-report-grid strong {
  margin-bottom: 10px;
  color: #0b322b;
}

.analysis-report-grid em {
  position: relative;
  padding: 8px 0 8px 18px;
  color: #405b54;
  font-style: normal;
  font-weight: 700;
}

.analysis-report-grid em::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f8b6d;
}

.shop-compare-panel,
.detail-panel {
  grid-column: span 7;
}

.staff-panel,
.quality-panel {
  grid-column: span 5;
}

.material-panel,
.risk-panel,
.cost-panel {
  grid-column: span 4;
}

.dashboard-panel::before {
  height: 0;
}

@media (max-width: 1180px) {
  .hero-kpis,
  .dashboard-cards,
  .analysis-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-hero,
  .analysis-chart-grid,
  .analysis-table-grid,
  .analysis-report-grid {
    grid-template-columns: 1fr;
  }

  .shop-compare-panel,
  .detail-panel,
  .staff-panel,
  .quality-panel,
  .material-panel,
  .risk-panel,
  .cost-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .sidebar {
    height: auto;
  }

  .dashboard-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-toolbar .toolbar-left,
  .dashboard-toolbar .toolbar-right {
    width: 100%;
  }

  .dashboard-toolbar .input,
  .dashboard-toolbar .btn {
    flex: 1 1 140px;
  }
}

/* V58 practical dashboard cleanup: remove decoration, keep the boss view readable. */
body {
  background: #f2f5f6;
}

.layout {
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  background: #062f28;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.08);
}

.brand {
  min-height: auto;
  padding: 2px 8px 20px;
}

.brand::before,
.brand::after,
.nav button::before {
  display: none !important;
  content: none !important;
}

.nav button {
  justify-content: flex-start;
  padding: 0 14px;
  border-radius: 8px;
}

.nav button:hover,
.nav button.active {
  background: rgba(19, 128, 99, 0.8);
}

.nav button.active {
  box-shadow: inset 4px 0 0 #d8a452;
}

.dashboard-titlebar h1 {
  font-size: 26px;
}

.dashboard-titlebar span,
.dashboard-titlebar em {
  font-weight: 700;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  grid-template-areas:
    "copy kpis"
    "copy profit";
  gap: 12px 18px;
  align-items: stretch;
  min-height: 0;
  overflow: visible;
  padding: 24px 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f765f 0%, #073c34 100%);
  box-shadow: 0 16px 34px rgba(9, 53, 45, 0.18);
}

.dashboard-hero::before,
.dashboard-hero::after {
  display: none !important;
  content: none !important;
}

.hero-copy {
  grid-area: copy;
  align-self: center;
}

.hero-copy span {
  letter-spacing: 0;
}

.hero-copy strong {
  font-size: clamp(30px, 3vw, 42px);
}

.hero-kpis {
  grid-area: kpis;
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  min-width: 0;
}

.hero-kpis div,
.hero-profit {
  min-width: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

.hero-kpis div {
  min-height: 86px;
  padding: 14px;
}

.hero-kpis strong {
  font-size: clamp(22px, 1.7vw, 30px);
  line-height: 1.12;
  white-space: nowrap;
}

.hero-profit {
  grid-area: profit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px 18px;
}

.hero-profit strong {
  font-size: clamp(26px, 2vw, 36px);
  line-height: 1.1;
  white-space: nowrap;
}

.hero-profit em {
  color: rgba(255, 255, 255, 0.72);
  flex: 1 0 100%;
  font-size: 12px;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.dashboard-cards {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 14px;
}

.dashboard-cards .metric {
  min-height: 104px;
  overflow: visible;
  padding: 18px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(25, 36, 50, 0.06);
}

.dashboard-cards .metric::before,
.dashboard-cards .metric::after {
  display: none !important;
  content: none !important;
}

.metric strong {
  max-width: 100%;
  font-size: clamp(22px, 1.55vw, 30px);
  line-height: 1.15;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .dashboard-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "kpis"
      "profit";
  }

  .hero-kpis,
  .dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-kpis,
  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .hero-profit {
    display: grid;
    justify-content: stretch;
  }
}

/* V68 quote layout: allow the result table to scroll inside its panel instead
   of forcing the whole page wider than the current desktop/mobile viewport. */
.quote-workspace > *,
.quote-result-wrap,
.quote-surface,
.quote-admin-panel .table-wrap {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1320px) {
  .quote-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .quote-editor {
    position: static;
  }
}

/* V68 responsive containment for the boss analysis and reconciliation pages. */
.analysis-controls {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.analysis-controls > *,
.reconcile-page > *,
.reconcile-result > * {
  min-width: 0;
  max-width: 100%;
}

.analysis-controls .input,
.analysis-controls .btn {
  width: 100%;
  min-width: 0;
}

.reconcile-page,
.reconcile-result {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
}

.hero-profit {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
}

.hero-profit em {
  flex: none;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

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

  .promotion-guard-grid,
  .promotion-watch-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .promotion-watch-row b {
    text-align: left;
  }
}

@media (max-width: 680px) {
  .analysis-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .promotion-guard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .promotion-guard-head b {
    text-align: left;
  }

  .promotion-guard-grid,
  .promotion-watch-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-profit {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-profit em {
    text-align: left;
  }

  .reconcile-page .section-titlebar,
  .reconcile-page .table-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* V77 filing footer: show ICP and police registration on login and app pages. */
.main {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.content {
  flex: 1 0 auto;
}

.login-shell {
  grid-template-rows: 1fr auto;
}

.login-shell .login-card {
  align-self: center;
}

.login-shell .record-footer {
  width: 100%;
  align-self: end;
}

/* V80 permanently expanded navigation and offline-order workspace. */
.permission-editor {
  min-width: 420px;
}

.permission-editor summary {
  cursor: pointer;
  color: var(--accent, #0f766e);
  font-weight: 600;
}

.permission-editor-body {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line, #dbe4e1);
  background: var(--surface-muted, #f7faf9);
  border-radius: 8px;
}

.permission-group + .permission-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #dbe4e1);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 7px 16px;
  margin-top: 8px;
}

.permission-savebar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line, #dbe4e1);
}

@media (max-width: 900px) {
  .permission-editor {
    min-width: 280px;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }
}
.nav {
  display: block;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group {
  margin-bottom: 6px;
}

.nav-group-label {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  padding: 0 10px;
  color: rgba(224, 240, 235, 0.7);
  font-size: 12px;
  font-weight: 700;
}

.nav-group-items {
  display: grid;
  gap: 4px;
  margin-top: 3px;
}

.nav .nav-item {
  width: 100%;
  min-height: 40px;
  padding: 0 14px 0 20px;
  font-size: 14px;
}

.offline-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #dbe7e3;
  border-radius: 8px;
  background: #f7faf9;
}

.offline-mode-bar > div:first-child {
  display: grid;
  gap: 4px;
}

.offline-mode-bar span {
  color: var(--muted);
  font-size: 12px;
}

.segmented-control {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid #d6e2df;
  border-radius: 8px;
  background: #eaf1ef;
}

.segmented-control button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: #50615c;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.segmented-control button.active {
  color: #08614d;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 54, 45, 0.12);
}

.calculated-input {
  color: #075f4c;
  background: #eef8f4 !important;
  font-weight: 800;
}

.offline-detail-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d9e5e1;
  border-radius: 8px;
  background: #f8fbfa;
}

.offline-detail-section .section-titlebar {
  margin-bottom: 12px;
}

.offline-detail-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #dce6e3;
  border-radius: 8px;
  background: #fff;
}

.offline-item-result {
  display: grid;
  align-self: stretch;
  align-content: center;
  gap: 4px;
  min-width: 135px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #24453d;
  background: #edf6f3;
  font-size: 12px;
  font-weight: 800;
}

.offline-item-result em {
  color: var(--danger);
  font-style: normal;
}

.offline-detail-row.zero-cost-row {
  border-color: #e8a7a1;
  background: #fff8f7;
}

.compensation-cell {
  display: grid;
  gap: 2px;
  color: var(--ok);
  white-space: nowrap;
}

.compensation-cell span {
  color: var(--muted);
  font-size: 12px;
}

.compensation-filter {
  color: #075f4c;
  background: #e8f5f0;
}

.offline-detail-totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 12px 4px 0;
  color: var(--muted);
}

.offline-detail-totals strong {
  color: #075f4c;
  font-size: 16px;
}

.offline-project-cell {
  display: grid;
  gap: 3px;
  width: min(330px, 28vw);
  white-space: normal;
}

.offline-project-cell small {
  color: #08745c;
  font-weight: 700;
}

@media (max-width: 1250px) {
  .offline-detail-row {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
  }
}

@media (max-width: 760px) {
  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-group {
    display: contents;
  }

  .nav-group-label {
    display: none;
  }

  .nav-group-items {
    display: flex;
    gap: 8px;
    margin: 0;
  }

  .nav .nav-item {
    width: auto;
    min-width: 84px;
    padding: 9px 12px;
    justify-content: center;
  }

  .offline-mode-bar,
  .offline-detail-totals {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .offline-detail-row {
    grid-template-columns: 1fr;
  }
}
