:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --border: #d8dee5;
  --text: #23303b;
  --muted: #607080;
  --accent: #1f5aa6;
  --ok: #197d4d;
  --err: #b33a3a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.login-page {
  min-height: 100vh;
  background: #f4f7fb;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 18px;
}

.login-card {
  width: min(100%, 420px);
  padding: 34px;
  border: 1px solid #dbe4ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(31, 50, 70, .08);
}

.login-logo {
  display: block;
  width: 148px;
  height: auto;
  margin-bottom: 30px;
}

.login-card h1 {
  margin: 0 0 8px;
  color: #1f2d3a;
  font-size: 26px;
  line-height: 1.2;
}

.login-card p {
  margin: 0 0 24px;
  color: #607080;
  font-size: 14px;
  line-height: 1.6;
}

.login-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #f2c4c4;
  border-radius: 7px;
  color: #a92727;
  background: #fff4f4;
  font-size: 13px;
  font-weight: 650;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #34495e;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-color: #d5dee8;
  color: #1f2d3a;
  background: #fff;
}

.login-form button {
  min-height: 44px;
  margin-top: 4px;
  font-weight: 750;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}

.brand {
  font-weight: 700;
}

.nav a {
  color: var(--muted);
  margin-left: 12px;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
}

.nav a.active, .nav a:hover {
  color: #fff;
  background: var(--accent);
}

