.proc-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  flex-wrap: wrap;
}
.proc-panel {
  padding: 26px;
  margin: 0 0 22px;
  min-width: 0;
}
.proc-panel h2 {
  margin-top: 0;
}
.proc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.proc-panel textarea,
.proc-panel input,
.proc-panel select,
.proc-letter textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  padding: 12px;
  border-radius: 9px;
}
.proc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  line-height: 1.5;
}
.proc-check input {
  width: 18px;
  flex: 0 0 18px;
  margin-top: 4px;
}
.proc-list-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  width: 100%;
  padding: 17px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
}
.proc-list-row small {
  color: var(--muted);
}
button.proc-list-row {
  cursor: pointer;
}
.proc-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 14px 0;
}
.proc-quote.recommended {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.proc-quote h3 {
  margin: 0 0 12px;
}
.proc-warning {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}
.proc-letter {
  background: var(--surface, #17202a);
  color: var(--ink, #eee);
  border: 1px solid var(--line, #4b5362);
  border-radius: 18px;
  width: min(760px, 90vw);
  max-height: 90vh;
  padding: 28px;
}
.proc-letter::backdrop {
  background: #0009;
}
.proc-letter textarea {
  resize: vertical;
  line-height: 1.7;
}
.assistant-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
}
.assistant-history,
.assistant-chat {
  padding: 24px;
  min-width: 0;
}
.assistant-messages {
  max-height: 60vh;
  overflow: auto;
  scrollbar-gutter: stable;
}
.assistant-turn {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.assistant-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assistant-chat textarea {
  width: 100%;
  min-height: 110px;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font: inherit;
}
@media (max-width: 760px) {
  .proc-grid,
  .assistant-layout {
    grid-template-columns: 1fr;
  }
  .proc-panel {
    padding: 18px;
  }
  .proc-quote {
    align-items: flex-start;
    flex-direction: column;
  }
  .proc-panel table {
    min-width: 600px;
  }
  .assistant-history {
    max-height: 230px;
    overflow: auto;
  }
}
.proc-panel fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.proc-item-table {
  width: 100%;
  margin: 12px 0;
}
.proc-item-table caption {
  text-align: left;
  font-weight: 600;
  padding: 12px 0;
}
.proc-item-table th:first-child {
  width: 50%;
}
.proc-item-table td {
  vertical-align: top;
}
.proc-item-table input {
  width: 100%;
}
.proc-item-table th:nth-child(2),
.proc-item-table th:nth-child(3) {
  width: 16%;
}
.proc-item-table .btn {
  white-space: nowrap;
}
.proc-panel .proc-grid + div.table-wrap {
  margin: 10px 0;
}
.proc-panel .proc-check {
  font-weight: 400;
}
.assistant-history .btn {
  display: block;
  text-align: left;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .proc-panel .proc-item-table {
    min-width: 0;
    display: block;
  }
  .proc-item-table thead {
    display: none;
  }
  .proc-item-table caption,
  .proc-item-table tbody {
    display: block;
  }
  .proc-item-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 12px;
  }
  .proc-item-table tbody td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
  }
  .proc-item-table td:first-child,
  .proc-item-table td:last-child {
    grid-column: 1/-1;
  }
  .proc-item-table td:first-child::before {
    content: 'Megnevezés';
  }
  .proc-item-table td:nth-child(2)::before {
    content: 'Mennyiség';
  }
  .proc-item-table td:nth-child(3)::before {
    content: 'Egység';
  }
  .proc-item-table td::before {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 5px;
  }
  .proc-quote .btn {
    width: 100%;
    white-space: normal;
  }
  .proc-quote p {
    overflow-wrap: anywhere;
  }
}
/* Procurement flow and delivery tracking */
.proc-workflow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.proc-workflow li {
  padding: 18px 16px;
  font-weight: 600;
  font-size: 13px;
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.proc-workflow li:last-child {
  border: 0;
}
.proc-workflow li span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 11px;
}
.proc-demo-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.proc-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}
.proc-kpis article {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.proc-kpis span,
.proc-kpis small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.proc-kpis strong {
  font-size: clamp(19px, 2vw, 26px);
  letter-spacing: -0.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.proc-kpis .proc-kpi-warning {
  border-color: #c46b2d;
}
.proc-kpi-warning strong {
  color: #b75818;
}
.proc-kpis progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}
.proc-section-heading,
.proc-order-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.proc-order-title {
  align-items: center;
  width: 100%;
}
.proc-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 11px;
  line-height: 1.4;
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  white-space: nowrap;
}
.proc-status-partial {
  color: #975310;
  background: #fbecd4;
  border-color: #ecd5ac;
}
.proc-status-received {
  color: #126449;
  background: #e1f2e9;
  border-color: #c1e2d1;
}
.proc-status-cancelled {
  color: var(--muted);
}
.proc-empty {
  text-align: center;
  padding: 32px 18px;
}
.proc-empty p {
  max-width: 520px;
  margin: 12px auto 24px;
  color: var(--muted);
  line-height: 1.7;
}
.proc-receipt {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.proc-panel details {
  margin: 18px 0;
}
.proc-panel details summary {
  cursor: pointer;
  font-weight: 600;
  line-height: 1.5;
}
.proc-panel details[open] summary {
  margin-bottom: 16px;
}
.proc-preserve-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.proc-panel .form-field {
  margin-bottom: 12px;
}
.proc-quote {
  flex-wrap: wrap;
}
.proc-quote > div {
  flex: 1 1 100%;
  min-width: 0;
}
.proc-quote .btn {
  flex: 0 1 auto;
}
.proc-order-list {
  margin-top: 18px;
}
.proc-order-list .proc-list-row {
  padding: 22px 8px;
}
.proc-order-list .proc-list-row:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.proc-delivery-table {
  width: 100%;
  border-collapse: collapse;
}
.proc-delivery-table td,
.proc-delivery-table th {
  padding: 14px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.proc-delivery-table td:first-child,
.proc-delivery-table th:first-child {
  text-align: left;
  white-space: normal;
  min-width: 160px;
}
.proc-tabs .btn[disabled] {
  opacity: 0.5;
  cursor: wait;
}
.proc-panel button:focus-visible,
.proc-tabs button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (max-width: 1000px) {
  .proc-workflow li {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 10px;
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  .proc-workflow {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-radius: 12px;
  }
  .proc-workflow li {
    font-size: 10px;
    padding: 10px 5px;
    overflow-wrap: anywhere;
    gap: 8px;
  }
  .proc-workflow li span {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
    font-size: 10px;
  }
  .proc-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .proc-kpis article {
    padding: 14px;
  }
  .proc-kpis strong {
    font-size: 18px;
  }
  .proc-section-heading,
  .proc-order-title {
    flex-direction: column;
    gap: 8px;
  }
  .proc-quote .btn {
    width: 100%;
  }
  .proc-panel .table-wrap {
    overflow-x: auto;
  }
  .proc-tabs {
    gap: 6px;
  }
  .proc-tabs .btn {
    font-size: 12px;
    padding: 9px 12px;
  }
}
/* Explicit invoice matching and separate order forecast. */
.proc-reconciliation fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.proc-reconciliation-line {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.proc-reconciliation-line > strong,
.proc-reconciliation-line > small {
  display: block;
  margin-bottom: 8px;
}
.proc-reconciliation-review {
  padding: 18px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.proc-reconciliation .proc-list-row small {
  display: block;
  overflow-wrap: anywhere;
}
.proc-reconciliation .btn {
  white-space: normal;
}
.proc-reconciliation .form-field {
  overflow-wrap: anywhere;
}
