/* =========================================================
   ORDER VIEW (ov- prefix)
   ========================================================= */
/* ========================================
   Order view – herstel layout-betrouwbaarheid
   ======================================== */

.ov-page input,
.ov-page textarea {
  transform: none;
}

.ov-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #222;
}

.ov-title {
  margin-bottom: 16px;
}

/* ---------- Grid ---------- */
.ov-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;

}

.ov-grid-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .ov-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Cards ---------- */
.ov-card {
  background: #f6f7f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
}

.ov-card-title {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
}

/* ---------- Status badge ---------- */
.ov-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.85em;
}

.ov-status-open {
  background: #d1e7dd;
  color: #0f5132;
}

.ov-status-processed {
  background: #fff3cd;
  color: #664d03;
}

.ov-status-ready {
  background: #e0cffc;
  color: #432874;
}

.ov-status-cancelled {
  background: #f8d7da;
  color: #842029;
}

.ov-status-completed {
  background: #cff4fc;
  color: #055160;
}

/* ---------- Buttons ---------- */
.ov-btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
}

.ov-btn-primary {
  background: #0d6efd;
  color: #fff;
}

.ov-btn-secondary {
  background: #f1f3f5;
  color: #333;
}

.ov-btn-danger {
  background: #dc3545;
  color: #fff;
}

/* ---------- Button groups ---------- */
.ov-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Tables ---------- */
.ov-table-wrapper {
  overflow-x: auto;
}

.ov-table {
  width: 100%;
  border-collapse: collapse;
}

.ov-table th,
.ov-table td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

/* ---------- Memo's ---------- */
.ov-memo {
  border-left: 4px solid #ddd;
  padding-left: 12px;
  margin-bottom: 12px;
}

.ov-memo-meta {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 4px;
}

.ov-memo-add {
  margin-top: 12px;
}
/* =======================
   Memo’s
   ======================= */

.ov-memo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ov-memo-item {
  background: #f9fafb;
  border: 1px solid #e3e6ea;
  border-radius: 6px;
  padding: 12px;
}

.ov-memo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 6px;
}

.ov-memo-user {
  font-weight: 600;
  color: #222;
}

.ov-memo-date {
  color: #777;
}

.ov-memo-delete {
  margin-left: auto;
}

.ov-memo-body {

  line-height: 1.4;
  color: #222;
}

/* ----- memo toevoegen ----- */

.ov-memo-add {
  margin-top: 16px;
}

.ov-memo-add-summary {
  cursor: pointer;
  color: #0d6efd;
  font-weight: 500;
}

.ov-memo-form {
  margin-top: 8px;
}

.ov-memo-textarea {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

/* Kleine knop variant */
.ov-btn-small {
  padding: 4px 8px;
  font-size: 0.75rem;
}
.ov-memo-deleted {
  background: #f1f3f5;
  border: 1px dashed #ccc;
  color: #666;
  font-style: italic;
}

.ov-memo-deleted-text {
  font-size: 0.6rem;
    opacity: 0.6;
    font-style: italic;
}
.ov-memo-empty {
  color: #777;
  font-style: italic;
  padding: 0px 0;
}
/* Klant visitekaart */
.ov-client-card-body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ov-client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2563eb; /* blauw accent */
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ov-client-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ov-client-name {
  font-weight: 600;
  font-size: 15px;
}

.ov-client-email {
  font-size: 13px;
  color: #2563eb;
  word-break: break-all;
}

.ov-client-address {
  font-size: 13px;
  color: #555;
  line-height: 1.4;
}
.ov-client-phones {
  font-size: 13px;
  color: #444;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ov-client-phones a {
  color: inherit;
  text-decoration: none;
}

.ov-client-phones a:hover {
  text-decoration: underline;
}
.ov-client-phones:empty {
  display: none;
}
.ov-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ov-table th.num,
.ov-table td.num {
  text-align: right;
  white-space: nowrap;
}

.ov-table td.actions {
  white-space: nowrap;
}
.ov-add-line {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #ccc;
}

.ov-form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.ov-form-actions {
  grid-column: span 6;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ov-line-edit td {
  background: #f9fafb;
}

.ov-line-form {
  padding: 12px;
}

.ov-table td.actions {
  white-space: nowrap;
}

.ov-form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.ov-form-actions {
  grid-column: span 6;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .ov-form-grid {
    grid-template-columns: 1fr;
  }
}


@media (max-width: 768px) {
  .ov-form-grid {
    grid-template-columns: 1fr;
  }

  .ov-form-actions {
    justify-content: stretch;
  }
}

/* Mobiel */
@media (max-width: 640px) {
  .ov-client-card-body {
    align-items: flex-start;
  }
}
.ov-add-line-card {
  margin: 8px 0 12px;
  padding: 8px;
  background: #f9fafb;
  border: 1px dashed #d0d7de;
  border-radius: 6px;
}

.ov-add-line-card input,
.ov-add-line-card select {
  width: 100%;
  box-sizing: border-box;
}

.ov-table-compact td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.ov-product-search {
  margin: 8px 0 12px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #d0d7de;
  border-radius: 6px;
}

.ov-tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ov-tool-head h4,
.ov-add-line-card h4 {
  margin: 0;
  font-size: 0.95rem;
}

.ov-product-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ov-product-search-form input[name="product_q"] {
  flex: 1;
  min-width: 220px;
}

.ov-product-search-form select {
  min-width: 180px;
}

.ov-product-results {
  margin-top: 10px;
}

.ov-result-meta {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #555;
}

.ov-pagination {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}

.ov-product-results select,
.ov-product-results input {
  width: 100%;
  box-sizing: border-box;
}

.ov-discount-grid {
  display: grid;
  grid-template-columns: minmax(76px, 0.8fr) minmax(60px, 0.6fr) minmax(70px, 0.8fr);
  gap: 4px;
  min-width: 210px;
}
#orderregels .ov-card-header {
  margin-bottom: 16px;
}

.ov-table thead th {
  background: #e5e7eb;
  color: #111827;
  font-weight: 600;
  border-bottom: 1px solid #d1d5db;
}

.ov-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.ov-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.ov-table tbody tr:hover {
  background: #eef2f7;
}

.ov-table tbody tr:has(.ov-edit:not([hidden])) {
  background: #eef6ff;
}

.ov-table td.num,
.ov-table th.num {
  text-align: right;
  white-space: nowrap;
}

.ov-table td.actions {
  text-align: right;
  white-space: nowrap;
}

.ov-table input,
.ov-table select {
  padding: 4px 6px;
  font-size: 0.9rem;
}
/* Concept-acties naast elkaar */
.ov-concept-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.ov-concept-actions--order {
  display: grid;
  gap: 10px;
  align-items: start;
}

.ov-concept-actions--order .order-finalize-form {
  max-width: 260px;
}

.ov-concept-button-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ov-concept-button-row .ov-btn {
  width: auto;
  min-height: 34px;
}

/* Rode gevaar-knop */
.ov-btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

.ov-btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
/* Gedeelde info-lijsten in cards */
.ov-info-list {
    font-size: 14px;
    line-height: 1.35;
}

.ov-info-list > div {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.ov-info-list > div:last-child {
    margin-bottom: 0;
}

.ov-info-list strong {
    font-weight: 600;
    color: #444;
}
.ov-info-list > div strong {
    min-width: 110px;
    display: inline-block;
}
/* =========================
   Form layout
   ========================= */

.ov-form {
  display: flex;
  flex-direction: column;
}

.ov-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ov-form-row label {
  font-weight: 600;
  font-size: 13px;
  color: #444;
}

/* Inputs / textarea uniform */
.ov-form-row input,
.ov-form-row textarea,
.ov-form-row select {
  width: 100%;
  box-sizing: border-box;

  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;

  border: 1px solid #ccc;
  border-radius: 4px;

  background-color: #fff;
}

/* Textarea specifieke afstemming */
.ov-form-row textarea {
  resize: vertical;
  min-height: 90px;
}

.repair-description-dialog {
  width: min(640px, calc(100vw - 32px));
  padding: 0;
}

.repair-description-dialog-form {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.repair-description-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.repair-description-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.repair-description-dialog .ov-dialog-close {
  flex: 0 0 auto;
}

.repair-description-error {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
}

.repair-description-help {
  margin: 0;
  color: #4b5563;
  line-height: 1.45;
}

#repair-description-text {
  width: 100%;
  min-height: 180px;
  box-sizing: border-box;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.4;
}

.repair-description-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Checkbox row */
.ov-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.ov-checkbox input {
  width: auto;
}

/* Actieknoppen */
.ov-form-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Focus states */
.ov-form-row input:focus,
.ov-form-row textarea:focus,
.ov-form-row select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}
/* =========================
   Order create layout
   ========================= */

.ov-grid-order-create {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  align-items: start; /* ⬅️ CRUCIAAL */
}

/* Linkerkolom: kaarten onder elkaar */
.ov-order-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.ov-order-layout-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  align-items: stretch;
}

