/* CCH Native V3 structural module CSS: modules/maschinen/css/maschinen.css
   Old visual skin removed. Uses core/css/cch-design-v3.css. */
body.cch-page-cch-maschinen {
  overflow-x: hidden;
}

.machine-gallery-field {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.machine-gallery-field>button {
  justify-self: start;
}

.machine-gallery-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 42px;
}

.machine-gallery-preview>span {
  position: relative;
  width: 96px;
  height: 72px;
}

.machine-gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.machine-gallery-preview span button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-weight: 900;
}

body.cch-page-cch-maschinen .wrap {
  margin: 0 auto 42px;
}

body.cch-page-cch-maschinen .module-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 20px;
  backdrop-filter: blur(18px);
}

body.cch-page-cch-maschinen .module-kicker {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.cch-page-cch-maschinen h1,
body.cch-page-cch-maschinen h2,
body.cch-page-cch-maschinen h3 {
  margin: 0;
  letter-spacing: 0;
}

body.cch-page-cch-maschinen h1 {
  margin-top: 10px;
  font-size: clamp(30px, 4vw, 50px);
  line-height: 1;
}

body.cch-page-cch-maschinen h2 {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1.1;
}

body.cch-page-cch-maschinen .small {
  font-size: 12px;
  line-height: 1.45;
}

body.cch-page-cch-maschinen .status,
body.cch-page-cch-maschinen .machine-report-hint {
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 14px;
}

body.cch-page-cch-maschinen .card,
body.cch-page-cch-maschinen .modal-card,
body.cch-page-cch-maschinen .stat {
  padding: 18px;
  box-sizing: border-box;
  backdrop-filter: blur(18px);
}

body.cch-page-cch-maschinen .grid2,
body.cch-page-cch-maschinen .grid3 {
  display: grid;
  gap: 12px;
}

body.cch-page-cch-maschinen .grid2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.cch-page-cch-maschinen .grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.cch-page-cch-maschinen label {
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 900;
}

body.cch-page-cch-maschinen input,
body.cch-page-cch-maschinen select,
body.cch-page-cch-maschinen textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  font: inherit;
  box-sizing: border-box;
}

body.cch-page-cch-maschinen textarea {
  min-height: 96px;
  resize: vertical;
}

body.cch-page-cch-maschinen button,
body.cch-page-cch-maschinen .primary,
body.cch-page-cch-maschinen .ghost,
body.cch-page-cch-maschinen .soft,
body.cch-page-cch-maschinen .danger {
  min-height: 40px;
  padding: 9px 13px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

body.cch-page-cch-maschinen button:hover {
  transform: translateY(-1px);
}

body.cch-page-cch-maschinen button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

body.cch-page-cch-maschinen .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

body.cch-page-cch-maschinen .module-actions-admin {
  width: min(320px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-left: auto;
}

body.cch-page-cch-maschinen .module-actions-admin button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.1;
}

body.cch-page-cch-maschinen .stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

body.cch-page-cch-maschinen .stat {
  padding: 15px;
}

body.cch-page-cch-maschinen .stat b {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

body.cch-page-cch-maschinen .stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

body.cch-page-cch-maschinen .filterbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) 190px 190px 190px auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

body.cch-page-cch-maschinen .tableWrap {
  width: 100%;
  overflow: auto;
}

body.cch-page-cch-maschinen table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

body.cch-page-cch-maschinen th,
body.cch-page-cch-maschinen td {
  padding: 12px 11px;
  text-align: left;
  vertical-align: top;
}

body.cch-page-cch-maschinen th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

body.cch-page-cch-maschinen td strong {
  display: block;
  font-weight: 900;
}

body.cch-page-cch-maschinen td small {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

body.cch-page-cch-maschinen .type-pill,
body.cch-page-cch-maschinen .history-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

body.cch-page-cch-maschinen .type-report {
  margin-top: 8px;
}

body.cch-page-cch-maschinen .machine-listing {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body.cch-page-cch-maschinen .machine-listing-copy {
  min-width: 0;
}

body.cch-page-cch-maschinen .machine-thumb {
  width: 78px;
  height: 78px;
  overflow: hidden;
}

body.cch-page-cch-maschinen .machine-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

body.cch-page-cch-maschinen .machine-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

body.cch-page-cch-maschinen .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 290px;
}

body.cch-page-cch-maschinen .row-actions button,
body.cch-page-cch-maschinen .history-row-actions button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

body.cch-page-cch-maschinen .history-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 170px;
}

body.cch-page-cch-maschinen .history-note {
  max-width: 280px;
  line-height: 1.45;
  white-space: pre-wrap;
}

body.cch-page-cch-maschinen .modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 28px 16px;
  backdrop-filter: blur(8px);
}

