:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-soft: #f9f9f9;
  --primary: #ef6c00;
  --primary-dark: #c65300;
  --text: #111111;
  --muted: #666666;
  --border: #d8d8d8;
  --success: #2e7d32;
  --error: #c62828;
  --radius: 14px;
  color-scheme: light;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% 0%, #fffaf5 0%, var(--bg) 45%);
  color: var(--text);
}
a { color: inherit; }
#app { min-height: 100vh; }

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 18px;
}

.login-box {
  width: min(420px, 96vw);
  background: var(--surface);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
}

.login-box h1 { margin: 0 0 10px; font-size: 30px; }
.login-business-name {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: #222;
}
.form-grid { display: grid; gap: 10px; }
label { font-weight: 600; font-size: 14px; text-align: right; }

input,
select,
textarea,
button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 11px 12px;
  font-size: 16px;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid #ffa45b;
  outline-offset: 1px;
}

button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}
button:hover { background: var(--primary-dark); }
button.secondary {
  background: #f1f1f1;
  color: #222;
  border: 1px solid #d1d1d1;
}
button.secondary:hover { background: #e8e8e8; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: #fff;
  border-left: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar .logo {
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 12px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: #f5f5f5;
  color: #1f1f1f;
}

.nav-btn.active {
  background: linear-gradient(135deg, #ef6c00, #f57c00);
  color: #fff;
}

.content-area { flex: 1; padding: 24px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.page { display: none; }
.page.active { display: block; }

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

.card {
  background: var(--surface);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 10px;
  border-bottom: 1px solid #efefef;
  text-align: right;
}

#products .products-table-wrap {
  width: 100%;
  overflow-x: auto;
}

#products .products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#products .products-toolbar h1 {
  margin: 0;
  flex: 0 0 auto;
}

#products .products-search-wrap {
  position: relative;
  flex: 1 1 520px;
  max-width: 760px;
  margin-inline: 10px;
}

#products .products-search-icon {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
  pointer-events: none;
}

#products #productsSearchInput {
  width: 100%;
  padding-inline-end: 38px;
}

#products .products-add-btn {
  width: auto;
  min-width: 124px;
  padding: 8px 14px;
  font-size: 14px;
  flex: 0 0 auto;
}

#products #productsTable {
  width: 100%;
  min-width: 1280px;
  table-layout: fixed;
}

#products #productsTable .products-data-col {
  width: 6.35%;
}

#products #productsTable .products-actions-col {
  width: 20%;
}

#products #productsTable th,
#products #productsTable td {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  height: 56px;
  padding: 10px 8px;
}

#products #productsTable td {
  overflow: hidden;
  text-overflow: ellipsis;
}

#products .products-actions-head,
#products .products-actions-cell {
  text-align: center;
}

#products .products-actions-cell {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}

#products .products-action-icon {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

#products .products-action-icon-svg {
  width: 21px;
  height: 21px;
  display: block;
}

#products .products-action-icon.edit {
  background: #ffe7d1;
  color: #ef6c00;
}

#products .products-action-icon.edit:hover,
#products .products-action-icon.edit:active {
  background: #ef6c00;
  color: #fff;
}

#products .products-action-icon.delete {
  background: #eceff3;
  color: #6b7280;
}

#products .products-action-icon.delete:hover,
#products .products-action-icon.delete:active {
  background: #6b7280;
  color: #fff;
}

#products .products-datasheet-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#globalModalRoot .products-delete-confirm-modal,
#customerCardModalRoot .products-delete-confirm-modal {
  width: min(420px, 92vw);
  text-align: center;
}

#globalModalRoot .products-delete-confirm-modal h3,
#customerCardModalRoot .products-delete-confirm-modal h3 {
  margin: 0;
  font-size: 22px;
}

#globalModalRoot .products-delete-confirm-actions,
#customerCardModalRoot .products-delete-confirm-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#globalModalRoot .products-delete-btn,
#customerCardModalRoot .products-delete-btn {
  width: 52px;
  min-width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 0;
  cursor: pointer;
}

#globalModalRoot .products-delete-btn.approve,
#customerCardModalRoot .products-delete-btn.approve {
  background: #ffe7d1;
  color: #ef6c00;
}

#globalModalRoot .products-delete-btn.approve:hover,
#globalModalRoot .products-delete-btn.approve:active,
#customerCardModalRoot .products-delete-btn.approve:hover,
#customerCardModalRoot .products-delete-btn.approve:active {
  background: #ef6c00;
  color: #fff;
}

#globalModalRoot .products-delete-btn.cancel,
#customerCardModalRoot .products-delete-btn.cancel {
  background: #eceff3;
  color: #6b7280;
}

#globalModalRoot .products-delete-btn.cancel:hover,
#globalModalRoot .products-delete-btn.cancel:active,
#customerCardModalRoot .products-delete-btn.cancel:hover,
#customerCardModalRoot .products-delete-btn.cancel:active {
  background: #6b7280;
  color: #fff;
}

.customer-public-highlight td {
  background: #fff8e8;
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffe7d1;
  color: #a54100;
}

.row { display: flex; gap: 10px; }
.hidden { display: none !important; }
.error { color: var(--error); font-size: 14px; }
.success { color: var(--success); font-size: 14px; }

.settings-page h1 { margin: 0 0 8px; }
.settings-page-desc {
  margin: 0 0 16px;
  color: var(--muted);
  max-width: 800px;
}

.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.settings-card-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.settings-card h3 {
  margin: 0;
  font-size: 18px;
}

.settings-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.settings-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff2e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.settings-status {
  font-size: 13px;
  color: #444;
  background: #f5f5f5;
  border-radius: 9px;
  padding: 8px;
}

.settings-open-btn {
  width: auto;
  justify-self: start;
  padding: 10px 16px;
}

body.modal-open {
  overflow: hidden;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 5500;
  padding: 16px;
}

.modal {
  width: min(900px, 96vw);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 16px;
  direction: rtl;
  text-align: right;
}

.form-submission-view-overlay {
  position: fixed;
  inset: 0;
  z-index: 5600;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 16px;
}

.form-submission-view-modal {
  width: min(760px, 96vw);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border: 1px solid #e8ebf0;
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.2);
  padding: 18px;
  position: relative;
  direction: rtl;
  text-align: right;
}

.form-submission-close-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #d7dbe2;
  background: #fff4ea;
  color: #ef6c00;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.form-submission-close-icon:hover,
.form-submission-close-icon:active {
  background: #ef6c00;
  color: #fff;
}

.form-submission-modal-header {
  margin: 0 40px 8px;
}

.form-submission-view-title {
  margin: 0;
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}

.form-submission-main-title {
  margin: 6px 0 0;
  text-align: center;
  font-size: 26px;
  font-weight: 700;
}