.ov-order-layout-mid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.ov-order-layout-mid > .ov-card:first-child {
  grid-column: span 1;
}

.ov-order-layout-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.case-detail-page {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ov-order-mid-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.ov-order-mid-grid > .ov-card:first-child {
  grid-column: span 1;
}

.ov-memos-card {
  grid-column: span 2;
}

.ov-status-actions-card form,
.ov-concept-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ov-concept-actions .order-finalize-form {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.ov-concept-actions.ov-concept-actions--order {
  display: grid;
}

.ov-status-actions-card button {
  margin: 0;
}

.case-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.case-photo {
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  margin: 0;
  padding: 8px;
  background: #fff;
}

.case-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e4e9f0;
}

.case-photo figcaption {
  margin-top: 8px;
  font-size: 13px;
  color: #334155;
}

@media (max-width: 1100px) {
  .ov-order-top-grid,
  .ov-order-layout-top,
  .ov-order-layout-mid,
  .ov-order-mid-grid {
    grid-template-columns: 1fr;
  }

  .ov-memos-card,
  .ov-order-layout-mid > .ov-card:first-child,
  .ov-order-mid-grid > .ov-card:first-child {
    grid-column: 1 / -1;
  }
}

.ov-left-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}


.ov-card-client .ov-form-row:has([name="email"]) {
  grid-column: 1 / -1;
}
/* Mobiel */
@media (max-width: 900px) {

  .ov-grid-order-create {
    grid-template-columns: 1fr;
  }

  /* Volgorde mobiel */
  .ov-card-load   { order: 1; }
  .ov-card-client { order: 2; }
  .ov-card-order  { order: 3; }

  /* Left column hoeft niet meer te groeperen */
  .ov-left-column {
    display: contents;
  }
}

/* Klant laden knop niet full width */
.ov-card-load .ov-btn {
  width: auto;
  align-self: flex-start;
  margin-top: 5px;
  background-color: #4b5563; /* donkergrijs */
  border-color: #4b5563;
  color: #fff;
}

/* =========================
   Klantgegevens – strakke en gelijke uitlijning
   ========================= */

/* Basis: klantformulier is een grid */
.ov-card-client .ov-form {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  row-gap: 14px;     /* verticale spacing */
  column-gap: 14px;    /* 🔑 voorkomt meetellen in breedte */
}

.ov-card-client .ov-form-row {
  min-width: 0; /* 🔑 voorkomt overflow in grid */
}

.ov-card-client .ov-form-row input,
.ov-card-client .ov-form-row textarea,
.ov-card-client .ov-form-row select {
  width: 100%;
  box-sizing: border-box;
}


/* =========================
   Desktop (≥ 901px)
   ========================= */
