/* ==========================================================================
   SEKCE DOKUMENTY (Sjednoceno do luxusního 1-ŘÁDKOVÉHO GRIDU)
   ========================================================================== */

/* 1. HLAVNÍ LAYOUT */
#sekce-dokumenty .jc-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

#sekce-dokumenty .jc-item {
  display: grid !important;
  align-items: start !important; /* OPRAVA: Vše visí nahoře, nesjíždí na střed! */
  /* Definice 4 sloupců: Stav (40px) | Text (320px) | Poznámka (flex) | Soubor (220px) */
  grid-template-columns: 40px 320px minmax(0, 1fr) 220px !important;
  grid-template-areas: "state label note file" !important;
  gap: 16px !important;
  padding: 20px 16px !important; 
  min-height: 80px !important; 
  margin-bottom: 12px !important;
  border-radius: 12px !important;
  border: 2px solid #f0f0f2 !important;
  background-color: #3a3a47 !important;
}

#sekce-dokumenty .jc-state {
  grid-area: state !important; /* OPRAVA: Pevné jméno zamezí skákání */
  justify-self: center !important;
  margin-top: 6px !important; /* OPRAVA: Srovnání kolečka s textem vpravo */
}

#sekce-dokumenty .extra-note-text {
  grid-area: note !important;
}

#sekce-dokumenty .pneu-file {
  grid-area: file !important;
  width: 220px !important;
}

#sekce-dokumenty .jc-label {
  grid-area: label !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  margin: 0 !important;
  align-self: start !important; /* OPRAVA: Nadpis drží nahoře s kolečkem */
  padding-top: 6px !important; /* Srovnání nadpisu s kolečkem */
}

/* STAVOVÉ KOLEČKO (Obrana proti vajíčku) */
#sekce-dokumenty .jc-state {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  flex-shrink: 0 !important;
  border-radius: 50% !important;
  border: 2px solid #f0f0f2 !important;
  background-color: #3a3a47 !important;
  cursor: pointer !important;
  display: grid !important;
  place-items: center !important;
  transition: transform 0.1s ease !important;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3) !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  font-size: 0 !important; /* Pojistka proti textu */
}

#sekce-dokumenty .jc-state:active {
  transform: scale(0.9) !important;
}

#sekce-dokumenty .jc-state::before {
  content: '•' !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: bold !important;
}

#sekce-dokumenty .jc-state[data-state="ok"] {
  background-color: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}

#sekce-dokumenty .jc-state[data-state="ok"]::before {
  content: '✔' !important;
}

#sekce-dokumenty .jc-state[data-state="bad"],
#sekce-dokumenty .jc-state[data-state="warn"] {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

#sekce-dokumenty .jc-state[data-state="bad"]::before,
#sekce-dokumenty .jc-state[data-state="warn"]::before {
  content: '!' !important;
}

/* POZNÁMKY */
#sekce-dokumenty .extra-note-text {
  display: block !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;
  border-radius: 10px !important;
  border: 2px solid #777 !important;
  background-color: #1e1e24 !important;
  padding: 10px 12px !important;
  height: 48px !important;
  color: #fff !important;
  box-sizing: border-box !important;
  font-size: 15px !important;
  margin: 0 !important;
}

#sekce-dokumenty .extra-note-text::placeholder {
  color: rgba(255,255,255,.55) !important;
}

/* INPUT SOUBORU */
#sekce-dokumenty .pneu-file {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  position: relative !important;
  margin: 0 !important;
}

#sekce-dokumenty .pneu-file input[type="file"] {
  width: 100% !important;
  margin: 0 !important;
  font-size: 13px !important;
  color: #dddddd !important;
  cursor: pointer !important;
}

/* NÁHLEDY FOTEK (Oprava velikosti sjednocená s Motor) */
#sekce-dokumenty .pneu-preview,
#sekce-dokumenty .note-preview,
#sekce-dokumenty .td-note-preview {
  width: 220px !important;
  margin-top: 6px !important;
  display: block !important;
}