.form-submission-meta-row {
  margin-top: 14px;
  padding: 10px 0 14px;
  border-bottom: 1px solid #eceff3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-submission-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  color: #111827;
}

.form-submission-date-item {
  text-align: left;
}

.form-submission-details {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-submission-field {
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 12px;
  padding: 10px 12px;
}

.form-submission-field-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
}

.form-submission-field-value {
  font-size: 17px;
  color: #111827;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-submission-empty {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed #d7dbe2;
  border-radius: 10px;
  color: #6b7280;
}

.form-submission-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
  direction: ltr;
}

.form-submission-add-btn {
  width: auto;
  min-width: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffb16a;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.form-submission-add-btn:hover,
.form-submission-add-btn:active {
  background: #ef6c00;
}

.product-modal {
  width: min(760px, 100%);
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.product-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.product-modal-header h2 {
  margin: 0;
  font-size: 24px;
  text-align: center;
}

.product-modal-header-spacer {
  width: 32px;
  min-width: 32px;
}

.product-modal-form-grid {
  gap: 12px;
}

.product-modal-images-block,
.product-modal-datasheet-row,
.product-modal-toggle-row {
  grid-column: 1 / -1;
}

.product-modal-images-block {
  display: grid;
  gap: 8px;
}

.product-modal-datasheet-row,
.product-modal-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-modal-datasheet-row {
  justify-content: space-between;
}

.product-modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.product-modal-actions button {
  width: auto;
  min-width: 120px;
}

.settings-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 5000;
}

.settings-modal {
  width: min(900px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #ddd;
  padding: 16px;
  direction: rtl;
  text-align: right;
}

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.settings-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.settings-modal.icon-close-mode {
  position: relative;
  padding-top: 18px;
}

.icon-close-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  background: #f5f5f5;
  color: #1f1f1f;
  border: 1px solid #d7d7d7;
  font-size: 20px;
  line-height: 1;
}

.icon-close-btn:hover {
  background: #ededed;
}

.popup-close-icon-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid #d8dde3;
  background: #f6f8fb;
  color: #111827;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.popup-close-icon-btn:hover {
  background: #ebeff4;
}

.danger-close {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  background: #d32f2f;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  margin-right: auto;
}

.danger-close:hover {
  background: #b71c1c;
}

.settings-modal-content {
  display: grid;
  gap: 10px;
}

.settings-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.settings-modal-actions.raw-send-actions {
  justify-content: center;
}

.settings-modal-actions.raw-send-actions button {
  width: auto;
  min-width: 180px;
}

.settings-modal.form-types-settings-modal {
  width: 600px;
  max-width: 92vw;
  height: 400px;
  max-height: 400px;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  direction: rtl;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.settings-modal.form-types-settings-modal .settings-modal-content {
  min-height: 0;
  overflow: hidden;
}

#formTypesSettingsPanel {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 10px;
  align-content: start;
}

#formTypesSettingsPanel .form-types-input-label {
  justify-self: center;
  font-weight: 700;
}

#formTypesSettingsPanel #formTypeNewNameInput {
  width: 100%;
}

#formTypesSettingsPanel .form-types-input-row {
  width: min(500px, 100%);
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
}

#formTypesSettingsPanel .form-types-inline-trash {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #eceff3;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

#formTypesSettingsPanel .form-types-inline-trash:hover,
#formTypesSettingsPanel .form-types-inline-trash:active {
  background: #6b7280;
  color: #fff;
}

#formTypesSettingsPanel .form-types-duplicate-msg {
  justify-self: center;
  color: #b91c1c;
  font-size: 13px;
  min-height: 18px;
}

#formTypesSettingsPanel .form-types-list {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
  overflow: auto;
  padding: 8px;
  min-height: 0;
  height: 100%;
}

#formTypesSettingsPanel .form-types-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eceff3;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

#formTypesSettingsPanel .form-types-row-check {
  margin: 0;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

#formTypesSettingsPanel .form-types-row-text {
  flex: 1;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#formTypesSettingsPanel .form-types-row + .form-types-row {
  margin-top: 8px;
}

#formTypesSettingsPanel .form-types-empty-note {
  text-align: center;
  color: #6b7280;
  padding: 20px 10px;
}

.settings-modal-actions.form-types-popup-actions {
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.settings-modal-actions.form-types-popup-actions .form-types-icon-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.settings-modal-actions.form-types-popup-actions .form-types-icon-btn.approve {
  background: #ffb16a;
  color: #fff;
}

.settings-modal-actions.form-types-popup-actions .form-types-icon-btn.approve:hover,
.settings-modal-actions.form-types-popup-actions .form-types-icon-btn.approve:active {
  background: #ef6c00;
}

.settings-modal-actions.form-types-popup-actions .form-types-icon-btn.cancel {
  background: #e5e7eb;
  color: #4b5563;
}

.settings-modal-actions.form-types-popup-actions .form-types-icon-btn.cancel:hover,
.settings-modal-actions.form-types-popup-actions .form-types-icon-btn.cancel:active {
  background: #6b7280;
  color: #fff;
}

.settings-modal-actions.form-types-popup-actions .form-types-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.settings-modal.labels-printer-modal {
  width: 1000px;
  max-width: 98vw;
  height: 1200px;
  max-height: 95vh;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  direction: rtl;
}

.labels-settings-page.settings-modal.labels-printer-modal {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  border-radius: 0;
  overflow: visible;
  grid-template-rows: auto auto 1fr auto;
}

.labels-settings-page .settings-modal-content {
  overflow: visible;
  padding: 0;
}

.labels-settings-page .labels-settings-topbar {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.labels-settings-page .labels-settings-back-btn {
  width: auto;
  min-width: 110px;
  height: 44px;
  align-self: flex-start;
}

.labels-settings-page .labels-settings-page-shell {
  width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  background: transparent;
}

.labels-settings-page .labels-settings-page-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), #ffffff);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.06);
}

.labels-settings-page .labels-popup-shell {
  padding: 24px;
}

.labels-settings-page .labels-popup-group {
  padding: 18px;
}

@media (max-width: 900px) {
  .labels-settings-page .labels-settings-topbar {
    flex-direction: column;
  }

  .labels-settings-page .labels-settings-back-btn {
    width: 100%;
  }

  .labels-settings-page .labels-popup-row,
  .labels-settings-page .labels-popup-row.two-col,
  .labels-settings-page .labels-popup-row.three-col,
  .labels-settings-page .labels-popup-row.four-col,
  .labels-settings-page .labels-popup-row-printer,
  .labels-settings-page .labels-popup-row.fields-selection {
    flex-direction: column;
    align-items: stretch;
  }

  .labels-settings-page .labels-popup-field,
  .labels-settings-page .labels-popup-row.two-col .labels-popup-field,
  .labels-settings-page .labels-popup-row.three-col .labels-popup-field,
  .labels-settings-page .labels-popup-row.four-col .labels-popup-field,
  .labels-settings-page .labels-popup-row-printer .labels-popup-field {
    width: 100%;
    max-width: none;
  }

  .labels-settings-page .labels-layout-editor-col,
  .labels-settings-page .labels-preview-col {
    width: 100%;
    max-width: none;
  }

  .labels-settings-page .labels-popup-check {
    width: 100%;
  }
}