@media (min-width: 901px) {

  /* E-mail: altijd volledige breedte */
  .ov-card-client .ov-form-row:has([name="email"]) {
    grid-column: 1 / -1;
  }

  /* Voornaam + tussenvoegsel */
  .ov-card-client .ov-form-row:has([name="first_name"]) {
    grid-column: 1 / 7;
  }
  .ov-card-client .ov-form-row:has([name="middle_name"]) {
    grid-column: 7 / -1;
  }

  /* Achternaam */
  .ov-card-client .ov-form-row:has([name="last_name"]) {
    grid-column: 1 / -1;
  }

  .ov-card-client .ov-form-row:has([name="country_code"]) {
    grid-column: 1 / -1;
  }

  .ov-card-client .ov-form-row:has([name="language_code"]) {
    grid-column: 1 / -1;
  }

  /* Straat + huisnummer + toevoeging */
  .ov-card-client .ov-form-row:has([name="street"]) {
    grid-column: 1 / 7;
  }
  .ov-card-client .ov-form-row:has([name="house_no"]) {
    grid-column: 7 / 9;
  }
  .ov-card-client .ov-form-row:has([name="addition"]) {
    grid-column: 9 / -1;
  }

  /* Postcode + woonplaats */
  .ov-card-client .ov-form-row:has([name="postcode"]) {
    grid-column: 1 / 5;
  }
  .ov-card-client .ov-form-row:has([name="city"]) {
    grid-column: 5 / -1;
  }

  /* Telefoon / mobiel */
  .ov-card-client .ov-form-row:has([name="phone"]),
  .ov-card-client .ov-form-row:has([name="mobile"]) {
    grid-column: 1 / -1;
  }
}

/* =========================
   Mobiel (≤ 900px)
   ========================= */
@media (max-width: 900px) {

  .ov-card-client .ov-form {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Volle breedte velden */
  .ov-card-client .ov-form-row:has([name="email"]),
  .ov-card-client .ov-form-row:has([name="last_name"]),
  .ov-card-client .ov-form-row:has([name="country_code"]),
  .ov-card-client .ov-form-row:has([name="language_code"]),
  .ov-card-client .ov-form-row:has([name="street"]),
  .ov-card-client .ov-form-row:has([name="postcode"]),
  .ov-card-client .ov-form-row:has([name="city"]),
  .ov-card-client .ov-form-row:has([name="phone"]),
  .ov-card-client .ov-form-row:has([name="mobile"]) {
    grid-column: 1 / -1;
  }

  /* Voornaam + tussenvoegsel */
  .ov-card-client .ov-form-row:has([name="first_name"]) {
    grid-column: 1 / 3;
  }
  .ov-card-client .ov-form-row:has([name="middle_name"]) {
    grid-column: 3 / -1;
  }

  /* Huisnummer + toevoeging */
  .ov-card-client .ov-form-row:has([name="house_no"]) {
    grid-column: 1 / 3;
  }
  .ov-card-client .ov-form-row:has([name="addition"]) {
    grid-column: 3 / -1;
  }
}

/* Orderregels: rustigere zoekzone en compacte regelacties */
#orderregels .ov-card-header {
  margin-bottom: 18px;
}

.ov-product-search {
  margin: 14px 0 30px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #d7dee8;
  border-radius: 8px;
}

.ov-product-search .ov-tool-head {
  margin-bottom: 12px;
}

.ov-product-search-form {
  gap: 10px;
}

.ov-product-search-form input,
.ov-product-search-form select,
.ov-add-line-card input,
.ov-add-line-card select,
.ov-dialog-form input,
.ov-dialog-form select {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
  color: #111827;
  font: inherit;
}

.ov-product-search-form .ov-search-btn {
  min-height: 34px;
  border-color: #1d4ed8;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
}

.ov-product-search-form .ov-search-btn:hover {
  background: #1d4ed8;
}

.ov-product-results {
  margin-top: 18px;
}

.ov-product-results .ov-table {
  margin-bottom: 14px;
}

.ov-result-meta {
  margin-bottom: 10px;
}

.ov-pagination {
  gap: 10px;
  justify-content: flex-end;
  margin: 16px 0 4px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.ov-pagination .ov-btn {
  border-color: #cbd5e1;
  background: #fff;
  color: #1f2937;
}

.ov-pagination .ov-btn:hover {
  background: #eef2f7;
}

.ov-subtle-select {
  width: auto;
  max-width: 260px;
  min-height: 30px;
  padding: 4px 28px 4px 8px;
  border-color: #d1d5db;
  background-color: #fff;
  color: #374151;
  font-size: 0.82rem;
}

.ov-fixed-choice {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  max-width: 240px;
  color: #374151;
  font-size: 0.86rem;
  line-height: 1.25;
}

.ov-fixed-choice small {
  color: #6b7280;
}

.ov-line-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ov-inline-form {
  display: inline;
  margin: 0;
}

.ov-btn-discount {
  border-color: #15803d;
  background: #16a34a;
  color: #fff;
  font-weight: 700;
}

.ov-btn-discount:hover {
  background: #15803d;
}

.ov-line-actions .ov-btn-danger {
  min-width: 30px;
  padding-inline: 8px;
}

.ov-qty-stepper {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-width: 72px;
}

.ov-qty-stepper form {
  margin: 0;
}

.ov-qty-stepper span {
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ov-icon-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.ov-icon-btn:hover:not(:disabled) {
  background: #eef2f7;
}

.ov-icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.ov-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

.ov-dialog::backdrop {
  background: rgba(15, 23, 42, 0.32);
}

.ov-dialog-form {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.ov-dialog-form h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
}

.ov-dialog-form p {
  margin: 0 0 8px;
  color: #4b5563;
}

.ov-dialog-form label {
  margin-top: 4px;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 600;
}

.ov-dialog-form menu {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}

@media (max-width: 760px) {
  .ov-product-search-form input[name="product_q"],
  .ov-product-search-form select,
  .ov-product-search-form .ov-search-btn {
    width: 100%;
  }

  .ov-line-actions {
    justify-content: flex-start;
  }
}

/* Product zoeken in popup en compacte orderregelbediening */
.ov-orderline-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ov-search-open-btn {
  border-color: #cbd5e1;
  background: #fff;
  color: #1f2937;
}

.ov-search-open-btn:hover {
  background: #f3f4f6;
}

.ov-product-dialog {
  width: min(1120px, calc(100vw - 36px));
  max-height: min(820px, calc(100vh - 36px));
}

.ov-product-dialog-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 46px);
}

.ov-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
}

.ov-dialog-header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.ov-dialog-header p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.ov-dialog-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  background: #fff;
  color: #374151;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.ov-dialog-close:hover {
  background: #f3f4f6;
}

