* {
  box-sizing: border-box;
}

:root {
  --ink: #163047;
  --muted: #5a6b7b;
  --line: #d9e3ea;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #ffffff;
  --accent: #d74e2f;
  --accent-soft: #fff1ea;
  --warm: #f5b562;
  --sea: #4ea7a0;
  --shadow: 0 20px 50px rgba(22, 48, 71, 0.08);
  --font-base: "Poppins", Arial, sans-serif;
  --legacy-form-font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --text-dark: #0f172a;
  --text-body: #475569;
  --text-muted: #64748b;
  --text-brand: #004b8d;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  color: var(--text-body);
  background:
    radial-gradient(circle at top left, rgba(78, 167, 160, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(215, 78, 47, 0.14), transparent 24%),
    linear-gradient(180deg, #f3f6f8 0%, #eef2f5 100%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-dark);
}

h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.17;
  font-weight: 700;
}

h2 {
  font-size: clamp(26px, 2.7vw, 30px);
  line-height: 1.27;
  font-weight: 600;
}

h3 {
  font-size: clamp(18px, 1.8vw, 20px);
  line-height: 1.4;
  font-weight: 600;
}

p,
li,
td,
th,
dd,
dt,
input,
textarea,
select {
  color: var(--text-body);
}

small,
.muted,
.subcopy,
.section-head p,
.link-card span,
.followup-meta span,
.empty-state {
  color: var(--text-muted);
}

label,
.top-nav a,
.nav-group-toggle,
.nav-button,
button,
.button,
input,
textarea,
select {
  font-family: var(--font-base);
}

label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--text-muted);
}

.top-nav a,
.nav-group-toggle,
.nav-button {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

button,
.button {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

a {
  color: var(--text-brand);
}

.site-header {
  display: flex;
  align-items: flex-end;
  padding: 1.05rem 2rem 0.45rem;
  min-height: 280px;
  background:
    linear-gradient(rgba(14, 39, 60, 0.42), rgba(14, 39, 60, 0.42)),
    url("/static/header-banner-wide.png") center center / cover no-repeat;
  color: #fff;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.header-row-auth {
  align-items: stretch;
  justify-content: flex-start;
}

.brand-block {
  flex: 0 0 auto;
  max-width: none;
  min-width: 0;
}

.brand-block h1,
.hero-panel h2,
.section-head h2 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: #99cfd0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subcopy,
.hero-copy {
  color: var(--muted);
}

.subcopy {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.75);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  white-space: nowrap;
}

.header-center-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-width: 0;
  padding-left: max(1rem, calc((100vw - 1420px) / 2 - 2rem));
  gap: 3.75rem;
  width: 100%;
}

.header-center-nav .top-nav {
  width: auto;
  max-width: none;
  justify-content: flex-start;
  margin-left: 0;
}

.header-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.45rem;
}

.header-right-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-left: auto;
  padding-right: max(1rem, calc((100vw - 1420px) / 2 - 2rem));
  flex: 0 0 auto;
}

.top-nav a,
.nav-button {
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-size: 1.14rem;
  font-weight: 600;
}

.nav-group {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.14rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.92;
}

.nav-group-toggle::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.nav-group:hover .nav-group-toggle,
.nav-group:focus-within .nav-group-toggle {
  opacity: 1;
}

.nav-group-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  display: none;
  min-width: 11rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(14, 39, 60, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.nav-group:hover .nav-group-menu,
.nav-group:focus-within .nav-group-menu {
  display: grid;
  gap: 0.5rem;
}

.nav-group-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-menu a {
  font-size: 1rem;
}

.top-nav a {
  opacity: 0.92;
}

.top-nav a:hover,
.nav-group-toggle:hover,
.nav-button:hover {
  opacity: 1;
}

.nav-button {
  background: transparent;
  border: none;
  cursor: pointer;
}

.inline-form {
  display: inline;
}

.top-nav .inline-form {
  flex: 0 0 auto;
}

.header-logout-form {
  flex: 0 0 auto;
}

.exchange-rate-form {
  display: grid;
  gap: 0.35rem;
  width: 360px;
  padding: 0.8rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.exchange-rate-form.compact {
  width: auto;
  min-width: 0;
  gap: 0;
  padding: 0.3rem 0.45rem;
  margin-left: 0;
  border-radius: 14px;
}

.exchange-rate-form label,
.exchange-rate-form span {
  color: rgba(255, 255, 255, 0.88);
}

.exchange-rate-form label {
  font-size: 0.92rem;
  font-weight: 600;
}

.exchange-rate-form span {
  font-size: 0.84rem;
}

.compact-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.76rem;
  font-weight: 700;
}

.compact-note {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  white-space: nowrap;
}

.exchange-rate-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
}

.exchange-rate-inline {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 64px) auto;
  gap: 0.35rem;
  align-items: center;
}

.exchange-rate-form input {
  padding: 0.68rem 0.8rem;
  border-radius: 12px;
}

.exchange-rate-form input[type="number"]::-webkit-outer-spin-button,
.exchange-rate-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.exchange-rate-form input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.exchange-rate-form.compact input {
  padding: 0.32rem 0.45rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.compact-button {
  min-height: 28px;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  font-size: 0.88rem;
}

.header-rate {
  display: inline-grid;
  flex: 0 0 auto;
  align-self: center;
  margin-left: 0;
}

.header-rate .compact-button {
  min-height: 22px;
  padding: 0.18rem 0.36rem;
  font-size: 0.72rem;
  line-height: 1;
}

.page-shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 1.5rem;
}

.rate-tools {
  position: fixed;
  left: 18px;
  top: 288px;
  z-index: 38;
}

.rate-tools-panel {
  position: relative;
  width: fit-content;
  max-width: min(416px, calc(100vw - 80px));
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px solid #d9e3ea;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(22, 48, 71, 0.14);
}

.rate-tools-toggle {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3deea;
  border-radius: 999px;
  background: #f6fbff;
  color: #54708a;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(22, 48, 71, 0.08);
}

.rate-tools-toggle:hover {
  background: #eef6ff;
}

.rate-tools-body {
  display: grid;
  gap: 0.65rem;
}

.rate-tools.is-collapsed .rate-tools-panel {
  padding: 0.45rem;
}

.rate-tools.is-collapsed .rate-tools-body {
  display: none;
}

.rate-tool-card {
  display: block;
  padding: 0.8rem;
  border: 1px solid #d9e7f2;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.rate-tool-row {
  display: grid;
  grid-template-columns: minmax(106px, 1.3fr) auto minmax(106px, 1.43fr);
  gap: 0.55rem;
  align-items: center;
}

.rate-tool-row-plain {
  grid-template-columns: minmax(106px, 1.3fr) auto minmax(106px, 1.3fr) auto minmax(106px, 1.36fr);
}

.rate-tool-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 45px;
  border: 1px solid #cddaea;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.rate-tool-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 100%;
  padding: 0 0.45rem;
  color: #54708a;
  font-size: 0.82rem;
  font-weight: 700;
  background: #f7fbff;
  border-right: 1px solid #dbe5f0;
}

.rate-tool-row input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0.68rem 0.6rem;
  border: none;
  background: transparent;
  text-align: center;
}

.rate-tool-row input[type="number"]::-webkit-outer-spin-button,
.rate-tool-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.rate-tool-row input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.rate-tool-equals {
  color: #54708a;
  font-size: 1rem;
  font-weight: 700;
}

.rate-tool-operator {
  color: #54708a;
  font-size: 1rem;
  font-weight: 700;
}

.rate-tool-output {
  min-height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 0.75rem;
  border: 1px solid #cddaea;
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

.rate-tool-card-freight {
  border-color: #f2d5bf;
  background: linear-gradient(180deg, #fffaf5 0%, #fff2e8 100%);
}

.rate-tool-card-freight .rate-tool-field {
  border-color: #e9c9ad;
  background: #fffdfb;
}

.rate-tool-card-freight .rate-tool-unit {
  color: #b85b20;
  background: #fff5ec;
  border-right-color: #efd8c3;
}

.rate-tool-card-freight .rate-tool-output {
  border-color: #e9c9ad;
  background: #fff5ec;
  color: #c75b1a;
}

.inquiry-sheet-page .page-shell {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.75rem 1rem;
}

.customer-match-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
  border: 1px dashed #b9c9d5;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.customer-match-panel strong {
  font-size: 0.98rem;
}

.customer-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.customer-match-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #e9f0f5;
  color: var(--ink);
}

.inline-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.card,
.hero-panel,
.link-card,
.stat-card {
  background: var(--surface);
  border: 1px solid rgba(217, 227, 234, 0.95);
  box-shadow: var(--shadow);
}

.card {
  border-radius: 24px;
  padding: 1.15rem 1.2rem;
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 1.25rem;
  padding: 1.4rem;
  border-radius: 28px;
  margin-bottom: 1rem;
}

.hero-search {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
}

.hero-search input {
  min-width: 0;
}

.dashboard-search-button {
  min-width: 58px;
  min-height: 46px;
  padding: 0.55rem 0.85rem;
  line-height: 1.15;
  flex: 0 0 auto;
}