body.cch-page-cch-maschinen .modal-backdrop.show {
  display: flex;
}

body.cch-page-cch-maschinen .modal-card {
  width: min(980px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  margin: auto;
}

body.cch-page-cch-maschinen .history-modal-card {
  width: min(1180px, 100%);
}

body.cch-page-cch-maschinen .transfer-modal-card,
body.cch-page-cch-maschinen .handover-history-modal-card {
  width: min(1180px, 100%);
}

body.cch-page-cch-maschinen .modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

body.cch-page-cch-maschinen .modal-head-compact {
  margin-bottom: 10px;
}

body.cch-page-cch-maschinen .modal-close-small {
  flex: 0 0 auto;
}

body.cch-page-cch-maschinen .handover-machine-card,
body.cch-page-cch-maschinen .upload-box,
body.cch-page-cch-maschinen .machine-photo-shell {
  padding: 12px;
  margin-bottom: 12px;
}

body.cch-page-cch-maschinen .handover-machine-card strong {
  display: block;
}

body.cch-page-cch-maschinen .machine-photo-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.cch-page-cch-maschinen .machine-photo-head label {
  margin-top: 0;
}

body.cch-page-cch-maschinen .machine-photo-preview {
  min-height: 220px;
  display: grid;
  place-items: center;
  margin-top: 12px;
  overflow: hidden;
}

body.cch-page-cch-maschinen .machine-photo-placeholder {
  display: grid;
  gap: 6px;
  padding: 24px;
  text-align: center;
}

body.cch-page-cch-maschinen .machine-photo-placeholder strong {
  font-size: 15px;
}

body.cch-page-cch-maschinen .machine-photo-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  display: block;
}

body.cch-page-cch-maschinen .machine-photo-meta {
  width: 100%;
  padding: 10px 12px;
  font-size: 12px;
  text-align: left;
}

body.cch-page-cch-maschinen .upload-box.compact {
  margin-bottom: 0;
}

body.cch-page-cch-maschinen .machine-plan-flag {
  margin-top: 12px;
}

body.cch-page-cch-maschinen .machine-plan-check {
  min-height: 42px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
}

body.cch-page-cch-maschinen .machine-plan-check input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
}

body.cch-page-cch-maschinen .machine-plan-check strong,
body.cch-page-cch-maschinen .machine-plan-check small {
  display: block;
}

body.cch-page-cch-maschinen .machine-plan-check small {
  margin-top: 4px;
  line-height: 1.4;
}

body.cch-page-cch-maschinen .handover-check {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  margin-top: 28px;
}

body.cch-page-cch-maschinen .handover-check input {
  width: auto;
  min-height: auto;
}

body.cch-page-cch-maschinen .handover-file-list {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

body.cch-page-cch-maschinen .handover-file-link {
  display: block;
  padding: 7px 9px;
  text-decoration: none;
  font-size: 12px;
}

body.cch-page-cch-maschinen .form-errors {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

body.cch-page-cch-maschinen [hidden] {
  display: none !important;
}

body.cch-page-cch-maschinen .history-table-wrap table {
  min-width: 1120px;
}

@media (max-width: 980px) {
body.cch-page-cch-maschinen .module-hero {
  flex-direction: column;
  padding: 16px;
}

body.cch-page-cch-maschinen .module-actions-admin {
  width: 100%;
  margin-left: 0;
}

body.cch-page-cch-maschinen .stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.cch-page-cch-maschinen .filterbar,
  body.cch-page-cch-maschinen .grid2,
  body.cch-page-cch-maschinen .grid3 {
  grid-template-columns: 1fr;
}

body.cch-page-cch-maschinen .machine-listing {
  grid-template-columns: 64px minmax(0, 1fr);
}

body.cch-page-cch-maschinen .machine-thumb {
  width: 64px;
  height: 64px;
}

body.cch-page-cch-maschinen .machine-photo-head {
  flex-direction: column;
}

body.cch-page-cch-maschinen .modal-backdrop {
  padding: 14px 10px;
}

body.cch-page-cch-maschinen .modal-card {
  max-height: calc(100vh - 28px);
  padding: 14px;
}

body.cch-page-cch-maschinen .modal-head {
  display: grid;
  grid-template-columns: 1fr;
}
}

body.cch-page-cch-maschinen #machineTable {
  min-width: 1480px;
}

body.cch-page-cch-maschinen .history-modal-card,
body.cch-page-cch-maschinen .handover-history-modal-card,
body.cch-page-cch-maschinen .parts-modal-card {
  width: min(1540px, calc(100vw - 40px)) !important;
  max-width: none !important;
}

body.cch-page-cch-maschinen .history-table-wrap {
  max-height: min(74dvh, 900px);
}

body.cch-page-cch-maschinen .history-table-wrap table {
  min-width: 1260px !important;
  table-layout: auto;
}

body.cch-page-cch-maschinen .history-table-wrap th:nth-child(4),
body.cch-page-cch-maschinen .history-table-wrap td:nth-child(4) {
  width: 34%;
}

body.cch-page-cch-maschinen .history-note {
  min-width: 260px;
  max-width: 620px;
  overflow-wrap: break-word;
}

body.cch-page-cch-maschinen .machine-part-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
}