.ov-product-search-form-dialog {
  padding: 16px 20px;
  border-bottom: 1px solid #eef0f3;
  background: #f8fafc;
}

.ov-product-search-form-dialog input[name="product_q"] {
  min-width: min(420px, 100%);
}

.ov-product-results-dialog {
  margin: 0;
  padding: 16px 20px 18px;
  overflow: auto;
}

.ov-product-result-table {
  min-width: 880px;
}

.ov-product-add-qty {
  width: 70px;
  text-align: center;
}

.ov-product-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.ov-product-pagination a,
.ov-product-pagination span {
  min-width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  font-size: 0.86rem;
}

.ov-product-pagination a:hover {
  background: #eef2f7;
}

.ov-product-pagination .current {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}

.ov-qty-pill {
  width: 96px;
  height: 31px;
  display: inline-grid;
  grid-template-columns: 29px 1fr 29px;
  align-items: center;
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.ov-qty-pill form {
  height: 100%;
  margin: 0;
}

.ov-qty-pill span {
  min-width: 0;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: #111827;
}

.ov-qty-btn {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.ov-qty-btn:hover:not(:disabled) {
  background: #f1f5f9;
  color: #1f2937;
}

.ov-qty-btn:disabled {
  color: #cbd5e1;
  cursor: default;
}

.ov-readonly-line-info {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f9fafb;
}

.ov-readonly-line-info div {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 10px;
  align-items: baseline;
}

.ov-readonly-line-info strong {
  color: #4b5563;
  font-size: 0.84rem;
}

.ov-readonly-line-info span {
  color: #111827;
  min-width: 0;
}

.ov-fixed-choice-dialog {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f9fafb;
}

@media (max-width: 760px) {
  .ov-dialog-header {
    padding: 14px;
  }

  .ov-product-search-form-dialog,
  .ov-product-results-dialog {
    padding: 14px;
  }

  .ov-product-dialog {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }
}

/* Kleine polish: bewerkpopup tabelvorm en compactere regelknoppen */
#orderregels .ov-table th:last-child,
#orderregels .ov-table td.ov-line-actions {
  min-width: 178px;
  width: 178px;
}

#orderregels .ov-table td.ov-line-actions {
  white-space: nowrap;
}

.ov-line-actions .ov-btn-small {
  padding: 4px 7px;
  font-size: 0.72rem;
}

.ov-line-actions .ov-btn-danger {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ov-qty-pill {
  width: 76px;
  height: 26px;
  grid-template-columns: 23px 1fr 23px;
  border-radius: 7px;
}

.ov-qty-pill span {
  font-size: 0.82rem;
}

.ov-qty-btn {
  font-size: 14px;
}

.ov-readonly-line-info {
  display: table;
  width: 100%;
  border-collapse: collapse;
  padding: 0;
  overflow: hidden;
}

.ov-readonly-line-info .ov-info-row,
.ov-info-row-control {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

.ov-readonly-line-info .ov-info-row:last-child {
  border-bottom: 0;
}

.ov-readonly-line-info .ov-info-row > span,
.ov-info-row-control > span {
  color: #4b5563;
  font-size: 0.84rem;
  font-weight: 600;
}

.ov-readonly-line-info .ov-info-row > strong {
  min-width: 0;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ov-info-row-control {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  background: #f9fafb;
}

.ov-info-row-control .ov-subtle-select,
.ov-info-row-control .ov-fixed-choice {
  width: 100%;
  max-width: none;
}

.ov-product-search-form-dialog select,
.ov-product-search-form-dialog input[name="product_q"],
.ov-product-search-form-dialog .ov-search-btn {
  min-height: 38px;
  height: 38px;
  box-sizing: border-box;
}

.ov-product-search-form-dialog select {
  padding-top: 0;
  padding-bottom: 0;
}

.ov-product-results-dialog .ov-result-meta {
  padding: 5px 0 10px;
  margin-bottom: 8px;
}

.ov-line-actions .ov-inline-form {
  display: inline-flex;
  align-items: center;
  height: 26px;
}

.ov-line-actions > button,
.ov-line-actions .ov-inline-form > button {
  align-self: center;
}

.ov-line-actions > .ov-btn,
.ov-line-actions .ov-inline-form > .ov-btn {
  height: 28px;
  line-height: 1;
}

@media (max-width: 768px) {
  #orderregels .portal-list-table td.ov-line-actions,
  #orderregels .ov-table td.ov-line-actions {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    white-space: normal;
  }

  #orderregels .portal-list-table td.ov-line-actions::before,
  #orderregels .ov-table td.ov-line-actions::before {
    display: none;
  }

  .ov-line-actions .ov-inline-form {
    display: inline-flex;
    align-items: center;
    height: auto;
    margin: 0;
  }

  .ov-line-actions > .ov-btn,
  .ov-line-actions .ov-inline-form > .ov-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-height: 30px;
    line-height: 1;
  }

  .ov-line-actions .ov-btn-danger {
    width: 30px;
    min-width: 30px;
  }

}

/* Aantal als gewone input en compactere bewerkdialog */
.ov-qty-inline-form {
  display: inline-flex;
  justify-content: flex-end;
  margin: 0;
}

.ov-line-qty-input {
  width: 58px;
  height: 28px;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 0.86rem;
  padding: 3px 4px;
}

.ov-line-qty-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

dialog[id^="dlg-edit-line-"] {
  width: min(640px, calc(100vw - 28px));
  overflow-x: hidden;
}

dialog[id^="dlg-edit-line-"] .ov-dialog-form {
  min-width: 0;
}