.hero-search input,
input,
textarea,
select {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid #bfcdd7;
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-family: var(--font-base);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1.1rem;
  border-radius: 22px;
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 52px rgba(22, 48, 71, 0.12);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.stat-card {
  border-radius: 20px;
  padding: 1rem;
}

.stat-card strong {
  display: block;
  margin-top: 0.4rem;
  font-size: 1.8rem;
}

.stat-card.accent {
  background: linear-gradient(135deg, rgba(215, 78, 47, 0.12), rgba(255, 255, 255, 0.96));
}

.stat-card.warm {
  background: linear-gradient(135deg, rgba(245, 181, 98, 0.18), rgba(255, 255, 255, 0.96));
}

.stat-card.soft {
  background: linear-gradient(135deg, rgba(78, 167, 160, 0.14), rgba(255, 255, 255, 0.96));
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-compact-table {
  table-layout: fixed;
}

.dashboard-compact-table th,
.dashboard-compact-table td {
  overflow: hidden;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dashboard-recent-table th:nth-child(1) {
  width: 128px;
}

.dashboard-recent-table th:nth-child(2) {
  width: 152px;
}

.dashboard-recent-table th:nth-child(3) {
  width: 150px;
}

.dashboard-recent-table th:nth-child(4) {
  width: 86px;
}

.dashboard-recent-table th:nth-child(5) {
  width: 74px;
}

.dashboard-overdue-table th:nth-child(1) {
  width: 170px;
}

.dashboard-overdue-table th:nth-child(2) {
  width: 74px;
}

.dashboard-overdue-table th:nth-child(3) {
  width: 96px;
}

.dashboard-overdue-table th:nth-child(4) {
  width: 88px;
}

.dashboard-overdue-table th:nth-child(5) {
  width: 74px;
}

.section-head,
.button-row,
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.section-head-inline {
  flex-wrap: nowrap;
}

.section-head-title {
  flex: 0 0 auto;
}

.button,
.chip,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}

.button,
.chip {
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: #dbe6ee;
  color: var(--ink);
}

.button.primary,
.chip.active {
  background: var(--accent);
  color: #fff;
}

.button.small {
  min-height: 42px;
  padding: 0.68rem 0.95rem;
}

.mini-button {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: #edf3f7;
  color: var(--ink);
}

.mini-button.danger {
  background: #fdecea;
  color: #9f2f1d;
}

.records-table,
.line-table,
.nested-table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e4eaee;
  padding: 0.75rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #506171;
  font-size: 0.92rem;
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.inquiry-sheet-card {
  --inquiry-section-width: min(1420px, calc(100vw - 32px));
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.inquiry-sheet-scroll {
  width: 100%;
  border: 1px solid #d6e1e8;
  background: transparent;
}

.inquiry-layout-form {
  gap: 0.8rem;
  justify-items: center;
}

.inquiry-section {
  width: var(--inquiry-section-width);
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #d6e1e8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 28px rgba(22, 46, 66, 0.06);
}

.inquiry-section-title {
  padding: 0.78rem 1rem;
  border-bottom: 1px solid #dde6ec;
  background: linear-gradient(180deg, #fbfdfe 0%, #f2f7fa 100%);
  color: #11344c;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.015em;
}

.inquiry-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 1rem;
  border-bottom: 1px solid #dde6ec;
  background: linear-gradient(180deg, #fbfdfe 0%, #f2f7fa 100%);
}

.inquiry-section-heading .inquiry-section-title {
  flex: 1 1 auto;
  margin: 0;
  border-bottom: none;
  background: transparent;
}

.sheet-number-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0.82rem;
  border: 1px solid #d6e2eb;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(18, 52, 75, 0.06);
  white-space: nowrap;
}

.sheet-number-label {
  color: #5c7084;
  font-size: 0.82rem;
  font-weight: 600;
}

.sheet-number-value {
  color: #12344b;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.document-action-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.document-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.68rem 1.1rem;
  border: 1px solid #cfdbe5;
  border-radius: 999px;
  background: #ffffff;
  color: #163047;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(22, 46, 66, 0.06);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.document-action-btn:hover {
  background: #edf5fa;
  border-color: #a9c4d8;
  transform: translateY(-1px);
}

.document-action-note {
  color: #748698;
  font-size: 0.86rem;
  white-space: nowrap;
}

.product-footer-note {
  padding: 0.8rem 1rem 0.95rem;
  border-top: 1px solid #e3ebf1;
  color: #5f7386;
  font-size: 0.86rem;
  line-height: 1.45;
}

.auxiliary-actions-card {
  padding: 0.75rem 1rem;
}

.auxiliary-actions-row {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.customers-toolbar-card {
  padding: 0.9rem 1rem;
}

.customers-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.customers-toolbar-title {
  margin: 0;
  flex: 0 0 auto;
  color: #12344b;
}

.customers-search-form {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
  margin: 0;
}

.customers-search-form input {
  width: 220px;
  min-width: 220px;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

.customers-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.document-center-card {
  display: grid;
  gap: 1rem;
}

.document-center-form {
  display: grid;
  gap: 1rem;
}

.document-center-block {
  border: 1px solid #dde6ec;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.document-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 0.55fr) minmax(0, 1fr);
}

.document-summary-grid > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.72rem 0.85rem;
  border-right: 1px solid #dde6ec;
  border-top: 1px solid #dde6ec;
  min-height: 62px;
}

.document-summary-grid span {
  color: #748698;
  font-size: 0.82rem;
}

.document-summary-grid strong {
  color: #163047;
  font-size: 0.98rem;
}

.document-summary-grid input {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cfd8df;
  border-radius: 10px;
  background: #ffffff;
  color: #163047;
  font: inherit;
}

.document-summary-grid select {
  width: 100%;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cfd8df;
  border-radius: 10px;
  background: #ffffff;
  color: #163047;
  font: inherit;
}

.document-summary-address {
  grid-column: span 6;
  border-right: none;
}

.document-summary-grid > div:nth-child(7),
.document-summary-grid > div:nth-child(14) {
  border-right: none;
}


}

.document-products-table th,
.document-products-table td {
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}

.document-products-table {
  table-layout: fixed;
}

.document-products-table th {
  text-align: center;
}

.document-products-table input {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 30px;
  box-sizing: border-box;
  padding: 0 0.28rem;
  border: 1px solid #d7e2ea;
  border-radius: 7px;
  background: #ffffff;
  text-align: center;
  font-size: 0.92rem;
}

.document-products-table select {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 30px;
  box-sizing: border-box;
  padding: 0 1.7rem 0 0.28rem;
  border: 1px solid #d7e2ea;
  border-radius: 7px;
  background: #ffffff;
  text-align: center;
  text-align-last: center;
  font-size: 0.92rem;
}

.document-products-table .document-edit-cell {
  padding-left: 0.24rem;
  padding-right: 0.24rem;
}

.document-products-table .document-edit-cell input {
  display: block;
  margin: 0;
}

.document-products-table .document-edit-cell input[readonly][data-doc-product-condition] {
  border-color: #d7e2ea;
  background: #f7fafc;
  color: #163047;
  cursor: default;
}

.document-products-table .document-edit-cell select {
  display: block;
  margin: 0;
}

.document-money-cell {
  padding-left: 0.24rem;
  padding-right: 0.24rem;
}

.money-input {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.money-prefix {
  flex: 0 0 auto;
  color: #5f7388;
  font-weight: 700;
  line-height: 1;
}

.money-input input {
  min-width: 0;
  flex: 1 1 auto;
}

.document-products-table .document-edit-cell input:focus {
  border-color: #c9d9e8;
  outline: 1px solid rgba(29, 78, 216, 0.08);
  background: #f8fbff;
}

.document-products-table .document-edit-cell select:focus {
  border-color: #c9d9e8;
  outline: 1px solid rgba(29, 78, 216, 0.08);
  background: #f8fbff;
}

.document-products-table .doc-col-brand { width: 110px; }
.document-products-table .doc-col-model { width: 190px; }
.document-products-table .doc-col-type { width: 108px; }
.document-products-table .doc-col-qty { width: 72px; }
.document-products-table .doc-col-unit { width: 88px; }
.document-products-table .doc-col-total { width: 88px; }
.document-products-table .doc-col-hs { width: 108px; }
.document-products-table .doc-col-weight { width: 76px; }
.document-products-table .doc-col-freight { width: 88px; }
.document-products-table .doc-col-status { width: 96px; }

.document-tab-head {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1rem 0;
  border-bottom: 1px solid #dde6ec;
}

.document-tab-btn {
  border: 1px solid #cfd8df;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: #f4f8fb;
  color: #748698;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.document-tab-btn.is-active {
  background: #ffffff;
  color: #163047;
}

.document-tab-panel {
  display: none;
  padding: 1rem;
}

.document-tab-panel.is-active {
  display: block;
}

.document-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.document-fields-grid-quotation {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-fields-grid-quotation .field-span-2 {
  grid-column: span 3;
}

.document-fields-grid-pi {
  grid-template-columns: repeat(3, minmax(0, 0.8fr)) minmax(420px, 1.8fr);
}

.document-fields-grid-pi .pi-account-field {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.document-fields-grid-pi .pi-account-field textarea {
  height: 100%;
  min-height: 136px;
}

.document-fields-grid label {
  display: grid;
  gap: 0.35rem;
}

.document-fields-grid label span {
  color: #163047;
  font-size: 0.88rem;
  font-weight: 700;
}

.document-fields-grid input,
.document-fields-grid select,
.document-fields-grid textarea {
  width: 100%;
  border: 1px solid #cfd8df;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  background: #fff;
  font: inherit;
  color: #163047;
}

.document-fields-grid textarea {
  resize: vertical;
}

.field-span-2 {
  grid-column: span 2;
}

.checkbox-field {
  grid-auto-flow: column;
  grid-template-columns: 20px 1fr;
  align-items: center;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

.voucher-section {
  margin-top: 1rem;
  border-top: 1px solid #dde6ec;
  padding-top: 1rem;
}

.voucher-list {
  display: grid;
  gap: 0.65rem;
}

.voucher-item,
.voucher-empty {
  padding: 0.75rem 0.9rem;
  border: 1px solid #dde6ec;
  border-radius: 12px;
  background: #f9fbfd;
}

.voucher-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.doc-actions-bar,
.voucher-upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.voucher-upload-form label {
  display: grid;
  gap: 0.35rem;
  min-width: min(420px, 100%);
}

.voucher-upload-form span {
  color: #163047;
  font-size: 0.88rem;
  font-weight: 700;
}

.basic-info-grid {
  display: grid;
  grid-template-columns: 15% 15% 11% 11% 5% 6% 6% 8% 8% 6% 9%;
}

.basic-info-grid .basic-info-fixed {
  min-width: 0;
}

.basic-info-grid .basic-info-fluid {
  min-width: 0;
}

.basic-info-grid .basic-info-narrow {
  min-width: 0;
}

.basic-info-grid .basic-info-summary input {
  color: #1d4ed8;
  font-weight: 600;
  background: #f7fbff;
  padding: 0 0.35rem;
}

.basic-info-grid label {
  display: grid;
  grid-template-rows: 44px 44px;
  margin: 0;
  border-right: 1px solid #dde6ec;
  color: #15384f;
  font-size: 0.93rem;
  font-weight: 700;
  text-align: center;
  align-items: stretch;
  background: #ffffff;
}

.basic-info-grid label > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.04rem;
  line-height: 1.1;
  padding: 0 0.35rem;
  min-height: 44px;
  white-space: nowrap;
}

.basic-info-grid label:last-child {
  border-right: none;
}

.basic-info-grid input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: none;
  border-top: 1px solid #dde6ec;
  padding: 0 0.7rem;
  text-align: center;
  font: inherit;
  font-weight: 400;
  line-height: 44px;
  background: #fbfdff;
}

.basic-info-grid select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: none;
  border-top: 1px solid #dde6ec;
  padding: 0 0.7rem;
  text-align: center;
  text-align-last: center;
  font: inherit;
  font-weight: 400;
  line-height: 44px;
  background: #fbfdff;
}

.basic-info-grid small {
  display: block;
  margin-top: 0;
  color: #748698;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1;
}

.basic-info-grid .date-compact-input {
  line-height: 44px;
}

.product-sheet-scroll {
  border: none;
}

.product-sheet-table {
  width: 100%;
  min-width: 0;
}

.inquiry-sheet-table {
  width: 1096px;
  min-width: 1096px;
  border-collapse: collapse;
  table-layout: fixed;
}

.inquiry-sheet-table th,
.inquiry-sheet-table td {
  height: 46px;
  padding: 0.2rem 0.3rem;
  border: 1px solid #dde6ec;
  color: #111827;
  text-align: center;
  vertical-align: middle;
  background: #fff;
  min-width: 0;
  white-space: normal;
}

.inquiry-sheet-table .col-add { width: 34px; }
.inquiry-sheet-table .col-select { width: 34px; }
.inquiry-sheet-table .col-whatsapp { width: 100px; }
.inquiry-sheet-table .col-email { width: 100px; }
.inquiry-sheet-table .col-contact { width: 62px; }
.inquiry-sheet-table .col-brand { width: 70px; }
.inquiry-sheet-table .col-model { width: 150px; }
.inquiry-sheet-table .col-qty { width: 50px; }
.inquiry-sheet-table .col-price { width: 68px; }
.inquiry-sheet-table .col-total { width: 68px; }
.inquiry-sheet-table .col-product { width: 104px; }
.inquiry-sheet-table .col-hs { width: 98px; }
.inquiry-sheet-table .col-weight { width: 56px; }
.inquiry-sheet-table .col-freight { width: 58px; }
.inquiry-sheet-table .col-condition { width: 92px; }
.inquiry-sheet-table .col-inquiry-date { width: 62px; }
.inquiry-sheet-table .col-status { width: 74px; }
.inquiry-sheet-table .col-quote-date { width: 62px; }
.inquiry-sheet-table .col-source { width: 62px; }
.inquiry-sheet-table .col-shipping { width: 62px; }
.inquiry-sheet-table .col-customer-info { width: 62px; }
.inquiry-sheet-table .col-payment { width: 62px; }

.inquiry-sheet-table.product-sheet-table {
  width: 100%;
  min-width: 0;
}

.inline-section-grid {
  border-bottom: none;
}

.vertical-info-grid {
  width: 100%;
}

.section-store {
  display: none;
}

.inquiry-sheet-table tbody tr:nth-child(odd) td,
.inquiry-sheet-table tbody tr:nth-child(odd) input,
.inquiry-sheet-table tbody tr:nth-child(odd) select {
  background: #fcfdff;
}

.inquiry-sheet-table tbody tr:nth-child(even) td,
.inquiry-sheet-table tbody tr:nth-child(even) input,
.inquiry-sheet-table tbody tr:nth-child(even) select {
  background: #f7fafc;
}

.inquiry-sheet-table tbody tr.is-selected td,
.inquiry-sheet-table tbody tr.is-selected input,
.inquiry-sheet-table tbody tr.is-selected select {
  background: rgba(59, 130, 246, 0.08);
}

.inquiry-sheet-table th {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fb 100%);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.12;
}

.inquiry-sheet-table th span {
  display: block;
  margin-top: 0.15rem;
  color: #768799;
  font-size: 0.8rem;
  font-weight: 400;
}

.inquiry-sheet-table input,
.inquiry-sheet-table select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0.22rem 0.42rem;
  border: 1px solid #dce5ec;
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
  font: inherit;
}

.inquiry-sheet-table input[name="email"] {
  min-width: 0;
}

.inquiry-sheet-table input[name="model_name"] {
  min-width: 0;
}

.inquiry-sheet-table input[type="date"] {
  min-width: 0;
}

.inquiry-sheet-table .date-compact-input {
  cursor: pointer;
}

.inquiry-sheet-table .date-compact-input[type="text"] {
  padding-right: 0.32rem;
}

.inquiry-sheet-table .date-compact-input[type="date"] {
  padding-right: 0.12rem;
}

.inquiry-sheet-table .status-select {
  border-color: rgba(17, 24, 39, 0.08);
  font-size: 0.78rem;
  font-weight: 400;
}

.inquiry-sheet-table .status-select option {
  font-size: 0.78rem;
  font-weight: 400;
}

.inquiry-sheet-table .status-select[data-status="待报价"] {
  background: #fff7ed;
  color: #c2410c;
}

.inquiry-sheet-table .status-select[data-status="已报价"] {
  background: #eff6ff;
  color: #1d4ed8;
}

.inquiry-sheet-table .status-select[data-status="付款中"] {
  background: #fef3c7;
  color: #b45309;
}

.inquiry-sheet-table .status-select[data-status="备货中"] {
  background: #eef2ff;
  color: #4338ca;
}

.inquiry-sheet-table .status-select[data-status="已发货"] {
  background: #ecfeff;
  color: #0e7490;
}

.inquiry-sheet-table .status-select[data-status="已成交"] {
  background: #dcfce7;
  color: #15803d;
}

.inquiry-sheet-table .status-select[data-status="未成交"] {
  background: #fee2e2;
  color: #b91c1c;
}

.inquiry-sheet-table .status-select option[value="待报价"] {
  background: #fff7ed;
  color: #c2410c;
}

.inquiry-sheet-table .status-select option[value="已报价"] {
  background: #eff6ff;
  color: #1d4ed8;
}

.inquiry-sheet-table .status-select option[value="付款中"] {
  background: #fef3c7;
  color: #b45309;
}

.inquiry-sheet-table .status-select option[value="备货中"] {
  background: #eef2ff;
  color: #4338ca;
}

.inquiry-sheet-table .status-select option[value="已发货"] {
  background: #ecfeff;
  color: #0e7490;
}

.inquiry-sheet-table .status-select option[value="已成交"] {
  background: #dcfce7;
  color: #15803d;
}

.inquiry-sheet-table .status-select option[value="未成交"] {
  background: #fee2e2;
  color: #b91c1c;
}

.inquiry-sheet-table input::-webkit-outer-spin-button,
.inquiry-sheet-table input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.inquiry-sheet-table input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.inquiry-sheet-table input:focus,
.inquiry-sheet-table select:focus {
  border-color: #8db0c8;
  outline: 2px solid rgba(141, 176, 200, 0.14);
}

.price-cell {
  display: block;
}

.price-summary-input {
  color: #1d4ed8;
  font-weight: 600;
}

.freight-summary-input {
  color: #1d4ed8;
  font-weight: 600;
}

.customer-summary-input {
  cursor: pointer;
}

.payment-summary-input {
  cursor: pointer;
}

.price-popover {
  position: absolute;
  z-index: 32;
  width: 180px;
  padding: 0.65rem;
  border: 1px solid #cfd8df;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(14, 42, 58, 0.18);
}

.price-popover[hidden] {
  display: none;
}

.price-popover label {
  display: grid;
  gap: 0.3rem;
  color: #123047;
  font-size: 0.9rem;
  font-weight: 700;
}

.price-popover input {
  height: 34px;
  border: 1px solid #cfd8df;
  border-radius: 8px;
  text-align: center;
  font: inherit;
}

.price-popover-note {
  margin-top: 0.4rem;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.add-row-head {
  width: 42px;
}

.sheet-add-row {
  width: 28px;
  height: 28px;
  border: 1px solid #c9d7e2;
  border-radius: 8px;
  background: #f5f9fc;
  color: #14364d;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1;
}

.sheet-add-row:hover {
  background: #e8f1f7;
}

.sheet-remove-row {
  width: 28px;
  height: 28px;
  border: 1px solid #f1b8b0;
  border-radius: 8px;
  background: #fff1ef;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1;
}

.sheet-remove-row:hover {
  background: #ffdeda;
}

.product-select-cell {
  text-align: center;
}

.product-select-toggle {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #b8c7d4;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.product-select-toggle:hover {
  border-color: #7aa4d6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.product-select-toggle.is-selected {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.92);
}

.customer-match-panel.is-hidden {
  display: none;
}

.autosave-status {
  min-height: 28px;
  color: var(--muted);
  font-size: 0.9rem;
}

.inquiry-form {
  position: relative;
}

.shipping-summary-input {
  cursor: pointer;
}

.shipping-popover {
  position: absolute;
  z-index: 30;
  width: min(760px, calc(100vw - 32px));
  border: 1px solid #cfd8df;
  background: #fff;
  box-shadow: 0 18px 40px rgba(14, 42, 58, 0.18);
}

.shipping-popover[hidden] {
  display: none;
}

.shipping-popover-title {
  padding: 0.48rem 0.65rem;
  border-bottom: 1px solid #cfd8df;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

.shipping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid #cfd8df;
}

.shipping-grid label {
  display: grid;
  grid-template-rows: 54px 36px;
  margin: 0;
  border-right: 1px solid #cfd8df;
}

.shipping-grid label:last-child {
  border-right: none;
}

.shipping-grid span {
  display: grid;
  place-items: center;
  padding: 0.25rem;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.18;
}

.shipping-grid small {
  color: #637586;
  font-size: 0.78rem;
  font-weight: 400;
}

.shipping-grid input,
.shipping-grid select {
  width: 100%;
  height: 36px;
  border: none;
  border-top: 1px solid #cfd8df;
  text-align: center;
  font: inherit;
  background: #fff;
}

.shipping-grid input[type="hidden"] {
  display: none;
}

.shipping-grid select {
  padding: 0 1rem 0 0.25rem;
  font-size: 0.86rem;
  text-align-last: center;
}

.shipping-grid input:focus,
.shipping-grid select:focus {
  outline: 2px solid rgba(106, 164, 200, 0.18);
}

.customer-payment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.customer-payment-panel {
  min-width: 0;
}

.customer-payment-panel + .customer-payment-panel {
  border-left: 1px solid #dde6ec;
}

.subsection-title {
  padding: 0.72rem 0.95rem;
  border-bottom: 1px solid #dde6ec;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9fc 100%);
  color: #12344b;
  font-size: 0.92rem;
  font-weight: 700;
}

.customer-payment-grid .customer-info-grid,
.customer-payment-grid .payment-info-grid {
  border-bottom: none;
}

.customer-payment-grid .customer-info-grid label,
.customer-payment-grid .payment-info-grid label {
  grid-template-columns: 118px minmax(0, 1fr);
}

.customer-payment-grid .payment-info-grid label {
  grid-template-columns: 60px minmax(0, 1fr);
}

@media (max-width: 900px) {
  .inquiry-sheet-card {
    --inquiry-section-width: calc(100vw - 20px);
  }

  .inquiry-section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding-right: 0;
  }

  .inquiry-section-heading .inquiry-section-title {
    width: 100%;
  }

  .sheet-number-badge {
    margin: 0 1rem 0.8rem;
  }

  .basic-info-grid,
  .shipping-grid,
  .customer-payment-grid {
    grid-template-columns: 1fr;
  }

  .payment-top-row {
    grid-template-columns: 1fr;
  }

  .payment-top-row .payment-compact-field + .payment-compact-field {
    border-left: none;
    border-top: 1px solid #cfd8df;
  }

  .basic-info-grid label,
  .shipping-grid label,
  .customer-payment-panel + .customer-payment-panel {
    border-right: none;
    border-left: none;
    border-bottom: 1px solid #cfd8df;
  }

  .basic-info-grid label:last-child,
  .shipping-grid label:last-child {
    border-bottom: none;
  }
}

.shipping-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
}

.compact-btn {
  padding: 0.45rem 0.8rem;
}

.customer-info-popover {
  position: absolute;
  z-index: 31;
  width: min(780px, calc(100vw - 32px));
  border: 1px solid #cfd8df;
  background: #fff;
  box-shadow: 0 18px 40px rgba(14, 42, 58, 0.18);
}

.customer-info-popover[hidden] {
  display: none;
}

.customer-info-grid {
  display: grid;
  border-bottom: 1px solid #dde6ec;
}

.customer-info-grid label {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 52px;
  margin: 0;
  border-bottom: 1px solid #dde6ec;
}

.customer-info-grid label:last-child {
  border-bottom: none;
}

.customer-info-grid span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.6rem 0.82rem;
  border-right: 1px solid #dde6ec;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
  background: #fbfdff;
}