.settings-modal.labels-printer-modal .settings-modal-content {
  min-height: 0;
  overflow: auto;
  padding: 5%;
  display: grid;
  grid-auto-rows: max-content;
  row-gap: 5px;
}

.settings-modal.labels-printer-modal .labels-popup-shell {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  row-gap: 5px;
}

.settings-modal.labels-printer-modal .labels-settings-layout {
  row-gap: 12px;
}

.settings-modal.labels-printer-modal .labels-popup-group {
  border: 1px solid #ececec;
  border-radius: 14px;
  background: #fbfbfb;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.settings-modal.labels-printer-modal .labels-popup-group h3 {
  margin: 0;
  font-size: 26px;
}

.settings-modal.labels-printer-modal .labels-popup-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2%;
  flex-wrap: wrap;
}

.settings-modal.labels-printer-modal .labels-popup-row.fields-selection {
  align-items: flex-start;
  gap: 5%;
}

.settings-modal.labels-printer-modal .labels-popup-row.two-col .labels-popup-field {
  width: min(260px, 44%);
}

.settings-modal.labels-printer-modal .labels-popup-row.four-col .labels-popup-field {
  width: min(180px, 22%);
}

.settings-modal.labels-printer-modal .labels-popup-row.three-col .labels-popup-field {
  width: min(250px, 31%);
}

.settings-modal.labels-printer-modal .labels-popup-field {
  display: grid;
  gap: 9px;
  width: min(280px, 100%);
  text-align: right;
}

.settings-modal.labels-printer-modal .labels-popup-field label {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
}

.settings-modal.labels-printer-modal .labels-popup-field input,
.settings-modal.labels-printer-modal .labels-popup-field select,
.settings-modal.labels-printer-modal .labels-popup-field textarea {
  font-size: 20px;
  min-height: 48px;
}

.settings-modal.labels-printer-modal .labels-template-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-modal.labels-printer-modal .labels-template-picker-row select {
  flex: 1;
}

.settings-modal.labels-printer-modal .labels-template-name-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.settings-modal.labels-printer-modal .labels-popup-row-printer .labels-popup-field {
  width: min(420px, 70%);
}

.settings-modal.labels-printer-modal .labels-popup-mini-btn {
  width: auto;
  min-width: 58px;
  min-height: 50px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 22px;
}

.settings-modal.labels-printer-modal .labels-popup-check {
  width: auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  direction: rtl;
  background: transparent;
  border: 0;
  padding: 0;
}

.settings-modal.labels-printer-modal .labels-popup-check span {
  direction: rtl;
  font-size: 20px;
}

.settings-modal.labels-printer-modal .labels-popup-check input {
  width: 22px;
  min-width: 22px;
  height: 22px;
  margin: 0;
}

.settings-modal.labels-printer-modal .labels-popup-check-list {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  padding: 2px 0;
}

.settings-modal.labels-printer-modal .labels-popup-check-list small {
  display: none;
}

.settings-modal.labels-printer-modal .options-row {
  justify-content: center;
  gap: 22px;
}

.settings-modal.labels-printer-modal .labels-region-toolbar {
  justify-content: space-between;
}

.settings-modal.labels-printer-modal .labels-grid-toolbar-row {
  align-items: end;
}

.settings-modal.labels-printer-modal .labels-advanced-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.settings-modal.labels-printer-modal .labels-advanced-accordion summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 20px;
  font-weight: 700;
  list-style: none;
}

.settings-modal.labels-printer-modal .labels-advanced-accordion summary::-webkit-details-marker {
  display: none;
}

.settings-modal.labels-printer-modal .labels-advanced-content {
  border-top: 1px solid #e5e7eb;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.settings-modal.labels-printer-modal .labels-field-group-basic {
  display: grid;
  gap: 4px;
}

.settings-modal.labels-printer-modal .labels-field-group-extra {
  border-top: 1px dashed #d8dce3;
  padding-top: 8px;
}

.settings-modal.labels-printer-modal .labels-field-group-extra summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: #334155;
}

