.vp-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.vp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.vp-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.vp-title-count {
  margin: 0;
}

.vp-title-icon {
  margin-right: 8px;
  vertical-align: -0.15em;
}

.vp-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vp-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 320px;
  padding: 0 10px;
  height: 34px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text2);
}

.vp-search svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.vp-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
}

.vp-add-btn {
  min-height: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
}

@media (max-width: 1600px) {
  .vp-input,
  .vp-textarea,
  .vp-cell-trigger,
  .vp-status-btn,
  .vp-vignette-name,
  .vp-vignette-dates,
  .vp-inline-link,
  .vp-delete-row-btn,
  .vp-add-btn {
    font-size: 11px;
  }

  .vp-table thead th,
  .vp-group-pill,
  .vp-group-pill strong,
  .vp-group-pill span {
    font-size: 9px;
  }
}

.vp-table-card {
  overflow: hidden;
}

.vp-table-scroll {
  overflow: auto;
}

.vp-table {
  width: 100%;
  min-width: 1540px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.vp-col--spz {
  width: 80px;
}

.vp-col--vozidlo {
  width: 120px;
}

.vp-col--palivo {
  width: 78px;
}

.vp-col--sofer {
  width: 148px;
}

.vp-col--tachometer {
  width: 92px;
}

.vp-col--stav {
  width: 126px;
}

.vp-col--stk {
  width: 126px;
}

.vp-col--pneumatiky {
  width: 78px;
}

.vp-col--tp {
  width: 81px;
}

.vp-col--poistka {
  width: 118px;
}

.vp-col--status {
  width: 62px;
}

.vp-col--delete {
  width: 42px;
}

.vp-col--znamka {
  width: calc(14% + 20px);
}

.vp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border2);
  border-right: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text3);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  text-align: center;
  white-space: nowrap;
}

.vp-table td {
  position: relative;
  padding: 0;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: middle;
}

.vp-table thead th:last-child,
.vp-table td:last-child {
  border-right: 0;
}

.vp-table td > * {
  position: relative;
  z-index: 1;
}

.vp-table tbody tr:hover td::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(99, 102, 241, 0.04);
}

.vp-input,
.vp-textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  padding: 6px 8px;
  outline: none;
  transition: background 0.16s ease, box-shadow 0.16s ease;
  box-sizing: border-box;
  min-height: 30px;
  appearance: none;
}

.vp-input:focus,
.vp-textarea:focus {
  background: rgba(99, 102, 241, 0.08);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.24);
}

.vp-cell-trigger {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6366f1;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.vp-cell-trigger:hover {
  background: transparent;
  color: #4338ca;
}

.vp-textarea {
  min-height: 30px;
  resize: none;
  line-height: 1.45;
  overflow: hidden;
}

.vp-plus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent2);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.vp-plus-btn:hover {
  background: rgba(99, 102, 241, 0.08);
}

.vp-table tbody tr:hover .vp-plus-btn:hover,
.vp-table tbody tr:hover .vp-cell-trigger:hover,
.vp-table tbody tr:hover .vp-file-main:hover {
  background: transparent;
}

.vp-plus-btn span {
  font-size: 24px;
  line-height: 1;
}

.vp-plus-btn--small {
  width: 32px;
  min-width: 32px;
  height: 30px;
}

.vp-plus-btn--small span {
  font-size: 20px;
}

.vp-file-card {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 30px;
}

.vp-file-main {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 30px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 0 7px;
  cursor: pointer;
  text-align: left;
}

.vp-file-main--preview {
  width: 100%;
  min-width: 0;
  height: 30px;
  justify-content: center;
  padding: 0;
}

.vp-file-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  flex-shrink: 0;
}

.vp-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vp-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vp-inline-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--accent2);
  cursor: pointer;
  font-size: 12px;
}

.vp-inline-link--danger {
  color: var(--red);
}

