.admin-body {
  background: var(--paper);
  min-height: 100vh;
}

.admin-login[hidden],
.admin-sidebar[hidden],
.admin-main[hidden] {
  display: none !important;
}

.admin-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ===== Sidebar (navegación principal del admin) ===== */
.admin-sidebar {
  flex: 0 0 240px;
  width: 240px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
}

.admin-sidebar__brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 8px;
}

.admin-sidebar__logo {
  height: 26px;
  width: auto;
  align-self: flex-start;
}

.admin-sidebar__brand-sub {
  font-size: 0.66rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.admin-sidebar__section-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 0 10px;
  margin-bottom: 6px;
}

.admin-sidebar__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid #1f2937;
  padding-top: 14px;
}

.admin-sidebar__footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-sidebar__footer-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
}

.admin-sidebar__footer-link--danger:hover {
  color: #f87171;
}

@media (max-width: 900px) {
  .admin-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-sidebar {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    min-height: 0;
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 12px 16px;
    gap: 16px;
    overflow-x: auto;
  }

  .admin-sidebar__brand {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
  }

  .admin-sidebar__brand-sub,
  .admin-sidebar__section-label {
    display: none;
  }

  .admin-sidebar__footer {
    flex: 0 0 auto;
    flex-direction: row;
    margin-top: 0;
    border-top: none;
    padding-top: 0;
  }

  .admin-sidebar__footer-link {
    white-space: nowrap;
  }
}

.admin-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(252, 98, 4, 0.16), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(252, 98, 4, 0.1), transparent 50%),
    var(--navy);
}

.admin-login__card {
  width: 100%;
  max-width: 360px;
  background: var(--white);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  border-top: 3px solid var(--accent);
}

.admin-login__logo {
  height: 32px;
  align-self: center;
}

.admin-login__card h1 {
  font-size: 1.1rem;
  color: var(--navy);
  text-align: center;
}

.admin-login__hint {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  margin-top: -8px;
}

.admin-login__card label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

.admin-login__error {
  font-size: 0.8rem;
  color: #dc2626;
  text-align: center;
}

.admin-login__submit {
  margin-top: 6px;
  width: 100%;
  padding: 12px;
}

.admin-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ===== Panel de estadísticas (resumen tipo dashboard) ===== */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  border-left: 4px solid var(--line);
}

.admin-stat-card__icon {
  font-size: 1.8rem;
  line-height: 1;
}

.admin-stat-card__info {
  display: flex;
  flex-direction: column;
}

.admin-stat-card__info strong {
  font-size: 1.5rem;
  color: var(--navy);
  line-height: 1.2;
}

.admin-stat-card__info span {
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-stat-card--products { border-left-color: var(--accent); }
.admin-stat-card--new { border-left-color: #f59e0b; }
.admin-stat-card--progress { border-left-color: #3b82f6; }
.admin-stat-card--done { border-left-color: #22c55e; }

/* ===== Navegación (enlaces del sidebar) ===== */
.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-tab {
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  font-size: 0.87rem;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-tab__icon {
  font-size: 1rem;
  line-height: 1;
  flex: 0 0 auto;
}

.admin-tab:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.07);
}

.admin-tab--active {
  color: var(--white);
  background: var(--accent);
}

.admin-tab__badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.7rem;
  color: var(--white);
}

.admin-tab--active .admin-tab__badge {
  background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
  .admin-tabs {
    flex-direction: row;
    gap: 4px;
    flex: 1 1 auto;
    overflow-x: auto;
  }

  .admin-tab {
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
  }
}

.admin-panel[hidden] {
  display: none;
}

.admin-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  padding: 30px 10px;
}

.admin-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.admin-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}

.admin-card h2 {
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 16px;
}

.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-card__header h2 {
  margin-bottom: 0;
}

.admin-card__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-form__submit {
  grid-column: 1 / -1;
  justify-self: start;
}

.bulk-import {
  margin-bottom: 20px;
}

.bulk-import__uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0;
}

