/* Общие стили экранов 1С (vanilla) */
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111827;
}
.onec-page {
  padding: 18px;
  background: #f3f4f6;
  min-height: 100vh;
}
.onec-shell {
  max-width: 1180px;
  margin: 0 auto;
}
.onec-shell > * + * {
  margin-top: 14px;
}
.onec-header h1 {
  margin: 0;
  font-size: 30px;
}
.onec-toolbar .onec-btn {
  margin-right: 8px;
  margin-bottom: 8px;
}
.onec-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px;
}
.onec-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.onec-card-header h2 {
  margin: 0;
  font-size: 22px;
}
.onec-alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.onec-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}
.onec-table-wrap {
  overflow: auto;
}
.onec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.onec-table th,
.onec-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
.onec-table th {
  font-weight: 600;
  color: #374151;
}
.onec-empty {
  color: #6b7280;
}
.onec-org-cell .onec-org-sub {
  color: #6b7280;
  font-size: 12px;
  margin-top: 2px;
}
.onec-pagination {
  margin-top: 10px;
}
.onec-pagination .onec-btn {
  margin: 0 8px;
}
.onec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border: 1px solid #c7ccd5;
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  cursor: pointer;
  text-decoration: none;
  color: #111827;
}
.onec-btn-disabled {
  opacity: 0.6;
  pointer-events: none;
}
.onec-btn-nav {
  background: #111827;
  border-color: #111827;
  color: #fff;
}
.onec-inline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid #c7ccd5;
  border-radius: 8px;
  background: #f9fafb;
  font-size: 13px;
  cursor: pointer;
  color: #111827;
}
.onec-inline-btn-wait {
  opacity: 0.55;
  pointer-events: none;
}
a.doki-link {
  color: #2563eb;
  text-decoration: none;
}
a.doki-link:hover {
  text-decoration: underline;
}

/* register / draft */
.doki-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px;
}
.doki-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.doki-input,
.doki-textarea,
.doki-select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  /* WebKit 1С: user-select:none с родителей блокирует ввод */
  -webkit-user-select: text !important;
  user-select: text !important;
  pointer-events: auto !important;
}
input:not([readonly]):not([disabled]),
textarea:not([readonly]):not([disabled]),
select:not([disabled]) {
  -webkit-user-select: text !important;
  user-select: text !important;
  pointer-events: auto !important;
}
.doki-textarea {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.doki-btn-primary {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.doki-btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}
.doki-btn-save {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  background: #059669;
  color: #fff;
  border: 1px solid #047857;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.doki-btn-save:disabled {
  opacity: 0.55;
}
.doki-error {
  padding: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 6px;
  margin-top:8px;
}
.doki-warn {
  font-size: 14px;
  color: #b45309;
  margin-top:8px;
}
.doki-ok {
  font-size: 14px;
  color: #047857;
}
.doki-pre {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 12px;
  border-radius: 6px;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-word;
}
.doki-sign-link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  background: #059669;
  color: #fff !important;
  font-weight: 600;
  text-decoration: none !important;
  margin-top: 12px;
}

/* etrn form */
.etrn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.etrn-span-2 {
  grid-column: span 2;
}
.etrn-label {
  display: block;
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 4px;
}
.etrn-cargo-box {
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 13px;
}
.etrn-cargo-line + .etrn-cargo-line {
  margin-top: 4px;
}
