/* ─────────────────────────────────────────────────────────────
   Tema oscuro · Paleta Prono Ingeniería
   Azul (#1b75bb/#2e9be0) · Rojo (#e1251b) · Verde hoja (#7fb93b)
   ───────────────────────────────────────────────────────────── */

:root {
  --bg:         #0a1322;   /* fondo de página (navy profundo) */
  --surface:    #131f33;   /* tarjetas, modal, header, login */
  --surface-2:  #1b2a44;   /* inputs, hovers, superficies internas */
  --line:       #26374f;   /* bordes */
  --text:       #e8edf4;   /* texto principal */
  --muted:      #8fa3bc;   /* texto secundario */
  --brand:      #2e9be0;   /* azul acento */
  --brand-600:  #1b75bb;
  --brand-700:  #155e96;
  --leaf:       #7fb93b;   /* verde */
  --leaf-600:   #6aa22f;
  --flame:      #e1251b;   /* rojo */
  --flame-600:  #c11d15;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(46,155,224,.10), transparent 55%),
    radial-gradient(1000px 500px at 100% 0%, rgba(225,37,27,.07), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;                 /* nunca scroll horizontal en móvil */
  -webkit-tap-highlight-color: transparent;
}

/* Ocultar barra de scroll (nav de secciones) manteniendo el desplazamiento */
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Utilidades de color reutilizadas desde el HTML */
.text-muted  { color: var(--muted); }
.border-line { border-color: var(--line); }

/* Superficies */
.surface        { background: var(--surface); border: 1px solid var(--line); }
.surface-header { background: rgba(19,31,51,.85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.login-card     { box-shadow: 0 20px 60px -20px rgba(0,0,0,.6); }

/* Cinta degradada con los colores del logo (rojo→azul→verde) */
.brand-strip {
  height: 3px;
  background: linear-gradient(90deg, var(--flame) 0%, #7b4fa3 35%, var(--brand) 65%, var(--leaf) 100%);
}

/* Respetar saltos de línea en descripciones */
.pre-line { white-space: pre-line; }

/* ── Navegación (pestañas) ── */
.nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 0 0.95rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.is-active { color: #fff; border-bottom-color: var(--brand); }

/* ── Filtros segmentados ── */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 0.5rem; overflow: hidden; font-size: 0.8125rem; }
.filter-btn {
  padding: 0.4rem 0.8rem;
  color: var(--muted);
  background: var(--surface);
  transition: background-color .15s, color .15s;
  cursor: pointer;
}
.filter-btn:not(:last-child) { border-right: 1px solid var(--line); }
.filter-btn:hover { color: var(--text); }
.filter-btn.is-active { background: var(--brand-600); color: #fff; }

/* ── Botones ── */
.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: background-color .15s, color .15s, border-color .15s, opacity .15s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sm:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand); }

.btn-leaf { background: var(--leaf-600); color: #fff; }
.btn-leaf:hover { background: var(--leaf); }

.btn-danger { background: var(--flame); color: #fff; }
.btn-danger:hover { background: var(--flame-600); }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-outline:hover { background: var(--surface-2); }

.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: #24365a; }

/* ── Inputs de formulario ── */
.f-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.f-input::placeholder { color: #64748b; }
.f-input:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(46,155,224,.25); }
.f-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: .3rem; }
select.f-input option { background: var(--surface-2); color: var(--text); }
input[type="file"].f-input { padding: 0.4rem 0.55rem; }
input[type="date"].f-input { color-scheme: dark; }

/* ── Tarjetas de catálogo ── */
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .1s;
  position: relative;
}
.cat-card:hover { border-color: #38507a; box-shadow: 0 8px 24px -10px rgba(0,0,0,.6); }
.cat-card.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }

.card-check { position: absolute; top: 0.5rem; left: 0.5rem; width: 1.35rem; height: 1.35rem; z-index: 5; accent-color: var(--brand); }

.card-thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #0e1a2d; display: block; }

.img-dots { position: absolute; bottom: 0.4rem; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
.img-dots span { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.35); }
.img-dots span.on { background: #fff; }

/* Miniaturas editables dentro del modal */
.thumb-edit { position: relative; border-radius: .5rem; overflow: hidden; border: 1px solid var(--line); }
.thumb-edit img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.thumb-edit .rm {
  position: absolute; top: 2px; right: 2px;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background: rgba(225,37,27,.92); color: #fff;
  font-size: .75rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.thumb-edit.pending::after {
  content: "nuevo"; position: absolute; bottom: 2px; left: 2px;
  font-size: .6rem; background: var(--brand-600); color: #fff;
  padding: 1px 5px; border-radius: 4px;
}

/* Badge de estado */
.badge { position: absolute; top: .5rem; right: .5rem; font-size: .65rem; font-weight: 600; padding: 2px 8px; border-radius: 9999px; }
.badge-on  { background: rgba(127,185,59,.18); color: #a6d95f; border: 1px solid rgba(127,185,59,.35); }
.badge-off { background: rgba(148,163,184,.15); color: #b0bccc; border: 1px solid rgba(148,163,184,.3); }

/* Tarjeta/fila de datos (repuestos, ofertas) */
.row-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.row-card:hover { border-color: #38507a; box-shadow: 0 8px 24px -12px rgba(0,0,0,.6); }

/* Toast */
.toast {
  min-width: 220px; max-width: 340px;
  padding: .7rem 1rem; border-radius: .6rem;
  color: #fff; font-size: .85rem; font-weight: 500;
  box-shadow: 0 10px 30px -8px rgba(0,0,0,.7);
  animation: toast-in .2s ease-out;
}
.toast-ok  { background: var(--leaf-600); }
.toast-err { background: var(--flame); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