.customer-info-grid input,
.customer-info-grid select {
  min-height: 52px;
  border: none;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.96rem;
  background: #ffffff;
}

.customer-info-grid input:focus,
.customer-info-grid select:focus {
  outline: 2px solid rgba(106, 164, 200, 0.18);
}

.payment-popover {
  position: absolute;
  z-index: 31;
  width: min(780px, calc(100vw - 32px));
  border: 1px solid #cfd8df;
  background: #fff;
  box-shadow: 0 18px 40px rgba(14, 42, 58, 0.18);
}

.payment-popover[hidden] {
  display: none;
}

.payment-info-grid {
  display: grid;
  border-bottom: 1px solid #dde6ec;
}

.payment-info-grid label {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  min-height: 52px;
  margin: 0;
  border-bottom: 1px solid #dde6ec;
}

.payment-info-grid label:last-child {
  border-bottom: none;
}

.payment-info-grid .payment-account-row {
  min-height: 120px;
}

.payment-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(240px, 1.18fr) 140px;
  border-bottom: 1px solid #dde6ec;
  background: #ffffff;
}

.payment-top-row .payment-compact-field {
  grid-template-columns: 60px minmax(0, 1fr);
  min-height: 48px;
  border-bottom: none;
}

.payment-top-row .payment-method-field {
  grid-template-columns: 60px minmax(0, 1fr);
}