dialog[id^="dlg-edit-line-"] .ov-readonly-line-info,
dialog[id^="dlg-edit-line-"] .ov-edit-line-grid {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

dialog[id^="dlg-edit-line-"] .ov-readonly-line-info .ov-info-row,
dialog[id^="dlg-edit-line-"] .ov-info-row-control {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 10px;
}

dialog[id^="dlg-edit-line-"] .ov-info-row-control > div,
dialog[id^="dlg-edit-line-"] .ov-info-row-control select,
dialog[id^="dlg-edit-line-"] .ov-info-row-control input,
dialog[id^="dlg-edit-line-"] .ov-fixed-choice-dialog {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ov-edit-line-grid {
  display: grid;
  border: 1px solid #e5e7eb;
  border-radius: 7px;
  overflow: hidden;
  background: #f9fafb;
}

.ov-edit-line-grid .ov-info-row-control {
  margin: 0;
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
  background: transparent;
}

.ov-edit-line-grid .ov-info-row-control:last-child {
  border-bottom: 0;
}

.ov-edit-line-grid input,
.ov-edit-line-grid select {
  min-height: 32px;
}

@media (max-width: 700px) {
  dialog[id^="dlg-edit-line-"] .ov-readonly-line-info .ov-info-row,
  dialog[id^="dlg-edit-line-"] .ov-info-row-control {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

/* Leveranciersbeheer: doorgetrokken rustige popup/tooling-stijl */
.supplier-manage-page {
  display: grid;
  gap: 15px;
  min-width: 0;
}

.supplier-manage-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #f8fafc;
}

.supplier-manage-header > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.supplier-manage-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

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

.supplier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid #d7dee8;
}

.supplier-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  box-sizing: border-box;
  padding: 6px 11px;
  border: 1px solid #d7dee8;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: #f8fafc;
  color: #374151;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
}

.supplier-tabs a:hover {
  border-color: #9db5d4;
  border-bottom: 0;
  background: #f0f8ff;
  color: #374151;
}

.supplier-tabs a.active {
  background: rgb(120, 152, 201);
  border-color: rgb(120, 152, 201);
  border-bottom: 0;
  color: #ffffff;
  font-weight: 400;
  box-shadow: none;
}

.supplier-tabs a.active:hover {
  background: rgb(120, 152, 201);
  border-color: rgb(120, 152, 201);
  color: #ffffff;
}

.supplier-tabs-arrow {
  display: none;
}

.supplier-tabs-mobile-wrap {
  display: contents;
}

@media (max-width: 768px) {
  .supplier-tabs-mobile-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
    margin-right: 0;
    min-width: 0;
  }

  .supplier-tabs--mobile-scroll {
    display: flex;
    flex-wrap: nowrap !important;
    gap: 4px;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 44px 7px 0;
    border-bottom: 1px solid #d7dee8;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-x;
  }

  .supplier-tabs--mobile-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .supplier-tabs--mobile-scroll a {
    flex: 0 0 auto;
    min-width: max-content;
    padding-right: 9px;
    padding-left: 9px;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .supplier-tabs-arrow {
    position: absolute;
    top: 0;
    bottom: 7px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    border: 0;
    color: #334155;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), #ffffff 38%);
    font-size: 1.25rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
  }

  .supplier-tabs-arrow--prev {
    left: 0;
    justify-content: flex-start;
    background: linear-gradient(to left, rgba(255, 255, 255, 0), #ffffff 38%);
  }

  .supplier-tabs-arrow--next {
    right: 0;
  }

  .supplier-tabs-arrow.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .supplier-tabs-mobile-wrap {
    margin-bottom: -1px;
  }

  .supplier-tabs--mobile-scroll {
    padding-bottom: 0;
  }

  .supplier-tabs-arrow {
    bottom: 0;
  }
}

.supplier-panel {
  padding: 15px;
  border: 1px solid #d7dee8;
  border-radius: 0 8px 8px 8px;
  background: #fff;
  min-width: 0;
  box-sizing: border-box;
}

.supplier-panel h2 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.supplier-panel p {
  margin: 0 0 14px;
  color: #6b7280;
}

.supplier-grid-form,
.supplier-inline-form,
.supplier-stack-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

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

.supplier-grid-form label,
.supplier-inline-form label,
.supplier-stack-form label {
  display: grid;
  gap: 4px;
  color: #4b5563;
  font-size: 0.84rem;
  font-weight: 600;
}

.supplier-grid-form input,
.supplier-grid-form select,
.supplier-inline-form input,
.supplier-inline-form select,
.supplier-stack-form input,
.supplier-stack-form textarea,
.supplier-manage-table input,
.supplier-manage-table select,
.supplier-manage-table textarea {
  min-height: 34px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 6px 8px;
  font: inherit;
}

.supplier-inline-form {
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
  align-items: end;
}

.supplier-stack-form textarea,
.supplier-manage-table textarea {
  min-height: 78px;
}

.supplier-check {
  align-content: end;
}

.supplier-check input,
.supplier-inline-form input[type="checkbox"],
.supplier-stack-form input[type="checkbox"],
.supplier-manage-table input[type="checkbox"] {
  min-height: auto;
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
}

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

.supplier-manage-table th,
.supplier-manage-table td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.supplier-manage-table th {
  background: #eef2f7;
  color: #111827;
  font-weight: 700;
}

.supplier-manage-table td:last-child {
  white-space: nowrap;
}

.supplier-fit-button,
.supplier-grid-form > button,
.supplier-stack-form > button {
  justify-self: start;
  width: auto;
}

.supplier-action-buttons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.supplier-checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}

.supplier-readonly-row {
  display: grid;
  gap: 4px;
  color: #4b5563;
  font-size: 0.84rem;
}

.supplier-readonly-row strong {
  color: #111827;
  font-size: 0.95rem;
  font-weight: 600;
}

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

.supplier-readonly-grid > div {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #f8fafc;
}

.supplier-readonly-grid span {
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 600;
}

.supplier-readonly-grid strong {
  min-height: 20px;
  color: #111827;
  font-size: 0.94rem;
  font-weight: 600;
}

.supplier-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.supplier-filter-bar input,
.supplier-filter-bar select {
  min-height: 34px;
  min-width: 190px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
}

.supplier-filter-bar button,
.supplier-filter-bar .btn,
.supplier-filter-bar .ov-btn,
.supplier-action-buttons .ov-btn,
.supplier-fit-button,
.supplier-grid-form > button,
.supplier-stack-form > button,
.supplier-list-page .ov-btn-small,
.supplier-manage-page .ov-btn-small,
.client-filter-bar button,
.client-filter-bar .ov-btn {
  min-height: 34px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  margin-top: 0;
  font-size: 0.88rem;
  line-height: 1.2;
  text-decoration: none;
}

.supplier-list-summary {
  padding-bottom: 5px;
}

.supplier-list-page .supplier-manage-table a {
  font-weight: 600;
}

@media (max-width: 820px) {
  .supplier-grid-form,
  .supplier-inline-form {
    grid-template-columns: 1fr;
  }

  .supplier-readonly-grid {
    grid-template-columns: 1fr;
  }

  .supplier-manage-header {
    display: grid;
  }
}

@media (max-width: 700px) {
  .supplier-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .supplier-filter-bar input,
  .supplier-filter-bar select,
  .supplier-filter-bar button,
  .supplier-filter-bar .btn,
  .supplier-filter-bar .ov-btn {
    width: 100%;
    min-width: 0;
  }

  .supplier-manage-table--mobile-cards thead {
    display: none;
  }

  .supplier-manage-table--mobile-cards,
  .supplier-manage-table--mobile-cards tbody {
    display: block;
    width: 100%;
  }

  .supplier-manage-table--mobile-cards tr {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
  }

  .supplier-manage-table--mobile-cards td {
    display: flex;
    gap: 0.5rem;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border-bottom: 1px solid #eef2f7;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .supplier-manage-table--mobile-cards td:last-child {
    border-bottom: 0;
    white-space: normal;
  }

  .supplier-manage-table--mobile-cards td::before {
    content: attr(data-label);
    display: block;
    flex: 0 0 42%;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
  }

  .supplier-manage-table--mobile-cards td[data-label="Acties"],
  .supplier-manage-table--mobile-cards td[data-label="Actie"] {
    display: block;
  }

  .supplier-manage-table--mobile-cards td[data-label="Acties"]::before,
  .supplier-manage-table--mobile-cards td[data-label="Actie"]::before {
    display: none;
  }

  .supplier-action-buttons {
    flex-wrap: wrap;
    white-space: normal;
  }

  .supplier-manage-table--mobile-cards td[data-label="Klant"] {
    display: block;
  }

  .supplier-manage-table--mobile-cards td[data-label="Klant"]::before {
    display: block;
    margin-bottom: 4px;
  }

  .supplier-manage-table--mobile-cards td[data-label="Klant"] strong,
  .supplier-manage-table--mobile-cards td[data-label="Klant"] small {
    display: block;
  }

  .supplier-manage-table--mobile-cards td[data-label="Klant"] small {
    margin-top: 2px;
  }

  .repair-parts-table.activities-table--mobile-cards thead {
    display: none;
  }

  .repair-parts-table.activities-table--mobile-cards,
  .repair-parts-table.activities-table--mobile-cards tbody {
    display: block;
    width: 100%;
  }

  .repair-parts-table.activities-table--mobile-cards tr {
    display: grid;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    background: #fff;
  }

  .repair-parts-table.activities-table--mobile-cards td {
    display: grid;
    grid-template-columns: minmax(108px, 36%) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 8px 10px;
    border-bottom: 1px solid #eef2f7;
    white-space: normal;
    word-break: break-word;
  }

  .repair-parts-table.activities-table--mobile-cards td:last-child {
    border-bottom: 0;
  }

  .repair-parts-table.activities-table--mobile-cards td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
  }

  .repair-parts-table.activities-table--mobile-cards td[data-label="Omschrijving"],
  .repair-parts-table.activities-table--mobile-cards td[data-label="Acties"] {
    grid-template-columns: 1fr;
  }
}