#sekce-dokumenty .ph.ph-testdrive {
  position: relative !important;
  width: 220px !important;
  height: 160px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  background: rgba(255,255,255,.04) !important;
  display: block !important;
}

#sekce-dokumenty .ph.ph-testdrive img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  cursor: zoom-in !important;
  transition: transform 0.3s ease !important;
}

#sekce-dokumenty .ph.ph-testdrive:hover img {
  transform: scale(1.05) !important;
}

/* Tlačítko odstranit */
#sekce-dokumenty .ph.ph-testdrive .photo-remove {
  position: absolute !important;
  top: 6px !important;
  right: 6px !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 6px 8px !important;
  background: rgba(0, 0, 0, 0.55) !important;
  color: #fff !important;
  font-size: 14px !important;
  z-index: 10 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#sekce-dokumenty .ph.ph-testdrive .photo-remove:hover {
  background: rgba(220, 38, 38, 1) !important;
}

/* =========================================================
   DYNAMICKÉ ŘÁDKY (Přidané poznámky - OPRAVA)
   ========================================================= */
#sekce-dokumenty .td-note-item {
  display: grid !important;
  align-items: start !important; /* OPRAVA: I tady vše visí hezky nahoře */
  /* Pouze 4 sloupce (bez labelu): Stav | Poznámka | Soubor | Křížek */
  grid-template-columns: 40px minmax(0, 1fr) 220px 40px !important;
  grid-template-areas: "state note file remove" !important;
  gap: 16px !important;
  padding: 20px 16px !important; 
  min-height: 80px !important; 
  margin-bottom: 12px !important;
  border-radius: 12px !important;
  border: 2px solid #f0f0f2 !important;
  background-color: #3a3a47 !important;
}

#sekce-dokumenty .td-note-item .jc-state {
  grid-area: state !important;
  justify-self: center !important;
  margin-top: 6px !important; /* OPRAVA: Srovnání kolečka s inputem */
}

/* Neprůstřelné zacílení na poznámku */
#sekce-dokumenty .td-note-item input[type="text"],
#sekce-dokumenty .td-note-item .note-text,
#sekce-dokumenty .td-note-item .extra-note-text {
  grid-area: note !important;
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  background-color: #1e1e24 !important;
  border: 2px solid #777 !important;
  border-radius: 10px !important;
  color: #fff !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

#sekce-dokumenty .td-note-item input[type="text"]::placeholder {
  color: rgba(255,255,255,.55) !important;
}

/* Neprůstřelné zacílení na Obal souboru (vezme jakýkoliv div, co JS vytvoří) */
#sekce-dokumenty .td-note-item > div {
  grid-area: file !important;
  width: 220px !important;
  margin: 0 !important;
}

#sekce-dokumenty .td-note-item .note-remove {
  grid-area: remove !important; /* OPRAVA: Drží se ve svém sloupci */
  align-self: end !important; /* OPRAVA: Sjíždí úplně dolů (jak jsi chtěl na desktopu) */
  background: transparent !important;
  border: none !important;
  color: #ef4444 !important;
  font-size: 24px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  justify-self: center !important;
  padding: 0 !important;
  margin-bottom: 8px !important;
}

#sekce-dokumenty .td-note-item .note-remove:hover {
  color: #ff6b6b !important;
}

/* =========================================================
   DOKUMENTY – OVERLAY (fullscreen foto z původního kódu)
   ========================================================= */
.doc-image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-image-overlay .overlay-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 34px;
  height: 34px;
  line-height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(185, 28, 28, 0.95);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  z-index: 10001;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.doc-image-overlay .overlay-close:hover {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.08);
}

.doc-image-overlay img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 12px;
  cursor: zoom-out;
}

/* =========================================================
   MOBIL
   ========================================================= */