.payment-top-row .payment-fee-field {
  grid-template-columns: 60px 80px;
}

.payment-top-row .payment-compact-field + .payment-compact-field {
  border-left: 1px solid #dde6ec;
}

.payment-top-row .payment-compact-field span {
  padding: 0.48rem 0.6rem;
  font-size: 0.92rem;
  background: #fbfdff;
}

.payment-info-grid span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.62rem 0.82rem;
  border-right: 1px solid #dde6ec;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 700;
  background: #fbfdff;
}

.payment-info-grid input,
.payment-info-grid select,
.payment-info-grid textarea {
  width: 100%;
  min-height: 52px;
  border: none;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.96rem;
  background: #ffffff;
}

.payment-top-row .payment-compact-field input,
.payment-top-row .payment-compact-field select {
  min-height: 48px;
  padding: 0.44rem 0.62rem;
  font-size: 0.92rem;
}

.payment-top-row .payment-fee-field input {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

.payment-info-grid textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}

.payment-info-grid .payment-account-row textarea {
  min-height: 120px;
}

.payment-info-grid input:focus,
.payment-info-grid select:focus,
.payment-info-grid textarea:focus {
  outline: 2px solid rgba(106, 164, 200, 0.18);
}

.followup-stack {
  display: grid;
  gap: 0.8rem;
}

.followup-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  color: inherit;
  text-decoration: none;
}

.followup-main {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.followup-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  font-size: 0.92rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.84rem;
  white-space: nowrap;
}

.pill[data-status="待报价"] {
  background: #fff7ed;
  color: #c2410c;
}

.pill[data-status="已报价"] {
  background: #eff6ff;
  color: #1d4ed8;
}

.pill[data-status="付款中"] {
  background: #fef3c7;
  color: #b45309;
}

.pill[data-status="备货中"] {
  background: #eef2ff;
  color: #4338ca;
}

.pill[data-status="已发货"] {
  background: #ecfeff;
  color: #0e7490;
}

.pill[data-status="已成交"] {
  background: #dcfce7;
  color: #15803d;
}

.pill[data-status="未成交"] {
  background: #fee2e2;
  color: #b91c1c;
}

.grid {
  display: grid;
  gap: 0.9rem;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.full {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  padding-top: 1.9rem;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
}

input,
textarea,
button {
  font: inherit;
}

.flash-stack {
  margin-bottom: 1rem;
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: 14px;
  margin-bottom: 0.6rem;
}

.flash.success {
  background: #e8f7ee;
  color: #175c36;
}

.flash.error {
  background: #fdecea;
  color: #8b2c1d;
}

.attachment-grid {
  display: grid;
  gap: 0.75rem;
}

.login-card {
  max-width: 720px;
  margin: 4rem auto 0;
}

.password-field {
  position: relative;
}

.password-input-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.password-input-wrap input {
  width: 100%;
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: #e8f0f7;
  color: var(--text-dark);
}

.password-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
}

.attachment-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: #f8fafc;
  border-radius: 12px;
}