.container {
  padding: 20px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.card h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.card p { margin: 0; font-size: 24px; font-weight: 700; }

.charts {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.chart-card canvas { max-height: 260px; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

input, select, button {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  padding: 7px 10px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

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

th, td {
  border-bottom: 1px solid var(--border);
  padding: 8px;
  text-align: left;
  white-space: nowrap;
}

.msg {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 8px;
}

.msg-success { background: #e8f6ee; color: var(--ok); }
.msg-error { background: #fdecec; color: var(--err); }
.msg-info { background: #eaf1fb; color: var(--accent); }

.inline-check {
  justify-content: flex-start;
}

.inline-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-time input {
  width: 72px;
}

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

.job-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.html-uploader {
  margin-bottom: 16px;
}

.uploader-dropzone {
  margin: 10px 0 12px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  background: #fbfcfe;
}

.uploader-dropzone.dragover {
  border-color: var(--accent);
  background: #eef4fe;
}

.uploader-config {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 8px 0 10px;
}

.uploader-config label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.uploader-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.uploader-row-success {
  background: #eef9f1;
}

.uploader-row-failed {
  background: #fdf0f0;
}

.copy-url-btn {
  margin-left: 6px;
  padding: 4px 7px;
  font-size: 12px;
}

/* Quote management */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-heading h1 {
  margin: 3px 0 4px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.page-subtitle, .section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
}

.button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
}

.primary-action { min-width: 108px; }
.secondary-button, button.secondary-button, a.secondary-button {
  color: var(--accent);
  background: #fff;
  border-color: #9eb6d6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 112px;
  padding: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text);
  text-decoration: none;
}

.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 23px; letter-spacing: -.02em; }
.metric-card small { color: var(--muted); font-size: 11px; }
.metric-link:hover { border-color: var(--accent); }
.metric-warn { border-left: 4px solid #d28a20; }
.metric-danger { border-left: 4px solid var(--err); }

.section-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

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

.section-header h2 {
  display: inline-block;
  margin: 0 0 4px;
  font-size: 17px;
}
.section-actions { display: flex; align-items: center; gap: 8px; }

.quote-filters input[type="search"] { min-width: 250px; flex: 1; }
.quote-table-wrap { border: 0; border-radius: 0; }
.quote-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.quote-table td { padding: 12px 8px; vertical-align: middle; }
.quote-table tr:last-child td { border-bottom: 0; }
.row-overdue { background: #fff8f7; }
.table-primary { display: block; color: var(--accent); font-weight: 700; text-decoration: none; margin-bottom: 3px; }
.table-secondary { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.text-danger { color: var(--err) !important; }

.status-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 4px 8px;
  background: #edf1f4;
  color: #53616d;
  font-size: 11px;
  font-weight: 700;
}

.status-sent, .status-acknowledged { background: #e9f1fb; color: #245b9e; }
.status-technical_discussion, .status-commercial_negotiation, .status-awaiting_decision { background: #fff4dc; color: #886018; }
.status-won { background: #e8f6ee; color: var(--ok); }
.status-lost, .status-expired { background: #fdecec; color: var(--err); }
.status-on_hold { background: #f1ecfa; color: #684995; }

.empty-state { padding: 45px 16px; text-align: center; white-space: normal; }
.empty-state h3 { margin: 0 0 7px; }
.empty-state p { margin: 0 0 18px; color: var(--muted); }
.compact-heading { align-items: flex-start; }
.back-link { display: inline-block; color: var(--accent); text-decoration: none; font-size: 13px; margin-bottom: 8px; }

.form-section { padding: 20px; }
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  margin-right: 8px;
  border-radius: 5px;
  background: #eaf1fb;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
}

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

.form-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-3 { grid-column: 1 / -1; }
.form-grid label, .stack-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #43515c;
  font-size: 12px;
  font-weight: 600;
}

.form-grid input, .form-grid select, .form-grid textarea,
.stack-form input, .stack-form select, .stack-form textarea {
  width: 100%;
  color: var(--text);
  background: #fff;
}

.quote-form-page .custom-select-control { position: relative; width: min(100%, 280px); }
.quote-form-page [hidden] { display: none !important; }
.quick-quote-form .custom-select-control { position: relative; width: 100%; }
.quote-form-page .item-grid .custom-select-control { width: 100%; }
.quote-form-page .custom-select-native, .quick-quote-form .custom-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}
.quick-quote-form .custom-select-trigger { min-height: 42px; }
.custom-select-trigger:hover { border-color: #9eb6d6; background: #fff; }
.custom-select-trigger:focus-visible { outline: 3px solid rgba(31,90,166,.18); border-color: var(--accent); }
.custom-select-trigger i { color: #657482; font-size: 12px; transition: transform .15s ease; }
.custom-select-control.is-open .custom-select-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,90,166,.12); }
.custom-select-control.is-open .custom-select-trigger i { transform: rotate(180deg); }
.custom-select-menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #bfd0e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28,48,69,.18);
}
.custom-select-control.open-up .custom-select-menu { top: auto; bottom: calc(100% + 5px); }
.custom-select-menu[hidden] { display: none; }
.custom-select-option {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  color: #273646;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
}
.custom-select-option:hover, .custom-select-option:focus-visible { color: var(--accent); background: #edf4fd; outline: none; }
.custom-select-option.selected { color: var(--accent); background: #e7f0fc; font-weight: 700; }

textarea { resize: vertical; font-family: inherit; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.required { display: inline; flex: 0 0 auto; color: var(--err); white-space: nowrap; }
.field-title { display: inline-flex; width: fit-content; max-width: 100%; flex-direction: row; align-items: baseline; gap: 3px; white-space: nowrap; }
.field-title .required { display: inline; flex: 0 0 auto; }
.drawing-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px dashed #9eb6d6;
  border-radius: 9px;
  background: #f8fbff;
  color: #43515c;
  font-size: 12px;
  font-weight: 600;
}
.drawing-upload input { width: 100%; background: #fff; }
.drawing-upload small { color: var(--muted); font-weight: 400; }
.model-asset-upload-section .section-header { margin-bottom: 12px; }
.model-asset-upload-list { display: flex; flex-direction: column; gap: 10px; }
.model-asset-upload-item { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(240px, 1.2fr); gap: 12px; align-items: end; padding: 13px; border: 1px solid #e0e7ee; border-radius: 8px; background: #fbfcfd; }
.model-asset-upload-item > div:first-child { align-self: center; min-width: 0; }
.model-asset-upload-item strong, .model-asset-upload-item span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-asset-upload-item strong { color: #1d2b39; font-size: 13px; }
.model-asset-upload-item span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.model-asset-upload-item label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #53616f; font-size: 11px; font-weight: 650; }
.model-asset-upload-item select, .model-asset-upload-item input { width: 100%; min-width: 0; background: #fff; }
.customer-attachment-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #d6e2ee;
  border-radius: 8px;
  background: #f8fbff;
}
.customer-attachment-box > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.customer-attachment-box strong { font-size: 13px; }
.customer-attachment-box span { color: var(--muted); font-size: 12px; }
.customer-attachment-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 74px;
  padding: 14px;
  border: 1px dashed #9eb6d6;
  border-radius: 7px;
  color: #345b86;
  background: #fff;
  cursor: pointer;
  text-align: center;
}
.customer-attachment-drop:focus-within,
.customer-attachment-drop:focus-visible,
.customer-attachment-box.has-pasted .customer-attachment-drop {
  outline: 3px solid rgba(31, 90, 166, .14);
  border-color: var(--accent);
}
.customer-attachment-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.customer-attachment-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.customer-attachment-list li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 6px;
  color: #244d78;
  background: #eaf2fc;
  font-size: 11px;
}
.project-link-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.project-link-heading { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.project-link-heading span { color: var(--muted); font-size: 12px; font-weight: 400; }
.autofill-notice, .attachment-reuse-note { margin: 10px 0 0; padding: 9px 11px; border: 1px solid #bdd3ec; border-radius: 7px; color: #245b91; background: #f1f7fd; font-size: 12px; line-height: 1.5; }
.project-link-form { display: flex; flex-direction: column; gap: 12px; }
.project-link-form > button { align-self: flex-start; }
.current-project-card { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; padding: 12px; border: 1px solid #bfd0e4; border-radius: 8px; background: #f4f8fd; }
.current-project-card span, .current-project-card small { color: var(--muted); font-size: 11px; }
.related-quotes { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.related-quotes h3 { margin: 0 0 4px; font-size: 14px; }
.related-quotes > p { margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.related-quotes article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf0f3; }
.related-quotes article div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.related-quotes article span { color: var(--muted); font-size: 11px; }
.related-quotes article button { white-space: nowrap; }

.quote-context-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.quote-context-strip div, .info-grid div { display: flex; flex-direction: column; gap: 5px; }
.quote-context-strip span, .info-grid span, .notes-grid span { color: var(--muted); font-size: 11px; }
.line-header { align-items: center; }
.quote-items { display: flex; flex-direction: column; gap: 12px; }
.quote-item-row { border: 1px solid var(--border); border-radius: 9px; padding: 14px; background: #fbfcfd; }
.item-row-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.item-row-actions { display: inline-flex; align-items: center; gap: 10px; }
.text-button { border: 0; background: transparent; color: var(--err); padding: 3px; font-size: 12px; }
.item-ai-fill-button { color: var(--accent); font-weight: 750; }
.item-grid { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
.item-grid .span-2 { grid-column: span 2; }
.item-financial {
  grid-column: span 2;
  border-left: 3px solid #9eb6d6;
  padding: 4px 0 4px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.item-financial span, .item-financial small { color: var(--muted); font-size: 11px; }
.item-financial strong { margin: 3px 0; font-size: 18px; }
.replacement-plan-box {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid #d7e2ee;
  border-radius: 8px;
  background: #f7f9fc;
}
.replacement-plan-box[hidden] { display: none !important; }
.replacement-plan-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.replacement-plan-title strong { font-size: 13px; }
.replacement-plan-title div { display: grid; gap: 2px; min-width: 0; }
.replacement-plan-title span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.replacement-plan-title label { display: flex; flex-direction: column; gap: 4px; color: #53616f; font-size: 11px; font-weight: 650; }
.replacement-plan-box .form-grid.three-cols {
  grid-template-columns: minmax(150px, .75fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
}
.replacement-plan-box label.span-3 { grid-column: 1 / -1; }
.item-autofill-modal[hidden] { display: none !important; }
.item-autofill-modal { position: fixed; inset: 0; z-index: 82; display: grid; place-items: center; padding: 28px; }
.item-autofill-backdrop { position: absolute; inset: 0; background: rgba(25, 38, 52, .42); }
.item-autofill-card { position: relative; z-index: 1; display: grid; gap: 13px; width: min(680px, calc(100vw - 56px)); padding: 18px; border: 1px solid #dbe5ef; border-radius: 8px; background: #fff; box-shadow: 0 24px 72px rgba(18, 31, 48, .22); }
.item-autofill-card header, .item-autofill-card footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.item-autofill-card h3 { margin: 0; font-size: 18px; }
.item-autofill-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.item-autofill-card textarea { width: 100%; min-height: 190px; resize: vertical; font: inherit; line-height: 1.55; }
.item-autofill-result { padding: 9px 11px; border: 1px solid #d8e6f4; border-radius: 7px; color: #2a4b6d; background: #f5f9fe; font-size: 12px; line-height: 1.5; }
.parameter-match-entry {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px dashed #c7d6e8;
  border-radius: 8px;
  background: #f8fbff;
}
.parameter-match-entry span { color: var(--muted); font-size: 11px; }
.replacement-mapping-list { display: grid; gap: 10px; }
.replacement-mapping-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 13px; border: 1px solid #dce5ee; border-radius: 8px; background: #fbfcfd; }
.replacement-mapping-card strong, .replacement-mapping-card span, .replacement-mapping-card small { display: block; }
.replacement-mapping-card span { margin-top: 4px; color: #53616f; font-size: 12px; }
.replacement-mapping-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.replacement-mapping-card p { margin: 8px 0 0; color: #334454; font-size: 12px; line-height: 1.5; }
.replacement-mapping-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; align-items: center; }
.replacement-mapping-actions form { display: flex; gap: 6px; align-items: center; margin: 0; }
.replacement-mapping-actions select { min-width: 120px; min-height: 30px; padding: 4px 7px; font-size: 12px; }
.replacement-mapping-create { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef2f5; }
.replacement-mapping-create summary { cursor: pointer; color: var(--accent); font-weight: 800; }
.quote-total-box { border: 1px solid #bfd0e4; border-radius: 8px; padding: 10px 12px; background: #f4f8fd; display: flex; flex-direction: column; }
.quote-total-box span, .quote-total-box small { color: var(--muted); font-size: 11px; }
.quote-total-box strong { margin: 4px 0; font-size: 20px; color: var(--accent); }
.parameter-summary .metric-grid { grid-template-columns: repeat(4, minmax(160px, 1fr)); }
.parameter-summary .metric-grid article {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfd;
}
.parameter-summary .metric-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.parameter-summary .metric-grid strong { font-size: 19px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.soft-tag, .warning-tag, .muted-tag, .rank-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}
.soft-tag { color: #245b9e; background: #eaf2fb; }
.warning-tag { color: #8a5c08; background: #fff3d6; }
.muted-tag { color: #657384; background: #eef2f5; }
.rank-badge { color: #fff; background: var(--accent); }
.match-result-card {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #fbfcfd;
}
.match-result-card + .match-result-card { margin-top: 12px; }
.match-result-main {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.match-result-main h3 { margin: 6px 0 2px; font-size: 20px; }
.match-result-main p { margin: 0; color: var(--muted); }
.match-score { text-align: right; min-width: 120px; }
.match-score strong { display: block; font-size: 30px; color: var(--accent); }
.match-score span { color: var(--muted); font-size: 12px; }
.match-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.match-columns > div {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fff;
}
.match-columns h4 {
  flex-basis: 100%;
  margin: 0 0 4px;
  color: #53616f;
  font-size: 12px;
}

.sticky-form-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  margin-top: 16px;
  border: 1px solid #b8c7d6;
  border-radius: 10px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 26px rgba(27, 42, 58, .14);
}
.sticky-form-actions > div { display: flex; gap: 8px; align-items: center; }
.sticky-form-actions span { color: var(--muted); font-size: 12px; }
.sticky-form-actions strong { font-size: 18px; }

.quote-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 32, 45, .28);
}
.quote-drawer-backdrop[hidden], .quote-drawer[hidden] { display: none !important; }
.quote-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 81;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(780px, 78vw);
  background: #fff;
  border-left: 1px solid var(--border);
  box-shadow: -14px 0 36px rgba(27, 42, 58, .18);
}
.quote-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.quote-drawer-header div { display: grid; gap: 3px; min-width: 0; }
.quote-drawer-header strong { font-size: 16px; }
.quote-drawer-header span { color: var(--muted); font-size: 12px; }
.quote-drawer iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.title-with-status { display: flex; align-items: center; gap: 10px; }
.title-with-status h1 { margin-bottom: 0; }
.heading-actions { display: flex; gap: 8px; }
.quote-summary-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.summary-hero, .summary-stat { border-radius: 10px; padding: 16px; min-height: 112px; display: flex; flex-direction: column; justify-content: space-between; }
.summary-hero { background: #173f70; color: #fff; }
.summary-hero span, .summary-hero small { color: #c8daee; font-size: 12px; }
.summary-hero strong { font-size: 28px; }
.summary-stat { background: #fff; border: 1px solid var(--border); }
.summary-stat span, .summary-stat small { color: var(--muted); font-size: 11px; }
.summary-stat strong { font-size: 19px; }
.summary-stat .summary-date, .summary-stat .summary-text { font-size: 15px; }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.detail-sidebar { position: sticky; top: 12px; }
.version-chip { border: 1px solid #bfd0e4; border-radius: 999px; padding: 4px 8px; color: var(--accent); font-size: 11px; }
.clean-table-wrap { border-radius: 7px; }
.clean-table-wrap th { background: #f6f8fa; color: var(--muted); }
.clean-table-wrap tfoot td { text-align: right; font-weight: 600; }
.clean-table-wrap .total-row td { color: var(--accent); font-size: 14px; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.notes-grid div { padding: 11px; border-radius: 7px; background: #f7f9fa; }
.notes-grid p { margin: 6px 0 0; font-size: 13px; white-space: pre-wrap; }
.version-list { display: flex; flex-direction: column; gap: 8px; }
.version-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 11px 12px; }
.version-row.current-version { border-color: #9eb6d6; background: #f6f9fd; }
.version-row div { display: flex; flex-direction: column; gap: 3px; }
.version-row span { color: var(--muted); font-size: 11px; }
.version-row a { color: var(--accent); text-decoration: none; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-grid strong, .info-grid p { margin: 0; font-size: 13px; word-break: break-word; }
.info-grid a { color: var(--accent); }
.action-card .section-header { margin-bottom: 12px; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.lost-reason-field { display: none !important; }
.lost-reason-field.visible { display: flex !important; }
.attachment-form { display: flex; flex-direction: column; gap: 8px; }
.attachment-form input { width: 100%; font-size: 12px; }
.attachment-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.attachment-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.attachment-list a { display: flex; justify-content: space-between; min-width: 0; gap: 8px; color: var(--accent); text-decoration: none; font-size: 12px; }
.attachment-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-list small { color: var(--muted); }
.technical-pack-list { margin-top: -2px; }
.technical-pack-heading { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.technical-pack-heading strong { font-size: 14px; }
.technical-pack-heading span { color: var(--muted); font-size: 12px; }
.technical-pack-item { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; padding: 14px 0; border-top: 1px solid #eef2f5; }
.technical-pack-item:first-of-type { border-top: 0; }
.technical-pack-item > div:first-child strong { display: block; font-size: 13px; }
.technical-pack-item > div:first-child span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.technical-pack-pending { opacity: .82; }
.technical-pending-note { padding: 11px 12px; border: 1px dashed #bfd0e4; border-radius: 7px; color: #667483; background: #f8fbff; font-size: 12px; }
.technical-attachment-form { display: flex; min-width: 0; flex-direction: column; gap: 10px; }
.technical-create-upload-list { display: flex; flex-direction: column; gap: 10px; }
.technical-create-upload-item { grid-template-columns: minmax(220px, .8fr) minmax(420px, 2fr); padding: 13px; border: 1px solid #e0e7ee; border-radius: 8px; background: #fbfcfd; }
.technical-create-upload-item .technical-file-actions,
.technical-create-upload-item .technical-catalog-evidence-picker { grid-column: 2; }
.technical-create-upload-item label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #53616f; font-size: 11px; font-weight: 650; }
.technical-create-upload-item select, .technical-create-upload-item input { width: 100%; min-width: 0; background: #fff; }
.technical-type-options { display: flex; flex-wrap: wrap; gap: 7px; }
.technical-type-options label { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 9px; border: 1px solid #d6e0ea; border-radius: 6px; color: #4f6174; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.technical-type-options input { width: auto; margin: 0; accent-color: var(--accent); }
.technical-type-options label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: #eef4fd; }
.technical-file-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.technical-file-actions input { width: 100%; }
.technical-attachment-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.attachment-row.compact a { display: flex; justify-content: space-between; gap: 10px; min-width: 0; color: var(--accent); text-decoration: none; font-size: 12px; }
.attachment-row.compact a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-row.compact small { color: var(--muted); white-space: nowrap; }
.technical-attachment-card { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 11px; align-items: center; min-width: 0; padding: 8px; border: 1px solid #e4ebf2; border-radius: 7px; background: #fff; }
.attachment-preview-button { display: flex; width: 82px; height: 64px; align-items: center; justify-content: center; overflow: hidden; padding: 0; border: 0; border-radius: 7px; color: #708091; background: #edf2f6; cursor: zoom-in; }
.attachment-preview-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-preview-button.file-preview { cursor: pointer; text-decoration: none; }
.attachment-preview-button i { font-size: 24px; }
.attachment-info-link { display: grid !important; justify-content: stretch !important; gap: 3px !important; min-width: 0; padding: 0; border: 0; color: var(--accent); background: transparent; text-align: left; cursor: zoom-in; font: inherit; }
.attachment-info-link span { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 750; line-height: 1.35; }
.attachment-info-link small { color: var(--muted); font-size: 12px; line-height: 1.35; white-space: normal; }
.detail-main .technical-pack-list { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eef2f5; }
.detail-main .technical-pack-heading { align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.detail-main .technical-pack-heading strong { flex: 0 0 auto; color: #1d2b39; font-size: 16px; }
.detail-main .technical-pack-heading span { max-width: 720px; line-height: 1.55; }
.detail-main .technical-pack-item { grid-template-columns: minmax(190px, 270px) minmax(0, 1fr); gap: 10px 18px; padding: 16px 0; }
.detail-main .technical-pack-item > div:first-child strong { font-size: 15px; line-height: 1.35; }
.detail-main .technical-pack-item > div:first-child span { font-size: 13px; line-height: 1.45; }
.detail-main .technical-attachment-form { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 82px; gap: 8px; align-items: center; }
.detail-main .technical-attachment-form select,
.detail-main .technical-attachment-form input[type="file"] { min-height: 38px; padding: 7px 10px; font-size: 13px; }
.detail-main .technical-attachment-form button { min-height: 38px; padding: 7px 10px; white-space: nowrap; }
.detail-main .technical-attachment-list { grid-column: 2; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 2px; }
.detail-main .attachment-row.compact { min-height: 0; }
.detail-main .attachment-row.compact a { align-items: center; font-size: 13px; }
.offered-model-asset-panel { grid-column: 2; margin-top: 10px; padding: 12px; border: 1px solid #dfe8f1; border-radius: 8px; background: #f8fbfe; }
.customer-provided-asset-panel .technical-attachment-list { grid-column: auto; margin-top: 0; }
.customer-provided-asset-panel .technical-attachment-card { border-color: #e4ebf2; }
.sample-library-evidence-panel { grid-column: 2; margin-top: 10px; padding: 12px; border: 1px solid #cfe0f2; border-radius: 8px; background: #f4f8fd; }
.offered-model-asset-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.offered-model-asset-heading strong { color: #1d2b39; font-size: 13px; }
.offered-model-asset-heading span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.offered-model-asset-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.offered-model-asset-row { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 9px; align-items: center; min-width: 0; padding: 8px; border: 1px solid #e4ebf2; border-radius: 7px; color: inherit; background: #fff; text-decoration: none; }
.offered-model-asset-preview-button { width: 100%; border: 1px solid #e4ebf2; text-align: left; cursor: zoom-in; font: inherit; }
.offered-model-asset-row.quote-print-asset { border-color: #b9d2ee; background: #f1f7fd; }
.offered-model-asset-row.sample-library-evidence-row { border-color: #cfe0f2; }
.sample-library-evidence-panel .offered-model-asset-list { grid-template-columns: minmax(0, 1fr); }
.sample-library-evidence-panel .offered-model-asset-heading { align-items: flex-start; }
.sample-library-evidence-panel .offered-model-asset-heading span { white-space: normal; line-height: 1.45; }
.sample-library-evidence-panel .offered-model-asset-row strong,
.sample-library-evidence-panel .offered-model-asset-row small { overflow: visible; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; line-height: 1.35; }
.sample-library-pick-row { grid-template-columns: minmax(0, 1fr) minmax(170px, 210px); align-items: stretch; }
.sample-library-preview-link { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 9px; align-items: center; min-width: 0; color: inherit; text-decoration: none; }
.sample-library-pick-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; align-items: stretch; min-width: 0; }
.sample-library-pick-form select { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.sample-library-pick-form button { min-height: 34px; padding: 6px 10px; width: 100%; white-space: nowrap; }
.technical-catalog-evidence-picker { grid-column: 2 / -1; display: grid; gap: 8px; min-width: 0; }
.technical-catalog-evidence-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px; border: 1px dashed #cfe0f2; border-radius: 8px; background: #f7fbff; color: var(--muted); font-size: 12px; }
.technical-catalog-evidence-option { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px; border: 1px solid #dce8f4; border-radius: 7px; background: #fff; }
.technical-catalog-evidence-preview-button { width: 54px; height: 42px; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: #edf2f6; cursor: zoom-in; }
.technical-catalog-evidence-option img { width: 54px; height: 42px; border-radius: 6px; object-fit: cover; background: #edf2f6; }
.technical-catalog-evidence-option span, .technical-catalog-evidence-option strong, .technical-catalog-evidence-option small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.technical-catalog-evidence-option strong { color: #1d2b39; font-size: 12px; }
.technical-catalog-evidence-option small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.technical-catalog-evidence-option button { min-height: 32px; padding: 6px 10px; white-space: nowrap; }
.technical-catalog-evidence-selected { display: grid; gap: 6px; }
.technical-catalog-evidence-chip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(116px, 140px) auto; gap: 7px; align-items: center; padding: 7px 9px; border: 1px solid #dce8f4; border-radius: 7px; background: #fff; }
.technical-catalog-evidence-chip span { min-width: 0; overflow: hidden; color: #1d2b39; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.technical-catalog-evidence-chip select { min-height: 32px; padding: 6px 9px; font-size: 12px; }
.catalog-evidence-preview-modal[hidden] { display: none !important; }
.catalog-evidence-preview-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 28px; }
.catalog-evidence-preview-backdrop { position: absolute; inset: 0; background: rgba(25, 38, 52, .48); }
.catalog-evidence-preview-card { position: relative; z-index: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(980px, calc(100vw - 56px)); max-height: calc(100vh - 56px); overflow: hidden; border: 1px solid #dbe5ef; border-radius: 8px; background: #fff; box-shadow: 0 24px 72px rgba(18, 31, 48, .22); }
.catalog-evidence-preview-card header, .catalog-evidence-preview-card footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e5edf5; }
.catalog-evidence-preview-card footer { border-top: 1px solid #e5edf5; border-bottom: 0; }
.catalog-evidence-preview-card header div { min-width: 0; }
.catalog-evidence-preview-card header strong { display: block; overflow: hidden; color: #1d2b39; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-evidence-preview-card header span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-evidence-preview-body { overflow: auto; padding: 14px; background: #eef3f8; }
.catalog-evidence-preview-body img { display: block; width: 100%; height: auto; border: 1px solid #d4dde8; background: #fff; }
.catalog-evidence-preview-card footer label { display: flex; align-items: center; flex-direction: row; gap: 8px; margin: 0; color: #4f6174; font-size: 12px; font-weight: 700; }
.catalog-evidence-preview-card footer select { min-width: 150px; min-height: 34px; padding: 6px 9px; font-size: 12px; }
.catalog-evidence-preview-card footer a { color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.attachment-image-preview-modal[hidden] { display: none !important; }
.attachment-image-preview-modal { position: fixed; inset: 0; z-index: 84; display: grid; place-items: center; padding: 28px; }
.attachment-image-preview-backdrop { position: absolute; inset: 0; background: rgba(25, 38, 52, .48); }
.attachment-image-preview-card { position: relative; z-index: 1; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(980px, calc(100vw - 56px)); max-height: calc(100vh - 56px); overflow: hidden; border: 1px solid #dbe5ef; border-radius: 8px; background: #fff; box-shadow: 0 24px 72px rgba(18, 31, 48, .22); }
.attachment-image-preview-card header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e5edf5; }
.attachment-image-preview-card strong { min-width: 0; overflow: hidden; color: #1d2b39; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-image-preview-body { overflow: auto; padding: 14px; background: #eef3f8; }
.attachment-image-preview-body img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid #d4dde8; background: #fff; }
.model-asset-preview-button { padding: 0; border: 0; cursor: zoom-in; }
.offered-model-asset-row img, .offered-model-asset-row i { display: flex; width: 54px; height: 42px; align-items: center; justify-content: center; border-radius: 6px; object-fit: cover; color: #7b8997; background: #edf2f6; }
.offered-model-asset-row strong, .offered-model-asset-row small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.offered-model-asset-row strong { color: #1d2b39; font-size: 12px; }
.offered-model-asset-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.trade-badge { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1.4; }
.trade-domestic { color: #7a4d00; background: #fff1c9; }
.trade-export { color: #145a8d; background: #e6f2fb; }
.delivery-upload-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.delivery-upload-block > strong { font-size: 13px; }
.delivery-upload-block > p { margin: 4px 0 10px; color: var(--muted); font-size: 11px; }
.delivery-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.delivery-image-grid > p { grid-column: 1 / -1; }
.delivery-image-grid a { min-width: 0; color: var(--accent); text-decoration: none; }
.delivery-image-grid img { display: block; width: 100%; aspect-ratio: 1.25; object-fit: cover; border: 1px solid var(--border); border-radius: 7px; background: #f4f6f8; }
.delivery-image-grid span { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.timeline { border-left: 2px solid #dce4ec; padding-left: 14px; display: flex; flex-direction: column; gap: 16px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -20px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }
.timeline-item span { color: var(--accent); font-size: 11px; font-weight: 700; }
.timeline-item strong { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.timeline-item p { margin: 5px 0; font-size: 12px; white-space: pre-wrap; }
.timeline-item small { color: var(--muted); }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .quote-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .technical-attachment-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  .topbar { align-items: flex-start; gap: 8px; }
  .nav { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .container { padding: 14px; }
  .page-heading, .quote-detail-heading { align-items: flex-start; flex-direction: column; }
  .metric-grid, .quote-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .technical-pack-item { grid-template-columns: 1fr; }
  .detail-main .technical-attachment-form, .detail-main .technical-attachment-list, .customer-provided-asset-panel { grid-column: 1; }
  .detail-main .technical-attachment-form { grid-template-columns: 1fr; }
  .offered-model-asset-panel { grid-column: 1; }
  .offered-model-asset-list { grid-template-columns: 1fr; }
  .form-grid.three-cols, .item-grid { grid-template-columns: repeat(2, 1fr); }
  .span-3 { grid-column: span 2; }
  .quote-context-strip { grid-template-columns: repeat(2, 1fr); }
  .version-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .metric-grid, .quote-summary-grid, .form-grid.three-cols, .item-grid, .notes-grid, .info-grid { grid-template-columns: 1fr; }
  .span-2, .span-3, .item-grid .span-2, .item-financial { grid-column: span 1; }
  .quote-context-strip { grid-template-columns: 1fr 1fr; }
  .technical-file-actions { grid-template-columns: 1fr; }
  .sticky-form-actions { align-items: flex-start; gap: 10px; flex-direction: column; }
  .sticky-form-actions > div:last-child { width: 100%; }
  .sticky-form-actions a, .sticky-form-actions button { flex: 1; }
}

/* Quote redesign: Today List */
.page-quotes { background: #fff; }
.page-quotes .topbar { display: none; }
.page-quotes .container { padding: 0; }
.today-quotes-shell {
  width: min(calc(100% - 56px), 1180px);
  min-height: auto;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 28px 0 44px;
  background: transparent;
}
.today-module-nav { display: inline-flex; align-self: flex-start; gap: 4px; margin-bottom: 24px; padding: 4px; border-radius: 7px; background: #f1f4f7; }
.today-module-nav a { padding: 7px 11px; border-radius: 5px; color: #637181; font-size: 13px; font-weight: 600; text-decoration: none; }
.today-module-nav a:hover { color: #1f5aa6; }
.today-module-nav a.active { color: #fff; background: #1f5aa6; }
.today-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.today-heading-actions { display: flex; align-items: center; gap: 10px; }
.quote-sort-form { margin: 0; }
.quote-sort-form label { display: inline-flex; align-items: center; gap: 6px; color: #637181; font-size: 12px; font-weight: 700; }
.quote-sort-form select { width: 132px; min-height: 36px; padding: 0 28px 0 9px; background-color: #fff; font-size: 12px; }
.today-heading h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: 0; color: #142233; }
.today-heading-actions { display: flex; align-items: center; gap: 14px; }
.today-all-link { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; color: #1f5aa6; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.today-all-link span { font-size: 22px; line-height: 16px; }
.today-message { margin-top: -10px; }
.today-summary, .analysis-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.today-summary div, .analysis-summary div { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border: 1px solid #dfe5eb; border-radius: 8px; background: #fff; }
.today-summary strong, .analysis-summary strong { color: #235fb3; font-size: 22px; }
.today-summary span, .analysis-summary span { color: #677483; font-size: 12px; }
.today-quote-list { display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dfe5eb; border-radius: 8px; background: #fff; }
.today-quote-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 130px 18px; gap: 18px; align-items: center; min-height: 76px; padding: 12px 16px; border-bottom: 1px solid #e6ebef; color: #172433; text-decoration: none; }
.today-quote-row:first-child { padding-top: 12px; }
.today-quote-row:last-child { border-bottom: 0; }
.today-quote-row:hover { background: #f8fbff; }
.today-quote-row:focus-visible { outline: 3px solid rgba(31,90,166,.25); outline-offset: 3px; }
.quote-row-main { min-width: 0; }
.quote-row-title { display: flex; align-items: center; gap: 7px; min-width: 0; margin-bottom: 3px; }
.quote-row-main strong { display: block; margin-bottom: 3px; font-size: 15px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-row-title strong { min-width: 0; margin-bottom: 0; }
.country-chip { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 20px; padding: 2px 7px; border: 1px solid #d9e2ea; border-radius: 4px; color: #516274; background: #fff; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; }
.quote-row-main > span { display: block; color: #677483; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-row-main p { margin: 4px 0 0; color: #7a8693; font-size: 12px; }
.quote-row-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.quote-row-meta em { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px; border-radius: 4px; color: #657383; background: #f1f4f7; font-size: 11px; font-style: normal; white-space: nowrap; }
.quote-row-meta .priority-chip { font-weight: 700; }
.priority-high { color: #a43d22 !important; background: #fff0e8 !important; }
.priority-medium { color: #235fb3 !important; background: #eef4fd !important; }
.priority-low { color: #687584 !important; background: #f3f5f7 !important; }
.today-quote-row.quote-priority-high { box-shadow: inset 3px 0 0 #e0793d; }
.quote-row-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 0; padding: 8px 10px; border: 1px solid #d7e2ee; border-radius: 6px; background: #f7fafc; }
.quote-row-amount span { color: #657383; font-size: 11px; line-height: 1; }
.quote-row-amount strong { max-width: 100%; color: #123f7d; font-size: 17px; line-height: 1.15; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-row-state { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 0; }
.due-label { color: #235fb3; font-size: 12px; }
.due-label.due-now { color: #d56b16; }
.simple-status { display: inline-flex; justify-content: center; min-width: 66px; padding: 4px 8px; border-radius: 4px; color: #235fb3; background: #eef4fd; font-size: 11px; white-space: nowrap; }
.simple-status-draft, .simple-status-internal_review, .simple-status-sent, .simple-status-commercial_negotiation, .simple-status-awaiting_decision { color: #bc5d11; background: #fff1e5; }
.simple-status-won { color: #197d4d; background: #e8f6ee; }
.simple-status-lost, .simple-status-expired { color: #a33a3a; background: #fdecec; }
.row-chevron { color: #a6afb9; font-size: 18px; }
.today-empty { padding: 70px 12px; text-align: center; }
.today-empty h2 { margin: 0 0 8px; font-size: 20px; }
.today-empty p { margin: 0; color: #7a8795; font-size: 14px; }
.quick-record-spacer, .quick-entry-dock { display: none; }
.quick-record-button { width: auto; min-height: 36px; padding: 0 14px; border-radius: 6px; font-size: 13px; font-weight: 700; box-shadow: none; }
.simple-quote-search { display: grid; grid-template-columns: minmax(0,1fr) 150px 150px auto; gap: 8px; margin-bottom: 18px; }
.simple-quote-search input, .simple-quote-search select { width: 100%; min-height: 40px; }
.quick-quote-dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; border: 0; border-radius: 14px; color: #172433; background: #fff; box-shadow: 0 24px 70px rgba(20,34,51,.24); }
.quick-quote-dialog::backdrop { background: rgba(20,34,51,.36); }
.quick-quote-form { padding: 22px; }
.quick-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.quick-dialog-heading p { margin: 0 0 3px; color: #7a8795; font-size: 12px; }
.quick-dialog-heading h2 { margin: 0; font-size: 24px; }
.quick-dialog-close { padding: 7px 0; border: 0; color: #687584; background: transparent; }
.quick-trade-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 8px; padding: 4px; border-radius: 9px; background: #eef2f6; }
.quick-trade-tabs button { min-height: 38px; border: 0; border-radius: 6px; color: #5e6c7a; background: transparent; font-size: 14px; font-weight: 650; }
.quick-trade-tabs button:hover { color: var(--accent); background: #f7f9fc; }
.quick-trade-tabs button.active { color: #fff; background: var(--accent); box-shadow: 0 3px 8px rgba(31,90,166,.18); }
.quick-trade-tabs button:focus-visible { outline: 3px solid rgba(31,90,166,.2); outline-offset: 2px; }
.quick-trade-note { margin: 0 0 16px; color: #6e7c89; font-size: 11px; }
.quick-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick-fields label, .quick-more label { display: flex; flex-direction: column; gap: 6px; color: #465360; font-size: 12px; font-weight: 600; }
.quick-fields [hidden] { display: none !important; }
.quick-fields .quick-field-title { display: inline-flex; width: fit-content; max-width: 100%; align-items: baseline; gap: 3px; color: #465360; white-space: nowrap; }
.quick-fields .quick-field-title b { display: inline; flex: 0 0 auto; color: #b33a3a; font-weight: 700; white-space: nowrap; }
.quick-fields input, .quick-fields select, .quick-more select, .quick-more textarea { width: 100%; min-height: 42px; color: #172433; background: #fff; }
.quick-fields .quick-full { grid-column: 1 / -1; }
.customer-autocomplete-control { position: relative; width: 100%; }
.customer-autocomplete-control > input { width: 100%; }
.customer-autocomplete-control.is-open > input { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,90,166,.12); outline: 0; }
.customer-autocomplete-menu {
  position: absolute;
  z-index: 95;
  top: calc(100% + 5px);
  left: 0;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #bfd0e4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(28,48,69,.18);
}
.customer-autocomplete-control.open-up .customer-autocomplete-menu { top: auto; bottom: calc(100% + 5px); }
.customer-autocomplete-menu[hidden], .customer-autocomplete-hint[hidden] { display: none; }
.customer-autocomplete-option { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 5px; color: #273646; cursor: pointer; }
.customer-autocomplete-option strong { font-size: 13px; font-weight: 650; }
.customer-autocomplete-option span { color: #6e7d8b; font-size: 11px; font-weight: 400; }
.customer-autocomplete-option:hover, .customer-autocomplete-option.active { color: var(--accent); background: #edf4fd; }
.customer-autocomplete-option:hover span, .customer-autocomplete-option.active span { color: #5277a3; }
.customer-autocomplete-empty { padding: 10px; color: #7a8795; font-size: 12px; font-weight: 400; }
.customer-autocomplete-hint { display: block; margin-top: 5px; color: var(--accent); font-size: 11px; font-weight: 500; }
.quick-more { margin-top: 16px; border-top: 1px solid #e2e7ec; }
.quick-more summary { padding: 14px 0; color: #1f5aa6; font-size: 13px; cursor: pointer; }
.quick-more > div { display: grid; gap: 12px; padding-bottom: 8px; }
.quick-dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; }
.quick-dialog-actions a { color: #1f5aa6; font-size: 13px; text-decoration: none; }
.quick-dialog-actions button { min-width: 140px; min-height: 44px; font-weight: 700; }
.quote-type-picker { min-width: 480px; }
.quote-type-options { display: grid; gap: 11px; }
.quote-type-options a { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 17px; border: 1px solid #dce4ec; border-radius: 10px; color: #23374a; text-decoration: none; }
.quote-type-options a:hover { border-color: #8eb2dc; background: #f5f9fd; }
.quote-type-options a > i:first-child { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 9px; color: #1f5aa6; background: #eaf2fc; font-size: 18px; }
.quote-type-options span { display: flex; flex-direction: column; gap: 3px; }
.quote-type-options strong { font-size: 15px; }
.quote-type-options small { color: #788694; font-size: 11px; }

/* CRM customer center */
.page-customers { background: #fff; }
.page-customers .topbar { display: none; }
.page-customers .container { padding: 0; }
.crm-shell, .crm-detail-shell { width: min(100%, 1180px); margin: 0 auto; padding: 38px 28px 48px; }
.crm-module-nav { margin-bottom: 22px; }
.crm-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.crm-heading h1 { margin: 4px 0 5px; color: #142233; font-size: 34px; letter-spacing: -.04em; }
.crm-heading > div > p:last-child { margin: 0; color: #677483; font-size: 14px; }
.crm-metric-grid, .crm-detail-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.crm-metric-grid article, .crm-detail-metrics article { display: flex; min-height: 108px; flex-direction: column; justify-content: space-between; padding: 15px; border: 1px solid #dfe5eb; border-radius: 10px; background: #fff; }
.crm-metric-grid article span, .crm-detail-metrics article span { color: #667483; font-size: 12px; }
.crm-metric-grid article strong, .crm-detail-metrics article strong { color: #172433; font-size: 27px; letter-spacing: -.03em; }
.crm-metric-grid article small, .crm-detail-metrics article small { color: #7a8795; font-size: 11px; }
.crm-metric-grid article:first-child { background: #173f70; border-color: #173f70; }
.crm-metric-grid article:first-child span, .crm-metric-grid article:first-child small { color: #c8daee; }
.crm-metric-grid article:first-child strong { color: #fff; }
.crm-metric-grid .crm-metric-warn { border-left: 4px solid #d28a20; }
.crm-filters { display: grid; grid-template-columns: minmax(240px, 1fr) 170px 150px auto auto; gap: 10px; align-items: end; margin-bottom: 18px; padding: 14px; border-radius: 10px; background: #f4f7fa; }
.crm-filters label { display: flex; flex-direction: column; gap: 5px; color: #667483; font-size: 11px; font-weight: 600; }
.crm-filters input, .crm-filters select, .crm-filters button { width: 100%; min-height: 40px; background: #fff; }
.crm-filters button { background: var(--accent); }
.crm-filters > a { display: inline-flex; min-height: 40px; align-items: center; color: var(--accent); font-size: 12px; text-decoration: none; }
.crm-customer-list { overflow: hidden; border: 1px solid #dfe5eb; border-radius: 11px; background: #fff; }
.crm-list-heading, .crm-customer-row { display: grid; grid-template-columns: minmax(240px, 1.35fr) minmax(230px, 1.15fr) minmax(180px, .9fr) minmax(150px, .75fr) 18px; gap: 16px; align-items: center; }
.crm-list-heading { padding: 10px 16px; color: #7a8795; background: #f6f8fa; font-size: 11px; font-weight: 700; }
.crm-list-heading span:nth-child(4) { grid-column: 4 / 6; }
.crm-customer-row { min-height: 120px; padding: 16px; border-top: 1px solid #e4e9ee; color: #172433; text-decoration: none; }
.crm-customer-row:hover { background: #f9fbfd; }
.crm-customer-row:focus-visible { outline: 3px solid rgba(31,90,166,.22); outline-offset: -3px; }
.crm-customer-row > i { color: #a6afb9; }
.crm-customer-main { min-width: 0; }
.crm-customer-main > strong { display: block; overflow: hidden; margin-bottom: 5px; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.crm-customer-main p { margin: 0 0 8px; color: #687686; font-size: 12px; }
.crm-customer-main > div { display: flex; flex-wrap: wrap; gap: 5px; }
.crm-chip { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; color: #235b9d; background: #eaf2fc; font-size: 11px; font-weight: 650; }
.crm-chip.muted-chip { color: #5f6c78; background: #eff2f4; }
.crm-stat-line { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.crm-stat-line span { color: #667483; font-size: 12px; }
.crm-stat-line strong { color: #273646; font-size: 15px; }
.text-success, .text-success strong { color: var(--ok) !important; }
.crm-amount-list { display: flex; flex-direction: column; gap: 6px; }
.crm-amount-list > span { display: flex; flex-direction: column; gap: 2px; }
.crm-amount-list strong { color: #23303b; font-size: 13px; }
.crm-amount-list small { color: var(--ok); font-size: 10px; }
.crm-empty-value { color: #8a96a2; font-size: 12px; }
.crm-follow-up { display: flex; flex-direction: column; gap: 3px; }
.crm-follow-up strong { font-size: 13px; }
.crm-follow-up span, .crm-follow-up small { color: #7a8795; font-size: 10px; }
.crm-empty-state { padding: 70px 20px; text-align: center; }
.crm-empty-state h2 { margin: 0 0 7px; }
.crm-empty-state p { margin: 0 0 16px; color: #7a8795; }
.crm-detail-heading { margin-bottom: 18px; }
.crm-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.crm-title-line h1 { margin: 2px 0 4px; }
.crm-detail-metrics article:first-child { border-color: #9eb6d6; background: #f4f8fd; }
.crm-money-summary { margin-bottom: 16px; }
.crm-money-summary > div:last-child { display: flex; flex-wrap: wrap; gap: 10px; }
.crm-money-summary article { display: flex; min-width: 190px; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 8px; background: #f4f8fd; }
.crm-money-summary article span { color: var(--accent); font-size: 11px; font-weight: 700; }
.crm-money-summary article strong { font-size: 20px; }
.crm-money-summary article small { color: #667483; font-size: 11px; }
.crm-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.crm-detail-main { min-width: 0; }
.crm-detail-sidebar { position: sticky; top: 14px; }
.crm-quote-history { display: flex; flex-direction: column; }
.crm-quote-history > a { display: grid; grid-template-columns: minmax(190px, 1.4fr) minmax(150px, 1fr) 120px 16px; gap: 14px; align-items: center; padding: 13px 4px; border-top: 1px solid #e5eaef; color: #23303b; text-decoration: none; }
.crm-quote-history > a:first-child { border-top: 0; }
.crm-quote-history > a:hover { background: #f9fbfd; }
.crm-quote-history > a > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.crm-quote-history > a > div > strong, .crm-quote-history > a > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-quote-history > a > div > span, .crm-quote-history small { color: #71808e; font-size: 11px; }
.crm-quote-history > a > i { color: #a6afb9; }
.crm-inquiry-list { display: flex; flex-direction: column; gap: 12px; }
.crm-inquiry-list article { padding: 13px; border: 1px solid #e1e7ec; border-radius: 8px; background: #fbfcfd; }
.crm-inquiry-list article > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crm-inquiry-list article span, .crm-inquiry-list article small { color: #71808e; font-size: 11px; }
.crm-inquiry-list article p { margin: 8px 0 5px; color: #354452; font-size: 13px; white-space: pre-wrap; }
.crm-profile-list { margin: 0; }
.crm-profile-list div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid #edf0f3; }
.crm-profile-list div:first-child { border-top: 0; }
.crm-profile-list dt { color: #71808e; font-size: 11px; }
.crm-profile-list dd { margin: 0; overflow-wrap: anywhere; color: #2d3b48; font-size: 12px; font-weight: 600; }
.crm-profile-list a { color: var(--accent); }
.crm-contact-list { display: flex; flex-direction: column; gap: 8px; }
.crm-contact-list article { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 7px; background: #f6f8fa; }
.crm-contact-list article strong { font-size: 13px; }
.crm-contact-list article span { color: #6f7d8a; font-size: 11px; overflow-wrap: anywhere; }
.crm-timeline { max-height: 420px; overflow-y: auto; }

@media (max-width: 900px) {
  .crm-list-heading { display: none; }
  .crm-customer-row { grid-template-columns: minmax(0, 1fr) auto 16px; gap: 14px; }
  .crm-stat-line { grid-column: 1; }
  .crm-amount-list { grid-column: 2; grid-row: 1; align-self: start; text-align: right; }
  .crm-follow-up { grid-column: 2; grid-row: 2; text-align: right; }
  .crm-customer-row > i { grid-column: 3; grid-row: 1 / 3; }
  .crm-detail-layout { grid-template-columns: 1fr; }
  .crm-detail-sidebar { position: static; }
}

@media (max-width: 680px) {
  .crm-shell, .crm-detail-shell { padding: 30px 18px 40px; }
  .crm-heading, .crm-detail-heading { align-items: flex-start; flex-direction: column; }
  .crm-metric-grid, .crm-detail-metrics { grid-template-columns: 1fr 1fr; }
  .crm-filters { grid-template-columns: 1fr 1fr; }
  .crm-filters label:first-child { grid-column: 1 / -1; }
  .crm-customer-row { grid-template-columns: minmax(0, 1fr) 16px; }
  .crm-stat-line, .crm-amount-list, .crm-follow-up { grid-column: 1; text-align: left; }
  .crm-amount-list { grid-row: auto; flex-direction: row; flex-wrap: wrap; gap: 10px; }
  .crm-follow-up { grid-row: auto; }
  .crm-customer-row > i { grid-column: 2; grid-row: 1 / 5; }
  .crm-quote-history > a { grid-template-columns: minmax(0, 1fr) 18px; }
  .crm-quote-history > a > div:nth-child(2), .crm-quote-history > a > div:nth-child(3) { grid-column: 1; }
  .crm-quote-history > a > i { grid-column: 2; grid-row: 1 / 4; }
}

@media (max-width: 820px) {
  .today-quotes-shell { width: min(calc(100% - 32px), 1180px); padding: 24px 0 32px; }
  .today-heading { align-items: flex-start; flex-direction: column; }
  .today-summary { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .today-heading h1 { font-size: 22px; }
  .today-heading-actions { width: 100%; justify-content: space-between; }
  .today-summary strong { font-size: 20px; }
  .today-quote-row { grid-template-columns: minmax(0, 1fr) 150px 18px; min-height: 84px; gap: 10px; }
  .quote-row-amount { align-items: flex-start; grid-column: 1; grid-row: 2; width: fit-content; min-width: 150px; }
  .quote-row-state { grid-column: 2; grid-row: 1 / span 2; align-items: flex-end; flex-direction: column; }
  .quote-row-main strong { font-size: 15px; }
  .simple-quote-search { grid-template-columns: 1fr auto; }
  .simple-quote-search select { grid-column: 1 / -1; }
  .quick-quote-dialog { width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .quick-quote-form { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .quick-fields { grid-template-columns: 1fr 1fr; }
}

/* Unified business navigation */
.app-topbar { position: relative; z-index: 30; min-height: 64px; justify-content: flex-start; gap: 34px; padding: 0 28px; border-bottom-color: #e2e7ec; }
.app-topbar .brand { flex: 0 0 auto; color: #173f70; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.app-topbar .brand img { display: block; width: 138px; height: auto; }
.primary-nav { display: flex; align-self: stretch; align-items: stretch; gap: 4px; }
.primary-nav a { display: inline-flex; align-items: center; margin: 0; padding: 0 18px; border-radius: 0; color: #5f6e7d; font-size: 14px; font-weight: 650; border-bottom: 3px solid transparent; }
.primary-nav a:hover { color: #1f5aa6; background: #f5f8fc; }
.primary-nav a.active { color: #1f5aa6; background: transparent; border-bottom-color: #1f5aa6; }
.topbar-actions { position: relative; display: flex; flex: 0 0 auto; align-self: stretch; align-items: center; margin-left: auto; white-space: nowrap; }
.account-menu { position: relative; display: flex; align-items: center; }
.account-menu summary { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; color: #32465a; list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { border-color: #d8e5f4; background: #f5f8fc; }
.current-user { display: block; max-width: 128px; overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; }
.account-menu summary i { color: #728193; font-size: 11px; }
.account-menu summary .account-menu-avatar { color: #1f5aa6; font-size: 17px; }
.account-menu summary .bi-chevron-down { transition: transform .16s ease; }
.account-menu[open] summary .bi-chevron-down { transform: rotate(180deg); }
.account-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 80; min-width: 180px; padding: 8px; border: 1px solid #dce4ed; border-radius: 8px; background: #fff; box-shadow: 0 14px 30px rgba(31, 50, 70, .14); }
.account-menu-panel::before { content: ""; position: absolute; top: -5px; right: 18px; width: 9px; height: 9px; border-top: 1px solid #dce4ed; border-left: 1px solid #dce4ed; background: #fff; transform: rotate(45deg); }
.account-menu-header { display: grid; gap: 2px; padding: 8px 9px 10px; border-bottom: 1px solid #edf1f5; }
.account-menu-header strong { max-width: 150px; overflow: hidden; color: #1f2d3a; font-size: 13px; text-overflow: ellipsis; }
.account-menu-header span { color: #7d8a98; font-size: 11px; }
.account-menu-item { display: flex; min-height: 34px; align-items: center; margin-top: 6px; padding: 7px 9px; border-radius: 6px; color: #b33a3a; font-size: 12px; font-weight: 700; text-decoration: none; }
.account-menu-item:hover { background: #fff1f1; }
.secondary-nav { position: relative; z-index: 20; display: flex; align-items: center; gap: 22px; min-height: 48px; padding: 0 max(28px, calc((100vw - 1180px) / 2)); border-bottom: 1px solid #e3e8ed; background: #fff; overflow-x: auto; }
.secondary-nav a { display: inline-flex; align-items: center; min-height: 48px; border-bottom: 2px solid transparent; color: #6a7886; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.secondary-nav a:hover { color: #1f5aa6; }
.secondary-nav a.active { color: #1f5aa6; border-bottom-color: #1f5aa6; }
.page-quotes .topbar, .page-customers .topbar { display: flex; }
.page-quotes, .page-customers { background: #f6f8fa; }
.today-quotes-shell { padding-top: 32px; }
.crm-shell, .crm-detail-shell { padding-top: 32px; }
.page-quotes .container > .page-heading,
.page-quotes .container > .msg,
.page-quotes .container > .quote-summary-grid,
.page-quotes .container > .detail-layout,
.page-quotes .container > .quote-form-page { width: min(calc(100% - 56px), 1180px); margin-left: auto; margin-right: auto; }
.page-quotes .container > .page-heading { margin-top: 32px; }
.page-quotes .container > .quote-form-page { margin-bottom: 52px; }
.page-quotes .container > .quote-form-extra-section { margin-top: -28px; }
.page-quotes .container > .quote-form-bottom-actions { margin-top: -28px; margin-bottom: 12px; }
.page-dashboard .container, .page-articles .container, .page-jobs .container { width: min(100%, 1180px); margin: 0 auto; padding: 32px 28px 52px; }

/* Model and project boards */
.operations-shell { width: min(100%, 1180px); margin: 0 auto; padding: 34px 28px 56px; }
.operations-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.operations-heading h1 { margin: 4px 0 6px; color: #142233; font-size: 34px; letter-spacing: -.04em; }
.operations-heading p:last-child { margin: 0; color: #677483; font-size: 14px; }
.perspective-tabs { display: inline-flex; gap: 4px; margin-bottom: 16px; padding: 4px; border-radius: 8px; background: #e9eef4; }
.perspective-tabs a { padding: 8px 14px; border-radius: 6px; color: #657382; font-size: 13px; font-weight: 650; text-decoration: none; }
.perspective-tabs a.active { color: #fff; background: #1f5aa6; }
.model-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.model-metric-grid article { display: flex; min-height: 98px; flex-direction: column; justify-content: space-between; padding: 15px; border: 1px solid #dfe5eb; border-radius: 10px; background: #fff; }
.model-metric-grid article:first-child { color: #fff; border-color: #173f70; background: #173f70; }
.model-metric-grid span { color: #697786; font-size: 12px; }
.model-metric-grid article:first-child span { color: #c8daee; }
.model-metric-grid strong { font-size: 28px; }
.model-search { display: flex; gap: 8px; margin-bottom: 16px; }
.model-search input { width: min(420px, 100%); }
.model-search a { align-self: center; color: #667483; font-size: 12px; text-decoration: none; }
.model-table-card { padding: 16px; border: 1px solid #dfe5eb; border-radius: 11px; background: #fff; }
.model-table { min-width: 1080px; }
.model-table th { color: #6b7987; background: #f5f7f9; font-size: 11px; }
.model-table td { vertical-align: middle; }
.model-table td > strong, .model-table td > small { display: block; }
.model-table td > small { margin-top: 4px; color: #758391; font-size: 11px; }
.model-board-table { min-width: 1080px; table-layout: fixed; }
.model-board-model-col { width: 145px; }
.model-board-demand-col { width: 185px; }
.model-board-price-col { width: 145px; }
.model-board-latest-col { width: 190px; }
.model-board-assets-col { width: 245px; }
.model-board-seo-col { width: 95px; }
.model-board-action-col { width: 85px; }
.model-board-table th,
.model-board-table td { min-width: 0; }
.model-board-model-name {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
}
.model-price { display: block; margin: 3px 0; white-space: nowrap; font-size: 12px; }
.model-price b { color: #1f5aa6; }
.model-asset-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.model-asset-pills span { display: inline-flex; min-height: 22px; align-items: center; padding: 3px 7px; border-radius: 999px; color: #7b8793; background: #edf1f4; font-size: 10px; font-weight: 750; white-space: nowrap; }
.model-asset-pills span.has-assets { color: #1f5aa6; background: #eaf2fc; }
.seo-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.seo-high { color: #9a4d00; background: #fff0d7; }
.seo-medium { color: #7a5a00; background: #fff7cf; }
.seo-covered { color: #197d4d; background: #e8f6ee; }
.seo-normal { color: #627181; background: #edf1f4; }
.row-detail-link { color: #1f5aa6; font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.model-empty { padding: 52px !important; color: #788694; text-align: center; }
.compact-model-metrics { margin-top: -2px; }
.history-table { min-width: 1040px; }
.model-asset-overview { margin-bottom: 16px; }
.model-asset-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.model-asset-summary-grid article { padding: 13px; border: 1px solid #e1e7ed; border-radius: 9px; background: #fbfcfd; }
.model-asset-summary-grid span, .model-asset-summary-grid small { display: block; color: #72808e; font-size: 11px; }
.model-asset-summary-grid strong { display: block; margin: 6px 0 5px; color: #172536; font-size: 24px; }
.model-asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.model-asset-card { display: grid; grid-template-columns: 82px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 10px; border: 1px solid #e1e7ed; border-radius: 9px; background: #fff; }
.model-asset-preview { display: flex; width: 82px; height: 64px; align-items: center; justify-content: center; overflow: hidden; border-radius: 7px; color: #7b8997; background: #edf2f6; text-decoration: none; }
.model-asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.model-asset-preview i { font-size: 24px; }
.model-asset-card strong, .model-asset-card span, .model-asset-card small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-asset-card strong { color: #172536; font-size: 13px; }
.model-asset-card span { margin-top: 4px; color: #5f6f7f; font-size: 11px; }
.model-asset-card small { margin-top: 4px; color: #87939f; font-size: 10px; }
.model-asset-upload-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; padding: 13px; border: 1px solid #dfe7ef; border-radius: 9px; background: #f8fafc; }
.model-asset-upload-form label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #657382; font-size: 11px; font-weight: 650; }
.model-asset-upload-form input, .model-asset-upload-form select { width: 100%; min-width: 0; background: #fff; }
.model-asset-upload-form .span-2 { grid-column: span 2; }
.physical-asset-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.physical-asset-group { display: grid; gap: 10px; min-width: 0; }
.physical-asset-group-title { display: flex; align-items: center; justify-content: space-between; color: #172536; }
.physical-asset-group-title span { color: #72808e; font-size: 12px; font-weight: 700; }
.catalog-physical-asset-grid { grid-template-columns: 1fr; }
.catalog-physical-asset-card { grid-template-columns: 96px minmax(0, 1fr) auto; }
.catalog-physical-asset-card .model-asset-preview { width: 96px; height: 72px; }
.project-board-list { display: flex; flex-direction: column; gap: 10px; }
.project-board-card { display: grid; grid-template-columns: minmax(220px, 1.2fr) auto minmax(250px, 1fr) 110px; gap: 22px; align-items: center; padding: 18px 20px; border: 1px solid #dde4ea; border-radius: 10px; background: #fff; }
.project-board-card h2 { margin: 3px 0 5px; font-size: 18px; }
.project-board-card p { margin: 4px 0; color: #586878; font-size: 12px; }
.project-board-card small, .project-board-card .muted, .project-board-date span { color: #788694; font-size: 11px; }
.project-label { color: #1f5aa6; font-size: 10px; font-weight: 750; }
.project-board-stats { display: flex; gap: 16px; }
.project-board-stats span { display: flex; flex-direction: column; color: #788694; font-size: 10px; text-align: center; }
.project-board-stats strong { color: #21303e; font-size: 21px; }
.project-board-date { display: flex; flex-direction: column; gap: 4px; text-align: right; }

@media (max-width: 820px) {
  .app-topbar { gap: 10px; padding: 0 14px; }
  .app-topbar .brand img { width: 118px; }
  .primary-nav a { padding: 0 10px; font-size: 12px; }
  .secondary-nav { padding: 0 18px; gap: 18px; }
  .operations-shell { padding: 28px 18px 44px; }
  .model-metric-grid { grid-template-columns: 1fr 1fr; }
  .project-board-card { grid-template-columns: 1fr auto; }
  .project-board-card > div:nth-child(3) { grid-column: 1; }
  .project-board-date { grid-column: 2; grid-row: 1 / 3; }
  .physical-asset-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .app-topbar { min-height: 58px; }
  .app-topbar .brand { display: none; }
  .primary-nav { flex: 1; justify-content: space-between; }
  .primary-nav a { flex: 1; justify-content: center; padding: 0 5px; }
  .operations-heading { align-items: flex-start; flex-direction: column; }
  .model-metric-grid { grid-template-columns: 1fr 1fr; }
  .project-board-card { grid-template-columns: 1fr; }
  .project-board-stats { justify-content: flex-start; }
  .project-board-date { grid-column: 1; grid-row: auto; text-align: left; }
}

/* Lightweight toolbox */
.toolbox-shell { width: min(100%, 1180px); margin: 0 auto; padding: 34px 28px 56px; }
.toolbox-heading { margin-bottom: 20px; }
.toolbox-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool-card { display: grid; gap: 15px; padding: 22px; border: 1px solid #dfe6ed; border-radius: 12px; background: #fff; box-shadow: 0 6px 20px rgba(31,54,78,.05); }
.tool-card-wide { grid-column: 1 / -1; }
.tool-card-icon { display: flex; width: 38px; height: 38px; align-items: center; justify-content: center; border-radius: 9px; color: #1f5aa6; background: #eaf2fc; font-size: 18px; }
.tool-card h2 { margin: 0 0 4px; color: #1c2f42; font-size: 18px; } .tool-card p { margin: 0; color: #718091; font-size: 12px; }
.tool-fields { display: grid; gap: 10px; } .tool-fields.two-cols { grid-template-columns: 1fr 130px; } .tool-fields.three-cols { grid-template-columns: 1fr 1fr 120px; }
.tool-fields label, .translation-layout label { display: flex; flex-direction: column; gap: 5px; color: #617182; font-size: 11px; font-weight: 700; }
.tool-fields input, .tool-fields select, .translation-layout textarea { width: 100%; min-width: 0; background: #fff; }
.tool-result { padding: 15px; border-radius: 9px; background: #f2f6fb; } .tool-result span, .tool-result strong { display: block; } .tool-result span { color: #748293; font-size: 10px; } .tool-result strong { margin-top: 5px; color: #163f72; font-size: 23px; }
.tool-help { color: #8a96a2; } .translation-layout { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; } .translation-button { align-self: center; }
.translation-examples { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; color: #758393; font-size: 11px; } .translation-examples button { padding: 5px 9px; color: #315d8e; background: #edf4fb; border: 0; border-radius: 999px; font-size: 11px; }
@media (max-width: 760px) { .toolbox-grid { grid-template-columns: 1fr; } .tool-card-wide { grid-column: 1; } .tool-fields.three-cols, .translation-layout { grid-template-columns: 1fr; } }

/* Sales orders: quote-to-delivery workflow */
.page-orders { background: #f6f8fa; }
.page-orders .container { padding: 0; }
.orders-shell, .order-detail-shell, .order-edit-shell, .pi-preview-shell { width: min(100%, 1180px); margin: 0 auto; padding: 34px 28px 56px; }
.order-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 190px 170px auto auto; gap: 10px; align-items: end; margin-bottom: 18px; padding: 14px; border-radius: 10px; background: #eaf0f6; }
.order-filters label, .payment-fields label, .delivery-task-row label { display: flex; flex-direction: column; gap: 5px; color: #667483; font-size: 11px; font-weight: 650; }
.order-filters input, .order-filters select, .order-filters button { width: 100%; min-height: 40px; background: #fff; }
.order-filters button { background: var(--accent); }
.order-filters > a { display: inline-flex; min-height: 40px; align-items: center; color: var(--accent); font-size: 12px; text-decoration: none; }
.order-list-card { overflow: hidden; border: 1px solid #dde4ea; border-radius: 11px; background: #fff; }
.order-list-heading, .order-list-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(190px, .9fr) minmax(240px, 1.2fr) 130px 80px; gap: 18px; align-items: center; }
.order-list-heading { padding: 11px 16px; color: #778492; background: #f5f7f9; font-size: 11px; font-weight: 700; }
.order-list-row { min-height: 118px; padding: 16px; border-top: 1px solid #e4e9ee; color: #21303e; text-decoration: none; }
.order-list-row:hover { background: #f8fbfe; }
.order-main, .order-money, .order-next, .order-date { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.order-main strong { color: #173f70; font-size: 16px; }
.order-main span, .order-money strong, .order-next strong, .order-date strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-main small, .order-money span, .order-next small, .order-date span { color: #778492; font-size: 11px; }
.order-money strong { font-size: 15px; }
.order-next strong { font-size: 12px; }
.order-status, .risk-chip, .payment-status, .document-draft-badge { display: inline-flex; align-self: flex-start; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status-waiting_deposit, .status-waiting_balance { color: #9a4d00; background: #fff0d7; }
.status-technical_confirming, .status-in_production, .status-ready_to_ship { color: #1f5aa6; background: #eaf2fc; }

.legacy-heading .page-actions, .page-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.page-actions > a, .page-actions > form, .page-actions button { flex: 0 0 auto; min-width: max-content; white-space: nowrap; word-break: keep-all; writing-mode: horizontal-tb; }
.legacy-heading > div:first-child { min-width: 0; }
.legacy-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 28px; }
.legacy-heading .page-subtitle { max-width: 980px; line-height: 1.55; }
.legacy-heading .page-actions { flex-wrap: nowrap; min-width: max-content; }
.danger-outline-button { min-height: 38px; padding: 8px 13px; border: 1px solid #e5a6a6; border-radius: 7px; color: #b42318; background: #fff; font-weight: 700; cursor: pointer; }
.legacy-filter-bar { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(4, minmax(150px, 1fr)) auto auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.legacy-filter-bar label, .legacy-catalog-upload label, .legacy-inline-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.legacy-filter-bar input, .legacy-filter-bar select, .legacy-catalog-upload input, .legacy-catalog-upload select, .legacy-inline-form input, .legacy-inline-form select { min-height: 38px; }
.legacy-list-card .section-header { align-items: center; }
.legacy-table td { vertical-align: top; }
.legacy-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.legacy-status.status-sample_confirmed { color: #057a55; background: #dcfce7; }
.legacy-status.status-standard_inferred { color: #1f5aa6; background: #e8f1ff; }
.legacy-status.status-experience_judgment { color: #886018; background: #fff4dc; }
.legacy-status.status-pending_confirmation { color: #6b7280; background: #eef2f5; }
.legacy-status.status-confirmed { color: #057a55; background: #dcfce7; }
.legacy-status.status-pending { color: #6b7280; background: #eef2f5; }
.legacy-status.status-rejected { color: #b42318; background: #fee4e2; }
.legacy-form .four-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.legacy-model-card { display: grid; gap: 14px; }
.legacy-model-title { display: flex; align-items: center; gap: 12px; }
.legacy-model-title strong { font-size: 24px; }
.legacy-model-title > span:last-child { color: var(--muted); }
.legacy-param-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.legacy-param-grid article { padding: 12px; border: 1px solid #e1e8f0; border-radius: 8px; background: #fbfcfd; }
.legacy-param-grid span, .legacy-param-grid small { display: block; color: var(--muted); font-size: 12px; }
.legacy-param-grid strong { display: block; margin: 4px 0; font-size: 18px; }
.legacy-detail-layout { display: grid; grid-template-columns: 1.1fr 1.1fr .9fr; gap: 14px; margin-top: 14px; }
.legacy-detail-layout.two-wide { grid-template-columns: 1.2fr .8fr; }
.legacy-section { margin-top: 14px; }
.legacy-detail-layout .legacy-section { margin-top: 0; }
.legacy-notes { display: grid; gap: 12px; }
.legacy-notes span { color: var(--muted); font-size: 12px; font-weight: 800; }
.legacy-notes em { color: #1f5aa6; font-style: normal; }
.legacy-notes p, .pre-line { white-space: pre-line; line-height: 1.6; }
.legacy-definition-list { display: grid; gap: 8px; margin: 0; }
.legacy-definition-list div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #eef2f5; }
.legacy-definition-list dt { color: var(--muted); font-weight: 700; }
.legacy-definition-list dd { margin: 0; font-weight: 700; }
.legacy-definition-list dd span { color: #1f5aa6; font-size: 12px; font-weight: 800; }
.legacy-inline-form { display: grid; grid-template-columns: minmax(220px, 1.4fr) 90px repeat(2, minmax(130px, 1fr)) repeat(4, minmax(82px, .6fr)) minmax(220px, 1.2fr) auto; gap: 8px; align-items: end; }
.legacy-inline-form .span-2 { grid-column: span 2; }
.catalog-page-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.catalog-page-card { display: grid; gap: 10px; padding: 12px; border: 1px solid #e1e8f0; border-radius: 8px; background: #fff; }
.catalog-page-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.catalog-page-meta strong { flex: 1 1 260px; }
.catalog-page-meta span { color: var(--muted); font-size: 12px; }
.catalog-page-meta div { display: flex; gap: 10px; font-size: 12px; font-weight: 800; }
.catalog-page-preview, .catalog-page-crop { display: block; max-height: 360px; overflow: hidden; border: 1px solid #d9e2ec; border-radius: 7px; background: #f8fafc; }
.catalog-page-crop { max-height: 220px; }
.catalog-page-preview img, .catalog-page-crop img { display: block; width: 100%; height: auto; }
.legacy-stack-form { display: grid; gap: 12px; }
.replacement-list, .quote-record-list { display: grid; gap: 10px; margin-top: 12px; }
.replacement-list article, .quote-record-list a { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid #eef2f5; color: inherit; text-decoration: none; }
.replacement-list span, .quote-record-list span, .quote-record-list em { color: var(--muted); font-size: 12px; font-style: normal; }
.legacy-catalog-upload { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.legacy-catalog-upload .span-2 { grid-column: span 2; }
.legacy-table small { color: var(--muted); font-weight: 650; }
.legacy-table td:last-child { white-space: nowrap; }
.compact-search-form { display: flex; gap: 8px; align-items: center; }
.table-actions { display: flex; gap: 10px; align-items: center; }
.legacy-picker { position: relative; display: grid; gap: 6px; align-self: end; }
.legacy-picker label { margin: 0; }
.legacy-picker-results { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; display: grid; max-height: 320px; overflow: auto; border: 1px solid #cbd7e3; border-radius: 8px; background: #fff; box-shadow: 0 14px 30px rgba(15, 23, 42, .12); }
.legacy-picker-option { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #eef2f5; color: inherit; background: #fff; text-align: left; cursor: pointer; }
.legacy-picker-option:hover { background: #f4f8fd; }
.legacy-picker-option span, .legacy-picker-option em, .legacy-picker-empty { color: var(--muted); font-size: 12px; font-style: normal; }
.legacy-picker-empty { padding: 10px 12px; }
.legacy-picked-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.legacy-picked-actions a { color: var(--accent); font-weight: 800; text-decoration: none; }

.catalog-filter-bar { display: grid; grid-template-columns: minmax(280px, 1.4fr) minmax(180px, .8fr) minmax(150px, .7fr) auto auto; gap: 10px; align-items: end; margin-bottom: 16px; }
.catalog-filter-bar label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.catalog-filter-bar input, .catalog-filter-bar select { min-height: 38px; }
.catalog-table td { vertical-align: top; }
.catalog-status { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.catalog-status.status-pending { color: #6b7280; background: #eef2f5; }
.catalog-status.status-parsing { color: #1f5aa6; background: #e8f1ff; }
.catalog-status.status-completed { color: #057a55; background: #dcfce7; }
.catalog-status.status-failed { color: #b42318; background: #fee4e2; }
.catalog-upload-page .sticky-form-actions { margin-top: 18px; }
.catalog-summary-card { display: grid; gap: 12px; }
.catalog-summary-layout { display: grid; grid-template-columns: minmax(132px, 24%) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.catalog-cover-card { position: relative; display: flex; align-items: center; justify-content: center; max-width: 220px; min-height: 118px; max-height: 150px; overflow: hidden; border: 1px solid #dce5ee; border-radius: 8px; color: var(--muted); background: #eef3f8; text-decoration: none; }
.catalog-cover-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; opacity: .92; }
.catalog-cover-card strong { position: absolute; left: 8px; bottom: 8px; padding: 3px 7px; border-radius: 999px; color: #1f5aa6; background: rgba(255,255,255,.9); font-size: 11px; }
.catalog-cover-card span { font-weight: 800; }
.catalog-summary-main { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.catalog-summary-main article { padding: 13px; border: 1px solid #e1e8f0; border-radius: 8px; background: #fbfcfd; }
.catalog-summary-main span, .catalog-summary-main small { display: block; color: var(--muted); font-size: 12px; }
.catalog-summary-main strong { display: block; margin: 5px 0; font-size: 24px; }
.catalog-search-strip form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 10px; align-items: end; }
.catalog-search-strip label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.catalog-page-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.catalog-page-tile { display: grid; gap: 4px; min-height: 86px; padding: 11px; border: 1px solid #dce5ee; border-radius: 8px; color: inherit; background: #fff; text-decoration: none; }
.catalog-page-tile:hover { border-color: var(--accent); background: #f7fbff; }
.catalog-page-tile span { color: var(--muted); font-size: 12px; font-weight: 800; }
.catalog-page-tile strong { font-size: 14px; }
.catalog-page-tile small { color: var(--muted); }
.catalog-page-tile.status-text_layer_missing { border-style: dashed; background: #fbfcfd; }
.catalog-page-detail-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); gap: 16px; align-items: start; }
.catalog-preview-panel { overflow: auto; max-height: calc(100vh - 180px); padding: 12px; background: #eef3f8; }
.catalog-preview-panel img { display: block; width: 100%; height: auto; border: 1px solid #d2dce7; background: #fff; }
.catalog-text-panel { position: sticky; top: 92px; max-height: calc(100vh - 120px); overflow: auto; }
.catalog-inline-cover { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; align-items: center; min-height: 48px; margin-bottom: 12px; padding: 6px 8px; border: 1px solid #dce5ee; border-radius: 8px; color: inherit; background: #fbfcfd; text-decoration: none; }
.catalog-inline-cover img { display: block; width: 34px; height: 40px; object-fit: cover; object-position: top center; border: 1px solid #d2dce7; background: #fff; }
.catalog-inline-cover small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.catalog-inline-cover strong { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-page-meta-list { display: grid; gap: 8px; margin: 0 0 12px; }
.catalog-page-meta-list div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid #eef2f5; }
.catalog-page-meta-list dt { color: var(--muted); font-weight: 700; }
.catalog-page-meta-list dd { margin: 0; font-weight: 700; }
.catalog-extracted-text { min-height: 360px; margin: 0; padding: 12px; border: 1px solid #dce5ee; border-radius: 8px; white-space: pre-wrap; word-break: break-word; background: #fbfcfd; font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.catalog-search-page-form { grid-template-columns: minmax(320px, 1.2fr) minmax(260px, .9fr) auto; }
.catalog-search-results { display: grid; gap: 10px; }
.catalog-search-results a { display: grid; gap: 5px; padding: 12px 0; border-top: 1px solid #eef2f5; color: inherit; text-decoration: none; }
.catalog-search-results a:first-child { border-top: 0; }
.catalog-search-results span { color: var(--muted); font-size: 12px; font-weight: 700; }
.catalog-search-results p { margin: 0; line-height: 1.55; }
@media (max-width: 900px) {
  .catalog-summary-layout { grid-template-columns: 1fr; }
  .catalog-cover-card { width: min(220px, 100%); min-height: 118px; }
}
.candidate-table { min-width: 1120px; table-layout: fixed; }
.candidate-table td { vertical-align: top; }
.candidate-model-col { width: 150px; }
.candidate-frame-col { width: 90px; }
.candidate-evidence-col { width: 230px; }
.candidate-count-col { width: 58px; }
.candidate-action-col { width: 112px; }
.candidate-actions { display: grid; justify-items: end; gap: 6px; }
.candidate-actions form { margin: 0; }
.candidate-confirm-button, .candidate-ignore-button {
  width: 76px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.candidate-confirm-button { border: 1px solid #bcd2ec; color: var(--accent); background: #f2f7fd; }
.candidate-confirm-button:hover { background: #e7f0fb; }
.candidate-ignore-button { border: 0; color: #b33a3a; background: transparent; }
.candidate-ignore-button:hover { background: #fdecec; }
.page-mini-link { display: inline-flex; align-items: center; min-height: 24px; margin: 0 3px 3px 0; padding: 2px 7px; border: 1px solid #d7e2ee; border-radius: 999px; color: var(--accent); font-size: 12px; font-weight: 800; text-decoration: none; background: #fff; }
.page-mini-link:hover { background: #eef5ff; }
.page-mini-link.evidence-parameter { border-color: #b8d4ee; color: #1f5aa6; background: #f1f7fd; }
.page-mini-link.evidence-dimension { border-color: #b9dccb; color: #197d4d; background: #f0faf4; }
.page-mini-link.evidence-other { border-color: #dde3ea; color: #697786; background: #f7f9fb; }
.status-shipped, .status-delivered, .status-after_sales { color: #126b62; background: #e3f5f2; }
.status-closed { color: #197d4d; background: #e8f6ee; }
.status-cancelled { color: #8a4040; background: #fdecec; }
.risk-normal { color: #197d4d; background: #e8f6ee; }
.risk-attention { color: #9a4d00; background: #fff0d7; }
.risk-high { color: #a33a3a; background: #fdecec; }
.order-empty { padding: 70px 20px; text-align: center; }
.order-empty h2 { margin: 0 0 7px; }
.order-empty p { margin: 0 0 18px; color: #778492; }
.order-button { background: #16725a !important; border-color: #16725a !important; color: #fff !important; }
.heading-actions form { margin: 0; }

.order-detail-heading { margin-bottom: 18px; padding: 0; }
.order-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.order-metric-grid article { display: flex; min-height: 110px; flex-direction: column; justify-content: space-between; padding: 16px; border: 1px solid #dce3e9; border-radius: 10px; background: #fff; }
.order-metric-grid article span, .order-metric-grid article small { color: #748291; font-size: 11px; }
.order-metric-grid article strong { font-size: 21px; }
.order-metric-grid .order-metric-primary { border-color: #173f70; background: #173f70; }
.order-metric-grid .order-metric-primary span, .order-metric-grid .order-metric-primary small { color: #c9daec; }
.order-metric-grid .order-metric-primary strong { color: #fff; }
.order-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.order-detail-main { min-width: 0; }
.order-detail-sidebar { position: sticky; top: 14px; }
.order-info-grid .order-next-action { color: #1f5aa6; }
.order-items-table { min-width: 980px; }
.confirm-chip { display: inline-flex; margin: 2px; padding: 3px 6px; border-radius: 999px; color: #778492; background: #edf1f4; font-size: 9px; font-weight: 700; }
.confirm-chip.done { color: #197d4d; background: #e8f6ee; }
.payment-card-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.payment-card { padding: 14px; border: 1px solid #dde4ea; border-radius: 9px; background: #fbfcfd; }
.payment-title, .payment-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payment-title > div { display: flex; flex-direction: column; gap: 3px; }
.payment-title span, .payment-actions small { color: #748291; font-size: 11px; }
.payment-pending { color: #9a4d00; background: #fff0d7; }
.payment-partially_received { color: #1f5aa6; background: #eaf2fc; }
.payment-received { color: #197d4d; background: #e8f6ee; }
.payment-overdue { color: #a33a3a; background: #fdecec; }
.payment-cancelled { color: #697786; background: #edf1f4; }
.payment-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 9px; margin: 13px 0; }
.payment-fields input, .payment-fields select { width: 100%; min-width: 0; }
.payment-fields .payment-note { grid-column: 1 / -1; }
.delivery-task-list { display: flex; flex-direction: column; }
.delivery-task-row { display: grid; grid-template-columns: 8px minmax(150px, 1.2fr) 125px 135px 110px minmax(150px, 1fr) auto; gap: 10px; align-items: end; padding: 12px 2px; border-top: 1px solid #e7ebef; }
.delivery-task-row:first-child { border-top: 0; }
.task-marker { align-self: center; width: 8px; height: 8px; border-radius: 50%; background: #c4ccd4; }
.task-in_progress .task-marker { background: #d78a20; }
.task-completed .task-marker { background: #197d4d; }
.task-cancelled { opacity: .58; }
.task-name { display: flex; align-self: center; flex-direction: column; gap: 3px; }
.task-name strong { font-size: 13px; }
.task-name span { color: #778492; font-size: 10px; }
.delivery-task-row input, .delivery-task-row select { width: 100%; min-width: 0; }
.delivery-task-row button { align-self: end; white-space: nowrap; }
.task-progress { color: #197d4d; font-size: 11px; font-weight: 700; }
.simple-task-row { display: grid; grid-template-columns: 8px minmax(180px, 1fr) auto auto; gap: 12px; align-items: center; padding: 13px 2px; border-top: 1px solid #e7ebef; }
.simple-task-row:first-child { border-top: 0; }
.task-complete-button { padding: 8px 13px; color: #197d4d; background: #e8f6ee; border: 1px solid #bfe3ce; }
.task-more { position: relative; }
.task-more > summary { color: #64748b; font-size: 12px; cursor: pointer; }
.task-more-form { position: absolute; z-index: 5; right: 0; top: 26px; display: grid; grid-template-columns: repeat(3, 130px); gap: 10px; width: 440px; padding: 14px; background: #fff; border: 1px solid #dce4ec; border-radius: 8px; box-shadow: 0 10px 28px rgba(30, 48, 70, .14); }
.task-more-form label { display: flex; flex-direction: column; gap: 4px; color: #667483; font-size: 11px; }
.task-more-form .span-3 { grid-column: 1 / -1; }
.task-more-form button { justify-self: end; grid-column: 1 / -1; }
.completed-task-group { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e7ebef; }
.remaining-task-group { margin-top: 8px; border-top: 1px solid #e7ebef; }
.remaining-task-group > summary { padding: 12px 2px; color: #526579; font-size: 12px; font-weight: 700; cursor: pointer; }
.completed-task-group > summary { color: #64748b; font-size: 12px; cursor: pointer; }
.completed-task-row { display: flex; gap: 10px; align-items: center; padding: 9px 2px; color: #197d4d; }
.completed-task-row span { display: flex; flex-direction: column; color: #334155; }
.completed-task-row small { color: #8793a0; }
@media (max-width: 760px) {
  .simple-task-row { grid-template-columns: 8px minmax(0, 1fr) auto; }
  .simple-task-row .task-more { grid-column: 2; }
  .simple-task-row > form { grid-column: 3; grid-row: 1 / 3; }
  .task-more-form { position: static; grid-template-columns: 1fr; width: min(72vw, 360px); margin-top: 8px; }
  .task-more-form .span-3, .task-more-form button { grid-column: 1; }
}
.document-list { display: flex; flex-direction: column; }
.document-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 3px; border-top: 1px solid #e7ebef; color: #22313f; text-decoration: none; }
.document-list a:first-child { border-top: 0; }
.document-list a > div { display: flex; flex-direction: column; gap: 3px; }
.document-list a span, .document-list a small { color: #748291; font-size: 11px; }
.document-upload-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, .8fr);
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dce4eb;
  border-radius: 9px;
  background: #f8fafc;
}
.document-upload-form label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: #667483;
  font-size: 11px;
  font-weight: 650;
}
.document-upload-form input,
.document-upload-form select { width: 100%; min-width: 0; background: #fff; }
.document-upload-form small { color: #8a96a2; font-weight: 500; }
.document-upload-form .span-2 { grid-column: 1 / -1; }
.document-upload-form button { justify-self: start; }
.order-source-card { display: flex; flex-direction: column; gap: 6px; }
.order-source-card span, .order-source-card small { color: #748291; font-size: 11px; }
.order-source-card a { color: var(--accent); font-size: 12px; text-decoration: none; }

.pi-preview-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.pi-preview-toolbar h1 { margin: 5px 0 4px; }
.pi-preview-toolbar p { margin: 0; color: #748291; font-size: 12px; }
.document-draft-badge { color: #9a4d00; background: #fff0d7; }
.pi-paper { overflow-x: auto; padding: 46px; border: 1px solid #dce2e8; border-radius: 6px; background: #fff; box-shadow: 0 14px 40px rgba(31,45,59,.08); }
.pi-document { min-width: 0; color: #1f2c39; font-family: Arial, sans-serif; }
.pi-header { display: grid; grid-template-columns: minmax(520px, 1.45fr) minmax(260px, .8fr); gap: 34px; padding-bottom: 26px; border-bottom: 3px solid #1f5aa6; }
.pi-header p, .pi-parties p { margin: 0 0 7px; color: #1f5aa6; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.pi-header h1 { margin: 0 0 8px; font-size: 21px; white-space: nowrap; }
.pi-header span, .pi-parties span { display: block; margin-top: 4px; color: #637181; font-size: 11px; }
.pi-header .pi-seller-contact { color: #1f2c39; font-size: 10px; white-space: nowrap; }
.pi-title { text-align: right; }
.pi-title h2 { margin: 0 0 12px; color: #1f5aa6; font-size: 27px; }
.pi-title strong { display: block; font-size: 14px; }
.pi-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 24px 0; }
.pi-parties > div { padding: 14px; border: 1px solid #dce3e9; border-radius: 5px; }
.pi-items { min-width: 760px; font-size: 11px; }
.pi-items th { color: #fff; background: #234f83; }
.pi-items th, .pi-items td { white-space: normal; }
.pi-items th:nth-last-child(-n+3), .pi-items td:nth-last-child(-n+3) { text-align: right; }
.pi-items td.pi-specification { text-align: left; line-height: 1.55; min-width: 220px; }
.pi-items tfoot td { color: #1f5aa6; background: #f1f5fa; font-size: 13px; font-weight: 800; text-align: right; }
.pi-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin-top: 22px; }
.pi-terms div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #e6eaee; }
.pi-terms span { color: #6e7c89; font-size: 11px; }
.pi-terms strong { font-size: 11px; text-align: right; }
.pi-bank, .pi-notes { margin-top: 22px; padding: 16px; border: 1px solid #dce3e9; border-radius: 5px; }
.pi-bank h3, .pi-notes h3 { margin: 0 0 10px; color: #1f5aa6; font-size: 12px; }
.pi-bank dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 0; }
.pi-bank dl div { display: grid; grid-template-columns: 85px 1fr; gap: 10px; }
.pi-bank dt { color: #6e7c89; font-size: 10px; }
.pi-bank dd { margin: 0; font-size: 11px; font-weight: 650; }
.pi-notes p { margin: 0; font-size: 11px; white-space: pre-wrap; }
@media (max-width: 900px) {
  .order-list-heading { display: none; }
  .order-list-row { grid-template-columns: 1fr 1fr; }
  .order-detail-layout { grid-template-columns: 1fr; }
  .order-detail-sidebar { position: static; }
  .delivery-task-row { grid-template-columns: 8px minmax(160px, 1fr) 125px 130px; }
  .delivery-task-row .task-note { grid-column: 2 / 4; }
}

@media (max-width: 680px) {
  .orders-shell, .order-detail-shell, .pi-preview-shell { padding: 28px 18px 44px; }
  .order-filters { grid-template-columns: 1fr 1fr; }
  .order-filters label:first-child { grid-column: 1 / -1; }
  .order-list-row { grid-template-columns: 1fr; gap: 12px; }
  .order-metric-grid { grid-template-columns: 1fr 1fr; }
  .order-detail-heading, .pi-preview-toolbar { align-items: flex-start; flex-direction: column; }
  .payment-card-list { grid-template-columns: 1fr; }
  .delivery-task-row { grid-template-columns: 8px 1fr 1fr; align-items: end; }
  .delivery-task-row .task-name { grid-column: 2 / 4; }
  .delivery-task-row .task-note { grid-column: 2 / 4; }
  .delivery-task-row button { grid-column: 3; }
  .pi-paper { padding: 24px; }
}

/* Keep delivery checklist controls inside the main column beside the sticky sidebar. */
@media (max-width: 1200px) {
  .delivery-task-row {
    grid-template-columns: 8px minmax(130px, 1fr) minmax(130px, 1fr) auto;
    align-items: end;
    padding: 14px 2px;
  }
  .delivery-task-row .task-marker { grid-column: 1; grid-row: 1 / 4; align-self: center; }
  .delivery-task-row .task-name { grid-column: 2 / 5; grid-row: 1; }
  .delivery-task-row > label:nth-of-type(1) { grid-column: 2; grid-row: 2; }
  .delivery-task-row > label:nth-of-type(2) { grid-column: 3; grid-row: 2; }
  .delivery-task-row > label:nth-of-type(3) { grid-column: 2; grid-row: 3; }
  .delivery-task-row .task-note { grid-column: 3 / 5; grid-row: 3; }
  .delivery-task-row > button { grid-column: 4; grid-row: 2; }
}

@media (max-width: 680px) {
  .delivery-task-row { grid-template-columns: 8px minmax(0, 1fr); }
  .delivery-task-row .task-marker { grid-column: 1; grid-row: 1 / 7; }
  .delivery-task-row .task-name,
  .delivery-task-row > label:nth-of-type(1),
  .delivery-task-row > label:nth-of-type(2),
  .delivery-task-row > label:nth-of-type(3),
  .delivery-task-row .task-note,
  .delivery-task-row > button { grid-column: 2; grid-row: auto; }
  .delivery-task-row > button { width: 100%; }
}

/* Order assets and SEO case library */
.page-case_assets, .page-seo_cases { background: #f6f8fa; }
.page-case_assets .container, .page-seo_cases .container { padding: 0; }
.case-assets-shell, .seo-cases-shell, .seo-case-detail-shell { width: min(100%, 1180px); margin: 0 auto; padding: 34px 28px 56px; }
.asset-count { color: #1f5aa6; font-size: 12px; font-weight: 750; }
.asset-upload-panel { margin: 16px 0 18px; border: 1px solid #dce4eb; border-radius: 10px; background: #f8fafc; }
.asset-upload-panel > summary, .asset-edit-panel > summary { cursor: pointer; color: #1f5aa6; font-size: 12px; font-weight: 700; list-style: none; }
.asset-upload-panel > summary { padding: 14px 16px; }
.asset-upload-panel > summary i { margin-right: 6px; }
.asset-form { padding: 0 16px 16px; border-top: 1px solid #e5eaf0; }
.asset-form-grid, .asset-edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 15px 0; }
.asset-form-grid label, .asset-edit-form label, .asset-filter-card label, .seo-generator-form label { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #667483; font-size: 11px; font-weight: 650; }
.asset-form-grid input, .asset-form-grid select, .asset-form-grid textarea, .asset-edit-form input, .asset-edit-form select, .asset-edit-form textarea { width: 100%; min-width: 0; background: #fff; }
.asset-form-grid small { color: #8a96a2; font-weight: 500; }
.asset-form-grid .span-2, .asset-edit-form .span-2 { grid-column: 1 / -1; }
.required-star { display: inline; flex: 0 0 auto; color: #c13e3e; white-space: nowrap; }
.asset-permission-row { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 0 0 14px; color: #748291; font-size: 11px; }
.check-line { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 7px !important; color: #334454 !important; }
.check-line input { width: auto !important; }
.asset-card-grid, .asset-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.asset-card, .library-asset-card { overflow: hidden; border: 1px solid #dce3e9; border-radius: 10px; background: #fff; }
.asset-preview { display: flex; min-height: 155px; max-height: 210px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; overflow: hidden; color: #708091; background: #edf2f6; font-size: 11px; text-decoration: none; }
.asset-preview img { width: 100%; height: 100%; min-height: 155px; object-fit: cover; }
.asset-preview i { font-size: 36px; }
.asset-preview span { max-width: 88%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card-body { padding: 12px; }
.asset-card-body > strong { display: block; margin: 8px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.asset-card-body > p { margin: 3px 0; color: #758391; font-size: 10px; }
.asset-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-type-badge, .visibility-badge, .seo-draft-type, .draft-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; }
.asset-type-badge { color: #1f5aa6; background: #eaf2fc; }
.visibility-private { color: #697786; background: #edf1f4; }
.visibility-need_blur { color: #9a4d00; background: #fff0d7; }
.visibility-public { color: #197d4d; background: #e8f6ee; }
.asset-flags { display: flex; flex-wrap: wrap; gap: 7px; margin: 8px 0; }
.asset-flags span { color: #3a765c; font-size: 9px; }
.asset-edit-panel { margin-top: 8px; padding-top: 9px; border-top: 1px solid #e7ebef; }
.asset-edit-form { gap: 8px; }
.asset-edit-actions { display: flex; justify-content: flex-end; }
.danger-text-button { padding: 7px 0; color: #b33a3a; border: 0; background: transparent; font-size: 10px; }
.danger-text-button:hover { text-decoration: underline; }
.asset-empty { display: flex; grid-column: 1 / -1; min-height: 180px; align-items: center; justify-content: center; flex-direction: column; gap: 7px; border: 1px dashed #cad4dd; border-radius: 10px; color: #71808f; background: #fafbfd; text-align: center; }
.asset-empty i { color: #9aa7b3; font-size: 30px; }
.asset-empty span { font-size: 11px; }

.seo-generator-form { padding: 15px; border: 1px solid #dce4eb; border-radius: 10px; background: #f8fafc; }
.seo-generator-panel { margin-top: 18px; padding-top: 18px; border-top: 1px solid #eef2f5; }
.seo-workbench-form { display: grid; gap: 14px; }
.seo-workbench-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.seo-workbench-summary div { padding: 12px; border: 1px solid #dce5ef; border-radius: 8px; background: #f8fafc; }
.seo-workbench-summary span, .seo-material-grid span, .seo-score-row span, .seo-score-total span { display: block; color: #667483; font-size: 11px; font-weight: 700; }
.seo-workbench-summary strong { display: block; margin-top: 4px; color: #203040; font-size: 13px; line-height: 1.35; }
.seo-workbench-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.seo-workbench-main { display: grid; gap: 12px; }
.seo-workbench-card, .seo-side-card { border: 1px solid #dce5ef; border-radius: 10px; background: #fff; padding: 14px; }
.seo-workbench-card-title { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; margin-bottom: 12px; }
.seo-workbench-card-title h3, .seo-side-card h3 { margin: 0; color: #1d2d3a; font-size: 17px; }
.seo-workbench-card-title p { margin: 0; color: #667483; font-size: 12px; font-weight: 650; }
.seo-workbench-sidebar { position: sticky; top: 88px; display: grid; gap: 12px; }
.seo-confirm-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; color: #526576; font-size: 12px; font-weight: 700; }
.seo-confirm-strip label, .seo-meta-control { display: inline-flex !important; flex-direction: row !important; gap: 6px; align-items: center; color: #526576 !important; font-size: 12px !important; }
.seo-meta-control input, .seo-confirm-strip input { width: auto; }
.seo-item-summary-list { display: grid; gap: 8px; margin: 8px 0 12px; }
.seo-item-summary-row { display: grid !important; grid-template-columns: auto 32px minmax(120px, 1fr) minmax(120px, 1fr) minmax(180px, 1.2fr); align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid #dce5ef; border-radius: 8px; background: #fff; color: #263746 !important; font-size: 12px !important; }
.seo-item-summary-row input { width: auto; }
.seo-item-summary-row strong { color: #1d2d3a; }
.seo-item-summary-row small { color: #667483; font-weight: 600; }
.seo-parameter-table { border: 1px solid #dce5ef; border-radius: 8px; overflow: hidden; }
.seo-parameter-head, .seo-parameter-row { display: grid; grid-template-columns: 120px minmax(150px, 1fr) 58px 120px minmax(220px, 1fr); gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #e8eef5; }
.seo-parameter-head { background: #f2f6fa; color: #526576; font-size: 11px; font-weight: 800; }
.seo-parameter-row:last-child { border-bottom: 0; }
.seo-parameter-row input { width: 100%; min-height: 34px; padding: 6px 8px; }
.seo-parameter-row label { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 5px; margin-right: 8px; color: #526576 !important; font-size: 12px !important; }
.seo-parameter-row label input { width: auto; min-height: auto; }
.seo-status-pill { display: inline-flex; justify-content: center; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: #edf1f4; color: #667483; font-size: 11px; font-weight: 800; }
.seo-status-pill.status-confirmed { color: #167449; background: #e6f5ed; }
.seo-status-pill.status-extracted_pending { color: #9a6400; background: #fff3cd; }
.seo-status-pill.status-system_recommended { color: #145da0; background: #e8f2ff; }
.seo-status-pill.status-conflict { color: #b42318; background: #fde8e6; }
.seo-status-pill.status-missing { color: #6c757d; background: #eef1f4; }
.seo-material-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seo-material-grid div { padding: 12px; border: 1px solid #e1e9f1; border-radius: 8px; background: #f8fafc; }
.seo-material-grid strong { display: block; margin-top: 4px; color: #1d2d3a; font-size: 20px; }
.seo-score-row, .seo-score-total { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #edf2f6; }
.seo-score-total { border-bottom: 0; padding-top: 12px; }
.seo-score-row strong, .seo-score-total strong { color: #0f5aa8; }
.seo-side-card a { display: block; padding: 7px 0; color: #1f5faa; font-weight: 700; text-decoration: none; border-bottom: 1px solid #edf2f6; }
.seo-readiness-grid { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 4px; }
.seo-readiness-grid span { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 8px; border-radius: 999px; color: #7a8794; background: #edf1f4; font-size: 10px; font-weight: 750; }
.seo-readiness-grid span.ready { color: #197d4d; background: #e8f6ee; }
.seo-asset-picker { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; padding: 12px; border: 1px solid #dce4eb; border-radius: 8px; background: #fff; }
.seo-asset-picker legend { padding: 0 5px; color: #617181; font-size: 11px; font-weight: 700; }
.seo-asset-option { display: block !important; width: 145px; cursor: pointer; }
.seo-asset-option > input { position: absolute; opacity: 0; }
.seo-asset-option > span { display: grid; grid-template-columns: 40px 1fr; gap: 7px; align-items: center; min-height: 58px; padding: 7px; border: 1px solid #dce3e9; border-radius: 7px; background: #fff; }
.seo-asset-option input:checked + span { border-color: #1f5aa6; box-shadow: 0 0 0 2px rgba(31,90,166,.13); }
.seo-asset-option img { width: 40px; height: 40px; border-radius: 5px; object-fit: cover; }
.seo-asset-option i { width: 40px; color: #778694; font-size: 20px; text-align: center; }
.seo-asset-option strong, .seo-asset-option small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seo-asset-option small { color: #7a8794; font-size: 9px; }
.seo-asset-option.disabled { cursor: default; opacity: .62; }
.seo-generator-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.seo-generator-actions span { color: #607080; font-size: 10px; }

.asset-filter-card { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; margin-bottom: 15px; padding: 14px; border: 1px solid #dce3e9; border-radius: 10px; background: #fff; }
.asset-filter-card input, .asset-filter-card select { width: 100%; min-width: 0; }
.asset-filter-actions { display: flex; align-items: center; gap: 10px; }
.asset-filter-actions a { color: #667483; font-size: 11px; text-decoration: none; }
.library-summary { display: flex; gap: 6px; align-items: baseline; margin: 15px 0 10px; }
.library-summary strong { color: #173f70; font-size: 23px; }
.library-summary span { color: #758391; font-size: 11px; }
.asset-order-link { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px solid #e7ebef; color: #1f5aa6; font-size: 10px; font-weight: 700; text-decoration: none; }

.seo-draft-list { display: flex; flex-direction: column; gap: 9px; }
.seo-draft-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 18px; border: 1px solid #dce3e9; border-radius: 10px; color: #23303b; background: #fff; text-decoration: none; }
.seo-draft-row:hover { border-color: #b8cadc; background: #fbfdff; }
.seo-draft-row h2 { margin: 7px 0 4px; font-size: 17px; }
.seo-draft-row p { margin: 0 0 7px; color: #657483; font-size: 11px; }
.seo-draft-row small { color: #82909d; font-size: 10px; }
.seo-draft-type { color: #1f5aa6; background: #eaf2fc; }
.seo-draft-state { display: flex; align-items: center; gap: 12px; }
.status-draft { color: #9a4d00; background: #fff0d7; }
.status-reviewed { color: #1f5aa6; background: #eaf2fc; }
.status-published { color: #197d4d; background: #e8f6ee; }
.status-archived { color: #697786; background: #edf1f4; }
.seo-case-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.seo-case-sidebar { display: flex; position: sticky; top: 14px; flex-direction: column; gap: 12px; }
.seo-case-sidebar .section-card { margin: 0; }

/* CI / PL document workspace */
.document-center-shell { width: min(100%, 1240px); margin: 0 auto; padding: 34px 28px 56px; }
.document-center-table-card { margin-top: 18px; }
.document-center-table { width: 100%; border-collapse: collapse; }
.document-center-table th, .document-center-table td { padding: 13px 12px; border-bottom: 1px solid #e7edf3; text-align: left; vertical-align: middle; }
.document-center-table th { color: #657485; background: #f7f9fc; font-size: 12px; }
.workspace-state { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px; color: #8b6412; background: #fff4d8; border-radius: 999px; font-size: 11px; font-weight: 750; }

.document-workspace-shell { width: min(100%, 1480px); margin: 0 auto; padding: 26px 24px 48px; }
.document-workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.document-workspace-heading h1 { margin: 5px 0 3px; color: #192b3d; font-size: 28px; }
.document-workspace-heading p { margin: 0; color: #667587; font-size: 13px; }
.document-workspace-grid { display: grid; grid-template-columns: 210px minmax(430px, .92fr) minmax(520px, 1.18fr); min-height: 820px; border: 1px solid #dfe6ee; border-radius: 12px; background: #fff; overflow: hidden; box-shadow: 0 8px 24px rgba(25, 46, 73, .06); }
.document-workspace-nav { padding: 20px 12px; background: #f7f9fc; border-right: 1px solid #e2e8f0; }
.workspace-nav-label { margin: 0 10px 10px; color: #7a8795; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.workspace-nav-label.related { margin-top: 26px; }
.workspace-doc-link { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 5px; padding: 11px 10px; color: #536577; text-decoration: none; border-radius: 8px; }
.workspace-doc-link i { margin-top: 2px; font-size: 16px; }
.workspace-doc-link span { min-width: 0; }
.workspace-doc-link strong, .workspace-doc-link small { display: block; }
.workspace-doc-link strong { color: inherit; font-size: 12px; line-height: 1.35; }
.workspace-doc-link small { margin-top: 3px; color: #8793a0; font-size: 10px; }
.workspace-doc-link.active { color: #1e5eb1; background: #e9f1fd; }
.workspace-doc-link.passive { cursor: default; }
.workspace-readiness { margin: 28px 8px 0; padding-top: 17px; border-top: 1px solid #e1e7ee; }
.workspace-readiness div:first-child { display: flex; justify-content: space-between; color: #5d6d7e; font-size: 11px; }
.workspace-readiness div:first-child strong { color: #1f5daa; font-size: 13px; }
.readiness-bar { height: 6px; margin: 9px 0; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.readiness-bar span { display: block; height: 100%; background: #2d65b2; }
.workspace-readiness small { color: #8a96a3; font-size: 10px; }
.workspace-readiness .ready-copy { color: #27805a; }

.document-editor-panel { min-width: 0; padding: 20px 22px 28px; border-right: 1px solid #e2e8f0; }
.document-editor-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.document-editor-toolbar h2 { margin: 0 0 4px; color: #1b2d3f; font-size: 19px; }
.document-editor-toolbar p { margin: 0; color: #7a8795; font-size: 11px; }
.document-editor-toolbar .heading-actions { flex-wrap: nowrap; }
.document-form-tabs { display: flex; gap: 24px; margin: 18px 0 20px; border-bottom: 1px solid #e1e7ee; }
.document-form-tabs button { padding: 0 3px 10px; color: #657485; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: 12px; }
.document-form-tabs button.active { color: #1f5daa; border-bottom-color: #1f5daa; }
.document-form-section { display: none; }
.document-form-section.active { display: block; }
.document-form-section h3 { margin: 19px 0 10px; color: #23374a; font-size: 14px; }
.document-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; }
.document-form-grid label { display: flex; flex-direction: column; gap: 5px; color: #5c6c7c; font-size: 11px; font-weight: 700; }
.workspace-field-hint { color: #64748b; font-size: 11px; font-weight: 500; }
.order-price-edit-table input { width: 100%; min-width: 120px; padding: 9px 10px; border: 1px solid #d8e1ea; border-radius: 6px; }
.trade-paper table .amount-in-words { padding: 8px 10px; text-align: center; font-weight: 700; }
.document-form-grid .span-2 { grid-column: 1 / -1; }
.document-form-grid input, .document-form-grid select, .document-form-grid textarea { width: 100%; min-width: 0; min-height: 38px; padding: 9px 10px; color: #25384a; background: #fff; border: 1px solid #d8e1ea; border-radius: 6px; font-size: 12px; }
.document-form-grid input:disabled, .document-form-grid textarea:disabled { color: #5f6f80; background: #f5f7fa; }
.shipment-item-editor { margin-bottom: 14px; padding: 13px; background: #f8fafc; border: 1px solid #e0e7ef; border-radius: 8px; }
.shipment-item-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.shipment-item-title strong { color: #24374a; font-size: 13px; }
.shipment-item-title span { color: #768493; font-size: 11px; }
.shipment-total-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 14px; padding: 12px; background: #f1f5f9; border-radius: 8px; }
.shipment-total-strip div { padding: 0 9px; border-right: 1px solid #dbe3ec; }
.shipment-total-strip div:last-child { border-right: 0; }
.shipment-total-strip span, .shipment-total-strip strong { display: block; }
.shipment-total-strip span { color: #7b8794; font-size: 10px; }
.shipment-total-strip strong { margin-top: 4px; color: #24374a; font-size: 12px; }

.document-preview-panel { min-width: 0; padding: 18px; background: #f5f7fa; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; color: #667587; font-size: 11px; }
.preview-toolbar div { display: flex; border: 1px solid #cfd9e5; border-radius: 6px; overflow: hidden; }
.preview-switch { padding: 7px 12px; color: #536577; background: #fff; border: 0; border-right: 1px solid #cfd9e5; border-radius: 0; font-size: 11px; }
.preview-switch:last-child { border-right: 0; }
.preview-switch.active { color: #1f5daa; background: #eef4fd; }
.trade-paper { min-height: 700px; padding: 20px 16px; color: #15191e; background: #fff; border: 1px solid #dbe2ea; box-shadow: 0 3px 12px rgba(32, 48, 67, .08); font-family: Arial, sans-serif; font-size: 9px; }
.trade-paper header { padding: 12px 8px; text-align: center; background: #fff200; }
.trade-paper header strong, .trade-paper header b, .trade-paper header small { display: block; }
.trade-paper header strong { font-size: 13px; }
.trade-paper header b { margin-top: 3px; font-size: 11px; }
.trade-paper header small { margin-top: 5px; font-size: 7px; }
.trade-paper h2 { margin: 22px 0; text-align: center; font-size: 17px; }
.paper-parties { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; align-items: start; }
.paper-parties p:last-child { text-align: right; }
.trade-paper table { width: 100%; margin: 16px 0; border-collapse: collapse; }
.trade-paper th, .trade-paper td { padding: 7px 4px; border: 1px solid #303030; text-align: center; }
.trade-paper th { font-weight: 800; }
.trade-paper td:nth-child(2) { text-align: left; }
.trade-paper tfoot td { font-weight: 800; background: #fff; }
.paper-highlight { background: #fff200; }
.paper-note { padding: 10px 7px; font-weight: 800; line-height: 1.35; }
.paper-statement { margin: 20px 0; font-weight: 700; line-height: 1.5; }
.paper-commercial-terms { margin: 16px 0 0; font-size: 9px; line-height: 1.45; }
.paper-commercial-terms p { margin: 5px 0; }
.paper-pi-certification { margin: 12px 0; font-size: 9px; font-weight: 700; line-height: 1.5; }
.paper-tax-information { margin: -8px 0 12px; padding: 7px 9px; font-size: 9px; font-weight: 700; line-height: 1.5; text-align: left; }

@media (max-width: 1180px) {
  .document-workspace-grid { grid-template-columns: 190px minmax(0, 1fr); }
  .document-preview-panel { grid-column: 1 / -1; border-top: 1px solid #e2e8f0; }
  .trade-paper { max-width: 760px; margin: 0 auto; }
}

@media (max-width: 760px) {
  .document-center-shell, .document-workspace-shell { padding: 22px 14px 40px; }
  .document-workspace-heading, .document-editor-toolbar { align-items: stretch; flex-direction: column; }
  .document-workspace-grid { display: block; }
  .document-workspace-nav { border-right: 0; border-bottom: 1px solid #e2e8f0; }
  .document-form-grid, .shipment-total-strip { grid-template-columns: 1fr; }
  .document-form-grid .span-2 { grid-column: 1; }
  .shipment-total-strip div { padding: 8px 0; border-right: 0; border-bottom: 1px solid #dbe3ec; }
  .trade-paper { overflow-x: auto; }
}
.seo-case-sidebar h2 { margin: 0 0 12px; font-size: 15px; }
.seo-case-preview { padding: 34px; }
.seo-case-article { max-width: 720px; margin: 0 auto; line-height: 1.72; }
.seo-case-article h1 { margin: 0 0 28px; color: #17283a; font-size: 30px; line-height: 1.18; }
.seo-case-article h2 { margin: 27px 0 8px; color: #214f83; font-size: 18px; }
.seo-case-article p, .seo-case-article li { color: #455666; font-size: 13px; }
.seo-case-article figure { margin: 18px 0; }
.seo-case-article figure img { width: 100%; max-height: 460px; border-radius: 8px; object-fit: contain; background: #f1f4f6; }
.seo-case-article figcaption { margin-top: 5px; color: #778492; font-size: 10px; text-align: center; }
.draft-meta { margin: 0; }
.draft-meta div { padding: 8px 0; border-top: 1px solid #e6ebef; }
.draft-meta div:first-child { border-top: 0; }
.draft-meta dt { color: #7a8794; font-size: 9px; }
.draft-meta dd { margin: 3px 0 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 650; }
.draft-asset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.draft-asset-list a { color: #334454; font-size: 9px; text-decoration: none; }
.draft-asset-list img, .draft-asset-list i { display: flex; width: 100%; height: 70px; align-items: center; justify-content: center; border-radius: 6px; object-fit: cover; background: #edf2f6; }
.draft-asset-list span { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 900px) {
  .asset-card-grid, .asset-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-filter-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seo-case-layout { grid-template-columns: 1fr; }
  .seo-case-sidebar { position: static; }
}

@media (max-width: 600px) {
  .case-assets-shell, .seo-cases-shell, .seo-case-detail-shell { padding: 28px 18px 44px; }
  .asset-card-grid, .asset-library-grid, .asset-form-grid, .asset-edit-form, .asset-filter-card { grid-template-columns: 1fr; }
  .asset-form-grid .span-2, .asset-edit-form .span-2 { grid-column: 1; }
  .seo-workbench-summary, .seo-workbench-layout, .seo-material-grid { grid-template-columns: 1fr; }
  .seo-workbench-sidebar { position: static; }
  .seo-parameter-head { display: none; }
  .seo-parameter-row { grid-template-columns: 1fr; }
  .seo-generator-actions, .seo-draft-row { align-items: stretch; flex-direction: column; }
  .seo-item-summary-row { grid-template-columns: auto 28px 1fr; }
  .seo-item-summary-row small { grid-column: 3; }
  .seo-draft-row { display: flex; }
  .seo-draft-state { justify-content: space-between; }
  .seo-case-preview { padding: 22px; }
}