body.cch-page-cch-maschinen .parts-table-wrap table {
  min-width: 1040px !important;
}

@media (max-width: 760px) {
body.cch-page-cch-maschinen .tableWrap,
  body.cch-page-cch-maschinen .history-table-wrap {
  overflow: visible !important;
  max-height: none !important;
}

body.cch-page-cch-maschinen #machineTable,
  body.cch-page-cch-maschinen #historyTable,
  body.cch-page-cch-maschinen #handoverHistoryTable,
  body.cch-page-cch-maschinen #partsTable {
  min-width: 0 !important;
  display: block;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) thead {
  display: none;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) tbody {
  display: grid;
  gap: 12px;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) tr {
  display: grid;
  gap: 0;
  overflow: hidden;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) td {
  min-width: 0 !important;
  width: auto !important;
  display: grid;
  grid-template-columns: minmax(92px, .36fr) minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px !important;
  overflow-wrap: break-word;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) td::before {
  content: attr(data-label);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) td[colspan] {
  display: block;
}

body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) td[colspan]::before {
  content: none;
}

body.cch-page-cch-maschinen #machineTable td:first-child {
  display: block;
  padding: 12px !important;
}

body.cch-page-cch-maschinen #machineTable td:first-child::before {
  content: none;
}

body.cch-page-cch-maschinen .machine-listing {
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
}

body.cch-page-cch-maschinen .machine-listing-copy {
  min-width: 0;
}

body.cch-page-cch-maschinen .machine-listing-copy strong {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

body.cch-page-cch-maschinen .row-actions,
  body.cch-page-cch-maschinen .history-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

body.cch-page-cch-maschinen .row-actions button,
  body.cch-page-cch-maschinen .history-row-actions button {
  width: 100%;
}

body.cch-page-cch-maschinen .history-modal-card,
  body.cch-page-cch-maschinen .handover-history-modal-card,
  body.cch-page-cch-maschinen .parts-modal-card {
  width: 100% !important;
  height: 100dvh;
  max-height: 100dvh !important;
  padding: 12px !important;
}

body.cch-page-cch-maschinen .history-note {
  min-width: 0;
  max-width: none;
}
}

body.cch-page-cch-maschinen .machine-record-modal-card {
  width: min(1500px,calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
}

body.cch-page-cch-maschinen .machine-record-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
  padding: 18px 22px;
  backdrop-filter: blur(12px);
}

body.cch-page-cch-maschinen .machine-record-content {
  padding: 20px;
}

body.cch-page-cch-maschinen .machine-record-loading {
  min-height: 280px;
  display: grid;
  place-items: center;
}

body.cch-page-cch-maschinen .machine-record-overview {
  display: grid;
  grid-template-columns: minmax(240px,360px) 1fr 170px;
  gap: 24px;
  align-items: center;
}

body.cch-page-cch-maschinen .machine-record-photo {
  aspect-ratio: 16/10;
  display: grid;
  place-items: center;
  overflow: hidden;
}

body.cch-page-cch-maschinen .machine-record-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.cch-page-cch-maschinen .machine-record-facts h3 {
  margin: 12px 0;
  font-size: 26px;
}

body.cch-page-cch-maschinen .machine-record-facts dl {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px 20px;
  margin: 0;
}

body.cch-page-cch-maschinen .machine-record-facts dl div {
  padding: 10px 0;
}

body.cch-page-cch-maschinen .machine-record-facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

body.cch-page-cch-maschinen .machine-record-facts dd {
  margin: 4px 0 0;
  font-weight: 700;
}

body.cch-page-cch-maschinen .machine-record-qr {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

body.cch-page-cch-maschinen .machine-record-qr img {
  width: 132px;
  height: 132px;
  padding: 7px;
}

body.cch-page-cch-maschinen .machine-record-actions {
  position: sticky;
  top: 82px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin: 20px -20px;
  padding: 12px 20px;
}

body.cch-page-cch-maschinen .machine-record-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 16px;
}

