.record-edit-card {
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line, #dce4ee);
  border-radius: 16px;
  background: var(--surface, #fff);
  box-shadow: none;
}

.record-edit-access {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line, #dce4ee);
  color: var(--ink, #172033);
  background: color-mix(in srgb, var(--surface, #fff) 92%, #64748b);
}

.record-edit-access > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--muted, #64748b);
}

.record-edit-access span,
.record-edit-access strong,
.record-edit-access small {
  display: block;
}

.record-edit-access strong {
  font-size: 13px;
  line-height: 1.25;
}

.record-edit-access small {
  margin-top: 2px;
  color: var(--muted, #637086);
  font-size: 11px;
  line-height: 1.4;
}

.record-edit-fieldset {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 0;
}

.record-edit-fieldset:disabled {
  opacity: 0.68;
}

.record-primary-field textarea {
  min-height: 92px;
  resize: vertical;
}

.record-edit-card.is-readonly {
  border-color: color-mix(in srgb, var(--line, #dce4ee) 88%, #64748b);
  background: color-mix(in srgb, var(--surface, #fff) 97%, #64748b);
}

html[data-theme="black"] .record-edit-card,
html[data-theme="black"] .record-edit-access,
body.theme-black .record-edit-card,
body.theme-black .record-edit-access {
  border-color: rgba(255, 255, 255, 0.13);
}

@media (max-width: 760px) {
  .record-edit-fieldset {
    padding: 12px;
  }

  .record-primary-field,
  .record-primary-field.span-2 {
    grid-column: 1 / -1;
  }
}

/* Record fields, catalogue context and invoice totals share one component layer. */
.layout.os-layout-v10 .record-edit-card .field > span {
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
}

.layout.os-layout-v10 .record-edit-card .field :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select) {
  min-height: 42px;
  height: 42px;
  font-size: 13px;
}

.layout.os-layout-v10 .record-edit-card .field textarea {
  font-size: 13px;
  line-height: 1.6;
}

.layout.os-layout-v10 .lookup-field .record-lookup-search {
  min-width: 0;
  min-height: 40px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2, var(--surface));
}

.layout.os-layout-v10 .lookup-field .record-lookup-search:focus-within {
  border-color: var(--primary, var(--brand));
  outline: 2px solid color-mix(in srgb, var(--primary, var(--brand)) 20%, transparent);
  outline-offset: 1px;
}

.layout.os-layout-v10 .lookup-field .record-lookup-search input {
  min-width: 0;
  min-height: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 12px;
}

.record-lookup-search > .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.record-lookup-search small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.layout.os-layout-v10 .lookup-field .lookup-pagination {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 7px;
}

.lookup-pagination :is(small, span) {
  margin-right: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.layout.os-layout-v10 .lookup-field .lookup-pagination .btn {
  min-height: 36px;
  height: auto;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 11px;
}

.layout.os-layout-v10 .lookup-field .lookup-pagination .btn:focus-visible {
  outline: 2px solid var(--primary, var(--brand));
  outline-offset: 2px;
}

.catalog-price-context {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--primary, var(--brand)) 22%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary, var(--brand)) 4%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.catalog-price-context[hidden] {
  display: none;
}

.catalog-price-context strong {
  font-size: 13px;
  font-weight: 650;
}

.catalog-price-context :is(small, p) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.document-total-preview {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2, var(--surface));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.document-total-preview > span {
  display: grid;
  gap: 4px;
}

.document-total-preview :is(b, strong) {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
}

.document-total-preview > :last-child :is(b, strong) {
  font-size: 20px;
}

@media (max-width: 640px), (pointer: coarse) {
  .layout.os-layout-v10 .record-edit-card .field :is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"]), select),
  .layout.os-layout-v10 .lookup-field .record-lookup-search,
  .layout.os-layout-v10 .lookup-field .lookup-pagination .btn {
    min-height: 44px;
    height: auto;
  }

  .layout.os-layout-v10 .record-edit-card .field :is(input, select, textarea),
  .layout.os-layout-v10 .lookup-field .record-lookup-search input {
    font-size: 16px;
  }
}

/* Duplicate previews and stale-edit comparisons preserve the operator's draft. */
.record-conflict,
.identity-preview {
  min-width: 0;
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--amber, #b45309) 30%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--amber, #b45309) 5%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.identity-preview[hidden],
.identity-preview:empty {
  display: none;
}

.record-conflict > strong,
.identity-preview > strong {
  font-size: 14px;
  font-weight: 650;
}

.record-conflict > :is(p, small),
.identity-preview > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.record-conflict-table {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.record-conflict-table:focus-visible {
  outline: 2px solid var(--primary, var(--brand));
  outline-offset: 2px;
}

.layout.os-layout-v10 .record-conflict-table table {
  width: 100%;
  min-width: 480px;
  table-layout: fixed;
  border-collapse: collapse;
}

.layout.os-layout-v10 .record-conflict-table :is(th, td) {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  vertical-align: top;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.layout.os-layout-v10 .record-conflict-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2, var(--surface));
  font-weight: 650;
}

.layout.os-layout-v10 .record-conflict-table th:first-child {
  width: 24%;
}

.layout.os-layout-v10 .record-conflict-table tbody th {
  color: var(--muted);
  font-weight: 500;
}

.record-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.layout.os-layout-v10 :is(.record-conflict-actions, .identity-preview) .btn {
  min-width: 0;
  min-height: 40px;
  height: auto;
  justify-content: flex-start;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}

.layout.os-layout-v10 :is(.record-conflict-actions, .identity-preview) .btn:focus-visible {
  outline: 2px solid var(--primary, var(--brand));
  outline-offset: 2px;
}

@media (max-width: 640px), (pointer: coarse) {
  .layout.os-layout-v10 :is(.record-conflict-actions, .identity-preview) .btn {
    min-height: 44px;
  }
}

.hr-organization {display:grid;gap:20px;min-width:0}
.hr-org-guide,.hr-org-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:16px}
.hr-org-guide {padding:20px}
.hr-org-card {padding:20px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;min-width:0}
.hr-org-card h3,.hr-org-card p {margin:0;overflow-wrap:anywhere}
.hr-org-card dl {display:grid;grid-template-columns:auto 1fr;gap:8px 12px;width:100%;font-size:13px}
.hr-org-card dt {color:var(--muted,#536580)}
.hr-org-card dd {margin:0;overflow-wrap:anywhere}
.hr-org-card .btn {margin-top:auto}
.hr-org-card .preserve-lines {white-space:pre-wrap}
.hr-org-search {padding:16px;display:flex;align-items:flex-end;gap:12px}
.hr-org-search .field {flex:1}
@media(max-width:600px){.hr-organization .page-header,.hr-organization .panel-header {flex-wrap:wrap;gap:12px}.record-window-save-actions {flex-wrap:wrap}}