@media (max-width: 900px) {
  #sekce-dokumenty .jc-item {
    grid-template-areas:
      "state label"
      "state note"
      "state file" !important;
    grid-template-columns: 40px 1fr !important;
    row-gap: 8px !important;
    min-height: auto !important;
    padding: 16px !important;
  }
  
  #sekce-dokumenty .td-note-item {
    grid-template-areas:
      "state remove"
      "note note"
      "file file" !important;
    grid-template-columns: 40px 1fr !important;
    row-gap: 8px !important;
    min-height: auto !important;
    padding: 16px !important;
  }
  
  #sekce-dokumenty .pneu-file,
  #sekce-dokumenty .pneu-preview,
  #sekce-dokumenty .note-preview,
  #sekce-dokumenty .td-note-preview,
  #sekce-dokumenty .td-note-item > div {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* OPRAVA: Pevná velikost i na mobilu, aby fotka nerostla jako guma */
  #sekce-dokumenty .ph.ph-testdrive {
    width: 220px !important;
    height: 160px !important; 
    max-width: 100% !important;
  }

  /* OPRAVA: Vrácení křížku hezky nahoru vedle kolečka v mobilní verzi */
  #sekce-dokumenty .td-note-item .note-remove {
    align-self: start !important;
    justify-self: end !important;
    margin-top: 4px !important;
    margin-bottom: 0 !important;
  }
}

/* Finální zarovnání a orientační hlavička sloupců */
#sekce-dokumenty .jc-acc-panel { padding-top:12px !important; }

#sekce-dokumenty .documents-column-head {
  display:grid;
  grid-template-columns:minmax(180px,260px) 152px minmax(240px,1fr) 48px;
  gap:14px;
  align-items:center;
  margin:0 0 6px;
  padding:0 14px;
  color:#8f98a8;
  font-size:10px;
  font-weight:800;
  letter-spacing:.08em;
  line-height:1;
  text-transform:uppercase;
  box-sizing:border-box;
}

#sekce-dokumenty .documents-column-head span:nth-child(4) { text-align:center; }

#sekce-dokumenty .jc-checklist { gap:6px !important; }

#sekce-dokumenty .jc-checklist>.jc-item {
  grid-template-columns:minmax(180px,260px) 152px minmax(240px,1fr) 48px !important;
  align-items:center !important;
  height:76px !important;
  min-height:76px !important;
  padding:8px 14px !important;
  gap:14px !important;
  border-color:rgba(255,255,255,.13) !important;
  border-radius:10px !important;
  box-sizing:border-box !important;
}

#sekce-dokumenty .jc-checklist>.jc-item.has-photo {
  grid-template-columns:minmax(180px,260px) 152px minmax(240px,1fr) 150px !important;
  height:118px !important;
  min-height:118px !important;
}

#sekce-dokumenty .jc-label {
  display:flex !important;
  align-items:center !important;
  min-height:40px !important;
  padding:0 4px !important;
  font-size:14px !important;
  font-weight:650 !important;
}

#sekce-dokumenty .jc-state {
  align-self:center !important;
  height:42px !important;
  min-height:42px !important;
  padding:0 13px !important;
  gap:9px !important;
}

#sekce-dokumenty .jc-state::before {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  flex:0 0 14px !important;
  line-height:1 !important;
}

#sekce-dokumenty .jc-state::after { line-height:1 !important; }

#sekce-dokumenty .extra-note-text {
  align-self:center !important;
  height:44px !important;
  padding:0 14px !important;
  font-size:14px !important;
}

#sekce-dokumenty .td-note-item {
  min-height:76px !important;
  padding:8px 14px !important;
  border-radius:10px !important;
  box-sizing:border-box !important;
}

@media (max-width:1050px) and (min-width:761px) {
  #sekce-dokumenty .documents-column-head,
  #sekce-dokumenty .jc-checklist>.jc-item {
    grid-template-columns:minmax(160px,220px) 152px minmax(180px,1fr) 48px !important;
  }
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo {
    grid-template-columns:minmax(160px,220px) 152px minmax(180px,1fr) 150px !important;
  }
}

@media (max-width:760px) {
  #sekce-dokumenty .documents-column-head { display:none !important; }
  #sekce-dokumenty .jc-acc-panel { padding-top:8px !important; }
  #sekce-dokumenty .jc-checklist>.jc-item,
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo {
    height:auto !important;
    min-height:auto !important;
    padding:13px !important;
  }
}

