@import url("/static/css/app.css");

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #111827;
  color: white;
  padding: 24px 16px;
  box-sizing: border-box;
}

.sidebar h2 {
  font-size: 20px;
  margin: 0 0 20px;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  color: #d1d5db;
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: 6px;
}

.nav-link:hover,
.nav-link.active {
  background: #1f2937;
  color: white;
}

.content {
  flex: 1;
  padding: 28px;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 28px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 20px;
}

.page-header p {
  margin: 0;
  color: #6b7280;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  margin-bottom: 18px;
}

.filter-form {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr) auto auto;
  gap: 10px;
}

.filter-form input,
.filter-form select,
.filter-form textarea,
.filter-form button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.data-table th {
  background: #f9fafb;
}

.btn-primary,
.btn-secondary,
.btn-danger {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-link {
  color: #2563eb;
  text-decoration: none;
}

.bulk-print-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.bulk-print-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-print-hint,
.muted-text {
  color: #6b7280;
  font-size: 13px;
}

.select-col {
  width: 58px;
  text-align: center;
}

.print-order-checkbox {
  width: 18px;
  height: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-payment-未付款 {
  background: #fff7ed;
  color: #c2410c;
}

.status-payment-已付款 {
  background: #ecfdf5;
  color: #047857;
}

.status-print-未打印 {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-print-已打印 {
  background: #f3f4f6;
  color: #4b5563;
}

.empty-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  color: #6b7280;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
}

.full-row {
  grid-column: 1 / -1;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-row form,
.page-actions form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-action-row,
.inline-picker-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-picker-form select {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  box-sizing: border-box;
}

.compact-select {
  min-width: 150px;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
  font: inherit;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

.settings-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.settings-form input,
.settings-form select,
.settings-form textarea {
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  box-sizing: border-box;
  font: inherit;
}

.settings-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.compact-settings-grid {
  margin-bottom: 0;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.print-document-body {
  margin: 0;
  background: #eef2f7;
  color: #111827;
}

.print-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #e5e7eb;
}

.delivery-print-document {
  display: grid;
  gap: 16px;
  justify-content: center;
  padding: 18px 0;
}

.print-page {
  width: 194mm;
  height: 281mm;
  background: #ffffff;
  box-sizing: border-box;
  padding: 0;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
  page-break-after: always;
}

.print-page:last-child {
  page-break-after: auto;
}

.delivery-copy {
  height: calc(281mm / 3);
  box-sizing: border-box;
  padding: 5mm 7mm 4mm;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 2.4mm;
  overflow: hidden;
}

.copy-divider {
  border-bottom: 1px dashed #6b7280;
}

.delivery-copy-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8mm;
}

.delivery-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 5mm;
}

.delivery-title-wrap h1 {
  margin: 0;
  font-size: 18pt;
  line-height: 1.1;
  letter-spacing: 0;
}

.delivery-title-wrap span {
  font-size: 10.5pt;
  font-weight: 700;
}

.delivery-order-meta {
  display: grid;
  gap: 1.5mm;
  min-width: 58mm;
  text-align: right;
  font-size: 9pt;
  line-height: 1.2;
}

.delivery-customer-row {
  display: grid;
  grid-template-columns: 1fr 70mm;
  gap: 5mm;
  font-size: 10pt;
  line-height: 1.3;
}

.delivery-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 8.6pt;
  line-height: 1.25;
}

.delivery-table th,
.delivery-table td {
  border: 1px solid #111827;
  padding: 1.3mm 1.5mm;
  vertical-align: top;
  word-break: break-word;
}

.delivery-table th {
  text-align: center;
  font-weight: 700;
}

.delivery-table tfoot td {
  font-weight: 700;
}

.delivery-table .col-name {
  width: 25%;
}

.delivery-table .col-spec {
  width: 16%;
}

.delivery-table .col-unit {
  width: 8%;
}

.delivery-table .col-qty {
  width: 8%;
}

.delivery-table .col-price,
.delivery-table .col-amount {
  width: 11%;
}

.delivery-table .col-remark {
  width: 21%;
}

.delivery-table .blank-row td {
  height: 6mm;
}

.delivery-copy-footer {
  display: grid;
  align-content: end;
  gap: 2mm;
  font-size: 8.4pt;
  line-height: 1.35;
}

.delivery-footer-lines {
  display: grid;
  gap: 0.6mm;
}

.delivery-footer-lines p {
  margin: 0;
}

.delivery-sign-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
  font-size: 9.5pt;
  line-height: 1.3;
}