.meta-grid {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.toolbar-inline {
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0;
  min-width: 0;
}

.toolbar input {
  max-width: 420px;
}

.toolbar-inline input {
  flex: 1 1 420px;
  max-width: none;
  min-width: 240px;
}

.product-knowledge-toolbar-row {
  align-items: center;
}

.product-knowledge-search-button {
  min-width: 92px;
  min-height: 46px;
  padding: 0.72rem 1.15rem;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(215, 78, 47, 0.16);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.product-knowledge-table .col-product-knowledge-model {
  width: 14.2857%;
}

.product-knowledge-table {
  table-layout: fixed;
}

.product-knowledge-table col {
  width: 9.5238%;
}

.product-knowledge-table thead th {
  text-align: center;
}

.product-knowledge-table td {
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}

.action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-row td {
  background: #fbfcfe;
}

.detail-box {
  padding: 0.4rem 0;
}

.ellipsis {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-item {
  font-size: 0.9rem;
  color: #465468;
}

.empty-state {
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.row-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.row-actions form {
  margin: 0;
}

.followup-single-line {
  white-space: nowrap;
}

.followup-button {
  min-width: 82px;
  background: #e9f5ee;
  color: #1d6b42;
}

.customers-table {
  width: 100%;
  table-layout: fixed;
}

.customers-table th,
.customers-table td {
  padding: 0.52rem 0.5rem;
  vertical-align: middle;
  box-sizing: border-box;
}

.customers-table th {
  font-size: 0.88rem;
  text-align: center;
  white-space: nowrap;
}

.customers-table .table-sort-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.customers-table .table-sort-link:hover {
  color: #1d4ed8;
}

.customers-table .sort-arrows {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.72;
  color: #8aa0b3;
  font-size: 0.68rem;
}

.customers-table .sort-arrows .is-active {
  color: #1d4ed8;
  font-weight: 700;
}

.customers-table .cell-ellipsis {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customers-table td {
  text-align: left;
}

.customers-table td:nth-child(5),
.customers-table td:nth-child(6),
.customers-table td:nth-child(7),
.customers-table td:nth-child(8),
.customers-table td:nth-child(9),
.customers-table td:nth-child(10) {
  text-align: center;
}

.customers-table .action-cell {
  text-align: center;
  white-space: nowrap;
}

.customers-table .action-cell form {
  margin: 0;
}

.compact-action {
  min-height: 30px;
  padding: 0.26rem 0.48rem;
  font-size: 0.82rem;
}

.customers-table .col-company {
  width: 210px;
}

.customers-table .col-contact {
  width: 150px;
}

.customers-table .col-whatsapp {
  width: 165px;
}

.customers-table .col-email {
  width: 250px;
}

.customers-table .col-country {
  width: 90px;
}

.customers-table .col-local-time {
  width: 100px;
}

.customers-table .col-last-contact {
  width: 120px;
}

.customers-table .col-followup {
  width: 82px;
}

.customers-table .col-edit,
.customers-table .col-delete {
  width: 72px;
}

.customers-table .local-time-cell {
  white-space: nowrap;
}

.followup-workbench-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 2.18fr);
  gap: 20px;
  align-items: start;
}

.followup-queue-card {
  position: sticky;
  top: 12px;
}

.followup-workbench-hero-row,
.followup-current-head,
.followup-action-row,
.followup-secondary-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.followup-workbench-hero p,
.followup-current-head p {
  margin-bottom: 0;
}

.followup-workbench-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.followup-workbench-title-note {
  margin: 0;
  color: var(--muted);
}

.followup-workbench-summary,
.followup-customer-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.followup-auto-task-panel {
  display: block;
  border: 1px solid rgba(210, 72, 54, 0.35);
  box-shadow: 0 12px 28px rgba(160, 58, 43, 0.08);
}

.followup-auto-task-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

.followup-auto-task-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 0 1 auto;
  margin-left: 8px;
}

.followup-auto-task-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: #153657;
  font-weight: 600;
}

.followup-auto-task-field span {
  font-size: 12px;
  line-height: 1.2;
}

.followup-auto-task-field input {
  width: 96px;
  min-width: 96px;
  height: 38px;
  min-height: 38px;
  padding: 0.35rem 0.7rem;
}

.followup-auto-task-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.followup-auto-task-actions .button {
  min-height: 38px;
  padding: 0.45rem 0.95rem;
}

.followup-auto-task-actions .button:disabled,
.followup-auto-task-actions .button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.followup-auto-task-actions .button.primary:disabled,
.followup-auto-task-actions .button.primary[disabled] {
  background: #f3b6a5;
  border-color: #f3b6a5;
  color: #ffffff;
}

.followup-auto-task-actions .button:not(.primary):disabled,
.followup-auto-task-actions .button:not(.primary)[disabled] {
  background: #e8eef5;
  border-color: #e8eef5;
  color: #7f92a6;
}

.followup-auto-task-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.35rem 0.8rem;
  border: 1px solid #d7e3ef;
  border-radius: 999px;
  background: #ffffff;
  color: #465468;
  font-weight: 700;
  white-space: nowrap;
  margin-left: auto;
}

.followup-auto-task-status.is-running {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.followup-auto-task-status.is-idle {
  border-color: #d7e3ef;
  background: #ffffff;
  color: #465468;
}

.followup-auto-task-status.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.followup-filter-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}

.followup-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 10px;
  align-items: start;
}

.followup-filter-form > .followup-filter-row > label,
.followup-filter-form > .followup-filter-row > fieldset,
.followup-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #153657;
  font-weight: 600;
}

.followup-stage-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.followup-stage-dropdown {
  position: relative;
}

.followup-stage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.62rem 0.78rem;
  border: 1px solid #cfd8df;
  border-radius: 12px;
  background: #ffffff;
  color: #153657;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.followup-stage-summary::-webkit-details-marker {
  display: none;
}

.followup-stage-summary::after {
  content: "▾";
  color: #6f8297;
  font-size: 0.85rem;
}

.followup-stage-dropdown[open] .followup-stage-summary::after {
  content: "▴";
}

.followup-filter-form select {
  width: 100%;
}

.followup-stage-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.7rem 0.78rem;
  border: 1px solid #d7e3ef;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(50, 78, 112, 0.12);
}

.followup-stage-option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-weight: 500;
  color: #153657;
  white-space: nowrap;
}

.followup-stage-option input[type="checkbox"] {
  width: auto;
  min-width: 0;
  height: auto;
  flex: 0 0 auto;
  margin: 0;
  order: 0;
  accent-color: #1f6feb;
}

.followup-stage-option span {
  order: 1;
  flex: 0 1 auto;
}

.followup-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  padding-top: 2px;
}

.followup-queue-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 240px);
  overflow-y: auto;
  padding-right: 4px;
}

.followup-queue-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line, #d7e3ef);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  background: rgba(245, 249, 253, 0.9);
}

.followup-queue-item.is-active {
  border-color: #e2582d;
  box-shadow: 0 10px 24px rgba(50, 78, 112, 0.12);
}

.followup-current-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.84fr) minmax(0, 1.5fr);
  gap: 20px;
}

.followup-meta-panel,
.followup-editor-panel {
  display: grid;
  gap: 18px;
  align-self: start;
}

