:root {
  --bg: #faf6f7;
  --surface: #ffffff;
  --border: #ecdfe4;
  --text: #2c1f26;
  --muted: #8b7680;
  --primary: #b03a63;
  --primary-dark: #8d2c4e;
  --primary-soft: #fbeef3;
  --ok: #1f8a5f;
  --ok-soft: #e8f6f0;
  --warn: #c47a12;
  --warn-soft: #fdf3e2;
  --danger: #c0392b;
  --inv: #6c5ce7;
  --inv-soft: #eeecfd;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(44, 31, 38, .06), 0 8px 24px rgba(44, 31, 38, .06);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; }
a { color: var(--primary); }
.muted { color: var(--muted); margin: .2rem 0 0; font-size: .9rem; }
.num { text-align: right; }

/* ---------- Login ---------- */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1.5rem;
  background: linear-gradient(140deg, #f3d9e3, #faf6f7 45%, #e8dcf5);
}
.login-card {
  background: var(--surface); padding: 2.2rem; border-radius: 20px;
  box-shadow: var(--shadow); width: 100%; max-width: 380px; text-align: center;
}
.login-mark {
  width: 60px; height: 60px; margin: 0 auto 1rem; border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), #d9749b);
  color: #fff; font-weight: 700; font-size: 1.35rem;
  display: flex; align-items: center; justify-content: center;
}
.login-card label { display: block; text-align: left; margin: 1rem 0 0; font-size: .85rem; color: var(--muted); }
.login-card input { margin-top: .35rem; }
.login-card .btn-block { margin-top: 1.5rem; }
.alert {
  background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2;
  padding: .6rem .8rem; border-radius: 10px; font-size: .85rem; margin-top: 1rem;
}

/* ---------- Layout ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .8rem 1.5rem; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 650; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; color: #fff; font-size: .8rem;
  background: linear-gradient(135deg, var(--primary), #d9749b);
  display: flex; align-items: center; justify-content: center;
}
.nav { display: flex; gap: .3rem; margin-right: auto; }
.nav a {
  padding: .45rem .9rem; border-radius: 10px; text-decoration: none;
  color: var(--muted); font-weight: 550; font-size: .92rem;
}
.nav a:hover { background: var(--primary-soft); color: var(--primary); }
.nav a.active { background: var(--primary); color: #fff; }
.user { display: flex; align-items: center; gap: .8rem; font-size: .88rem; color: var(--muted); }
.user > a:first-child { color: var(--muted); text-decoration: none; }
.user > a:first-child:hover, .user .user-activo { color: var(--primary); }
.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }

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

/* ---------- Botones y campos ---------- */
.btn, .btn-ghost {
  font: inherit; font-weight: 550; cursor: pointer; border-radius: 10px;
  padding: .55rem 1.1rem; border: 1px solid transparent; transition: .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; border-radius: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; text-decoration: underline; }
.danger-link { color: var(--danger); }

input, select, textarea {
  font: inherit; width: 100%; padding: .5rem .7rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; }