.settings-modal.labels-printer-modal .labels-field-group-extra-list {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.settings-modal.labels-printer-modal .labels-layout-preview-grid {
  align-items: stretch;
}

.settings-modal.labels-printer-modal .labels-layout-editor-col {
  display: none;
}

.settings-modal.labels-printer-modal .labels-preview-col {
  width: min(1150px, 100%);
  align-self: stretch;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.settings-modal.labels-printer-modal .labels-preview-col h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.settings-modal.labels-printer-modal .labels-field-toolbar {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fffaf3;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.settings-modal.labels-printer-modal .labels-field-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.settings-modal.labels-printer-modal .labels-field-align-actions,
.settings-modal.labels-printer-modal .labels-field-toolbar-actions {
  gap: 8px;
}

.settings-modal.labels-printer-modal .labels-field-align-actions .labels-popup-mini-btn,
.settings-modal.labels-printer-modal .labels-field-toolbar-actions .labels-popup-mini-btn {
  min-width: 110px;
}

.settings-modal.labels-printer-modal .labels-region-fields {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  max-height: 220px;
  overflow: auto;
}

.settings-modal.labels-printer-modal .labels-layout-canvas {
  width: min(1100px, 100%);
  margin: 0 auto;
  min-height: 520px;
  border: 1px solid #d6dbe3;
  border-radius: 12px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.settings-modal.labels-printer-modal .labels-layout-canvas.grid-on {
  background-image:
    linear-gradient(to right, rgba(31, 41, 55, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 41, 55, 0.08) 1px, transparent 1px);
  background-size: var(--labels-grid-size, 24px) var(--labels-grid-size, 24px);
}

.settings-modal.labels-printer-modal .labels-rendered-preview-wrap {
  margin-top: 12px;
  border: 1px dashed #cfd4dc;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.settings-modal.labels-printer-modal .labels-rendered-preview-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid #e5e7eb;
}

.settings-modal.labels-printer-modal .labels-preview-region {
  position: absolute;
  border: 1px dashed transparent;
  border-radius: 6px;
  background: transparent;
  overflow: hidden;
}

.settings-modal.labels-printer-modal .labels-preview-region.active {
  border-color: rgba(239, 108, 0, 0.45);
}

.settings-modal.labels-printer-modal .labels-preview-field {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 1px 3px;
  font-size: 18px;
  cursor: move;
  display: flex;
  align-items: flex-start;
  align-content: flex-start;
  overflow: hidden;
  text-overflow: clip;
  word-break: break-word;
  user-select: none;
  unicode-bidi: plaintext;
}

.settings-modal.labels-printer-modal .labels-preview-field .labels-preview-field-text {
  width: 100%;
  display: block;
  overflow: hidden;
  unicode-bidi: plaintext;
}

.settings-modal.labels-printer-modal .labels-preview-field.selected {
  border-color: #ef6c00;
  background: rgba(255, 243, 228, 0.5);
}

.settings-modal.labels-printer-modal .labels-preview-field.overflow-warning {
  box-shadow: inset 0 0 0 1px #dc2626;
}

.settings-modal.labels-printer-modal .labels-editor {
  display: grid;
  gap: 12px;
}

.settings-modal.labels-printer-modal .labels-editor-topbar {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8dee6;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.settings-modal.labels-printer-modal .labels-editor-topbar-left,
.settings-modal.labels-printer-modal .labels-editor-topbar-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.settings-modal.labels-printer-modal .labels-editor-icon-btn {
  min-width: 40px;
  height: 40px;
  border: 1px solid #cdd5df;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.settings-modal.labels-printer-modal .labels-editor-meta-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}

.settings-modal.labels-printer-modal .labels-editor-meta-input input {
  width: 80px;
  min-height: 36px;
  font-size: 14px;
}

.settings-modal.labels-printer-modal .labels-editor-main {
  display: grid;
  grid-template-columns: 52px 260px minmax(420px, 1fr) 280px;
  gap: 10px;
  min-height: 620px;
}

.settings-modal.labels-printer-modal .labels-editor-sidebar,
.settings-modal.labels-printer-modal .labels-editor-panels,
.settings-modal.labels-printer-modal .labels-editor-stage,
.settings-modal.labels-printer-modal .labels-editor-properties {
  border: 1px solid #dbe3ed;
  border-radius: 12px;
  background: #fff;
}

.settings-modal.labels-printer-modal .labels-editor-sidebar {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 6px;
}

.settings-modal.labels-printer-modal .labels-editor-side-btn {
  width: 100%;
  height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 9px;
  background: #f8fafc;
  cursor: pointer;
}

.settings-modal.labels-printer-modal .labels-editor-side-btn.active {
  border-color: #ef6c00;
  background: #fff1e4;
}

.settings-modal.labels-printer-modal .labels-editor-panels,
.settings-modal.labels-printer-modal .labels-editor-properties {
  padding: 10px;
  overflow: auto;
}

.settings-modal.labels-printer-modal .labels-editor-panel {
  display: none;
  gap: 8px;
}

.settings-modal.labels-printer-modal .labels-editor-panel.active {
  display: grid;
}

.settings-modal.labels-printer-modal .labels-editor-panel h3,
.settings-modal.labels-printer-modal .labels-editor-properties h3 {
  margin: 0;
  font-size: 18px;
}

.settings-modal.labels-printer-modal .labels-editor-stage {
  position: relative;
  background: radial-gradient(circle at 20% 20%, #f8fbff 0%, #eef3fa 100%);
  padding: 28px 12px 12px 34px;
  overflow: auto;
}

.settings-modal.labels-printer-modal .labels-editor-ruler-top {
  position: absolute;
  top: 0;
  right: 34px;
  left: 12px;
  height: 24px;
  border-bottom: 1px solid #d4dde9;
  background: #f4f7fb;
}

.settings-modal.labels-printer-modal .labels-editor-ruler-top span {
  position: absolute;
  transform: translateX(-50%);
  top: 2px;
  font-size: 10px;
  color: #64748b;
}

.settings-modal.labels-printer-modal .labels-editor-ruler-left {
  position: absolute;
  right: 0;
  top: 28px;
  bottom: 12px;
  width: 24px;
  border-left: 1px solid #d4dde9;
  background: #f4f7fb;
}

.settings-modal.labels-printer-modal .labels-editor-ruler-left span {
  position: absolute;
  transform: translateY(-50%);
  right: 2px;
  font-size: 10px;
  color: #64748b;
}

.settings-modal.labels-printer-modal .labels-editor-canvas-wrap {
  min-height: 520px;
  display: grid;
  align-content: start;
  justify-content: center;
  gap: 8px;
}

.settings-modal.labels-printer-modal .labels-layout-canvas {
  margin: 0;
  min-height: 0;
  border-style: solid;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.14);
}

.settings-modal.labels-printer-modal .labels-preview-region {
  cursor: pointer;
}

.settings-modal.labels-printer-modal .labels-preview-field {
  padding: 2px 6px;
  border-radius: 6px;
}

.settings-modal.labels-printer-modal .labels-field-resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  left: -3px;
  bottom: -3px;
  border-radius: 50%;
  background: #ef6c00;
  border: 1px solid #fff;
  cursor: nwse-resize;
}

@media (max-width: 1280px) {
  .settings-modal.labels-printer-modal .labels-editor-main {
    grid-template-columns: 52px 230px 1fr;
  }

  .settings-modal.labels-printer-modal .labels-editor-properties {
    grid-column: 1 / -1;
    max-height: 240px;
  }
}

@media (max-width: 900px) {
  .settings-modal.labels-printer-modal .labels-editor-main {
    grid-template-columns: 1fr;
  }

  .settings-modal.labels-printer-modal .labels-editor-sidebar {
    grid-auto-flow: column;
    grid-auto-columns: 42px;
    overflow: auto;
  }

  .settings-modal.labels-printer-modal .labels-editor-stage {
    min-height: 440px;
  }
}

.settings-modal-actions.labels-printer-actions {
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn {
  width: 74px;
  min-width: 74px;
  height: 74px;
  border-radius: 999px;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  line-height: 1;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.save {
  background: #ffb16a;
  color: #fff;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.save:hover,
.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.save:active {
  background: #ef6c00;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.cancel {
  background: #e5e7eb;
  color: #4b5563;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.cancel:hover,
.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.cancel:active {
  background: #6b7280;
  color: #fff;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.print,
.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.cut {
  background: #f1f5f9;
  color: #1f2937;
  border: 1px solid #d9dde3;
}

.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.print:hover,
.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.print:active,
.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.cut:hover,
.settings-modal-actions.labels-printer-actions .labels-popup-icon-btn.cut:active {
  background: #dbe7f5;
}

@media (max-width: 900px) {
  .settings-modal.labels-printer-modal .labels-popup-row.two-col .labels-popup-field,
  .settings-modal.labels-printer-modal .labels-popup-row.four-col .labels-popup-field,
  .settings-modal.labels-printer-modal .labels-popup-row-printer .labels-popup-field {
    width: min(320px, 100%);
  }

  .settings-modal.labels-printer-modal .options-row {
    gap: 14px;
  }
}

.progress-track {
  width: 100%;
  height: 14px;
  background: #ececec;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #d9d9d9;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #ef6c00, #ff9800);
  transition: width 220ms ease;
}

.import-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 10px;
}

.note {
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid #ececec;
  border-radius: 10px;
  padding: 10px;
}

.label-preview {
  border: 2px dashed #bbb;
  border-radius: 12px;
  background: #fafafa;
  padding: 14px;
  min-height: 80px;
}

.forms-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 14px;
}

.forms-search-pane,
.forms-editor-pane {
  display: grid;
  gap: 10px;
}

.forms-search-box {
  display: grid;
  gap: 10px;
  align-content: start;
}

.forms-search-input-wrap {
  position: relative;
}

.forms-search-icon {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #888;
}

.forms-search-input-wrap input {
  padding-right: 36px;
}

.forms-search-list,
.forms-type-list {
  display: grid;
  gap: 8px;
}

.forms-search-item,
.forms-type-item {
  border: 1px solid #e1e1e1;
  background: #fafafa;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.forms-search-item.selected,
.forms-type-item.selected {
  border-color: #f0a060;
  background: #fff7ef;
}

.forms-search-name,
.forms-type-name {
  width: auto;
  border: 0;
  background: transparent;
  color: #222;
  padding: 0;
  text-align: right;
  display: grid;
  gap: 2px;
}

.forms-search-name span,
.forms-type-item span {
  color: #666;
  font-size: 13px;
}

.forms-search-icons,
.forms-type-icons {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.forms-search-icons button,
.forms-type-icons button {
  width: auto;
}

.forms-type-select-row,
.forms-type-editor,
.forms-color-row,
.forms-placeholder-row {
  display: grid;
  gap: 8px;
}

.forms-type-editor-actions {
  justify-content: flex-start;
}

.forms-checkboxes {
  display: grid;
  gap: 8px;
}

.setting-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.setting-check-row input {
  width: auto;
  margin: 0;
}

.forms-action-btn {
  flex: 1 1 0;
  min-width: 140px;
}

.signature-section {
  display: grid;
  gap: 10px;
}

.signature-title {
  font-weight: 700;
}

.signature-note {
  color: var(--muted);
  font-size: 14px;
}

.signature-canvas {
  width: 100%;
  height: 180px;
  border: 1px solid #d7d7d7;
  border-radius: 12px;
  background: #fff;
  touch-action: none;
}

.signature-actions {
  flex-wrap: wrap;
}

.doc-card {
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.doc-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.doc-card h3 {
  margin: 0;
}

.doc-card-meta {
  color: var(--muted);
  margin-top: 4px;
}

.doc-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.doc-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-card-actions button {
  width: auto;
}

.doc-raw-view {
  display: grid;
  gap: 12px;
}

.doc-raw-meta {
  display: grid;
  gap: 6px;
  color: #333;
}

.doc-raw-preview {
  border: 1px solid #e1e1e1;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  min-height: 220px;
  overflow: auto;
}

.raw-send-picker-wrap {
  display: grid;
  gap: 10px;
}

.raw-send-picker-head {
  display: grid;
  gap: 2px;
}

.raw-send-picker-title {
  font-weight: 700;
}

.raw-send-picker-channel {
  color: #6b7280;
  font-size: 13px;
}

.raw-send-picker-search-row {
  direction: rtl;
  display: grid;
  grid-template-columns: 85% 10%;
  column-gap: 1.5%;
  align-items: center;
}

.raw-send-picker-search-row input {
  width: 100%;
}

.raw-send-picker-search-row button {
  width: 100%;
  min-width: 74px;
}

.raw-send-picker-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  border: 1px solid #eceff3;
  border-radius: 12px;
  padding: 8px;
  background: #fcfcfd;
}

.raw-send-picker-empty {
  text-align: center;
  color: #6b7280;
  padding: 18px;
}

.raw-send-customer-card {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(120px, 1.4fr) minmax(110px, 1fr) minmax(130px, 1.1fr) minmax(100px, 0.9fr) minmax(100px, 0.9fr) minmax(130px, 1.2fr);
  gap: 8px;
  align-items: center;
  direction: rtl;
  border: 1px solid #eceff3;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
  cursor: pointer;
}

.raw-send-customer-card.selected {
  background: #fff6ed;
  border-color: #f2b074;
}

.raw-send-customer-col {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.raw-send-customer-check-col {
  display: flex;
  justify-content: center;
}

.raw-send-customer-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.raw-send-customer-card .raw-send-customer-col:nth-child(2) {
  font-weight: 700;
}

.raw-send-picker-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-dispatch-table th,
.customer-dispatch-table td {
  white-space: nowrap;
}

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

.forms-list-item {
  border: 1px solid #e1e1e1;
  background: #fafafa;
  border-radius: 12px;
  padding: 10px;
}

.forms-list-item.selected {
  border-color: #f0a060;
  background: #fff7ef;
}

.public-forms-settings-panel {
  display: grid;
  gap: 12px;
}

.public-forms-settings-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-forms-settings-head h3 {
  margin: 0;
}

.public-forms-create-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #f2c18f;
  background: #ffecd8;
  color: #ef6c00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.public-forms-create-btn .icon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 22px;
  line-height: 1;
}

.public-forms-create-btn:hover,
.public-forms-create-btn:active {
  background: #ef6c00;
  border-color: #ef6c00;
  color: #fff;
}

.public-form-edit-overlay {
  z-index: 6200;
}

.public-form-edit-modal {
  max-width: 920px;
}

.public-form-editor-modal {
  width: 800px;
  max-width: 95vw;
  height: 1000px;
  max-height: 95vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  direction: rtl;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.public-form-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 10% 10px;
  border-bottom: 1px solid #eceff3;
}

.public-form-edit-header h2 {
  margin: 0;
}

.public-form-editor-body {
  overflow: auto;
  padding: 14px 10% 16px;
  display: grid;
  gap: 14px;
  min-height: 0;
}

.public-form-editor-section {
  display: grid;
  gap: 10px;
}

.public-form-editor-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.public-form-editor-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-form-editor-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.public-form-editor-field label {
  font-weight: 700;
  text-align: right;
}

.public-form-editor-description textarea {
  min-height: 68px;
  max-height: 120px;
  resize: vertical;
}

.public-form-editor-active-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
}

.public-form-editor-selected h3 {
  margin: 0;
  font-size: 16px;
}

.public-form-selected-box {
  border: 1px solid #eceff3;
  border-radius: 12px;
  background: #fcfcfd;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.public-form-selected-title {
  font-weight: 700;
}

.public-form-selected-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  min-height: 180px;
  overflow: auto;
}

.public-form-selected-item {
  border: 1px solid #eceff3;
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-form-selected-empty {
  color: #6b7280;
  text-align: right;
}

.public-form-editor-link {
  margin-top: 4px;
  text-align: right;
  word-break: break-word;
}

.public-form-editor-actions {
  border-top: 1px solid #eceff3;
  padding: 12px 10%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.public-form-editor-actions button {
  width: auto;
  min-width: 96px;
}

.public-form-editor-actions .primary {
  background: #ef6c00;
  border-color: #ef6c00;
  color: #fff;
}

.public-form-editor-actions .primary:hover,
.public-form-editor-actions .primary:active {
  background: #c85700;
  border-color: #c85700;
}

#publicFormsSettingsPanel .public-forms-settings-head {
  justify-content: flex-start;
}

#publicFormsSettingsPanel .public-forms-settings-head h3 {
  flex: 0 1 auto;
}

#publicFormsSettingsPanel .public-forms-create-btn {
  flex: 0 0 auto;
}

#publicFormsSettingsPanel .public-forms-list-header,
#publicFormsSettingsPanel .public-forms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 0;
}

#publicFormsSettingsPanel .public-forms-desc {
  min-width: 0;
  padding: 0 12px;
}

#publicFormsSettingsPanel .public-forms-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr) minmax(90px, 0.8fr) minmax(120px, 1fr);
  align-items: center;
  text-align: right;
  gap: 8px 12px;
}

#publicFormsSettingsPanel .public-forms-meta-grid > div,
#publicFormsSettingsPanel .public-form-name-link {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#publicFormsSettingsPanel .public-form-name-link {
  display: block;
  width: 100%;
}

#publicFormsSettingsPanel .public-forms-actions-title,
#publicFormsSettingsPanel .public-forms-actions {
  width: 180px;
  min-width: 180px;
  justify-self: center;
}

#publicFormsSettingsPanel .public-forms-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

#publicFormsSettingsPanel .actions-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#publicFormsTable .public-forms-list-header,
#publicFormsTable .public-forms-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 0;
}

#publicFormsTable .public-forms-desc {
  min-width: 0;
  padding: 0 12px;
}

