:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e0e7;
  --accent: #006d77;
  --accent-2: #d15b45;
  --soft: #eef7f6;
  --shadow: 0 18px 42px rgba(25, 42, 62, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

.shell {
  height: 100vh;
  padding: 24px;
  overflow: hidden;
}

.workspace {
  display: block;
}

.main-panel {
  min-width: 0;
  height: calc(100vh - 48px);
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.summary-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
  transition: grid-template-columns 0.18s ease;
}

.summary-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.summary-layout.drawer-collapsed {
  grid-template-columns: 72px minmax(0, 1fr);
}

.summary-sidebar,
.main-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.summary-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
  transition: padding 0.18s ease;
}

.drawer-toggle {
  position: absolute;
  top: 18px;
  right: -15px;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(25, 42, 62, 0.12);
  font-size: 24px;
  line-height: 1;
}

.summary-layout.drawer-collapsed .drawer-toggle {
  right: -18px;
}

.summary-layout.drawer-collapsed .summary-sidebar {
  align-items: center;
  gap: 14px;
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  padding: 18px 12px;
}

.summary-layout.drawer-collapsed .brand {
  justify-content: center;
}

.summary-layout.drawer-collapsed .brand div,
.summary-layout.drawer-collapsed .upload-section,
.summary-layout.drawer-collapsed .reset-all-btn,
.summary-layout.drawer-collapsed .metric-grid,
.summary-layout.drawer-collapsed .status {
  display: none;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.25;
}

.brand p,
#detailSubtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.upload-stack {
  display: grid;
  gap: 12px;
}

.upload-section {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.upload-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.upload-section-hint {
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.upload-error {
  display: block;
  margin-top: -8px;
  font-size: 12px;
  color: #d15b45;
  min-height: 0;
}

.upload-error:empty {
  display: none;
}

.reset-all-btn {
  width: 100%;
  margin-top: 10px;
  padding: 7px 0;
  border: 1px solid #d15b45;
  border-radius: 6px;
  background: transparent;
  color: #d15b45;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.reset-all-btn:hover {
  background: #d15b45;
  color: #fff;
}

.upload-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #97a6b5;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-box:hover {
  border-color: var(--accent);
  background: var(--soft);
}

.upload-box.drag-over {
  border-color: var(--accent);
  background: var(--soft);
  border-style: solid;
  box-shadow: 0 0 0 2px rgba(0, 109, 119, 0.2);
}

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

.upload-name {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.upload-box input {
  display: none;
}

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

.metric-grid div,
.detail-metrics div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.metric-label,
.detail-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.metric-grid strong,
.detail-metrics strong {
  font-size: 22px;
}

.upload-log-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow: hidden;
}

.upload-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.upload-log-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.upload-log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 130px;
  font-size: 12px;
  line-height: 1.6;
}

.upload-log-list li {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px solid #f0f0f0;
}

.upload-log-empty {
  color: var(--muted);
  font-style: italic;
}

.upload-log-time {
  flex-shrink: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.upload-log-type {
  flex-shrink: 0;
  padding: 0 5px;
  border-radius: 3px;
  background: #e8f0fe;
  color: #1a56db;
  font-size: 11px;
  font-weight: 600;
}

.upload-log-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.summary-layout.drawer-collapsed .upload-log-section {
  display: none;
}

.status {
  margin-top: auto;
  padding: 12px;
  border-radius: 8px;
  background: #fff5e8;
  color: #815513;
  font-size: 13px;
  line-height: 1.45;
}

.main-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  height: 38px;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: #344054;
  padding: 0 14px;
}

.tab-btn.active {
  background: var(--accent);
  color: white;
}