@media (max-width: 720px) {
  .bulk-import__uploads {
    grid-template-columns: 1fr;
  }
}

.bulk-import .photo-manager__dropzone {
  margin: 0;
}

.admin-form__nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* ===== Formulario "Agregar nuevo producto" ===== */
.add-product-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.add-product-card__title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
}

.add-product-card__title--small {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.add-product-form-v2 {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.add-product-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.add-product-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.add-product-field input,
.add-product-field select,
.add-product-field textarea {
  font: 0.92rem/1.4 inherit;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

.add-product-field textarea {
  resize: vertical;
}

.add-product-field input:focus,
.add-product-field select:focus,
.add-product-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.add-product-preview {
  position: sticky;
  top: 20px;
}

.add-product-preview__image {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
}

.add-product-preview__image span {
  color: var(--muted);
  font-size: 0.82rem;
}

.add-product-preview__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.add-product-preview__category {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
  margin-bottom: 6px;
}

.add-product-preview__name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.add-product-preview__price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 900px) {
  .add-product-layout {
    grid-template-columns: 1fr;
  }

  .add-product-preview {
    position: static;
  }
}

@media (max-width: 640px) {
  .add-product-row {
    grid-template-columns: 1fr;
  }
}

.add-product__photo {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== Gestor de fotos: subir varias y reordenar arrastrando (agregar producto + editar) ===== */
.photo-manager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-manager:empty {
  display: none;
}

.photo-manager__item {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--white);
  cursor: grab;
  transition: border-color 0.15s ease;
}

.photo-manager__item:active {
  cursor: grabbing;
}

.photo-manager__item--main {
  border-color: var(--accent);
}

.photo-manager__item--drag-over {
  border-color: var(--accent-dark);
  border-style: dashed;
}

.photo-manager__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.photo-manager__badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: var(--navy);
  font-size: 0.58rem;
  font-weight: 700;
  text-align: center;
  padding: 1px 0;
}

.photo-manager__remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: var(--white);
  font-size: 0.65rem;
  cursor: pointer;
  line-height: 1;
}

.photo-manager__dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 14px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.photo-manager__dropzone:hover,
.photo-manager__dropzone--drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.add-product__dropzone-icon {
  font-size: 2rem;
}

.add-product__dropzone-hint {
  font-size: 0.7rem;
  color: #94a3b8;
}

.add-product__checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.add-product__checkbox input {
  width: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
}

.add-product-form .admin-form__submit {
  align-self: flex-start;
  padding: 12px 26px;
  font-size: 0.9rem;
}


.admin-btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.admin-btn:hover {
  opacity: 0.9;
}

.admin-btn--primary {
  background: var(--accent);
  color: var(--navy);
}

.admin-btn--ghost {
  background: var(--paper);
  color: var(--navy);
  border: 1px solid var(--line);
}

.admin-btn--danger {
  background: #fee2e2;
  color: #b91c1c;
  padding: 6px 10px;
  border-radius: 8px;
}

.admin-btn--pulse {
  animation: admin-pulse 1.4s ease-in-out infinite;
}

@keyframes admin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(6, 182, 212, 0); }
}

.admin-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-table-toolbar__search {
  flex: 1 1 220px;
  min-width: 180px;
}

.admin-table-toolbar__filter {
  flex: 0 1 200px;
  width: auto;
}

.admin-table-toolbar__count {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ===== Filtro de estado de pedidos ===== */
.admin-status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-status-pill:hover {
  border-color: var(--accent);
}

.admin-status-pill--active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.admin-status-pill span {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
}

.admin-status-pill--active span {
  background: rgba(255, 255, 255, 0.2);
}

.admin-table-wrap {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 10px;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.02);
}

.admin-table tbody tr:hover {
  background: var(--accent-soft);
}

.admin-table tbody tr[hidden] {
  display: none;
}

.admin-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.admin-input {
  width: 100%;
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
}

.admin-input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-table__photo-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.admin-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.admin-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