/* Čistá finální varianta: bez tabulkové hlavičky a bez stísněných řádků. */
#sekce-dokumenty .documents-column-head { display:none !important; }
#sekce-dokumenty .jc-acc-panel { padding-top:12px !important; }
#sekce-dokumenty .jc-checklist { gap:8px !important; }
#sekce-dokumenty .jc-checklist>.jc-item {
  height:82px !important;
  min-height:82px !important;
  padding:10px 14px !important;
  border-color:rgba(255,255,255,.16) !important;
  border-radius:12px !important;
  background:#343441 !important;
  transform:none !important;
}
#sekce-dokumenty .jc-checklist>.jc-item:hover {
  border-color:rgba(255,255,255,.22) !important;
  background:#363643 !important;
}
#sekce-dokumenty .jc-checklist>.jc-item.has-photo {
  height:118px !important;
  min-height:118px !important;
}
#sekce-dokumenty .jc-state[data-state="none"]::before {
  content:'' !important;
  display:block !important;
  width:10px !important;
  min-width:10px !important;
  max-width:10px !important;
  height:10px !important;
  min-height:10px !important;
  max-height:10px !important;
  flex:0 0 10px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:50% !important;
  background:#929aa8 !important;
  box-shadow:none !important;
  box-sizing:border-box !important;
}

@media (max-width:760px) {
  #sekce-dokumenty .jc-acc-panel { padding-top:8px !important; }
  #sekce-dokumenty .jc-checklist>.jc-item,
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo {
    height:auto !important;
    min-height:auto !important;
  }
}

/* ==========================================================================
   KOMPAKTNI HYBRIDNI VARIANTA
   Zachovava tmavy vzhled a puvodni logiku, ale sklada kontrolu do jednoho
   citelneho radku: nazev | stav | poznamka | fotografie.
   ========================================================================== */

#sekce-dokumenty .jc-checklist {
  gap: 8px !important;
}

#sekce-dokumenty .jc-item {
  grid-template-columns: minmax(180px, 260px) 152px minmax(240px, 1fr) 48px !important;
  grid-template-areas: "label state note file" !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 64px !important;
  padding: 10px 14px !important;
  margin-bottom: 0 !important;
  border: 1px solid rgba(255,255,255,.16) !important;
  border-radius: 12px !important;
  background: #343441 !important;
  transition: border-color .18s ease, background-color .18s ease !important;
}

#sekce-dokumenty .jc-item:focus-within {
  border-color: rgba(69, 145, 213, .75) !important;
  background: #373744 !important;
}

#sekce-dokumenty .jc-label {
  align-self: center !important;
  padding: 0 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

/* Puvodni kolecko je nyni citelny stavovy ovladac. Klikani dal cykluje stavy. */
#sekce-dokumenty .jc-state {
  justify-self: stretch !important;
  width: 152px !important;
  min-width: 152px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  border-radius: 10px !important;
  background: #282832 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  box-shadow: none !important;
  font-size: 12px !important;
  color: #c7ccd5 !important;
}

#sekce-dokumenty .jc-state:hover {
  border-color: rgba(255,255,255,.42) !important;
}

#sekce-dokumenty .jc-state::before {
  content: '' !important;
  width: 8px !important;
  height: 8px !important;
  flex: 0 0 8px !important;
  border-radius: 50% !important;
  background: #8f96a3 !important;
}

#sekce-dokumenty .jc-state::after {
  content: 'Nezkontrolováno' !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
}

#sekce-dokumenty .jc-state[data-state="ok"] {
  color: #8be0bb !important;
  border-color: rgba(16,185,129,.42) !important;
  background: rgba(16,185,129,.11) !important;
}

#sekce-dokumenty .jc-state[data-state="ok"]::before {
  content: '' !important;
  background: #32c98a !important;
  box-shadow: 0 0 0 3px rgba(50,201,138,.13) !important;
}

