:root {
  --admin-sidebar-w: 260px;
  --admin-bg: #0f172a;
  --admin-sidebar: #1e293b;
  --admin-accent: #6366f1;
  --admin-surface: #ffffff;
  --admin-muted: #64748b;
}

body.vk-admin {
  background: #f1f5f9;
  min-height: 100vh;
}

.vk-admin-shell {
  display: flex;
  min-height: 100vh;
}

.vk-admin-sidebar {
  width: var(--admin-sidebar-w);
  background: var(--admin-sidebar);
  color: #e2e8f0;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1040;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.vk-admin-brand {
  padding: 1.25rem 1rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.vk-admin-nav {
  padding: 0.75rem 0.5rem;
}

.vk-admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 0.9rem;
  font-weight: 500;
}

.vk-admin-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.vk-admin-nav a.active {
  background: var(--admin-accent);
  color: #fff;
}

#adminToastContainer .toast {
  min-width: 280px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.vk-admin-nav-badge {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 0 2px var(--admin-sidebar);
}

.vk-admin-nav-section {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 1rem 0.85rem 0.35rem;
}

.vk-admin-main {
  flex: 1;
  margin-left: var(--admin-sidebar-w);
  min-width: 0;
  padding: 1.25rem;
}

@media (max-width: 991.98px) {
  .vk-admin-sidebar {
    transform: translateX(-100%);
  }
  .vk-admin-sidebar.show {
    transform: translateX(0);
  }
  .vk-admin-main {
    margin-left: 0;
    padding-top: 3.5rem;
  }
}

.vk-admin-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--admin-surface);
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 1rem;
}

@media (max-width: 991.98px) {
  .vk-admin-topbar { display: flex; align-items: center; justify-content: space-between; }
}

.vk-admin-card {
  background: var(--admin-surface);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.vk-admin-stat {
  padding: 1.25rem;
  height: 100%;
}

.vk-admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.vk-admin-stat-label {
  color: var(--admin-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Dashboard: фиксированная высота графиков (иначе Chart.js растягивает страницу) */
.vk-dashboard-chart-wrap {
  position: relative;
  height: 200px;
  max-height: 200px;
  width: 100%;
}

.vk-dashboard-chart-wrap--wide {
  height: 180px;
  max-height: 180px;
}

.vk-dashboard-chart-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
}

.vk-dashboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vk-dashboard-status-list li:last-child {
  border-bottom: none !important;
}

.vk-admin-table {
  margin-bottom: 0;
}

.vk-admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--admin-muted);
  font-weight: 600;
  background: #f8fafc;
  white-space: nowrap;
}

.vk-admin-page-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.vk-admin-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 1035;
}

.vk-admin-overlay.show { display: block; }

/* Каталог: товары и дизайны */
.vk-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.vk-catalog-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.vk-catalog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.vk-catalog-card-img {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vk-catalog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vk-catalog-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Конструктор форм */
.vk-field-palette .field-palette-item {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.vk-field-palette .field-palette-item:active {
  cursor: grabbing;
}

.vk-field-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 0.5rem;
}

.vk-field-card-handle {
  color: #94a3b8;
  padding-top: 0.15rem;
  cursor: grab;
  touch-action: none;
}

.vk-field-card-handle:active {
  cursor: grabbing;
}

.vk-field-card-ghost,
.vk-palette-ghost {
  opacity: 0.55;
}

.vk-builder-dropzone {
  min-height: 72px;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.5rem;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s;
}

.vk-builder-dropzone.sortable-drag-active {
  border-color: #3b82f6;
  background: #eff6ff;
}

.vk-builder-step + .vk-builder-step {
  border-top: 1px solid #e2e8f0;
  padding-top: 1rem;
}

.vk-builder-step-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.vk-step-drag-handle {
  color: #94a3b8;
  cursor: grab;
  padding: 0.25rem;
  touch-action: none;
}

.vk-step-drag-handle:active {
  cursor: grabbing;
}

.vk-builder-step-ghost {
  opacity: 0.55;
}

#wizardStepsList.sortable-drag-active {
  background: #f8fafc;
  border-radius: 10px;
}

/* Чат админки */
.vk-chat-messenger-panel {
  display: flex;
  flex-direction: column;
  max-height: 520px;
}

.vk-chat-messenger-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 12px;
  min-height: 280px;
}

.vk-status-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vk-status-timeline li {
  position: relative;
  padding-left: 1.25rem;
  padding-bottom: 0.75rem;
  border-left: 2px solid #e2e8f0;
  margin-left: 0.35rem;
}

.vk-status-timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, #6366f1);
}

/* Файлы — этап 5 */
.vk-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.vk-file-grid--compact {
  grid-template-columns: 1fr;
}

.vk-file-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.vk-file-card-preview {
  background: #f8fafc;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vk-file-card-img {
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.vk-file-card-video {
  max-width: 100%;
  max-height: 160px;
  width: 100%;
}

.vk-file-card-audio {
  max-width: 100%;
  padding: 0.5rem;
}

.vk-file-card-body {
  padding: 0.65rem 0.75rem;
}

.vk-file-card-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.vk-file-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.vk-file-lightbox.show {
  display: flex;
}

.vk-file-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
}

.vk-file-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 720px);
  max-height: 90vh;
  text-align: center;
}

.vk-file-lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 8px;
}

.vk-file-lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
}

/* WB FBS modal — перетаскиваемые столбцы */
.vk-wb-cols-table .vk-wb-col-th {
  cursor: grab;
  user-select: none;
  white-space: nowrap;
  font-size: 0.8rem;
}
.vk-wb-cols-table .vk-wb-col-th:active {
  cursor: grabbing;
}
.vk-wb-cols-table .vk-wb-col-th--drag {
  opacity: 0.55;
}
.vk-wb-cols-table .vk-wb-col-th--over {
  box-shadow: inset 0 -3px 0 var(--bs-primary);
}
.vk-order-modal-chat-files .vk-chat-attach--image img {
  max-width: 88px;
  max-height: 88px;
  object-fit: cover;
  border-radius: 8px;
}

/* Конструктор: выбор с ветками */
.vk-choice-builder-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 420px;
  overflow-y: auto;
}

.vk-choice-builder-card {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 0.75rem;
  background: #f8fafc;
}

.vk-choice-builder-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.vk-choice-builder-head .vk-choice-label-input {
  flex: 1;
  font-weight: 600;
}

.vk-choice-builder-fields {
  padding-left: 0.25rem;
}

.vk-choice-branch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e9ecef;
}

.vk-choice-branch-row:last-of-type {
  border-bottom: none;
  margin-bottom: 0.35rem;
}
