/* Sprint 11 - XML index konfiguráció */
.xml-index-form-grid {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(300px, 2fr);
}
.xml-index-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 14px;
  margin-top: 14px;
  min-height: 420px;
}
.xml-index-tree-panel,
.xml-index-summary-panel {
  border: 1px solid var(--border-color, #d8e3f3);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  min-width: 0;
}
.xml-index-panel-title {
  padding: 12px 14px;
  font-weight: 800;
  color: #0f2d55;
  background: #eef5ff;
  border-bottom: 1px solid #d8e3f3;
}
.xml-index-tree,
.xml-index-summary {
  padding: 12px;
  max-height: 520px;
  overflow: auto;
}
.xml-index-chain {
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #f9fbff;
}
.xml-index-chain summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 700;
}
.xml-index-chain-name {
  color: #0b5cad;
  white-space: nowrap;
}
.xml-index-chain-label {
  color: #10233f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xml-index-field-count {
  margin-left: auto;
  color: #5b6f8c;
  font-size: 12px;
  font-weight: 600;
}
.xml-index-fields {
  border-top: 1px solid #d8e3f3;
  background: #fff;
}
.xml-index-field-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto 150px;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #edf2f8;
}
.xml-index-field-row:last-child { border-bottom: 0; }
.xml-index-field-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.xml-index-field-main strong,
.xml-index-field-main span,
.xml-index-field-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xml-index-field-main span,
.xml-index-field-main small {
  color: #617089;
  font-size: 12px;
}
.xml-index-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #233a5c;
  white-space: nowrap;
}
.xml-index-match {
  min-width: 140px;
}
.xml-index-summary-row {
  padding: 10px 0;
  border-bottom: 1px solid #edf2f8;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.xml-index-summary-row strong {
  color: #10233f;
}
.xml-index-summary-row span,
.xml-index-summary-row small {
  color: #617089;
  font-size: 12px;
}