/* Order korting/bewerken popups compacter met iets meer bruikbare ruimte */
dialog[id^="dlg-edit-line-"],
dialog[id^="dlg-discount-"] {
  width: min(700px, calc(100vw - 24px));
  padding: 10px;
  overflow-x: hidden;
  box-sizing: border-box;
}

dialog[id^="dlg-edit-line-"] .ov-dialog-form,
dialog[id^="dlg-discount-"] .ov-dialog-form {
  padding: 0;
}

dialog[id^="dlg-discount-"] .ov-edit-line-grid {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Reparaties en garanties */
.case-detail-page {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.case-detail-page > .ov-header,
.case-detail-page > .error,
.case-detail-page > .info,
.repair-detail-layout,
.order-detail-layout {
  grid-column: 1 / -1;
}

.case-detail-page > .ov-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.case-detail-page > .ov-header h1 {
  margin: 0;
}

.supplier-manage-page-detail .supplier-manage-header {
  margin-bottom: 6px;
}

.supplier-manage-page-detail .supplier-manage-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.supplier-manage-page-detail .supplier-manage-header h1,
.supplier-manage-page-detail .supplier-manage-header p {
  margin: 0;
}

.supplier-manage-page-detail .supplier-panel {
  padding-top: 15px;
}

.case-detail-page .ov-order-top-grid,
.case-detail-page .ov-order-mid-grid {
  display: contents;
}

.repair-detail-layout {
  display: grid;
  grid-template-columns: minmax(25%, 300px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.repair-detail-left,
.repair-detail-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.order-detail-layout {
  display: grid;
  grid-template-columns: minmax(25%, 300px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.order-detail-left,
.order-detail-right,
.order-detail-layout .ov-order-layout-top,
.order-detail-layout .ov-order-layout-mid,
.order-detail-layout .ov-order-layout-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.order-detail-layout .ov-order-layout-top,
.order-detail-layout .ov-order-layout-mid,
.order-detail-layout .ov-order-layout-bottom {
  margin-bottom: 0;
  width: 100%;
  align-self: stretch;
}

.order-detail-right .ov-order-layout-bottom {
  order: 1;
}

.order-detail-right .ov-memos-card {
  order: 2;
  grid-column: auto;
}

.order-detail-layout .ov-card {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border-color: #d7e0ec;
}

.order-detail-layout .ov-card-title {
  margin-bottom: 8px;
  font-size: 1rem;
}

.order-detail-layout .ov-info-list {
  line-height: 1.3;
}

.order-detail-layout .ov-info-list > div {
  align-items: flex-start;
  margin-bottom: 6px;
}

.order-detail-layout .ov-client-card-body {
  align-items: flex-start;
  gap: 10px;
}

.order-detail-layout .ov-client-avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.order-detail-layout .ov-memo-list {
  gap: 8px;
}

.order-detail-layout .ov-memo-item {
  padding: 8px;
}

.order-detail-left .order-card-client {
  order: 1;
}

.order-detail-left .order-card-actions {
  order: 2;
}

.order-detail-left .order-card-status {
  order: 3;
}

.order-detail-left .ov-order-layout-mid {
  order: 4;
}

.order-detail-left .order-card-payment {
  width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}

.order-card-actions,
.order-card-status,
.order-detail-left .order-card-payment,
.repair-card-actions {
  background: #eef6ff !important;
  border-color: #b9d7fb !important;
}

.order-card-actions,
.order-card-status,
.order-card-payment {
  font-size: 0.9rem;
}

.order-card-actions .ov-card-title,
.order-card-status .ov-card-title,
.order-card-payment .ov-card-title {
  margin-bottom: 8px;
  font-size: 1rem;
}

.order-card-status .ov-info-list,
.order-card-payment .ov-info-list {
  font-size: 0.9rem;
  line-height: 1.3;
}

.order-card-status .ov-info-list > div,
.order-card-payment .ov-info-list > div {
  margin-bottom: 6px;
}

.order-card-status .ov-info-list strong,
.order-card-payment .ov-info-list strong {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.client-filter-bar {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.clients-table td {
  vertical-align: top;
}

.client-dossier-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px 4px 0;
  padding: 3px 7px;
  border: 1px solid #d7e0ec;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  white-space: nowrap;
}

.client-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.client-detail-heading h2,
.client-detail-heading p {
  margin: 0;
}

.client-detail-heading p {
  color: #64748b;
  font-size: 0.88rem;
}

.client-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.client-create-layout {
  margin-top: 0;
}

.client-readonly-form input:disabled,
.client-readonly-form select:disabled {
  color: #111827;
  opacity: 1;
  background: #f8fafc;
  border-color: #d7e0ec;
}

.client-edit-actions {
  justify-content: flex-start;
  align-items: flex-start;
}

.client-edit-actions .ov-btn {
  width: auto;
}

.client-edit-card {
  padding: 12px;
  border: 1px solid #d7e0ec;
  border-radius: 6px;
  background: #f8fafc;
}

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

.client-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.client-edit-grid label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 700;
}

.client-edit-grid input,
.client-edit-grid select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font: inherit;
  box-sizing: border-box;
}

.client-info-card {
  padding: 10px;
  border: 1px solid #d7e0ec;
  border-radius: 6px;
  background: #f8fafc;
}

.client-history-summary {
  display: grid;
  gap: 8px;
}

.client-history-summary a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #d7e0ec;
  border-radius: 6px;
  background: #fff;
  color: #0f3f8c;
  text-decoration: none;
}

.client-history-summary strong {
  color: #111827;
  font-size: 1rem;
}

.client-history-sections {
  display: grid;
  gap: 10px;
}

.client-history-sections > .ov-card {
  padding: 10px;
  border: 1px solid #d7e0ec;
  border-radius: 6px;
  background: #f8fafc;
}

.case-detail-page .ov-card {
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border-color: #d7e0ec;
}

.case-detail-page .ov-card-title {
  margin-bottom: 8px;
  font-size: 1rem;
}

.case-detail-page p {
  margin-top: 0;
  margin-bottom: 6px;
  line-height: 1.35;
}

.repair-card-client {
  grid-column: 1;
  grid-row: 1;
}

.repair-card-actions {
  grid-column: 1;
  grid-row: 2;
}

.repair-card-status {
  grid-column: 1;
  grid-row: 3;
}

.repair-card-cost {
  grid-column: 1;
  grid-row: 4;
}

.repair-card-shipping {
  grid-column: 1;
  grid-row: 5;
}

.repair-card-product {
  grid-column: 2;
  grid-row: 1;
}

.repair-card-specs {
  grid-column: 2;
  grid-row: 2;
}

.repair-card-parts {
  grid-column: 2;
  grid-row: 3;
}

.repair-card-intake {
  grid-column: 2;
  grid-row: 4;
}

.repair-card-result {
  grid-column: 2;
  grid-row: 5;
}

.repair-card-status,
.repair-card-cost,
.repair-card-shipping {
  background: #eef6ff !important;
  border-color: #b9d7fb !important;
}

.repair-card-product {
  background: #f9fbfd !important;
}

.repair-detail-left .repair-card-client {
  order: 1;
}

.repair-detail-left .repair-card-actions {
  order: 2;
}

.repair-detail-left .repair-card-status {
  order: 3;
}

.repair-detail-left .repair-card-cost {
  order: 4;
}

.repair-detail-left .repair-card-shipping {
  order: 5;
}

.repair-detail-right .repair-card-product {
  order: 1;
}

.repair-detail-right .repair-card-specs {
  order: 2;
}

.repair-detail-right .repair-card-parts {
  order: 3;
}

.repair-detail-right .repair-card-intake {
  order: 4;
}

.repair-detail-right .repair-card-result {
  order: 5;
}

.case-detail-page .ov-form {
  gap: 8px;
}

.case-detail-page .ov-form-row textarea {
  min-height: 72px;
}

.case-subsection {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #d7e0ec;
}

.case-subsection h4 {
  margin: 0 0 8px;
  color: #1f3b63;
  font-size: 0.9rem;
}

.repair-card-cost .case-subsection {
  padding: 10px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.case-shipping-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.case-shipping-form .ov-btn {
  justify-self: start;
}

.case-detail-page .supplier-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
  gap: 8px;
  margin: 10px 0 0;
}

.case-detail-page .supplier-filter-bar label {
  display: grid;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #4b5563;
}

.case-detail-page .supplier-filter-bar input,
.case-detail-page .supplier-filter-bar select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
}

.case-detail-page .supplier-filter-check {
  display: inline-flex !important;
  align-items: center;
  justify-content: start;
  gap: 6px;
  min-height: 32px;
}

.case-detail-page .supplier-filter-check input,
.case-detail-page .ov-checkbox input,
.case-dialog .supplier-filter-check input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.case-line-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 6px 0 8px;
}

.case-detail-page .ov-btn,
.case-dialog .ov-btn {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

.case-detail-page button,
.case-dialog button {
  max-width: max-content;
}

.case-compact-card {
  font-size: 0.9rem;
}

.case-compact-list {
  display: grid;
  gap: 4px;
  margin: 0;
}

.case-compact-list > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.55fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.case-compact-list dt {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
}

.case-compact-list dd {
  margin: 0;
  color: #111827;
  font-weight: 600;
  word-break: break-word;
}

.case-product-summary {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  overflow: hidden;
}

.case-product-summary th,
.case-product-summary td {
  padding: 6px 8px;
  border-bottom: 1px solid #edf1f5;
  text-align: left;
}

.case-product-summary th {
  width: 90px;
  color: #475569;
  background: #eef4fb;
  font-size: 0.82rem;
}

.case-product-summary tr:last-child th,
.case-product-summary tr:last-child td {
  border-bottom: 0;
}

.case-inline-action {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 6px 0 0;
}

.case-status-actions {
  gap: 6px;
  align-items: center;
}

.case-compact-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.8fr) auto;
  align-items: end;
  gap: 8px;
}

.case-compact-form .ov-form-row {
  min-width: 0;
}

.case-dialog {
  width: min(620px, calc(100vw - 24px));
  padding: 10px;
}

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

.case-dialog-grid label {
  display: grid;
  gap: 4px;
  color: #4b5563;
  font-size: 0.84rem;
  font-weight: 600;
}

.case-dialog-grid input,
.case-dialog-grid select {
  width: 100%;
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
}

.case-upload-form {
  display: grid;
  gap: 10px;
}

.case-upload-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 8px;
}