/* ===== Fila de producto: nombre, precio, categoría, estado y acciones ===== */
.admin-product-name {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: transparent;
  cursor: pointer;
  text-align: left;
  transition: text-decoration-color 0.15s ease;
}

.admin-product-name:hover {
  text-decoration-color: var(--accent-dark);
}

.admin-table__reference {
  display: inline-block;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

.admin-pack-pill {
  display: inline-block;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  border: none;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 4px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-pack-pill:hover {
  opacity: 0.85;
}

.admin-pack-pill--default {
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed var(--line);
  font-weight: 600;
}

.admin-table__price-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: nowrap;
}

.admin-price {
  font-size: 0.85rem;
}

.admin-price--catalogo {
  color: var(--navy);
  font-weight: 700;
}

.admin-price--mayorista::before {
  content: "Mayor: ";
  font-weight: 400;
  color: var(--muted);
}

.admin-price--mayorista {
  color: var(--accent-dark);
  font-weight: 700;
}

.admin-pill {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-pill--category {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.admin-table__badges-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  align-items: flex-start;
  max-width: 190px;
}

.admin-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-badge--new {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-badge--active {
  background: #dcfce7;
  color: #15803d;
}

.admin-badge--paused {
  background: #f1f5f9;
  color: #64748b;
}

.admin-badge--mayorista {
  background: #fef3c7;
  color: #92400e;
}

.admin-badge--catalogo {
  background: #ede9fe;
  color: #6d28d9;
}

.admin-badge__meta {
  display: inline-block;
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
}

.admin-table__actions-inner {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.admin-action-btn {
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.admin-action-btn:active {
  transform: scale(0.92);
}

.admin-action-btn:hover {
  opacity: 0.85;
}

.admin-category-group__header .admin-action-btn--edit {
  width: auto;
  height: auto;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.admin-action-btn--edit {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.admin-action-btn--toggle {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-action-btn--delete {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-action-btn--view {
  background: #e0f2fe;
  color: #0369a1;
  text-decoration: none;
}

/* En móvil la tabla se ve como una lista de tarjetas en vez de forzar scroll horizontal */
@media (max-width: 720px) {
  .admin-table-wrap {
    max-height: none;
    border: none;
    overflow: visible;
  }

  .admin-table {
    min-width: 0;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody {
    display: block;
    width: 100%;
  }

  .admin-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
  }

  .admin-table tbody tr:nth-child(even) {
    background: var(--white);
  }

  .admin-table tbody tr[hidden] {
    display: none;
  }

  .admin-table td {
    padding: 0;
    border-bottom: none;
  }

  .admin-table__photo {
    flex: 0 0 auto;
  }

  .admin-thumb,
  .admin-thumb--empty {
    width: 52px;
    height: 52px;
  }

  .admin-table tbody tr > td:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
  }

  .admin-table__price,
  .admin-table tbody tr > td:nth-child(4),
  .admin-table__badges {
    flex: 1 1 calc(50% - 5px);
  }

  .admin-table__actions {
    flex: 1 1 100%;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px dashed var(--line);
  }

  .admin-table__actions-inner {
    justify-content: flex-end;
  }

  .admin-action-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
}

/* ===== Pedidos ===== */
.admin-orders-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ===== Dashboard: feed de productos agregados ===== */
.admin-dashboard-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-dashboard-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
}

.admin-dashboard-item:last-child {
  border-bottom: none;
}

.admin-dashboard-item__thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--paper);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}

.admin-dashboard-item__info {
  flex: 1 1 auto;
  min-width: 0;
}

.admin-dashboard-item__name {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
}

.admin-dashboard-item__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
  flex-wrap: wrap;
}

.admin-dashboard-item__price {
  font-weight: 700;
  color: var(--accent-dark);
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-dashboard-item__time {
  flex: 0 0 auto;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-order {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--paper);
}

.admin-order__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.admin-order__header strong {
  color: var(--navy);
  margin-right: 8px;
}

.admin-order__mode {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.admin-order__mode--mayorista {
  background: #fef3c7;
  color: #92400e;
}

.admin-order__channel {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  margin-left: 6px;
}

.admin-order__date {
  font-size: 0.75rem;
  color: var(--muted);
}

.admin-order__contact,
.admin-order__company,
.admin-order__address,
.admin-order__notes {
  font-size: 0.82rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.admin-order__items {
  list-style: none;
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--navy);
}

.admin-order__items li {
  padding: 2px 0;
}

.admin-order__footer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-order__total {
  font-weight: 700;
  color: var(--navy);
}

.admin-order__payment {
  font-size: 0.82rem;
  color: var(--muted);
}

.admin-order__status {
  font: inherit;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  margin-left: auto;
}

/* ===== Modal de detalles extendidos del producto ===== */
.details-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.details-modal[hidden] {
  display: none;
}

.details-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.details-modal__panel {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.details-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--white);
}

.details-modal__header h2 {
  font-size: 1.1rem;
  color: var(--navy);
}

.details-modal__body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.details-modal__section h3 {
  font-size: 0.9rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.details-modal__section input:not([type="checkbox"]),
.details-modal__section select,
.details-modal__section textarea {
  width: 100%;
  font: inherit;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
}

.details-modal__section textarea {
  resize: vertical;
}

.details-modal__section > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
}

.details-modal__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

.details-modal__toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.details-modal__row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

.details-modal__footer {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  position: sticky;
  bottom: 0;
  background: var(--white);
}


/* ===== Categorías y subcategorías ===== */
.admin-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.admin-categories-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-category-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--paper);
  transition: background 0.12s ease;
}

.admin-category-group.admin-category-drag-over {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.admin-drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  user-select: none;
}

.admin-drag-handle:active {
  cursor: grabbing;
}

.admin-category-group__header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-category-group__label {
  flex: 1 1 200px;
  min-width: 140px;
  font-weight: 700;
  color: var(--navy);
  background: var(--white);
}

.admin-category-group__header .admin-pill,
.admin-category-group__header .admin-action-btn,
.admin-category-group__header .admin-category-mode-badges {
  flex-shrink: 0;
}

.admin-category-mode-badges {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.admin-category-group__subs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-left: 18px;
  border-left: 2px dashed var(--line);
}

.admin-category-group__empty {
  font-size: 0.8rem;
  color: var(--muted);
  padding-left: 4px;
}

.admin-category-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 8px;
  transition: background 0.12s ease;
}

.admin-category-sub.admin-category-drag-over {
  background: var(--accent-soft);
}

.admin-category-sub__arrow {
  color: var(--muted);
  flex: 0 0 auto;
}

.admin-category-sub__label {
  flex: 1 1 160px;
  min-width: 120px;
  background: var(--white);
}

.admin-category-sub__move {
  flex: 1 1 180px;
  min-width: 160px;
  max-width: 220px;
  background: var(--white);
}

.admin-category-sub .admin-pill,
.admin-category-sub .admin-action-btn,
.admin-category-sub .admin-category-mode-badges {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .admin-category-group__header,
  .admin-category-sub {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-category-group__subs {
    padding-left: 12px;
  }
}

/* ===== Categorías adicionales (etiquetas de búsqueda en el formulario de producto) ===== */
.add-product__extra-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.add-product__extra-categories-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--navy);
}

.admin-hint--tight {
  margin: 0 0 4px;
}

.admin-category-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 180px;
  overflow-y: auto;
}

.admin-category-checklist__group-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-top: 6px;
}

.admin-category-checklist__group-label:first-child {
  margin-top: 0;
}

.admin-checkbox-pill {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  font-size: 0.82rem;
  font-weight: 400 !important;
  color: var(--ink);
  margin-right: 12px;
}

.admin-checkbox-pill input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.admin-pill--extra {
  background: #f1f5f9;
  color: #475569;
  margin-left: 4px;
}
