:root {
  --bg: #07070a;
  --bg-soft: #0f0f12;
  --panel: #141210;
  --panel-alt: #1c150f;
  --text: #f6efe6;
  --muted: #a89a8c;
  --accent: #f97d02;
  --accent-2: #ff9a3c;
  --ok: #8adbb5;
  --warn: #ffcf7a;
  --line: #332920;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1000px 700px at 12% 0%, #3a1e02 0%, transparent 55%),
              radial-gradient(900px 800px at 92% 100%, #2a1205 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  font-family: "Bahnschrift", "Segoe UI", sans-serif;
}

.bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(70px);
  opacity: 0.28;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  background: #f97d02;
  top: -80px;
  left: -60px;
}

.bg-shape-b {
  width: 280px;
  height: 280px;
  background: #7a2c00;
  right: -80px;
  bottom: -80px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, 96vw);
  margin: 18px auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(249, 125, 2, 0.35));
}

.topbar h1 {
  margin: 0;
  letter-spacing: 0.03em;
}

.topbar p {
  margin: 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 10px;
  margin: 10px 0 16px;
}

.tab {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #221a12 0%, #17120d 100%);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}

.tab.is-active {
  background: linear-gradient(90deg, var(--accent), #ffb15c);
  border-color: transparent;
  color: #1a0f04;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
  animation: fade 180ms ease-out;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-alt) 100%);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head-row h2 {
  margin: 0;
}

h2, h3 {
  margin: 6px 0 10px;
}

textarea {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d0b09;
  color: var(--text);
  padding: 10px;
  resize: vertical;
}

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 6px;
}

.cat-tab {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #1c150f 0%, #16100b 100%);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.85em;
  cursor: pointer;
}

.cat-tab.is-active {
  background: linear-gradient(90deg, var(--accent), #ffb15c);
  border-color: transparent;
  color: #1a0f04;
}

.product-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 1200px){
  .product-grid{
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.product-btn {
  border: 1px solid var(--line);
  background: #17130f;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  padding: 10px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.product-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.product-btn img {
  width: 100%;
  height: 92px;
  object-fit: contain;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 8px 0 12px;
  max-height: 300px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #241c15;
  font-size: 0.95rem;
}

th {
  position: sticky;
  top: 0;
  background: #1e1710;
  text-align: left;
}

td.num,
th.num {
  text-align: right;
}

tbody tr:hover {
  background: #1d160f;
}

tbody tr.is-selected {
  background: #2c1c0c;
}

.kpi-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border: 1px dashed #4a3621;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.kpi-line strong {
  font-size: 1.4rem;
  color: var(--accent-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ticket-card {
  display: flex;
  flex-direction: column;
}

.ticket-table-wrap {
  max-height: 45vh;
}

.ticket-actions {
  margin-top: 6px;
  margin-bottom: 10px;
}

.ticket-logo {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px 6px;
  min-height: 140px;
}

.ticket-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}

button {
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent), #c75e00);
  color: #140b03;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button.ghost {
  background: linear-gradient(180deg, #3a3029, #241d17);
  color: var(--text);
  border: 1px solid var(--line);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: #171310;
}

.mini-card p {
  margin: 6px 0;
}

.kit-price-row {
  margin: 8px 0;
  align-items: center;
}
.kit-price-row input {
  max-width: 120px;
}

.muted {
  color: var(--muted);
}

.warn {
  color: var(--warn);
}

input.qty-input {
  width: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #110d0a;
  color: var(--text);
  padding: 4px 6px;
  text-align: center;
}

input.qty-input::-webkit-outer-spin-button,
input.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input.qty-input {
  appearance: textfield;
  -moz-appearance: textfield;
}

.trash-btn {
  background: linear-gradient(180deg, #cf4e35, #a83a25);
  border: 1px solid #b14b37;
  border-radius: 8px;
  min-width: 34px;
  padding: 4px 8px;
  font-size: 15px;
  line-height: 1;
  color: #fff;
}

.trash-btn:hover {
  filter: brightness(1.12);
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(940px, 94vw);
}

dialog::backdrop {
  background: rgba(2, 1, 0, 0.75);
}

.modal-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #1a140e 0%, #110d09 100%);
  color: var(--text);
  padding: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 980px) {
  .split {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .ticket-table-wrap {
    max-height: 36vh;
  }
}


/* --- Gestion de empleados / productos --- */
.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0d0b09;
  color: var(--text);
  padding: 8px 10px;
}

select.text-input {
  appearance: auto;
}

.form-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 8px 0;
}

.form-row .text-input {
  flex: 1 1 240px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

.admin-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #171310;
}

button.danger {
  background: linear-gradient(180deg, #cf4e35, #a83a25);
  color: #fff;
}

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

.subtabs {
  display: flex;
  gap: 8px;
  margin: 4px 0 14px;
}

.subtab {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #221a12 0%, #17120d 100%);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: 0.92em;
  cursor: pointer;
}

.subtab.is-active {
  background: linear-gradient(90deg, var(--accent), #ffb15c);
  border-color: transparent;
  color: #1a0f04;
}

.subtab-panel {
  display: none;
}

.subtab-panel.is-active {
  display: block;
  animation: fade 180ms ease-out;
}

.prod-thumb {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0b09;
  padding: 2px;
}

.tag-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82em;
  font-weight: 700;
  border: 1px solid var(--line);
}
.tag-pill.tag-fijo { color: #f9c27d; }
.tag-pill.tag-agregado { color: #9fe8b0; }
.tag-pill.tag-oculto { color: #e89f9f; }

.product-preview {
  margin: 10px 0;
}
.product-preview img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d0b09;
  padding: 6px;
}

/* --- Acceso con modal (sin prompt) --- */
.access-card {
  width: min(520px, 94vw);
  margin: 0 auto;
}

.access-help {
  margin: 6px 0 12px;
}

.pass-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1 1 260px;
}

.pass-wrap .text-input {
  flex: 1 1 auto;
  min-width: 180px;
}

.ghost.small {
  padding: 8px 10px;
}

.error-text {
  margin: 0;
  color: #ff9b8a;
  font-weight: 700;
  min-height: 18px;
}

/* Copiado manual (fallback cuando el navegador bloquea el portapapeles en HTTP) */
.copy-fallback-text{
  width: 100%;
  min-height: 180px;
  resize: vertical;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.35);
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}


/* Copy fallback modal tweaks */
#copy-fallback-modal .actions { flex-wrap: wrap; gap: 8px; }
#copy-fallback-modal .actions button { min-width: 140px; }

/* --- Acceso con contraseña (modal estético) --- */
#access-modal{
  width: min(560px, 94vw);
}

#access-modal .form-row{
  align-items: stretch;
}