.followup-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.followup-meta-grid div,
.followup-mail-config,
.followup-history {
  border: 1px solid var(--line, #d7e3ef);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(248, 251, 255, 0.92);
}

.followup-meta-grid strong,
.followup-mail-config strong,
.followup-history strong {
  color: #153657;
}

.followup-meta-grid div strong {
  display: block;
  line-height: 1.45;
  word-break: break-word;
}

.followup-mail-config {
  display: grid;
  gap: 10px;
}

.followup-mail-config p {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.followup-meta-grid span,
.followup-history-item span {
  display: block;
  font-size: 12px;
  color: #6f8297;
  margin-bottom: 4px;
}

.followup-history {
  display: grid;
  gap: 10px;
}

.followup-history-item {
  border-top: 1px solid var(--line, #d7e3ef);
  padding-top: 10px;
}

.followup-history-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.followup-editor-form {
  display: grid;
  gap: 16px;
}

.followup-editor-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.followup-editor-toolbar {
  align-items: end;
}

.followup-editor-toolbar label,
.followup-editor-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: #153657;
}

.followup-editor-form input,
.followup-editor-form select,
.followup-editor-form textarea {
  width: 100%;
}

.followup-editor-form textarea {
  min-height: 360px;
  resize: vertical;
}

.followup-action-row {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  padding-top: 4px;
  margin-top: 4px;
  gap: 10px;
  overflow-x: auto;
}

.followup-action-row form,
.followup-action-row .button {
  flex: 0 1 auto;
}

.followup-empty-state,
.followup-queue-empty {
  padding: 20px;
  color: #5e7186;
}

@media (max-width: 1080px) {
  .followup-queue-card {
    position: static;
  }

  .followup-workbench-layout,
  .followup-current-grid {
    grid-template-columns: 1fr;
  }

  .followup-editor-toolbar {
    grid-template-columns: 1fr;
  }

  .followup-filter-row {
    grid-template-columns: 1fr;
  }

  .followup-auto-task-form {
    grid-template-columns: 1fr;
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .followup-auto-task-head {
    flex-wrap: wrap;
  }

  .followup-auto-task-status {
    margin-left: 0;
  }

  .followup-filter-actions {
    justify-content: flex-start;
  }

  .followup-action-row {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .followup-queue-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

.customers-table .local-time-cell .cell-ellipsis {
  text-align: center;
}

.customers-table .local-time-cell .cell-ellipsis.is-working-hours {
  color: #15803d;
  font-weight: 700;
}

.inquiries-table th,
.inquiries-table td {
  text-align: center;
  vertical-align: middle;
}

.inquiries-table {
  table-layout: fixed;
}

.inquiries-table th {
  white-space: nowrap;
}

.inquiries-table .cell-ellipsis {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inquiries-table .table-sort-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.inquiries-table .table-sort-link:hover {
  color: #1d4ed8;
}

.inquiries-table .sort-arrows {
  display: inline-flex;
  flex-direction: column;
  line-height: 0.72;
  color: #8aa0b3;
  font-size: 0.68rem;
}

.inquiries-table .sort-arrows .is-active {
  color: #1d4ed8;
  font-weight: 700;
}

.inquiries-table .inquiry-link {
  color: inherit;
  text-decoration: none;
}

.inquiries-table .inquiry-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.inquiries-table .row-actions {
  justify-content: center;
}

.product-summary-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0 0.1rem;
}

.product-summary-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.38rem;
  justify-content: flex-start;
  min-height: 0;
  margin: 0;
  padding: 0;
  color: #15384f;
  font-size: 0.88rem;
  font-weight: 700;
}

.product-summary-item > span {
  color: #35546e;
  white-space: nowrap;
}

.product-summary-item input {
  width: 102px;
  min-width: 102px;
  height: 32px;
  border: 1px solid #d9e4f2;
  border-radius: 10px;
  background: #ffffff;
  color: #15384f;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  padding: 0 0.3rem;
}

.product-summary-item [data-shipping-field="total_weight"] {
  width: 102px;
  min-width: 102px;
}

.product-summary-item [data-shipping-field="summary_freight"] {
  width: 87px;
  min-width: 87px;
}

.product-summary-item [data-product-summary-field="discount_amount"] {
  width: 87px;
  min-width: 87px;
}

.product-summary-readonly input {
  background: #f7fbff;
  color: #1d4ed8;
}

.inquiries-table .status-filter-head {
  width: 148px;
  text-align: center;
}

.inquiries-table .status-filter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin: 0 auto;
  width: 100%;
}

.inquiries-table .status-filter-label {
  font-weight: 700;
  line-height: 1;
}

.inquiries-table .status-filter-select {
  width: 88px;
  min-width: 88px;
  padding: 0.18rem 1.25rem 0.18rem 0.42rem;
  border: 1px solid #c9d9e8;
  border-radius: 999px;
  background: #f7fbff;
  color: #14395f;
  font: inherit;
  margin: 0 auto;
  text-align: center;
}

.inquiries-table .col-inquiry-number,
.inquiries-table .col-inquiry-customer,
.inquiries-table .col-inquiry-date,
.inquiries-table .col-inquiry-contact,
.inquiries-table .col-inquiry-status {
  width: 148px;
}

.inquiries-table .col-inquiry-whatsapp {
  width: 162px;
}

.inquiries-table .col-inquiry-country {
  width: 92px;
}

.inquiries-table .col-inquiry-detail-count {
  width: 78px;
}

.inquiries-table .col-inquiry-actions {
  width: 190px;
}

.inquiries-table td:last-child {
  overflow: visible;
}

.customer-form-layout {
  gap: 0.85rem;
}

.customer-form-head {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.9rem;
}

.customer-form-summary {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.customer-form-summary-item {
  min-width: 132px;
  padding: 0.55rem 0.85rem;
  border: 1px solid #d9e4ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  text-align: center;
}

.customer-form-summary-label {
  display: block;
  color: #6a8194;
  font-size: 0.82rem;
  line-height: 1.2;
}

.customer-form-summary-value {
  display: block;
  margin-top: 0.22rem;
  color: #14354b;
  font-size: 1.02rem;
  line-height: 1.25;
}

.customer-form-head-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.customer-top-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0.95rem;
  align-items: stretch;
}

.customer-compact-fields,
.customer-text-panel {
  padding: 0.9rem 1rem;
  border: 1px solid #d9e4ec;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.customer-compact-fields {
  display: grid;
  gap: 0.82rem;
  height: 100%;
}

.customer-grid-tight {
  gap: 0.72rem;
}

.customer-fields-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.72rem 0.8rem;
  align-items: end;
}

.customer-field-span-2 {
  grid-column: span 2;
}

.customer-field-span-4 {
  grid-column: span 4;
}

.customer-field-span-3 {
  grid-column: span 3;
}

.customer-notes-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.72rem 0.8rem;
  align-items: stretch;
}

.customer-notes-grid textarea {
  min-height: 108px;
}

.customer-grid-tight label {
  gap: 0.28rem;
  font-size: 0.88rem;
  min-width: 0;
}

.customer-grid-tight input,
.customer-grid-tight select {
  width: 100%;
  min-width: 0;
  padding: 0.62rem 0.78rem;
  border-radius: 12px;
}

.customer-enabled-row {
  min-height: 46px;
  padding-top: 0;
  align-self: stretch;
}

.customer-enabled-card {
  justify-content: flex-start;
  min-height: 46px;
  padding: 0 0.78rem;
  border: 1px solid #cfd8df;
  border-radius: 12px;
  background: #ffffff;
  box-sizing: border-box;
}

.customer-text-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.7rem;
  height: 100%;
}

.customer-text-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.customer-text-panel-head strong {
  color: #14354b;
  font-size: 0.96rem;
}

.customer-text-panel-head span {
  color: #7890a3;
  font-size: 0.8rem;
}

.customer-parse-head-button {
  flex: none;
  min-height: 34px;
  padding: 0.4rem 0.8rem;
  font-size: 0.84rem;
}

.customer-raw-text {
  min-height: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  background: #fbfdff;
}

.customer-text-tip {
  color: #708497;
  font-size: 0.84rem;
}

.customer-text-tip-hidden {
  display: none;
}

.customer-text-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.customer-text-actions .button {
  flex: none;
}

.customer-related-card {
  margin-top: 0.9rem;
}

.customer-addresses-card {
  margin-top: 0.9rem;
}

.customer-addresses-head h3,
.customer-address-editor h4 {
  margin: 0;
  color: #14354b;
}

.customer-addresses-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.customer-addresses-head p {
  margin: 0;
}

.customer-addresses-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.95fr);
  gap: 0.95rem;
}

.customer-address-list,
.customer-address-editor {
  padding: 0.9rem 1rem;
  border: 1px solid #d9e4ec;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.customer-address-list {
  display: grid;
  gap: 0.8rem;
}

.customer-address-item {
  padding: 0.9rem 0.95rem;
  border: 1px solid #dbe6ee;
  border-radius: 16px;
  background: #ffffff;
}

.customer-address-item.is-disabled {
  opacity: 0.72;
}

.customer-address-item-head,
.customer-address-item-actions,
.customer-address-meta,
.customer-address-form-actions {
  display: flex;
  gap: 0.55rem;
}

.customer-address-item-head {
  align-items: flex-start;
  justify-content: space-between;
}

.customer-address-item-head strong {
  color: #173a52;
  font-size: 0.98rem;
}

.customer-address-item-actions {
  align-items: center;
  flex-wrap: wrap;
}

.customer-address-item-actions form {
  margin: 0;
}

.customer-address-meta {
  margin-top: 0.55rem;
  flex-wrap: wrap;
  color: #5f7488;
  font-size: 0.84rem;
}

.customer-address-body {
  margin-top: 0.58rem;
  color: #163047;
  line-height: 1.55;
}

.customer-address-notes {
  margin-top: 0.5rem;
  color: #6d8093;
  font-size: 0.86rem;
}

.customer-address-editor {
  display: grid;
  gap: 0.8rem;
}

.customer-address-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.72rem 0.8rem;
  align-items: start;
}

.customer-address-span-2 {
  grid-column: span 2;
}

.customer-address-notes-field {
  grid-column: span 2;
}

.customer-address-full-row {
  grid-column: 1 / -1;
}

.customer-address-form-grid label {
  gap: 0.28rem;
  font-size: 0.88rem;
}

.customer-address-form-grid input,
.customer-address-form-grid textarea {
  width: 100%;
  min-width: 0;
  padding: 0.62rem 0.78rem;
  border-radius: 12px;
}

.customer-address-form-actions {
  align-items: center;
  flex-wrap: wrap;
}

.customer-address-form-actions-top {
  justify-content: flex-start;
}

.customer-related-head h3 {
  margin: 0;
  color: #14354b;
  font-size: 1.02rem;
}

.customer-related-table {
  table-layout: fixed;
}

.customer-related-table th,
.customer-related-table td {
  text-align: center;
  vertical-align: middle;
}

.customer-related-table .col-inquiry-number {
  width: 150px;
}

.customer-related-table .col-inquiry-date {
  width: 110px;
}

.customer-related-table .col-inquiry-contact {
  width: 150px;
}

.customer-related-table .col-inquiry-whatsapp {
  width: 170px;
}

.customer-related-table .col-inquiry-country,
.customer-related-table .col-inquiry-total,
.customer-related-table .col-inquiry-status,
.customer-related-table .col-inquiry-detail {
  width: 100px;
}

.customer-related-table .detail-cell {
  white-space: nowrap;
}

.customer-related-empty {
  padding: 1rem 0.75rem;
  color: #708497;
}

@media (max-width: 1380px) {
  .customer-form-head {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .customer-form-summary {
    justify-content: flex-start;
  }

  .customer-top-layout {
    grid-template-columns: 1fr;
  }

  .customer-addresses-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .customer-fields-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .customer-notes-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .customer-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-field-span-4 {
    grid-column: span 2;
  }

  .customer-address-form-grid {
    grid-template-columns: 1fr;
  }

  .customer-address-span-2 {
    grid-column: auto;
  }
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid #e4edf3;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  color: #6d8296;
  font-weight: 700;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 38px;
  padding: 0.45rem 0.85rem;
  border: 1px solid #d7e2ea;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #21425d;
  text-decoration: none;
  font-weight: 600;
}

.pagination-link:hover {
  border-color: #aac2d4;
  background: #f7fbff;
}

.pagination-link.active {
  border-color: #d74e2f;
  background: #fff1ea;
  color: #c94a2d;
}

.pagination-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.row-log-details {
  position: relative;
}

.row-log-details summary {
  list-style: none;
}

.row-log-details summary::-webkit-details-marker {
  display: none;
}

.row-log-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(360px, 60vw);
  padding: 0.8rem 0.9rem;
  border: 1px solid #d6e1e8;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(17, 36, 53, 0.14);
}