.tab-view {
  display: none;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.tab-view.active {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.history-manager {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.history-actions {
  display: flex;
  justify-content: flex-start;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.history-list-wrap {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.small-btn {
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
}

.small-btn.danger {
  background: #d15b45;
}

/* ── Pricing tab ── */
.pricing-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.supplier-manager {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.pricing-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  overflow: auto;
  overscroll-behavior: contain;
}

.supplier-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  overflow: auto;
  overscroll-behavior: contain;
}

.pricing-sidebar .brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.supplier-sidebar .brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.pricing-sidebar .brand h1 {
  font-size: 20px;
  line-height: 1.25;
}

.supplier-sidebar .brand h1 {
  font-size: 20px;
  line-height: 1.25;
}

.pricing-sidebar .brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.supplier-sidebar .brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.supplier-editor {
  display: grid;
  gap: 10px;
}

.supplier-editor label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.supplier-editor input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
}

.supplier-status strong {
  font-size: 18px;
}

.supplier-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.supplier-list-wrap {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.pricing-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.pricing-filter-bar .search-wrap {
  flex: 1;
  min-width: 200px;
}

.pricing-filter-bar select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.pricing-export-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pricing-table-wrap {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.pricing-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.pricing-tree-table .col-expand {
  width: 36px;
  text-align: center;
  padding: 0 4px;
}

.pricing-expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.12s;
}

.pricing-expand-btn:hover {
  background: var(--line);
}

.pricing-drug-row {
  background: var(--panel);
  font-weight: 500;
}

.pricing-drug-row:hover {
  background: #f7f9fb;
}

.pricing-supplier-row {
  background: #f9fbfc;
}

.pricing-supplier-header-row td {
  background: #eef2f6;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}

.pricing-supplier-row td {
  border-bottom: 1px solid #eef2f6;
  font-size: 13px;
}

.pricing-add-row td {
  background: #f0f7f6;
  border-bottom: 1px solid var(--line);
}

.supplier-count-badge {
  display: inline-block;
  background: var(--soft);
  color: var(--accent);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
}

.pricing-supplier-edit,
.pricing-add-supplier {
  width: 160px;
}

.pricing-price-edit,
.pricing-qty-edit,
.pricing-add-price,
.pricing-add-qty {
  width: 90px;
}

/* ── Inbound tab ── */
.inbound-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.inbound-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  padding: 22px;
  border-right: 1px solid var(--line);
  overflow: auto;
  overscroll-behavior: contain;
}

.inbound-sidebar .brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.inbound-sidebar .brand h1 {
  font-size: 20px;
  line-height: 1.25;
}

.inbound-sidebar .brand p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.inbound-sidebar .inbound-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.inbound-sidebar .inbound-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.inbound-sidebar .inbound-stat strong {
  font-size: 18px;
  color: var(--accent);
}

.inbound-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
}

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

.inbound-stat strong {
  font-size: 18px;
  color: var(--accent);
}

.inbound-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.inbound-info {
  min-height: 0;
}

.search-wrap {
  flex: 1 1 0;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.secondary-btn {
  background: #edf1f5;
  color: var(--ink);
}

.secondary-btn:hover {
  background: #dfe7ee;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  background: #eef7f6;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.download-link[hidden] {
  display: none;
}

.column-menu {
  position: relative;
  flex: 0 0 auto;
}

.column-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  width: 190px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 30px rgba(25, 42, 62, 0.16);
}

.column-menu-panel[hidden] {
  display: none;
}

.column-menu-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  cursor: pointer;
}

.column-menu-panel input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  background: #b5c0c9;
  cursor: not-allowed;
}

.icon-btn {
  width: 38px;
  padding: 0;
  background: #edf1f5;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.table-wrap,
.detail-table-wrap {
  overflow: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overscroll-behavior: contain;
}

.table-wrap > table,
.detail-table-wrap > table {
  flex: 0 0 auto;
}

.top-scroll {
  height: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.top-scroll div {
  height: 1px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f6;
  color: #344054;
  text-align: left;
  font-weight: 800;
  height: 56px;
}

.table-wrap thead th,
.pricing-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.table-wrap thead tr:first-child th {
  top: 0;
}

.table-wrap thead tr.filter-row th {
  top: 56px;
  z-index: 5;
}

.pricing-table-wrap thead th {
  box-shadow: inset 0 -1px 0 var(--line);
}

.sort-btn,
.detail-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sort-btn.num,
.detail-sort-btn.num {
  justify-content: flex-end;
  text-align: right;
}

.sort-btn span,
.detail-sort-btn span {
  display: inline-block;
  min-width: 10px;
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
}

.sort-btn:hover,
.sort-btn.active,
.detail-sort-btn:hover,
.detail-sort-btn.active {
  color: var(--accent);
}

.filter-row th {
  top: 56px;
  height: 40px;
  padding-top: 4px;
  padding-bottom: 4px;
  background: #f7f9fb;
  vertical-align: top;
}

.filter-row .filter-control {
  display: block;
}

.filter-control,
.inline-select,
.inline-number,
.inline-text {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
  padding: 0 6px;
  font-size: 12px;
  line-height: 1.2;
}

.store-filter-group {
  display: flex;
  gap: 4px;
  min-width: 0;
  flex-wrap: nowrap;
}

.store-filter-group .filter-control {
  height: 28px;
  font-size: 11px;
  flex: 1 1 0;
  min-width: 0;
}

.inline-select {
  min-width: 180px;
}

.inline-number {
  min-width: 88px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inline-text {
  min-width: 180px;
}

.price-compare-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-compare-cell .inline-number {
  min-width: 0;
  flex: 1 1 auto;
}

.price-arrow {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.price-arrow.up {
  color: #d15b45;
}

.price-arrow.down {
  color: #14804a;
}

.pricing-confirm-select {
  width: 96px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  color: var(--ink);
  padding: 0 6px;
  font-size: 12px;
  cursor: pointer;
}

.pricing-confirm-select.price-updated-select {
  border-color: #f97316;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 700;
}

.store-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  min-width: 70px;
}

.store-check-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #b8c4cf;
  border-radius: 999px;
  background: #f8fafc;
  color: #8a98a6;
  font-size: 14px;
  line-height: 1;
  font-weight: 900;
}

.store-check-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.store-check-btn.checked {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: -5px;
  z-index: 6;
  width: 10px;
  height: 100%;
  cursor: col-resize;
}

.col-resize-handle:hover {
  background: rgba(0, 109, 119, 0.2);
}

.resizing-column {
  cursor: col-resize;
  user-select: none;
}

.sticky-col {
  position: sticky;
  z-index: 2;
  background: white;
}

th.sticky-col {
  z-index: 7;
  background: #eef2f6;
}

.filter-row th.sticky-col {
  z-index: 7;
  background: #f7f9fb;
}

.sticky-col-1 {
  left: 0;
}

.sticky-col-2 {
  left: var(--sticky-code-width, 118px);
  box-shadow: 8px 0 12px -12px rgba(25, 42, 62, 0.55);
}

td.sticky-col-2,
th.sticky-col-2 {
  white-space: normal;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: var(--soft);
}

tbody tr:hover .sticky-col {
  background: var(--soft);
}

tbody tr.row-confirmed,
tbody tr.row-confirmed .sticky-col {
  background: #e7f6ec;
}

tbody tr.row-pending,
tbody tr.row-pending .sticky-col {
  background: #fff7da;
}

tbody tr.row-price-updated,
tbody tr.row-price-updated .sticky-col {
  background: #fff2e8;
}

tbody tr.row-confirmed:hover,
tbody tr.row-confirmed:hover .sticky-col {
  background: #d7f0df;
}

tbody tr.row-pending:hover,
tbody tr.row-pending:hover .sticky-col {
  background: #ffefb0;
}

tbody tr.row-price-updated:hover,
tbody tr.row-price-updated:hover .sticky-col {
  background: #ffe4cc;
}

.no-pricing-badge {
  display: inline-block;
  background: #e5e7eb;
  color: #6b7280;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pricing-no-pricing-row {
  opacity: 0.6;
}

.no-supplier-badge {
  display: inline-block;
  background: #d15b45;
  color: #fff;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  margin-left: 6px;
}

.empty-row td {
  height: 180px;
  color: var(--muted);
  text-align: center;
  cursor: default;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.center {
  text-align: center;
}

.supplier-pill {
  display: inline-flex;
  max-width: 230px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #073b3a;
  background: #dff3f0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.missing {
  color: var(--accent-2);
  font-weight: 700;
}

dialog {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(10, 23, 38, 0.28);
}

dialog::backdrop {
  background: rgba(14, 24, 35, 0.42);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px 20px 0;
}

.chart-panel {
  height: 340px;
  padding: 18px 20px;
}

.detail-table-wrap {
  max-height: 280px;
  border-top: 1px solid var(--line);
}

.quote-dialog {
  width: min(920px, calc(100vw - 32px));
}

.store-export-dialog {
  width: min(720px, calc(100vw - 32px));
}

.store-export-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px;
}

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

.store-export-field label,
.store-export-check {
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.store-export-field select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.store-export-check {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.store-export-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.store-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 18px;
  border-top: 1px solid var(--line);
}

.quote-table-wrap {
  max-height: min(560px, calc(100vh - 150px));
  overflow: auto;
}

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

.quote-current-row {
  background: #e5f7ec;
}

.quote-detail-btn {
  min-width: 86px;
  padding: 8px 10px;
}

@media (max-width: 900px) {
  .shell {
    padding: 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .toolbar {
    gap: 8px;
    padding: 12px;
  }

  .toolbar button {
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .search-wrap {
    min-width: 80px;
    padding: 0 10px;
  }

  .column-menu-panel {
    left: 0;
    right: auto;
  }

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

  .store-export-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .summary-sidebar {
    padding: 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

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

  th,
  td {
    padding: 9px 10px;
  }
}