.vp-status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 0;
  border: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.vp-status-btn.is-ok {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.vp-status-btn.is-down {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  font-size: 11px;
}

.vp-status-btn.is-waiting {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  font-size: 11px;
}

.vp-vignette-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.vp-vignette-row {
  display: grid;
  align-items: center;
  gap: 0;
  min-height: 30px;
}

.vp-vignette-row--one {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.vp-vignette-row--two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px;
}

.vp-vignette-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  padding: 0 6px;
  cursor: pointer;
  text-align: left;
}

.vp-group-row td {
  padding: 0;
  background: rgba(255,255,255,0.02);
}

.vp-delete-head {
  padding: 0 !important;
}

.vp-delete-cell {
  padding: 0;
  background: transparent;
}

.vp-status-cell,
.vp-delete-cell {
  padding: 0;
}

.vp-status-cell > .vp-status-btn,
.vp-delete-cell > .vp-delete-row-btn {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.vp-delete-row-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.vp-delete-row-btn svg {
  width: 15px;
  height: 15px;
}

.vp-delete-row-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.vp-delete-row-btn:focus-visible {
  outline: 0;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.vp-group-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px;
  background: color-mix(in srgb, var(--vp-group-color, #94a3b8) 10%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--vp-group-color, #94a3b8) 42%, transparent);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.vp-group-pill span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--vp-group-color, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}

.vp-group-pill span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--vp-group-color, #94a3b8);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--vp-group-color, #94a3b8) 40%, transparent);
}

.vp-group-pill strong {
  color: var(--text2);
  font-size: 10px;
  font-weight: 700;
}

.vp-vignette-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.vp-vignette-flag .vp-flag {
  width: 24px;
  height: 18px;
  display: block;
}

.vp-vignette-item--active {
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.34), rgba(34, 197, 94, 0.22));
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.42);
}

.vp-vignette-item--expired {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}

.vp-vignette-item--upcoming {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
}

.vp-vignette-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.vp-vignette-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.vp-vignette-dates {
  font-size: 10px;
  color: var(--text2);
  white-space: nowrap;
}

.vp-empty-cell {
  padding: 34px 20px !important;
  color: var(--text3);
  text-align: center;
}

.vp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 4200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 10, 18, 0.76);
}

.vp-modal {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border2);
  border-radius: 22px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.vp-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.vp-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.vp-modal-inline-toggle-row {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 430px;
  height: 28px;
}

.vp-modal-inline-toggle {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  white-space: nowrap;
}

.vp-modal-inline-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.vp-modal-stredisko-inline {
  display: none;
  position: absolute;
  top: -2px;
  left: 154px;
  width: 240px;
}

.vp-modal-stredisko-inline.is-visible {
  display: block;
}

.vp-modal-stredisko-inline input {
  width: 100%;
  min-height: 28px;
  height: 28px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 4px 10px;
  box-sizing: border-box;
  font: inherit;
  font-size: 12px;
}

@media (max-width: 900px) {
  .vp-modal-inline-toggle-row {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .vp-modal-stredisko-inline {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
  }

  .vp-modal-inline-toggle {
    position: static;
  }
}

.vp-modal-sub {
  margin-top: 6px;
  margin-bottom: 18px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.5;
}

.vp-confirm-target {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
}

.vp-modal-delete-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.vp-modal-delete-row:hover {
  background: rgba(239, 68, 68, 0.18);
}

.vp-modal-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 4px;
}

.vp-modal-field span {
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-family: var(--font-mono);
}

.vp-modal-field input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  box-sizing: border-box;
}

.vp-modal-field select,
.vp-modal-field textarea {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  box-sizing: border-box;
  font: inherit;
}

.vp-modal-field select {
  min-height: 36px;
  height: 36px;
  line-height: 20px;
}

.vp-modal-field textarea {
  min-height: 76px;
  resize: vertical;
}

.vp-modal--vehicle {
  width: min(980px, 100%);
}

.vp-modal-grid--vehicle .vp-modal-field--full {
  grid-column: 1 / -1;
}