#sekce-dokumenty .jc-state[data-state="ok"]::after {
  content: 'V pořádku' !important;
}

#sekce-dokumenty .jc-state[data-state="warn"] {
  color: #f5ca72 !important;
  border-color: rgba(245,158,11,.48) !important;
  background: rgba(245,158,11,.11) !important;
}

#sekce-dokumenty .jc-state[data-state="warn"]::before {
  content: '' !important;
  background: #f2ad32 !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,.14) !important;
}

#sekce-dokumenty .jc-state[data-state="warn"]::after {
  content: 'S výhradou' !important;
}

#sekce-dokumenty .jc-state[data-state="bad"] {
  color: #ffaaa6 !important;
  border-color: rgba(239,68,68,.45) !important;
  background: rgba(239,68,68,.11) !important;
}

#sekce-dokumenty .jc-state[data-state="bad"]::before {
  content: '' !important;
  background: #ef5b57 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.13) !important;
}

#sekce-dokumenty .jc-state[data-state="bad"]::after {
  content: 'Závada' !important;
}

#sekce-dokumenty .extra-note-text {
  height: 40px !important;
  min-width: 0 !important;
  padding: 8px 12px !important;
  border: 1px solid rgba(255,255,255,.2) !important;
  border-radius: 10px !important;
  background: #222229 !important;
  font-size: 13px !important;
}

#sekce-dokumenty .extra-note-text:focus {
  border-color: #4591d5 !important;
  outline: 2px solid rgba(69,145,213,.14) !important;
}

/* Vlastni tlacitko fotografie misto systemoveho "Vybrat soubor". */
#sekce-dokumenty .pneu-file {
  width: 48px !important;
  min-width: 48px !important;
  display: grid !important;
  place-items: center !important;
  gap: 0 !important;
}

#sekce-dokumenty .td-note-item > .pneu-file {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  margin: 0 !important;
}

#sekce-dokumenty .pneu-file > input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

#sekce-dokumenty .jc-photo-trigger {
  width: 44px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  background: #292933;
  color: #b8c0cd;
  cursor: pointer;
  font-size: 17px;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

#sekce-dokumenty .jc-photo-trigger:hover {
  color: #fff;
  border-color: #4591d5;
  background: #303846;
}

#sekce-dokumenty .jc-photo-trigger.has-file {
  color: #8be0bb;
  border-color: rgba(16,185,129,.55);
  background: rgba(16,185,129,.12);
}

#sekce-dokumenty .pneu-preview,
#sekce-dokumenty .note-preview,
#sekce-dokumenty .td-note-preview {
  position: absolute !important;
  inset: 0 !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 9px !important;
  display: block !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

#sekce-dokumenty .pneu-preview > .ph.ph-dokumenty,
#sekce-dokumenty .note-preview > .ph.ph-dokumenty,
#sekce-dokumenty .td-note-preview > .ph.ph-dokumenty,
#sekce-dokumenty .pneu-preview > .photo-thumb,
#sekce-dokumenty .note-preview > .photo-thumb,
#sekce-dokumenty .td-note-preview > .photo-thumb {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  border-radius: 9px !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#sekce-dokumenty .pneu-preview img,
#sekce-dokumenty .note-preview img,
#sekce-dokumenty .td-note-preview img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  max-width: 44px !important;
  max-height: 40px !important;
  margin: 0 !important;
  transform: none !important;
  pointer-events: auto !important;
}

#sekce-dokumenty .pneu-preview .ph:hover img,
#sekce-dokumenty .note-preview .ph:hover img,
#sekce-dokumenty .td-note-preview .ph:hover img {
  transform: none !important;
}

#sekce-dokumenty .pneu-preview .photo-remove,
#sekce-dokumenty .note-preview .photo-remove,
#sekce-dokumenty .td-note-preview .photo-remove {
  top: 2px !important;
  right: 2px !important;
  width: 15px !important;
  min-width: 15px !important;
  max-width: 15px !important;
  height: 15px !important;
  min-height: 15px !important;
  max-height: 15px !important;
  padding: 0 !important;
  font-size: 9px !important;
  line-height: 15px !important;
  pointer-events: auto !important;
}