.field { display: block; margin-bottom: .9rem; font-size: .85rem; color: var(--muted); }
.field > input, .field > select, .field > textarea { margin-top: .3rem; color: var(--text); }
fieldset.field { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; }
legend { padding: 0 .4rem; }
.hint { display: block; margin-top: .25rem; font-size: .78rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.radios { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.radio { display: flex; align-items: center; gap: .4rem; color: var(--text); font-size: .9rem; }
.radio input { width: auto; }

/* ---------- Filtros ---------- */
.filtros {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem; margin-bottom: 1.2rem;
}
.filtros input[type="search"] { flex: 1 1 240px; }
.filtros select, .filtros input[type="date"] { width: auto; }
.inline { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.2rem; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--muted);
  border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow);
}
.stat-label { display: block; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat strong { display: block; font-size: 1.4rem; margin-top: .2rem; }
.stat-sub { display: block; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.stat-ok { border-left-color: var(--ok); } .stat-ok strong { color: var(--ok); }
.stat-warn { border-left-color: var(--warn); } .stat-warn strong { color: var(--warn); }
.stat-inv { border-left-color: var(--inv); } .stat-inv strong { color: var(--inv); }
.stat-gain { border-left-color: var(--primary); } .stat-gain strong { color: var(--primary); }

/* ---------- Tarjetas de pedido (Diseño Premium Minimalista) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(44, 31, 38, .04), 0 1px 3px rgba(44, 31, 38, .02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(44, 31, 38, .08), 0 2px 6px rgba(44, 31, 38, .04);
}

/* ========================================================
   ESTADO ENTREGADO: Fondo verde suave, distinguible y elegante
   ======================================================== */
.card.card-entregado {
  background: linear-gradient(165deg, #eaf7f1 0%, #dcf3e8 100%);
  border-color: #9ee0c4;
  box-shadow: 0 4px 18px rgba(31, 138, 95, 0.1);
}

.card.card-entregado:hover {
  box-shadow: 0 12px 30px rgba(31, 138, 95, 0.18);
  border-color: #79d4b0;
}

.card.card-entregado .card-montos-box {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  border-color: rgba(31, 138, 95, 0.2);
}

.card.card-entregado .card-codigo-pill {
  background: #1f8a5f;
  color: #ffffff;
}

.card.card-entregado .card-footer-actions {
  background: rgba(255, 255, 255, 0.55);
  border-top-color: rgba(31, 138, 95, 0.15);
}

.card.card-entregado .card-notas-box {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(31, 138, 95, 0.25);
  color: #176544;
}

/* Estado Cancelado / Proceso */
.card.card-cancelado {
  opacity: 0.85;
  background: #fcf6f6;
  border-color: #f3d0ce;
}
.card.card-proceso {
  border-color: #c7c0f8;
}

/* Top Meta Bar */
.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .8rem 1rem .6rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.card-meta-left {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  flex-wrap: wrap;
}

.card-codigo-pill {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--primary-soft);
  color: var(--primary);
  padding: .2rem .55rem;
  border-radius: 7px;
  font-family: inherit;
}

.card-cliente-pill {
  font-size: .83rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-ws {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: #25d366;
  color: #fff !important;
  text-decoration: none;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 600;
  transition: transform 0.15s, background 0.15s;
  line-height: 1;
}

.btn-ws:hover {
  background: #1eb857;
  transform: scale(1.05);
}

/* Estado Badges */
.badge-estado {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Body & Content Layout */
.card-body-wrap {
  display: flex;
  gap: .9rem;
  padding: .9rem 1rem .6rem;
}

.card-thumb {
  width: 82px;
  height: 82px;
  flex: none;
  border-radius: 14px;
  object-fit: cover;
  background: var(--primary-soft);
  cursor: zoom-in;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  border: 1px solid rgba(0, 0, 0, .05);
  transition: transform .2s;
}

.card-thumb:hover {
  transform: scale(1.03);
}

.card-thumb.sin-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  background: linear-gradient(135deg, var(--primary-soft), #f6e6ec);
  font-size: 1.7rem;
}

.card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.card-desc {
  font-size: .98rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-details-grid {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin-top: .15rem;
}

.detail-badge {
  font-size: .79rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .3rem;
}

.detail-badge strong {
  color: var(--text);
  font-weight: 600;
}

.detail-badge.highlight-entrega {
  font-size: .95rem;
  color: var(--primary-dark);
  background: rgba(176, 58, 99, 0.08);
  padding: .28rem .6rem;
  border-radius: 8px;
  border: 1px solid rgba(176, 58, 99, 0.18);
  margin-top: .2rem;
  margin-bottom: .1rem;
}

.highlight-entrega span {
  font-weight: 600;
}

.highlight-entrega strong {
  color: var(--primary-dark);
  font-size: 1.02rem;
  font-weight: 800;
}

.card-lugar-badge {
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .55rem;
  border-radius: 8px;
  margin-top: .2rem;
  display: inline-block;
  align-self: flex-start;
}

.card-lugar-badge.is-plaza {
  background: rgba(31, 138, 95, 0.08);
  color: var(--ok);
}

.card-lugar-badge.is-delivery {
  background: rgba(196, 122, 18, 0.1);
  color: #9c5c08;
}

.card-lugar-badge.is-agencia {
  background: rgba(176, 58, 99, 0.1);
  color: var(--primary-dark);
}

.btn-ver-agencia {
  background: rgba(176, 58, 99, 0.12);
  color: var(--primary-dark);
  border: 1px solid rgba(176, 58, 99, 0.2);
  padding: .1rem .45rem;
  border-radius: 6px;
  font-size: .7rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: .35rem;
  transition: background .15s, transform .15s;
}

.btn-ver-agencia:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.dir-text {
  display: block;
  font-weight: 400;
  font-size: .73rem;
  opacity: .9;
  margin-top: .1rem;
}

.card-notas-box {
  margin-top: .35rem;
  background: rgba(0, 0, 0, .025);
  border: 1px dashed rgba(0, 0, 0, .1);
  border-radius: 8px;
  padding: .35rem .6rem;
  font-size: .77rem;
  color: var(--muted);
  line-height: 1.35;
  display: flex;
  gap: .3rem;
}

/* Box de Montos (Financial Grid) */
.card-montos-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .3rem;
  margin: .6rem 1rem;
  padding: .6rem .8rem;
  background: #fdfafb;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.monto-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.monto-title {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
}

.monto-value {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .1rem;
}

.monto-item.is-saldado .monto-value {
  color: var(--ok);
}

.monto-item.is-pendiente .monto-value {
  color: var(--warn);
}

/* Footer Actions */
.card-footer-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.4);
  margin-top: auto;
}

.estado-select-container {
  flex: 1;
  min-width: 110px;
}

.select-estado-pill {
  width: 100%;
  font-size: .79rem;
  font-weight: 600;
  padding: .3rem .5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.btns-group {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.btn-card-action {
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-card-action:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-card-action.btn-cobrar:hover {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.btn-card-action.btn-del:hover {
  background: #fdecea;
  border-color: var(--danger);
  color: var(--danger);
}

.tag {
  display: inline-block; padding: .1rem .5rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-info { background: var(--inv-soft); color: var(--inv); }
.tag-muted { background: #f1eaed; color: var(--muted); }
.tag-danger { background: #fdecea; color: var(--danger); }
.badge-estado { float: right; }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
.tabla th { background: #fdfafb; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #fdfafb; }
.tabla-simple { box-shadow: none; }
.fila-fuerte td { font-weight: 650; background: var(--primary-soft); }
.vacio { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* ---------- Paneles y gráfico ---------- */
.panel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1.2rem;
}
.panel h2 { margin-bottom: .8rem; }
.grafico { display: flex; align-items: flex-end; gap: .9rem; height: 210px; overflow-x: auto; padding-top: .5rem; }
.g-mes { display: flex; flex-direction: column; align-items: center; gap: .35rem; min-width: 54px; }
.g-barras { display: flex; align-items: flex-end; gap: 3px; height: 160px; }
.g-barra { width: 12px; border-radius: 4px 4px 0 0; min-height: 2px; }
.g-ing { background: var(--primary); } .g-inv { background: var(--inv); } .g-gan { background: var(--ok); }
.g-label { font-size: .72rem; color: var(--muted); }
.leyenda { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }
.sw-ing { background: var(--primary); } .sw-inv { background: var(--inv); } .sw-gan { background: var(--ok); }
.lugares { display: flex; gap: .8rem; margin-top: .8rem; flex-wrap: wrap; }
.lugar-chip { flex: 1 1 140px; background: #fdfafb; border: 1px solid var(--border); border-radius: 12px; padding: .6rem .8rem; font-size: .82rem; }
.lugar-chip b { display: block; font-size: 1rem; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(44, 31, 38, .5); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 1rem; overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--surface); border-radius: 18px; width: 100%; max-width: 460px;
  padding: 1.4rem; box-shadow: 0 20px 60px rgba(44, 31, 38, .28); max-height: 92vh; overflow-y: auto;
}
.modal-lg { max-width: 760px; }
.modal-img { max-width: 640px; padding: .8rem; position: relative; }
.modal-img img { width: 100%; border-radius: 12px; display: block; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-close { background: none; border: 0; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }

.resumen-pago {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem;
  background: var(--primary-soft); border-radius: 12px; padding: .7rem .9rem; margin-bottom: 1rem;
  font-size: .8rem;
}
.resumen-pago span { display: block; color: var(--muted); font-size: .72rem; }
.resumen-pago strong { font-size: 1rem; }
.resumen-pago .pend strong { color: var(--warn); }
.resumen-pago .gan strong { color: var(--ok); }
.preview-wrap { margin-bottom: 1rem; }
.preview-wrap img { max-height: 190px; border-radius: 12px; border: 1px solid var(--border); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translate(-50%, 130%);
  background: var(--text); color: #fff; padding: .7rem 1.2rem; border-radius: 12px;
  font-size: .88rem; z-index: 90; transition: transform .25s; max-width: 90vw;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---------- Catálogo de Productos ---------- */
.cards-catalogo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.25rem;
}

.card-prod {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(44, 31, 38, .04), 0 1px 3px rgba(44, 31, 38, .02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card-prod:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(44, 31, 38, .08);
}

.card-prod-top {
  display: flex;
  gap: .9rem;
  padding: 1.1rem 1.1rem .6rem;
}

.card-prod-thumb {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: 14px;
  object-fit: cover;
  background: var(--primary-soft);
  cursor: zoom-in;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  border: 1px solid rgba(0, 0, 0, .05);
  transition: transform .2s;
}

.card-prod-thumb:hover {
  transform: scale(1.04);
}

.card-prod-thumb.sin-foto {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  background: linear-gradient(135deg, var(--primary-soft), #f6e6ec);
  font-size: 1.8rem;
}

.card-prod-header {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.card-prod-code-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-prod-codigo {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: var(--primary-soft);
  color: var(--primary);
  padding: .15rem .5rem;
  border-radius: 6px;
}

.card-prod-precio {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.card-prod-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: .1rem 0;
  line-height: 1.3;
}

.card-prod-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .2rem;
}

.tag-cat {
  background: #eeecfd;
  color: #5c4be4;
  font-size: .7rem;
  font-weight: 650;
  padding: .1rem .45rem;
  border-radius: 6px;
}

.tag-genero {
  background: #fbeef3;
  color: #b03a63;
  font-size: .7rem;
  font-weight: 650;
  padding: .1rem .45rem;
  border-radius: 6px;
}

.tag-material {
  background: #fef4e8;
  color: #b06900;
  font-size: .7rem;
  font-weight: 650;
  padding: .1rem .45rem;
  border-radius: 6px;
}

.tag-flor {
  background: #eaf7f1;
  color: #1f8a5f;
  font-size: .7rem;
  font-weight: 650;
  padding: .1rem .45rem;
  border-radius: 6px;
}

.card-prod-body {
  padding: .4rem 1.1rem .8rem;
}

.card-prod-incluye {
  background: #faf6f8;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: .6rem .8rem;
}

.incluye-title {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .2rem;
}

.incluye-text {
  font-size: .83rem;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
  white-space: pre-wrap;
}

.card-prod-footer {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1.1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.4);
  margin-top: auto;
}

.btn-copy-chat {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(135deg, #25d366, #1eb857);
  color: #ffffff;
  border: none;
  padding: .4rem .75rem;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

.btn-copy-chat:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.card-prod-btns {
  display: flex;
  gap: .3rem;
}

@media (max-width: 900px) {
  .stats, .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .panel-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0.8rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .resumen-pago { grid-template-columns: repeat(2, 1fr); }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: .2rem; }
  .topbar { padding: .7rem 1rem; gap: .8rem; }
  .cards, .cards-catalogo { grid-template-columns: 1fr; gap: 1rem; }
  .filtros input[type="search"], .filtros select { width: 100%; flex: 1 1 100%; }
  .card-prod-footer { flex-direction: column; align-items: stretch; gap: .6rem; }
  .btn-copy-chat { justify-content: center; width: 100%; }
  .card-prod-btns { justify-content: space-between; width: 100%; }
  .card-prod-btns .btn-card-action { flex: 1; text-align: center; justify-content: center; }
  .card-footer-actions { flex-direction: column; align-items: stretch; gap: .6rem; }
  .card-footer-actions .select-estado-pill { width: 100%; }
  .card-footer-actions .btns-group { justify-content: space-between; width: 100%; }
  .card-footer-actions .btn-card-action { flex: 1; text-align: center; justify-content: center; }
}