#publicFormsTable .public-forms-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr) minmax(90px, 0.8fr) minmax(120px, 1fr);
  align-items: center;
  text-align: right;
  gap: 8px 12px;
}

#publicFormsTable .public-forms-meta-grid > div,
#publicFormsTable .public-form-name-link {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#publicFormsTable .public-form-name-link {
  display: block;
  width: 100%;
}

#publicFormsTable .public-forms-actions-title,
#publicFormsTable .public-forms-actions {
  width: 180px;
  min-width: 180px;
  justify-self: center;
}

#publicFormsTable .public-forms-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.public-forms-list {
  display: grid;
  gap: 8px;
}

.public-forms-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 8px;
}

.public-forms-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-forms-list-header,
.public-forms-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 2.7fr) minmax(0, 1.8fr) minmax(0, 0.9fr) minmax(0, 1.2fr) 160px;
  align-items: center;
  gap: 0;
  padding-inline: 10px;
  direction: rtl;
  border: 1px solid #eceff3;
  border-radius: 12px;
  background: #fff;
}

.public-forms-list-header {
  min-height: 46px;
  background: #fafbfd;
}

.public-forms-row {
  min-height: 62px;
  transition: background 120ms ease, border-color 120ms ease;
}

.public-forms-row:hover,
.public-forms-row:focus-visible {
  background: #fff7ef;
  border-color: #f0c79a;
  outline: none;
}