#sekce-dokumenty .td-note-item {
  grid-template-columns: 152px minmax(240px, 1fr) 48px 36px !important;
  grid-template-areas: "state note file remove" !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 64px !important;
  padding: 10px 14px !important;
  margin-bottom: 8px !important;
  border: 1px solid rgba(255,255,255,.16) !important;
}

#sekce-dokumenty .td-note-item .note-remove {
  align-self: center !important;
  margin: 0 !important;
  font-size: 18px !important;
}

@media (max-width: 1050px) {
  #sekce-dokumenty .jc-item {
    grid-template-columns: minmax(160px, 220px) 152px minmax(180px, 1fr) 48px !important;
  }
}

#sekce-dokumenty .jc-state[data-state="ok"]::before { content:'✓' !important; width:14px !important; background:transparent !important; box-shadow:none !important; color:#34d399 !important; font-size:17px !important; }
#sekce-dokumenty .jc-state[data-state="warn"]::before { content:'!' !important; width:14px !important; background:transparent !important; box-shadow:none !important; color:#fbbf24 !important; font-size:16px !important; }
#sekce-dokumenty .jc-state[data-state="bad"]::before { content:'×' !important; width:14px !important; background:transparent !important; box-shadow:none !important; color:#fb7185 !important; font-size:20px !important; }

@media (max-width: 760px) {
  #sekce-dokumenty .jc-item {
    grid-template-columns: minmax(0, 1fr) 48px !important;
    grid-template-areas:
      "label file"
      "state state"
      "note note" !important;
    gap: 9px 12px !important;
    padding: 13px !important;
  }

  #sekce-dokumenty .jc-state {
    width: 100% !important;
    min-width: 0 !important;
  }

  #sekce-dokumenty .pneu-file {
    justify-self: end !important;
  }

  #sekce-dokumenty .td-note-item {
    grid-template-columns: minmax(0, 1fr) 48px 36px !important;
    grid-template-areas:
      "state file remove"
      "note note note" !important;
  }
}

/* Sekundární akce sjednocená s Karoserií. */
#sekce-dokumenty .documents-add-point-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 210px !important;
  margin: 12px 0 0 !important;
  padding: 11px 16px !important;
  border: 1px solid #4591d5 !important;
  border-radius: 10px !important;
  background: rgba(69,145,213,.13) !important;
  color: #e2f1ff !important;
  font-size: 12px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

#sekce-dokumenty .documents-add-point-btn:hover {
  background: rgba(69,145,213,.23) !important;
  border-color: #66a9e5 !important;
}

/* Vetsi nahled fotografie: tlacitko zustava male, samotna fotografie se po
   nahrani zobrazi jako citelny nahled a radek se ji prizpusobi. */
#sekce-dokumenty .jc-item.has-photo {
  grid-template-columns: minmax(180px, 260px) 152px minmax(240px, 1fr) 150px !important;
  min-height: 118px !important;
}

#sekce-dokumenty .td-note-item.has-photo {
  grid-template-columns: 152px minmax(240px, 1fr) 150px 36px !important;
  min-height: 118px !important;
}

#sekce-dokumenty .pneu-file.has-preview,
#sekce-dokumenty .td-note-item > .pneu-file.has-preview {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
  display: block !important;
  overflow: visible !important;
}

#sekce-dokumenty .pneu-file.has-preview > .jc-photo-trigger {
  display: none !important;
}

#sekce-dokumenty .pneu-file.has-preview > .pneu-preview,
#sekce-dokumenty .pneu-file.has-preview > .note-preview,
#sekce-dokumenty .pneu-file.has-preview > .td-note-preview {
  position: relative !important;
  inset: auto !important;
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  display: block !important;
}

#sekce-dokumenty .pneu-file.has-preview .ph.ph-dokumenty,
#sekce-dokumenty .pneu-file.has-preview .photo-thumb {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
  margin: 0 !important;
  border-radius: 10px !important;
}