.row-log-popover strong {
  display: block;
  margin-bottom: 0.55rem;
  color: #12344b;
  font-size: 0.9rem;
}

.row-log-list {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.row-log-list li {
  display: grid;
  gap: 0.18rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #edf2f6;
}

.row-log-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.row-log-time {
  color: #5f7387;
  font-size: 0.78rem;
}

.row-log-text {
  color: #173449;
  font-size: 0.88rem;
  line-height: 1.45;
}

.row-log-empty {
  color: #6c7f91;
  font-size: 0.84rem;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.asset-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfcfd;
}

.asset-card h3 {
  margin-top: 0;
}

.asset-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin-bottom: 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.asset-preview img {
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.asset-signature img {
  max-height: 120px;
}

.sticky-notes {
  position: fixed;
  right: 18px;
  top: 148px;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.sticky-notes-toggle {
  min-width: 54px;
  min-height: 54px;
  padding: 0.7rem 0.75rem;
  border: 1px solid #cbd9e3;
  border-radius: 18px;
  background: rgba(255, 250, 214, 0.98);
  color: #6e5312;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(22, 48, 71, 0.12);
}

.sticky-notes-panel {
  width: 420px;
  max-height: calc(100vh - 180px);
  display: none;
  grid-template-rows: auto 1fr auto;
  gap: 0.7rem;
  padding: 0.9rem;
  border: 1px solid #d9e3ea;
  border-radius: 22px;
  background: rgba(255, 252, 235, 0.98);
  box-shadow: 0 18px 40px rgba(22, 48, 71, 0.16);
  overflow: hidden;
}

.sticky-notes.is-open .sticky-notes-panel {
  display: grid;
}

.sticky-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.sticky-notes-head strong {
  color: #634b12;
  font-size: 1rem;
}

.sticky-notes-list {
  display: grid;
  gap: 0.55rem;
  overflow-y: auto;
  padding-right: 0.1rem;
}

.sticky-note-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
  padding: 0.45rem 0.55rem;
  border: 1px solid #ecd98f;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.sticky-note-card:nth-child(odd) {
  background: rgba(255, 255, 255, 0.82);
}

.sticky-note-card:nth-child(even) {
  background: rgba(255, 248, 217, 0.82);
}

.sticky-note-text {
  min-height: 54px;
  max-height: 54px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #e4d289;
  border-radius: 10px;
  background: #fffdf3;
  resize: none;
  line-height: 1.35;
}

.sticky-note-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #846925;
  font-size: 0.8rem;
  font-weight: 700;
}

.sticky-notes-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-top: 0.25rem;
}

.sticky-notes-status {
  color: #8a7432;
  font-size: 0.8rem;
}

.sticky-notes-save {
  min-height: 36px;
  padding: 0.45rem 0.95rem;
}

.phrase-library {
  position: fixed;
  right: 18px;
  top: 214px;
  z-index: 39;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.phrase-library-toggle {
  min-width: 84px;
  min-height: 54px;
  padding: 0.7rem 0.85rem;
  border: 1px solid #c9d8e4;
  border-radius: 18px;
  background: rgba(232, 241, 249, 0.98);
  color: #183a53;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(22, 48, 71, 0.12);
}

.phrase-library-panel {
  width: 460px;
  max-height: calc(100vh - 240px);
  display: none;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 0.75rem;
  padding: 0.95rem;
  border: 1px solid #d9e3ea;
  border-radius: 22px;
  background: rgba(248, 252, 255, 0.98);
  box-shadow: 0 18px 40px rgba(22, 48, 71, 0.16);
  overflow: hidden;
}

.phrase-library.is-open .phrase-library-panel {
  display: grid;
}

.phrase-library-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.phrase-library-head strong {
  color: #17344d;
  font-size: 1rem;
}

.phrase-library-add-trigger {
  min-height: 34px;
  padding: 0.42rem 0.8rem;
  font-size: 0.84rem;
}

.phrase-library-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(148px, 180px);
  gap: 0.55rem;
}

.phrase-library-search,
.phrase-library-filter,
.phrase-library-form select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.62rem 0.8rem;
  border: 1px solid #d4e0e9;
  border-radius: 12px;
  background: #ffffff;
  color: #183a53;
  font: inherit;
}

.phrase-library-form {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid #dbe6ef;
  border-radius: 16px;
  background: #ffffff;
}

.phrase-library-form[hidden] {
  display: none;
}

.phrase-library-form label {
  gap: 0.28rem;
  font-size: 0.86rem;
}

.phrase-library-form textarea {
  min-height: 68px;
  padding: 0.72rem 0.82rem;
  border-radius: 12px;
}

.phrase-library-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.phrase-library-status {
  color: #6a8094;
  font-size: 0.82rem;
}

.phrase-library-list {
  display: grid;
  gap: 0.15rem;
  max-height: min(54vh, 560px);
  overflow-y: auto;
  padding-right: 0.1rem;
}

.phrase-card {
  padding: 0.2rem 0;
  border-bottom: 1px solid #e4edf3;
}

.phrase-card.is-open {
  border-bottom-color: #c7d7e4;
}

.phrase-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.25rem 0.1rem;
}

.phrase-card-toggle {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #17344d;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.phrase-card-zh {
  color: #17344d;
  font-size: 0.88rem;
  line-height: 1.35;
  min-width: 0;
}

