
/* Lak photo preview */
.lak-upload{ display:flex; flex-direction:column; align-items:flex-start; }
.lak-upload input[type="file"]{ margin-bottom:10px; }
.lak-preview{ width:100%; margin-top:8px; display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:10px; }
.lak-preview .ph{ position:relative; border:1px solid #777; border-radius:8px; background:#2c2c34; min-height:100px; overflow:hidden; }
.lak-preview .ph img{ width:100%; height:100%; object-fit:cover; display:block; }
.lak-preview .ph .label{ position:absolute; left:6px; bottom:6px; background:#111827; font-size:12px; padding:2px 6px; border-radius:999px; opacity:.9; }
.lak-preview .ph .remove{ position:absolute; top:4px; right:4px; background:#ef4444; border:none; color:#fff; border-radius:6px; font-size:12px; padding:2px 6px; cursor:pointer; }
.lak-preview .file{ display:flex; align-items:center; justify-content:center; padding:6px; font-size:13px; }

/* === Lak vozu – HLAVIČKA AKORDEONU === */
/* Tohle zajistí, že šipka + nadpis budou vlevo. */
.lak-section .jc-acc-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
}

.lak-section .lak-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

/* Lak photo preview */
.lak-upload{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}
.lak-upload input[type="file"]{
  margin-bottom:10px;
}
.lak-preview{
  width:100%;
  margin-top:8px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
  gap:10px;
}
.lak-preview .ph{
  position:relative;
  border:1px solid #777;
  border-radius:8px;
  background:#2c2c34;
  min-height:100px;
  overflow:hidden;
}
.lak-preview .ph img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.lak-preview .ph .label{
  position:absolute;
  left:6px;
  bottom:6px;
  background:#111827;
  font-size:12px;
  padding:2px 6px;
  border-radius:999px;
  opacity:.9;
}
.lak-preview .ph .remove{
  position:absolute;
  top:4px;
  right:4px;
  background:#ef4444;
  border:none;
  color:#fff;
  border-radius:6px;
  font-size:12px;
  padding:2px 6px;
  cursor:pointer;
}
.lak-preview .file{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:6px;
  font-size:13px;
}

/* === Lak vozu inspection section === */
.lak-section .jc-acc-panel {
  padding-top: 0;
}

.lak-damage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.lak-damage-item {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) 44px;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(58, 58, 71, 0.72);
}

.lak-damage-item .lak-note {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.32);
  color: #ffffff;
  padding: 10px 12px;
  font: inherit;
}

.lak-damage-item .lak-file {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.lak-damage-item .lak-file input[type="file"] {
  max-width: 100%;
}

.lak-damage-item .lak-preview {
  display: block;
  width: 100%;
  max-width: 240px;
  margin-top: 0;
}

.lak-damage-item .lak-preview img,
.lak-damage-item .lak-preview-img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: zoom-in;
}

.lak-damage-item .lak-remove {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: #ff4d5f;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  align-self: center;
}

.lak-damage-item .lak-remove:hover {
  background: rgba(239, 68, 68, 0.22);
}

@media (max-width: 860px) {
  .lak-damage-item {
    grid-template-columns: 1fr 44px;
    grid-template-areas:
      "note remove"
      "file file";
  }

  .lak-damage-item .lak-note { grid-area: note; }
  .lak-damage-item .lak-file { grid-area: file; }
  .lak-damage-item .lak-remove { grid-area: remove; }
  .lak-damage-item .lak-preview { max-width: 220px; }
}

/* Layout container for the lak inspection: label on the left, items on the right */
.lak-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.lak-check-item {
  display: grid;
  align-items: flex-start;
  grid-template-columns: 40px 1fr minmax(200px, 1fr) minmax(160px, 220px);
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #f0f0f2;
  background-color: #3a3a47;
}

.lak-check-item .jc-state {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #f0f0f2;
  background-color: #3a3a47;
  cursor: pointer;
  transition: transform 0.05s ease;
  box-shadow: 0 0 10px rgba(2, 2, 2, 0.3);
}

.lak-check-item .jc-state:active {
  transform: scale(0.98);
}

.lak-check-item .jc-state[data-state="ok"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
}

.lak-check-item .jc-state[data-state="bad"] {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.50);
}

.lak-check-item .jc-icon {
  font-weight: 700;
}

.lak-check-item .lak-item-label {
  font-size: 0.98rem;
  padding-top: 8px;
}

