body.insolvency-active,
body.insolvency-active .app-container,
body.insolvency-active .main-wrapper {
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

body.insolvency-active main.page-content {
  padding: 0;
  background: #eef3f8;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.insolvency-active #view-insolvency {
  flex: 1;
  min-height: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.iso-root {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 150px;
  background:
    radial-gradient(900px 280px at 12% -10%, rgba(31, 94, 168, 0.1), transparent 55%),
    radial-gradient(700px 240px at 92% 108%, rgba(47, 158, 102, 0.08), transparent 50%),
    #eef3f8;
  color: #163a6b;
  font-family: "Segoe UI Variable", "Segoe UI", David, sans-serif;
  direction: rtl;
}

.iso-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #d7e2f0;
}

.iso-back {
  appearance: none;
  border: 1px solid #d7e2f0;
  background: #fff;
  color: #1f5ea8;
  font: 600 13px inherit;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.iso-back:hover { background: #f7fbff; }

.iso-brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.iso-brand strong { font-size: 16px; color: #163a6b; }
.iso-brand small { color: #6b7c93; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.iso-lm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7c93;
  background: #f7fbff;
  border: 1px solid #d7e2f0;
  border-radius: 999px;
  padding: 6px 12px;
}
.iso-lm b { color: #163a6b; font-weight: 650; }
.iso-pulse { width: 8px; height: 8px; border-radius: 50%; background: #c5d0de; }
.iso-lm.is-on .iso-pulse { background: #2f9e66; box-shadow: 0 0 0 0 rgba(47, 158, 102, 0.45); animation: iso-pulse 1.8s ease-out infinite; }
.iso-lm.is-off .iso-pulse { background: #c45c26; }
@keyframes iso-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 158, 102, 0.4); }
  100% { box-shadow: 0 0 0 10px rgba(47, 158, 102, 0); }
}

.iso-stage {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 280px;
  min-height: 0;
  gap: 12px;
  padding: 12px 14px;
}

.iso-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(22, 58, 107, 0.06);
  overflow: hidden;
}
.iso-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e8eef5;
  background: #f7fbff;
}
.iso-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b7c93;
  font: 700 13px inherit;
  padding: 10px 16px;
  cursor: pointer;
}
.iso-tabs button.is-on {
  color: #1f5ea8;
  background: #fff;
  box-shadow: inset 0 -2px 0 #1f5ea8;
}
.iso-main .iso-map {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.iso-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.iso-print {
  appearance: none;
  border: 0;
  background: #1f5ea8;
  color: #fff;
  font: 700 12px inherit;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.iso-sec { margin-bottom: 16px; }
.iso-sec h3 { margin: 0 0 8px; font-size: 13px; color: #163a6b; }
.iso-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.iso-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.iso-field span { color: #3d5a78; display: flex; justify-content: space-between; gap: 8px; }
.iso-field em { font-style: normal; font-size: 10px; color: #1f5ea8; background: #e8f1ff; border-radius: 999px; padding: 0 6px; }
.iso-field input, .iso-field select, .iso-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e5eaf1;
  border-radius: 8px;
  padding: 7px 8px;
  font: 13px inherit;
  color: #163a6b;
  background: #fff;
}
.iso-field.is-empty input, .iso-field.is-empty select, .iso-field.is-empty textarea {
  border-style: dashed;
  background: #fffdf8;
}
.iso-fields > .iso-field:has(textarea) { grid-column: 1 / -1; }

.iso-id, .iso-map, .iso-rack {
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid #d7e2f0;
  border-radius: 14px;
  padding: 14px 14px 16px;
  box-shadow: 0 10px 28px rgba(22, 58, 107, 0.06);
}

.iso-kicker {
  font-size: 12px;
  font-weight: 700;
  color: #163a6b;
  margin: 0 0 10px;
}

.iso-hint { margin: 0 0 10px; color: #6b7c93; font-size: 12px; line-height: 1.5; }

.iso-search {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e5eaf1;
  color: #163a6b;
  padding: 8px 10px;
  font: 13px inherit;
  margin-bottom: 10px;
  border-radius: 8px;
}
.iso-search:focus { outline: 2px solid rgba(31, 94, 168, 0.2); border-color: #1f5ea8; }

.iso-people { display: grid; gap: 6px; }
.iso-person {
  appearance: none;
  width: 100%;
  text-align: right;
  background: #f7fbff;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  color: inherit;
  cursor: pointer;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
}
.iso-person:hover { border-color: #c5d0de; }
.iso-person.is-on { background: #e8f1ff; border-color: #1f5ea8; box-shadow: 0 0 0 3px rgba(31, 94, 168, 0.12); }
.iso-person-meta { display: grid; gap: 1px; min-width: 0; }
.iso-person strong { font-size: 13px; }
.iso-person span { font-size: 12px; color: #6b7c93; font-variant-numeric: tabular-nums; }
.iso-ava {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #dce8f8; color: #1f5ea8; font: 700 11px inherit;
  flex: 0 0 auto;
}
.iso-person.is-on .iso-ava { background: #1f5ea8; color: #fff; }

.iso-go {
  margin-top: 12px;
  width: 100%;
  appearance: none;
  border: 0;
  cursor: pointer;
  font: 700 13px inherit;
  color: #fff;
  background: #1f5ea8;
  padding: 10px 12px;
  border-radius: 8px;
}
.iso-go:hover { background: #184c8a; }
.iso-go:disabled { opacity: 0.45; cursor: default; }

.iso-map { position: relative; }
.iso-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.iso-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.iso-stat {
  font-size: 11px; font-weight: 700; color: #1f5ea8;
  background: #e8f1ff; border-radius: 999px; padding: 3px 9px;
}
.iso-stat.is-ok { background: #e7f7ee; color: #1d6b45; }
.iso-stat.is-wait { background: #fff6e8; color: #8a5a16; }

.iso-empty {
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  min-height: 240px;
  color: #6b7c93;
  padding: 24px;
}
.iso-empty strong { color: #163a6b; font-size: 17px; }
.iso-sketch { width: min(280px, 70%); height: 120px; margin: 0 auto 8px; display: block; }

.iso-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
}

.iso-tree ul {
  list-style: none;
  margin: 0;
  padding: 0 22px 0 0;
  border-right: 2px solid #e4edf6;
}

.iso-tree li {
  position: relative;
  padding: 4px 0;
  animation: iso-in 0.28s ease both;
}

.iso-tree li:nth-child(1) { animation-delay: 0.02s; }
.iso-tree li:nth-child(2) { animation-delay: 0.05s; }
.iso-tree li:nth-child(3) { animation-delay: 0.08s; }
.iso-tree li:nth-child(4) { animation-delay: 0.11s; }
.iso-tree li:nth-child(5) { animation-delay: 0.14s; }

.iso-tree li::before {
  content: "";
  position: absolute;
  top: 16px;
  right: -22px;
  width: 16px;
  border-top: 2px solid #e4edf6;
}
.iso-tree li::after {
  content: "";
  position: absolute;
  top: 13px;
  right: -6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #c5d0de;
}
.iso-tree > li::before, .iso-tree > li::after { display: none; }

@keyframes iso-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}

.iso-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  min-width: 0;
  transition: background .15s ease, box-shadow .15s ease;
}
.iso-row:hover { background: #f7fbff; }

.iso-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iso-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #1f5ea8;
}

.iso-row.is-source { font-weight: 700; color: #163a6b; background: #f7fbff; }
.iso-row.is-folder { color: #3d5a78; }
.iso-row.is-file { color: #4d6280; }
.iso-row.is-lock { background: #e7f7ee; color: #1d6b45; box-shadow: inset 3px 0 0 #2f9e66; }
.iso-row.is-hold { background: #fff6e8; color: #8a5a16; box-shadow: inset 3px 0 0 #e0a106; }
.iso-row.is-skip { color: #8aa0b8; }
.iso-row.is-lock:hover { background: #dbf3e6; }
.iso-tree li:has(> .iso-row.is-lock)::after { box-shadow: 0 0 0 2px #2f9e66; background: #e7f7ee; }
.iso-tree li:has(> .iso-row.is-hold)::after { box-shadow: 0 0 0 2px #e0a106; background: #fff6e8; }

.iso-tag {
  margin-inline-start: auto;
  font-size: 11px;
  font-weight: 650;
  color: #1f5ea8;
  background: #e8f1ff;
  border-radius: 999px;
  padding: 1px 8px;
  flex: 0 0 auto;
}
.iso-row.is-lock .iso-tag { background: #d9f3e5; color: #1d6b45; }
.iso-row.is-hold .iso-tag { background: #fde9cc; color: #8a5a16; }

.iso-bay {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #e8eef5;
  border-radius: 10px;
  background: #f7fbff;
}
.iso-bay.is-lock {
  border-color: #b7e3cb;
  background: #f3fbf6;
  box-shadow: 0 6px 16px rgba(47, 158, 102, 0.1);
}
.iso-bay header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  align-items: center;
}
.iso-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d7e2f0;
  flex: 0 0 auto;
}
.iso-bay.is-lock .iso-led { background: #2f9e66; }
.iso-bay ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 3px; }
.iso-bay li { font-size: 12px; color: #5b6f86; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.iso-trace {
  margin: 0 14px 12px;
  background: #fff;
  border: 1px solid #d7e2f0;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(22, 58, 107, 0.05);
}
.iso-trace-head {
  padding: 12px 14px;
  color: #163a6b;
  font-size: 12px;
  font-weight: 700;
  border-left: 1px solid #e8eef5;
  background: #f7fbff;
}
.iso-log {
  margin: 0;
  padding: 10px 18px 12px 14px;
  overflow: auto;
  font: 13px/1.55 inherit;
  color: #4d6280;
  direction: rtl;
  text-align: right;
}
.iso-log > div {
  position: relative;
  padding: 3px 14px 3px 0;
}
.iso-log > div::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 0;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #c5d0de;
}
.iso-log .is-lock { color: #1d6b45; }
.iso-log .is-hold { color: #8a5a16; }
.iso-log .is-skip { color: #6b7c93; }
.iso-log .is-sys { color: #163a6b; }
.iso-log .is-lock::before { background: #2f9e66; }
.iso-log .is-hold::before { background: #e0a106; }
.iso-log .is-sys::before { background: #1f5ea8; }

.iso-go.is-busy { position: relative; overflow: hidden; }
.iso-go.is-busy::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: iso-sheen 1.1s linear infinite;
}
@keyframes iso-sheen { from { transform: translateX(120%); } to { transform: translateX(-280%); } }

.iso-bay.is-open {
  border-style: dashed;
  background: #fff;
}
.iso-bay.is-drop {
  border-color: #1f5ea8;
  background: #e8f1ff;
}
.iso-attach {
  display: inline-flex;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1f5ea8;
  cursor: pointer;
  background: #e8f1ff;
  border-radius: 8px;
  padding: 6px 10px;
}
.iso-attach:hover { background: #dce8f8; }
.iso-drop { position: absolute; inset: 0; pointer-events: none; border-radius: 12px; }
.iso-map.is-drop .iso-drop {
  pointer-events: auto;
  background: rgba(31, 94, 168, 0.06);
  box-shadow: inset 0 0 0 2px #1f5ea8;
}
