/* Panel de administración de Carpimat. Misma marca que el sitio (manual 2026). */

@font-face {
  font-family: "DM Sans";
  src: url("/fonts/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: "Lexend";
  src: url("/fonts/lexend.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #de7b01;
  --brand-hover: #f08b10;
  --brand-ink: #000000;
  --brand-soft: #fdf4e8;
  --brand-text: #9a5400;
  --ink: #111111;
  --ink-soft: #454f5e;
  --ink-muted: #7a7a7a;
  --page: #f5f5f4;
  --surface: #ffffff;
  --sunken: #f7f7f7;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --dark: #111111;
  --ok: #1e7f4f;
  --ok-bg: #e4f5ec;
  --warn: #9a6100;
  --warn-bg: #fdf3e3;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --radius: 10px;
  --radius-control: 8px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 14px rgb(0 0 0 / 0.05);
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Lexend", "DM Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.1rem;
}

p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------ marco */

.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 0.9rem 1rem;
  background: #111;
  color: #fff;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem 0.4rem;
}

.side-brand img {
  width: 150px;
  height: auto;
}

.side-brand span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.5);
}

.side-close {
  display: none;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-group {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.side-label {
  margin: 0 0 0.3rem;
  padding: 0 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 0.42);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-control);
  color: rgb(255 255 255 / 0.78);
  font-size: 0.93rem;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.side-nav a svg {
  flex: none;
  opacity: 0.85;
}

.side-nav a:hover {
  background: rgb(255 255 255 / 0.07);
  color: #fff;
}

.side-nav a[aria-current="page"] {
  background: var(--brand);
  color: #000;
  font-weight: 700;
}

.side-nav a[aria-current="page"] svg {
  opacity: 1;
}

.side-badge {
  margin-left: auto;
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--brand);
  color: #000;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.side-nav a[aria-current="page"] .side-badge {
  background: #000;
  color: #fff;
}

.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem 0.5rem 0;
  border-top: 1px solid rgb(255 255 255 / 0.1);
}

.side-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.side-user strong {
  display: block;
  font-size: 0.9rem;
  line-height: 1.2;
}

.side-user small {
  color: rgb(255 255 255 / 0.55);
  font-size: 0.78rem;
}

.side-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  font-weight: 700;
}

.side-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: rgb(255 255 255 / 0.65);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.side-logout:hover {
  color: #fff;
}

.side-scrim {
  display: none;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 62px;
  padding: 0.6rem 2rem;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: saturate(180%) blur(14px);
}

.topbar-menu,
.topbar-logo {
  display: none;
}

.topbar-spacer {
  flex: 1;
}

.topbar-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 0.86rem;
  font-weight: 700;
}

.topbar-pending .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgb(222 123 1 / 0.2);
}

.topbar-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ok);
  font-size: 0.86rem;
  font-weight: 600;
}

.topbar .btn {
  min-height: 2.4rem;
}

.main {
  width: 100%;
  max-width: 1180px;
  padding: 1.75rem 2rem 4rem;
}

@media (max-width: 960px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(290px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.25s ease;
    box-shadow: 10px 0 40px rgb(0 0 0 / 0.3);
  }

  .menu-open .side {
    transform: none;
  }

  .side-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--radius-control);
    background: rgb(255 255 255 / 0.08);
    color: #fff;
    cursor: pointer;
  }

  .menu-open .side-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgb(0 0 0 / 0.45);
  }

  .topbar {
    padding: 0.5rem 1rem;
  }

  .topbar-menu {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: #fff;
    cursor: pointer;
  }

  .topbar-logo {
    display: block;
  }

  .main {
    padding: 1.25rem 1rem 3rem;
  }
}

@media (max-width: 640px) {
  .pending-long {
    display: none;
  }

  .topbar-site span,
  .topbar-ok {
    display: none;
  }

  .topbar-pending {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
  }
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head p {
  color: var(--ink-muted);
  margin-top: 0.25rem;
}

/* ---------------------------------------------------------- tarjetas */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.card + .card {
  margin-top: 1.25rem;
}

.card-title {
  margin-bottom: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------- formularios */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field > span,
label.field > span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.field small {
  color: var(--ink-muted);
  font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  padding: 0.6rem 0.8rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgb(236 149 7 / 0.2);
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input.code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.4rem;
  letter-spacing: 0.4em;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-family: var(--display);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--brand-ink);
}

.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* ------------------------------------------------------------ avisos */

.alert {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-control);
  border: 1px solid;
  font-size: 0.95rem;
}

