/* Keep the full-screen invoice editor consistently readable in dark mode. */
html[data-theme="dark"] .sales-invoice-modal { background:#110c20 !important; }
html[data-theme="dark"] .sales-invoice-editor { background:#20172f !important; color:#eee9fb !important; }
html[data-theme="dark"] .sales-invoice-editor-header,
html[data-theme="dark"] .sales-invoice-editor-actions { background:#20172f !important; border-color:#3a2e51 !important; color:#eee9fb !important; box-shadow:0 2px 12px #0000002b !important; }
html[data-theme="dark"] .sales-invoice-editor :is(h1,h2,h3,label,summary,.sales-invoice-line-headings,.sales-invoice-summary) { color:#f5f1ff !important; }
html[data-theme="dark"] .sales-invoice-editor .muted,
html[data-theme="dark"] .sales-invoice-editor .so-field-label { color:#b5aaca !important; }
html[data-theme="dark"] .sales-invoice-editor :is(input,select,textarea) { background:#171020 !important; color:#eee9fb !important; border-color:#4c3c66 !important; }
html[data-theme="dark"] .sales-invoice-editor :is(input,select,textarea)::placeholder { color:#b5aaca !important; }
html[data-theme="dark"] .sales-invoice-editor option { background:#171020; color:#eee9fb; }
html[data-theme="dark"] .sales-invoice-editor .sales-invoice-line { background:#281e3b !important; border-color:#4c3c66 !important; box-shadow:0 1px 2px #00000035 !important; }
html[data-theme="dark"] .sales-invoice-editor :is(.invoice-taxable-value,.invoice-vat-value,.sales-invoice-line > output) { background:#302149 !important; border-color:#4c3c66 !important; color:#f5f1ff !important; }
html[data-theme="dark"] .sales-invoice-editor :is(.secondary-btn,details > summary) { background:#302149 !important; border-color:#4c3c66 !important; color:#cdb9ff !important; }
html[data-theme="dark"] .sales-invoice-editor .error { color:#ffadbe !important; }

/* Always-visible, scan-friendly total panel for rapid invoice entry. */
.sales-invoice-editor-actions { gap:14px !important; }
.sales-invoice-summary {
  display:grid;
  grid-template-columns:repeat(3,minmax(116px,1fr));
  gap:8px;
  margin-right:auto;
  min-width:min(510px,100%);
}
.sales-invoice-total-metric {
  display:grid;
  gap:2px;
  min-width:0;
  padding:8px 12px;
  border:1px solid #d9e0ec;
  border-radius:9px;
  background:#f7f9fc;
  color:#334155;
}
.sales-invoice-total-metric span { font-size:11px; font-weight:700; letter-spacing:.015em; color:#64748b; }
.sales-invoice-total-metric strong { font-size:18px; line-height:1.1; white-space:nowrap; color:#1e293b; }
.sales-invoice-total-metric.is-grand-total { background:#5d35de; border-color:#5d35de; }
.sales-invoice-total-metric.is-grand-total span,
.sales-invoice-total-metric.is-grand-total strong { color:#fff; }
html[data-theme="dark"] .sales-invoice-total-metric { background:#302149 !important; border-color:#4c3c66 !important; }
html[data-theme="dark"] .sales-invoice-total-metric span { color:#c9bddf !important; }
html[data-theme="dark"] .sales-invoice-total-metric strong { color:#fff !important; }
html[data-theme="dark"] .sales-invoice-total-metric.is-grand-total { background:#7048f8 !important; border-color:#8d70ff !important; }
@media (max-width:850px) {
  .sales-invoice-editor-actions { flex-wrap:wrap; }
  .sales-invoice-summary { order:-1; width:100%; min-width:0; }
}
@media (max-width:520px) {
  .sales-invoice-summary { grid-template-columns:1fr; }
}