#sekce-dokumenty .pneu-file.has-preview img {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
  object-fit: cover !important;
}

#sekce-dokumenty .pneu-file.has-preview .photo-remove {
  top: 6px !important;
  right: 6px !important;
  width: 22px !important;
  min-width: 22px !important;
  max-width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  font-size: 12px !important;
  line-height: 22px !important;
}

@media (max-width: 1050px) and (min-width: 761px) {
  #sekce-dokumenty .jc-item.has-photo {
    grid-template-columns: minmax(160px, 220px) 152px minmax(180px, 1fr) 150px !important;
  }
}

@media (max-width: 760px) {
  #sekce-dokumenty .jc-item.has-photo {
    grid-template-columns: minmax(0, 1fr) 150px !important;
    grid-template-areas:
      "label file"
      "state state"
      "note note" !important;
  }

  #sekce-dokumenty .td-note-item.has-photo {
    grid-template-columns: minmax(0, 1fr) 150px 36px !important;
  }
}

/* Přidaný vlastní bod – definitivní sjednocení s Karoserií. */
#sekce-dokumenty .td-note-item .note-remove {
  grid-area: remove !important;
  align-self: center !important;
  justify-self: center !important;
  display: grid !important;
  place-items: center !important;
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(239,68,68,.35) !important;
  border-radius: 9px !important;
  background: rgba(239,68,68,.08) !important;
  color: #ff7771 !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

#sekce-dokumenty .td-note-item .note-remove:hover {
  border-color: rgba(239,68,68,.65) !important;
  background: rgba(239,68,68,.17) !important;
}

@media (max-width: 760px) {
  #sekce-dokumenty .td-note-item,
  #sekce-dokumenty .td-note-item.has-photo {
    grid-template-columns: minmax(0, 1fr) var(--documents-extra-photo, 48px) 36px !important;
    grid-template-areas:
      "state file remove"
      "note note note" !important;
    align-items: center !important;
    gap: 9px 12px !important;
    min-height: auto !important;
    padding: 13px !important;
  }

  #sekce-dokumenty .td-note-item.has-photo {
    --documents-extra-photo: 150px;
  }

  #sekce-dokumenty .td-note-item .jc-state {
    grid-area: state !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  #sekce-dokumenty .td-note-item input[type="text"] {
    grid-area: note !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #sekce-dokumenty .td-note-item > .pneu-file {
    grid-area: file !important;
    justify-self: end !important;
  }

  #sekce-dokumenty .td-note-item .note-remove {
    grid-area: remove !important;
    align-self: center !important;
    justify-self: center !important;
  }
}

/* Definitivní zámek kompaktního rozložení – musí zůstat na konci souboru. */
#sekce-dokumenty .jc-checklist { gap:6px !important; }
#sekce-dokumenty .jc-checklist>.jc-item {
  grid-template-columns:minmax(180px,260px) 152px minmax(240px,1fr) 48px !important;
  grid-template-areas:"label state note file" !important;
  align-items:center !important;
  height:76px !important;
  min-height:76px !important;
  padding:8px 14px !important;
  gap:14px !important;
  border-color:rgba(255,255,255,.13) !important;
  border-radius:10px !important;
  box-sizing:border-box !important;
}
#sekce-dokumenty .jc-checklist>.jc-item.has-photo {
  grid-template-columns:minmax(180px,260px) 152px minmax(240px,1fr) 150px !important;
  height:118px !important;
  min-height:118px !important;
}
#sekce-dokumenty .jc-label { align-self:center !important; min-height:40px !important; padding:0 4px !important; font-size:14px !important; font-weight:650 !important; }
#sekce-dokumenty .jc-state { align-self:center !important; height:42px !important; min-height:42px !important; margin:0 !important; padding:0 13px !important; gap:9px !important; }
#sekce-dokumenty .jc-state::before { display:inline-flex !important; align-items:center !important; justify-content:center !important; flex:0 0 14px !important; line-height:1 !important; }
#sekce-dokumenty .jc-state::after { line-height:1 !important; }
#sekce-dokumenty .extra-note-text { align-self:center !important; height:44px !important; padding:0 14px !important; font-size:14px !important; }
#sekce-dokumenty .td-note-item { min-height:76px !important; padding:8px 14px !important; border-radius:10px !important; box-sizing:border-box !important; }