.alert-error {
  background: var(--danger-bg);
  border-color: #f3c0bb;
  color: var(--danger);
}

.alert-ok {
  background: var(--ok-bg);
  border-color: #b9e4cb;
  color: var(--ok);
}

.alert-warn {
  background: var(--warn-bg);
  border-color: #f6dfb5;
  color: var(--warn);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.badge-off {
  background: var(--sunken);
  color: var(--ink-muted);
}

/* ------------------------------------------------------------ tablas */

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

.table th,
.table td {
  text-align: left;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 600;
}

.table tr:hover td {
  background: var(--sunken);
}

.thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--sunken);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------- login */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 0%, rgb(236 149 7 / 0.18), transparent 45%),
    var(--dark);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
}

.auth-brand {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}

.auth-brand span {
  color: var(--brand);
}

.auth-sub {
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 1.25rem 0;
}

.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------------------------------------------------------- utilidades */

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.qr {
  width: 200px;
  height: 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  padding: 0.5rem;
  background: #fff;
}

.mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
  word-break: break-all;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------ biblioteca */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.media-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-item img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: contain;
  background: var(--sunken);
  padding: 0.5rem;
}

.media-item .media-body {
  padding: 0.6rem 0.7rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.media-item .media-name {
  font-weight: 600;
  word-break: break-all;
}

.media-item input[type="text"] {
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.media-item .btn {
  min-height: 2rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

/* selector */

.picker {
  width: min(900px, 95vw);
  max-height: 85vh;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.3);
}

.picker::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.picker-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
}

.picker-head input {
  flex: 1;
  padding: 0.45rem 0.7rem;
}

.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
  padding: 1rem;
  overflow: auto;
  max-height: calc(85vh - 60px);
}

.picker-item {
  border: 2px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  padding: 0.3rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font: inherit;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: left;
}

.picker-item:hover {
  border-color: var(--brand);
}

.picker-item img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: contain;
  background: var(--sunken);
}

.picker-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* campo de imagen (vista previa + botones) */

.image-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.image-field img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.image-field img[hidden] {
  display: none;
}

.image-field .placeholder {
  width: 72px;
  height: 72px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-control);
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

/* galería del producto */

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gallery-item {
  width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.75rem;
}

.gallery-item img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: contain;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.gallery-item .row {
  gap: 0.25rem;
}

.gallery-item .btn {
  min-height: 1.8rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
}

/* filas de la ficha técnica */

.attr-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

/* registro de publicación */

.log {
  background: var(--dark);
  color: #d7d7d7;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 1rem;
  border-radius: var(--radius-control);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow: auto;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.toolbar form {
  display: flex;
  gap: 0.5rem;
}

.toolbar input[type="search"] {
  width: 280px;
  max-width: 100%;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--brand);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.pager {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1rem;
}

.pager a,
.pager span {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: 0.85rem;
}

.pager [aria-current] {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  font-weight: 600;
}

/* ------------------------------------------------------------ inicio */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stat {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}

.stat:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.stat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-control);
  background: var(--sunken);
  color: var(--ink-soft);
}

.stat-icon.is-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.stat-icon.is-warn {
  background: var(--warn-bg);
  color: var(--warn);
}

.stat-icon.is-brand {
  background: var(--brand);
  color: #000;
}

.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-body small {
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.stat-body strong {
  font-family: var(--display);
  font-size: 1.45rem;
  line-height: 1.2;
}

.stat-body em {
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-style: normal;
}

.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.quick a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-weight: 600;
  transition: border-color 0.15s, background-color 0.15s;
}

.quick a:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.quick a svg {
  color: var(--brand-text);
}

.tasks,
.activity {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tasks a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--line);
}

.tasks li:last-child a {
  border-bottom: 0;
}

.tasks a > svg:first-child {
  color: var(--warn);
}

.tasks a > svg:last-child {
  margin-left: auto;
  color: var(--ink-muted);
}

.tasks a:hover span {
  text-decoration: underline;
}

.activity li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.activity li:last-child {
  border-bottom: 0;
}

.activity time {
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.85rem;
}

.side-avatar.is-light {
  background: var(--sunken);
  color: var(--ink-soft);
  width: 30px;
  height: 30px;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .stats,
  .quick {
    grid-template-columns: 1fr;
  }
}