#access-toggle{
  white-space: nowrap;
}

/* Desplegables */
select.text-input { background: #0f0c09; color: var(--text); }

.app-version { text-align: center; color: var(--muted); font-size: 0.75rem; margin: 18px 0 6px; opacity: 0.7; }

/* Pantalla de arranque al abrir la app desde la pantalla de Inicio.
   Igual que la imagen de arranque del iPhone (icons/splash-*.png). */
.app-splash { display: none; }
.is-app .app-splash {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: radial-gradient(circle at 50% 50%, #3a1e02 0%, #1c0f03 30%, var(--bg) 62%), var(--bg);
  transition: opacity 0.45s ease, visibility 0.45s;
}
.is-app .app-splash img { width: 50vw; max-width: 320px; height: auto; }
.is-app .app-splash.is-hidden { opacity: 0; visibility: hidden; }

/* ID de Discord de cada empleado (Gestión de empleados) */
.form-grid .emp-discord-new { grid-column: 1 / 3; }
.form-grid .emp-iban-new { grid-column: 3 / 4; }
.emp-iban-input { width: 105px; text-transform: uppercase; }
.emp-discord-input { min-width: 170px; font-variant-numeric: tabular-nums; }
.emp-discord-input.is-bad { border-color: #ff9a7a; }

/* Datos compartidos (Modulo de Pagos) */
.shared-box { margin: 12px 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 12px; }
.shared-box h3 { margin: 0 0 4px; font-size: 0.95rem; }
.shared-box p { margin: 0 0 6px; }
.emp-readonly-note { color: var(--accent-2); }

[hidden] { display: none !important; }
@media (max-width: 980px) {
  .form-grid .emp-discord-new, .form-grid .emp-iban-new { grid-column: auto; }
}

/* Casilla "No cobra" en Gestion de empleados */
th.center, td.center { text-align: center; }
.emp-nopay-input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }

/* Largo del concepto para el datafono (40 caracteres) */
.concept-info { margin: 4px 2px 0; font-size: 0.8rem; color: var(--muted); min-height: 1em; }
.concept-info.is-over { color: var(--warn); }

/* ==========================================================================
   Vista movil (pantallas de hasta 700px). En PC nada de esto se muestra.
   ========================================================================== */
.m-menu-btn, .m-cat-btn, .m-ticket-bar, .m-drawer, .qty-badge { display: none; }

@media (max-width: 700px) {
  html, body { overflow-x: hidden; }

  .app-shell { width: auto; margin: 0; padding: 0 12px 84px; }

  /* Cabecera compacta y fija, con el boton del menu */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    margin: 0 -12px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    background: rgba(7, 7, 10, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-brand { gap: 10px; }
  .topbar-logo { width: 36px; height: 36px; }
  .topbar h1 { font-size: 1.15rem; }
  .topbar p { display: none; }
  .m-menu-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 1.35rem;
    line-height: 1;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #1c150f;
    color: var(--text);
  }

  /* Secciones y categorias pasan al menu */
  nav.tabs { display: none; }
  #cat-tabs { display: none; }
  .m-cat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 8px 0 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #17130f;
    color: var(--text);
    font-weight: 600;
    text-align: left;
  }
  .m-cat-btn strong { flex: 1; color: var(--accent-2); }

  .card { padding: 10px; border-radius: 14px; }
  .card-head-row h2 { font-size: 1.1rem; }
  .card-head-row button { padding: 6px 10px; font-size: 0.78rem; }
  .split { gap: 10px; }
  #tab-caja .split > .card:first-child { margin-top: 10px; }

  /* Productos en lista: icono pequeno, nombre y precio en una fila */
  .product-grid { grid-template-columns: 1fr !important; gap: 6px; margin-top: 6px; }
  .product-btn {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 10px;
  }
  .product-btn:hover { transform: none; }
  .product-btn:active { background: #241a10; }
  .product-btn img { width: 34px; height: 34px; flex: none; border-radius: 8px; }
  .product-btn strong { flex: 1; font-size: 0.92rem; font-weight: 600; line-height: 1.25; }
  .product-btn small { flex: none; font-size: 0.9rem; font-weight: 700; color: var(--accent-2); }
  .qty-badge {
    display: inline-block;
    flex: none;
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 800;
    color: #1a0f04;
    background: var(--accent);
    border-radius: 999px;
    padding: 0;
  }
  .qty-badge:empty { display: none; }
  .product-btn.in-ticket .qty-badge { padding: 2px 7px; }
  .product-btn.in-ticket { border-color: rgba(249, 125, 2, 0.55); }

  /* Ticket: sin el logo grande; las acciones caben en dos filas */
  .ticket-logo { display: none; }
  .ticket-table-wrap { max-height: none; }
  /* En el movil el ticket no muestra la columna Precio (el subtotal ya lo dice) */
  .ticket-table-wrap th:nth-child(3), .ticket-table-wrap td:nth-child(3) { display: none; }
  .ticket-table-wrap th, .ticket-table-wrap td { padding: 8px 6px; }
  .ticket-table-wrap .qty-input { width: 52px; }
  .ticket-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .ticket-actions button { padding: 9px 6px; font-size: 0.8rem; }

  /* Barra del ticket abajo (solo en la Caja) */
  body.is-caja .m-ticket-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 55;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #1c150f;
    color: var(--text);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  }
  body.is-caja .m-ticket-bar.has-items { background: linear-gradient(90deg, var(--accent), #ffb15c); color: #1a0f04; border-color: transparent; }
  .m-ticket-label { font-weight: 800; }
  .m-ticket-count { flex: 1; opacity: 0.85; font-size: 0.9rem; }
  .m-ticket-bar strong { font-size: 1.05rem; }
  body.m-drawer-open .m-ticket-bar { display: none; }

  /* Menu lateral */
  .m-drawer { display: block; position: fixed; inset: 0; z-index: 200; }
  .m-drawer[hidden] { display: none; }
  .m-drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; transition: opacity 0.2s; }
  .m-drawer-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, 84vw);
    overflow-y: auto;
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-right: 1px solid var(--line);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .m-drawer.is-open .m-drawer-backdrop { opacity: 1; }
  .m-drawer.is-open .m-drawer-panel { transform: translateX(0); }
  .m-drawer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
  .m-drawer-head img { width: 32px; height: 32px; }
  .m-drawer-head strong { flex: 1; }
  .m-drawer-panel h3 { margin: 14px 4px 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
  .m-nav-list { display: grid; gap: 4px; }
  .m-nav-item {
    width: 100%;
    text-align: left;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-weight: 600;
  }
  .m-nav-item.is-active { background: #2a1d10; border-color: rgba(249, 125, 2, 0.5); color: var(--accent-2); }
}

/* ==========================================================================
   Version 20: estilo "taller industrial", iconos, ticket de recibo y aviso
   ========================================================================== */
html, body {
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(249, 125, 2, 0.22), transparent 60%),
    radial-gradient(800px 700px at 100% 110%, rgba(249, 125, 2, 0.12), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cg fill='%23ffffff' fill-opacity='.035'%3E%3Cpath d='M4 10l6-6 2 2-6 6zM18 24l6-6 2 2-6 6z'/%3E%3C/g%3E%3C/svg%3E"),
    #070708;
}

/* Cabecera: nombre metalico y franja de peligro */
.topbar { position: relative; padding-bottom: 18px; }
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  border-radius: 4px;
  background: repeating-linear-gradient(-45deg, #f97d02 0 14px, #111 14px 28px);
  box-shadow: 0 0 18px rgba(249, 125, 2, 0.35);
}
.topbar h1 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
  background: linear-gradient(180deg, #fff 0%, #ffd2a0 55%, #f97d02 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar p { text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.78rem; color: #f9a65a; }
.topbar-logo { filter: drop-shadow(0 0 14px rgba(249, 125, 2, 0.6)); }

/* Pestanas y tarjetas */
.tab { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.82rem; }
.tab.is-active { box-shadow: 0 0 0 1px #ffb15c, 0 0 22px rgba(249, 125, 2, 0.55); }
.cat-tab.is-active { box-shadow: 0 0 14px rgba(249, 125, 2, 0.5); }
.card { position: relative; border-color: #3a2c1d; background: linear-gradient(180deg, #17120d 0%, #0f0c09 100%); }
.card::before, .card::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9a8a78, #3a2e22);
  box-shadow: inset 0 0 1px #000;
  pointer-events: none;
}
.card::before { left: 10px; }
.card::after { right: 10px; }
.card h2 { text-transform: uppercase; letter-spacing: 0.06em; }
.card h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1.1em;
  margin-right: 10px;
  vertical-align: -3px;
  border-radius: 2px;
  background: linear-gradient(#ffb15c, #f97d02);
}

/* Ticket como recibo de papel */
.receipt {
  position: relative;
  margin: 6px 0 16px;
  padding: 16px 14px 20px;
  color: #2a2118;
  border-radius: 4px;
  background: #f4ecdf;
  font-family: "Courier New", ui-monospace, monospace;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
}
.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 10px;
  background:
    linear-gradient(-45deg, transparent 6px, #f4ecdf 0) 0 0 / 12px 10px,
    linear-gradient(45deg, transparent 6px, #f4ecdf 0) 0 0 / 12px 10px;
}
.receipt-head { text-align: center; border-bottom: 2px dashed #b9a88f; padding-bottom: 10px; margin-bottom: 8px; }
.receipt-head img { width: 60px; filter: grayscale(1) contrast(1.2) brightness(0.55); }
.receipt-head b { display: block; letter-spacing: 0.25em; font-size: 0.95rem; }
.receipt-head span { font-size: 0.72rem; color: #6d5e4b; }
.receipt .table-wrap { border: 0; margin: 0; background: transparent; }
.receipt table { font-family: inherit; color: inherit; }
.receipt th { background: transparent !important; color: #6d5e4b !important; border-bottom: 1px dashed #b9a88f !important; font-size: 0.72rem; text-transform: uppercase; }
.receipt td { border-bottom: 1px dotted #d5c8b4 !important; color: #2a2118 !important; font-size: 0.85rem; }
.receipt tbody tr.is-selected td { background: #e9dcc6 !important; }
.receipt .qty-input { background: #fff8ee; color: #2a2118; border-color: #cbb99f; }
.receipt-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px dashed #b9a88f; margin-top: 10px; padding-top: 10px; font-weight: 900; font-size: 1.15rem; }
.receipt-total strong { font-size: 1.35rem; color: #1a1209; }
.receipt-foot { text-align: center; font-size: 0.7rem; color: #6d5e4b; margin-top: 10px; letter-spacing: 0.1em; }
.ticket-actions button { text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.04em; }
#btn-copy-total, #btn-copy-concept { box-shadow: 0 0 16px rgba(249, 125, 2, 0.45); }

/* Aviso al anadir un producto */
.add-toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 300;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1c150f;
  border: 1px solid #f97d02;
  box-shadow: 0 0 24px rgba(249, 125, 2, 0.35);
  color: #f6efe6;
  font-size: 0.9rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.add-toast b { color: #ffb15c; }
.add-toast.is-visible { opacity: 1; transform: translateY(0); }

/* Solo PC: cabecera grande y tarjetas de producto */
@media (min-width: 701px) {
  .topbar h1 { font-size: 2.1rem; }
  .topbar-logo { width: 72px; height: 72px; }
  .tab { padding: 11px 18px; }
  .card h2 { font-size: 1.15rem; }
  .product-btn {
    position: relative;
    min-height: 150px;
    padding: 12px;
    overflow: hidden;
    border-color: #2e241a;
    background: linear-gradient(160deg, #1d1610 0%, #110d0a 100%);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  }
  .product-btn img { height: 64px; margin: 4px 0 6px; }
  .product-btn strong { font-size: 0.86rem; line-height: 1.25; }
  .product-btn small {
    align-self: flex-start;
    margin-top: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
    color: #1a0f04;
    background: linear-gradient(90deg, #f97d02, #ffb15c);
  }
  .product-btn::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #f97d02, transparent);
    opacity: 0;
    transition: opacity 0.15s;
  }
  .product-btn:hover { transform: translateY(-3px); border-color: #f97d02; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(249, 125, 2, 0.25); }
  .product-btn:hover::after { opacity: 1; }
  .product-btn .qty-badge {
    display: inline-block;
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f97d02;
    color: #1a0f04;
    font-weight: 900;
    font-size: 0.78rem;
  }
  .product-btn .qty-badge:empty { display: none; }
  .product-btn.in-ticket { border-color: #f97d02; }
}

/* Movil: franja mas fina, sin aviso flotante (ya esta la barra del ticket) */
@media (max-width: 700px) {
  .topbar { padding-bottom: 12px; }
  .topbar::after { height: 4px; border-radius: 0; }
  .add-toast { display: none; }
  .card::before, .card::after { top: 7px; width: 5px; height: 5px; }
  .card::before { left: 7px; }
  .card::after { right: 7px; }
}

/* ==========================================================================
   Version 22: Modulo de Pagos con tarjetas de resumen y ranking
   ========================================================================== */
.terminal-input {
  font-family: "Courier New", ui-monospace, monospace;
  background: #050504 !important;
  color: #8ce99a !important;
  border: 1px solid #2e241a;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}
.pg-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.pg-step { padding: 10px; border-radius: 10px; background: #15100b; border: 1px solid #2e241a; font-size: 0.78rem; color: #cfc3b5; }
.pg-step b { display: block; color: #ffb15c; font-size: 1.1rem; }
.pg-step strong { color: #ffb15c; }

.pg-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 14px; }
.pg-kpi { position: relative; min-width: 0; padding: 14px 14px 12px; border-radius: 14px; border: 1px solid #3a2c1d; background: linear-gradient(160deg, #21180f, #120d09); overflow: hidden; }
.pg-kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(249, 125, 2, 0.18), transparent 70%); pointer-events: none; }
.pg-kpi .lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.pg-kpi .val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.35rem; font-weight: 900; margin-top: 6px; color: #fff; }
.pg-kpi .val.pg-kpi-name { font-size: 1rem; line-height: 1.2; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pg-kpi .sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.pg-kpi .sub.warn { color: #ff9b8a; }
.pg-kpi.hl { border-color: #f97d02; box-shadow: 0 0 22px rgba(249, 125, 2, 0.25); }
.pg-kpi.hl .val { background: linear-gradient(180deg, #fff, #ffb15c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pg-kpi .ic { width: 18px; height: 18px; flex: none; stroke: #f97d02; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pg-sec { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.pg-sec h3 { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem; }
.pg-kitprice { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.pg-kitprice input { width: 90px; padding: 5px 8px; }

.pg-list { display: grid; gap: 8px; }
.pg-empty { padding: 18px; text-align: center; border: 2px dashed #3a2c1d; border-radius: 12px; }
.pg-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid #2e241a; background: linear-gradient(90deg, #1a140e, #120e0a); }
.pg-row.first { border-color: #f97d02; background: linear-gradient(90deg, #2a1a0a, #120e0a); }
.pg-av { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #1a0f04; background: linear-gradient(135deg, #ffb15c, #c75e00); }
.pg-av.np { background: linear-gradient(135deg, #6b6158, #3a332c); color: #ddd; }
.pg-av .crown { position: absolute; top: -10px; right: -6px; font-size: 1rem; }
.pg-mid { min-width: 0; }
.pg-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 700; }
.pg-badge { font-size: 0.66rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em; }
.r-jefe { background: #f97d02; color: #1a0f04; }
.r-subjefe { background: #ffb15c; color: #1a0f04; }
.r-exp { background: #ae3ec933; color: #e599f7; border: 1px solid #ae3ec988; }
.r-mecanico { background: #3b5bdb33; color: #9db4ff; border: 1px solid #3b5bdb88; }
.r-chalan { background: #2f9e4433; color: #8ce99a; border: 1px solid #2f9e4488; }
.w-iban { background: #ffcf7a22; color: #ffcf7a; border: 1px solid #ffcf7a66; }
.w-nopay { background: #ffffff14; color: #bbb; border: 1px solid #ffffff33; }
.w-self { background: #ff6b6b22; color: #ff9b8a; border: 1px solid #ff6b6b66; }
.pg-bar { height: 6px; border-radius: 999px; background: #2a2019; margin-top: 7px; overflow: hidden; }
.pg-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #c75e00, #ffb15c); }
.pg-meta { font-size: 0.74rem; color: var(--muted); margin-top: 4px; }
.pg-amt { text-align: right; white-space: nowrap; }
.pg-amt small { display: block; color: var(--muted); font-size: 0.72rem; }
.pg-amt b { display: block; font-size: 1.05rem; }
.pg-amt .pay { color: #ffb15c; font-weight: 900; }
.pg-amt .pg-dash { color: #888; }

.pg-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(90deg, #f97d02, #ffb15c); color: #1a0f04; font-weight: 900; box-shadow: 0 0 26px rgba(249, 125, 2, 0.35); }
.pg-total b { font-size: 1.6rem; color: #1a0f04; }
.pg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pg-actions button { flex: 1 1 150px; padding: 11px; text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.05em; }
#pg-copy-discord { box-shadow: 0 0 16px rgba(249, 125, 2, 0.45); }
.pg-copied { min-height: 1em; margin: 6px 2px 0; color: var(--ok); }
.pg-detail { margin-top: 12px; }
.pg-detail summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; padding: 6px 0; }
.pg-detail[open] summary { margin-bottom: 8px; }

@media (max-width: 700px) {
  .pg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pg-kpi { padding: 10px; }
  .pg-kpi .val { font-size: 1.15rem; }
  .pg-steps { grid-template-columns: 1fr; }
  .pg-row { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; padding: 9px 10px; }
  .pg-av { width: 38px; height: 38px; font-size: 0.85rem; }
  .pg-amt { grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: baseline; }
  .pg-amt small { display: inline; }
  .pg-total b { font-size: 1.3rem; }
}

/* ==========================================================================
   Version 23: Modulo de Sorteo
   ========================================================================== */
.sx-subtabs { display: flex; gap: 8px; margin: 0 0 12px; }
.sx-subtab { border: 1px solid var(--line); background: #15100b; color: var(--text); border-radius: 999px; padding: 9px 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.78rem; cursor: pointer; }
.sx-subtab.is-active { background: linear-gradient(90deg, #f97d02, #ffb15c); color: #1a0f04; border-color: transparent; box-shadow: 0 0 16px rgba(249, 125, 2, 0.45); }
.sx-pane { display: none; }
.sx-pane.is-active { display: block; animation: fade 180ms ease-out; }

.sx-rules { display: grid; gap: 8px; }
.sx-rule { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #15100b; border: 1px solid #2e241a; font-size: 0.85rem; }
.sx-rule b { color: #ffb15c; }
.sx-ok { color: #8ce99a; font-weight: 900; }
.sx-set { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sx-set label { display: grid; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.sx-set label[hidden] { display: none; }
.sx-check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-size: 0.82rem; color: var(--muted); cursor: pointer; }

.sx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 4px 0 14px; }
.sx-kpi { padding: 14px; border-radius: 14px; border: 1px solid #3a2c1d; background: linear-gradient(160deg, #21180f, #120d09); min-width: 0; }
.sx-kpi .lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.sx-kpi .val { font-size: 1.5rem; font-weight: 900; margin-top: 6px; }
.sx-kpi.hl { border-color: #f97d02; box-shadow: 0 0 22px rgba(249, 125, 2, 0.25); }
.sx-kpi.hl .val { color: #ffb15c; }
.sx-kpi.bad .val { color: #ff9b8a; }
.sx-h { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; align-items: center; margin: 14px 0 8px; }
.sx-h h3 { margin: 0; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.9rem; }
.sx-h span { font-size: 0.75rem; color: var(--muted); }
.sx-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 70px 64px; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; border: 1px solid #2e241a; background: linear-gradient(90deg, #1a140e, #120e0a); margin-bottom: 6px; }
.sx-mid { min-width: 0; }
.sx-tk { text-align: center; font-weight: 900; color: #ffb15c; font-size: 1.05rem; }
.sx-tk small { display: block; color: var(--muted); font-weight: 400; font-size: 0.68rem; }
.sx-pc { text-align: right; font-weight: 800; }
.sx-bad { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px dashed #4a2a24; background: #160c0a; margin-bottom: 6px; font-size: 0.82rem; }

.sx-combo { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 14px; }
.sx-prog { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); margin: 4px 2px 8px; }
.sx-progbar { height: 8px; border-radius: 9px; background: #2a2019; overflow: hidden; margin-bottom: 12px; }
.sx-progbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c75e00, #ffb15c); transition: width 0.4s; }
.sx-pz { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 12px; border: 1px solid #2e241a; background: #15100b; margin-bottom: 8px; }
.sx-pz .ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: radial-gradient(#3a2410, #140e09); border: 1px solid #3a2c1d; }
.sx-pz b { display: block; }
.sx-pz small { color: var(--muted); font-size: 0.74rem; }
.sx-pz .who { text-align: right; }
.sx-pz .who b { color: #ffb15c; }
.sx-pz.done { background: linear-gradient(90deg, #21180f, #120d09); border-color: #3a2c1d; }
.sx-pz.done .ico { border-color: #f97d02; }
.sx-pz.now, .sx-pz.next { border-color: #f97d02; box-shadow: 0 0 18px rgba(249, 125, 2, 0.35); background: linear-gradient(90deg, #2a1a0a, #15100b); }
.sx-pz.now .who b { color: #fff; }
.sx-tools { display: flex; gap: 4px; }
.sx-tools button { padding: 4px 9px; }
.sx-add { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 6px; margin-top: 6px; }
.sx-add[hidden] { display: none; }

.sx-stage { position: relative; text-align: center; padding: 20px 20px 18px; border-radius: 18px; border: 1px solid #f97d02; background: radial-gradient(600px 300px at 50% 0%, rgba(249, 125, 2, 0.25), transparent 70%), linear-gradient(180deg, #1d150d, #0e0a07); box-shadow: 0 0 40px rgba(249, 125, 2, 0.2); overflow: hidden; }
.sx-tag { display: inline-block; padding: 5px 14px; border-radius: 999px; background: #f97d02; color: #1a0f04; font-weight: 900; letter-spacing: 0.1em; font-size: 0.8rem; }
.card .sx-stage h2 { font-size: 2.1rem; margin: 12px 0 4px; text-transform: uppercase; letter-spacing: 0.06em; background: linear-gradient(180deg, #fff, #ffb15c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card .sx-stage h2::before { display: none; }
.sx-reel { position: relative; margin: 16px auto 10px; max-width: 560px; height: 168px; border-radius: 14px; overflow: hidden; border: 2px solid #3a2c1d; background: #080605; }
.sx-reel::before, .sx-reel::after { content: ""; position: absolute; left: 0; right: 0; height: 52px; z-index: 2; pointer-events: none; }
.sx-reel::before { top: 0; background: linear-gradient(#080605, transparent); }
.sx-reel::after { bottom: 0; background: linear-gradient(transparent, #080605); }
.sx-reel-line { position: absolute; left: 0; right: 0; top: 56px; height: 56px; border-top: 2px solid #f97d02; border-bottom: 2px solid #f97d02; background: rgba(249, 125, 2, 0.12); z-index: 1; }
.sx-reel ul { list-style: none; margin: 0; padding: 0; position: absolute; left: 0; right: 0; top: 0; text-align: center; }
.sx-reel li { height: 56px; line-height: 56px; font-size: 1.35rem; font-weight: 800; color: #6d5e4b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }
.sx-reel li.win { color: #fff; font-size: 1.8rem; text-shadow: 0 0 18px rgba(249, 125, 2, 0.8); }
.sx-odds { color: var(--muted); font-size: 0.88rem; min-height: 1.2em; }
.sx-odds b { color: #ffb15c; }
.sx-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.sx-btns button { padding: 13px 26px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; }
.sx-go { box-shadow: 0 0 26px rgba(249, 125, 2, 0.6); }
.sx-go:disabled { box-shadow: none; opacity: 0.6; }
.sx-seal { margin-top: 12px; font-size: 0.75rem; color: var(--muted); }
.sx-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.sx-confetti i { position: absolute; top: -20px; width: 8px; height: 14px; border-radius: 2px; animation-name: sx-fall; animation-timing-function: ease-in; animation-fill-mode: forwards; }
@keyframes sx-fall { to { top: 105%; transform: rotate(540deg); opacity: 0.2; } }

.sx-under { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; margin-top: 14px; }
.sx-discord { margin: 0; white-space: pre-wrap; word-break: break-word; background: #313338; color: #dbdee1; border-radius: 10px; padding: 14px 16px; font-family: "gg sans", "Segoe UI", sans-serif; font-size: 0.85rem; line-height: 1.5; max-height: 360px; overflow: auto; }
.sx-side { display: grid; gap: 8px; align-content: start; }
.sx-side button { padding: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.sx-note { padding: 12px; border-radius: 12px; border: 1px solid #2e241a; background: #15100b; font-size: 0.82rem; color: #cfc3b5; margin: 0; }

@media (max-width: 980px) {
  .sx-combo, .sx-under { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .sx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-set { grid-template-columns: 1fr; }
  .sx-row { grid-template-columns: 38px minmax(0, 1fr) 56px; }
  .sx-row .pg-av { width: 38px; height: 38px; }
  .sx-pc { display: none; }
  .sx-bad { grid-template-columns: 1fr; }
  .card .sx-stage h2 { font-size: 1.4rem; }
  .sx-reel li { font-size: 1.05rem; }
  .sx-reel li.win { font-size: 1.3rem; }
}

/* Iconos de las pestanas (caja registradora, dolar, ruleta) */
.tab-ic { width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab-ic .tab-ic-ball, .tab-ic-ball { fill: currentColor; stroke: none; }
.tab:not(.is-active) .tab-ic { stroke: #ffb15c; }
.tab:not(.is-active) .tab-ic .tab-ic-ball { fill: #ffb15c; }
.m-nav-item .tab-ic { stroke: #ffb15c; }
.m-nav-item .tab-ic .tab-ic-ball { fill: #ffb15c; }

/* Modulo de Compraventa (v26) */
.cv-mode { margin: -4px 0 12px; }
.cv-search { max-width: 280px; }
.cv-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.cv-filters select { width: auto; }
.cv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 10px; }
.cv-car { border: 1px solid #3a2c1d; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, #1b140d, #100c08); display: flex; flex-direction: column; }
.cv-pic { position: relative; aspect-ratio: 16 / 10; background: repeating-linear-gradient(135deg, #15100b 0 10px, #120d09 10px 20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 0.75rem; }
.cv-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.cv-pic svg { width: 46%; fill: none; stroke: #6b4a28; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cv-plate { position: absolute; left: 10px; bottom: 10px; background: #f4f1ea; color: #111; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: 0.12em; font-size: 0.82rem; padding: 3px 8px; border-radius: 4px; border: 2px solid #1a3d8f; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.cv-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cv-body h4 { margin: 0; font-size: 1.05rem; letter-spacing: 0.04em; color: #ffb15c; }
.cv-body dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 0.85rem; }
.cv-body dt { color: var(--muted); }
.cv-body dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.cv-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.cv-acts button { flex: 1; padding: 7px 10px; font-size: 0.8rem; }
.cv-empty { text-align: center; padding: 18px 0 6px; }
.cv-table td { vertical-align: middle; }
.cv-date { white-space: nowrap; color: var(--muted); font-size: 0.85rem; }
.cv-plate-sm { display: inline-block; margin-left: 8px; background: #f4f1ea; color: #111; font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.08em; padding: 1px 6px; border-radius: 3px; }
.cv-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.cv-compra { background: rgba(255, 112, 90, 0.15); color: #ff9b8a; border: 1px solid rgba(255, 112, 90, 0.4); }
.cv-venta { background: rgba(80, 220, 140, 0.13); color: #7fe0a8; border: 1px solid rgba(80, 220, 140, 0.4); }
.cv-traspaso { background: rgba(255, 177, 92, 0.12); color: #ffb15c; border: 1px solid rgba(255, 177, 92, 0.35); }
.cv-money-compra { color: #ff9b8a; }
.cv-money-venta { color: #7fe0a8; }
.cv-soc { color: #ffb15c; font-weight: 800; }
.cv-view { max-width: min(92vw, 900px); padding: 12px; border: 1px solid #3a2c1d; border-radius: 14px; background: #0f0c09; color: var(--text); }
.cv-view::backdrop { background: rgba(0, 0, 0, 0.75); }
.cv-view img { display: block; max-width: 100%; max-height: 75vh; border-radius: 8px; }
.cv-view p { margin: 10px 0; font-weight: 800; letter-spacing: 0.06em; color: #ffb15c; }
@media (max-width: 700px) {
  .cv-search { max-width: none; width: 100%; }
  .cv-filters { width: 100%; }
  .cv-filters .cv-search { flex: 1; min-width: 0; }
  .cv-grid { grid-template-columns: 1fr; }
  .cv-table th:nth-child(6), .cv-table td:nth-child(6) { display: none; }
}
.cv-filters { flex-wrap: nowrap; align-items: center; }
.cv-filters .cv-search { width: 220px; }
@media (max-width: 700px) {
  #tab-cv .card-head-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .cv-filters .cv-search { width: auto; }
}

/* Foto de compraventa: pegar recorte (v27) */
.cv-photo-dlg { width: min(92vw, 520px); }
.cv-photo-dlg h3 { margin: 4px 0 12px; }
.cv-drop { border: 2px dashed #6b4a28; border-radius: 12px; padding: 26px 16px; text-align: center; display: flex; flex-direction: column; gap: 8px; background: #15100b; outline: none; }
.cv-drop b { color: #ffb15c; font-size: 1.05rem; }
.cv-drop span { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
.cv-drop:focus, .cv-drop.is-over { border-color: #f97d02; box-shadow: 0 0 18px rgba(249, 125, 2, 0.3); }
.cv-drop kbd { background: #2a2017; border: 1px solid #4a3622; border-bottom-width: 3px; border-radius: 5px; padding: 1px 6px; font-size: 0.78rem; color: #fff; }
.cv-keys { font-style: normal; white-space: nowrap; }

/* Observacion bajo el nombre del producto (v29) */
.product-note { display: block; margin-top: 4px; font-size: 0.72rem; font-weight: 600; line-height: 1.3; color: #ffb15c; opacity: 0.85; }

/* Compraventa en linea (Supabase) (v32) */
.cv-cloud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: -4px 0 6px; padding: 8px 12px; border: 1px solid #3a2c1d; border-radius: 12px; background: #120d09; font-size: 0.85rem; }
.cv-dot { width: 10px; height: 10px; border-radius: 50%; background: #6b5a48; flex: none; }
.cv-dot.is-on { background: #3ddc84; box-shadow: 0 0 10px rgba(61, 220, 132, 0.7); }
.cv-dot.is-off { background: #ff7a5c; }
.cv-cloud-text { flex: 1; min-width: 200px; color: var(--muted); }
.cv-cloud-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.cv-cloud-acts button { padding: 6px 12px; font-size: 0.8rem; }
#tab-cv.is-busy { cursor: progress; }
#tab-cv.is-busy button { pointer-events: none; opacity: 0.6; }
.cv-login { display: flex; flex-direction: column; gap: 10px; }
.cv-login label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.cv-login p { margin: 0; }
.emp-cloud { margin: 10px 0 4px; }