@media (max-width:1050px) and (min-width:761px) {
  #sekce-dokumenty .jc-checklist>.jc-item { grid-template-columns:minmax(160px,220px) 152px minmax(180px,1fr) 48px !important; }
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo { grid-template-columns:minmax(160px,220px) 152px minmax(180px,1fr) 150px !important; }
}

@media (max-width:760px) {
  #sekce-dokumenty .jc-checklist>.jc-item,
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo {
    grid-template-columns:minmax(0,1fr) var(--documents-final-photo,48px) !important;
    grid-template-areas:"label file" "state state" "note note" !important;
    height:auto !important;
    min-height:auto !important;
    padding:13px !important;
  }
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo { --documents-final-photo:150px; }
}

/* Vizuální dotažení seznamu dokumentů */
#sekce-dokumenty .jc-acc-panel { padding-top:8px !important; }
#sekce-dokumenty .documents-column-head {
  min-height:32px;
  margin:0 0 4px;
  padding:0 14px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(255,255,255,.025);
  color:#9da7b8;
  box-sizing:border-box;
}
#sekce-dokumenty .jc-checklist { gap:4px !important; }
#sekce-dokumenty .jc-checklist>.jc-item {
  height:68px !important;
  min-height:68px !important;
  padding:7px 14px !important;
  background:#32323e !important;
  transition:border-color .16s ease, background-color .16s ease, transform .16s ease !important;
}
#sekce-dokumenty .jc-checklist>.jc-item:hover {
  border-color:rgba(69,145,213,.42) !important;
  background:#353542 !important;
}
#sekce-dokumenty .jc-checklist>.jc-item.has-photo {
  height:112px !important;
  min-height:112px !important;
}
#sekce-dokumenty .jc-label { min-height:38px !important; }
#sekce-dokumenty .jc-state { height:40px !important; min-height:40px !important; }
#sekce-dokumenty .extra-note-text { height:42px !important; }

@media (max-width:760px) {
  #sekce-dokumenty .documents-column-head { display:none !important; }
  #sekce-dokumenty .jc-checklist>.jc-item,
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo {
    height:auto !important;
    min-height:auto !important;
  }
}

/* Výsledná varianta – tento blok musí být poslední. */
#sekce-dokumenty .documents-column-head { display:none !important; }
#sekce-dokumenty .jc-acc-panel { padding-top:12px !important; }
#sekce-dokumenty .jc-checklist { gap:8px !important; }
#sekce-dokumenty .jc-checklist>.jc-item {
  height:82px !important;
  min-height:82px !important;
  padding:10px 14px !important;
  border-color:rgba(255,255,255,.16) !important;
  border-radius:12px !important;
  background:#343441 !important;
  transform:none !important;
}
#sekce-dokumenty .jc-checklist>.jc-item:hover { border-color:rgba(255,255,255,.22) !important; background:#363643 !important; }
#sekce-dokumenty .jc-checklist>.jc-item.has-photo { height:118px !important; min-height:118px !important; }
#sekce-dokumenty .jc-state[data-state="none"]::before {
  content:'' !important;
  display:block !important;
  width:10px !important;
  min-width:10px !important;
  max-width:10px !important;
  height:10px !important;
  min-height:10px !important;
  max-height:10px !important;
  flex:0 0 10px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:50% !important;
  background:#929aa8 !important;
  box-shadow:none !important;
  box-sizing:border-box !important;
}
@media (max-width:760px) {
  #sekce-dokumenty .jc-acc-panel { padding-top:8px !important; }
  #sekce-dokumenty .jc-checklist>.jc-item,
  #sekce-dokumenty .jc-checklist>.jc-item.has-photo { height:auto !important; min-height:auto !important; }
}