.phrase-card-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.phrase-card-btn {
  min-height: 24px;
  padding: 0.18rem 0.48rem;
  border: 1px solid #d5e1ea;
  border-radius: 999px;
  background: transparent;
  color: #183a53;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}

.phrase-card-body {
  display: grid;
  gap: 0.7rem;
  padding: 0 0.1rem 0.45rem 2rem;
}

.phrase-card-body[hidden] {
  display: none;
}

.phrase-card-en {
  margin: 0;
  color: #21425d;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.phrase-card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.phrase-card-category {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #eef5fa;
  color: #5f7488;
  font-size: 0.72rem;
  white-space: nowrap;
}

.phrase-card-copy-row {
  display: flex;
}

@media (max-width: 1180px) {
  .quick-links,
  .stats-grid,
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-grid,
  .hero-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .grid.two,
  .grid.three,
  .grid.four,
  .customer-fields-grid,
  .quick-links,
  .stats-grid,
  .asset-grid {
    grid-template-columns: 1fr;
  }

  .customer-field-span-2 {
    grid-column: auto;
  }

  .customer-field-span-3 {
    grid-column: auto;
  }

  .site-header {
    padding: 1rem 1rem 0.5rem;
    min-height: 200px;
  }

  .header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-block {
    width: auto;
    min-width: 0;
  }

  .section-head-inline {
    flex-wrap: wrap;
  }

  .toolbar-inline {
    width: 100%;
  }

  .toolbar-inline input {
    min-width: 0;
  }

  .customers-toolbar-row {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .customers-search-form,
  .customers-toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .customers-search-form input {
    width: 100%;
    min-width: 0;
  }

  .header-center-nav {
    width: 100%;
    padding-left: 0;
    gap: 1rem;
    justify-content: flex-start;
  }

  .header-center-nav .top-nav {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .header-nav-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .header-right-actions {
    width: 100%;
    padding-right: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .header-rate {
    margin-left: 0;
  }

  .top-nav {
    flex-wrap: wrap;
    white-space: normal;
    justify-content: flex-start;
  }

  .nav-group {
    width: 100%;
    align-items: flex-start;
  }

  .nav-group-menu {
    position: static;
    display: grid;
    min-width: 0;
    margin-top: 0.45rem;
    background: rgba(14, 39, 60, 0.5);
  }

  .exchange-rate-form,
  .exchange-rate-form.compact {
    width: 100%;
    margin: 0;
  }

  .exchange-rate-inline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 0.25rem;
  }

  .compact-note {
    grid-column: 1 / -1;
  }

  .page-shell {
    padding: 1rem;
  }

  .rate-tools {
    left: 10px;
    top: auto;
    bottom: 16px;
  }

  .rate-tools-panel {
    width: min(320px, calc(100vw - 94px));
  }

  .sticky-notes {
    right: 10px;
    top: auto;
    bottom: 16px;
  }

  .phrase-library {
    right: 74px;
    top: auto;
    bottom: 16px;
  }

  .phrase-library-panel {
    width: min(360px, calc(100vw - 96px));
    max-height: min(70vh, 560px);
  }

  .phrase-library-tools {
    grid-template-columns: 1fr;
  }

  .sticky-notes-panel {
    width: min(320px, calc(100vw - 84px));
    max-height: min(70vh, 520px);
  }

  .hero-search {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .site-header,
  .button-row,
  .status-row,
  .flash-stack {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

.batch-import-top-layout,
.batch-import-results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.card-soft {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(186, 205, 224, 0.9);
  border-radius: 20px;
  padding: 20px;
}

@media (max-width: 430px) {
  body {
    font-size: 15px;
    line-height: 1.6;
  }

  h1 {
    font-size: 32px;
    line-height: 1.25;
  }

  h2 {
    font-size: 26px;
    line-height: 1.35;
  }

  h3 {
    font-size: 18px;
    line-height: 1.45;
  }

  button,
  .button {
    font-size: 15px;
    line-height: 22px;
  }
}

/* Typography requirements override: text-only, keep layout intact */
html,
body,
button,
input,
textarea,
select,
table,
th,
td {
  font-family: var(--font-base);
}

.site-header .brand-block h1 {
  font-size: 48px;
  line-height: 56px;
  font-weight: 700;
  color: #ffffff;
}

.top-nav a,
.nav-group-toggle,
.nav-button,
.nav-group-menu a,
.nav-group-label,
.header-rate .compact-title {
  font-family: var(--font-base);
}

.top-nav a,
.nav-group-toggle,
.nav-button {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.nav-group-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.hero-panel .eyebrow,
.section-head .eyebrow {
  font-size: 14px;
  line-height: 22px;
  font-weight: 400;
  letter-spacing: 0;
}

.hero-panel h2 {
  font-size: 48px;
  line-height: 56px;
  font-weight: 700;
  color: #0f172a;
}

.hero-copy,
.hero-panel p,
.section-head p,
.link-card span,
.records-table,
.records-table td,
.records-table th,
.card p,
.empty-state {
  font-size: 16px;
  line-height: 28px;
  font-weight: 400;
  color: #475569;
}

.section-head h2,
.section-head-inline h2,
.card h2 {
  font-size: 30px;
  line-height: 38px;
  font-weight: 600;
  color: #0f172a;
}

.card h3,
.section-head h3,
.section-head-inline h3,
.link-card strong,
.stat-card span,
.records-table th {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: #0f172a;
}

.link-card strong,
.stat-card strong,
.records-table td strong,
.pill,
.mini-button {
  font-family: var(--font-base);
}

.mini-button,
.button,
.button.primary,
.button.secondary,
.button-row .button,
.hero-search button {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}

label,
.form-grid label,
.field-label,
.records-table thead th {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #64748b;
}

input,
textarea,
select,
.hero-search input {
  font-size: 16px;
  line-height: 28px;
  font-weight: 400;
  color: #475569;
}

.subcopy,
.muted,
.nav-group-label,
.flash,
.helper-text,
small {
  color: #64748b;
}

.top-nav a,
.nav-group-toggle,
.nav-button,
.button,
.mini-button {
  text-decoration: none;
}

@media (max-width: 430px) {
  .site-header .brand-block h1,
  .hero-panel h2 {
    font-size: 32px;
    line-height: 40px;
  }

  .hero-copy,
  .hero-panel p,
  .section-head p,
  .link-card span,
  .records-table,
  .records-table td,
  .records-table th,
  .card p,
  input,
  textarea,
  select,
  .hero-search input {
    font-size: 15px;
    line-height: 24px;
  }
}

.stack-label {
  display: grid;
  gap: 10px;
}

.batch-import-source-text {
  min-height: 360px;
  width: 100%;
  resize: vertical;
}

.batch-import-editor-config {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(186, 205, 224, 0.7);
  display: grid;
  gap: 12px;
}

.batch-import-page-actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  min-width: 160px;
}

.batch-import-side {
  display: grid;
  gap: 20px;
  align-content: start;
}

.batch-import-side-queue {
  min-height: 180px;
  padding: 18px;
}

.batch-import-config {
  margin-top: 20px;
}

.batch-import-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 20px;
  align-items: start;
}

.batch-import-config-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.batch-import-config-inline {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) repeat(2, minmax(72px, 0.28fr));
  gap: 14px;
  align-items: end;
}

.batch-import-config-inline label,
.batch-import-preview-grid div {
  display: grid;
  gap: 6px;
}

.batch-import-task-name-field {
  min-width: 0;
  max-width: 240px;
}

.batch-import-task-name-field input {
  max-width: 240px;
}

.batch-import-delay-field {
  width: 100%;
  max-width: 84px;
}

.batch-import-delay-field input {
  max-width: 84px;
  text-align: center;
}

.batch-import-auto-send-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  justify-content: flex-start;
  align-self: start;
  margin-top: 2px;
}

.batch-import-auto-send-inline span {
  white-space: nowrap;
  line-height: 1.2;
}

.batch-import-auto-send-inline input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: #1f6fe5;
  transform: translateY(-1px);
}

.batch-import-config-actions {
  display: grid;
  gap: 12px;
  align-content: start;
  align-self: start;
  margin-top: 0;
}

.batch-import-config-actions .button {
  width: 100%;
  justify-content: center;
}

.batch-import-preview-list,
.batch-import-log-list,
.batch-import-task-list {
  display: grid;
  gap: 14px;
}

.batch-import-preview-list {
  max-height: 760px;
  overflow-y: auto;
  padding-right: 8px;
  align-content: start;
}

.batch-import-log-list {
  max-height: 600px;
  overflow-y: auto;
  padding-right: 8px;
  align-content: start;
}

.batch-import-preview-item {
  border: 1px solid rgba(186, 205, 224, 0.9);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.batch-import-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.batch-import-preview-meta,
.batch-import-preview-duplicate,
.batch-import-task-summary {
  margin-top: 10px;
  color: var(--text-secondary, #486581);
}

.batch-import-preview-compact {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.batch-import-preview-compact strong,
.batch-import-preview-compact span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  word-break: break-word;
}

.batch-import-preview-compact strong {
  font-weight: 600;
  color: var(--text-primary, #143255);
}

.batch-import-preview-compact span {
  color: var(--text-secondary, #486581);
}

.batch-import-log-item {
  display: grid;
  grid-template-columns: 160px 72px minmax(0, 1fr);
  gap: 8px;
  padding: 3px 0;
  line-height: 1.12;
  font-size: 0.86rem;
  border-bottom: 0;
}

.batch-import-log-item:last-child {
  border-bottom: 0;
}

.batch-import-log-item strong,
.batch-import-log-item span {
  margin: 0;
}

.batch-import-log-item.is-success span,
.batch-import-log-item.is-success strong {
  color: #2d8a4e;
}

.batch-import-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(186, 205, 224, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.batch-import-task-name {
  font-weight: 600;
  color: var(--text-primary, #143255);
  word-break: break-word;
}

.batch-import-task-meta {
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted, #5f7890);
}

.batch-import-task-meta.is-running {
  color: #2d8a4e;
  font-weight: 700;
}

.batch-import-task-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.batch-import-task-delay-editor {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  margin-right: 2px;
}

.batch-import-task-delay-field {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.batch-import-task-delay-field span {
  color: var(--muted, #5f7890);
  font-size: 0.68rem;
  line-height: 1.1;
}

.batch-import-task-delay-input {
  width: 52px;
  min-width: 52px;
  height: 28px;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(186, 205, 224, 0.9);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
}

.batch-import-task-delay-input::-webkit-outer-spin-button,
.batch-import-task-delay-input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.batch-import-task-delay-input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.batch-import-task-actions .button {
  min-height: 28px;
  padding: 0.28rem 0.62rem;
  font-size: 0.82rem;
}

.batch-import-task-delay-confirm {
  min-width: 44px;
}

@media (max-width: 960px) {
  .batch-import-top-layout,
  .batch-import-results-layout,
  .batch-import-config-layout,
  .batch-import-config-inline,
  .batch-import-preview-grid {
    grid-template-columns: 1fr;
  }

  .batch-import-log-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .batch-import-task-row {
    grid-template-columns: 1fr;
  }

  .batch-import-task-actions {
    justify-content: flex-start;
  }

  .batch-import-task-delay-editor {
    width: 100%;
  }

  .batch-import-page-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.mailbox-hero-row,
.mailbox-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mailbox-hero p,
.mailbox-detail-head p,
.mailbox-meta-line {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.mailbox-hero-actions,
.mailbox-detail-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.mailbox-layout {
  display: grid;
  grid-template-columns: minmax(360px, 42%) minmax(0, 58%);
  gap: 20px;
  align-items: start;
}

.mailbox-list-card,
.mailbox-detail-card {
  min-height: 640px;
}

.mailbox-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 720px;
  overflow: auto;
}

.mailbox-list-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-decoration: none;
  color: var(--ink);
}

.mailbox-list-item.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(227, 86, 42, 0.12);
}

.mailbox-list-item.is-matched {
  background: #f7fcf8;
}

.mailbox-list-item.is-unread .mailbox-item-subject {
  font-weight: 800;
}

.mailbox-item-top,
.mailbox-item-tags {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mailbox-item-top span,
.mailbox-item-snippet {
  color: var(--muted);
  font-size: 0.92rem;
}

.mailbox-item-subject {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.35;
}

.mailbox-item-snippet {
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mailbox-item-tags {
  margin-top: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.mailbox-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mailbox-detail-meta > div,
.mailbox-empty {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.mailbox-detail-meta span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.mailbox-body {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  max-height: 720px;
  overflow: auto;
}

.mailbox-body-title {
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
}

.mailbox-rich-body {
  color: var(--ink);
  line-height: 1.7;
}

.mailbox-rich-body > *:first-child {
  margin-top: 0;
}

.mailbox-rich-body > *:last-child {
  margin-bottom: 0;
}

.mailbox-rich-body p {
  margin: 0 0 14px;
  word-break: break-word;
}

.mailbox-rich-body h4 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 800;
}

.mailbox-rich-list {
  margin: 0 0 14px;
  padding-left: 22px;
}

.mailbox-rich-list li + li {
  margin-top: 6px;
}

.mailbox-history {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.mailbox-history summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}

.mailbox-history summary::-webkit-details-marker {
  display: none;
}

.mailbox-history[open] summary {
  border-bottom: 1px solid var(--line);
}

.mailbox-body-history {
  margin-top: 0;
  border: 0;
  border-radius: 0 0 18px 18px;
  max-height: 360px;
}

.mailbox-rich-body-history {
  color: var(--muted);
  font-size: 0.95rem;
}

.mailbox-empty-detail {
  min-height: 320px;
}

@media (max-width: 960px) {
  .mailbox-layout,
  .mailbox-detail-meta {
    grid-template-columns: 1fr;
  }

  .mailbox-hero-row,
  .mailbox-detail-head {
    flex-direction: column;
  }

  .mailbox-hero-actions,
  .mailbox-detail-tags {
    justify-content: flex-start;
  }
}
