/* MiSans by Xiaomi Inc. Used under the MiSans font license. */
@layer reset, tokens, legacy, summary, utilities;

@font-face {
  font-family: "MiSans";
  src: url("/fonts/misans/MiSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MiSans";
  src: url("/fonts/misans/MiSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MiSans";
  src: url("/fonts/misans/MiSans-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MiSans";
  src: url("/fonts/misans/MiSans-Bold.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MiSans Latin";
  src: url("/fonts/misans/MiSansLatin-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MiSans Latin";
  src: url("/fonts/misans/MiSansLatin-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MiSans Latin";
  src: url("/fonts/misans/MiSansLatin-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MiSans Latin";
  src: url("/fonts/misans/MiSansLatin-Bold.woff2") format("woff2");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f4ec;
  --card: #ffffff;
  --text: #26352c;
  --muted: #6f746e;
  --line: #e8e0d2;
  --brand: #26352c;
  --brand-dark: #2b2b2b;
  --brand-soft: #f2eee4;
  --warn: #d97706;
  --green: #16a34a;
  --shadow: 0 12px 28px rgba(38, 53, 44, 0.08);
  --order-toolbar-height: 34px;
  --order-header-height: 32px;
  --order-row-height: 27px;
  --summary-table-row-height: 28px;
  --order-group-height: 29px;
  --order-tag-height: 18px;
  --order-left-panel-width: 438px;
  --order-day-width: 34px;
  --order-gantt-bar-height: 20px;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}
body {
  margin: 0;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "MiSans Latin", "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.shell { width: 100%; min-height: 100vh; max-width: 1160px; margin: 0 auto; padding: 28px 24px 56px; }
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(23, 184, 189, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}
.brand { color: var(--brand-dark); font-size: 18px; font-weight: 900; }
h1 { margin: 8px 0 0; font-size: 32px; letter-spacing: 0; }
.desc { margin-top: 8px; color: var(--muted); font-size: 14px; }
.pill { padding: 8px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 13px; font-weight: 800; white-space: nowrap; }

.tabs { position: relative; z-index: 2; display: flex; gap: 10px; margin-bottom: 18px; }
.tab {
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f4ec;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}
.tab.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); box-shadow: 0 6px 16px rgba(23, 184, 189, 0.12); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-title { padding: 17px 20px; border-bottom: 1px solid var(--line); background: #fbfcfd; font-size: 16px; font-weight: 900; }
.panel-body { padding: 16px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; color: #263442; font-size: 13px; font-weight: 900; }
input, select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d4dce2;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  outline: none;
}
input[type="date"] { cursor: pointer; }
textarea { min-height: 68px; padding: 9px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 184, 189, 0.14); }
input::placeholder, textarea::placeholder { color: #9ca3af; font-weight: 500; }
.order-form-sections { display: grid; gap: 12px; }
.form-section {
  padding: 14px 16px;
  border: 1px solid #d9e2e6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(31, 45, 55, 0.035);
}
.form-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; padding-bottom: 9px; border-bottom: 1px solid #e4e8ec; }
.form-section-title { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; color: #17212b; font-size: 15px; font-weight: 900; }
.form-section-title::before { width: 3px; height: 14px; border-radius: 3px; background: var(--brand); content: ""; }
.form-section-desc { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.45; }
.form-field { min-width: 0; padding: 1px; border-radius: 8px; }
.required-mark { margin-left: 4px; color: #dc2626; font-weight: 900; }
.optional-mark { margin-left: 6px; color: #9ca3af; font-size: 11px; font-weight: 700; }
.form-field.has-error { padding: 8px; border: 1px solid #ef4444; background: #fff7f7; }
.form-field.has-error label { color: #b91c1c; }
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: #ef4444; background: #ffffff; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.09); }
.required-summary {
  display: none;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}
.required-summary.visible { display: block; }
.region-field { max-width: 560px; }
.region-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; }
.quick-btn { height: 38px; padding: 0 10px; white-space: nowrap; }
button {
  height: 42px;
  touch-action: manipulation;
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
button:hover { background: var(--brand-dark); box-shadow: 0 8px 18px rgba(23, 184, 189, 0.18); transform: translateY(-1px); }
button.secondary { background: #eef0f3; color: var(--text); }
button.secondary:hover { background: #e2e5e9; }

.calc-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.calc-row.two { grid-template-columns: repeat(2, 1fr); }
.calc-box { padding: 12px 14px; border-radius: 8px; background: #f7fbfb; border: 1px solid #dbeff0; }
.calc-label { color: #4b5563; font-size: 12px; font-weight: 800; }
.calc-value { margin-top: 5px; font-size: 17px; font-weight: 900; }
.rent-calculator { margin-bottom: 12px; padding: 14px 16px; border: 1px solid #dbeff0; border-radius: 10px; background: linear-gradient(180deg, #fbffff, #f7fbfb); }
.calculator-title { margin-bottom: 10px; font-size: 15px; font-weight: 900; }
.checkbox-row { display: flex; gap: 8px; align-items: center; height: 38px; color: var(--text); font-size: 14px; font-weight: 700; }
.checkbox-row input { width: 16px; min-height: 16px; height: 16px; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions button { min-width: 150px; }
.status { margin-top: 12px; color: var(--muted); font-size: 13px; min-height: 18px; }

.search-card { padding: 18px; }
.search-row { display: grid; grid-template-columns: 1fr 120px 120px; gap: 12px; }
.layout { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
.list { min-height: 120px; max-height: 320px; overflow: auto; }
.empty { padding: 28px 18px; color: var(--muted); font-size: 14px; }
.result-item { display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(130px, 0.9fr) minmax(110px, 0.7fr) minmax(150px, 1fr) minmax(150px, 1fr); gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background 0.12s ease, border-left-color 0.12s ease; border-left: 3px solid transparent; font-size: 13px; }
.result-item:hover, .result-item.active { background: #f0fbfc; border-left-color: var(--brand); }
.result-item.header { position: sticky; top: 0; z-index: 1; background: #fbfcfd; color: var(--muted); cursor: default; font-size: 12px; font-weight: 900; }
.result-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-main { font-weight: 900; color: var(--text); }
.order-no { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.tag { flex: 0 0 auto; color: var(--brand-dark); font-size: 12px; font-weight: 800; }
.result-meta { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.result-brief { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.result-brief div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-status { display: flex; gap: 6px; flex-wrap: wrap; }
.mini-chip { max-width: 100%; padding: 3px 7px; border-radius: 999px; background: #eef0f3; color: var(--muted); font-size: 11px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-chip.warn { background: #fff7ed; color: #c2410c; }
.mini-chip.green { background: #ecfdf5; color: #15803d; }

.detail { padding: 18px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.detail-grid .full { grid-column: 1 / -1; }
.field { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.field:last-child { border-bottom: 0; }
.label { color: var(--muted); }
.value { font-weight: 650; word-break: break-word; }
.value.green { color: var(--green); }
.value.warn { color: var(--warn); }
.link-box { margin-top: 18px; padding: 16px; border-radius: 8px; background: #fbfcfd; border: 1px solid var(--line); }
.link-label { color: var(--muted); font-size: 13px; }
.link-value { margin-top: 8px; font-size: 13px; line-height: 1.5; word-break: break-all; }
.message-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.copy-tip { margin-top: 10px; color: var(--brand-dark); font-size: 13px; font-weight: 800; }
.risk-action-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: center; margin-top: 18px; }
.risk-reminder { padding: 10px 12px; border: 1px solid #fed7aa; border-radius: 6px; background: #fff7ed; color: #c2410c; font-size: 13px; font-weight: 800; line-height: 1.5; }
#createdOrderPanel .link-box { border-color: #c7ecee; background: #f7ffff; }
.operation-box { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.operation-title { margin-bottom: 10px; font-size: 14px; font-weight: 900; }
.operation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.operation-grid .full { grid-column: 1 / -1; }
.operation-grid button { width: 100%; }
.deposit-test-box { margin-top: 18px; padding: 16px; border: 1px solid #cdebed; border-radius: 8px; background: #f7ffff; }
.deposit-test-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.deposit-test-title { font-size: 15px; font-weight: 900; }
.deposit-test-desc { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.deposit-sync-badge { padding: 5px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 900; white-space: nowrap; }
.deposit-sync-badge.pending { background: #fff7ed; color: #c2410c; }
.deposit-sync-badge.failed { background: #fef2f2; color: #b91c1c; }
.deposit-test-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.deposit-test-actions button { width: 100%; }
.deposit-test-actions .pass { background: #16a34a; }
.deposit-test-actions .fail { background: #dc2626; }
.deposit-test-actions .timeout { background: #d97706; }
.deposit-history { display: grid; gap: 8px; margin-top: 14px; }
.deposit-event { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.deposit-event-head { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; font-weight: 900; }
.deposit-event-meta { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; word-break: break-word; }
.deposit-history-empty { margin-top: 14px; color: var(--muted); font-size: 12px; }
.reply-assistant { margin-top: 18px; padding: 16px; border: 1px solid #cdebed; border-radius: 8px; background: #f7ffff; }
.reply-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.reply-title { font-size: 15px; font-weight: 900; }
.reply-desc { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.reply-badge { padding: 5px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 11px; font-weight: 900; white-space: nowrap; }
.reply-question-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reply-question { height: 34px; padding: 0 12px; border: 1px solid #cfe6e8; border-radius: 999px; background: #ffffff; color: #52616d; font-size: 12px; font-weight: 800; }
.reply-question:hover, .reply-question.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); box-shadow: none; transform: none; }
.reply-output { min-height: 132px; margin-top: 14px; background: #ffffff; line-height: 1.7; }
.reply-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.reply-actions button { min-width: 150px; }
.reply-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.backup-grid { display: grid; grid-template-columns: minmax(240px, 1.7fr) repeat(3, minmax(120px, 1fr)); gap: 14px; margin-bottom: 18px; }
.backup-card { padding: 16px; border: 1px solid #dbeff0; border-radius: 8px; background: #f7fbfb; }
.backup-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.backup-value { margin-top: 8px; font-size: 18px; font-weight: 900; word-break: break-word; }
.backup-path-value {
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: normal;
}
.backup-value.ok { color: var(--green); }
.backup-log { margin-top: 12px; padding: 14px; min-height: 180px; border-radius: 8px; background: #111827; color: #d1d5db; font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow: auto; }
.backup-list { margin-top: 12px; display: grid; gap: 8px; }
.backup-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 180px; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.log-toolbar { display: grid; grid-template-columns: 160px minmax(220px, 1fr) 110px; gap: 10px; margin-bottom: 16px; }
.activity-list { display: grid; gap: 8px; }
.duplicate-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.duplicate-toolbar button { min-width: 128px; }
.duplicate-list { display: grid; gap: 10px; }
.duplicate-group {
  border: 1px solid #dbe7dd;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.duplicate-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fbf8;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
.duplicate-group summary::-webkit-details-marker { display: none; }
.duplicate-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7ef;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}
.duplicate-records { display: grid; gap: 8px; padding: 10px 14px 14px; }
.duplicate-record {
  border: 1px solid #e5eee8;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}
.duplicate-record.keep {
  border-color: #b8e0c4;
  background: #f5fbf7;
}
.duplicate-record-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}
.duplicate-record-title {
  display: block;
}
.duplicate-record-id {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.duplicate-record-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.duplicate-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.activity-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.activity-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #94a3b8; }
.activity-row.success .activity-dot { background: #16a34a; }
.activity-row.warning .activity-dot { background: #d97706; }
.activity-row.error { border-color: #fecaca; background: #fffafa; }
.activity-row.error .activity-dot { background: #dc2626; }
.activity-title { font-size: 14px; font-weight: 900; }
.activity-detail { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.activity-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 11px; text-align: right; }
.activity-order { padding: 3px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; font-weight: 800; white-space: nowrap; }
.activity-summary { margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.activity-section { margin-top: 18px; }
.activity-section:first-child { margin-top: 0; }
.activity-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.activity-section-title { font-size: 15px; font-weight: 900; color: #172033; }
.activity-section-note { color: var(--muted); font-size: 12px; }
.status-rules-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.status-rules-toolbar button { min-width: 116px; }
.status-rules-list { display: grid; gap: 12px; }
.status-rule-card {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #dbeff0;
  border-radius: 10px;
  background: #fbfffd;
}
.status-rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.status-rule-title { color: #172033; font-size: 15px; font-weight: 900; }
.status-rule-source {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eaf8f3;
  color: #1f6f5c;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.status-rule-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #4a5568;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f1f5f9;
  color: #243044;
  font-size: 12px;
  font-weight: 800;
}
.status-chip.primary {
  border-color: #bfe7dc;
  background: #eaf8f3;
  color: #1f6f5c;
}
.status-chip.deposit {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}
.status-rule-arrow { color: #8aa09c; font-weight: 900; }
.status-rule-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.status-side-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}
.activity-system-errors {
  padding: 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fffafa;
}
.activity-normal-sync {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}
.activity-normal-sync summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}
.activity-normal-sync summary::-webkit-details-marker { display: none; }
.activity-normal-sync-list { display: grid; gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.activity-normal-sync-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.recent-entry-card { margin-top: 18px; }
.recent-entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recent-entry-actions { display: flex; gap: 6px; align-items: center; }
.recent-entry-head button { min-width: 76px; height: 34px; padding: 0 12px; }
.write-queue-summary {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fffaf0;
  color: #6b5330;
  font-size: 12px;
  line-height: 1.45;
}
.write-queue-summary.clean {
  background: #f8fbf9;
  color: #637166;
}
.write-queue-summary.attention {
  background: #fff7ed;
  color: #92400e;
}
.write-queue-title { font-weight: 900; color: var(--text); }
.write-queue-list { display: grid; gap: 4px; }
.write-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.write-queue-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.write-queue-state {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(146, 64, 14, .12);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.write-queue-state.failed { background: rgba(220, 38, 38, .1); color: #b91c1c; }
.write-queue-state.dead_letter { background: rgba(127, 29, 29, .12); color: #7f1d1d; }
.write-queue-actions-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.write-queue-actions-inline button { min-height: 30px; padding: 0 10px; }
.write-queue-small-action { min-height: 26px; padding: 0 8px; font-size: 11px; }
.recent-entry-table { overflow-x: auto; }
.recent-entry-row {
  display: grid;
  grid-template-columns: 150px 92px 150px 130px 100px 110px 110px 90px 130px 90px;
  gap: 10px;
  align-items: center;
  min-width: 1200px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.recent-entry-row.header { background: #fbfcfd; color: var(--muted); font-weight: 900; }
.recent-entry-row:last-child { border-bottom: 0; }
.recent-entry-status { font-weight: 900; }
    .recent-entry-status.success { color: var(--green); }
    .recent-entry-status.failed { color: #dc2626; }
    .recent-entry-status.pending { color: var(--warn); }
    .recent-entry-status.queued { color: #b7791f; }
    .health-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid #d9eeee;
  border-radius: 8px;
  background: #f7fbfb;
}
.health-overview.warning { border-color: #fed7aa; background: #fffbeb; }
.health-overview.error { border-color: #fecaca; background: #fff7f7; }
.health-overview-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.health-overview-dot { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12); }
.health-overview.warning .health-overview-dot { background: #d97706; box-shadow: 0 0 0 6px rgba(217, 119, 6, 0.12); }
.health-overview.error .health-overview-dot { background: #dc2626; box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.12); }
.health-overview-title { font-size: 19px; font-weight: 900; }
.health-overview-meta { margin-top: 5px; color: var(--muted); font-size: 12px; }
.health-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.health-actions button { min-width: 108px; }
.health-check-list { display: grid; gap: 10px; margin-top: 16px; }
.health-check {
  display: grid;
  grid-template-columns: 12px minmax(160px, .7fr) minmax(240px, 1.6fr) minmax(180px, .8fr);
  gap: 14px;
  align-items: start;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.health-check.warning { border-color: #fed7aa; background: #fffdfa; }
.health-check.error { border-color: #fecaca; background: #fffafa; }
.health-check-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #16a34a; }
.health-check.warning .health-check-dot { background: #d97706; }
.health-check.error .health-check-dot { background: #dc2626; }
.health-check-title { font-size: 14px; font-weight: 900; }
.health-check-status { margin-top: 5px; color: var(--green); font-size: 12px; font-weight: 900; }
.health-check.warning .health-check-status { color: #b45309; }
.health-check.error .health-check-status { color: #b91c1c; }
.health-check-summary { font-size: 13px; font-weight: 800; line-height: 1.55; }
.health-check-detail { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.health-check-action { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.55; }
.health-action-status { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid rgba(23, 184, 189, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}
.auth-brand { color: var(--brand-dark); font-size: 18px; font-weight: 900; }
.auth-title { margin: 8px 0 6px; font-size: 26px; font-weight: 900; }
.auth-desc { margin-bottom: 20px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.auth-form { display: grid; gap: 14px; }
.auth-form button { width: 100%; margin-top: 4px; }
.auth-error { min-height: 18px; color: #dc2626; font-size: 13px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.login-state { color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; }
.logout-btn { min-width: 76px; height: 36px; padding: 0 12px; background: #eef0f3; color: var(--text); }
.logout-btn:hover { background: #e2e5e9; }
.sync-health {
  display: grid;
  grid-template-columns: minmax(230px, 1.3fr) minmax(420px, 2fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #d9eeee;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.06);
}
.sync-health.warning { border-color: #fed7aa; background: #fffbeb; }
.sync-health.working { border-color: #bfdbfe; background: #f8fbff; }
.sync-health.error { border-color: #fecaca; background: #fff7f7; }
.sync-health-main { display: flex; gap: 11px; align-items: center; min-width: 0; }
.sync-health-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.13); }
.sync-health.healthy .sync-health-dot { background: #16a34a; box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.12); }
.sync-health.working .sync-health-dot { background: #2f6fed; box-shadow: 0 0 0 5px rgba(47, 111, 237, 0.12); }
.sync-health.warning .sync-health-dot { background: #d97706; box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.12); }
.sync-health.error .sync-health-dot { background: #dc2626; box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.12); }
.sync-health-title { font-size: 14px; font-weight: 900; }
.sync-health-message { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.sync-health.error .sync-health-message { color: #b91c1c; font-weight: 700; }
.sync-health-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sync-health-metric { min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.sync-health-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.sync-health-value { margin-top: 4px; font-size: 13px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-health-refresh { min-width: 88px; height: 36px; padding: 0 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none; }
@media (max-width: 880px) {
  .shell { width: 100%; padding: 14px 10px 42px; }
  .top { padding: 16px; margin-bottom: 12px; }
  .top { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 26px; }
  .desc { line-height: 1.55; }
  .top-actions { width: 100%; justify-content: flex-start; }
  .tabs {
    gap: 8px;
    margin-top: 2px;
    margin-bottom: 12px;
    padding: 7px 1px 5px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; height: 42px; padding: 0 16px; }
  .panel-title { padding: 15px 14px; }
  .panel-body, .detail, .search-card { padding: 14px; }
  .form-section { padding: 14px; }
  .form-section-head { display: block; margin-bottom: 12px; }
  .form-section-desc { margin-top: 5px; }
  .layout, .grid, .calc-row, .detail-grid { grid-template-columns: 1fr; }
  .search-row { grid-template-columns: 1fr; }
  .backup-grid { grid-template-columns: 1fr; }
  .backup-row { grid-template-columns: 1fr; }
  .log-toolbar { grid-template-columns: 1fr; }
  .status-rules-toolbar { align-items: stretch; flex-direction: column; }
  .activity-row { grid-template-columns: 14px minmax(0, 1fr); }
  .duplicate-group summary { align-items: flex-start; flex-direction: column; }
  .duplicate-record-meta { grid-template-columns: 1fr 1fr; }
  .activity-meta { grid-column: 2; justify-content: flex-start; text-align: left; flex-wrap: wrap; }
  .result-item { grid-template-columns: 1fr; gap: 6px; }
  .result-item.header { display: none; }
  input, select, textarea {
    min-width: 0;
    font-size: 16px;
  }
  button { font-size: 15px; }
  .region-field { max-width: none; }
  .region-row, .risk-action-row, .operation-grid { grid-template-columns: 1fr; }
  .deposit-test-actions { grid-template-columns: 1fr; }
  .actions, .reply-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .actions button, .reply-actions button { width: 100%; min-width: 0; }
  .field { grid-template-columns: 82px minmax(0, 1fr); gap: 10px; }
  .link-value, .value { overflow-wrap: anywhere; }
  .auth-screen { padding: 14px; }
  .auth-card { padding: 22px 18px; }
  .sync-health { grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; box-shadow: 0 6px 16px rgba(31, 41, 51, 0.05); }
  .sync-health-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-health-refresh { width: 100%; }
  .health-overview { align-items: flex-start; flex-direction: column; }
  .health-actions { width: 100%; justify-content: stretch; }
  .health-actions button { flex: 1 1 120px; }
  .health-check { grid-template-columns: 12px minmax(0, 1fr); }
  .health-check > div:nth-child(3),
  .health-check-action { grid-column: 2; }
  .health-check-action { padding: 10px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}
.watermark-layer {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: none;
  pointer-events: none;
  overflow: hidden;
}
.watermark-layer.visible { display: block; }
.watermark-grid {
  position: absolute;
  inset: -20%;
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 110px 55px;
  align-content: start;
  transform: rotate(-18deg);
  opacity: .11;
  color: #273947;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.account-form { display: grid; grid-template-columns: 1fr 1.4fr 1fr 1.4fr auto; gap: 12px; align-items: end; }
.account-module-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}
.account-module-picker > label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.account-module-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.account-module-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(39, 115, 76, .18);
  border-radius: 999px;
  background: #fff;
  color: #33443a;
  font-size: 13px;
}
.account-module-option input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}
.account-list { margin-top: 18px; display: grid; gap: 10px; }
.account-row { display: grid; grid-template-columns: .8fr 1fr 1fr .8fr 1.2fr auto; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.account-row-main { display: contents; }
.account-row-modules {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(24, 33, 27, .07);
}
.account-row-modules-label {
  color: var(--muted);
  font-size: 12px;
}
.account-row-wecom {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid rgba(24, 33, 27, .07);
  color: #34443c;
  font-size: 12px;
}
.account-row-wecom-label {
  color: var(--muted);
  font-size: 12px;
}
.account-row-wecom-code {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.account-row-wecom .muted {
  color: var(--muted);
}
.account-row-module-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.account-module-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef6f1;
  color: #286045;
  font-size: 12px;
  font-weight: 700;
}
.account-module-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #f8faf8;
}
.account-status.active { color: var(--green); }
.account-status.disabled { color: #dc2626; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.account-actions button { min-width: auto; height: 34px; padding: 0 12px; }
.account-action-panel {
  position: fixed;
  z-index: 10010;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(24, 33, 27, .28);
}
.account-action-card {
  display: grid;
  gap: 14px;
  width: min(420px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(24, 33, 27, .18);
}
.account-action-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}
.account-action-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.account-action-card input {
  width: 100%;
}
.account-action-help {
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}
.account-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.account-action-buttons button {
  min-width: 82px;
}
@media (max-width: 900px) {
  .account-form, .account-row { grid-template-columns: 1fr; }
  .account-actions { justify-content: flex-start; }
  .watermark-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); }
}

/* Task-focused operations console */
:root {
  --bg: #f4f6f4;
  --card: #ffffff;
  --text: #18211b;
  --muted: #6e7871;
  --line: #dfe5e0;
  --brand: #326b49;
  --brand-dark: #28593c;
  --brand-soft: #edf5ef;
  --shadow: 0 8px 24px rgba(28, 44, 33, 0.055);
}
.shell {
  max-width: none;
  padding: 0;
  display: grid;
  grid-template-columns: 208px minmax(540px, 1fr) 286px;
  align-items: start;
  background: var(--bg);
}
.sidebar-collapse-btn {
  width: 34px;
  height: 30px;
  min-width: 34px;
  padding: 0;
  margin: 0 0 10px;
  border-radius: 6px;
  color: #26352c;
  background: #fffcf5;
  box-shadow: none;
}
.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}
.top {
  display: block;
  margin: 0 0 24px;
  padding: 8px 8px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.top .brand { color: var(--brand); font-size: 14px; letter-spacing: 0; }
.top h1 { margin-top: 4px; font-size: 23px; line-height: 1.2; }
.top .desc { margin-top: 6px; font-size: 12px; }
.top-actions {
  display: grid;
  justify-content: stretch;
  gap: 7px;
  margin-top: 18px;
}
.top-actions .pill { width: max-content; padding: 5px 8px; font-size: 10px; }
.login-state { overflow: hidden; color: #4f5d53; font-size: 11px; text-overflow: ellipsis; }
.logout-btn { width: 100%; height: 34px; }
.tabs {
  display: grid;
  gap: 18px;
  margin: 0;
}
.tab {
  position: relative;
  width: 100%;
  height: 40px;
  padding: 0 12px 0 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #657168;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none;
}
.tab::before {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 6px;
  height: 6px;
  border: 1.5px solid #8a968d;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}
.tab:hover { background: #f0f4f1; color: var(--text); box-shadow: none; transform: none; }
.tab.active {
  border: 0;
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: inset 3px 0 0 var(--brand);
}
.tab.active::before { border-color: var(--brand); background: var(--brand); }
.nav-count-badge {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #ffe1df;
  color: #b3312d;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  transform: translateY(-50%);
}
.tab.has-risk-badge {
  padding-right: 38px;
}
.workspace-main {
  min-width: 0;
  padding: 20px 18px 48px;
}
.workspace-context {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding: 2px 2px 13px;
  border-bottom: 1px solid var(--line);
}
.workspace-eyebrow { color: var(--brand); font-size: 11px; font-weight: 900; }
.workspace-context h2 { margin: 3px 0 0; font-size: 21px; line-height: 1.2; }
.workspace-description { margin-top: 5px; color: var(--muted); font-size: 12px; }
.workspace-hint { color: #8b958e; font-size: 11px; white-space: nowrap; }
.workspace-content { min-width: 0; }
.workspace-aside {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  padding: 20px 16px 20px 0;
  overflow-y: auto;
}
.card {
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: none;
}
.panel-title {
  padding: 12px 14px;
  background: #fafbfa;
  font-size: 14px;
}
.panel-body, .detail, .search-card { padding: 14px; }
#createView > .panel-title { display: none; }
.rent-calculator {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-color: #dce6df;
  border-radius: 6px;
  background: #f8faf8;
}
.calculator-title { margin-bottom: 8px; font-size: 13px; }
.order-form-sections { gap: 9px; }
.form-section {
  padding: 11px 13px 13px;
  border-color: var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}
.form-section-head {
  gap: 8px;
  margin-bottom: 9px;
  padding-bottom: 7px;
}
.form-section-title { font-size: 13px; }
.form-section-title::before { width: 2px; height: 12px; }
.form-section-desc { font-size: 11px; }
.grid { gap: 9px 11px; }
label { margin-bottom: 4px; font-size: 12px; }
input, select, textarea { min-height: 36px; font-size: 13px; }
textarea { min-height: 58px; }
button { height: 38px; border-radius: 5px; font-size: 13px; }
.actions { margin-top: 10px; }
.calc-row { gap: 8px; margin-top: 9px; }
.calc-box { padding: 9px 11px; border-radius: 5px; }
.calc-label { font-size: 11px; }
.calc-value { margin-top: 3px; font-size: 15px; }
.search-card { border-radius: 6px; }
.layout { gap: 12px; margin-top: 12px; }
.workspace-aside .sync-health {
  display: block;
  margin: 0 0 12px;
  padding: 13px;
  border-color: var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
}
.workspace-aside .sync-health-main { align-items: flex-start; }
.workspace-aside .sync-health-message { margin-top: 5px; }
.workspace-aside .sync-health-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.workspace-aside .sync-health-metric {
  padding: 8px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 0;
}
.workspace-aside .sync-health-metric:nth-child(2n) { border-right: 0; }
.workspace-aside .sync-health-metric:nth-last-child(-n+2) { border-bottom: 0; }
.workspace-aside .sync-health-refresh { width: 100%; margin-top: 10px; }
.workspace-aside .recent-entry-card { margin: 0; }
.workspace-aside .recent-entry-head { padding: 11px 12px; }
.workspace-aside .recent-entry-actions { gap: 5px; }
.workspace-aside .recent-entry-head button { min-width: 52px; height: 30px; padding: 0 8px; font-size: 11px; }
.workspace-aside .write-queue-summary { padding: 9px 11px; font-size: 11px; }
.workspace-aside .recent-entry-table { max-height: calc(100vh - 330px); overflow: auto; }
.workspace-aside .recent-entry-row.header { display: none; }
.workspace-aside .recent-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 8px;
  min-width: 0;
  padding: 10px 11px;
  font-size: 11px;
}
.workspace-aside .recent-entry-row > div:nth-child(1) { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }
.workspace-aside .recent-entry-row > div:nth-child(2) { color: var(--accent); font-weight: 900; }
.workspace-aside .recent-entry-row > div:nth-child(3) { font-weight: 900; }
.workspace-aside .recent-entry-row > div:nth-child(5) { color: var(--muted); text-align: right; }
.workspace-aside .recent-entry-row > div:nth-child(9) { grid-column: 1 / -1; }
.workspace-aside .recent-entry-row > div:nth-child(4),
.workspace-aside .recent-entry-row > div:nth-child(6),
.workspace-aside .recent-entry-row > div:nth-child(7),
.workspace-aside .recent-entry-row > div:nth-child(8),
.workspace-aside .recent-entry-row > div:nth-child(10) { display: none; }
.watermark-grid {
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 165px 120px;
  opacity: .052;
  font-size: 13px;
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .workspace-aside {
    position: static;
    grid-column: 2;
    height: auto;
    padding: 0 18px 40px;
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 12px;
    overflow: visible;
  }
  .workspace-aside .recent-entry-table { max-height: 300px; }
  .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { display: block; min-height: 100vh; }
  .app-sidebar {
    position: sticky;
    top: 0;
    min-height: 0;
    padding: 9px 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 4px 2px 8px;
    border-bottom: 0;
  }
  .top .brand { display: none; }
  .top h1 { margin: 1px 0 0; font-size: 17px; white-space: nowrap; }
  .top .desc, .top-actions .pill { display: none; }
  .top-actions { display: flex; flex: 0 0 auto; width: auto; align-items: center; justify-content: flex-end; gap: 7px; margin: 0; }
  .login-state { max-width: 120px; }
  .logout-btn { width: auto; min-width: 52px; height: 32px; }
  .tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; width: auto; height: 36px; padding: 0 12px; }
  .tab::before { display: none; }
  .tab.active { box-shadow: inset 0 -2px 0 var(--brand); }
  .workspace-main { padding: 13px 10px 24px; }
  .workspace-context { margin-bottom: 10px; padding: 0 2px 10px; }
  .workspace-context h2 { font-size: 19px; }
  .workspace-description { line-height: 1.45; }
  .workspace-hint { display: none; }
  .workspace-aside {
    display: block;
    padding: 0 10px 30px;
  }
  .workspace-aside .sync-health { margin-bottom: 10px; }
  .workspace-aside .recent-entry-table { max-height: 280px; }
  .backup-grid { grid-template-columns: 1fr; }
  .form-section-head { display: block; }
  .form-section-desc { margin-top: 4px; }
  .watermark-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 190px 120px;
    opacity: .045;
  }
}
/* Feishu-inspired compact order entry sheet */
.sheet-create-view {
  overflow: visible;
  border: 0;
  background: transparent;
}
.sheet-create-view > .panel-body { padding: 0; }
.sheet-calculator {
  margin-bottom: 12px;
  border: 1px solid #dfe5e1;
  border-radius: 7px;
  background: #fff;
}
.sheet-calculator summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 46px;
  padding: 0 13px;
  cursor: pointer;
  list-style: none;
}
.sheet-calculator summary::-webkit-details-marker { display: none; }
.sheet-calculator summary strong { font-size: 13px; }
.sheet-calculator summary small { margin-left: 8px; color: var(--muted); font-size: 11px; font-weight: 500; }
.sheet-summary-result { display: flex; align-items: center; gap: 10px; }
.sheet-summary-result b { color: var(--brand); font-size: 13px; }
.sheet-summary-result i { color: #8d9790; font-size: 10px; font-style: normal; }
.sheet-calculator-body { padding: 10px 13px 12px; border-top: 1px solid var(--line); }
.calculator-fields {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(170px, 1fr) minmax(145px, .8fr) minmax(145px, .8fr) auto;
  gap: 8px;
  align-items: end;
}
.sheet-tool-field { min-width: 0; }
.sheet-tool-field label { color: #69756d; font-size: 10px; }
.sheet-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #4e5c53;
  font-size: 11px;
}
.sheet-check input { width: 15px; min-height: 15px; accent-color: var(--brand); }
.calculator-apply { min-width: 92px; }
.calculator-results {
  display: flex;
  gap: 18px;
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 5px;
  background: #f5f8f6;
  color: #738078;
  font-size: 11px;
}
.calculator-results b { margin-left: 5px; color: var(--text); font-size: 12px; }
.entry-sheet {
  border: 1px solid #d9dfdb;
  border-radius: 7px;
  background: #fff;
  overflow: visible;
}
.pending-confirm-panel {
  margin-top: 12px;
  border: 1px solid #f1c3af;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff8f4 0%, #fff 46%);
  box-shadow: 0 10px 26px rgba(194, 65, 12, .08);
  overflow: hidden;
}
.pending-confirm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  background: rgba(255, 247, 237, .9);
  border-bottom: 1px solid #fed7aa;
}
.pending-confirm-toolbar > div {
  min-width: 0;
}
.pending-confirm-toolbar strong { display: block; font-size: 13px; color: #9a3412; }
.pending-confirm-toolbar strong::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 99px;
  background: #ea580c;
  box-shadow: 0 0 0 4px rgba(234, 88, 12, .12);
  vertical-align: 1px;
}
.pending-confirm-toolbar span { color: #8a948d; font-size: 10px; }
.pending-confirm-toolbar button {
  flex: 0 0 auto;
  min-width: 56px;
  height: var(--order-row-height);
  padding: 0 10px;
  font-size: 11px;
  white-space: nowrap;
}
.pending-confirm-list { max-height: 320px; overflow: auto; }
.pending-confirm-item {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1.4fr .8fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #eef1ef;
  background: rgba(255, 255, 255, .76);
  cursor: pointer;
}
.pending-confirm-item:hover { background: #fff7ed; }
.pending-confirm-item.active { background: #fff1e8; box-shadow: inset 4px 0 0 #ea580c; }
.pending-confirm-main { font-size: 12px; font-weight: 900; color: var(--text); }
.pending-confirm-sub { margin-top: 2px; color: #809087; font-size: 10px; }
.pending-confirm-status {
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.pending-confirm-empty { padding: 18px 12px; color: var(--muted); font-size: 12px; }
@keyframes pendingPulse {
  0%, 100% { opacity: .45; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}
.syncing-pulse::before {
  animation: pendingPulse .8s infinite ease-in-out;
}
.entry-sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 7px 10px 7px 13px;
  border-bottom: 1px solid #dfe4e1;
}
.entry-sheet-toolbar strong { display: block; font-size: 13px; }
.entry-sheet-toolbar span { color: #8a948d; font-size: 10px; }
.pending-order-time-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 13px;
  border-bottom: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 800;
}
.pending-order-time-detail.hidden { display: none; }
.pending-order-time-detail b {
  margin-left: 6px;
  color: #7c2d12;
  font-size: 12px;
  font-weight: 900;
}
.pending-order-time-detail span:last-child {
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.entry-sheet-actions { display: flex; gap: 7px; }
.entry-sheet-actions button { height: 32px; padding: 0 12px; font-size: 11px; }
.entry-sheet-scroll { overflow-x: auto; }
.entry-grid {
  display: grid;
  grid-template-columns: 125px 135px 130px 125px 190px 145px 145px 100px;
  min-width: 1095px;
}
.entry-grid-header {
  border-bottom: 1px solid #dfe4e1;
  background: #f5f7f6;
  color: #606c64;
  font-size: 10px;
  font-weight: 800;
}
.entry-grid-header > div {
  padding: 8px 9px;
  border-right: 1px solid #e1e6e3;
}
.entry-grid-header em { color: #d74a4a; font-style: normal; }
.entry-grid-row { background: #fff; }
.sheet-cell {
  position: relative;
  min-width: 0;
  padding: 4px;
  border-right: 1px solid #e4e8e5;
  border-bottom: 1px solid #e4e8e5;
}
.sheet-cell input {
  width: 100%;
  height: 31px;
  min-height: 31px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
}
.sheet-cell input:hover, .sheet-cell input:focus { border-color: #cad7ce; background: #f8faf9; }
.source-control {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.feishu-control {
  position: relative;
  width: 100%;
  height: 31px;
  padding: 0 25px 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 11px;
  font-weight: 650;
  box-shadow: none;
}
.feishu-control:hover, .feishu-control:focus { border-color: #cbd7cf; background: #f7faf8; box-shadow: none; transform: none; }
.feishu-control::after {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid #7b8780;
  border-bottom: 1.5px solid #7b8780;
  content: "";
  transform: translateY(-65%) rotate(45deg);
}
.date-control::before {
  position: absolute;
  top: 50%;
  left: 8px;
  width: 10px;
  height: 9px;
  border: 1px solid #89958d;
  border-radius: 2px;
  content: "";
  transform: translateY(-50%);
}
.date-control { padding-left: 25px; }
.date-control::after { width: 4px; height: 4px; }
.tag-control { color: var(--brand-dark); }
.tag-control .control-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 21px;
  padding: 0 7px;
  border-radius: 4px;
  background: #e8f1eb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.device-tag .control-tag { background: #e8efff; color: #2e5ec5; }
.source-tag .control-tag { background: #f6eed4; color: #765b12; }
.region-tag .control-tag { background: #eef4d9; color: #526d19; }
.region-sheet-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px; }
.child-order-check {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-top: 5px;
  color: #506158 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  cursor: pointer;
}
.child-order-check input {
  width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  padding: 0 !important;
  accent-color: #2f7d57;
}
.quick-yunnan {
  height: 31px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: #f0f3f1;
  color: #526159;
  font-size: 10px;
  box-shadow: none;
}
.quick-yunnan:hover { background: #e6ece8; box-shadow: none; transform: none; }
.money-cell { display: flex; align-items: center; gap: 1px; padding-left: 9px; color: #69766e; font-size: 11px; }
.money-cell input { padding-left: 2px; }
.entry-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, .9fr) 165px;
  gap: 0;
  border-bottom: 1px solid #dfe4e1;
}
.entry-detail-grid > div { padding: 9px 10px; border-right: 1px solid #e4e8e5; }
.entry-detail-grid label { color: #606d64; font-size: 10px; }
.entry-detail-grid textarea {
  min-height: 48px;
  padding: 6px 7px;
  border-color: transparent;
  background: #f8faf9;
  font-size: 11px;
  resize: vertical;
}
.entry-detail-grid textarea:focus { border-color: #b9ccbf; background: #fff; }
.shipping-preview { display: grid; align-content: center; gap: 8px; }
.shipping-preview div { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
.shipping-preview span { color: #7c8880; }
.shipping-preview b { color: var(--text); }
.entry-sheet-add {
  width: 100%;
  height: var(--order-group-height);
  border: 0;
  border-radius: 0 0 7px 7px;
  background: #fafbfa;
  color: #65736a;
  text-align: left;
  font-size: 11px;
  font-weight: 750;
  box-shadow: none;
}
.entry-sheet-add:hover { background: #f0f5f1; color: var(--brand-dark); box-shadow: none; transform: none; }
.sheet-cell.has-error, .entry-detail-grid .has-error { background: #fff3f3; box-shadow: inset 0 0 0 1px #dc6666; }
.floating-control-popover {
  position: fixed;
  z-index: 200;
  width: 230px;
  max-height: 310px;
  border: 1px solid #d8dedb;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(38, 52, 43, .16);
  overflow: auto;
  overscroll-behavior: contain;
}
.popover-search { position: sticky; top: 0; z-index: 1; padding: 7px; border-bottom: 1px solid var(--line); background: #fff; }
.popover-search input { width: 100%; height: 30px; min-height: 30px; font-size: 11px; }
.popover-option {
  display: flex;
  align-items: center;
  width: calc(100% - 8px);
  height: 31px;
  margin: 2px 4px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  box-shadow: none;
}
.popover-option:hover, .popover-option.active { background: #edf3ef; color: var(--brand-dark); box-shadow: none; transform: none; }
.popover-option .option-tag { padding: 2px 7px; border-radius: 4px; background: #eef3ef; }
.calendar-popover { width: 248px; padding: 9px; overflow: visible; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calendar-head strong { font-size: 12px; }
.calendar-nav { display: flex; gap: 4px; }
.calendar-nav button { width: 27px; height: 27px; padding: 0; border: 0; background: transparent; color: #67736b; box-shadow: none; }
.calendar-week, .calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-week span { padding: 4px 0; color: #879189; text-align: center; font-size: 9px; }
.calendar-day {
  width: 29px;
  height: 29px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 10px;
  font-weight: 650;
  box-shadow: none;
}
.calendar-day:hover { background: #edf4ef; color: var(--brand-dark); box-shadow: none; transform: none; }
.calendar-day.outside { color: #bdc5bf; }
.calendar-day.today { box-shadow: inset 0 0 0 1px #8eaa97; }
.calendar-day.selected { background: var(--brand); color: #fff; }
.calendar-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.calendar-foot button { height: 27px; padding: 0 7px; border: 0; background: transparent; color: var(--brand); font-size: 10px; box-shadow: none; }
/* UI repair: keep custom date picker states visually distinct. */
.calendar-popover .calendar-day {
  color: var(--text-primary, var(--text));
  background: transparent;
}

.calendar-popover .calendar-day.outside {
  color: var(--text-muted, #9ca3af);
}

.calendar-popover .calendar-day.today:not(.selected) {
  color: var(--success, #2f7d32);
  background: var(--success-soft, #eaf6ed);
  box-shadow: inset 0 0 0 1px var(--success, #2f7d32);
}

.calendar-popover .calendar-day.selected {
  color: #fff;
  background: var(--brand, #4f7f4e);
  box-shadow: 0 0 0 2px rgba(79, 127, 78, 0.18);
}

.calendar-popover .calendar-day:hover:not(.selected) {
  color: var(--brand-dark, #335f36);
  background: var(--brand-soft, #edf4ef);
}
/* Linear order-entry workbench */
.sheet-calculator {
  margin-bottom: 10px;
  border-color: #d9e1dc;
  box-shadow: 0 1px 0 rgba(37, 57, 44, .03);
}
.sheet-calculator summary {
  min-height: 40px;
  padding: 0 12px;
}
.sheet-calculator summary strong { font-size: 12px; }
.sheet-calculator summary small { font-size: 10px; }
.sheet-calculator-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 9px 12px 10px;
}
.calculator-fields {
  grid-template-columns: minmax(112px, .7fr) minmax(180px, 1.05fr) minmax(138px, .85fr) minmax(138px, .85fr) auto;
  gap: 7px;
}
.calculator-results {
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  white-space: nowrap;
}
.calculator-results span { display: flex; align-items: center; }
.calculator-results span:last-child { display: none; }
.entry-sheet-toolbar {
  min-height: 46px;
  padding: 8px 12px;
}
.entry-sheet-toolbar strong { font-size: 13px; }
.entry-sheet-toolbar span { font-size: 10px; }
.entry-workbench { display: block; }
.entry-main {
  min-width: 0;
  padding: 0 12px 12px;
  background: #fff;
}
.entry-form-section {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid #e7ebe8;
}
.entry-form-section + .entry-form-section {
  margin-top: 0;
  padding-top: 11px;
  border-top: 0;
}
.entry-section-heading {
  display: block;
  margin: 0;
  padding-top: 2px;
}
.entry-section-heading strong {
  display: block;
  color: #27342c;
  font-size: 11px;
}
.entry-section-heading span {
  display: block;
  margin-top: 3px;
  color: #929c95;
  font-size: 9px;
  line-height: 1.45;
}
.entry-field-grid {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.identity-fields {
  grid-template-columns: minmax(145px, 1fr) minmax(190px, 1.25fr) minmax(105px, .62fr) minmax(100px, .58fr) minmax(170px, 1fr);
}
.fulfillment-fields {
  grid-template-columns: minmax(140px, .9fr) minmax(140px, .9fr) minmax(95px, .55fr) minmax(115px, .65fr) minmax(115px, .65fr);
}
.detail-fields {
  grid-template-columns: minmax(300px, 1.7fr) minmax(220px, 1fr);
}
.sheet-field {
  min-width: 0;
}
.sheet-field > label {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 0 4px;
  color: #59675f;
  font-size: 10px;
  font-weight: 750;
}
.sheet-field > label em {
  color: #d34b4b;
  font-style: normal;
}
.sheet-field > label small {
  color: #929b95;
  font-size: 9px;
  font-weight: 500;
}
.sheet-field input,
.sheet-field textarea,
.sheet-field .feishu-control,
.sheet-field .quick-yunnan {
  border: 1px solid #e0e6e2;
  background: #fbfcfb;
}
.sheet-field input,
.sheet-field .feishu-control,
.sheet-field .quick-yunnan {
  height: var(--order-group-height);
  min-height: 34px;
}
.sheet-field input {
  width: 100%;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 11px;
}
.sheet-field textarea {
  width: 100%;
  min-height: 58px;
  padding: 7px 9px;
  border-radius: 5px;
  font-size: 11px;
  resize: vertical;
}
.sheet-field input:hover,
.sheet-field input:focus,
.sheet-field textarea:hover,
.sheet-field textarea:focus,
.sheet-field .feishu-control:hover,
.sheet-field .feishu-control:focus {
  border-color: #b8c9bd;
  background: #fff;
}
.sheet-field .money-input {
  display: flex;
  align-items: center;
  height: var(--order-group-height);
  padding-left: 9px;
  border: 1px solid #e0e6e2;
  border-radius: 5px;
  background: #fbfcfb;
  color: #708078;
  font-size: 11px;
}
.sheet-field .money-input input {
  height: 31px;
  min-height: 31px;
  padding-left: 4px;
  border: 0;
  background: transparent;
}
.shipping-output {
  display: flex;
  align-items: center;
  height: var(--order-group-height);
  padding: 0 9px;
  border: 1px solid #e0e6e2;
  border-radius: 5px;
  background: #f5f8f6;
  color: #33433a;
  font-size: 11px;
  font-weight: 750;
}
.entry-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 11px;
}
.entry-bottom-note {
  color: #89948d;
  font-size: 9px;
  line-height: 1.5;
}
.entry-bottom-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}
.entry-bottom-actions button {
  width: auto;
  min-width: 112px;
  height: 34px;
  padding: 0 14px;
  font-size: 11px;
}
.sheet-field.has-error {
  padding: 5px;
  margin: -5px;
  border-radius: 6px;
  background: #fff3f3;
  box-shadow: inset 0 0 0 1px #dc6666;
}
.entry-sheet-add { display: none; }
@media (max-width: 1180px) {
  .sheet-calculator-body { display: block; }
  .calculator-results { margin-top: 8px; }
  .entry-form-section { grid-template-columns: 104px minmax(0, 1fr); }
  .identity-fields, .fulfillment-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .sheet-calculator summary small, .sheet-summary-result i { display: none; }
  .sheet-calculator-body { display: block; }
  .calculator-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-apply { width: 100%; }
  .calculator-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .calculator-results span { display: grid; gap: 2px; }
  .calculator-results b { margin: 0; }
  .entry-sheet-toolbar { align-items: flex-start; }
  .entry-sheet-toolbar span { display: none; }
  .entry-sheet-actions button { padding: 0 8px; }
  .entry-detail-grid { grid-template-columns: 1fr; }
  .entry-detail-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .shipping-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-form-section { display: block; }
  .entry-section-heading { margin-bottom: 8px; }
  .identity-fields, .fulfillment-fields, .detail-fields { grid-template-columns: 1fr; }
  .entry-bottom-bar { display: block; }
  .entry-bottom-actions { margin-top: 9px; }
  .entry-bottom-actions button { flex: 1; min-width: 0; }
}
.tab-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 8px 12px;
  border: 1px solid rgba(24, 33, 27, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .58);
  box-shadow: 0 1px 0 rgba(24, 33, 27, .03);
}
.tab-group:first-child {
  padding-top: 10px;
}
.tab-group-title {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 6px 5px;
  border-bottom: 1px solid rgba(24, 33, 27, .07);
  color: #26362b;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0;
}
.tab-group-title::before {
  width: 4px;
  height: 15px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand);
  content: "";
}
.tab-group .tab {
  margin-left: 0;
  width: 100%;
}
.tab-group.hidden {
  display: none;
}
@media (max-width: 760px) {
  .tabs {
    gap: 6px;
    align-items: stretch;
  }
  .tab-group {
    flex-direction: row;
    flex: 0 0 auto;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .tab-group-title {
    display: none;
  }
  .tab-group-title::before {
    display: none;
  }
  .tab-group .tab {
    margin-left: 0;
    width: auto;
  }
}
.workspace-placeholder {
  border: 1px dashed rgba(39, 115, 76, .28);
  background: linear-gradient(180deg, #fbfdfb 0%, #fff 100%);
  border-radius: 14px;
  padding: 24px;
  color: #526158;
}
.workspace-placeholder strong {
  display: block;
  margin-bottom: 8px;
  color: #16231b;
  font-size: 20px;
  font-weight: 900;
}
.workspace-placeholder p {
  margin: 0;
  line-height: 1.7;
}
.workspace-placeholder-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.buyer-history-notice {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  border-radius: 12px;
  color: #7c2d12;
}
.buyer-history-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #9a3412;
  font-weight: 900;
}
.buyer-history-notice span {
  font-size: 13px;
  line-height: 1.6;
}
.buyer-history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.buyer-history-actions button {
  min-width: 88px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 13px;
}
.pending-confirm-panel {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 52%);
  box-shadow: 0 12px 36px rgba(234, 88, 12, .09);
}
.pending-confirm-toolbar strong {
  color: #9a3412;
  font-weight: 900;
}
.pending-confirm-toolbar span {
  color: #9a3412;
}
.summary-shell { padding: 0; overflow: hidden; }
.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 0;
  border-bottom: 1px solid #e8e0d2;
  background: #fffdf7;
}
.summary-view-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.summary-view-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: #5d625c;
  font-size: 13px;
  font-weight: 800;
  box-shadow: none;
}
.summary-tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-tab-count {
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #efe8d8;
  color: #53625a;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.summary-tab-count.danger {
  background: #ffe1df;
  color: #b3312d;
}
.summary-view-tab::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 9px;
  width: 1px;
  height: 15px;
  background: #e6ded0;
}
.summary-view-tab:last-child::after { display: none; }
.summary-view-tab:hover {
  background: #fffcf5;
  color: #26352c;
  transform: none;
}
.summary-view-tab.active {
  border-color: #e8e0d2;
  background: #f7f1e6;
  color: #26352c;
  font-weight: 950;
  box-shadow: inset 0 -3px 0 #26352c;
}
.summary-view-tab.gantt.active { background: #f7f1e6; color: #26352c; box-shadow: inset 0 -3px 0 #26352c; }
.summary-add-view {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 7px 7px 0 0;
  font-size: 20px;
  line-height: 1;
}
.summary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #e8e0d2;
  background: #fffcf5;
}
.summary-actions, .summary-config-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.summary-toolbar button {
  height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  font-size: 12px;
}
.summary-search {
  width: min(260px, 38vw);
  height: 32px;
  padding: 0 11px;
  border: 1px solid #e8e0d2;
  border-radius: 6px;
  font-size: 13px;
}
.summary-search-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.summary-search-count {
  min-width: 46px;
  color: #66736c;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.summary-search-count.hidden {
  display: none;
}
.summary-search-nav {
  width: 28px;
  min-width: 28px;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1;
}
.summary-status {
  min-height: 30px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff7e8;
  color: #7a4e11;
  font-size: 12px;
}
.summary-workspace {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  background: #fffdf7;
}
.summary-body { min-height: 560px; background: #fff; }
.summary-table-wrap {
  max-height: calc(100vh - 250px);
  overflow: auto;
  background: #fff;
}
.summary-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.summary-grid {
  position: relative;
  width: var(--summary-grid-width, max-content);
  min-width: 100%;
}
.summary-grid-header {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  width: var(--summary-grid-width, 100%);
  min-width: 100%;
  grid-template-columns: var(--summary-grid-columns);
}
.summary-grid-body {
  position: relative;
  width: var(--summary-grid-width, 100%);
  min-width: 100%;
  height: var(--summary-grid-body-height, 0);
}
.summary-grid-row {
  position: absolute;
  left: 0;
  display: grid;
  width: var(--summary-grid-width, 100%);
  min-width: 100%;
  grid-template-columns: var(--summary-grid-columns);
}
.summary-grid-cell {
  position: relative;
  height: var(--summary-table-row-height);
  min-width: 0;
  max-width: 320px;
  padding: 0 8px;
  overflow: hidden;
  border-right: 1px solid #eee6da;
  border-bottom: 1px solid #eee6da;
  background: #fff;
  color: #26352c;
  font-size: 12px;
  line-height: var(--summary-table-row-height);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-grid-head-cell {
  background: #fffaf0;
  color: #7b5f26;
  font-weight: 900;
}
.summary-table th, .summary-table td {
  position: relative;
  height: var(--summary-table-row-height);
  max-width: 320px;
  padding: 0 8px;
  border-right: 1px solid #eee6da;
  border-bottom: 1px solid #eee6da;
  background: #fff;
  color: #26352c;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-table .summary-row-index,
.summary-table .summary-row-check {
  position: sticky;
  z-index: 6;
  text-align: center;
  color: #8a968d;
  background: #fff;
  box-shadow: 1px 0 0 #e8e0d2;
}
.summary-table th.summary-row-index,
.summary-table th.summary-row-check {
  z-index: 8;
  background: #fffaf0;
}
.summary-grid-header .summary-row-index,
.summary-grid-header .summary-row-check {
  z-index: 9;
  background: #fffaf0;
}
.summary-table .summary-row-index { left: 0; width: 42px; min-width: 42px; max-width: 42px; }
.summary-table .summary-row-check { left: 42px; width: 34px; min-width: 34px; max-width: 34px; }
.summary-row-check input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: #26352c;
}
.summary-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fffaf0;
  color: #5d625c;
  font-weight: 800;
}
.summary-th-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}
.summary-field-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid #d9e0dc;
  border-radius: 4px;
  color: #77837d;
  background: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.summary-table tr:hover td { background: #fffbf2; }
.summary-table tr.selected td,
.summary-table tr.selected:hover td { background: #f3efe5; }
.summary-table tr.search-current td { background: #fff8e6; }
.summary-grid-row:hover .summary-grid-cell { background: #fffbf2; }
.summary-grid-row.selected .summary-grid-cell,
.summary-grid-row.selected:hover .summary-grid-cell { background: #f3efe5; }
.summary-grid-row.search-current .summary-grid-cell { background: #fff8e6; }
.summary-table td.search-hit,
.summary-grid-cell.search-hit,
.gantt-left-row div.search-hit { background: #fff5d8 !important; }
.summary-table td.search-active,
.summary-grid-cell.search-active,
.gantt-left-row div.search-active { box-shadow: inset 0 0 0 1px #26352c; background: #f3efe5 !important; color: #26352c; }
.summary-table td.editable { cursor: default; }
.summary-grid-cell.editable { cursor: default; }
.summary-table td.selected-cell,
.summary-grid-cell.selected-cell,
.gantt-left-row div.selected-cell {
  box-shadow: inset 0 0 0 1px #26352c;
  background: #f4efe4 !important;
}
.summary-table td.syncing { background: #fff5dc; color: #946200; }
.summary-table td.missing-critical { background: #fff1f0 !important; }
.summary-table td.missing-warning { background: #fff7df !important; }
.summary-grid-cell.syncing { background: #fff5dc; color: #946200; }
.summary-grid-cell.missing-critical { background: #fff1f0 !important; }
.summary-grid-cell.missing-warning { background: #fff7df !important; }
.summary-table td.missing-danger {
  background: #fff1f0 !important;
  box-shadow: inset 2px 0 0 #d92d20;
}
.summary-grid-cell.missing-danger {
  background: #fff1f0 !important;
  box-shadow: inset 2px 0 0 #d92d20;
}
.summary-table td.risk-overdue {
  box-shadow: inset 2px 0 0 #d92d20;
}
.summary-grid-cell.risk-overdue {
  box-shadow: inset 2px 0 0 #d92d20;
}
.summary-cell-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-detail-open-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 22px;
  height: 22px;
  min-width: 22px;
  padding: 0 !important;
  border: 1px solid #d8d1c4;
  border-radius: 5px;
  background: rgba(255, 255, 255, .92);
  color: #5c6862;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transform: translateY(-50%);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  cursor: pointer;
}
.summary-detail-open-btn:hover {
  border-color: #b8c9bd;
  background: #fff;
  color: #1f3028;
  opacity: 1;
  transform: translateY(-50%);
}
.summary-table tr:hover .summary-detail-open-btn,
.summary-table tr.selected .summary-detail-open-btn,
.summary-grid-row:hover .summary-detail-open-btn,
.summary-grid-row.selected .summary-detail-open-btn,
.gantt-left-row:hover .summary-detail-open-btn,
.gantt-left-row.selected .summary-detail-open-btn {
  opacity: 1;
}
.summary-table .field-frozen {
  position: sticky;
  z-index: 3;
  box-shadow: 1px 0 0 #e8e0d2;
}
.summary-grid .field-frozen {
  position: sticky;
  z-index: 3;
  box-shadow: 1px 0 0 #e8e0d2;
}
.summary-table td.has-detail-cell {
  padding-right: 32px;
}
.summary-grid-cell.has-detail-cell {
  padding-right: 32px;
}
.summary-table th.field-frozen { z-index: 5; }
.summary-grid-header .field-frozen { z-index: 7; }
.summary-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: var(--order-tag-height);
  padding: 1px 6px;
  border-radius: 999px;
  background: #edf4ff;
  color: #3764b5;
  font-weight: 800;
  line-height: 1.15;
  font-size: 11px;
}
.summary-badge.green { background: #eaf7d8; color: #4e750d; }
.summary-badge.orange { background: #ffe9cf; color: #9a5500; }
.summary-badge.red { background: #ffe1df; color: #b3312d; }
.summary-badge.blue { background: #e4efff; color: #2c63c4; }
.summary-badge.gray { background: #eef1f0; color: #596861; }
.summary-badge.yellow { background: #fff1c8; color: #8d6200; }
.summary-badge.lime { background: #eef8d8; color: #5d7c14; }
.summary-badge.purple { background: #eaf2ff; color: #1d4ed8; }
.summary-badge.cyan { background: #e1f5fb; color: #21708c; }
.summary-badge.machine {
  min-height: 20px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 1px 7px;
}
.summary-badge.machine-pocket4 { background: #ffedee; border-color: #f7c5c8; color: #e5484d; }
.summary-badge.machine-pocket3 { background: #eef4ff; border-color: #bdd2ff; color: #2f6fed; }
.summary-badge.machine-transfer { background: #fff4d6; border-color: #efd07a; color: #d68a00; }
.summary-badge.machine-ordinary { background: #eef7ef; border-color: #cfe5d3; color: #2f6b45; }
.summary-badge.region-yunnan { background: #eaf7d8; color: #4e750d; }
.summary-badge.region-hebei { background: #fff1c8; color: #8d6200; }
.summary-badge.region-next-day-plus { background: #ffe8e5; color: #a94735; }
.summary-badge.region-remote { background: #ffd8d5; color: #b3312d; }
.summary-empty {
  color: #b8c1bc;
  font-weight: 700;
}
.summary-empty.detail {
  color: #9aa6a0;
  font-weight: 800;
}
.summary-panel {
  display: none;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
  padding: 12px 14px;
}
.summary-panel.active { display: block; }
.summary-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}
.summary-panel label {
  display: grid;
  gap: 5px;
  color: #53625a;
  font-size: 12px;
  font-weight: 800;
}
.summary-panel input, .summary-panel select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  background: #fff;
  font-size: 13px;
}
.summary-field-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}
.summary-field-checks label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid #e3e9e5;
  border-radius: 6px;
  background: #fff;
}
.summary-filter-row, .summary-sort-row {
  display: grid;
  grid-template-columns: 160px 150px minmax(160px, 1fr) 32px;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.summary-filter-row button, .summary-sort-row button { width: 32px; padding: 0; }
.summary-row-hint {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(211, 219, 213, 0.78);
  border-radius: 8px;
  background: #f7f8f4;
  color: #697265;
  font-size: 12px;
  font-weight: 700;
}
.summary-detail {
  flex: 0 0 clamp(520px, 38vw, 780px);
  width: clamp(520px, 38vw, 780px);
  min-width: min(520px, 100%);
  max-width: 780px;
  border-left: 1px solid var(--line);
  background: #fff;
  padding: 0;
  overflow: auto;
}
.summary-detail-title {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 32px 16px;
  border-bottom: 1px solid #e6ebe8;
  background: #fff;
  color: #1f3028;
  font-weight: 900;
}
.summary-detail-heading {
  min-width: 0;
}
.summary-detail-heading strong {
  display: block;
  overflow: hidden;
  color: #1f2933;
  font-size: 30px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-detail-heading span {
  display: block;
  margin-top: 6px;
  color: #6b756f;
  font-size: 12px;
  font-weight: 700;
}
.summary-detail-tabs {
  display: flex;
  gap: 28px;
  padding: 0 32px;
  border-bottom: 1px solid #e6ebe8;
}
.summary-detail-tab {
  height: 42px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 -2px 0 transparent;
  color: #33423a;
  font-size: 14px;
  font-weight: 800;
}
.summary-detail-tab.active {
  color: #1d5ef0;
  box-shadow: inset 0 -2px 0 #1d5ef0;
}
.summary-detail-section {
  padding: 18px 32px 6px;
}
.summary-detail-section-title {
  margin-bottom: 8px;
  color: #7a8580;
  font-size: 12px;
  font-weight: 900;
}
.summary-detail-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 0;
  border: 1px solid #e6ebe8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.summary-detail-label,
.summary-detail-value {
  min-height: 38px;
  padding: 9px 12px;
  border-bottom: 1px solid #eef2ef;
  color: #28362f;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.summary-detail-label {
  background: #fbfcfb;
  color: #6a766f;
  font-weight: 800;
}
.summary-detail-value.editable {
  cursor: pointer;
}
.summary-detail-value.editable:hover {
  background: #f4f8ff;
  box-shadow: inset 0 0 0 1px #cfe0ff;
}
.summary-timeline {
  max-height: 170px;
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #e3e9e5;
  border-radius: 7px;
  background: #fff;
}
.summary-timeline div {
  padding: 8px 10px;
  border-bottom: 1px solid #edf0ee;
  color: #33423a;
  font-size: 12px;
  line-height: 1.5;
}
.summary-select-editor {
  position: fixed;
  z-index: 10000;
  width: 176px;
  max-height: 282px;
  overflow: hidden;
  border: 1px solid #dce4e0;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 38, 30, .11);
}
.summary-text-editor {
  position: fixed;
  z-index: 10000;
  width: min(360px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid #cfd9d4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(25, 38, 30, .14);
}
.summary-text-editor input,
.summary-text-editor textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid #dfe6e2;
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 13px;
  outline: none;
}
.summary-text-editor textarea {
  min-height: 96px;
  resize: vertical;
}
.summary-inline-input {
  width: 100%;
  height: calc(var(--order-row-height) - 6px);
  min-width: 60px;
  border: 1px solid #26352c;
  border-radius: 5px;
  padding: 0 6px;
  background: #fffefa;
  color: #26352c;
  font: inherit;
  font-weight: 800;
  outline: none;
  box-shadow: 0 0 0 2px rgba(38, 53, 44, .08);
}
.summary-inline-editing {
  overflow: visible !important;
  z-index: 9;
}
.summary-text-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 7px;
}
.summary-text-editor-actions button {
  height: 26px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 12px;
}
.summary-select-editor input {
  width: calc(100% - 22px);
  height: 29px;
  margin: 7px 10px 5px;
  border: 0;
  border-bottom: 1px solid #edf1ee;
  outline: none;
  font-size: 12px;
}
.summary-select-options {
  max-height: 232px;
  overflow: auto;
  padding: 1px 7px 7px;
}
.summary-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 26px;
  margin: 2px 0;
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  color: #24342c;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.summary-select-option:hover,
.summary-select-option.active { background: #f5efe2; transform: none; }
.summary-gantt-wrap {
  position: relative;
  min-height: 0;
  background: #fff;
}
.summary-gantt {
  --gantt-left-width: var(--order-left-panel-width);
  --gantt-day-width: var(--order-day-width);
  height: calc(100vh - 255px);
  min-height: 560px;
  overflow: auto;
  background: #fff;
  border-top: 1px solid #eee6da;
  cursor: default;
}
.summary-gantt.is-pannable { cursor: grab; }
.summary-gantt.is-panning {
  cursor: grabbing;
  user-select: none;
}
.summary-gantt-inner {
  display: grid;
  grid-template-columns: var(--gantt-left-width) max-content;
  min-width: 100%;
}
.gantt-left-head, .gantt-date-head {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 58px;
  border-bottom: 1px solid #eee6da;
  background: #fffdf7;
}
.gantt-left-head {
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: var(--gantt-left-columns, 42px 34px 120px 58px 62px 62px 54px 56px 82px);
  box-shadow: 1px 0 0 #e8e0d2;
}
.gantt-left-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  bottom: 0;
  z-index: 12;
  width: 8px;
  cursor: col-resize;
  background: transparent;
}
.gantt-left-resizer:hover { background: rgba(38, 53, 44, .13); }
.gantt-left-head div, .gantt-left-row div {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border-right: 1px solid #eee6da;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-left-head div {
  display: flex;
  align-items: center;
  color: #5e6c65;
  font-size: 12px;
  font-weight: 900;
}
.gantt-date-head {
  display: grid;
  grid-template-rows: 25px 33px;
  width: max-content;
  z-index: 12;
}
.gantt-month-row, .gantt-day-row, .gantt-timeline-row {
  display: grid;
  grid-template-columns: repeat(var(--gantt-day-count), var(--gantt-day-width));
}
.gantt-month-cell, .gantt-day-cell {
  border-right: 1px solid #eee6da;
  color: #66736c;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 25px;
  background: #fff;
}
.gantt-day-cell {
  line-height: 33px;
  border-top: 1px solid #f3ede2;
}
.gantt-day-cell.weekend, .gantt-timeline-cell.weekend { background: #faf8f3; }
.gantt-day-cell.today {
  background: #f0eadf;
  color: #26352c;
  box-shadow: inset 0 -1px 0 rgba(38, 53, 44, .58);
}
.gantt-group {
  display: contents;
}
.gantt-group-title {
  position: sticky;
  left: 0;
  z-index: 6;
  grid-column: 1 / 2;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border-bottom: 1px solid #eee6da;
  background: #fffaf0;
  color: #34443c;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 1px 0 0 #e8e0d2;
  cursor: pointer;
}
.gantt-group-type {
  max-width: 86px;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-group-band {
  grid-column: 2 / 3;
  height: 34px;
  border-bottom: 1px solid #eee6da;
  background: #fffaf0;
}
.gantt-left-row {
  position: sticky;
  left: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: var(--gantt-left-columns, 42px 34px 120px 58px 62px 62px 54px 56px 82px);
  height: var(--order-row-height);
  align-items: center;
  border-bottom: 0;
  background: #fff;
  box-shadow: 1px 0 0 #e8e0d2;
  cursor: pointer;
}
.gantt-left-row div:first-child {
  justify-content: center;
  padding-right: 6px;
  color: #8a968d;
}
.gantt-row-check {
  justify-content: center;
}
.gantt-row-check input {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  accent-color: #26352c;
}
.gantt-machine-combo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.gantt-machine-combo > .summary-badge:first-child {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-machine-type-inline {
  flex: 0 0 auto;
  max-width: 48px;
  padding-left: 5px;
  padding-right: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-left-row.selected { background: #eef5ff; }
.gantt-row-track {
  position: relative;
  height: var(--order-row-height);
  border-bottom: 0;
  cursor: grab;
}
.gantt-timeline-row {
  position: absolute;
  inset: 0;
}
.gantt-timeline-cell {
  border-right: 1px solid #eef2f0;
  background: #fff;
}
.gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(47, 111, 237, .72);
  transform: translateX(-.5px);
  z-index: 3;
}
.gantt-today-line::before {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f6fed;
  content: "";
  transform: translateX(-50%);
}
.gantt-bar {
  position: absolute;
  top: calc((var(--order-row-height) - var(--order-gantt-bar-height)) / 2);
  height: var(--order-gantt-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 34px;
  padding: 0 9px;
  border-radius: 4px;
  background: #2f6df2;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 1px 2px rgba(36, 99, 207, .14);
  cursor: pointer;
}
.gantt-bar.selected {
  outline: 1px solid rgba(21, 75, 232, .9);
  box-shadow: 0 0 0 3px rgba(47, 109, 246, .14), 0 1px 4px rgba(36, 99, 207, .18);
}
.gantt-bar.conflict {
  outline: 1px solid rgba(245, 158, 11, .9);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .12), 0 1px 3px rgba(36, 99, 207, .16);
}
.gantt-warning {
  position: absolute;
  top: calc((var(--order-row-height) - var(--order-gantt-bar-height)) / 2);
  left: 8px;
  height: var(--order-gantt-bar-height);
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a5b00;
  font-size: 12px;
  font-weight: 900;
}
.gantt-conflict-chip {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff7ed;
  color: #a25a00;
  font-size: 11px;
  font-weight: 900;
}
.gantt-offscreen-arrow {
  position: absolute;
  top: calc((var(--order-row-height) - var(--order-gantt-bar-height)) / 2);
  z-index: 4;
  width: 22px;
  height: var(--order-gantt-bar-height);
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: rgba(238, 242, 240, .88);
  color: #6a766f;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}
.gantt-offscreen-arrow.left { left: 6px; }
.gantt-offscreen-arrow.right { right: 6px; }
.gantt-header-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 1px;
  background: rgba(47, 111, 237, .72);
  transform: translateX(-.5px);
  pointer-events: none;
}
.gantt-left-row.search-current {
  background: #f4f8ff;
}
.gantt-bar.search-hit {
  filter: brightness(1.04);
}
.gantt-bar.search-active {
  outline: 1px solid rgba(31, 91, 240, .95);
  box-shadow: 0 0 0 3px rgba(31, 91, 240, .18), 0 1px 4px rgba(36, 99, 207, .18);
}
.gantt-bar.overdue {
  box-shadow: inset 3px 0 0 rgba(185, 28, 28, .78), 0 1px 3px rgba(36, 99, 207, .16);
}
.gantt-date-dot {
  position: absolute;
  top: calc((var(--order-row-height) - var(--order-gantt-bar-height)) / 2 - 3px);
  z-index: 6;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .16);
  transform: translateX(-50%);
  pointer-events: none;
}
.gantt-date-dot.ship { background: #d68a00; }
.gantt-date-dot.return { background: #2f6fed; }
.gantt-risk-chip {
  position: absolute;
  top: calc((var(--order-row-height) - 18px) / 2);
  z-index: 5;
  height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid rgba(185, 28, 28, .16);
  border-radius: 999px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}
.gantt-navigator {
  position: absolute;
  top: 58px;
  right: 34px;
  z-index: 20;
  width: 34px;
  max-height: 34px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(232, 224, 210, .96);
  border-radius: 7px;
  background: rgba(255, 252, 245, .96);
  box-shadow: 0 8px 24px rgba(38, 53, 44, .09);
  backdrop-filter: blur(8px);
  overflow: hidden;
  opacity: .74;
  transition: width .16s ease, max-height .16s ease, opacity .16s ease, box-shadow .16s ease;
}
.gantt-navigator:hover,
.gantt-navigator:focus-within {
  width: 148px;
  max-height: min(420px, calc(100% - 78px));
  opacity: 1;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .12);
}
.gantt-navigator:not(:hover):not(:focus-within) input,
.gantt-navigator:not(:hover):not(:focus-within) .gantt-navigator-list {
  display: none;
}
.gantt-navigator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 8px 5px;
  color: #4f5c52;
  font-size: 11px;
  font-weight: 900;
}
.gantt-navigator:not(:hover):not(:focus-within) .gantt-navigator-head {
  height: 32px;
  justify-content: center;
  padding: 0;
}
.gantt-navigator:not(:hover):not(:focus-within) .gantt-navigator-head span:first-child {
  display: none;
}
.gantt-navigator input {
  height: 25px;
  margin: 0 7px 6px;
  padding: 0 7px;
  border: 1px solid #e8e0d2;
  border-radius: 5px;
  color: #27362f;
  font-size: 11px;
  outline: none;
}
.gantt-navigator-list {
  overflow: auto;
  padding: 0 5px 6px;
}
.gantt-nav-item {
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 1px 0;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  color: #34443c;
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.gantt-nav-item:hover { background: #f5efe2; transform: none; }
.gantt-nav-item.active { background: #efe8d8; color: #26352c; }
.gantt-nav-item.priority { color: #a25a00; }
.gantt-nav-item.muted { color: #a7b1ac; cursor: default; }
.gantt-nav-item span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-nav-count {
  color: #7a8580;
  font-weight: 800;
}
.shell.summary-mode button:hover {
  transform: none;
}
.shell.summary-mode .workspace-content,
.shell.summary-mode #summaryView {
  height: 100%;
  min-height: 0;
}
.shell.summary-mode .summary-shell {
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fffdf7;
}
.shell.summary-mode .summary-head {
  min-height: 38px;
  padding: 0 8px;
  gap: 6px;
  border-bottom-color: #e8e0d2;
}
.shell.summary-mode .summary-view-tabs {
  gap: 6px;
}
.shell.summary-mode .summary-view-tab {
  height: 38px;
  padding: 0 10px;
  border-radius: 7px 7px 0 0;
  font-size: 12px;
}
.shell.summary-mode .summary-add-view {
  width: 34px;
  height: var(--order-row-height);
  border-radius: 5px;
  font-size: 18px;
}
.shell.summary-mode .summary-toolbar {
  min-height: 36px;
  padding: 5px 8px;
  gap: 6px;
  border-bottom-color: #e8e0d2;
  background: #fffcf5;
}
.shell.summary-mode .summary-actions,
.shell.summary-mode .summary-config-actions {
  gap: 5px;
}
.shell.summary-mode .summary-toolbar button,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button {
  height: 28px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 12px;
  box-shadow: none;
}
.shell.summary-mode .summary-search {
  width: min(260px, 26vw);
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}
.shell.summary-mode .summary-status {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 4px 8px;
  font-size: 11px;
}
.shell.summary-mode .summary-panel {
  flex: 0 0 auto;
  padding: 8px;
}
.shell.summary-mode .summary-panel-grid {
  gap: 8px;
}
.shell.summary-mode .summary-workspace {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.shell.summary-mode .summary-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.shell.summary-mode .summary-body.table-body .summary-table-wrap {
  height: 100%;
  max-height: none;
}
.shell.summary-mode .summary-body.gantt-body {
  display: flex;
  flex-direction: column;
}
.shell.summary-mode .summary-body.gantt-body > .summary-actions {
  flex: 0 0 auto;
  padding: 5px 8px !important;
}
.shell.summary-mode .summary-gantt {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
.shell.summary-mode .summary-gantt-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  position: relative;
}
.shell.summary-mode .summary-gantt-wrap .summary-gantt {
  flex: 1 1 auto;
  min-width: 0;
}
.shell.summary-mode .summary-table {
  font-size: 12px;
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .summary-table td {
  height: var(--summary-table-row-height);
  max-width: 260px;
  padding: 0 7px;
}
.shell.summary-mode .summary-table th {
  height: var(--summary-table-row-height);
}
.shell.summary-mode .summary-badge {
  min-height: var(--order-tag-height);
  padding: 1px 6px;
  font-size: 11px;
}
.shell.summary-mode .gantt-left-head,
.shell.summary-mode .gantt-date-head {
  min-height: 50px;
}
.shell.summary-mode .gantt-date-head {
  grid-template-rows: 22px 28px;
}
.shell.summary-mode .gantt-month-cell {
  line-height: 22px;
}
.shell.summary-mode .gantt-day-cell {
  line-height: 28px;
}
.shell.summary-mode .gantt-group-title,
.shell.summary-mode .gantt-group-band {
  height: var(--order-group-height);
}
.shell.summary-mode .gantt-left-row,
.shell.summary-mode .gantt-row-track {
  height: var(--order-row-height);
}
.shell.summary-mode .gantt-bar,
.shell.summary-mode .gantt-warning {
  top: calc((var(--order-row-height) - var(--order-gantt-bar-height)) / 2);
  height: var(--order-gantt-bar-height);
  border-radius: 5px;
  font-size: 11px;
}
.shell.summary-mode .summary-detail {
  max-height: none;
  overflow: auto;
}
.summary-meta {
  color: #7a8580;
  font-size: 12px;
  white-space: nowrap;
}
.summary-icon-btn {
  width: 30px;
  min-width: 30px;
  padding: 0 !important;
  font-weight: 900;
}
.summary-undo-btn {
  min-width: 88px;
  color: #26352c;
  border-color: #e8e0d2 !important;
  background: #fffcf5 !important;
}
.summary-undo-btn:not(:disabled):hover {
  border-color: #26352c !important;
  background: #f2eee4 !important;
}
.summary-undo-btn:disabled {
  opacity: .44;
  cursor: not-allowed;
}
.summary-more-wrap {
  position: relative;
}
.summary-more-menu {
  position: absolute;
  top: 32px;
  right: 0;
  z-index: 30;
  min-width: 116px;
  padding: 5px;
  border: 1px solid #dfe6e2;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}
.summary-more-menu button {
  display: block;
  width: 100%;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  color: #26342c;
  text-align: left;
  font-size: 12px;
}
.summary-more-menu button:hover {
  background: #f2f5f3;
  transform: none;
}
.summary-more-menu button.danger {
  color: #b42318;
}

/* Order summary V3: focused data-workbench skin. */
.shell.summary-mode {
  --workbench-bg: #f3f5f9;
  --workbench-panel: #ffffff;
  --workbench-panel-soft: #f8f9fc;
  --workbench-line: #e3e7ef;
  --workbench-line-strong: #cfd6e3;
  --workbench-text: #111827;
  --workbench-muted: #697386;
  --workbench-soft-text: #8a94a6;
  --workbench-accent: #2563eb;
  --workbench-accent-2: #2563eb;
  --workbench-accent-soft: #eef2ff;
  --workbench-danger: #e5484d;
  --workbench-warning: #d97706;
  --workbench-success: #16a34a;
  --workbench-shadow: 0 18px 48px rgba(28, 38, 63, .10);
  --workbench-shadow-soft: 0 8px 22px rgba(28, 38, 63, .065);
}
.shell.summary-mode .workspace-context {
  display: none;
}
.shell.summary-mode .summary-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--workbench-line);
  border-radius: 18px;
  background: var(--workbench-panel);
  box-shadow: var(--workbench-shadow-soft);
}
.shell.summary-mode .summary-head {
  min-height: 46px;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--workbench-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(249, 250, 253, .96));
}
.shell.summary-mode .summary-view-tabs {
  gap: 4px;
  padding: 0 4px;
}
.shell.summary-mode .summary-view-tab {
  height: 40px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px 12px 0 0;
  color: #5f6b7d;
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}
.shell.summary-mode .summary-view-tab::after {
  right: -2px;
  top: 12px;
  height: 16px;
  background: #dfe4ee;
}
.shell.summary-mode .summary-view-tab:hover {
  background: #f3f5fb;
  color: #1f2937;
}
.shell.summary-mode .summary-view-tab.active,
.shell.summary-mode .summary-view-tab.gantt.active {
  background: #ffffff;
  color: var(--workbench-text);
  font-weight: 950;
  box-shadow:
    inset 0 -3px 0 var(--workbench-accent),
    0 -1px 0 #ffffff;
}
.shell.summary-mode .summary-view-tab.active::before {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--workbench-accent);
  content: "";
}
.shell.summary-mode .summary-tab-count {
  background: #edf2ff;
  color: #3349a8;
  font-size: 10px;
  font-weight: 950;
}
.shell.summary-mode .summary-tab-count.danger,
.shell.summary-mode .nav-count-badge {
  background: #ffe5e7;
  color: #c62832;
}
.shell.summary-mode .summary-add-view {
  align-self: center;
  width: 32px;
  height: 32px;
  margin-right: 3px;
  border-radius: 10px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 20px;
}
.shell.summary-mode .summary-toolbar {
  min-height: 44px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--workbench-line);
  background: #fbfcff;
}
.shell.summary-mode .summary-actions,
.shell.summary-mode .summary-config-actions {
  gap: 6px;
}
.shell.summary-mode .summary-toolbar button,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button,
.shell.summary-mode .summary-more-menu button {
  border: 1px solid transparent;
  border-radius: 9px;
  background: #eef1f6;
  color: #263244;
  font-weight: 900;
}
.shell.summary-mode .summary-toolbar button:hover,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button:hover {
  border-color: #d2d9e8;
  background: #e8edf6;
  color: #111827;
}
.shell.summary-mode .summary-toolbar button.active {
  background: var(--workbench-accent-soft);
  color: #4338ca;
}
.shell.summary-mode .summary-search {
  width: min(320px, 28vw);
  height: 32px;
  border-color: var(--workbench-line);
  border-radius: 11px;
  background: #fff;
  color: var(--workbench-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset;
}
.shell.summary-mode .summary-search:focus {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.shell.summary-mode .summary-search-count,
.shell.summary-mode .summary-meta {
  color: var(--workbench-muted);
  font-variant-numeric: tabular-nums;
}
.shell.summary-mode .summary-status {
  border-bottom-color: var(--workbench-line);
  background: #fff8e8;
  color: #8a5b12;
}
.shell.summary-mode .summary-workspace,
.shell.summary-mode .summary-body {
  background: #fff;
}
.shell.summary-mode .summary-table-wrap {
  background: #fff;
  scrollbar-color: #aeb7c7 #eef1f6;
}
.shell.summary-mode .summary-table {
  color: var(--workbench-text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .summary-table td {
  height: var(--summary-table-row-height);
  border-right: 1px solid var(--workbench-line);
  border-bottom: 1px solid var(--workbench-line);
  background: #fff;
  color: var(--workbench-text);
}
.shell.summary-mode .summary-table th {
  height: var(--summary-table-row-height);
  background: #f7f9fc;
  color: #4b5565;
  font-weight: 950;
}
.shell.summary-mode .summary-table .summary-row-index,
.shell.summary-mode .summary-table .summary-row-check,
.shell.summary-mode .summary-table th.summary-row-index,
.shell.summary-mode .summary-table th.summary-row-check {
  background: #f9fafc;
  color: #8a94a6;
  box-shadow: 1px 0 0 var(--workbench-line);
}
.shell.summary-mode .summary-row-check input,
.shell.summary-mode .gantt-row-check input {
  accent-color: var(--workbench-accent);
}
.shell.summary-mode .summary-field-icon {
  border: 0;
  background: #edf1f7;
  color: #6b7280;
}
.shell.summary-mode .summary-table tr:hover td {
  background: #f8fbff;
}
.shell.summary-mode .summary-table tr.selected td,
.shell.summary-mode .summary-table tr.selected:hover td,
.shell.summary-mode .gantt-left-row.selected {
  background: #eef3ff;
}
.shell.summary-mode .summary-table tr.search-current td {
  background: #fff9eb;
}
.shell.summary-mode .summary-table td.search-active,
.shell.summary-mode .gantt-left-row div.search-active,
.shell.summary-mode .summary-table td.selected-cell,
.shell.summary-mode .gantt-left-row div.selected-cell {
  background: #eef2ff !important;
  box-shadow: inset 0 0 0 1px var(--workbench-accent);
  color: var(--workbench-text);
}
.shell.summary-mode .summary-table .field-frozen {
  box-shadow: 1px 0 0 var(--workbench-line);
}
.shell.summary-mode .summary-empty {
  color: #b4bdca;
}
.shell.summary-mode .summary-badge {
  min-height: 19px;
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}
.shell.summary-mode .summary-badge.machine {
  border-radius: 7px;
}
.shell.summary-mode .summary-badge.machine-pocket4 {
  background: #ffecee;
  border-color: #ffc8cc;
  color: #d92d3a;
}
.shell.summary-mode .summary-badge.machine-pocket3 {
  background: #edf4ff;
  border-color: #c6d9ff;
  color: #2463d9;
}
.shell.summary-mode .summary-badge.machine-transfer {
  background: #fff4d6;
  border-color: #f0d27f;
  color: #b76a00;
}
.shell.summary-mode .summary-badge.machine-ordinary {
  background: #eef8ef;
  border-color: #cee9d3;
  color: #2f6b45;
}
.shell.summary-mode .summary-badge.blue { background: #eaf1ff; color: #2358c7; }
.shell.summary-mode .summary-badge.green { background: #eaf7ee; color: #1f6f3f; }
.shell.summary-mode .summary-badge.orange { background: #fff0da; color: #9a5200; }
.shell.summary-mode .summary-badge.yellow { background: #fff5cf; color: #836000; }
.shell.summary-mode .summary-badge.red { background: #ffe8ea; color: #c42a36; }
.shell.summary-mode .summary-badge.gray { background: #edf0f5; color: #667085; }
.shell.summary-mode .summary-badge.purple { background: #eaf2ff; color: #1d4ed8; }
.shell.summary-mode .summary-detail-open-btn {
  border-color: #d8dfeb;
  border-radius: 7px;
  background: rgba(255, 255, 255, .94);
  color: #536074;
  box-shadow: 0 6px 14px rgba(28, 38, 63, .12);
}
.shell.summary-mode .summary-detail-open-btn:hover {
  border-color: #a5b4fc;
  background: #eef2ff;
  color: #4338ca;
}
.shell.summary-mode .summary-panel {
  border-bottom-color: var(--workbench-line);
  background: #f8f9fc;
}
.shell.summary-mode .summary-panel input,
.shell.summary-mode .summary-panel select,
.shell.summary-mode .summary-text-editor input,
.shell.summary-mode .summary-text-editor textarea,
.shell.summary-mode .summary-select-editor input {
  border-color: var(--workbench-line);
  border-radius: 9px;
}
.shell.summary-mode .summary-field-checks label {
  border-color: var(--workbench-line);
  border-radius: 10px;
  background: #fff;
}
.shell.summary-mode .summary-detail {
  border-left: 1px solid var(--workbench-line);
  background: #fff;
  box-shadow: -18px 0 38px rgba(28, 38, 63, .08);
}
.shell.summary-mode .summary-detail-title {
  padding: 24px 30px 16px;
  border-bottom-color: var(--workbench-line);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(10px);
}
.shell.summary-mode .summary-detail-heading strong {
  color: var(--workbench-text);
  font-size: 28px;
  letter-spacing: 0;
}
.shell.summary-mode .summary-detail-heading span,
.shell.summary-mode .summary-detail-section-title {
  color: var(--workbench-muted);
}
.shell.summary-mode .summary-detail-tabs {
  border-bottom-color: var(--workbench-line);
}
.shell.summary-mode .summary-detail-tab.active {
  color: var(--workbench-accent);
  box-shadow: inset 0 -2px 0 var(--workbench-accent);
}
.shell.summary-mode .summary-detail-grid {
  border-color: var(--workbench-line);
  border-radius: 12px;
}
.shell.summary-mode .summary-detail-label {
  background: #f8f9fc;
  color: #667085;
}
.shell.summary-mode .summary-detail-value {
  color: var(--workbench-text);
  border-bottom-color: var(--workbench-line);
}
.shell.summary-mode .summary-select-editor,
.shell.summary-mode .summary-text-editor,
.shell.summary-mode .summary-more-menu {
  border-color: var(--workbench-line);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(28, 38, 63, .16);
}
.shell.summary-mode .summary-select-option:hover,
.shell.summary-mode .summary-select-option.active,
.shell.summary-mode .gantt-nav-item:hover {
  background: #eef2ff;
  color: #2f2b83;
}
.shell.summary-mode .summary-inline-input {
  border-color: var(--workbench-accent);
  border-radius: 7px;
  background: #fff;
  color: var(--workbench-text);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.shell.summary-mode .summary-gantt-wrap {
  background: #fff;
}
.shell.summary-mode .summary-gantt {
  border-top: 1px solid var(--workbench-line);
  background: #fff;
  scrollbar-color: #aeb7c7 #eef1f6;
}
.shell.summary-mode .gantt-left-head,
.shell.summary-mode .gantt-date-head {
  min-height: 54px;
  border-bottom: 1px solid var(--workbench-line);
  background: #f8f9fc;
}
.shell.summary-mode .gantt-left-head {
  box-shadow: 1px 0 0 var(--workbench-line);
}
.shell.summary-mode .gantt-left-head div,
.shell.summary-mode .gantt-left-row div {
  border-right: 1px solid var(--workbench-line);
  color: var(--workbench-text);
}
.shell.summary-mode .gantt-left-head div {
  color: #4b5565;
  font-weight: 950;
}
.shell.summary-mode .gantt-date-head {
  grid-template-rows: 24px 30px;
}
.shell.summary-mode .gantt-month-cell,
.shell.summary-mode .gantt-day-cell {
  border-right: 1px solid var(--workbench-line);
  background: #fff;
  color: #667085;
  font-weight: 850;
}
.shell.summary-mode .gantt-month-cell {
  line-height: 24px;
  background: #f8f9fc;
}
.shell.summary-mode .gantt-day-cell {
  line-height: 30px;
  border-top: 1px solid var(--workbench-line);
}
.shell.summary-mode .gantt-day-cell.weekend,
.shell.summary-mode .gantt-timeline-cell.weekend {
  background: #f5f7fb;
}
.shell.summary-mode .gantt-day-cell.today {
  background: #eef2ff;
  color: #4338ca;
  box-shadow: inset 0 -2px 0 var(--workbench-accent);
}
.shell.summary-mode .gantt-header-today-line,
.shell.summary-mode .gantt-today-line {
  width: 1px;
  background: rgba(37, 99, 235, .78);
  transform: translateX(-.5px);
}
.shell.summary-mode .gantt-header-today-line::before,
.shell.summary-mode .gantt-today-line::before {
  background: var(--workbench-accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.shell.summary-mode .gantt-background-grid {
  background:
    linear-gradient(90deg, rgba(227, 231, 239, .86) 1px, transparent 1px) 0 0 / var(--gantt-day-width) 100%,
    #fff;
}
.shell.summary-mode .gantt-weekend-band {
  background: rgba(245, 247, 251, .9);
}
.shell.summary-mode .gantt-grid-lines,
.shell.summary-mode .gantt-timeline-cell {
  display: none;
}
.shell.summary-mode .gantt-group-title,
.shell.summary-mode .gantt-group-band {
  height: 31px;
  border-bottom: 1px solid var(--workbench-line);
  background: #f8f9fc;
}
.shell.summary-mode .gantt-group-title {
  color: #344054;
  box-shadow: 1px 0 0 var(--workbench-line);
}
.shell.summary-mode .gantt-left-row {
  background: #fff;
  box-shadow: 1px 0 0 var(--workbench-line);
}
.shell.summary-mode .gantt-row-track {
  border-bottom: 1px solid rgba(227, 231, 239, .72);
  cursor: grab;
}
.shell.summary-mode .gantt-bar {
  height: 20px;
  border: 1px solid rgba(35, 88, 199, .18);
  border-radius: 7px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 12px rgba(37, 99, 235, .18);
  font-weight: 950;
}
.shell.summary-mode .gantt-bar:hover {
  filter: brightness(1.03);
}
.shell.summary-mode .gantt-bar.selected,
.shell.summary-mode .gantt-bar.search-active {
  outline: 1px solid rgba(37, 99, 235, .95);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16), 0 8px 16px rgba(37, 99, 235, .20);
}
.shell.summary-mode .gantt-bar.overdue {
  background: linear-gradient(180deg, #f87171, #e5484d);
  box-shadow: 0 0 0 2px rgba(229, 72, 77, .12), 0 8px 16px rgba(229, 72, 77, .16);
}
.shell.summary-mode .gantt-bar.conflict {
  outline: 1px solid rgba(217, 119, 6, .9);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, .14), 0 8px 16px rgba(37, 99, 235, .16);
}
.shell.summary-mode .gantt-warning {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a5b00;
}
.shell.summary-mode .gantt-offscreen-arrow {
  border: 1px solid var(--workbench-line);
  background: rgba(248, 250, 252, .92);
  color: #667085;
}
.shell.summary-mode .gantt-risk-chip {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #be123c;
}
.shell.summary-mode .gantt-navigator {
  border-color: var(--workbench-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 34px rgba(28, 38, 63, .14);
}
.shell.summary-mode .gantt-navigator-head {
  color: #344054;
}
.shell.summary-mode .gantt-navigator input {
  border-color: var(--workbench-line);
  border-radius: 8px;
}
.shell.summary-mode .gantt-nav-item {
  border-radius: 8px;
  color: #344054;
}
.shell.summary-mode .gantt-nav-item.active {
  background: #eef2ff;
  color: #4338ca;
}
.shell.summary-mode .summary-undo-btn {
  border-color: #dbe3ff !important;
  background: #eef2ff !important;
  color: #4338ca;
}
.shell.summary-mode .summary-undo-btn:not(:disabled):hover {
  border-color: #a5b4fc !important;
  background: #e0e7ff !important;
}
.summary-debug-panel {
  display: none;
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 12000;
  width: min(380px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid #cfd9d4;
  border-radius: 7px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
  color: #223129;
  font-size: 11px;
}
body.order-summary-debug .summary-debug-panel {
  display: block;
}
.summary-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #e5ebe7;
  font-weight: 900;
}
.summary-debug-panel button {
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
}
.summary-debug-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #edf2ef;
}
.summary-debug-grid div {
  min-width: 0;
  padding: 6px 8px;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-debug-grid strong {
  display: block;
  margin-bottom: 2px;
  color: #66736c;
  font-size: 10px;
  font-weight: 800;
}
.summary-mode-active .watermark-layer {
  display: none;
}
.shell.summary-mode .summary-search-wrap .summary-search {
  width: min(220px, 22vw);
}
.shell.summary-mode .summary-status {
  display: none;
}
.shell.summary-mode .summary-table .summary-row-index,
.shell.summary-mode .summary-table .summary-row-check {
  padding: 0;
}
.summary-spacer td {
  padding: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  background: #fff !important;
}
.summary-table .summary-column-spacer {
  padding: 0;
  border-right: 0;
  pointer-events: none;
}
.shell.summary-mode .summary-gantt-inner {
  grid-template-rows: 50px max-content;
  width: max(var(--gantt-total-width), 100%);
}
.shell.summary-mode .gantt-left-head {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  height: 50px;
}
.shell.summary-mode .gantt-date-head {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  height: 50px;
  width: var(--gantt-timeline-width);
}
.shell.summary-mode .gantt-month-row,
.shell.summary-mode .gantt-day-row {
  width: var(--gantt-timeline-width);
}
.gantt-virtual-rows {
  position: relative;
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  min-width: 100%;
  background: #fff;
}
.gantt-background-grid {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}
.gantt-grid-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--gantt-day-width) - 1px),
    #efe8dc calc(var(--gantt-day-width) - 1px),
    #efe8dc var(--gantt-day-width)
  );
}
.gantt-weekend-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(38, 53, 44, .035);
}
.gantt-background-grid .gantt-today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 1px;
  background: rgba(47, 111, 237, .72);
  transform: translateX(-.5px);
}
.gantt-row-window {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: var(--gantt-total-width);
  will-change: transform;
}
.gantt-virtual-row {
  display: grid;
  grid-template-columns: var(--gantt-left-width) var(--gantt-timeline-width);
  min-width: 100%;
}
.shell.summary-mode .gantt-left-row,
.shell.summary-mode .gantt-row-track,
.shell.summary-mode .gantt-group-title,
.shell.summary-mode .gantt-group-band {
  height: 100%;
}

.shell.summary-mode .summary-shell {
  background: #fff;
}
.shell.summary-mode .summary-head {
  background: #fffdf8;
  border-bottom-color: #e6ddcf;
}
.shell.summary-mode .summary-view-tabs {
  gap: 3px;
  padding-left: 2px;
}
.shell.summary-mode .summary-view-tab {
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px 6px 0 0;
  color: #67726c;
  background: transparent;
  box-shadow: inset 0 -2px 0 transparent;
}
.shell.summary-mode .summary-view-tab::after {
  right: -2px;
  top: 11px;
  height: 13px;
  background: #e1d8c8;
}
.shell.summary-mode .summary-view-tab:hover {
  background: #faf5ea;
  color: #26352c;
}
.shell.summary-mode .summary-view-tab.active,
.shell.summary-mode .summary-view-tab.gantt.active {
  background: #f3ede2;
  color: #17251d;
  box-shadow: inset 0 -3px 0 #26352c;
}
.shell.summary-mode .summary-tab-count {
  height: 17px;
  min-width: 17px;
  padding: 0 5px;
  background: #ebe3d4;
  color: #435248;
}
.shell.summary-mode .summary-tab-count.danger {
  background: #ffe3e0;
  color: #b42318;
}
.shell.summary-mode .summary-toolbar {
  background: #fff;
  border-bottom-color: #ebe3d7;
}
.shell.summary-mode .summary-toolbar button,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button,
.shell.summary-mode .summary-icon-btn {
  border-color: #e4ddd1;
  background: #f8f5ee;
  color: #26352c;
}
.shell.summary-mode .summary-toolbar button:hover,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button:hover,
.shell.summary-mode .summary-icon-btn:hover {
  border-color: #cfc4b3;
  background: #f1eadf;
}
.shell.summary-mode .summary-search {
  border-color: #ded6c9;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.shell.summary-mode .summary-search:focus {
  border-color: #aebcaf;
  box-shadow: 0 0 0 2px rgba(38, 53, 44, .08);
}
.shell.summary-mode .summary-meta {
  color: #7f887f;
  font-size: 11px;
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .summary-table td,
.shell.summary-mode .gantt-left-head div,
.shell.summary-mode .gantt-left-row div {
  border-right-color: #ebe5da;
  border-bottom-color: #eee8dc;
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .summary-table th.summary-row-index,
.shell.summary-mode .summary-table th.summary-row-check,
.shell.summary-mode .gantt-left-head,
.shell.summary-mode .gantt-date-head {
  background: #fffdf8;
  color: #526057;
}
.shell.summary-mode .summary-table tr:hover td {
  background: #faf7ef;
}
.shell.summary-mode .summary-table tr.selected td,
.shell.summary-mode .summary-table tr.selected:hover td,
.shell.summary-mode .gantt-left-row.selected {
  background: #edf4ff;
}
.shell.summary-mode .summary-field-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: #fff;
  color: #7c877f;
  font-size: 9px;
}
.shell.summary-mode .summary-badge {
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 850;
  letter-spacing: 0;
}
.shell.summary-mode .summary-badge.machine {
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 6px;
}
.shell.summary-mode .summary-badge.machine-pocket4 {
  background: #ffeded;
  border-color: #f5c1c4;
  color: #d63b40;
}
.shell.summary-mode .summary-badge.machine-pocket3 {
  background: #edf4ff;
  border-color: #c4d7ff;
  color: #2f65d8;
}
.shell.summary-mode .summary-badge.machine-transfer {
  background: #fff5d8;
  border-color: #ead18c;
  color: #ad7100;
}
.shell.summary-mode .summary-badge.machine-ordinary {
  background: #edf7ef;
  border-color: #cfe5d3;
  color: #2f6b45;
}
.shell.summary-mode .summary-select-editor,
.shell.summary-mode .summary-text-editor,
.shell.summary-mode .floating-control-popover {
  border-color: #ded6c9;
  box-shadow: 0 14px 36px rgba(38, 53, 44, .13);
}
.shell.summary-mode .summary-select-option:hover,
.shell.summary-mode .summary-select-option.active {
  background: #f5efe2;
}
.shell.summary-mode .summary-gantt {
  border-top-color: #ebe3d7;
  background: #fff;
}
.shell.summary-mode .gantt-left-head {
  box-shadow: 1px 0 0 #ddd4c6;
}
.shell.summary-mode .gantt-left-head div {
  padding: 0 6px;
  font-size: 11px;
}
.shell.summary-mode .gantt-left-row div {
  padding: 0 6px;
}
.shell.summary-mode .gantt-group-title,
.shell.summary-mode .gantt-group-band {
  background: #fff9ed;
  border-bottom-color: #eee3d1;
}
.shell.summary-mode .gantt-group-title {
  gap: 6px;
  font-size: 12px;
  color: #2e4036;
}
.shell.summary-mode .gantt-group-title > span:last-child {
  color: #6f7a72;
  font-size: 11px;
  font-weight: 850;
}
.shell.summary-mode .gantt-group-type {
  max-width: 72px;
}
.shell.summary-mode .gantt-day-cell,
.shell.summary-mode .gantt-month-cell {
  border-right-color: #ebe5da;
  color: #69746d;
  background: #fffdf8;
}
.shell.summary-mode .gantt-day-cell.weekend,
.shell.summary-mode .gantt-timeline-cell.weekend,
.shell.summary-mode .gantt-weekend-band {
  background: rgba(38, 53, 44, .035);
}
.shell.summary-mode .gantt-day-cell.today {
  background: #eef4ff;
  color: #2357c4;
  box-shadow: inset 0 -2px 0 #2f6fed;
}
.shell.summary-mode .gantt-grid-lines {
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--gantt-day-width) - 1px),
    #ece5da calc(var(--gantt-day-width) - 1px),
    #ece5da var(--gantt-day-width)
  );
}
.shell.summary-mode .gantt-today-line,
.shell.summary-mode .gantt-header-today-line,
.shell.summary-mode .gantt-background-grid .gantt-today-line {
  background: rgba(47, 111, 237, .82);
}
.shell.summary-mode .gantt-bar {
  height: 19px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 4px;
  background: #2f6fed;
  box-shadow: 0 1px 3px rgba(47, 111, 237, .18);
}
.shell.summary-mode .gantt-bar span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell.summary-mode .gantt-bar span:last-child {
  flex: 0 0 auto;
}
.summary-compact-id {
  color: #516059;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}
.shell.summary-mode .gantt-navigator {
  border-color: #ded6c9;
  background: rgba(255, 253, 248, .97);
  box-shadow: 0 8px 24px rgba(38, 53, 44, .12);
}
.shell.summary-mode .gantt-nav-item.active {
  background: #f1eadf;
  box-shadow: inset 2px 0 0 #26352c;
}
.shell.summary-mode .summary-detail {
  background: #fffdf8;
  border-left-color: #e1d8c8;
}
.shell.summary-mode .summary-detail-title {
  background: #fffdf8;
  border-bottom-color: #e6ddcf;
}
.shell.summary-mode .summary-detail-heading strong {
  color: #1f2c25;
  font-size: 28px;
}
.shell.summary-mode .summary-detail-tab.active {
  color: #26352c;
  box-shadow: inset 0 -2px 0 #26352c;
}
.shell.summary-mode .summary-detail-grid {
  border-color: #e7dfd2;
  border-radius: 7px;
}
.shell.summary-mode .summary-detail-label {
  background: #fff9ef;
  color: #69746d;
}
.shell.summary-mode .gantt-left-row {
  grid-column: 1 / 2;
  grid-template-columns: var(--gantt-left-columns, 120px 56px 60px 62px 54px 54px 82px);
}
.shell.summary-mode .gantt-row-track {
  grid-column: 2 / 3;
  width: var(--gantt-timeline-width);
  background: transparent;
}
.shell.summary-mode .gantt-virtual-row .gantt-group-title {
  grid-column: 1 / 2;
  display: flex;
  position: sticky;
  left: 0;
  z-index: 5;
}
.shell.summary-mode .gantt-virtual-row .gantt-group-band {
  grid-column: 2 / 3;
  width: var(--gantt-timeline-width);
  background: rgba(255, 250, 240, .86);
}
.shell.summary-mode .gantt-left-head div,
.shell.summary-mode .gantt-left-row div {
  padding: 0 6px;
}
.shell.summary-mode .gantt-bar span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell.summary-mode .gantt-bar span:last-child {
  flex: 0 0 auto;
  margin-left: auto;
}
.shell.summary-mode .gantt-bar.conflict {
  outline: 1px solid #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .12);
}
.shell.summary-mode .gantt-conflict-chip {
  background: #fff7ed;
  color: #a25a00;
}
/* Order summary V3 final pass: stop older green/beige rules from bleeding into the workspace. */
.shell.summary-mode {
  --workbench-bg: #f3f5f9;
  --workbench-panel: #ffffff;
  --workbench-panel-soft: #f8fafc;
  --workbench-line: #e3e7ef;
  --workbench-line-strong: #d4dae8;
  --workbench-text: #111827;
  --workbench-muted: #687386;
  --workbench-accent: #2563eb;
  --workbench-accent-soft: #eef2ff;
  --workbench-danger: #dc2626;
}
.shell.summary-mode .summary-head-title,
.shell.summary-mode .summary-view-tab,
.shell.summary-mode .summary-table th,
.shell.summary-mode .gantt-left-head,
.shell.summary-mode .gantt-date-head {
  color: var(--workbench-text);
}
.shell.summary-mode .summary-shell {
  overflow: hidden;
  border: 1px solid var(--workbench-line);
  border-radius: 18px;
  background: var(--workbench-panel);
  box-shadow: 0 18px 50px rgba(15, 23, 42, .055);
}
.shell.summary-mode .summary-head,
.shell.summary-mode .summary-view-tabs,
.shell.summary-mode .summary-toolbar {
  background: #fff;
  border-color: var(--workbench-line);
}
.shell.summary-mode .summary-view-tabs {
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
}
.shell.summary-mode .summary-view-tab {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px 10px 0 0;
  color: #576174;
  box-shadow: inset 0 -2px 0 transparent;
}
.shell.summary-mode .summary-view-tab::after {
  right: -5px;
  background: #d9deea;
}
.shell.summary-mode .summary-view-tab:hover {
  background: #f5f7fb;
  color: #1f2937;
}
.shell.summary-mode .summary-view-tab.active,
.shell.summary-mode .summary-view-tab.gantt.active {
  background: var(--workbench-accent-soft);
  color: #1d4ed8;
  box-shadow: inset 0 -3px 0 var(--workbench-accent);
}
.shell.summary-mode .summary-toolbar {
  min-height: 38px;
  padding: 5px 10px;
}
.shell.summary-mode .summary-toolbar button,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button,
.shell.summary-mode .summary-icon-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  background: #eef1f6;
  color: #263244;
  box-shadow: none;
}
.shell.summary-mode .summary-toolbar button:hover,
.shell.summary-mode .summary-body.gantt-body > .summary-actions button:hover,
.shell.summary-mode .summary-icon-btn:hover {
  border-color: var(--workbench-line-strong);
  background: #e7ecf6;
  color: #111827;
}
.shell.summary-mode .summary-toolbar button.active,
.shell.summary-mode .summary-icon-btn.active {
  background: #e6ebff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .22);
}
.shell.summary-mode .summary-search {
  border-color: var(--workbench-line);
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}
.shell.summary-mode .summary-search:focus {
  border-color: #9aa8ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}
.shell.summary-mode .summary-meta {
  color: var(--workbench-muted);
}
.shell.summary-mode .summary-table-wrap,
.shell.summary-mode .summary-gantt {
  background: #fff;
  border-color: var(--workbench-line);
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .summary-table th.summary-row-index,
.shell.summary-mode .summary-table th.summary-row-check,
.shell.summary-mode .gantt-left-head,
.shell.summary-mode .gantt-date-head {
  background: #f8fafc;
  color: #4b5565;
  border-color: var(--workbench-line);
  box-shadow: none;
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .summary-table td,
.shell.summary-mode .gantt-left-head div,
.shell.summary-mode .gantt-left-row div {
  border-right-color: var(--workbench-line);
  border-bottom-color: var(--workbench-line);
}
.shell.summary-mode .summary-table tr:hover td {
  background: #f8fbff;
}
.shell.summary-mode .summary-table tr.selected td,
.shell.summary-mode .summary-table tr.selected:hover td,
.shell.summary-mode .gantt-left-row.selected {
  background: #eef3ff;
}
.shell.summary-mode .summary-field-icon {
  background: #eef1f6;
  color: #6b7280;
}
.shell.summary-mode .summary-badge {
  border-radius: 7px;
  min-height: 18px;
  padding: 1px 6px;
  letter-spacing: 0;
}
.shell.summary-mode .summary-badge.machine-pocket4 {
  background: #ffecee;
  border-color: #f5b8bd;
  color: #d5343d;
}
.shell.summary-mode .summary-badge.machine-pocket3 {
  background: #edf4ff;
  border-color: #bfd3ff;
  color: #2f65d8;
}
.shell.summary-mode .summary-badge.machine-transfer {
  background: #fff3ce;
  border-color: #efd084;
  color: #a16207;
}
.shell.summary-mode .summary-badge.machine-ordinary {
  background: #edf7ef;
  border-color: #cce3d1;
  color: #2f6b45;
}
.shell.summary-mode .gantt-group-title,
.shell.summary-mode .gantt-group-band {
  background: #f8fafc;
  border-color: var(--workbench-line);
}
.shell.summary-mode .gantt-group-title {
  color: #263244;
  font-weight: 800;
}
.shell.summary-mode .gantt-day-cell,
.shell.summary-mode .gantt-month-cell {
  border-color: var(--workbench-line);
  background: #f8fafc;
  color: #5f697a;
}
.shell.summary-mode .gantt-day-cell.weekend,
.shell.summary-mode .gantt-timeline-cell.weekend,
.shell.summary-mode .gantt-weekend-band {
  background: #f5f7fb;
}
.shell.summary-mode .gantt-day-cell.today {
  background: #eef2ff;
  color: #1d4ed8;
  box-shadow: inset 0 -2px 0 var(--workbench-accent);
}
.shell.summary-mode .gantt-grid-lines {
  display: none !important;
}
.shell.summary-mode .gantt-background-grid {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, .07) 1px, transparent 1px) 0 0 / var(--gantt-day-width) 100%,
    linear-gradient(180deg, transparent calc(var(--order-row-height) - 1px), rgba(15, 23, 42, .045) calc(var(--order-row-height) - 1px)) 0 0 / 100% var(--order-row-height),
    #fff;
}
.shell.summary-mode .gantt-today-line,
.shell.summary-mode .gantt-header-today-line,
.shell.summary-mode .gantt-background-grid .gantt-today-line {
  background: rgba(37, 99, 235, .82);
}
.shell.summary-mode .gantt-bar {
  height: 20px;
  min-width: 34px;
  border-radius: 6px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  box-shadow: 0 2px 7px rgba(37, 99, 235, .2);
}
.shell.summary-mode .gantt-bar.conflict {
  outline: 1px solid #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .13);
}
.shell.summary-mode .summary-detail {
  background: #fff;
  border-left-color: var(--workbench-line);
  box-shadow: -18px 0 44px rgba(15, 23, 42, .08);
}
.shell.summary-mode .summary-detail-title,
.shell.summary-mode .summary-detail-tabs {
  background: #fff;
  border-color: var(--workbench-line);
}
.shell.summary-mode .summary-detail-heading strong {
  color: #111827;
}
.shell.summary-mode .summary-detail-tab.active {
  color: #1d4ed8;
  box-shadow: inset 0 -2px 0 var(--workbench-accent);
}
/* Backend UI V5: warm product workbench inspired by Duozhuayu + lightweight SaaS structure. */
:root {
  --bg-page: #f5f2ea;
  --bg-page-soft: #f8f6f0;
  --surface: #ffffff;
  --surface-soft: #fffcf6;
  --border: #e6ded1;
  --border-light: #efe8dc;
  --divider: #ede7dc;
  --text-primary: #242321;
  --text-secondary: #77736c;
  --text-muted: #aaa59b;
  --text-disabled: #c5bfb4;
  --primary: #2b2b2b;
  --primary-hover: #1f1f1f;
  --primary-soft: #f0ede6;
  --focus: #4f7f4e;
  --focus-soft: #edf6ed;
  --focus-border: #bfd8bf;
  --success: #4f7f4e;
  --success-soft: #edf6ed;
  --success-border: #bfd8bf;
  --warning: #d6a100;
  --warning-soft: #fff4d6;
  --warning-border: #f1d884;
  --danger: #c94d3d;
  --danger-soft: #ffede9;
  --danger-border: #f2b8ae;
  --info: #3b6fd8;
  --info-soft: #eef4ff;
  --info-border: #b8cdf6;
  --shadow-card: 0 8px 24px rgba(36, 35, 33, .06);
  --shadow-popover: 0 12px 32px rgba(36, 35, 33, .14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --bg: var(--bg-page);
  --card: var(--surface);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border);
  --brand: var(--primary);
  --brand-dark: var(--primary-hover);
  --brand-soft: var(--primary-soft);
  --green: var(--success);
  --shadow: var(--shadow-card);
}
html,
body {
  background:
    radial-gradient(circle at 14% 0, rgba(79, 127, 78, .08), transparent 360px),
    radial-gradient(circle at 100% 18%, rgba(214, 161, 0, .06), transparent 340px),
    linear-gradient(180deg, var(--bg-page-soft) 0%, var(--bg-page) 100%) !important;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
body {
  font-size: 13px;
  letter-spacing: 0;
}
.watermark-layer {
  display: none !important;
}
.auth-screen {
  background:
    radial-gradient(circle at 18% 10%, rgba(79, 127, 78, .12), transparent 330px),
    radial-gradient(circle at 86% 0, rgba(214, 161, 0, .08), transparent 360px),
    var(--bg-page) !important;
}
.auth-card {
  border: 1px solid rgba(230, 222, 209, .92);
  border-radius: 24px;
  background: rgba(255, 252, 246, .92);
  box-shadow: 0 24px 70px rgba(36, 35, 33, .13);
  backdrop-filter: blur(14px);
}
.auth-brand,
.workspace-eyebrow {
  color: var(--success);
  font-weight: 900;
}
.auth-title,
.workspace-context h2,
.top h1,
h1 {
  color: var(--text-primary) !important;
  letter-spacing: 0;
}
.auth-desc,
.workspace-description,
.workspace-hint,
.top .desc,
.desc {
  color: var(--text-secondary) !important;
}
.shell {
  grid-template-columns: 232px minmax(0, 1fr) 314px;
  background: transparent !important;
}
.app-sidebar {
  padding: 18px 14px;
  border-right: 1px solid rgba(230, 222, 209, .95);
  background: rgba(255, 252, 246, .9) !important;
  box-shadow: 14px 0 34px rgba(36, 35, 33, .035);
  backdrop-filter: blur(12px);
}
.top {
  padding: 10px 8px 16px;
  border: 0;
  border-bottom: 1px solid var(--divider);
  background: transparent;
  box-shadow: none;
}
.top .brand,
.brand {
  color: var(--success) !important;
  font-size: 13px;
  font-weight: 900;
}
.top h1 {
  font-size: 25px;
  line-height: 1.08;
  font-weight: 950;
}
.pill {
  border: 1px solid var(--success-border);
  background: var(--success-soft);
  color: #3f6f43;
  box-shadow: none;
}
.login-state {
  color: var(--text-secondary);
}
.sidebar-collapse-btn,
.logout-btn {
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: none;
}
.tabs {
  gap: 14px;
}
.tab-group {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--divider);
}
.tab-group-title {
  gap: 8px;
  padding: 0 10px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}
.tab-group-title::before {
  width: 3px;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--success);
  content: "";
}
.tab {
  height: 38px;
  padding: 0 12px 0 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 760;
  box-shadow: none;
}
.tab::before {
  left: 13px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--text-muted);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.tab:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-primary);
  transform: none;
}
.tab.active {
  border-color: var(--border);
  background: var(--primary-soft);
  color: var(--text-primary);
  box-shadow: inset 3px 0 0 var(--primary);
}
.tab.active::before {
  border-color: var(--primary);
  background: var(--primary);
}
.nav-count-badge,
.summary-count-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}
.workspace-main {
  padding: 18px 18px 48px;
  background: transparent;
}
.workspace-context {
  min-height: 62px;
  margin-bottom: 14px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--divider);
}
.workspace-context h2 {
  font-size: 23px;
  font-weight: 950;
}
.workspace-aside {
  padding: 18px 16px 18px 0;
  background: transparent;
}
.card,
.form-section,
.operation-box,
.reply-assistant,
.deposit-test-box,
.backup-card,
.duplicate-group,
.activity-row,
.status-rule-card,
.sync-health,
.recent-entry-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.panel-title,
.recent-entry-head {
  border-bottom-color: var(--divider);
  background: var(--surface-soft);
  color: var(--text-primary);
  font-weight: 900;
}
.panel-body,
.detail,
.search-card {
  padding: 16px;
}
label {
  color: var(--text-primary);
  font-weight: 820;
}
input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #d8cdbb;
  background: #fffefa;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(79, 127, 78, .16);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}
button {
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(36, 35, 33, .14);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, border-color .16s ease, color .16s ease;
}
button:hover {
  background: var(--primary-hover);
  box-shadow: 0 12px 24px rgba(36, 35, 33, .18);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(36, 35, 33, .14);
}
button:disabled {
  background: #ebe6dc;
  color: var(--text-disabled);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
button.secondary,
.secondary,
.quick-btn,
.reply-question,
.summary-toolbar button,
.summary-icon-btn,
.summary-body.gantt-body > .summary-actions button,
.summary-more-menu button {
  border: 1px solid var(--border-light);
  background: var(--primary-soft);
  color: var(--text-primary);
  box-shadow: none;
}
button.secondary:hover,
.secondary:hover,
.quick-btn:hover,
.reply-question:hover,
.reply-question.active,
.summary-toolbar button:hover,
.summary-icon-btn:hover,
.summary-body.gantt-body > .summary-actions button:hover,
.summary-more-menu button:hover {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 6px 16px rgba(36, 35, 33, .06);
}
.form-section-title::before,
.status-rule-source::before {
  background: var(--primary);
}
.rent-calculator,
.sheet-calculator,
.calc-box,
.link-box,
.message-box,
.shipping-output,
.write-queue-summary,
.pending-confirm-section {
  border-color: var(--border);
  background: var(--surface-soft);
}
.sync-health.working {
  border-color: var(--info-border);
  background: var(--info-soft);
}
.sync-health.warning {
  border-color: var(--warning-border);
  background: var(--warning-soft);
}
.sync-health.error {
  border-color: var(--danger-border);
  background: #fff8f6;
}
.sync-health.working .sync-health-dot {
  background: var(--info);
  box-shadow: 0 0 0 5px rgba(59, 111, 216, .12);
}
.workspace-aside .sync-health-metrics {
  border-color: var(--border);
  border-radius: var(--radius-md);
}
.workspace-aside .sync-health-metric {
  border-color: var(--border);
  background: rgba(255, 252, 246, .78);
}
.recent-entry-row,
.result-item,
.backup-row,
.deposit-event,
.duplicate-record {
  border-color: var(--divider);
  background: var(--surface);
}
.result-item:hover,
.result-item.active {
  background: #fffaf0;
  border-left-color: var(--primary);
}
.mini-chip,
.activity-order {
  background: var(--primary-soft);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.mini-chip.green {
  background: var(--success-soft);
  color: #3f6f43;
  border-color: var(--success-border);
}
.mini-chip.warn {
  background: var(--warning-soft);
  color: #8a6200;
  border-color: var(--warning-border);
}
.shell.summary-mode {
  --workbench-bg: var(--bg-page);
  --workbench-panel: var(--surface);
  --workbench-panel-soft: var(--surface-soft);
  --workbench-line: var(--border-light);
  --workbench-line-strong: var(--border);
  --workbench-text: var(--text-primary);
  --workbench-muted: var(--text-secondary);
  --workbench-accent: var(--primary);
  --workbench-accent-soft: var(--primary-soft);
  --workbench-danger: var(--danger);
}
.shell.summary-mode .summary-shell {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.shell.summary-mode .summary-view-tabs {
  gap: 4px;
  border-bottom-color: var(--divider);
  background: var(--surface);
}
.shell.summary-mode .summary-view-tab {
  min-height: 36px;
  padding: 0 13px;
  border-right: 1px solid var(--divider);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}
.shell.summary-mode .summary-view-tab::after {
  display: none;
}
.shell.summary-mode .summary-view-tab:hover {
  background: var(--surface-soft);
  color: var(--text-primary);
}
.shell.summary-mode .summary-view-tab.active,
.shell.summary-mode .summary-view-tab.gantt.active {
  background: var(--primary-soft);
  color: var(--text-primary);
  font-weight: 950;
  box-shadow: inset 0 -3px 0 var(--primary);
}
.shell.summary-mode .summary-view-tab.active::before {
  background: var(--success);
}
.shell.summary-mode .summary-toolbar {
  border-bottom-color: var(--divider);
  background: var(--surface-soft);
}
.shell.summary-mode .summary-toolbar button.active,
.shell.summary-mode .summary-icon-btn.active {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.shell.summary-mode .summary-search {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text-primary);
}
.shell.summary-mode .summary-search:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(79, 127, 78, .15);
}
.shell.summary-mode .summary-table-wrap,
.shell.summary-mode .summary-gantt-wrap {
  background: var(--surface);
}
.shell.summary-mode .summary-table th,
.shell.summary-mode .gantt-left-header,
.shell.summary-mode .gantt-month-row,
.shell.summary-mode .gantt-day-row {
  background: var(--surface-soft);
  color: var(--text-secondary);
  border-color: var(--divider);
}
.shell.summary-mode .summary-table td,
.shell.summary-mode .summary-table th,
.shell.summary-mode .gantt-left-cell,
.shell.summary-mode .gantt-timeline-row,
.shell.summary-mode .gantt-timeline-cell {
  border-color: var(--divider);
}
.shell.summary-mode .summary-table tr:hover td,
.shell.summary-mode .summary-table-row:hover,
.shell.summary-mode .gantt-order-row:hover {
  background: #fffaf0;
}
.shell.summary-mode .summary-table-row.is-selected,
.shell.summary-mode .gantt-order-row.is-selected,
.shell.summary-mode .summary-selected-row {
  background: #f7f1e6;
}
.shell.summary-mode .summary-cell-selected,
.shell.summary-mode .summary-editing-cell {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #fffefa;
}
.shell.summary-mode .summary-badge {
  min-height: 19px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 850;
  line-height: 17px;
  box-shadow: none;
}
.shell.summary-mode .summary-badge.machine {
  min-width: 0;
  height: 20px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}
.shell.summary-mode .summary-badge.machine-transfer {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: #8a6200;
}
.shell.summary-mode .summary-badge.machine-pocket4 {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.shell.summary-mode .summary-badge.machine-pocket3 {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info);
}
.shell.summary-mode .summary-badge.machine-ordinary {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: #3f6f43;
}
.shell.summary-mode .summary-badge.blue {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info);
}
.shell.summary-mode .summary-badge.green,
.shell.summary-mode .summary-badge.lime,
.shell.summary-mode .summary-badge.purple {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: #3f6f43;
}
.shell.summary-mode .summary-badge.orange {
  background: #fff0da;
  border-color: #f3c88d;
  color: #9a5200;
}
.shell.summary-mode .summary-badge.yellow {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: #8a6200;
}
.shell.summary-mode .summary-badge.red {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.shell.summary-mode .summary-badge.gray {
  background: #efeee9;
  border-color: #ddd8cf;
  color: var(--text-secondary);
}
.shell.summary-mode .summary-badge.region-yunnan {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: #3f6f43;
}
.shell.summary-mode .summary-badge.region-hebei {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: #8a6200;
}
.shell.summary-mode .summary-badge.region-next-day-plus {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: #a94735;
}
.shell.summary-mode .summary-badge.region-remote {
  background: #ffd8d5;
  border-color: #efa6a0;
  color: #9f2d25;
}
.shell.summary-mode .summary-gantt {
  background: var(--surface);
  color: var(--text-primary);
}
.shell.summary-mode .gantt-group-row {
  background: rgba(255, 252, 246, .9);
  color: var(--text-primary);
}
.shell.summary-mode .gantt-day-cell.weekend,
.shell.summary-mode .gantt-timeline-cell.weekend {
  background: #f6f3ec;
}
.shell.summary-mode .gantt-background-grid {
  background-color: var(--surface);
}
.shell.summary-mode .gantt-bar {
  border-radius: 7px;
  background: #3474e0;
  box-shadow: 0 3px 8px rgba(52, 116, 224, .14);
}
.shell.summary-mode .gantt-bar:hover,
.shell.summary-mode .gantt-bar.is-selected {
  outline: 2px solid rgba(36, 35, 33, .34);
  outline-offset: 1px;
  filter: saturate(1.03);
}
.shell.summary-mode .gantt-day-cell.today {
  background: #f2efe6;
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.shell.summary-mode .gantt-today-line,
.shell.summary-mode .gantt-header-today-line,
.shell.summary-mode .gantt-background-grid .gantt-today-line {
  width: 1px;
  background: rgba(36, 35, 33, .7);
}
.shell.summary-mode .summary-popover,
.shell.summary-mode .summary-more-menu,
.shell.summary-mode .summary-text-editor,
.shell.summary-mode .summary-detail,
.summary-detail {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.shell.summary-mode .summary-detail-head {
  background: var(--surface);
  border-bottom-color: var(--divider);
}
.shell.summary-mode .summary-detail-tab.active {
  color: var(--text-primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}
.shell.summary-mode .summary-option-menu {
  border-color: var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}
.shell.summary-mode .summary-option-menu button {
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
}
.shell.summary-mode .summary-option-menu button:hover {
  background: var(--primary-soft);
  transform: none;
}
.shell.summary-mode .summary-detail-grid {
  border-color: var(--workbench-line);
  border-radius: 12px;
}
.shell.summary-mode .summary-detail-label {
  background: #f8fafc;
  color: #667085;
}
/* Backend UI V4: whole-site neutral admin shell, no purple accent. */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #111827;
  --muted: #667085;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --warn: #d97706;
  --green: #16a34a;
  --shadow: 0 16px 42px rgba(15, 23, 42, .075);
}
html,
body {
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, .055), transparent 360px),
    linear-gradient(180deg, #f7f9fc 0%, var(--bg) 100%);
  color: var(--text);
}
body {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.auth-screen {
  background:
    radial-gradient(circle at 18% 10%, rgba(37, 99, 235, .1), transparent 320px),
    radial-gradient(circle at 90% 0, rgba(14, 165, 233, .08), transparent 360px),
    #f4f6fa;
}
.auth-card {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 22px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .14);
  backdrop-filter: blur(12px);
}
.auth-brand {
  color: var(--brand);
}
.auth-title {
  color: #0f172a;
  letter-spacing: 0;
}
.auth-desc {
  color: #667085;
}
.shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) 306px;
  gap: 0;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: transparent;
}
.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .94) !important;
  box-shadow: 16px 0 44px rgba(15, 23, 42, .04);
  backdrop-filter: blur(12px);
}
.top {
  margin: 0 0 16px;
  padding: 10px 8px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}
.top .brand,
.brand {
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}
.top h1,
h1 {
  margin-top: 3px;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}
.top .desc,
.desc {
  color: #64748b;
}
.pill {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: none;
}
.login-state {
  color: #64748b;
}
.sidebar-collapse-btn,
.logout-btn {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
  box-shadow: none;
}
.tabs {
  display: grid;
  gap: 14px;
  margin: 0;
}
.tab-group {
  margin: 0;
  padding: 0 0 14px;
  border-bottom: 1px solid #eef2f7;
}
.tab-group:first-child {
  padding-top: 0;
}
.tab-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0 10px;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}
.tab-group-title::before {
  width: 3px;
  height: 14px;
  border-radius: 999px;
  background: var(--brand);
  content: "";
}
.tab {
  position: relative;
  width: 100%;
  height: 38px;
  padding: 0 12px 0 32px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  text-align: left;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.tab::before {
  left: 13px;
  width: 7px;
  height: 7px;
  border: 1.5px solid #94a3b8;
  border-radius: 999px;
  background: #fff;
}
.tab:hover {
  border-color: #dbeafe;
  background: #f8fbff;
  color: #1e293b;
  transform: none;
}
.tab.active {
  border-color: #dbeafe;
  background: var(--brand-soft);
  color: #1d4ed8;
  box-shadow: inset 3px 0 0 var(--brand);
}
.tab.active::before {
  border-color: var(--brand);
  background: var(--brand);
}
.nav-count-badge {
  background: #fee2e2;
  color: #b91c1c;
}
.workspace-main {
  min-width: 0;
  padding: 18px 18px 48px;
  background: transparent;
}
.workspace-context {
  align-items: flex-end;
  min-height: 62px;
  margin-bottom: 14px;
  padding: 0 4px 14px;
  border-bottom: 1px solid var(--line);
}
.workspace-eyebrow {
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}
.workspace-context h2 {
  color: #0f172a;
  font-size: 22px;
  letter-spacing: 0;
}
.workspace-description,
.workspace-hint {
  color: #64748b;
}
.workspace-aside {
  position: sticky;
  top: 0;
  min-width: 0;
  height: 100vh;
  padding: 18px 16px 18px 0;
  overflow-y: auto;
  background: transparent;
}
.card,
.form-section,
.operation-box,
.reply-assistant,
.deposit-test-box,
.backup-card,
.duplicate-group,
.activity-row,
.status-rule-card {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}
.panel-title {
  border-bottom-color: var(--line);
  background: #f8fafc;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}
.panel-body,
.detail,
.search-card {
  padding: 16px;
}
label {
  color: #334155;
  font-weight: 850;
}
input,
select,
textarea {
  border-color: #d7deea;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 650;
  box-shadow: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:hover,
select:hover,
textarea:hover {
  border-color: #b8c3d5;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}
button {
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 7px 16px rgba(37, 99, 235, .18);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease, border-color .16s ease;
}
button:hover {
  background: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(37, 99, 235, .22);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(37, 99, 235, .16);
}
button.secondary,
.secondary,
.quick-btn,
.reply-question {
  border: 1px solid var(--line);
  background: #f8fafc;
  color: #334155;
  box-shadow: none;
}
button.secondary:hover,
.secondary:hover,
.quick-btn:hover,
.reply-question:hover,
.reply-question.active {
  border-color: #cbd5e1;
  background: #eef4ff;
  color: #1d4ed8;
  box-shadow: none;
}
.form-section-title::before,
.status-rule-source::before {
  background: var(--brand);
}
.form-section {
  padding: 14px 16px;
  box-shadow: none;
}
.form-section-head,
.entry-section-heading {
  border-bottom-color: var(--line);
}
.rent-calculator,
.sheet-calculator,
.calc-box,
.link-box,
.message-box,
.shipping-output,
.write-queue-summary {
  border-color: var(--line);
  background: #f8fafc;
}
.sync-health {
  border-color: var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}
.sync-health.working {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.sync-health.warning {
  border-color: #fed7aa;
  background: #fffbeb;
}
.sync-health.error {
  border-color: #fecaca;
  background: #fff7f7;
}
.sync-health.working .sync-health-dot {
  background: var(--brand);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .12);
}
.workspace-aside .sync-health-metrics {
  border-color: var(--line);
  border-radius: 12px;
}
.workspace-aside .sync-health-metric {
  border-color: var(--line);
  background: #fbfdff;
}
.recent-entry-card {
  border-radius: 16px;
}
.recent-entry-head {
  background: #f8fafc;
  color: #0f172a;
}
.recent-entry-row,
.result-item,
.backup-row,
.deposit-event,
.duplicate-record {
  border-color: var(--line);
  background: #fff;
}
.result-item:hover,
.result-item.active {
  background: #f8fbff;
  border-left-color: var(--brand);
}
.mini-chip,
.activity-order {
  background: #eef2f7;
  color: #475569;
}
.mini-chip.green {
  background: #ecfdf5;
  color: #15803d;
}
.mini-chip.warn {
  background: #fff7ed;
  color: #c2410c;
}
.account-module-options label,
.checkbox-row,
.child-order-check,
.sheet-check {
  color: #334155;
}
.shell.summary-mode {
  --workbench-bg: #f4f6fa;
  --workbench-panel: #ffffff;
  --workbench-panel-soft: #f8fafc;
  --workbench-line: #e2e8f0;
  --workbench-line-strong: #cbd5e1;
  --workbench-text: #111827;
  --workbench-muted: #667085;
  --workbench-accent: #2563eb;
  --workbench-accent-soft: #eff6ff;
  --workbench-danger: #dc2626;
}
.shell.summary-mode .summary-shell {
  border-radius: 18px;
  border-color: var(--workbench-line);
  box-shadow: 0 18px 52px rgba(15, 23, 42, .07);
}
.shell.summary-mode .summary-view-tab.active,
.shell.summary-mode .summary-view-tab.gantt.active {
  background: var(--workbench-accent-soft);
  color: #1d4ed8;
  box-shadow: inset 0 -3px 0 var(--workbench-accent);
}
.shell.summary-mode .summary-toolbar button.active,
.shell.summary-mode .summary-icon-btn.active {
  background: #dbeafe;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .26);
}
.shell.summary-mode .summary-search:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.shell.summary-mode .summary-badge.purple {
  background: #eaf2ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.shell.summary-mode .gantt-day-cell.today {
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 -2px 0 var(--workbench-accent);
}
.shell.summary-mode .gantt-today-line,
.shell.summary-mode .gantt-header-today-line,
.shell.summary-mode .gantt-background-grid .gantt-today-line {
  background: rgba(37, 99, 235, .82);
}
.shell.summary-mode .summary-detail-tab.active {
  color: #1d4ed8;
  box-shadow: inset 0 -2px 0 var(--workbench-accent);
}
@media (max-width: 900px) {
  .summary-toolbar { align-items: flex-start; flex-direction: column; }
  .summary-search { width: 100%; }
  .summary-gantt { --gantt-left-width: 420px; --gantt-day-width: 42px; }
  .summary-filter-row, .summary-sort-row { grid-template-columns: 1fr 1fr; }
  .summary-filter-row button, .summary-sort-row button { width: auto; }
}
/* Backend UI V6: white-first customer workbench polish.
   This final layer intentionally overrides older V3/V4/V5 theme blocks. */
:root {
  --bg-page: #ffffff;
  --bg-page-soft: #fafafa;
  --surface: #ffffff;
  --surface-soft: #fbfbfa;
  --border: #eaeaea;
  --border-light: #f0f0f0;
  --divider: #ededed;
  --text-primary: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --text-disabled: #c8c8c8;
  --primary: #222222;
  --primary-hover: #111111;
  --primary-soft: #f3f3f3;
  --focus: #2563eb;
  --focus-soft: #eff6ff;
  --focus-border: #bfdbfe;
  --success: #4f7f4e;
  --success-soft: #edf6ed;
  --success-border: #bfd8bf;
  --warning: #d6a100;
  --warning-soft: #fff4d6;
  --warning-border: #f1d884;
  --danger: #c94d3d;
  --danger-soft: #ffede9;
  --danger-border: #f2b8ae;
  --info: #3b6fd8;
  --info-soft: #eef4ff;
  --info-border: #b8cdf6;
  --shadow-card: 0 8px 24px rgba(34, 34, 34, .05);
  --shadow-popover: 0 12px 32px rgba(34, 34, 34, .14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --brand: var(--primary);
  --brand-strong: var(--primary-hover);
  --brand-soft: var(--primary-soft);
  --line: var(--border);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --soft: var(--bg-page-soft);
  --workbench-bg: var(--bg-page);
  --workbench-panel: var(--surface);
  --workbench-panel-soft: var(--surface-soft);
  --workbench-line: var(--border);
  --workbench-line-strong: #d9d9d9;
  --workbench-text: var(--text-primary);
  --workbench-muted: var(--text-secondary);
  --workbench-accent: var(--focus);
  --workbench-accent-soft: var(--focus-soft);
}

html,
body {
  background: var(--bg-page) !important;
  color: var(--text-primary);
}
.watermark-layer { display: none !important; }
input,
select,
textarea,
button {
  border-radius: var(--radius-sm);
}
input,
select,
textarea {
  border-color: #d9dde5;
  background: #fff;
  color: var(--text-primary);
}
input:focus,
select:focus,
textarea:focus,
.summary-search:focus {
  border-color: var(--focus) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1) !important;
  outline: none;
}
button {
  font-weight: 800;
  letter-spacing: 0;
}
button:not(.secondary):not(.tab):not(.summary-view-tab):not(.summary-icon-btn):not(.summary-add-view):not(.summary-detail-tab):not(.summary-select-option):not(.gantt-nav-item):not(.summary-search-nav):not(.gantt-offscreen-arrow) {
  background: var(--primary);
  color: #fff;
  box-shadow: none;
}
button:not(.secondary):not(.tab):not(.summary-view-tab):not(.summary-icon-btn):not(.summary-add-view):not(.summary-detail-tab):not(.summary-select-option):not(.gantt-nav-item):not(.summary-search-nav):not(.gantt-offscreen-arrow):hover {
  background: var(--primary-hover);
  transform: none;
}
button.secondary,
.secondary {
  border-color: #dde1e8;
  background: #fff;
  color: var(--text-primary);
  box-shadow: none;
}
button.secondary:hover,
.secondary:hover {
  background: #f7f8fa;
  border-color: #cfd5df;
  transform: none;
}

.shell {
  background: #fff !important;
  color: var(--text-primary);
}
.app-sidebar {
  background: #fff !important;
  border-right: 1px solid var(--border);
  box-shadow: none !important;
}
.top {
  border-bottom-color: var(--border);
}
.brand {
  color: var(--success);
  letter-spacing: 0;
}
.top h1 {
  color: var(--text-primary);
  letter-spacing: 0;
}
.desc,
.login-state,
.workspace-description,
.workspace-hint {
  color: var(--text-secondary);
}
.pill {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success-border);
}
.logout-btn {
  background: #f6f7f8 !important;
  color: var(--text-primary) !important;
  border: 1px solid #e3e6eb !important;
}
.tab-group {
  border-color: var(--border);
  background: #fff;
  box-shadow: none;
}
.tab-group-title {
  color: var(--text-primary);
  letter-spacing: 0;
}
.tab {
  color: #4f5662;
  background: transparent;
  border-radius: var(--radius-sm);
}
.tab::before {
  border-color: #b8c0cc;
  background: #fff;
}
.tab:hover {
  background: #f7f8fa;
  color: var(--text-primary);
  transform: none;
}
.tab.active {
  background: var(--focus-soft);
  color: var(--focus);
  font-weight: 950;
  box-shadow: inset 3px 0 0 var(--focus);
}
.tab.active::before {
  border-color: var(--focus);
  background: var(--focus);
}
.nav-count-badge {
  background: var(--danger);
  color: #fff;
  border-color: #fff;
  box-shadow: none;
}
.workspace-main {
  background: #fff !important;
  padding: 18px 20px 28px;
}
.workspace-context {
  border-bottom-color: var(--border);
  background: #fff;
  box-shadow: none;
}
.workspace-eyebrow {
  color: var(--focus);
  letter-spacing: 0;
}
.workspace-context h2 {
  color: var(--text-primary);
  letter-spacing: 0;
}
.workspace-aside {
  background: #fff !important;
  border-left: 1px solid var(--border);
  box-shadow: none;
}
.card,
.form-section,
.sync-health,
.recent-entry-card,
.result-item,
.order-card,
.backup-row,
.duplicate-record {
  border-color: var(--border) !important;
  border-radius: var(--radius-lg) !important;
  background: #fff !important;
  box-shadow: var(--shadow-card) !important;
}
.panel-title,
.recent-entry-head,
.summary-detail-head {
  border-bottom-color: var(--border);
  background: #fbfcfd;
  color: var(--text-primary);
}
.query-bar,
.form-row,
.summary-toolbar,
.summary-head {
  gap: 10px;
}
.recent-entry-row {
  border-color: var(--border-light);
  background: #fff;
}

.summary-shell,
.shell.summary-mode .summary-shell {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  background: #fff !important;
  box-shadow: var(--shadow-card) !important;
  overflow: hidden;
}
.summary-head,
.shell.summary-mode .summary-head {
  min-height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.summary-view-tabs,
.shell.summary-mode .summary-view-tabs {
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.summary-view-tab,
.shell.summary-mode .summary-view-tab {
  height: 40px;
  padding: 0 13px;
  border: 0;
  border-right: 1px solid var(--divider);
  border-radius: 0;
  background: transparent;
  color: #566070;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: none;
}
.summary-view-tab:hover {
  background: #f8fafc;
  color: var(--text-primary);
}
.summary-view-tab.active,
.summary-view-tab.gantt.active,
.shell.summary-mode .summary-view-tab.active,
.shell.summary-mode .summary-view-tab.gantt.active {
  background: #fff;
  color: var(--text-primary);
  font-weight: 950;
  box-shadow: inset 0 -3px 0 var(--focus);
}
.summary-view-tab .nav-count-badge,
.summary-view-count {
  background: #eef2f7;
  color: #475569;
}
.summary-view-tab.has-risk-badge .summary-view-count,
.summary-view-tab.has-risk-badge .nav-count-badge {
  background: var(--danger);
  color: #fff;
}
.summary-add-view,
.shell.summary-mode .summary-add-view {
  border-color: var(--border);
  background: #f7f8fa;
  color: var(--text-primary);
}
.summary-toolbar,
.shell.summary-mode .summary-toolbar {
  min-height: 38px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}
#summaryFieldsBtn,
#summaryGanttBtn,
#summaryFilterBtn,
#summaryGroupBtn {
  display: none !important;
}
.summary-config-actions {
  gap: 6px;
}
.summary-search {
  min-width: 260px;
  height: 32px;
  border-color: #d9dde5;
  border-radius: var(--radius-sm);
  background: #fff;
}
.summary-search-count.hidden {
  display: none !important;
}
.summary-meta {
  color: var(--text-secondary);
  font-size: 12px;
}
.summary-undo-btn:not(:disabled) {
  border-color: var(--warning-border);
  background: var(--warning-soft);
  color: #8a6200;
}
.summary-icon-btn,
.summary-search-nav {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.summary-status {
  border-color: var(--border);
  background: #fff;
  color: var(--text-secondary);
}
.summary-panel.active {
  border-color: var(--border);
  background: #fff;
  box-shadow: var(--shadow-popover);
}

.summary-table-wrap,
.summary-gantt-wrap {
  background: #fff;
}
.summary-table,
.summary-table-head,
.summary-table-row {
  color: var(--text-primary);
}
.summary-table-head {
  background: #fbfcfd;
  border-bottom: 1px solid var(--border);
}
.summary-table-row {
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}
.summary-table-row:hover,
.summary-table-row.selected,
.summary-table-row.search-current,
.gantt-left-row:hover,
.gantt-left-row.selected,
.gantt-left-row.search-current {
  background: #f7fbff !important;
}
.summary-cell,
.summary-head-cell,
.gantt-left-head div,
.gantt-left-row div {
  border-right-color: var(--border-light) !important;
}
.summary-cell.selected,
.summary-selected-cell {
  box-shadow: inset 0 0 0 2px var(--focus) !important;
  background: #fff !important;
}
.summary-cell.missing-warning,
.gantt-left-row .missing-warning {
  background: #fff8e6 !important;
}
.summary-cell.missing-danger,
.gantt-left-row .missing-danger {
  background: #fff3f1 !important;
}
.summary-cell-text,
.summary-compact-id {
  color: inherit;
}

.summary-badge {
  min-height: 18px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 850;
  line-height: 16px;
  box-shadow: none;
}
.summary-badge.machine-transfer {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: #8a6200;
}
.summary-badge.machine-pocket4 {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.summary-badge.machine-pocket3 {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info);
}
.summary-badge.machine-ordinary {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: #3f6f43;
}
.summary-badge.red,
.summary-badge.region-remote {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}
.summary-badge.blue,
.summary-badge.region-yunnan {
  background: var(--info-soft);
  border-color: var(--info-border);
  color: var(--info);
}
.summary-badge.green,
.summary-badge.lime {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success);
}
.summary-badge.yellow,
.summary-badge.region-hebei {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: #8a6200;
}
.summary-badge.orange,
.summary-badge.region-next-day-plus {
  background: #fff0e6;
  border-color: #ffd2b3;
  color: #b45309;
}
.summary-badge.gray,
.summary-badge.purple {
  background: #f1f3f5;
  border-color: #dde1e8;
  color: #556070;
}

.summary-gantt,
.shell.summary-mode .summary-gantt {
  border-top: 1px solid var(--border);
  background: #fff;
  scrollbar-width: thin;
}
.summary-gantt-inner {
  background: #fff;
}
.gantt-left-head,
.gantt-date-head {
  border-bottom-color: var(--border);
  background: #fff !important;
}
.gantt-left-head {
  box-shadow: 1px 0 0 var(--border);
}
.gantt-date-head {
  box-shadow: 0 1px 0 var(--border);
}
.gantt-month-cell,
.gantt-day-cell {
  border-right: 0;
  background: #fff;
  color: #697386;
  font-size: 11px;
}
.gantt-month-cell {
  color: #4b5563;
  font-weight: 900;
}
.gantt-day-cell {
  border-top: 1px solid var(--border-light);
  box-shadow: inset 1px 0 0 rgba(226, 232, 240, .55);
}
.gantt-day-cell.weekend,
.gantt-timeline-cell.weekend {
  background: #fafafa;
}
.gantt-day-cell.today,
.shell.summary-mode .gantt-day-cell.today {
  background: var(--focus-soft);
  color: var(--focus);
  font-weight: 950;
  box-shadow: inset 0 -2px 0 var(--focus), inset 1px 0 0 rgba(37, 99, 235, .18);
}
.gantt-header-today-line,
.gantt-today-line,
.shell.summary-mode .gantt-header-today-line,
.shell.summary-mode .gantt-today-line,
.shell.summary-mode .gantt-background-grid .gantt-today-line {
  width: 1px;
  background: rgba(37, 99, 235, .82) !important;
  transform: translateX(-.5px);
}
.gantt-header-today-line::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.gantt-background-grid {
  background:
    linear-gradient(90deg, rgba(226, 232, 240, .5) 1px, transparent 1px) 0 0 / var(--gantt-day-width) 100%,
    #fff !important;
}
.gantt-grid-lines {
  display: none !important;
}
.gantt-weekend-band {
  background: #fafafa;
}
.gantt-group-title,
.gantt-group-band {
  border-bottom-color: var(--border-light);
  background: #fbfcfd !important;
}
.gantt-group-title {
  color: var(--text-primary);
  box-shadow: 1px 0 0 var(--border);
}
.gantt-left-row {
  background: #fff;
  box-shadow: 1px 0 0 var(--border);
}
.gantt-row-track {
  border-bottom: 1px solid var(--border-light);
}
.gantt-bar {
  height: 20px;
  border-radius: 7px;
  background: #2f6fed;
  box-shadow: 0 4px 12px rgba(47, 111, 237, .14);
}
.gantt-bar:hover,
.gantt-bar.selected,
.gantt-bar.search-active {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .22), 0 8px 20px rgba(47, 111, 237, .16);
}
.gantt-bar.overdue {
  background: var(--danger);
}
.gantt-bar.conflict {
  outline: 1px solid var(--danger);
  outline-offset: 1px;
}
.gantt-warning,
.gantt-risk-chip,
.gantt-conflict-chip {
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 900;
}
.gantt-controls {
  padding: 7px 10px;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}
.gantt-controls [data-gantt-today] {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #d9dde5;
  background: #fff;
  color: var(--text-primary);
  border-radius: var(--radius-pill);
}
.gantt-navigator {
  border-color: var(--border);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow-card);
}
.gantt-nav-item:hover,
.gantt-nav-item.active {
  background: #f3f6fb;
  color: var(--focus);
}

.summary-detail,
.summary-more-menu,
.summary-select-editor,
#summaryTextEditor {
  border-color: var(--border) !important;
  background: #fff !important;
  box-shadow: var(--shadow-popover) !important;
}
.summary-select-option:hover,
.summary-select-option.active {
  background: #f3f6fb;
}

.mobile-sidebar-scrim {
  display: none;
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }
  .shell {
    display: block;
    min-height: 100dvh;
    background: #fff !important;
  }
  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(82vw, 310px);
    transform: translateX(-104%);
    transition: transform .18s ease;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    box-shadow: 18px 0 44px rgba(34, 34, 34, .14) !important;
  }
  .shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  .mobile-sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    background: rgba(17, 24, 39, .28);
    backdrop-filter: blur(2px);
  }
  .mobile-sidebar-scrim[hidden] {
    display: none !important;
  }
  .sidebar-collapse-btn {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 90;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff !important;
    box-shadow: 0 8px 24px rgba(34, 34, 34, .12);
    transform: translateX(min(85.28vw, 322.4px));
  }
  .shell.sidebar-open .sidebar-collapse-btn {
    transform: none;
  }
  .workspace-main {
    min-width: 0;
    padding: 58px 12px 18px !important;
  }
  .workspace-context {
    display: block;
    padding: 6px 0 14px;
  }
  .workspace-context h2 {
    font-size: 24px;
  }
  .workspace-hint {
    display: none;
  }
  .workspace-content {
    gap: 12px;
  }
  .workspace-aside {
    position: static;
    height: auto;
    padding: 0 12px 18px;
    border-left: 0;
  }
  .card,
  .summary-shell {
    border-radius: 14px !important;
    box-shadow: 0 8px 22px rgba(34, 34, 34, .04) !important;
  }
  .query-bar,
  .order-form-grid,
  .form-row,
  .summary-toolbar,
  .summary-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .query-bar input,
  .query-bar button,
  .summary-search-wrap,
  .summary-search {
    width: 100%;
    min-width: 0;
  }
  .summary-head {
    min-height: 44px;
    padding-left: 8px;
  }
  .summary-view-tabs {
    flex: 1 1 auto;
  }
  .summary-view-tab {
    height: 38px;
    padding: 0 11px;
  }
  .summary-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .summary-actions {
    width: 100%;
  }
  .summary-meta {
    order: 4;
    width: 100%;
  }
  .summary-body,
  .summary-table-wrap,
  .summary-gantt-wrap {
    overflow-x: auto;
  }
  .summary-table,
  .summary-gantt {
    min-width: 920px;
  }
  .summary-gantt {
    --gantt-left-width: 390px;
    --gantt-day-width: 34px;
    height: calc(100dvh - 196px);
    min-height: 520px;
  }
  .gantt-navigator {
    right: 12px;
  }
  .summary-workspace {
    display: block;
  }
  .summary-detail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 95;
    width: auto;
    max-height: 78dvh;
    border-radius: 18px 18px 0 0 !important;
    overflow: auto;
  }
  .recent-entry-card {
    max-height: 46dvh;
    overflow: auto;
  }
}

/* Backend UI V7: global visual foundation.
   White-first work surface, warm off-white page shell, restrained ink/green accents. */
:root {
  --bg-page: #f6f4ee;
  --bg-page-soft: #faf8f2;
  --surface: #ffffff;
  --surface-soft: #fffdf7;
  --surface-muted: #f7f5ee;
  --border: #e8e2d6;
  --border-light: #f1ece4;
  --divider: #eee8dc;
  --text-primary: #242321;
  --text-secondary: #706c64;
  --text-muted: #a29d93;
  --text-disabled: #c5bfb4;
  --primary: #242321;
  --primary-hover: #171715;
  --primary-soft: #f3f0e8;
  --focus: #4f7f4e;
  --focus-soft: #edf6ed;
  --focus-border: #bfd8bf;
  --success: #4f7f4e;
  --success-soft: #edf6ed;
  --success-border: #bfd8bf;
  --warning: #d6a100;
  --warning-soft: #fff4d6;
  --warning-border: #f1d884;
  --danger: #c94d3d;
  --danger-soft: #ffede9;
  --danger-border: #f2b8ae;
  --info: #3b6fd8;
  --info-soft: #eef4ff;
  --info-border: #b8cdf6;
  --shadow-card: 0 10px 28px rgba(36, 35, 33, 0.055);
  --shadow-soft: 0 6px 18px rgba(36, 35, 33, 0.04);
  --shadow-popover: 0 16px 42px rgba(36, 35, 33, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --brand: var(--primary);
  --brand-dark: var(--primary-hover);
  --brand-soft: var(--primary-soft);
  --brand-strong: var(--primary);
  --line: var(--border);
  --line-soft: var(--border-light);
  --muted: var(--text-secondary);
  --page-bg: var(--bg-page);
}

html,
body {
  color: var(--text-primary) !important;
  background: linear-gradient(180deg, #fbfaf6 0%, var(--bg-page) 100%) !important;
}

.shell {
  grid-template-columns: 228px minmax(0, 1fr) 300px !important;
  background: transparent !important;
}

.app-sidebar {
  background: rgba(255, 253, 247, 0.94) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 8px 0 24px rgba(36, 35, 33, 0.035) !important;
  backdrop-filter: blur(12px);
}

.app-sidebar .top {
  color: var(--text-primary) !important;
}

.app-sidebar .top::before {
  background: var(--success) !important;
  opacity: 0.95 !important;
}

.app-sidebar .brand-tag,
.app-sidebar .version-pill {
  background: var(--success-soft) !important;
  color: var(--success) !important;
  border-color: var(--success-border) !important;
}

.sidebar-collapse-btn,
.sync-health-refresh,
.icon-btn,
.summary-icon-btn,
.summary-more-button,
.summary-refresh-button {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
}

.sidebar-collapse-btn:hover,
.icon-btn:hover,
.summary-icon-btn:hover,
.summary-refresh-button:hover,
.summary-more-button:hover {
  background: var(--primary-soft) !important;
  border-color: var(--border) !important;
}

.tab-group {
  background: rgba(255, 255, 255, 0.72) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-soft) !important;
}

.tab-group h2 {
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-light) !important;
}

.tab-group h2::before {
  background: var(--primary) !important;
  opacity: 0.9 !important;
}

.tab {
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.tab::before {
  border-color: #cbd5ca !important;
  background: var(--surface) !important;
}

.tab:hover {
  background: var(--primary-soft) !important;
  color: var(--text-primary) !important;
}

.tab.active {
  background: #f1f5ee !important;
  color: var(--text-primary) !important;
  box-shadow: inset 3px 0 0 var(--success) !important;
  font-weight: 900 !important;
}

.tab.active::before {
  background: var(--success) !important;
  border-color: var(--success) !important;
  box-shadow: none !important;
}

.tab-count-badge,
.summary-tab-count,
.summary-side-badge {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border: 1px solid var(--danger-border) !important;
  box-shadow: none !important;
}

.workspace-main {
  background: transparent !important;
  color: var(--text-primary) !important;
}

.workspace-context {
  border-bottom: 1px solid var(--border) !important;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.72), rgba(255, 255, 255, 0.36)) !important;
}

.workspace-eyebrow {
  color: var(--success) !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

.workspace-context h1,
.panel-title,
.form-section-title,
.recent-entry-head h2,
.sync-health-title {
  color: var(--text-primary) !important;
}

.workspace-context p,
.form-section-desc,
.sync-health-message,
.recent-empty,
.hint,
.muted {
  color: var(--text-secondary) !important;
}

.workspace-aside {
  background: transparent !important;
  border-left: 1px solid var(--border) !important;
}

.card,
.form-section,
.sync-health,
.recent-entry-card,
.duplicate-group,
.duplicate-record,
.status-rule-card,
.activity-row,
.order-card,
.summary-shell,
.summary-detail-drawer,
.summary-debug-panel,
.summary-popover,
.modal-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card) !important;
}

.panel-title,
.recent-entry-head,
.summary-toolbar,
.summary-table-head,
.summary-gantt-toolbar,
.summary-gantt-header,
.form-section-head {
  background: var(--surface-soft) !important;
  border-color: var(--border-light) !important;
}

.form-section-title::before {
  background: var(--primary) !important;
}

input,
select,
textarea,
.summary-search,
.summary-cell-input,
.entry-input,
.entry-select,
.entry-textarea,
.sheet-input,
.sheet-select {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder,
.summary-search::placeholder {
  color: var(--text-muted) !important;
}

input:focus,
select:focus,
textarea:focus,
.summary-search:focus,
.summary-cell-input:focus,
.entry-input:focus,
.entry-select:focus,
.entry-textarea:focus {
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px rgba(79, 127, 78, 0.13) !important;
  outline: 0 !important;
}

button,
.button,
.btn,
.btn-secondary,
.ghost-btn {
  border-radius: var(--radius-sm) !important;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

button:focus-visible,
.button:focus-visible,
.btn:focus-visible,
.btn-secondary:focus-visible,
.ghost-btn:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--focus-border) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(79, 127, 78, 0.14) !important;
}

.btn-primary,
button.primary,
.primary-btn,
.search-button,
.save-button {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: none !important;
}

.btn-primary:hover,
button.primary:hover,
.primary-btn:hover,
.search-button:hover,
.save-button:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: translateY(-1px);
}

.btn-secondary,
.secondary-btn,
.clear-button,
.refresh-button,
.sync-button {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.btn-secondary:hover,
.secondary-btn:hover,
.clear-button:hover,
.refresh-button:hover,
.sync-button:hover {
  background: var(--primary-soft) !important;
}

.sync-health.healthy {
  background: var(--surface) !important;
  border-color: var(--success-border) !important;
}

.sync-health.working,
.sync-health.warning {
  background: var(--warning-soft) !important;
  border-color: var(--warning-border) !important;
}

.sync-health.error {
  background: var(--danger-soft) !important;
  border-color: var(--danger-border) !important;
}

.sync-health.healthy .sync-health-dot {
  background: var(--success) !important;
  box-shadow: 0 0 0 5px rgba(79, 127, 78, 0.13) !important;
}

.sync-health.working .sync-health-dot,
.sync-health.warning .sync-health-dot {
  background: var(--warning) !important;
  box-shadow: 0 0 0 5px rgba(214, 161, 0, 0.15) !important;
}

.sync-health.error .sync-health-dot {
  background: var(--danger) !important;
  box-shadow: 0 0 0 5px rgba(201, 77, 61, 0.13) !important;
}

.recent-entry-item {
  border-color: var(--border-light) !important;
}

.recent-entry-item:hover {
  background: var(--surface-soft) !important;
}

.summary-shell {
  overflow: hidden;
}

.summary-topbar,
.summary-toolbar,
.summary-view-tabs {
  background: var(--surface) !important;
  border-color: var(--border-light) !important;
}

.summary-view-tabs {
  gap: 4px !important;
  padding-inline: 8px !important;
}

.summary-view-tab {
  color: var(--text-secondary) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: inset -1px 0 0 var(--border-light) !important;
}

.summary-view-tab:hover {
  background: var(--primary-soft) !important;
  color: var(--text-primary) !important;
}

.summary-view-tab.active,
.summary-view-tab.gantt.active {
  background: var(--surface-soft) !important;
  color: var(--text-primary) !important;
  font-weight: 900 !important;
  box-shadow: inset 0 -3px 0 var(--focus), inset -1px 0 0 var(--border-light) !important;
}

.summary-toolbar-button,
.summary-tool-btn {
  background: var(--primary-soft) !important;
  color: var(--text-primary) !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm) !important;
}

.summary-toolbar-button:hover,
.summary-tool-btn:hover {
  background: var(--surface-soft) !important;
  border-color: var(--border) !important;
}

.summary-more-menu button {
  border: 1px solid transparent !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  transform: none !important;
}

.summary-more-menu button:hover,
.summary-more-menu button:focus-visible {
  border-color: var(--border) !important;
  background: var(--primary-soft) !important;
  color: var(--text-primary) !important;
}

.summary-more-menu #summaryDeleteViewBtn {
  border-color: var(--danger-border) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.summary-more-menu #summaryDeleteViewBtn:hover,
.summary-more-menu #summaryDeleteViewBtn:focus-visible {
  border-color: var(--danger-border) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
}

.summary-view-action-panel {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 35, 33, .26);
}

.summary-view-action-card {
  display: grid;
  gap: 14px;
  width: min(440px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.summary-view-action-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
}

.summary-view-action-card p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.summary-view-action-card input[type="text"],
.summary-view-action-card > input {
  width: 100%;
}

.summary-view-action-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-view-action-type label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--text-primary);
  font-size: 13px;
}

.summary-view-action-type input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.summary-view-action-help {
  min-height: 18px;
  color: var(--text-secondary);
  font-size: 12px;
}

.summary-view-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.summary-view-action-buttons button {
  min-width: 82px;
}

.app-confirm-panel {
  position: fixed;
  z-index: 10030;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 35, 33, .26);
}

.app-confirm-card {
  display: grid;
  gap: 14px;
  width: min(420px, calc(100vw - 40px));
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
}

.app-confirm-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 16px;
}

.app-confirm-card p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.app-confirm-help {
  min-height: 18px;
  color: var(--text-secondary);
  font-size: 12px;
}

.app-confirm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.app-confirm-buttons button {
  min-width: 82px;
}

.danger-soft-action {
  border-color: var(--danger-border) !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  box-shadow: none !important;
}

.danger-soft-action:hover,
.danger-soft-action:focus-visible {
  border-color: var(--danger) !important;
  background: #ffe1da !important;
  color: var(--danger) !important;
}

#summarySearchPrevBtn:disabled,
#summarySearchPrevBtn:disabled:hover,
#summarySearchNextBtn:disabled,
#summarySearchNextBtn:disabled:hover,
#summaryUndoBtn:disabled,
#summaryUndoBtn:disabled:hover {
  border-color: var(--border-light) !important;
  background: #ebe6dc !important;
  color: var(--text-disabled) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: .66;
  transform: none !important;
}

.summary-meta,
.summary-count-text,
.summary-sync-text {
  color: var(--text-secondary) !important;
}

.summary-table,
.summary-table-body,
.summary-gantt,
.summary-gantt-board {
  background: var(--surface) !important;
}

.summary-table-head {
  color: var(--text-secondary) !important;
  box-shadow: inset 0 -1px 0 var(--border) !important;
}

.summary-table-row {
  border-color: var(--border-light) !important;
  color: var(--text-primary) !important;
}

.summary-table-row:hover {
  background: #fbfaf6 !important;
}

.summary-table-row.selected,
.summary-row-selected,
.summary-table-row.active {
  background: #fff8e8 !important;
}

.summary-cell.selected,
.summary-cell-active,
.summary-table-cell.active {
  box-shadow: inset 0 0 0 2px var(--focus) !important;
  background: #fffdf7 !important;
}

.summary-empty-value,
.summary-cell-empty {
  color: var(--text-muted) !important;
}

.summary-badge,
.badge,
.tag,
.pill {
  min-height: 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill) !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

.summary-badge.machine-transfer,
.summary-badge.transfer,
.summary-badge.yellow {
  background: var(--warning-soft) !important;
  color: #8a6200 !important;
  border-color: var(--warning-border) !important;
}

.summary-badge.machine-pocket4,
.summary-badge.pocket4,
.summary-badge.red {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border-color: var(--danger-border) !important;
}

.summary-badge.machine-pocket3,
.summary-badge.pocket3,
.summary-badge.blue,
.summary-badge.info {
  background: var(--info-soft) !important;
  color: var(--info) !important;
  border-color: var(--info-border) !important;
}

.summary-badge.machine-ordinary,
.summary-badge.green,
.summary-badge.lime,
.summary-badge.region-yunnan,
.summary-badge.success {
  background: var(--success-soft) !important;
  color: #3f6f43 !important;
  border-color: var(--success-border) !important;
}

.summary-badge.region-hebei,
.summary-badge.orange {
  background: var(--warning-soft) !important;
  color: #8a6200 !important;
  border-color: var(--warning-border) !important;
}

.summary-badge.region-next-day-plus,
.summary-badge.region-remote {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border-color: var(--danger-border) !important;
}

.summary-badge.gray {
  background: #f0eee8 !important;
  color: var(--text-secondary) !important;
  border-color: var(--border) !important;
}

.summary-gantt-left,
.summary-gantt-left-head,
.summary-gantt-group,
.summary-gantt-row-left {
  background: var(--surface) !important;
  border-color: var(--border-light) !important;
}

.summary-gantt-header {
  color: var(--text-secondary) !important;
}

.summary-gantt-month,
.summary-gantt-date {
  color: var(--text-secondary) !important;
  border-color: var(--border-light) !important;
}

.summary-gantt-date.today,
.summary-gantt-day.today,
.gantt-day-cell.today {
  background: var(--success-soft) !important;
  color: var(--success) !important;
  box-shadow: inset 0 -2px 0 var(--success) !important;
}

.summary-gantt-today-line,
.gantt-today-line {
  background: var(--success) !important;
  opacity: 0.78 !important;
}

.summary-gantt-grid {
  background-color: var(--surface) !important;
}

.summary-gantt-row {
  border-color: var(--border-light) !important;
}

.summary-gantt-row:hover {
  background: rgba(255, 248, 232, 0.36) !important;
}

.summary-gantt-group {
  background: #fffaf0 !important;
  color: var(--text-primary) !important;
  font-weight: 900 !important;
}

.summary-gantt-bar,
.gantt-bar {
  background: #3b74dd !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 4px 10px rgba(59, 116, 221, 0.18) !important;
}

.summary-gantt-bar.selected,
.gantt-bar.selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--focus), 0 8px 16px rgba(36, 35, 33, 0.12) !important;
}

.summary-popover,
.summary-select-menu,
.floating-editor,
.dropdown-menu {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-popover) !important;
}

.summary-option:hover,
.dropdown-menu button:hover,
.floating-editor-option:hover {
  background: var(--primary-soft) !important;
}

/* Backend UI V7.1: targeted fixes for form controls and summary layout. */
.feishu-control,
.select-control,
.date-control,
.tag-control,
.region-sheet-control .feishu-control {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  transform: none !important;
}

.feishu-control:hover,
.feishu-control:focus,
.select-control:hover,
.select-control:focus,
.date-control:hover,
.date-control:focus,
.tag-control:hover,
.tag-control:focus {
  background: var(--surface-soft) !important;
  border-color: var(--focus-border) !important;
  box-shadow: 0 0 0 3px rgba(79, 127, 78, 0.12) !important;
  transform: none !important;
}

.feishu-control::after {
  border-color: var(--text-secondary) !important;
}

.date-control::before {
  border-color: var(--text-secondary) !important;
}

.quick-yunnan {
  min-width: 48px !important;
  border: 1px solid var(--success-border) !important;
  background: var(--success-soft) !important;
  color: var(--success) !important;
  box-shadow: none !important;
  transform: none !important;
}

.quick-yunnan:hover,
.quick-yunnan:focus {
  border-color: var(--success) !important;
  background: #eef7ec !important;
  color: var(--success) !important;
  box-shadow: 0 0 0 3px rgba(79, 127, 78, 0.12) !important;
  transform: none !important;
}

.feishu-control .control-tag {
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-tool-field .feishu-control,
.sheet-field .feishu-control {
  min-height: 36px !important;
  border-radius: var(--radius-sm) !important;
}

#renewView .query-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 14px !important;
  align-items: stretch;
}

#renewView #renewSearchInput {
  width: 100%;
  min-width: 0;
}

#renewView #renewSearchBtn {
  width: auto !important;
  min-width: 128px;
  margin-left: 0 !important;
  white-space: nowrap;
}

/* Backend UI V7.2: fix opened select popovers and keep summary sidebar aligned with other pages. */
#floatingControlPopover,
.floating-control-popover {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-popover) !important;
}

.floating-control-popover .popover-search,
.floating-control-popover .popover-option-list {
  background: var(--surface) !important;
}

.floating-control-popover .popover-search input {
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.floating-control-popover .popover-option {
  background: transparent !important;
  color: var(--text-primary) !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.floating-control-popover .popover-option:hover,
.floating-control-popover .popover-option.active {
  background: var(--primary-soft) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  transform: none !important;
}

.floating-control-popover .popover-option .option-tag {
  background: var(--success-soft) !important;
  color: var(--success) !important;
  border: 1px solid var(--success-border) !important;
  border-radius: var(--radius-pill) !important;
}

@media (max-width: 760px) {
  #renewView .query-bar {
    grid-template-columns: 1fr;
  }

  #renewView #renewSearchBtn {
    width: 100% !important;
  }
}

@media (max-width: 900px) {
  .shell {
    background: var(--bg-page) !important;
  }
  .app-sidebar {
    background: var(--surface-soft) !important;
  }
  .workspace-main {
    background: transparent !important;
  }
  .card,
  .form-section,
  .sync-health,
  .recent-entry-card,
  .summary-shell {
    border-radius: var(--radius-md) !important;
  }
}

.hidden { display: none !important; }
/* Sidebar consistency hotfix: order summary must not restyle the global navigation. */
@media (min-width: 901px) {
.app-sidebar {
  width: auto !important;
  min-width: 0 !important;
  padding: 18px 14px !important;
  background: rgba(255, 253, 247, 0.94) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: 8px 0 24px rgba(36, 35, 33, 0.035) !important;
  backdrop-filter: blur(12px) !important;
}

.app-sidebar .top {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-height: 0 !important;
  margin: 0 0 16px !important;
  padding: 10px 8px 16px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--divider) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.app-sidebar .brand {
  color: var(--success) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

.app-sidebar h1 {
  margin: 3px 0 0 !important;
  color: var(--text-primary) !important;
  font-size: 25px !important;
  line-height: 1.08 !important;
  font-weight: 950 !important;
  letter-spacing: 0 !important;
}

.app-sidebar .desc,
.app-sidebar .login-state {
  color: var(--text-secondary) !important;
  font-size: 12px !important;
}

.app-sidebar .pill {
  width: max-content !important;
  padding: 6px 10px !important;
  border: 1px solid var(--success-border) !important;
  background: var(--success-soft) !important;
  color: var(--success) !important;
  font-size: 12px !important;
  box-shadow: none !important;
}

.app-sidebar .logout-btn {
  width: 100% !important;
  height: 36px !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  box-shadow: none !important;
}

.tabs {
  display: grid !important;
  gap: 14px !important;
  margin: 0 !important;
}

.tab-group {
  display: block !important;
  margin: 0 !important;
  padding: 0 0 14px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--divider) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.tab-group-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 0 !important;
  margin: 0 0 8px !important;
  padding: 0 10px !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

.tab-group-title::before {
  width: 3px !important;
  height: 14px !important;
  margin: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: var(--success) !important;
  box-shadow: none !important;
  content: "" !important;
}

.tab {
  position: relative !important;
  width: 100% !important;
  height: 38px !important;
  padding: 0 12px 0 32px !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-md) !important;
  background: transparent !important;
  color: var(--text-secondary) !important;
  text-align: left !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  box-shadow: none !important;
  transform: none !important;
}

.tab::before {
  left: 13px !important;
  width: 7px !important;
  height: 7px !important;
  border: 1.5px solid var(--text-muted) !important;
  border-radius: var(--radius-pill) !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

.tab:hover {
  border-color: var(--border) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}

.tab.active {
  border-color: var(--border) !important;
  background: var(--primary-soft) !important;
  color: var(--text-primary) !important;
  font-weight: 950 !important;
  box-shadow: inset 3px 0 0 var(--primary) !important;
}

.tab.active::before {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
}

.nav-count-badge {
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border: 1px solid var(--danger-border) !important;
  box-shadow: none !important;
}

.shell.summary-mode.sidebar-collapsed .app-sidebar {
  padding: 16px 8px !important;
}

.shell.summary-mode.sidebar-collapsed .tab {
  padding: 0 !important;
}
}

@media (max-width: 900px) {
  .shell {
    display: block !important;
    min-height: 100dvh;
    background: var(--bg-page) !important;
  }

  .app-sidebar {
    position: sticky !important;
    inset: auto !important;
    top: 0 !important;
    z-index: 80 !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 9px 10px 0 !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    background: rgba(255, 253, 247, 0.98) !important;
    box-shadow: 0 6px 18px rgba(34, 34, 34, .04) !important;
    transform: none !important;
    transition: none !important;
  }

  .mobile-sidebar-scrim,
  .sidebar-collapse-btn {
    display: none !important;
  }

  .app-sidebar .top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 4px 2px 8px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .app-sidebar .brand {
    display: none !important;
  }

  .app-sidebar h1 {
    margin: 1px 0 0 !important;
    font-size: 18px !important;
    line-height: 1.16 !important;
    white-space: nowrap !important;
  }

  .app-sidebar .desc,
  .app-sidebar .pill {
    display: none !important;
  }

  .app-sidebar .top-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    margin: 0 !important;
  }

  .app-sidebar .login-state {
    max-width: 140px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .app-sidebar .logout-btn {
    width: auto !important;
    min-width: 52px !important;
    height: 32px !important;
    padding: 0 10px !important;
  }

  .tabs {
    display: flex !important;
    gap: 10px !important;
    align-items: stretch !important;
    margin: 0 !important;
    padding: 0 0 8px !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    scrollbar-width: none !important;
  }

  .tabs::-webkit-scrollbar {
    display: none !important;
  }

  .tab-group {
    display: flex !important;
    flex: 0 0 auto !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  .tab-group-title {
    display: none !important;
  }

  .tab {
    flex: 0 0 auto !important;
    width: auto !important;
    height: 36px !important;
    padding: 0 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    background: var(--surface) !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  @media (max-width: 760px) {
    .tabs {
      flex-wrap: wrap !important;
      gap: 6px !important;
      padding-bottom: 8px !important;
      overflow: visible !important;
    }

    .tab-group {
      flex-wrap: wrap !important;
      gap: 5px !important;
      min-width: 0 !important;
    }

    .tab {
      height: 34px !important;
      padding: 0 10px !important;
      font-size: 13px !important;
    }
  }

  .tab::before {
    display: none !important;
  }

  .tab.active {
    border-color: var(--success-border) !important;
    background: var(--success-soft) !important;
    color: var(--text-primary) !important;
    box-shadow: inset 0 -2px 0 var(--success) !important;
  }

  .workspace-main {
    min-width: 0 !important;
    padding: 13px 10px 24px !important;
  }
}

/* Shell normalization round 2: order summary keeps its data workbench, not a separate app shell. */
html {
  scrollbar-gutter: stable;
  color-scheme: light;
}

select,
select option,
select optgroup {
  color-scheme: light !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
}

@media (min-width: 901px) {
  .shell {
    grid-template-columns: 232px minmax(0, 1fr) 314px !important;
  }

  .shell.summary-mode {
    grid-template-columns: 232px minmax(0, 1fr) !important;
  }

  .shell.summary-mode.sidebar-collapsed {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }

  .shell.summary-mode .workspace-aside {
    display: none !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .shell.summary-mode .workspace-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    padding-right: 0 !important;
  }

  .shell.summary-mode .workspace-content,
  .shell.summary-mode #summaryView,
  .shell.summary-mode .summary-shell {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }
}

@media (min-width: 901px) {
  body.summary-mode-active {
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode {
    height: 100vh;
    min-height: 100vh;
    align-items: stretch;
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode .workspace-main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode .workspace-content {
    display: flex;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode #summaryView,
  body.summary-mode-active .shell.summary-mode .summary-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode .summary-workspace {
    display: flex;
    flex: 1 1 auto;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode .summary-body.table-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.summary-mode-active .shell.summary-mode .summary-body.table-body .summary-table-wrap {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
  }
}

/* UI repair: keep the status/recent-entry rail in the desktop third column. */
@media (min-width: 901px) {
  .shell:not(.summary-mode) .workspace-aside {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: start;
    display: block;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 16px 18px 0;
    overflow-y: auto;
  }
}

/* UI repair: order-entry grids must fit beside the desktop status rail. */
.sheet-create-view .calculator-fields {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.sheet-create-view .calculator-apply {
  width: 100%;
  min-width: 0;
}

.sheet-create-view .identity-fields {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.sheet-create-view .fulfillment-fields {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.sheet-create-view .detail-fields {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* UI repair: final calendar popover guard against later global button rules. */
.floating-control-popover.calendar-popover {
  width: 248px !important;
  max-height: none !important;
  background: var(--surface, #fff) !important;
  overflow: visible !important;
}

.floating-control-popover.calendar-popover .calendar-nav button,
.floating-control-popover.calendar-popover .calendar-foot button {
  background: transparent !important;
  color: var(--brand-dark, #335f36) !important;
  box-shadow: none !important;
  transform: none !important;
}

.floating-control-popover.calendar-popover .calendar-day {
  background: transparent !important;
  color: var(--text-primary, #242321) !important;
  box-shadow: none !important;
  transform: none !important;
}

.floating-control-popover.calendar-popover .calendar-day.outside {
  color: var(--text-muted, #9ca3af) !important;
}

.floating-control-popover.calendar-popover .calendar-day.today:not(.selected) {
  background: var(--success-soft, #eaf6ed) !important;
  color: var(--success, #4f7f4e) !important;
  box-shadow: inset 0 0 0 1px var(--success, #4f7f4e) !important;
}

.floating-control-popover.calendar-popover .calendar-day.selected {
  background: var(--brand, #4f7f4e) !important;
  color: #fff !important;
  box-shadow: 0 0 0 2px rgba(79, 127, 78, 0.18) !important;
}

.floating-control-popover.calendar-popover .calendar-day:hover:not(.selected) {
  background: var(--brand-soft, #edf4ef) !important;
  color: var(--brand-dark, #335f36) !important;
}