.vp-attachments-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.vp-attachment-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 134px;
  border: 1px solid var(--border2);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  text-align: center;
  cursor: pointer;
}

.vp-attachment-card.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.vp-attachment-thumb {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vp-attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vp-attachment-thumb--empty {
  border: 1px dashed var(--border2);
  color: var(--accent2);
  font-size: 36px;
  line-height: 1;
}

.vp-attachment-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.vp-attachment-note {
  font-size: 11px;
  color: var(--text3);
}

.vp-vignette-selected {
  min-height: 36px;
  margin-bottom: 12px;
}

.vp-vignette-selected-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--text);
  font-size: 12px;
}

.vp-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  flex-shrink: 0;
}

.vp-country-flag .vp-flag {
  width: 33px;
  height: 24px;
  display: block;
}

.vp-country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  cursor: pointer;
  text-align: left;
}

.vp-country-item.is-selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.vp-country-item-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.vp-country-item-copy strong {
  font-size: 13px;
  min-width: 0;
}

.vp-country-item-copy span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  white-space: nowrap;
}

.vp-vignette-country-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  margin-bottom: 14px;
  padding-right: 2px;
}

.vp-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 6px;
}

.vp-modal-grid--vehicle {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vp-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2px;
}

.vp-modal-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vp-modal-error {
  min-height: 20px;
  margin-top: 3px;
  color: var(--red);
  font-size: 12px;
}

@media (max-width: 900px) {
  .vp-search {
    min-width: 0;
    width: 100%;
  }

  .vp-head-actions {
    width: 100%;
  }

  .vp-head-actions .btn-primary-sm {
    width: 100%;
    justify-content: center;
  }

  .vp-vignette-country-list,
  .vp-modal-grid {
    grid-template-columns: 1fr;
  }

  .vp-modal-grid--vehicle {
    grid-template-columns: 1fr;
  }

  .vp-attachments-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1720px), (max-height: 980px) {
  .vp-table {
    min-width: 1410px !important;
  }

  .vp-col--spz {
    width: 74px !important;
  }

  .vp-col--vozidlo {
    width: 108px !important;
  }

  .vp-col--palivo {
    width: 66px !important;
  }

  .vp-col--sofer {
    width: 132px !important;
  }

  .vp-col--tachometer {
    width: 84px !important;
  }

  .vp-col--stav,
  .vp-col--stk,
  .vp-col--poistka {
    width: 110px !important;
  }

  .vp-col--pneumatiky {
    width: 70px !important;
  }

  .vp-col--tp {
    width: 70px !important;
  }

  .vp-col--znamka {
    width: calc(12% + 12px) !important;
  }

  .vp-col--status {
    width: 58px !important;
  }

  .vp-col--delete {
    width: 38px !important;
  }

  .vp-table thead th {
    font-size: 9px !important;
    padding: 4px 4px !important;
  }

  .vp-table .vp-input,
  .vp-table .vp-textarea,
  .vp-table .vp-cell-trigger,
  .vp-table .vp-status-btn,
  .vp-table .vp-vignette-name,
  .vp-table .vp-vignette-dates,
  .vp-table .vp-inline-link,
  .vp-table .vp-delete-row-btn {
    font-size: 11px !important;
  }

  .vp-table .vp-input,
  .vp-table .vp-textarea {
    padding: 6px 6px !important;
  }

  .vp-table .vp-cell-trigger,
  .vp-table .vp-file-main,
  .vp-table .vp-vignette-item {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .vp-table .vp-vignette-item {
    gap: 4px !important;
  }

  .vp-table .vp-vignette-copy {
    gap: 4px !important;
  }

  .vp-table .vp-vignette-flag {
    width: 20px !important;
    height: 20px !important;
  }

  .vp-table .vp-vignette-flag .vp-flag {
    width: 20px !important;
    height: 15px !important;
  }

  .vp-table .vp-vignette-dates {
    letter-spacing: -0.01em;
  }
}