.public-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.public-header {
  text-align: left;
  margin-bottom: 24px;
}

.public-header h1 {
  margin: 0 0 6px;
  font-size: 32px;
}

.public-header p {
  margin: 0;
  color: #6b7280;
}

.shop-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.showcase-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  margin: 16px 0;
}

.showcase-search input {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-sizing: border-box;
  font: inherit;
}

.showcase-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.showcase-image-frame,
.manage-product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  overflow: hidden;
}

.showcase-card img,
.manage-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.showcase-card-body {
  padding: 12px 14px 14px;
}

.showcase-card h3 {
  margin: 10px 0 6px;
  font-size: 17px;
  line-height: 1.35;
}

.showcase-card p {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quote-line-total {
  font-weight: 700;
  color: #dc2626;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

.form-grid label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
  background: #fff;
}

.full-width {
  grid-column: 1 / -1;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.auth-card h1 {
  margin-top: 0;
  margin-bottom: 8px;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.auth-form input {
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
}

.auth-footer {
  margin-top: 16px;
}

.error-text {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 10px 12px;
  border-radius: 10px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash-message {
  border-radius: 10px;
  padding: 11px 13px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
  line-height: 1.45;
}

.flash-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.flash-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.flash-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.form-error-list {
  margin: 0 0 16px;
  padding: 12px 14px 12px 32px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
}

.log-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.log-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
}

.log-item:last-child {
  border-bottom: none;
}

.log-time,
.log-operator {
  color: #6b7280;
}

.submit-lock-note {
  color: #6b7280;
  font-size: 12px;
}

.inline-danger {
  border: none;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  margin-left: 8px;
}

.inline-danger:hover {
  text-decoration: underline;
}
.mobile-form-card {
  max-width: 760px;
}

.mobile-order-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mobile-order-form input,
.mobile-order-form select,
.mobile-order-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
  background: #ffffff;
  font: inherit;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-item-small {
  max-width: 320px;
}

.required-star {
  color: #dc2626;
}

.help-text {
  color: #6b7280;
  font-size: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.order-entry-page {
  max-width: 920px;
}

.voice-panel {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
  margin-bottom: 18px;
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.voice-icon-button {
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.voice-icon-button.recording {
  background: #dc2626;
  animation: pulse-recording 1s ease-in-out infinite;
}

.voice-icon {
  width: 24px;
  height: 34px;
  border-radius: 14px;
  border: 3px solid currentColor;
  position: relative;
}

.voice-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 3px;
  height: 12px;
  background: currentColor;
  transform: translateX(-50%);
}

.voice-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 24px;
  height: 12px;
  border: 3px solid currentColor;
  border-top: none;
  border-radius: 0 0 16px 16px;
  transform: translateX(-50%);
}

@keyframes pulse-recording {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

.voice-panel p {
  margin: 0;
  color: #6b7280;
}

.voice-panel textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  font: inherit;
  resize: vertical;
}

.voice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app-modal[hidden] {
  display: none;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
}

.app-modal-panel {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.app-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.app-modal-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.app-modal-head p {
  margin: 0;
  color: #6b7280;
}

.compact-voice-modal .voice-panel {
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.draft-message {
  padding: 10px 12px;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e40af;
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.draft-list {
  width: 100%;
  display: grid;
  gap: 10px;
  text-align: left;
}

.draft-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  background: #f9fafb;
}

.draft-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.draft-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-size: 14px;
}

.draft-fields .missing,
.draft-issues {
  color: #b91c1c;
}

.draft-issues {
  margin-top: 10px;
  font-size: 13px;
}

.query-voice-panel {
  margin-bottom: 18px;
}

.query-draft-card {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fafc;
  padding: 14px;
  text-align: left;
}

.query-draft-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.query-draft-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.query-draft-fields span {
  display: grid;
  gap: 4px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  color: #111827;
}

.query-draft-fields strong {
  color: #6b7280;
  font-size: 12px;
}

.category-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.category-quick-btn {
  border: none;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  padding: 7px 12px;
  cursor: pointer;
}

.mobile-order-list,
.bottom-nav {
  display: none;
}

.mobile-menu-button,
.mobile-nav-overlay,
.mobile-new-order-fab {
  display: none;
}

.mobile-order-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
  min-width: 0;
}

.mobile-order-card[data-mobile-toggle-card] {
  cursor: pointer;
}

.mobile-order-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.mobile-order-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #111827;
}

.mobile-order-head span {
  color: #6b7280;
  font-size: 13px;
}

.mobile-order-title {
  margin-top: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mobile-order-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.mobile-order-main {
  min-width: 0;
}

.mobile-order-subtitle {
  color: #6b7280;
  font-size: 13px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-order-amount {
  color: #dc2626;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-order-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.mobile-order-details {
  display: none;
}

.mobile-order-card.is-expanded .mobile-order-details {
  display: grid;
}

.mobile-order-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
  color: #4b5563;
  font-size: 14px;
}

.mobile-order-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-order-more {
  color: #6b7280;
  font-size: 12px;
  margin-top: 10px;
}

.mobile-order-card.is-expanded .mobile-order-more {
  display: none;
}

.mobile-order-action {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.mobile-card-actions {
  display: grid;
  gap: 10px;
}

.mobile-card-actions form {
  margin: 0;
}

.mobile-print-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-weight: 600;
}

.amount-preview {
  float: right;
  color: #2563eb;
  font-size: 13px;
  font-weight: 600;
}

.install-button {
  white-space: nowrap;
}

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  text-decoration: none;
  font-size: 14px;
}

.category-tab.active {
  background: #2563eb;
  color: #ffffff;
}

.showcase-category {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.showcase-code {
  color: #111827;
  font-size: 12px;
  font-weight: 700;
}

.management-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 18px;
  align-items: start;
}

.catalog-panel,
.quote-panel {
  min-width: 0;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.manage-tabs {
  justify-content: flex-start;
  margin-bottom: 0;
}

.manage-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.manage-product-card {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.manage-product-select {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  z-index: 2;
}

.manage-product-select input {
  width: 18px;
  height: 18px;
}

.manage-product-body {
  padding: 12px;
}

.manage-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #6b7280;
  font-size: 12px;
}

.manage-product-card h3 {
  margin: 10px 0 6px;
  font-size: 16px;
  line-height: 1.35;
}

.manage-product-card p {
  min-height: 42px;
  margin: 0 0 12px;
  color: #6b7280;
  line-height: 1.5;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.manage-product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.manage-product-actions .btn-primary,
.manage-product-actions .btn-secondary {
  text-align: center;
  padding: 9px 10px;
  box-sizing: border-box;
}

.quote-panel {
  position: sticky;
  top: 18px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.quote-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.quote-panel-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.quote-panel-head p {
  margin: 0;
  color: #6b7280;
}

.quote-table-wrap {
  max-height: calc(100vh - 260px);
  overflow: auto;
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.quote-table th,
.quote-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.quote-table th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 1;
}

.quote-table input {
  width: 100%;
  min-width: 72px;
  padding: 8px 9px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
}

.quote-thumb {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #f3f4f6;
}

.quote-remove-btn {
  border: none;
  background: transparent;
  color: #dc2626;
  cursor: pointer;
  white-space: nowrap;
}

.quote-empty {
  margin: 14px;
  padding: 24px;
}

.quote-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.manage-showcase-header {
  align-items: flex-start;
}

.manage-selection-grid {
  user-select: none;
}

.manage-select-card {
  position: relative;
  cursor: pointer;
}

.manage-select-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), 0 8px 20px rgba(15, 23, 42, 0.05);
}

.selection-mark {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d1d5db;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  z-index: 2;
  display: none;
}

.selection-mode .selection-mark {
  display: block;
}

.manage-select-card.selected .selection-mark {
  background: #2563eb;
  border-color: #2563eb;
}

.manage-select-card.selected .selection-mark::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 5px;
  width: 8px;
  height: 15px;
  border: solid #ffffff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.quote-modal[hidden] {
  display: none;
}

.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.quote-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.quote-modal-panel {
  position: relative;
  width: min(1060px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.quote-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.quote-modal-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.quote-modal-head p {
  margin: 0;
  color: #6b7280;
}

.quote-modal-panel .quote-table-wrap {
  max-height: none;
  flex: 1;
}

.manage-card-title-only {
  padding: 10px 12px;
}

.manage-card-title-only h3 {
  margin: 0;
}

.showcase-detail-panel {
  width: min(760px, 100%);
}

.showcase-detail-body {
  padding: 18px;
  overflow: auto;
}

.showcase-detail-image,
.showcase-detail-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #f3f4f6;
  object-fit: contain;
}

.showcase-detail-image {
  display: block;
}

.showcase-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.showcase-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.showcase-detail-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 13px;
}

.showcase-detail-body p {
  margin: 14px 0 0;
  color: #374151;
  line-height: 1.7;
  white-space: pre-wrap;
}

.suggest-wrap {
  position: relative;
}

.suggest-box {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
  z-index: 30;
  overflow: hidden;
}

.suggest-item {
  width: 100%;
  border: none;
  background: white;
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 14px;
}

.suggest-item:hover,
.suggest-item:focus {
  background: #f3f4f6;
}

@media (max-width: 768px) {
  html,
  body,
  .layout,
  .content {
    max-width: 100%;
    overflow-x: hidden;
  }

  .layout {
    display: block;
    width: 100%;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(76vw, 220px);
    padding: 64px 12px 18px;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 80;
    overflow-y: auto;
    box-shadow: 12px 0 28px rgba(15, 23, 42, 0.24);
  }

  .sidebar h2 {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .nav-link {
    padding: 12px;
    margin-bottom: 4px;
  }

  .mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-button {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 90;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: #111827;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
  }

  .mobile-menu-button span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #ffffff;
  }

  .mobile-nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.36);
  }

  .mobile-nav-open .mobile-nav-overlay {
    display: block;
  }

  .mobile-new-order-fab {
    position: fixed;
    right: 14px;
    bottom: 16px;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  }

  .content {
    width: 100%;
    min-width: 0;
    padding: 64px 10px 66px;
  }

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

  .page-actions {
    justify-content: flex-end;
    margin-top: 0;
    gap: 8px;
  }

  .page-header h1 {
    font-size: 21px;
  }

  .page-header p {
    font-size: 13px;
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-form input:first-child {
    grid-column: 1 / -1;
  }

  .filter-form input,
  .filter-form select,
  .filter-form textarea,
  .filter-form button,
  .compact-filter-card .btn-secondary {
    min-width: 0;
    min-height: 38px;
    padding: 8px 9px;
    font-size: 14px;
  }

  .compact-filter-card,
  .compact-summary-card,
  .order-results-card,
  .compact-print-picker {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .quick-filter-row {
    margin-top: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
  }

  .quick-filter-row .btn-secondary {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }

  .mobile-form-card {
    max-width: none;
    padding: 10px;
    border-radius: 8px;
  }

  .mobile-order-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-order-form .form-item:first-child,
  .mobile-order-form .form-item:nth-child(3),
  .mobile-order-form .form-item:nth-child(10),
  .mobile-order-form .form-actions {
    grid-column: 1 / -1;
  }

  .form-item {
    gap: 4px;
  }

  .form-item label {
    font-size: 13px;
    font-weight: 600;
  }

  .mobile-order-form input,
  .mobile-order-form select,
  .mobile-order-form textarea,
  .voice-panel textarea {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 16px;
  }

  .mobile-order-form textarea {
    min-height: 72px;
  }

  .help-text {
    display: none;
  }

  .form-actions {
    position: sticky;
    bottom: 0;
    background: rgba(245, 247, 251, 0.96);
    padding: 12px 0 2px;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary,
  .voice-actions .btn-primary,
  .voice-actions .btn-secondary {
    flex: 1;
    text-align: center;
  }

  .orders-table {
    display: none;
  }

  .dashboard-table {
    display: none;
  }

  .mobile-order-list {
    display: grid;
    gap: 8px;
  }

  .mobile-order-card {
    padding: 10px;
    border-radius: 8px;
  }

  .mobile-order-head,
  .mobile-order-summary {
    gap: 8px;
  }

  .mobile-order-title {
    margin-top: 6px;
    font-size: 14px;
  }

  .mobile-order-meta {
    gap: 6px;
    margin: 8px 0;
    font-size: 13px;
  }

  .log-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .mobile-card-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-card-actions .mobile-order-action {
    min-height: 38px;
    padding: 9px 10px;
  }

  .mobile-card-actions form:first-child {
    grid-column: 1 / -1;
  }

  .bottom-nav {
    display: none;
  }

  .draft-fields,
  .mobile-order-meta,
  .query-draft-fields {
    grid-template-columns: 1fr;
  }

  .public-page {
    padding: 14px 10px 24px;
  }

  .shop-header {
    display: flex;
    align-items: flex-end;
  }

  .public-header h1 {
    font-size: 22px;
  }

  .category-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    margin-bottom: 10px;
  }

  .category-tab {
    white-space: nowrap;
  }

  .showcase-grid,
  .manage-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .showcase-search {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    margin: 10px 0;
  }

  .showcase-search .btn-secondary {
    grid-column: 1 / -1;
    text-align: center;
  }

  .showcase-image-frame,
  .manage-product-image {
    aspect-ratio: 4 / 3;
  }

  .showcase-card-body,
  .manage-product-body {
    padding: 8px;
  }

  .showcase-card h3,
  .manage-product-card h3 {
    font-size: 14px;
    margin: 6px 0 4px;
  }

  .manage-card-title-only h3 {
    margin: 0;
  }

  .showcase-card p {
    display: none;
  }

  .app-modal {
    align-items: flex-end;
    padding: 8px;
  }

  .app-modal-panel {
    max-height: calc(100vh - 16px);
    border-radius: 10px 10px 0 0;
  }

  .app-modal-head {
    padding: 12px;
  }

  .app-modal-head h2 {
    font-size: 18px;
  }

  .voice-panel {
    padding: 12px;
  }

  .voice-icon-button {
    width: 54px;
    height: 54px;
  }

  .inline-picker-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .inline-picker-form select,
  .inline-picker-form .btn-primary {
    width: 100%;
    min-width: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-grid input,
  .form-grid select,
  .form-grid textarea {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 16px;
  }

  .management-shell {
    grid-template-columns: 1fr;
  }

  .catalog-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .quote-panel {
    position: static;
  }

  .quote-table-wrap {
    max-height: none;
  }

  .quote-actions .btn-primary,
  .quote-actions .btn-secondary,
  .catalog-toolbar .btn-secondary {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .action-row form,
  .page-actions form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .compact-select {
    width: 100%;
    min-width: 0;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .manage-product-actions {
    grid-template-columns: 1fr;
  }

  .quote-modal {
    padding: 10px;
    align-items: flex-end;
  }

  .quote-modal-panel {
    max-height: calc(100vh - 20px);
  }

  .quote-modal-head {
    display: block;
  }

  .quote-modal-head .btn-secondary {
    margin-top: 12px;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
  }

  .no-print,
  .print-toolbar,
  .sidebar,
  .bottom-nav,
  .mobile-menu-button,
  .mobile-new-order-fab {
    display: none !important;
  }

  .print-document-body {
    background: #ffffff;
  }

  .delivery-print-document {
    display: block;
    padding: 0;
  }

  .print-page {
    width: 194mm;
    height: 281mm;
    margin: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
.priority-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.priority-红色 {
  background: #dc2626;
}

.priority-橙色 {
  background: #ea580c;
}

.priority-黄色 {
  background: #ca8a04;
}

.priority-蓝色 {
  background: #2563eb;
}

.priority-灰色 {
  background: #6b7280;
}
.summary-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

.summary-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px 16px;
}

.summary-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

@media (max-width: 768px) {
  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-item {
    padding: 9px 10px;
    border-radius: 8px;
  }

  .summary-label {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .summary-value {
    font-size: 18px;
  }
}


.quick-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .quick-filter-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

/* Order workflow UX refresh: compact back-office layout, not a marketing page. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-payment-未结清,
.status-payment-未付款 {
  background: #fef2f2;
  color: #b91c1c;
}

.status-payment-已结清,
.status-payment-已付款,
.status-delivery-已拉走,
.status-print-已打印 {
  background: #ecfdf5;
  color: #047857;
}

.status-delivery-未拉走,
.status-print-未打印 {
  background: #fff7ed;
  color: #c2410c;
}

.ledger-page-header {
  margin-bottom: 14px;
}

.ledger-overview-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.4fr repeat(3, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ledger-overview-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #d9e0ea;
  border-left: 4px solid #0f5fb8;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  text-decoration: none;
}

.ledger-overview-card span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.ledger-overview-card strong {
  color: #172033;
  font-size: 24px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.ledger-overview-card em {
  color: #667085;
  font-size: 12px;
  font-style: normal;
}

.ledger-overview-card.is-danger {
  border-left-color: #c81e1e;
}

.ledger-overview-card.is-danger strong {
  color: #c81e1e;
}

.ledger-overview-card.is-warning {
  border-left-color: #b45309;
}

.ledger-overview-card.is-warning strong {
  color: #b45309;
}

.ledger-command-card,
.ledger-results-card {
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.ledger-search-form {
  display: grid;
  gap: 12px;
}

.ledger-search-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.ledger-search-input,
.ledger-filter-grid input,
.ledger-filter-grid select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  box-sizing: border-box;
  font: inherit;
}

.mobile-filter-trigger {
  display: none;
}

.ledger-quick-filters {
  margin-top: 0;
  gap: 8px;
}

.ledger-quick-filters .btn-secondary.active,
.active-filter-chip {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #0b4f9c;
}

.active-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.active-filter-label {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.active-filter-chip {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.active-filter-chip::after {
  content: " ×";
  font-weight: 700;
}

.clear-filter-link {
  color: #0f5fb8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.filter-sheet-backdrop {
  display: none;
}

.filter-sheet-panel {
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.filter-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.filter-sheet-head h2 {
  margin: 0 0 3px;
  font-size: 16px;
}

.filter-sheet-head p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.filter-sheet-close {
  display: none;
}

.ledger-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.ledger-filter-grid label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.filter-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.results-toolbar,
.compact-bulk-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.results-toolbar p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.efficient-orders-table th,
.efficient-orders-table td {
  vertical-align: top;
}

.efficient-orders-table th:nth-child(2),
.efficient-orders-table td:nth-child(2) {
  width: 22%;
}

.efficient-orders-table th:nth-child(3),
.efficient-orders-table td:nth-child(3) {
  width: 30%;
}

.efficient-orders-table th:nth-child(4),
.efficient-orders-table td:nth-child(4) {
  width: 18%;
}

.table-muted-line,
.table-note-line {
  margin-top: 4px;
  color: #667085;
  font-size: 12px;
  line-height: 1.4;
}

.table-note-line {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mobile-card-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mobile-card-primary-actions form {
  margin: 0;
}

.efficient-mobile-card .mobile-order-head {
  align-items: flex-start;
}

.efficient-mobile-card .mobile-order-head > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dashboard-priority-metrics {
  grid-template-columns: 1.5fr repeat(4, minmax(120px, 1fr));
}

.metric-large strong {
  font-size: 30px;
}

.detail-hero-card {
  border-radius: 8px;
}

.detail-hero-main {
  min-width: 0;
}

.detail-status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.muted-risk-text {
  color: #667085;
}

.detail-done-text {
  margin: 10px 0 0;
  color: #047857;
  font-weight: 700;
}

.detail-primary-actions,
.detail-secondary-actions {
  justify-content: space-between;
  align-items: flex-start;
  border-radius: 8px;
}

.detail-primary-actions p,
.detail-secondary-actions p {
  margin: 0;
  color: #667085;
  font-size: 13px;
}

.detail-action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.detail-action-buttons form {
  margin: 0;
}

.efficient-detail-grid > div {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f4;
}

.efficient-detail-grid > div span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.efficient-detail-grid > div strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.form-section-label {
  padding: 4px 0 2px;
  color: #0b4f9c;
  font-size: 13px;
  font-weight: 800;
}

.form-money-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #f8fafc;
}

.form-money-summary div {
  display: grid;
  gap: 4px;
}

.form-money-summary span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

.form-money-summary strong {
  color: #172033;
  font-size: 20px;
}

.form-money-summary .is-danger strong {
  color: #c81e1e;
}

.efficient-order-form .form-item-full,
.efficient-order-form .form-section-label,
.efficient-order-form .form-money-summary,
.efficient-order-form .form-actions {
  grid-column: 1 / -1;
}

@media (max-width: 1024px) {
  .ledger-overview-grid,
  .dashboard-priority-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ledger-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ledger-overview-grid,
  .dashboard-priority-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ledger-overview-card {
    padding: 10px;
    border-radius: 8px;
  }

  .ledger-overview-card strong {
    font-size: 20px;
  }

  .ledger-overview-card:nth-child(2) {
    grid-column: 1 / -1;
  }

  .ledger-search-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .ledger-search-input {
    grid-column: 1 / -1;
    min-height: 44px;
    font-size: 16px;
  }

  .ledger-search-row .btn-primary,
  .ledger-search-row .btn-secondary {
    min-height: 44px;
    padding: 10px 12px;
  }

  .mobile-filter-trigger {
    display: inline-block;
  }

  .ledger-quick-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .ledger-quick-filters .btn-secondary {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }

  .active-filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .active-filter-label,
  .active-filter-chip,
  .clear-filter-link {
    flex: 0 0 auto;
  }

  .filter-sheet {
    display: none;
  }

  .orders-filter-open {
    overflow: hidden;
  }

  .orders-filter-open .filter-sheet {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: block;
  }

  .filter-sheet-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
  }

  .filter-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(82vh, 680px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
  }

  .filter-sheet-head {
    padding: 12px;
    background: #ffffff;
  }

  .filter-sheet-close {
    display: inline-block;
  }

  .ledger-filter-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
  }

  .ledger-filter-grid input,
  .ledger-filter-grid select {
    min-height: 44px;
    font-size: 16px;
  }

  .filter-sheet-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .filter-sheet-actions .btn-primary,
  .filter-sheet-actions .btn-secondary {
    min-height: 44px;
    text-align: center;
  }

  .results-toolbar,
  .compact-bulk-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .compact-bulk-bar .bulk-print-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mobile-card-primary-actions {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-card-primary-actions .mobile-order-action,
  .mobile-card-actions .mobile-order-action {
    min-height: 44px;
    padding: 11px 10px;
  }

  .efficient-mobile-card {
    border-radius: 8px;
    padding: 12px;
  }

  .efficient-mobile-card .mobile-order-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .efficient-mobile-card .mobile-order-amount {
    font-size: 14px;
  }

  .detail-hero-card,
  .detail-primary-actions,
  .detail-secondary-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-status-stack,
  .detail-action-buttons {
    justify-content: flex-start;
  }

  .detail-action-buttons,
  .detail-secondary-actions .action-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-action-buttons .btn-primary,
  .detail-action-buttons .btn-secondary,
  .detail-secondary-actions .btn-secondary,
  .detail-secondary-actions .btn-danger {
    width: 100%;
    min-height: 44px;
    text-align: center;
    box-sizing: border-box;
  }

  .form-section-label,
  .efficient-order-form .form-item-full,
  .efficient-order-form .form-money-summary,
  .efficient-order-form .form-actions {
    grid-column: 1 / -1;
  }

  .form-money-summary {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    padding: 10px;
  }

  .form-money-summary strong {
    font-size: 17px;
  }
}