body.cch-page-cch-maschinen .machine-record-grid>article {
  min-width: 0;
  padding: 18px;
}

body.cch-page-cch-maschinen .machine-record-grid article>header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

body.cch-page-cch-maschinen .machine-record-grid h3 {
  margin: 0;
}

body.cch-page-cch-maschinen .machine-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.cch-page-cch-maschinen .machine-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 3px 14px;
  padding: 10px 0 10px 18px;
}

body.cch-page-cch-maschinen .machine-timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 15px;
  width: 10px;
  height: 10px;
}

body.cch-page-cch-maschinen .machine-timeline small {
  grid-column: 2;
}

body.cch-page-cch-maschinen .machine-record-parts {
  display: grid;
}

body.cch-page-cch-maschinen .machine-record-parts>div {
  display: grid;
  grid-template-columns: minmax(150px,1fr) 130px auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
}

body.cch-page-cch-maschinen .machine-record-parts small {
  display: block;
}

body.cch-page-cch-maschinen .part-low,.machine-record-warning {
  font-weight: 800;
}

@media (max-width:900px) {
body.cch-page-cch-maschinen .machine-record-modal-card {
  width: calc(100vw - 12px);
  max-height: calc(100vh - 12px);
}

body.cch-page-cch-maschinen .machine-record-overview {
  grid-template-columns: 1fr;
}

body.cch-page-cch-maschinen .machine-record-qr {
  grid-template-columns: auto 1fr;
  justify-items: start;
  text-align: left;
}

body.cch-page-cch-maschinen .machine-record-qr img {
  width: 96px;
  height: 96px;
  grid-row: 1/3;
}

body.cch-page-cch-maschinen .machine-record-actions {
  position: static;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

body.cch-page-cch-maschinen .machine-record-grid {
  grid-template-columns: 1fr;
}

body.cch-page-cch-maschinen .machine-record-parts>div {
  grid-template-columns: 1fr auto;
}

body.cch-page-cch-maschinen .machine-record-parts button {
  grid-column: 1/-1;
}
}

@media (max-width: 620px) {
body.cch-page-cch-maschinen .stats {
  grid-template-columns: 1fr;
}

body.cch-page-cch-maschinen h1 {
  font-size: 32px;
}

body.cch-page-cch-maschinen .row-actions {
  min-width: 220px;
}

body.cch-page-cch-maschinen .history-row-actions {
  min-width: 140px;
}
}

@media print {
body.cch-page-cch-maschinen .module-actions-admin,
  body.cch-page-cch-maschinen .filterbar,
  body.cch-page-cch-maschinen .modal-backdrop,
  body.cch-page-cch-maschinen #cchTopnavMount {
  display: none !important;
}
}

body.cch-page-cch-maschinen .module-hero {
  min-height: 96px;
  align-items: center;
  padding: 20px 24px;
}

body.cch-page-cch-maschinen .module-kicker {
  display: block;
  margin: 0;
}

body.cch-page-cch-maschinen h1 {
  margin-top: 4px;
  font-size: clamp(30px, 3vw, 42px) !important;
}

body.cch-page-cch-maschinen .module-actions-admin {
  width: auto;
  grid-template-columns: repeat(3, auto);
}

body.cch-page-cch-maschinen .stats {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

body.cch-page-cch-maschinen .stat {
  min-height: 82px;
  padding: 13px 15px;
}

body.cch-page-cch-maschinen .stat strong {
  font-size: 24px;
}

body.cch-page-cch-maschinen .card {
  padding: 14px;
}

body.cch-page-cch-maschinen .filterbar {
  padding: 12px;
}

body.cch-page-cch-maschinen .tableWrap {
  margin-top: 12px;
}

@media (max-width: 980px) {
body.cch-page-cch-maschinen .module-actions-admin {
  grid-template-columns: 1fr;
}

body.cch-page-cch-maschinen .stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

@media (max-width: 760px) {
body.cch-page-cch-maschinen :where(#machineTable, #historyTable, #handoverHistoryTable, #partsTable) {
  min-width: 0 !important;
}
}


/* CCH V3 Maschinenakte 0.8.0: zentrale Akte + verschachtelte Modale */
body.cch-page-cch-maschinen #machineRecordModal {
  z-index: 4600;
}

body.cch-page-cch-maschinen :is(#reportModal,#handoverModal,#returnModal,#historyModal,#partsModal,#handoverHistoryModal,#machineModal) {
  z-index: 4800;
}

body.cch-page-cch-maschinen #machineDefectModal {
  z-index: 2147482500 !important;
}