.public-forms-desc {
  min-width: 0;
  padding: 0 12px;
  text-align: right;
}

.public-forms-name-cell,
.public-forms-doc-cell,
.public-forms-status-cell,
.public-forms-updated-cell,
.public-forms-actions-title,
.public-forms-select-title {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-forms-name-cell,
.public-forms-doc-cell,
.public-forms-status-cell,
.public-forms-updated-cell,
.public-forms-actions {
  display: flex;
  align-items: center;
}

.public-forms-name-cell {
  justify-content: flex-end;
  text-align: right;
}

.public-forms-doc-cell,
.public-forms-status-cell,
.public-forms-updated-cell {
  justify-content: center;
  text-align: center;
}

.public-forms-select-title,
.public-forms-select-cell,
.public-forms-actions-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-forms-select-title,
.public-forms-actions-title {
  font-weight: 700;
  color: #374151;
}

.public-forms-select-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ef6c00;
}

.public-forms-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content max-content;
  align-items: center;
  text-align: right;
  gap: 8px 12px;
}

.public-forms-meta-grid > div,
.public-form-name-link {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.public-forms-meta-grid-header {
  font-weight: 700;
  color: #374151;
}

.public-form-name-link {
  border: none;
  background: transparent;
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: right;
  font-size: 14px;
}

.public-form-name-link:hover {
  color: #ef6c00;
}

.public-forms-actions-title {
  text-align: center;
  font-weight: 700;
  color: #374151;
  width: 160px;
}

.public-forms-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 160px;
  white-space: nowrap;
  flex-wrap: nowrap;
}

.actions-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.public-form-icon-btn.delete {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.public-form-icon-btn.edit {
  background: #ffecd8;
  border-color: #f2c18f;
  color: #ef6c00;
}

.public-form-icon-btn.edit:hover {
  background: #ef6c00;
  border-color: #ef6c00;
  color: #fff;
}

.public-form-icon-btn.delete:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #374151;
}

.public-forms-bulk-delete-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.public-forms-bulk-delete-btn svg {
  width: 18px;
  height: 18px;
}

.public-forms-bulk-delete-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #374151;
}

.public-forms-bulk-delete-spacer {
  width: 36px;
  height: 36px;
  display: inline-block;
}

.public-forms-delete-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 6100;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  place-items: center;
  padding: 16px;
}

.public-forms-delete-confirm-modal {
  width: min(520px, 92vw);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  padding: 20px;
  display: grid;
  gap: 14px;
  direction: rtl;
  text-align: right;
}

.public-forms-delete-confirm-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
}

.public-forms-delete-confirm-text {
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
}

