/* v24 visual system: presentation-only overrides. */
:root {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --line: #d9e0e9;
  --line-soft: #e9edf3;
  --text: #182230;
  --muted: #667085;
  --brand: #2563eb;
  --primary: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #edf4ff;
  --danger: #d92d20;
  --danger-dark: #b42318;
  --ok: #07865f;
  --ok-soft: #eaf8f2;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.035);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.modal-body::-webkit-scrollbar { width: 10px; height: 10px; }
body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: #c5ceda;
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: padding-box;
}

.app { grid-template-columns: 108px minmax(0, 1fr); }
.sidebar {
  padding: 16px 10px;
  background: #fbfaf7;
  border-right-color: #e5ddd2;
  box-shadow: 1px 0 0 rgba(66, 50, 32, 0.03);
}
.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-bottom: 15px;
  padding: 0 2px 13px;
  border-bottom: 1px solid #e8dfd3;
  color: #332b23;
  font-size: 11px;
  line-height: 1.2;
}
.brand-mark {
  display: block;
  width: 68px;
  height: 84px;
  background-image: url('/static/jili-packaging-logo.png');
  background-repeat: no-repeat;
  background-size: 502px 502px;
  background-position: -219px -382px;
}
.brand-caption {
  color: #76614b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.menu-item {
  min-height: 40px;
  margin-bottom: 5px;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #3f372f;
  font-size: 13px;
  line-height: 1.15;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.menu-item::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.menu-item:hover {
  background: #f3ece2;
  border-color: #eadfce;
  color: #78512c;
}
.menu-item.active {
  background: #ead8bd;
  border-color: #ddc39e;
  color: #33271c;
  font-weight: 800;
}
.menu-item.active::after { background: #a46f3d; }
.flyout {
  left: 94px;
  top: -4px;
  width: 214px;
  padding: 6px;
  border-color: #dfd3c3;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, 0.16);
}
.flyout button:hover {
  background: #f3e8d8;
  color: #76502e;
}

.followup-operation-section {
  border-color: #eadfce;
  background: #fcfaf7;
}
.followup-operation-hint { margin-bottom: 10px; }
.followup-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flyout button {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 13px;
}

.topbar {
  height: 62px;
  padding: 0 24px;
  border-bottom-color: #e3e7ed;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
}
.title { color: #162033; font-size: 17px; font-weight: 800; }
.topbar-actions { gap: 7px; }
.user-pill {
  padding: 6px 10px;
  border: 1px solid #e2e7ee;
  border-radius: 7px;
  background: #f8fafc;
  color: #344054;
}
.content {
  width: 100%;
  max-width: 1840px;
  padding: 18px 22px 30px;
}
.site-footer { padding: 12px 20px 20px; color: #7b8798; }

.grid { gap: 12px; }
.quote-grid {
  grid-template-columns: minmax(680px, 1.82fr) minmax(390px, 1fr);
  gap: 14px;
}
.quote-result-column { top: 76px; }
.bottom-grid { gap: 12px; margin-top: 12px; }
.card {
  padding: 13px 14px;
  border-color: #dfe5ed;
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.card h3 {
  min-height: 31px;
  margin: 0 0 11px;
  padding: 0 0 9px;
  border-bottom-color: #e8ecf2;
  color: #202b3c;
  font-size: 14px;
  font-weight: 800;
}
.quote-customer-card { padding-bottom: 11px; }
.quote-customer-card .form-grid { gap: 10px 12px; }
.customer-profile-strip {
  margin-top: 11px;
  padding: 10px 0 0 12px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-left: 3px solid #d8e5fb;
  border-radius: 0;
  background: transparent;
}
.customer-profile-head { color: #344054; font-size: 12px; }
.profile-row { padding: 5px 0; border-bottom-color: #eef1f5; }
.profile-empty { padding: 4px 0 7px; line-height: 1.6; }

.quote-result-card {
  border-color: #b9cdf8;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(37, 99, 235, 0.09);
}
.quote-result-card h3 { color: #173b7a; border-bottom-color: #dce7fb; }
.quote-details-card { border-color: #dbe3ee; }
.quote-support-card {
  border-color: #e0e5ec;
  box-shadow: none;
  background: #fff;
}
.quote-result-column .summary-text {
  min-height: 150px;
  padding: 10px 11px;
  border-color: #dce6f6;
  background: #f8fbff;
  line-height: 1.65;
}
.quote-result-column .summary-grid { gap: 8px; }
.quote-result-column .metric {
  min-height: 66px;
  padding: 10px 11px;
  border-color: #dfe7f2;
  background: #f8fafc;
}
.quote-result-column .metric .value { color: #1849a9; font-size: 20px; }
.metric .value { margin-top: 3px; font-size: 18px; }

.form-grid { gap: 10px 12px; }
.form-grid.compact { gap: 9px 10px; }
.field label {
  margin-bottom: 4px;
  color: #536176;
  font-size: 12px;
  font-weight: 700;
}
.field input,
.field select,
.field textarea {
  min-height: 37px;
  padding: 7px 9px;
  border-color: #cfd8e5;
  border-radius: 6px;
  background: #ffffff;
}
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #aebdce; }
.field input[readonly] { background: #f6f8fb; color: #475467; }
.field textarea { min-height: 68px; }

.param-section {
  margin: 0 0 10px;
  padding: 11px 0 0;
  border: 0;
  border-top: 1px solid #e7ebf1;
  border-radius: 0;
  background: transparent;
}
.quote-form-card .param-section:first-of-type { padding-top: 1px; border-top: 0; }
.section-title {
  margin-bottom: 9px;
  color: #344054;
  font-size: 13px;
}
.section-title::before { width: 3px; height: 13px; border-radius: 2px; }
.actions { gap: 7px; margin-top: 11px; }
.thin-actions {
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.btn {
  min-height: 35px;
  padding: 8px 13px;
  border-color: #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  font-weight: 700;
  box-shadow: none;
}
.btn:hover {
  border-color: #98a7ba;
  background: #f8fafc;
  box-shadow: none;
}
.btn.primary { background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { background: #fff; border-color: #f3b8b3; color: var(--danger); }
.btn.danger:hover { background: #fff4f3; border-color: #e98982; color: var(--danger-dark); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.small { min-height: 29px; padding: 5px 9px; }
.icon-btn { border-radius: 6px; }

.filter-row {
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-soft);
}
.filter-row .field { min-width: 138px; }
.filter-row .btn { margin-bottom: 0; }

.table-wrap {
  border-color: #dbe2eb;
  border-radius: 7px;
  box-shadow: none;
}
table { border-collapse: separate; border-spacing: 0; }
th, td { border-bottom-color: #e8ecf2; }
th {
  height: 38px;
  padding: 8px 10px;
  background: #f6f8fb;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  vertical-align: middle;
}
.data-table td {
  padding: 10px;
  color: #344054;
  line-height: 1.4;
}
.data-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.data-table tbody tr:hover td { background: #f3f7fd; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-wrap > table > thead > tr:first-child > th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.status,
.status-tag,
.protect-badge,
.prediction-status {
  min-height: 24px;
  border-radius: 999px;
  font-weight: 700;
}
.action-cell { flex-wrap: nowrap; gap: 5px; }

/* Keep operational tables readable; narrow viewports scroll instead of crushing columns. */
#inquiryTable { min-width: 1260px; }
#predictionTable { min-width: 1380px; }
#orderTable { min-width: 1660px; }
#productionSourceTable { min-width: 880px; }
#productionTable { min-width: 1060px; }
#logisticsTable { min-width: 1420px; }
#historyTable { min-width: 1760px; }
.order-select-col {
  width: 42px;
  min-width: 42px;
  text-align: center;
}
.order-select-col input { width: 16px; height: 16px; }
.order-copy-groups { display: grid; gap: 10px; }
.order-copy-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  background: #f8fafc;
}
.order-copy-group > div { display: grid; gap: 3px; }
.order-copy-group span { color: #667085; font-size: 12px; }
#inquiryTable td:nth-child(1),
#inquiryTable td:nth-child(2),
#inquiryTable td:nth-child(3),
#inquiryTable td:nth-child(4),
#inquiryTable td:nth-child(7),
#inquiryTable td:nth-child(8),
#inquiryTable td:nth-child(9),
#inquiryTable td:nth-child(10),
#inquiryTable td:nth-child(11),
#inquiryTable td:last-child,
#orderTable td:nth-child(1),
#orderTable td:nth-child(2),
#orderTable td:nth-child(3),
#orderTable td:nth-child(4),
#orderTable td:nth-child(5),
#orderTable td:nth-child(7),
#orderTable td:nth-child(8),
#orderTable td:nth-child(9),
#orderTable td:nth-child(10),
#orderTable td:nth-child(11),
#orderTable td:nth-child(12),
#orderTable td:nth-child(13),
#orderTable td:nth-child(14),
#orderTable td:last-child { white-space: nowrap; }
#inquiryTable td:nth-child(6),
#orderTable td:nth-child(6) {
  min-width: 190px;
  white-space: normal;
  line-height: 1.45;
}

.mini-table { border-color: #e2e7ed; border-radius: 7px; }
.mini-table th { height: 34px; background: #f7f9fb; }
.mini-table th,
.mini-table td { padding: 7px 8px; }
.kv {
  grid-template-columns: 112px minmax(0, 1fr);
  padding: 7px 0;
  border-bottom-color: #edf0f4;
}
.kv:last-child { border-bottom: 0; }
.pre {
  border-color: #dfe5ec;
  border-radius: 7px;
  background: #f8fafc;
}

.production-board-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.production-board-grid > .card { box-shadow: none; }
.production-board-grid .table-wrap { overflow: visible; }
.production-board-grid table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.repeat-order-note {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  color: #9a6700;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.production-followup-card { padding-bottom: 15px; }
.production-followup-card .filter-row { margin-bottom: 12px; }
.followup-table {
  width: 100%;
  min-width: 1280px;
}
.followup-table th,
.followup-table td { font-size: 12px; }
.followup-table .process-cell {
  width: auto;
  min-width: 0;
  padding: 5px 4px !important;
}
.process-chip { border-radius: 4px; }
.process-done { background: #67c23a; border-color: #55aa30; color: #12320b; }
.followup-mini-select { border-radius: 5px; }
.followup-mini-select.payment-warning {
  border-color: #f0b429;
  background: #fff7d6;
  color: #7a4d00;
  font-weight: 800;
}
.followup-note-input {
  width: 100%;
  min-width: 180px;
  height: 30px;
  padding: 4px 7px;
  border-color: #d7dee8;
  background: #fff;
  font-size: 12px;
}
.followup-note-input:focus { background: #fffef5; }
.followup-note-input.saved {
  border-color: #51a846;
  background: #f0faee;
}

.logistics-artwork-preview {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 8px;
  border: 1px solid #dfe5ec;
  border-radius: 7px;
  background: #f8fafc;
}
.logistics-pickup-cell { min-width: 260px; }
.logistics-pickup-cell pre {
  margin: 0 0 7px;
  color: #344054;
  font: inherit;
  line-height: 1.55;
  white-space: pre-wrap;
}

.modal-backdrop { background: rgba(16, 24, 40, 0.46); backdrop-filter: blur(3px); }
.modal {
  border-color: #d7dee8;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.24);
}
.modal-header,
.modal-footer { padding: 13px 16px; background: #fafbfc; }
.modal-title { color: #1d2939; font-size: 15px; }
.modal-body { padding: 15px 16px 17px; gap: 12px; }
.modal-section { padding: 13px; border-color: #e2e7ed; border-radius: 7px; }
.deal-options-row { padding: 9px 10px; border-radius: 7px; background: #f7f9fc; }
.deal-check-option { border-radius: 6px; }

.toast { border-radius: 7px; background: #1d2939; }
.notice,
.dialog-message { border-radius: 7px; }

.login-screen {
  position: relative;
  background: #f2f5f9;
}
.login-legal {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  color: #7b8798;
  font-size: 12px;
}
.login-legal a { color: inherit; text-decoration: none; }
.login-legal a:hover { color: #245ebd; }
.login-card {
  width: min(400px, 94vw);
  padding: 26px;
  border-color: #dce3ec;
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.12);
}
.login-card::before {
  content: "内部运营工作台";
  display: inline-flex;
  margin-bottom: 12px;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
}
.login-card h1 { color: #162033; font-size: 21px; }

@media (max-width: 1440px) {
  .quote-grid { grid-template-columns: minmax(650px, 1.65fr) minmax(370px, 1fr); }
  .quote-customer-card .form-grid { grid-template-columns: repeat(3, minmax(118px, 1fr)); }
}

@media (max-width: 1180px) {
  .quote-grid,
  .bottom-grid { grid-template-columns: 1fr; }
  .quote-result-column { position: static; }
  .quote-customer-card .form-grid,
  .form-grid,
  .form-grid.compact { grid-template-columns: repeat(3, minmax(100px, 1fr)); }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 88px minmax(0, 1fr); }
  .sidebar { padding: 14px 7px; }
  .menu-item { padding-inline: 4px; font-size: 12px; }
  .flyout { left: 76px; }
  .topbar { padding: 0 14px; }
  .topbar .title { font-size: 15px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn { padding-inline: 8px; }
  .content { padding: 14px 12px 24px; }
  .quote-customer-card .form-grid,
  .form-grid,
  .form-grid.compact,
  .modal-grid { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .span-3,
  .span-4 { grid-column: 1 / -1; }
}