.xml-index-node {
  border: 1px solid #d8e3f3;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #f9fbff;
}
.xml-index-node summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  font-weight: 700;
}
.xml-index-node-children {
  border-top: 1px solid #e5edf8;
  padding: 8px 8px 8px 16px;
  background: #fff;
}
.xml-index-node-type {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e8f2ff;
  color: #0b5cad;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}
.xml-index-node-name {
  color: #0b5cad;
  white-space: nowrap;
}
.xml-index-node-label {
  color: #10233f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xml-index-field-full {
  margin-left: var(--xml-index-indent, 0px);
  background: #fff;
  border: 1px solid #edf2f8;
  border-radius: 10px;
  margin-bottom: 6px;
}

@media (max-width: 1100px) {
  .xml-index-layout { grid-template-columns: 1fr; }
  .xml-index-field-row { grid-template-columns: 1fr; align-items: start; }
}


/* Sprint 11 v3 - XSD fa struktura attekinthetoseg */
.xml-index-layout {
  grid-template-columns: minmax(0, 3fr) minmax(360px, 1fr);
}
.xml-index-tree-panel,
.xml-index-summary-panel {
  display: flex;
  flex-direction: column;
}
.xml-index-tree {
  background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
  padding: 16px 18px 20px;
  max-height: min(68vh, 760px);
}
.xml-index-tree .xml-index-node {
  position: relative;
  border: 0;
  border-radius: 0;
  margin: 0;
  background: transparent;
}
.xml-index-tree .xml-index-node + .xml-index-node {
  margin-top: 4px;
}
.xml-index-tree .xml-index-node summary {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #c8d8ef;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 45, 85, 0.06);
  gap: 7px;
}
.xml-index-tree .xml-index-node summary:hover {
  border-color: #75a7e8;
  background: #f5faff;
}
.xml-index-tree .xml-index-node[open] > summary {
  border-color: #8bb7ef;
  background: #eef6ff;
}
.xml-index-tree .xml-index-node summary::marker {
  color: #0b5cad;
}
.xml-index-tree .xml-index-node-children {
  position: relative;
  border-top: 0;
  border-left: 2px dashed #b9cce6;
  margin: 5px 0 7px 18px;
  padding: 6px 0 3px 18px;
  background: transparent;
}
.xml-index-tree .xml-index-node-children::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  width: 14px;
  height: 18px;
  border-bottom: 2px dashed #b9cce6;
}
.xml-index-tree .xml-index-node-children > .xml-index-node,
.xml-index-tree .xml-index-node-children > .xml-index-field-row {
  position: relative;
}
.xml-index-tree .xml-index-node-children > .xml-index-node::before,
.xml-index-tree .xml-index-node-children > .xml-index-field-row::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 16px;
  width: 16px;
  border-top: 2px dashed #b9cce6;
}
.xml-index-tree .xml-index-node-type {
  min-width: 72px;
  text-align: center;
  border-radius: 8px;
  background: #e8f2ff;
  color: #0b5cad;
  letter-spacing: .02em;
}
.xml-index-tree .xml-index-node-form > summary .xml-index-node-type { background: #dbeafe; color: #123f7a; }
.xml-index-tree .xml-index-node-block > summary .xml-index-node-type { background: #ede9fe; color: #5b21b6; }
.xml-index-tree .xml-index-node-chain > summary .xml-index-node-type { background: #dcfce7; color: #166534; }
.xml-index-tree .xml-index-node-chain_elem > summary .xml-index-node-type { background: #ecfdf5; color: #047857; }
.xml-index-tree .xml-index-node-field_group > summary .xml-index-node-type { background: #fef3c7; color: #92400e; }
.xml-index-tree .xml-index-node-field > summary .xml-index-node-type { background: #e0f2fe; color: #075985; }
.xml-index-tree .xml-index-node-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #064f92;
}
.xml-index-tree .xml-index-node-label {
  max-width: 520px;
  color: #10233f;
}
.xml-index-tree .xml-index-field-count {
  margin-left: 8px;
  color: #607087;
  background: #f3f7fc;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  padding: 2px 8px;
}
.xml-index-tree .xml-index-field-row {
  margin: 5px 0 6px 0;
  padding: 8px 10px;
  border: 1px solid #d9e6f7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 45, 85, 0.04);
  grid-template-columns: minmax(300px, 1fr) auto auto auto 142px;
}
.xml-index-tree .xml-index-field-row:hover {
  border-color: #83b2ec;
  background: #fbfdff;
}
.xml-index-tree .xml-index-field-row:has(input:checked) {
  border-color: #34d399;
  background: #f0fdf4;
}
.xml-index-tree .xml-index-field-full {
  margin-left: 0;
}
.xml-index-tree .xml-index-field-main strong {
  color: #10233f;
  font-size: 13px;
}
.xml-index-tree .xml-index-field-main span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0b5cad;
}
.xml-index-tree .xml-index-field-main small {
  white-space: normal;
  overflow-wrap: anywhere;
  color: #607087;
}
.xml-index-tree .xml-index-check {
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
}
.xml-index-tree .xml-index-check:has(input:checked) {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #0b5cad;
}
.xml-index-tree .xml-index-match {
  min-width: 136px;
  height: 34px;
}
.xml-index-summary {
  max-height: min(68vh, 760px);
}

@media (max-width: 1250px) {
  .xml-index-layout { grid-template-columns: 1fr; }
  .xml-index-tree .xml-index-field-row { grid-template-columns: 1fr; align-items: start; }
  .xml-index-tree .xml-index-node-label { max-width: 420px; }
}

/* Sprint 11 v4 - valodi hierarchikus XSD fa level mezokkel */
.xml-index-tree .xml-index-field-leaf {
  position: relative;
  margin: 4px 0 5px 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.xml-index-tree .xml-index-field-leaf::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 17px;
  width: 16px;
  border-top: 2px dashed #b9cce6;
}
.xml-index-tree .xml-index-field-leaf-line {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid #c8d8ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 45, 85, 0.05);
}
.xml-index-tree .xml-index-field-leaf-line:hover {
  border-color: #75a7e8;
  background: #f5faff;
}
.xml-index-tree .xml-index-field-leaf.xml-index-field-selected .xml-index-field-leaf-line {
  border-color: #34d399;
  background: #f0fdf4;
}
.xml-index-tree .xml-index-field-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
.xml-index-tree .xml-index-field-identity .xml-index-node-type {
  min-width: 72px;
  text-align: center;
  background: #e0f2fe;
  color: #075985;
}
.xml-index-tree .xml-index-field-identity .xml-index-node-name {
  flex: 0 0 auto;
}
.xml-index-tree .xml-index-field-identity .xml-index-node-label {
  min-width: 0;
  max-width: none;
}
.xml-index-tree .xml-index-field-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.xml-index-tree .xml-index-field-path {
  margin: 2px 0 0 92px;
  color: #607087;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.xml-index-tree .xml-index-node-children > .xml-index-field-leaf::before {
  left: -18px;
  top: 17px;
}
@media (max-width: 1250px) {
  .xml-index-tree .xml-index-field-leaf-line {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .xml-index-tree .xml-index-field-actions {
    justify-content: flex-start;
  }
  .xml-index-tree .xml-index-field-path {
    margin-left: 0;
  }
}

/* Sprint 11 v5 - simple searchable XSD field picker for XML index config */
.xml-index-field-picker {
  display: grid;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}
.xml-index-field-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}
.xml-index-field-picker-row select {
  min-width: 0;
}
.xml-index-field-list {
  display: grid;
  gap: 0.55rem;
}
.xml-index-available-field {
  width: 100%;
  border: 1px solid var(--border-color, #cfe0f7);
  border-radius: 14px;
  background: #fff;
  padding: 0.7rem 0.85rem;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.18rem 0.75rem;
  align-items: center;
  color: var(--text-color, #0f2340);
  cursor: pointer;
}
.xml-index-available-field:hover {
  border-color: #8db8ff;
  background: #f7fbff;
}
.xml-index-available-field.selected {
  border-color: #8ad4ad;
  background: #eefbf4;
}
.xml-index-available-field-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.xml-index-available-field-meta {
  color: #1d5ea8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}
.xml-index-available-field-path {
  grid-column: 1 / -1;
  color: #526783;
  font-size: 0.78rem;
  word-break: break-all;
}
.xml-index-available-field-action {
  grid-row: 1 / span 2;
  grid-column: 2;
  justify-self: end;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  background: #eaf2ff;
  color: #185abc;
  font-size: 0.78rem;
  font-weight: 700;
}
.xml-index-available-field.selected .xml-index-available-field-action {
  background: #dff7e8;
  color: #0c7a3f;
}
.xml-index-selected-editor {
  display: grid;
  gap: 0.55rem;
}
.xml-index-selected-header {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: flex-start;
}
.xml-index-selected-header span {
  display: block;
  margin-top: 0.16rem;
  color: #526783;
  font-size: 0.78rem;
  word-break: break-all;
}
.xml-index-selected-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.xml-index-selected-controls .xml-index-match {
  min-width: 150px;
}


.xml-index-context-notice {
  margin: 0 0 1rem;
  line-height: 1.55;
}