.lak-check-item .lak-note {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  color: #ffffff;
}

.lak-check-item .lak-note::placeholder {
  opacity: 0.6;
  color: #aaaaaa;
}

.lak-check-item .lak-file input[type="file"] {
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
}

.lak-check-item .lak-preview {
  width: 100%;
  max-height: 80px;
  overflow: hidden;
  color: #e5e7eb;
  font-size: 13px;
}

.lak-check-item .lak-preview img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

@media (max-width: 860px) {
  .lak-check-item {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "s l"
      "s n"
      "s f";
  }

  .lak-check-item .jc-state { grid-area: s; }
  .lak-check-item .lak-item-label { grid-area: l; }
  .lak-check-item .lak-note { grid-area: n; }
  .lak-check-item .lak-file { grid-area: f; }
}

/* === Dynamic extra notes styling === */
.lak-extra {
  margin-top: 16px;
}

.lak-note-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.lak-note-item {
  display: grid;
  align-items: flex-start;
  grid-template-columns: 40px 1fr minmax(200px, 1fr) minmax(160px, 220px);
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #f0f0f2;
  background-color: #3a3a47;
}

.lak-note-item .jc-state {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 2px solid #f0f0f2;
  background-color: #3a3a47;
  cursor: pointer;
  transition: transform 0.05s ease;
  box-shadow: 0 0 10px rgba(2, 2, 2, 0.3);
}

.lak-note-item .jc-state:active {
  transform: scale(0.98);
}

.lak-note-item .jc-state[data-state="ok"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
}

.lak-note-item .jc-state[data-state="bad"] {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.50);
}

.lak-note-item .jc-icon {
  font-weight: 700;
}

.lak-note-item .note-text {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  color: #ffffff;
}

.lak-note-item .note-text::placeholder {
  opacity: 0.6;
  color: #aaaaaa;
}

.lak-note-item .note-file input[type="file"] {
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
}

.lak-note-item .note-preview {
  width: 100%;
  max-height: 80px;
  overflow: hidden;
  color: #e5e7eb;
  font-size: 13px;
}

.lak-note-item .note-preview img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.lak-note-item .note-remove {
  border: none;
  background: transparent;
  color: #ef4444;
  font-size: 22px;
  cursor: pointer;
  align-self: center;
}

@media (max-width: 860px) {
  .lak-note-item {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "s n"
      "s f"
      "s r";
  }

  .lak-note-item .jc-state { grid-area: s; }
  .lak-note-item .note-text { grid-area: n; }
  .lak-note-item .note-file { grid-area: f; }
  .lak-note-item .note-remove {
    grid-area: r;
    align-self: flex-end;
    margin-top: 4px;
  }
}

/* Add button / container styling for dynamic notes */
.lak-add-note-btn {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  padding: 20px;
  margin: 40px auto;
  max-width: 1100px;
  background-color: #3a3a47;
  border: 2px solid #f0f0f2;
  border-radius: 25px;
  box-shadow: 0 0 10px rgba(2, 2, 2, 0.3);
  color: #ffffff;
}

/* ========================================================================== 
   LAK VOZU – STRUKTUROVANÉ KARTY NÁLEZŮ
   ========================================================================== */
.lak-section .jc-acc-toggle {
  width: 100%;
}

.lak-section .lak-counters {
  margin-left: auto;
  color: #aeb5c1;
  font-size: 12px;
  white-space: nowrap;
}

.lak-section .lak-counters b {
  color: #fff;
}

.lak-section .jc-acc-panel {
  padding: 16px 0 0;
}

.lak-section .lak-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 12px;
  background: rgba(16,185,129,.07);
}

.lak-section.has-damages .lak-toolbar {
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.055);
}

.lak-section .lak-empty-state {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.lak-section .lak-empty-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #91e3bd;
  background: rgba(16,185,129,.15);
  font-weight: 800;
}

.lak-section .lak-empty-state b,
.lak-section .lak-empty-state small {
  display: block;
}

.lak-section .lak-empty-state b {
  font-size: 13px;
  color: #dce3ea;
}

.lak-section .lak-empty-state small {
  margin-top: 3px;
  color: #8d97a5;
  font-size: 11px;
}

.lak-section.has-damages .lak-empty-icon {
  color: #f4c15d;
  background: rgba(245,158,11,.14);
}

.lak-section.has-damages .lak-empty-icon::before {
  content: '!';
}

.lak-section.has-damages .lak-empty-icon {
  font-size: 0;
}