.case-upload-fields label {
  display: grid;
  gap: 4px;
  color: #4b5563;
  font-size: 0.84rem;
  font-weight: 600;
}

.case-upload-fields input,
.case-upload-fields select {
  min-height: 32px;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
}

.case-dropzone {
  padding: 10px;
  min-height: 54px;
  display: grid;
  place-items: center;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1f3b63;
}

.case-photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.case-photo {
  padding: 5px;
  border-radius: 6px;
}

.case-photo-thumb {
  display: block;
  width: 75px;
  height: 75px;
  padding: 0;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}

.case-photo-thumb img,
.case-photo img {
  width: 75px;
  height: 75px;
  aspect-ratio: auto;
  object-fit: cover;
  border: 0;
  border-radius: 6px;
}

.case-photo figcaption {
  max-width: 92px;
  margin-top: 4px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.case-photo-dialog {
  width: min(840px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.case-photo-dialog img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 6px;
}

.case-photo-dialog p {
  margin: 8px 0 0;
  text-align: center;
  font-weight: 600;
}

.case-receipt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.case-receipt-item {
  display: block;
  padding: 8px 10px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: #0f3f8c;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .case-detail-page {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  }

  .repair-detail-layout {
    grid-template-columns: minmax(25%, 280px) minmax(0, 1fr);
  }

  .order-detail-layout {
    grid-template-columns: minmax(25%, 280px) minmax(0, 1fr);
  }

  .case-detail-page .supplier-filter-bar,
  .case-upload-fields,
  .case-compact-form,
  .case-dialog-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .case-detail-page {
    grid-template-columns: 1fr;
  }

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

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

  .client-filter-bar,
  .client-detail-grid,
  .client-edit-grid {
    grid-template-columns: 1fr;
  }

  .client-detail-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-detail-actions,
  .client-edit-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .repair-card-status,
  .repair-card-cost,
  .repair-card-shipping,
  .repair-card-client,
  .repair-card-actions,
  .repair-card-product,
  .repair-card-specs,
  .repair-card-parts,
  .repair-card-intake,
  .repair-card-result {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .case-detail-page .supplier-filter-bar,
  .case-upload-fields,
  .case-compact-form,
  .case-dialog-grid {
    grid-template-columns: 1fr;
  }

  .case-line-actions {
    justify-content: flex-start;
  }
}

.case-detail-tabs { margin: 0; }

.case-conversation-heading {
  padding-bottom: 12px;
  border-bottom: 1px solid #d7dee8;
}

.case-conversation-panel {
  display: grid;
  grid-template-columns: minmax(280px, 33%) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.case-conversation-history,
.case-conversation-compose {
  display: grid;
  gap: 12px;
}

.case-conversation-history {
  padding: 14px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
}

.case-conversation-history > header,
.case-conversation-compose > header {
  display: grid;
  gap: 2px;
}

.case-conversation-history h2,
.case-conversation-compose h2 {
  margin: 0;
  font-size: 1rem;
  color: #111827;
}

.case-conversation-history p,
.case-conversation-compose p {
  margin: 0;
  color: #64748b;
  font-size: 0.86rem;
}

.case-conversation-compose {
  padding: 14px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #f8fafc;
}

.case-conversation-list {
  display: grid;
  gap: 10px;
}

.case-message {
  max-width: min(760px, 82%);
  padding: 10px 12px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
}

.case-message header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #475569;
  font-size: 0.82rem;
}

.case-message p {
  margin: 0;
  white-space: normal;
}

.case-message-link {
  color: #0f5ea8;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.case-message-link-warning::after {
  content: " !";
  color: #b45309;
  font-weight: 800;
}

.case-message small,
.case-message-status {
  display: block;
  margin-top: 8px;
  color: #64748b;
  font-size: 0.72rem;
  font-style: italic;
}

.case-message-staff {
  justify-self: start;
  background: #f8fafc;
}

.case-message-customer {
  justify-self: end;
  background: #eef6ff;
}

.case-conversation-form {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 8px;
}

.case-conversation-label,
.case-conversation-notify {
  display: flex;
  grid-column: 1 / -1;
  width: 100%;
}

.case-conversation-label {
  align-items: center;
}

.case-conversation-notify {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 2px;
}

.case-conversation-form textarea {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  background: #fff;
}

.case-conversation-form .ov-form-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.case-conversation-empty {
  margin: 0;
  color: #64748b;
}

@media (max-width: 680px) {
  .case-conversation-panel {
    grid-template-columns: 1fr;
  }

  .case-conversation-compose {
    order: -1;
  }

  .case-message {
    max-width: 94%;
  }
}
