.vs {
  font-size: 14px;
  color: var(--ink);
  --vs-grid: minmax(400px, 1fr) repeat(3, minmax(160px, 0.24fr))
    minmax(190px, 0.28fr) 120px;
}
.vs button,
.vs input,
.vs select,
.vs textarea {
  font: inherit;
}
.vs button {
  cursor: pointer;
  border: 1px solid var(--linka);
  border-radius: 7px;
  background: white;
  color: var(--znacka);
  padding: 7px 12px;
  min-height: 34px;
}
.vs button:hover {
  background: #f4f7fa;
}
.vs button.primary {
  background: var(--znacka);
  color: white;
}
.vs button.add {
  background: var(--akcia);
  color: white;
  border: 0;
}
.vs button.danger {
  color: #bb302c;
}
.vs button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.vs input,
.vs select,
.vs textarea {
  padding: 9px;
  border: 1px solid var(--linka);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.vs textarea {
  resize: vertical;
  line-height: 1.45;
}
.vs textarea.inline {
  border-color: transparent;
  background: transparent;
  padding: 2px 0;
  min-height: 24px;
}
.vs textarea.inline:hover,
.vs textarea.inline:focus {
  border-color: var(--modra);
  background: white;
}
.vs textarea::placeholder,
.vs .note {
  font-style: italic;
}
.vs .toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.vs .toolbar .spacer {
  flex: 1;
}
.vs .tab {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 10px 0;
  color: var(--ink2);
}
.vs .tab.active {
  border-bottom: 3px solid var(--modra);
  color: var(--znacka);
  font-weight: 600;
}
.vs .filters {
  display: grid;
  grid-template-columns: var(--vs-grid);
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.vs .search {
  display: flex;
  gap: 10px;
  align-items: center;
}
.vs .card {
  background: white;
  border: 1px solid var(--linka);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.vs .top {
  display: grid;
  grid-template-columns: var(--vs-grid);
  gap: 12px;
  padding: 12px 16px;
  align-items: start;
}
.vs .identity {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  grid-row: span 2;
}
.vs .photo {
  width: 110px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--plocha);
}
.vs .photo-box {
  position: relative;
}
.vs .reg {
  position: absolute;
  left: 3px;
  top: 3px;
  background: #ffffffe8;
  color: var(--ink2);
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 3px;
}
.vs h2 {
  font-size: 19px;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.vs .identity p {
  margin: 0 0 10px;
  color: var(--ink2);
}
.vs .link {
  border: 0;
  padding: 4px 0;
  min-height: 0;
  color: var(--modra);
  background: transparent;
}
.vs .badge {
  display: inline-block;
  background: #edf5ef;
  color: #28714b;
  padding: 5px 7px;
  border-radius: 5px;
  font-size: 12px;
  margin-top: 5px;
}
.vs .badge.reserved {
  background: #fff2e4;
  color: #a96522;
}
.vs .metric {
  padding: 0 10px;
  border-left: 1px solid var(--linka);
  min-height: 70px;
}
.vs .metric.first {
  border-left: 0;
  padding-left: 0;
}
.vs label,
.vs .label {
  display: block;
  font-size: 12px;
  color: var(--ink3);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.vs .metric strong {
  font-weight: 600;
  white-space: nowrap;
}
.vs .days {
  font-weight: 400;
  color: #28754e;
}
.vs .days.urgent {
  color: #c0392b;
}
.vs small {
  font-size: 12px;
  color: var(--ink2);
}
.vs .net {
  display: block;
  margin-top: 8px;
  white-space: nowrap;
}
.vs .purchase {
  font-size: 12px;
  color: var(--ink2);
  margin-top: 7px;
}
.vs .purchase .label {
  margin-bottom: 1px;
  font-size: 11px;
}
.vs .actions {
  grid-column: 6;
  grid-row: 1 / span 2;
  display: grid;
  gap: 6px;
  align-self: center;
}
.vs .icons {
  display: flex;
  justify-content: space-between;
  gap: 2px;
}
.vs .icons button {
  padding: 4px;
  border: 0;
  min-width: 26px;
}
.vs .icons svg {
  width: 18px;
  height: 18px;
  display: block;
}
.vs .added {
  grid-column: 2;
}
.vs .owner {
  grid-column: 3 / span 2;
}
.vs .owner label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.vs .bottom {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(230px, 0.48fr) minmax(
      360px,
      0.75fr
    );
  gap: 16px;
  border-top: 1px solid var(--linka);
  padding: 6px 16px;
}
.vs .bottom label {
  margin-bottom: 2px;
}
.vs .notes {
  display: flex;
  gap: 12px;
  align-items: start;
}
.vs .notes label {
  padding-top: 3px;
}
.vs .portals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.vs .portals a {
  color: var(--znacka);
  text-decoration: none;
}
.vs .muted {
  color: var(--ink3);
}
.vs .error {
  padding: 10px;
  background: #fff0ef;
  color: #a32c24;
  margin-bottom: 10px;
}
.vs .saved {
  color: #28754e;
  font-size: 12px;
}
.vs .detail {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
}
.vs .panel {
  background: white;
  border: 1px solid var(--linka);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}
.vs h3 {
  font-size: 16px;
  margin: 0 0 16px;
}
.vs .fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.vs .fields.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.vs .field label {
  margin: 0 0 5px;
}
.vs .field.wide {
  grid-column: 1 / -1;
}
.vs .check {
  display: flex;
  gap: 8px;
  align-items: center;
  text-transform: none;
  color: var(--ink);
}
.vs .check input {
  width: auto;
}
.vs .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.vs .gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 6px;
}
.vs .gallery .panel {
  padding: 10px;
}
.vs .contract-text {
  min-height: 500px;
  font-family: Georgia, serif;
  line-height: 1.6;
}
.vs .pages {
  width: 100%;
  height: 80vh;
  border: 1px solid var(--linka);
  background: #e8edf2;
}
.vs dialog {
  border: 1px solid var(--linka);
  border-radius: 12px;
  max-width: min(850px, 90vw);
  max-height: 90vh;
  padding: 0;
  margin: auto;
  position: fixed;
  inset: 0;
  width: min(850px, calc(100vw - 32px));
  overflow: auto;
  color: var(--ink);
}
.vs dialog::backdrop {
  background: #12203a55;
}
.vs .template-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.vs .template-fields button {
  background: #eef2ff;
  border-color: #ced8fc;
  font-weight: 600;
  font-size: 12px;
}
.vs .footer {
  display: flex;
  justify-content: space-between;
  color: var(--ink3);
  font-size: 12px;
}
.vs .steps {
  display: flex;
  gap: 20px;
  margin: 16px 0;
}
.vs .steps .active {
  font-weight: 600;
  color: var(--znacka);
}
@media (max-width: 1250px) {
  .vs {
    --vs-grid: minmax(400px, 1fr) repeat(3, minmax(160px, 0.25fr)) 190px 110px;
  }
  .vs .list-wrap {
    overflow: auto;
  }
  .vs .filters,
  .vs .card {
    min-width: 1380px;
  }
  .vs .detail {
    grid-template-columns: 1fr;
  }
  .vs .fields.four {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vs h2 .link {
  color: var(--ink);
  text-align: left;
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  line-height: 1.3;
}
.vs .search > .link {
  white-space: nowrap;
}
.vs .top {
  font-variant-numeric: tabular-nums;
}
.vs .bottom .portals small {
  white-space: nowrap;
}

.vs .contract-text[contenteditable] {
  white-space: pre-wrap;
  border: 1px solid var(--linka);
  border-radius: 6px;
  padding: 18px;
  outline-color: var(--modra);
  overflow-wrap: anywhere;
  background: white;
}
.vs .merge-field {
  font-weight: 700;
  background: #edf2ff;
  color: var(--znacka);
  padding: 1px 3px;
  border-radius: 3px;
}

.vs .pdf-pages {
  background: #e8edf2;
  padding: 20px;
  display: grid;
  justify-items: center;
  gap: 20px;
  overflow: auto;
}
.vs .pdf-sheet {
  width: 210mm;
  max-width: 100%;
  background: white;
  box-shadow: 0 1px 5px #12203a22;
  line-height: 0;
}
.vs .pdf-sheet img {
  display: block;
  width: 100%;
  height: auto;
}

.vs .list-wrap {
  overflow-x: auto;
}
.vs .filters,
.vs .card {
  min-width: 1380px;
}

.vs .stock-dialog-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid var(--linka);
}
.vs .stock-dialog-body {
  padding: 18px 22px 22px;
}