.public-forms-delete-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.public-forms-delete-confirm-btn {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.public-forms-delete-confirm-btn.approve {
  background: #ffb16a;
  color: #fff;
}

.public-forms-delete-confirm-btn.approve:hover {
  background: #ef6c00;
}

.public-forms-delete-confirm-btn.cancel {
  background: #eceff3;
  color: #6b7280;
}

.public-forms-delete-confirm-btn.cancel:hover {
  background: #6b7280;
  color: #fff;
}

.public-form-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.public-form-icon-btn .icon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.public-form-icon-btn .icon-mark svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.public-form-icon-btn.whatsapp {
  background: #e8f7ee;
  border-color: #9fd5b4;
  color: #1f8f4f;
}

.public-form-icon-btn.whatsapp:hover {
  background: #d8f1e3;
  border-color: #84c79f;
}

.public-form-icon-btn.preview {
  background: #eef4ff;
  border-color: #b8c9eb;
  color: #1f3b75;
}

.public-form-icon-btn.preview:hover {
  background: #e3edff;
  border-color: #9fb8e6;
}

.public-form-icon-btn.email {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}

.public-form-icon-btn.email:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.public-form-icon-btn:hover {
  border-color: #ef6c00;
  background: #fff3e6;
}

.public-form-icon-btn:focus-visible {
  outline: 2px solid #ef6c00;
  outline-offset: 1px;
}

.global-delete-warning-overlay {
  position: fixed;
  inset: 0;
  z-index: 6300;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 12px;
}

.global-delete-warning-modal {
  width: 500px;
  max-width: 92vw;
  min-height: 150px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.25);
  padding: 14px 16px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  direction: rtl;
  text-align: center;
}

.global-delete-warning-text {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f2937;
  line-height: 1.5;
  font-size: 16px;
}

.global-delete-warning-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.global-delete-warning-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 999px;
  border: 0;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.global-delete-warning-btn.approve {
  background: #ffb16a;
  color: #fff;
}

.global-delete-warning-btn.approve:hover {
  background: #ef6c00;
}

.global-delete-warning-btn.cancel {
  background: #eceff3;
  color: #6b7280;
}

.global-delete-warning-btn.cancel:hover {
  background: #6b7280;
  color: #fff;
}

.pf-fields-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
  min-height: 0;
}

.pf-fields-block {
  border: 1px solid #eceff3;
  border-radius: 12px;
  background: #fcfcfd;
  padding: 10px;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
}

.pf-fields-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.pf-fields-list {
  display: grid;
  gap: 8px;
  max-height: 300px;
  overflow: auto;
}

.pf-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px dashed #e6ebf1;
  padding: 6px 0;
  min-height: 38px;
}

.pf-field-main-label,
.pf-field-required-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pf-field-main-label {
  flex-direction: row;
}

.pf-field-main-text {
  text-align: right;
}

.pf-field-main-label .pf-field-check,
.pf-field-required-label .pf-field-required {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
}

.pf-field-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

@media (max-width: 880px) {
  .public-form-editor-modal {
    width: 95vw;
    max-height: 95vh;
    height: auto;
  }

  .public-form-editor-body,
  .public-form-edit-header,
  .public-form-editor-actions {
    padding-inline: 6%;
  }

  .public-form-editor-row-2 {
    grid-template-columns: 1fr;
  }

  .pf-fields-wrap {
    grid-template-columns: 1fr;
  }

  .public-forms-list-header,
  .public-forms-row {
    grid-template-columns: 42px minmax(0, 2.7fr) minmax(0, 1.8fr) minmax(0, 0.9fr) minmax(0, 1.2fr) 140px;
    padding-inline: 8px;
  }

  .public-forms-name-cell,
  .public-forms-doc-cell,
  .public-forms-status-cell,
  .public-forms-updated-cell {
    font-size: 13px;
  }

  .public-forms-actions-title,
  .public-forms-actions {
    width: 140px;
  }

  .public-forms-actions {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .public-form-icon-btn {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .public-forms-bulk-delete-btn,
  .public-forms-bulk-delete-spacer {
    width: 34px;
    height: 34px;
  }
}

/* Orders page */
.orders-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.orders-filters input,
.orders-filters select {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
}

.orders-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.order-stat-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.order-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.order-status-badge-warning {
  background: #f59e0b;
  color: #111827;
}
button.small {
  padding: 4px 10px;
  font-size: 12px;
}
button.danger {
  background: #fff0f0;
  color: #c62828;
  border-color: #f5c6c6;
}
button.danger:hover {
  background: #c62828;
  color: #fff;
}
.empty-state {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 15px;
}

.customer-name-link {
  width: auto;
  border: 0;
  background: transparent;
  color: #1f2937;
  padding: 0;
  border-radius: 0;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-color: #f2b074;
  text-underline-offset: 3px;
}

.customer-name-link:hover {
  color: #ef6c00;
  background: transparent;
}

.customer-card-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5200;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  place-items: center;
  padding: 16px;
}

.customer-card-modal {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 16px;
  direction: rtl;
}

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

.customer-card-header h2 {
  margin: 0;
  font-size: 24px;
}

.customer-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.customer-card-meta span {
  background: #f6f7f9;
  border: 1px solid #eceff3;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #374151;
}

.customer-card-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.customer-card-tab {
  width: auto;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
}

.customer-card-tab.active {
  background: #ef6c00;
  border-color: #ef6c00;
  color: #fff;
}

.customer-card-content {
  background: #fcfcfd;
  border: 1px solid #eceff3;
  border-radius: 14px;
  padding: 14px;
}

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

.customer-card-field {
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 12px;
  padding: 10px;
}

.customer-card-field-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.customer-card-field-value {
  min-height: 20px;
  font-size: 14px;
  color: #111827;
}

.customer-card-notes-block {
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.customer-card-notes-value {
  white-space: pre-wrap;
  min-height: 28px;
  color: #111827;
}

.customer-work-orders-header {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.customer-open-work-order-btn {
  width: auto;
  border-radius: 999px;
  padding: 10px 16px;
  background: #ef6c00;
  color: #fff;
}

.customer-work-orders-table-wrap {
  overflow: auto;
}

.customer-work-orders-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #eceff3;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.customer-work-orders-table th,
.customer-work-orders-table td {
  border-bottom: 1px solid #f2f4f7;
  text-align: right;
  padding: 8px;
  font-size: 13px;
}

.customer-work-orders-empty {
  background: #fff;
  border: 1px dashed #d7dbe2;
  border-radius: 12px;
  text-align: center;
  padding: 24px 10px;
  color: #4b5563;
  margin-bottom: 10px;
}

.customer-work-order-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5300;
  background: rgba(17, 24, 39, 0.42);
  display: grid;
  place-items: center;
  padding: 14px;
}

.customer-work-order-modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
}

.customer-work-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.customer-work-order-header h3 {
  margin: 0;
  text-align: center;
  font-size: 22px;
}

.customer-work-order-header-spacer {
  width: 36px;
  min-width: 36px;
}

.customer-work-order-close-x {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 999px;
  padding: 0;
  background: #d32f2f;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.customer-work-order-close-x:hover {
  background: #b71c1c;
}

.customer-work-order-number-banner {
  margin: 6px 0 12px;
  text-align: center;
  background: #fff7ef;
  border: 1px solid #f6c99b;
  border-radius: 12px;
  padding: 10px;
  font-size: 20px;
  font-weight: 800;
  color: #b45309;
}

.customer-work-order-sections {
  display: grid;
  gap: 12px;
}

.customer-work-order-section {
  background: #fcfcfd;
  border: 1px solid #eceff3;
  border-radius: 12px;
  padding: 10px;
}

.customer-work-order-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
}

