/* Форма оформления — работает и в Bootstrap-админке, и в hub менеджера */

.appearance-form {
  --appearance-gap: 1rem;
  color: var(--foreground, #212529);
}

.appearance-form form > * + *,
.appearance-form > * + * {
  margin-top: var(--appearance-gap);
}

.appearance-form form {
  margin: var(--appearance-gap) 0 0;
}

.appearance-form-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.appearance-tabs-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--border, #dee2e6);
  border-radius: var(--radius-lg, 0.625rem);
  background: var(--muted, #f1f3f5);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.appearance-tabs-bar::-webkit-scrollbar {
  display: none;
}

.appearance-tab-trigger {
  flex: 1 1 auto;
  min-width: 5.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm, 0.375rem);
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--muted-foreground, #6c757d);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, box-shadow 0.15s, background 0.15s;
}

.appearance-tab-trigger[data-state='active'] {
  color: var(--foreground, #212529);
  background: var(--card, #fff);
  border-color: color-mix(in oklch, var(--border, #dee2e6) 70%, transparent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.appearance-tab-panel {
  display: flex;
  flex-direction: column;
  gap: var(--appearance-gap);
}

.appearance-tab-panel[hidden] {
  display: none !important;
}

.appearance-form-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.25rem;
}

.appearance-form-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.appearance-form-header p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted-foreground, #6c757d);
}

.appearance-form-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.appearance-form-section {
  padding: 1.1rem 1.15rem 1.2rem;
  border: 1px solid var(--border, #dee2e6);
  border-radius: var(--radius-xl, 0.75rem);
  background: var(--card, #fff);
}

.appearance-form-section > h2 {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  font-weight: 650;
}

.appearance-form-section > h3 {
  margin: 1rem 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-foreground, #6c757d);
}

.appearance-form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.appearance-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.appearance-field input:not([type='checkbox']):not([type='radio']),
.appearance-field select,
.appearance-field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  height: 2.35rem;
  padding: 0 0.75rem;
  border: 1px solid var(--input, #ced4da);
  border-radius: var(--radius-sm, 0.375rem);
  background: var(--background, #fff);
  font: inherit;
  color: inherit;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  appearance: none;
}

.appearance-field select {
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 1rem;
}

.appearance-field textarea {
  height: auto;
  min-height: 4.5rem;
  padding: 0.55rem 0.75rem;
  resize: vertical;
}

.appearance-field input:not([type='checkbox']):not([type='radio']):focus-visible,
.appearance-field select:focus-visible,
.appearance-field textarea:focus-visible {
  outline: none;
  border-color: var(--ring, #86b7fe);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring, #86b7fe) 35%, transparent);
}

.appearance-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.15rem 0.75rem;
}

.appearance-form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 540px) {
  .appearance-form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.appearance-form-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted-foreground, #6c757d);
}

.appearance-form-hint code {
  font-size: 0.85em;
}

.appearance-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #dee2e6);
}

.appearance-form-actions .btn-primary,
.appearance-form-actions .btn-default {
  min-width: 7.5rem;
}

.appearance-form .theme-swatches {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

@media (min-width: 400px) {
  .appearance-form .theme-swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .appearance-form .theme-swatches {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.appearance-form .theme-swatch {
  position: relative;
  margin: 0;
}

.appearance-form .theme-swatch input[type='radio'] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.appearance-form .theme-swatch:has(input:checked) {
  border-color: var(--primary, #0d6efd);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary, #0d6efd) 22%, transparent);
}

.appearance-form .logo-upload {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .appearance-form .logo-upload {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.appearance-form .logo-upload-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7rem;
  padding: 0.85rem;
  border: 1px dashed var(--border, #dee2e6);
  border-radius: var(--radius-lg, 0.625rem);
  background: color-mix(in oklch, var(--muted, #f1f3f5) 45%, transparent);
}

.appearance-form .logo-upload-preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 5.5rem;
  object-fit: contain;
}

.appearance-form .logo-upload-preview-photo img {
  max-height: 8rem;
  object-fit: cover;
  border-radius: var(--radius-sm, 0.375rem);
}

.appearance-form .logo-upload-fields {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.appearance-form .appearance-field-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.appearance-form .appearance-field-check input {
  width: auto;
  height: auto;
}

.appearance-form .appearance-field input[type='file'] {
  padding: 0.45rem 0.55rem;
  height: auto;
}

.appearance-table-wrap {
  overflow-x: auto;
}

.appearance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.appearance-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground, #6c757d);
  padding: 0.45rem 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border, #dee2e6);
  white-space: nowrap;
}

.appearance-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--border, #dee2e6);
  vertical-align: middle;
}

.appearance-table tr:last-child td {
  border-bottom: 0;
}

.appearance-table-thumb {
  display: block;
  width: 3.4rem;
  height: 2.4rem;
  object-fit: cover;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--border, #dee2e6);
  background: var(--muted, #f1f3f5);
}

.appearance-table-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 2.4rem;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px dashed var(--border, #dee2e6);
  color: var(--muted-foreground, #6c757d);
  font-size: 0.7rem;
}

.hub-admin-panel .btn-primary {
  background: var(--primary);
  border-color: transparent;
  color: var(--primary-foreground);
}

.hub-admin-panel .btn-primary:hover {
  background: color-mix(in oklch, var(--primary) 90%, transparent);
  border-color: transparent;
  color: var(--primary-foreground);
}

.hub-admin-panel .btn-outline-primary,
.hub-admin-panel .btn-outline-secondary {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
}

.hub-admin-panel .btn-outline-primary:hover,
.hub-admin-panel .btn-outline-secondary:hover {
  background: var(--accent);
  border-color: var(--border);
  color: var(--accent-foreground);
}

/* Hub менеджера: карточка-обёртка */
.hub-admin-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  display: block;
  overflow: visible;
}

.hub-admin-content {
  padding: 1.15rem 1.15rem 1.25rem;
}

@media (max-width: 767px) {
  .hub-admin-content {
    padding: 0.95rem 0.85rem 1rem;
  }

  .appearance-form-section {
    padding: 0.95rem 0.85rem 1rem;
  }

  .appearance-form-header h1 {
    font-size: 1.2rem;
  }

  .appearance-form .theme-swatches {
    gap: 0.4rem;
  }

  .appearance-tab-trigger {
    min-width: 4.75rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
  }
}

.menu-sort-btns {
  display: inline-flex;
  gap: 0.2rem;
}

.menu-sort-btns form {
  display: inline;
}

.menu-sort-btns .btn {
  min-width: 2rem;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}