.grid-2 > .card + .card {
  margin-top: 0;
}

/* ----------------------------------------------------- formularios 2 */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.form-grid .is-wide {
  grid-column: 1 / -1;
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.mb-1 {
  margin-bottom: 1rem;
}

.mt-1 {
  margin-top: 0.75rem;
}

/* Barra de guardar pegada abajo en formularios largos. */
.savebar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 -0.5rem;
  padding: 0.85rem 0.5rem;
  border-top: 1px solid var(--line);
  background: rgb(245 245 244 / 0.92);
  backdrop-filter: blur(8px);
}

/* -------------------------------------------------------- categorías */

.card-flush {
  padding: 0.25rem 0;
}

.cat-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.cat-list li:last-child {
  border-bottom: 0;
}

.cat-list li.is-hidden .cat-name,
.cat-list li.is-hidden .cat-thumb {
  opacity: 0.5;
}

.cat-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-text);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.cat-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: var(--brand-soft);
  color: var(--brand-text);
}

.cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cat-name {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.cat-name strong {
  font-size: 0.95rem;
}

.cat-name small {
  color: var(--ink-muted);
}

.cat-name:hover strong {
  color: var(--brand-text);
}

/* Interruptor sí/no. */
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color 0.2s;
}

.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.2s;
}

.switch.on {
  background: var(--ok);
}

.switch.on span {
  transform: translateX(18px);
}

.btn-sm {
  min-height: 2.1rem;
  padding: 0.3rem 0.8rem;
  font-size: 0.88rem;
}

.back {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--brand-text);
  font-weight: 600;
  font-size: 0.9rem;
}

.danger-zone {
  border-color: #f2c4bf;
}

.link {
  color: var(--brand-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------------------------------------------------------- mensajes */

.tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
}

.tabs a {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.tabs a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  color: var(--ink-muted);
  text-align: center;
}

.messages {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message.is-new {
  border-left: 4px solid var(--brand);
}

.message-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.message-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
}

.message-body {
  margin: 0.75rem 0 1rem;
  white-space: pre-line;
  line-height: 1.6;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.message-contact {
  font-size: 0.88rem;
}

.message-status {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.temp-pass {
  display: block;
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-control);
  background: #fff;
  font-size: 1.1rem;
  user-select: all;
}

/* --------------------------------------------------- lista productos */

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filters-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.4rem 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filters-search > svg {
  color: var(--ink-muted);
}

.filters-search input[type="search"] {
  flex: 1;
  min-width: 180px;
  border: 0;
  padding: 0.45rem 0.25rem;
  background: transparent;
  font: inherit;
  outline: none;
}

.filters-search select {
  max-width: 230px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip.on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.chip-clear {
  border-style: dashed;
}

.prod-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.prod-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
}

.prod-list li:last-child {
  border-bottom: 0;
}

.prod-list li.is-hidden .prod-name,
.prod-list li.is-hidden .prod-thumb {
  opacity: 0.45;
}

.prod-thumb {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sunken);
  color: var(--line-strong);
}

.prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.prod-name {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.prod-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.93rem;
}

.prod-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.prod-name:hover strong {
  color: var(--brand-text);
}

.prod-price {
  color: var(--ink);
  font-weight: 700;
}

.prod-price.is-empty {
  color: var(--brand-text);
  font-weight: 600;
}

.prod-stock select {
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
}

.prod-stock select.stock-instock {
  border-color: #b7e0c8;
  background: var(--ok-bg);
  color: var(--ok);
}

.prod-stock select.stock-onbackorder {
  border-color: #f2d6a8;
  background: var(--warn-bg);
  color: var(--warn);
}

.prod-stock select.stock-outofstock {
  border-color: #f2c4bf;
  background: var(--danger-bg);
  color: var(--danger);
}

.star {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--line-strong);
  cursor: pointer;
}

.star:hover {
  background: var(--sunken);
  color: var(--brand);
}

.star.on {
  color: var(--brand);
}

.star.on svg {
  fill: var(--brand);
}

@media (max-width: 700px) {
  .prod-list li {
    flex-wrap: wrap;
  }

  .prod-name {
    flex-basis: calc(100% - 64px);
  }

  .prod-stock {
    margin-left: 60px;
  }

  .prod-edit {
    margin-left: auto;
  }
}

.pending-short {
  display: none;
}

@media (max-width: 640px) {
  .pending-short {
    display: inline;
  }
}