.customer-work-order-serial-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.customer-work-order-scan-btn {
  width: auto;
}

.customer-work-order-images-block {
  margin-bottom: 12px;
}

.customer-work-order-images-title {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
}

.customer-work-order-images-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.customer-work-order-image-item {
  border: 1px solid #eceff3;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.customer-work-order-image-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.customer-work-order-image-name {
  margin-top: 6px;
  font-size: 12px;
  color: #374151;
  word-break: break-all;
}

.customer-work-order-image-delete {
  margin-top: 6px;
  width: 100%;
  background: #fff1f2;
  color: #b91c1c;
  border: 1px solid #fecdd3;
}

.customer-work-order-image-delete:hover {
  background: #b91c1c;
  color: #fff;
}

.customer-work-order-images-empty {
  margin-top: 8px;
  border: 1px dashed #dbe2ea;
  border-radius: 10px;
  padding: 14px;
  color: #6b7280;
  text-align: center;
}

.customer-work-order-scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 5400;
  background: rgba(15, 23, 42, 0.56);
  display: grid;
  place-items: center;
  padding: 14px;
}

.customer-work-order-scanner-modal {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px;
}

.customer-work-order-scanner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.customer-work-order-scanner-modal video {
  width: 100%;
  min-height: 220px;
  border-radius: 10px;
  background: #111827;
}

.customer-work-order-scanner-help {
  margin-top: 8px;
  color: #4b5563;
  font-size: 13px;
}

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

.customer-work-order-form textarea {
  grid-column: 1 / -1;
}

.customer-work-order-label-form {
  grid-template-columns: 1fr;
}

.customer-work-order-label-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.customer-work-order-label-preview {
  border: 1px dashed #d7dbe2;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.customer-work-order-label-preview-title {
  font-size: 13px;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 8px;
}

.customer-work-order-label-preview-list {
  display: grid;
  gap: 6px;
}

.customer-work-order-label-preview-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.customer-work-order-label-preview-key {
  color: #6b7280;
  font-size: 12px;
}

.customer-work-order-label-preview-value {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

.customer-work-order-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.work-orders-page {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 12px;
}

.work-orders-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

.work-orders-filters input,
.work-orders-filters select {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 9px 11px;
  background: #fff;
}

.work-orders-loading {
  background: #fff6ed;
  border: 1px solid #f4d2b4;
  color: #9a4500;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.work-orders-table-wrap {
  overflow: auto;
}

.work-orders-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ebedf0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.work-orders-table th,
.work-orders-table td {
  text-align: right;
  padding: 8px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 13px;
  white-space: nowrap;
}

.work-orders-link-btn {
  width: auto;
  border: 0;
  background: transparent;
  color: #1f2937;
  padding: 0;
  border-radius: 0;
  text-decoration: underline;
  text-decoration-color: #f2b074;
  text-underline-offset: 3px;
}

.work-orders-link-btn:hover {
  background: transparent;
  color: #ef6c00;
}

.work-order-status-badge,
.work-order-payment-badge {
  display: inline-block;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #374151;
}

.work-orders-empty {
  text-align: center;
  padding: 20px 8px;
  color: #6b7280;
}

.work-orders-pagination {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-editor-host {
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.jodit-container {
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}

.jodit-workplace {
  background: #fff;
}

.doc-editor-host .ck-editor__editable,
.ck-editor__editable_inline {
  min-height: 280px;
  direction: rtl;
  text-align: right;
  line-height: 1.5;
}

.doc-editor-host [dir="ltr"],
.ck-editor__editable_inline [dir="ltr"] {
  direction: ltr;
  text-align: left;
}

.doc-editor-host [dir="rtl"],
.ck-editor__editable_inline [dir="rtl"] {
  direction: rtl;
  text-align: right;
}

hr {
  border: 0;
  border-top: 1px solid #ececec;
  margin: 12px 0;
}

@media (max-width: 980px) {
  .forms-grid { grid-template-columns: 1fr; }
  .settings-modal-actions button { width: 100%; }
  .forms-action-btn { min-width: 0; width: 100%; }
  .doc-card-head { flex-direction: column; }
  .settings-modal-actions.raw-send-actions button {
    width: 100%;
    min-width: 0;
  }
  .raw-send-picker-search-row {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 8px;
  }
}

@media (max-width: 900px) {
  .raw-send-customer-card {
    grid-template-columns: 32px 1fr 1fr;
    row-gap: 6px;
  }
}

@media (max-width: 560px) {
  .raw-send-picker-search-row {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .raw-send-customer-card {
    grid-template-columns: 32px 1fr;
  }

  .form-submission-view-modal {
    width: min(100%, 100vw);
    max-height: calc(100vh - 18px);
    padding: 14px;
    border-radius: 14px;
  }

  .form-submission-modal-header {
    margin-inline: 36px;
  }

  .form-submission-view-title {
    font-size: 30px;
  }

  .form-submission-main-title {
    font-size: 22px;
  }

  .form-submission-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-submission-details {
    grid-template-columns: 1fr;
  }

  .form-submission-field-value {
    font-size: 16px;
  }
}

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; order: -1; }
  .cards { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .settings-cards-grid { grid-template-columns: 1fr; }
  .forms-grid { grid-template-columns: 1fr; }
  .settings-modal-actions button { width: 100%; }
  .work-orders-filters { grid-template-columns: 1fr; }
  .work-orders-table th,
  .work-orders-table td { font-size: 12px; }
  .customer-card-grid { grid-template-columns: 1fr; }
  .customer-work-order-form { grid-template-columns: 1fr; }
  .customer-card-modal { padding: 12px; }
  .customer-work-order-images-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-work-order-serial-row { grid-template-columns: 1fr; }
  .customer-work-order-label-row { grid-template-columns: 1fr; }
  #products .products-toolbar {
    flex-wrap: wrap;
    align-items: stretch;
  }
  #products .products-toolbar h1 {
    width: 100%;
  }
  #products .products-search-wrap {
    order: 2;
    flex: 1 1 100%;
    max-width: none;
    margin-inline: 0;
  }
  #products .products-add-btn {
    order: 3;
  }
  #products #productsTable { min-width: 1080px; }
  #products .products-action-icon { width: 40px; min-width: 40px; height: 40px; }
}