body.cch-page-cch-maschinen .machine-defect-modal-card {
  width: min(820px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
}

body.cch-page-cch-maschinen .machine-record-defects {
  grid-column: 1 / -1;
}

body.cch-page-cch-maschinen .machine-record-defects > header {
  align-items: center;
  gap: 16px;
}

body.cch-page-cch-maschinen .machine-record-defects > header small,
body.cch-page-cch-maschinen .machine-defect-empty small {
  display: block;
  margin-top: 4px;
  color: var(--cch-text-muted, #9bb0c4);
}

body.cch-page-cch-maschinen .machine-defect-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

body.cch-page-cch-maschinen .machine-defect-item,
body.cch-page-cch-maschinen .machine-defect-empty {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--cch-danger, #ff6b75) 28%, var(--cch-line, #28485b));
  border-radius: 14px;
  background: color-mix(in srgb, var(--cch-danger, #ff6b75) 7%, var(--cch-surface-2, #0e2638));
}

body.cch-page-cch-maschinen .machine-defect-item.is-resolved {
  border-color: color-mix(in srgb, var(--cch-success, #54d69b) 30%, var(--cch-line, #28485b));
  background: color-mix(in srgb, var(--cch-success, #54d69b) 7%, var(--cch-surface-2, #0e2638));
}

body.cch-page-cch-maschinen .machine-defect-item header,
body.cch-page-cch-maschinen .machine-defect-item header > div,
body.cch-page-cch-maschinen .machine-defect-item footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.cch-page-cch-maschinen .machine-defect-item header {
  justify-content: space-between;
}

body.cch-page-cch-maschinen .machine-defect-item p {
  margin: 12px 0 8px;
  color: var(--cch-text, #edf7fd);
  line-height: 1.45;
}

body.cch-page-cch-maschinen .machine-defect-item > small {
  color: var(--cch-text-muted, #9bb0c4);
}

body.cch-page-cch-maschinen .machine-defect-resolution {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .18);
}

body.cch-page-cch-maschinen .machine-defect-item footer {
  justify-content: flex-end;
  margin-top: 12px;
}

body.cch-page-cch-maschinen .defect-priority-critical,
body.cch-page-cch-maschinen .defect-priority-high {
  color: #ffd7da;
  border-color: rgba(255, 107, 117, .5);
  background: rgba(169, 30, 45, .34);
}

@media (max-width: 760px) {
  body.cch-page-cch-maschinen .machine-defect-list {
    grid-template-columns: 1fr;
  }

  body.cch-page-cch-maschinen .machine-record-defects > header,
  body.cch-page-cch-maschinen .machine-defect-item header {
    align-items: stretch;
    flex-direction: column;
  }

  body.cch-page-cch-maschinen .machine-record-defects > header > button,
  body.cch-page-cch-maschinen .machine-defect-item footer > button {
    width: 100%;
  }
}

body.cch-page-cch-maschinen .machine-record-overview {
  grid-template-columns: minmax(420px, 560px) minmax(0, 1fr) 190px;
  align-items: stretch;
}

body.cch-page-cch-maschinen .machine-record-photo {
  min-height: 330px;
  max-height: 440px;
  aspect-ratio: 4 / 3;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--cch-accent, #2fc7ed) 26%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--cch-surface-2, #0e2638) 88%, transparent);
}

body.cch-page-cch-maschinen .machine-record-photo img {
  object-fit: contain;
  border-radius: 12px;
}

body.cch-page-cch-maschinen .machine-record-qr {
  align-content: center;
  padding: 16px 12px;
  border: 1px solid color-mix(in srgb, var(--cch-accent, #2fc7ed) 22%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--cch-surface-2, #0e2638) 82%, transparent);
}

body.cch-page-cch-maschinen .machine-record-qr img {
  width: 156px;
  height: 156px;
  background: #fff;
  border-radius: 12px;
}

body.cch-page-cch-maschinen .machine-record-actions {
  justify-content: flex-start;
}

@media (max-width: 1180px) {
  body.cch-page-cch-maschinen .machine-record-overview {
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  }
  body.cch-page-cch-maschinen .machine-record-qr {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
  }
  body.cch-page-cch-maschinen .machine-record-qr img {
    width: 118px;
    height: 118px;
    grid-row: 1 / 3;
  }
}

@media (max-width: 900px) {
  body.cch-page-cch-maschinen .machine-record-overview {
    grid-template-columns: 1fr;
  }
  body.cch-page-cch-maschinen .machine-record-photo {
    min-height: 260px;
    max-height: none;
  }
  body.cch-page-cch-maschinen .machine-record-qr {
    grid-column: auto;
  }
}