.lak-section.has-damages .lak-empty-icon::before {
  font-size: 15px;
}

.lak-section.has-damages .lak-empty-state b {
  font-size: 0;
}

.lak-section.has-damages .lak-empty-state b::after {
  content: 'Zaznamenaná poškození laku';
  font-size: 13px;
}

.lak-section .lak-add-btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #4591d5;
  border-radius: 10px;
  background: rgba(69,145,213,.13);
  color: #dceeff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.lak-section .lak-add-btn:hover {
  background: rgba(69,145,213,.22);
}

.lak-section .lak-damage-list {
  display: grid;
  gap: 10px;
}

.lak-section .lak-damage-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 36px;
  align-items: center;
  gap: 16px;
  min-height: 152px;
  padding: 15px;
  margin: 0;
  border: 1px solid rgba(245,158,11,.32);
  border-left: 3px solid #e5a62c;
  border-radius: 13px;
  background: #343441;
}

.lak-section .lak-damage-item[data-severity="severe"] {
  border-color: rgba(239,68,68,.42);
  border-left-color: #ef5b57;
}

.lak-section .lak-damage-content {
  min-width: 0;
}

.lak-section .lak-damage-fields {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.lak-section .lak-damage-fields select,
.lak-section .lak-note {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  background: #222229;
  color: #eef2f6;
  font: inherit;
  outline: none;
}

.lak-section .lak-damage-fields select {
  height: 42px;
  padding: 0 10px;
  font-size: 12px;
}

.lak-section .lak-damage-fields select:focus,
.lak-section .lak-note:focus {
  border-color: #4591d5;
  box-shadow: 0 0 0 2px rgba(69,145,213,.12);
}

.lak-section .lak-note {
  min-height: 64px;
  max-height: 130px;
  padding: 10px 12px;
  resize: vertical;
  font-size: 13px;
}

.lak-section .lak-file {
  position: relative;
  width: 180px;
  height: 120px;
  min-width: 180px;
  display: block;
}

.lak-section .lak-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
}

.lak-section .lak-file-button {
  width: 180px;
  height: 120px;
  display: grid;
  place-content: center;
  gap: 7px;
  border: 1px dashed rgba(255,255,255,.28);
  border-radius: 11px;
  background: #292933;
  color: #aeb8c5;
  cursor: pointer;
}

.lak-section .lak-file-button span {
  font-size: 22px;
}

.lak-section .lak-file-button b {
  font-size: 11px;
}

.lak-section .lak-file-button:hover {
  border-color: #4591d5;
  color: #fff;
}

.lak-section .lak-file.has-preview .lak-file-button {
  display: none;
}

.lak-section .lak-preview,
.lak-section .lak-photo-card,
.lak-section .lak-preview-img {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  height: 120px;
  min-height: 120px;
  max-height: 120px;
  margin: 0;
}

.lak-section .lak-preview {
  display: block;
  overflow: visible;
}

.lak-section .lak-photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 11px;
  background: #202027;
}

.lak-section .lak-preview-img {
  display: block;
  object-fit: cover;
  border: 0;
  border-radius: 10px;
  cursor: zoom-in;
}

.lak-section .lak-photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20,20,25,.82);
  color: #fff;
  font-size: 16px;
  line-height: 23px;
  cursor: pointer;
}

.lak-section .lak-remove {
  width: 34px;
  height: 34px;
  align-self: center;
  padding: 0;
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 9px;
  background: rgba(239,68,68,.08);
  color: #ff7771;
  font-size: 21px;
  line-height: 32px;
}

@media (max-width: 1000px) {
  .lak-section .lak-damage-fields {
    grid-template-columns: 1fr 1fr;
  }

  .lak-section .lak-severity {
    grid-column: 1 / 3;
  }
}

@media (max-width: 720px) {
  .lak-section .lak-counters {
    font-size: 10px;
  }

  .lak-section .lak-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lak-section .lak-add-btn {
    width: 100%;
  }

  .lak-section .lak-damage-item {
    grid-template-columns: minmax(0, 1fr) 36px;
    grid-template-areas:
      "content remove"
      "file file";
  }

  .lak-section .lak-damage-content { grid-area: content; }
  .lak-section .lak-file { grid-area: file; }
  .lak-section .lak-remove { grid-area: remove; align-self: start; }
  .lak-section .lak-damage-fields { grid-template-columns: 1fr; }
  .lak-section .lak-severity { grid-column: auto; }
}
