:root {
  --necty-orange: #e85d04;
  --necty-orange-dark: #c2410c;
  --bg: #0a0b11;
  --bg-soft: #11131d;
  --card: rgba(20, 23, 35, 0.92);
  --card-border: rgba(148, 163, 184, 0.16);
  --text: #eef2ff;
  --muted: #a5b4cf;
  --danger: #ef4444;
  --ok: #22c55e;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-optical-sizing: auto;
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 8% -12%, rgba(232, 93, 4, 0.2), transparent 55%),
    radial-gradient(900px 380px at 92% -18%, rgba(59, 130, 246, 0.15), transparent 60%),
    linear-gradient(165deg, var(--bg), var(--bg-soft) 45%, #0d111b 100%);
}

a { color: #fb923c; }

.wrap { max-width: 460px; margin: 0 auto; padding: 1.6rem 1.2rem; }

/* ——— Login (referencia split-card + móvil apilado); fondo hero = fondoo.png ——— */
body.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(165deg, #dce3ec 0%, #eef2f7 45%, #e2e8f0 100%);
  color: #0f172a;
}

@media (min-width: 768px) {
  body.auth-page {
    padding: clamp(1rem, 3vw, 2rem);
  }
}

.auth-portal {
  width: 100%;
  max-width: 940px;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

@media (min-width: 768px) {
  .auth-portal {
    min-height: 520px;
    height: auto;
    max-height: min(640px, 92vh);
    flex-direction: row;
    border-radius: 28px;
    box-shadow:
      0 28px 56px rgba(15, 23, 42, 0.12),
      0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  }
}

.auth-hero {
  position: relative;
  flex: 0 0 auto;
  min-height: 38vh;
  min-height: 38dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (min-width: 768px) {
  .auth-hero {
    flex: 1 1 46%;
    min-height: auto;
    min-height: 0;
  }
}

.auth-hero-media {
  position: absolute;
  inset: 0;
  background: #0f172a;
}

.auth-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  image-rendering: auto;
  -webkit-user-drag: none;
  user-select: none;
}

.auth-hero-veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(100% 80% at 30% 20%, rgba(251, 146, 60, 0.22), transparent 55%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.72));
  pointer-events: none;
}

.auth-hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.75rem 1.5rem 2rem;
  max-width: 280px;
}

.auth-logo-wrap {
  margin: 0 auto 1.1rem;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-store-logo {
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.35));
}

.auth-hero-tag {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
}

.auth-hero-inner--solo .auth-hero-tag {
  margin-top: 0.25rem;
}

.auth-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafbfc;
  padding: 0;
  position: relative;
  z-index: 3;
  margin-top: -22px;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.08);
}

@media (min-width: 768px) {
  .auth-main {
    flex: 1 1 54%;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fafbfc;
  }
}

.auth-main-inner {
  width: 100%;
  max-width: 400px;
  padding: 1.75rem 1.5rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .auth-main-inner {
    padding: 2.25rem 2rem 2.5rem;
  }
}

.auth-welcome {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  background: linear-gradient(120deg, #ea580c, #c2410c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .auth-welcome {
    color: #ea580c;
  }
}

.auth-lead {
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
}

.auth-lead-muted {
  margin-top: 0.5rem;
  margin-bottom: 0.85rem;
}

.auth-page .alert {
  margin-bottom: 1rem;
}

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.auth-page .auth-form input[type="email"],
.auth-page .auth-form input[type="password"],
.auth-page .auth-form input[type="text"] {
  width: 100%;
  padding: 0.78rem 0.95rem;
  margin-bottom: 1rem;
  border-radius: 14px;
  border: 1px solid #d1fae5;
  background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #0f172a;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-page .auth-form input::placeholder {
  color: #94a3b8;
}

.auth-page .auth-form input:focus {
  outline: none;
  border-color: rgba(234, 88, 12, 0.55);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2);
  background: #fff;
}

.auth-submit {
  margin-top: 0.35rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-submit-secondary {
  border-radius: 999px;
}

.auth-foot {
  margin: 1.25rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  line-height: 1.45;
}

.auth-sep {
  margin: 1.35rem 0;
  border-top-color: #e2e8f0;
}

@media (min-width: 900px) {
  .wrap-wide { max-width: 1240px; margin: 0 auto; padding: 1.5rem; }
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 1.35rem 1.25rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out), border-color 0.25s ease;
}

h1 {
  font-size: 1.42rem;
  margin: 0 0 0.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.08rem;
  margin: 0 0 0.6rem;
  font-weight: 650;
}

.sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.79rem;
  color: #c7d2fe;
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.72rem 0.82rem;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 18, 30, 0.92);
  color: var(--text);
  margin-bottom: 0.9rem;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(251, 146, 60, 0.72);
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.2);
  background: rgba(16, 20, 33, 0.98);
}

textarea { min-height: 4.4rem; resize: vertical; }
input[type="checkbox"] { width: auto; margin-right: 0.35rem; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
@media (max-width: 640px) { .form-row-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 0.72rem 1rem;
  border-radius: 12px;
  border: none;
  font-weight: 650;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.2s var(--ease-out), filter 0.2s ease, box-shadow 0.25s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); filter: brightness(0.96); }

.btn-primary {
  background: linear-gradient(160deg, #f97316, var(--necty-orange-dark));
  color: #fff;
  box-shadow: 0 12px 26px rgba(232, 93, 4, 0.28);
}

.btn-primary:hover { filter: brightness(1.04); }

.btn-ghost {
  background: rgba(30, 41, 59, 0.55);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.26);
  margin-top: 0.5rem;
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.72);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-sm { width: auto; padding: 0.38rem 0.72rem; font-size: 0.8rem; border-radius: 10px; }
.btn-danger { background: var(--danger); color: #fff; }

.alert {
  padding: 0.7rem 0.75rem;
  border-radius: 11px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-err { background: rgba(239, 68, 68, .16); color: #fecaca; border: 1px solid rgba(239, 68, 68, 0.35); }
.alert-ok { background: rgba(34, 197, 94, .16); color: #bbf7d0; border: 1px solid rgba(34, 197, 94, 0.35); }
hr.sep { border: 0; border-top: 1px solid rgba(148, 163, 184, 0.25); margin: 1.2rem 0; }

.sistema-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  background: rgba(12, 15, 26, 0.84);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}

.sistema-top-left { min-width: 0; }

/* Título + usuario: vuelven al inicio sin estilo de enlace global */
a.sistema-home-link {
  display: block;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  margin: -0.2rem -0.4rem;
  padding: 0.2rem 0.4rem;
}

a.sistema-home-link:focus-visible {
  outline: 2px solid rgba(251, 146, 60, 0.75);
  outline-offset: 2px;
}

.sistema-top h1 { font-size: 1.08rem; margin-bottom: 0.16rem; }
.sistema-user-label {
  color: #94a3b8;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sistema-top-nav { display: flex; align-items: center; justify-content: flex-end; gap: 0.55rem; }

.sistema-hamburger-btn {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.28rem;
  width: 2.65rem;
  height: 2.35rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 13px;
  background: linear-gradient(155deg, rgba(51, 65, 85, 0.55), rgba(30, 41, 59, 0.75));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}

.sistema-hamburger-btn:hover {
  border-color: rgba(251, 146, 60, 0.55);
  background: linear-gradient(155deg, rgba(71, 85, 105, 0.65), rgba(45, 59, 84, 0.88));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 24px rgba(251, 146, 60, 0.12);
  transform: translateY(-1px);
}

.sistema-hamburger-btn:focus-visible {
  outline: 2px solid rgba(251, 146, 60, 0.75);
  outline-offset: 2px;
}

.sistema-hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: #f8fafc;
  transition: transform .2s ease, opacity .2s ease;
}

.sistema-hamburger-btn.is-open .sistema-hamburger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sistema-hamburger-btn.is-open .sistema-hamburger-line:nth-child(2) { opacity: 0; }
.sistema-hamburger-btn.is-open .sistema-hamburger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sistema-dropdown-menu {
  margin-top: 0.6rem !important;
  min-width: 17.5rem;
  padding: 0.45rem 0 !important;
  border-radius: 16px !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  background: rgba(8, 11, 20, 0.88) !important;
  backdrop-filter: blur(22px) saturate(1.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 28px 56px rgba(0, 0, 0, 0.58),
    0 0 100px rgba(232, 93, 4, 0.07);
  transform-origin: top right;
}

.sistema-dropdown-menu.show {
  animation: sistemaNavReveal 0.26s var(--ease-out) both;
}

@keyframes sistemaNavReveal {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.96);
    filter: blur(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.sistema-dropdown-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 1rem 0.38rem;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 750;
  color: #94a3b8;
}

.sistema-dropdown-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fb923c, #ea580c);
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.65);
}

.sistema-dropdown-item {
  color: #e2e8f0;
  font-size: 0.87rem;
  font-weight: 550;
  padding: 0.52rem 0.75rem;
  margin: 0.06rem 0.45rem;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s var(--ease-out);
}

.sistema-item-icon {
  width: 1.15rem;
  display: inline-flex;
  justify-content: center;
  color: #fb923c;
  opacity: 0.95;
  font-size: 0.95rem;
}

.sistema-dropdown-item:hover,
.sistema-dropdown-item:focus {
  color: #fff7ed;
  background: linear-gradient(90deg, rgba(232, 93, 4, 0.22), rgba(232, 93, 4, 0.06));
  transform: translateX(2px);
}

.sistema-dropdown-item-active,
.sistema-dropdown-item-active:hover,
.sistema-dropdown-item-active:focus {
  color: #fff7ed;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(232, 93, 4, 0.34), rgba(232, 93, 4, 0.1));
  box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.22);
}

.sistema-dropdown-divider {
  border-top-color: rgba(148, 163, 184, 0.18);
  margin: 0.4rem 0.55rem;
  opacity: 1;
}

.sistema-dropdown-item-logout {
  color: #fecdd3 !important;
  font-weight: 600;
}

.sistema-dropdown-item-logout .sistema-item-icon {
  color: #fda4af;
}

.sistema-dropdown-item-logout:hover,
.sistema-dropdown-item-logout:focus {
  color: #fff1f2 !important;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.28), rgba(239, 68, 68, 0.08)) !important;
  transform: translateX(2px);
}

/* ——— Panel sistema (portal-app): contraste, jerarquía tipo app, tablas legibles ——— */
body.portal-app {
  --portal-fg: #f1f5f9;
  --portal-fg-muted: #cbd5e1;
  --portal-fg-soft: #94a3b8;
  --portal-border: rgba(148, 163, 184, 0.22);
  --portal-surface: rgba(22, 26, 38, 0.97);
  --portal-surface-2: rgba(16, 20, 32, 0.92);
  background:
    radial-gradient(980px 420px at 10% -6%, rgba(232, 93, 4, 0.12), transparent 50%),
    radial-gradient(720px 320px at 92% 4%, rgba(59, 91, 140, 0.16), transparent 46%),
    linear-gradient(180deg, #05060a 0%, #0a0c12 42%, #07080e 100%) !important;
  color: var(--portal-fg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.portal-app .wrap-wide {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  padding: 0.65rem clamp(0.65rem, 2vw, 1.35rem) 2.25rem;
}

/* Inicio: bloque centrado en vertical y horizontal (también portátil 1366px, antes solo hasta 1279px) */
body.portal-app .wrap-wide:has(> .portal-home-main) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding-top: 0.45rem;
  padding-bottom: 1.25rem;
}

.portal-home-main {
  width: 100%;
  max-width: min(100%, 36rem);
  margin-inline: auto;
}

@media (min-width: 720px) {
  .portal-home-main {
    max-width: min(100%, 82rem);
  }
}

/* Inicio móvil: tarjetas más cuadradas, más altas y contenido centrado en la celda */
@media (max-width: 719px) {
  body.portal-app .wrap-wide:has(> .portal-home-main) .grid-menu {
    gap: 0.75rem;
    padding: 0.45rem 0.5rem 0.25rem;
    width: 100%;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile {
    border-radius: 11px;
    padding: 0.78rem 0.55rem 0.72rem;
    aspect-ratio: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile .icon {
    font-size: 1.34rem;
    margin-bottom: 0.38rem;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile .t {
    font-size: 0.93rem;
    line-height: 1.2;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile .d {
    font-size: 0.73rem;
    line-height: 1.3;
    margin-top: 0.28rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
  }

  .portal-home-main .badge-warn {
    margin-top: 0.55rem;
    width: 100%;
  }
}

/*
 * Inicio ≥720px: 4 columnas (8 accesos = 2 filas), tarjetas cuadradas — mismo “porte” denso
 * que antes a lo ancho; no 2 columnas gigantes.
 */
@media (min-width: 720px) {
  body.portal-app .wrap-wide:has(> .portal-home-main) .grid-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.55rem, 1.1vw, 0.95rem);
    padding: 0.55rem 0.45rem 0.4rem;
    width: 100%;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile {
    border-radius: 12px;
    aspect-ratio: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(0.45rem, 1.4vw, 0.85rem) clamp(0.32rem, 1vw, 0.55rem);
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile .icon {
    font-size: clamp(1.1rem, 2.4vw, 1.38rem);
    margin-bottom: 0.28rem;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile .t {
    font-size: clamp(0.78rem, 1.35vw, 0.92rem);
    line-height: 1.15;
  }

  body.portal-app .wrap-wide:has(> .portal-home-main) .tile .d {
    font-size: clamp(0.62rem, 1.05vw, 0.72rem);
    line-height: 1.28;
    margin-top: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
  }

  .portal-home-main .badge-warn {
    margin-top: 0.55rem;
    width: 100%;
  }
}

body.portal-app .sub {
  color: var(--portal-fg-muted);
}

body.portal-app label {
  color: var(--portal-fg-muted);
}

body.portal-app h2 {
  color: #f8fafc;
  letter-spacing: -0.015em;
}

body.portal-app .sistema-top h1 {
  color: #fff;
}

body.portal-app .sistema-user-label {
  color: var(--portal-fg-soft);
}

body.portal-app a.sistema-home-link {
  color: var(--portal-fg);
}

body.portal-app a.sistema-home-link .sistema-user-label {
  color: var(--portal-fg-soft);
}

body.portal-app .card {
  /* Bootstrap .card fuerza color: var(--bs-body-color) (oscuro); sin esto el texto del panel queda ilegible. */
  color: var(--portal-fg) !important;
  background: var(--portal-surface) !important;
  border: 1px solid var(--portal-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38) !important;
}

/* Recibo / bloques monoespaciado: legibles sobre fondo oscuro (venta_ver, etc.) */
body.portal-app pre.portal-receipt {
  margin: 0 0 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #e8edf5 !important;
  background: rgba(6, 8, 14, 0.92) !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 12px;
  padding: 1rem 1.08rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

body.portal-app .portal-sale-order {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
}

body.portal-app .portal-sale-order .portal-sale-order-label {
  color: var(--portal-fg-muted);
  font-weight: 600;
}

body.portal-app .portal-sale-order strong {
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.03em;
}

body.portal-app .portal-sale-foot {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

body.portal-app .portal-sale-foot a {
  color: var(--portal-fg-muted);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid rgba(251, 146, 60, 0.35);
}

body.portal-app .portal-sale-foot a:hover {
  color: #fed7aa;
  border-bottom-color: rgba(251, 146, 60, 0.55);
}

body.portal-app input[type="text"],
body.portal-app input[type="search"],
body.portal-app input[type="email"],
body.portal-app input[type="password"],
body.portal-app input[type="number"],
body.portal-app input[type="datetime-local"],
body.portal-app input[type="tel"],
body.portal-app select,
body.portal-app textarea {
  background: var(--portal-surface-2) !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
  color: #f8fafc !important;
}

body.portal-app input::placeholder,
body.portal-app textarea::placeholder {
  color: #94a3b8 !important;
}

body.portal-app .table-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  background: rgba(14, 17, 28, 0.95);
  margin: 0 0.55rem 1rem;
}

@media (min-width: 768px) {
  body.portal-app .table-wrap {
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 1.35rem;
  }
}

body.portal-app table.data {
  background: transparent !important;
}

body.portal-app table.data th {
  background: rgba(12, 15, 26, 0.98) !important;
  color: #f8fafc !important;
  font-weight: 650;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28) !important;
}

body.portal-app table.data td {
  color: #e2e8f0 !important;
  border-bottom-color: rgba(148, 163, 184, 0.12) !important;
}

body.portal-app table.data tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

body.portal-app table.data tbody tr:hover {
  background: rgba(251, 146, 60, 0.09);
}

body.portal-app table.data a {
  color: #fed7aa !important;
  font-weight: 600;
}

body.portal-app table.data a:hover {
  color: #ffedd5 !important;
}

body.portal-app .btn-secondary {
  color: #f1f5f9 !important;
  background: rgba(51, 65, 85, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.38) !important;
}

body.portal-app .btn-ghost {
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
}

body.portal-app .pos-search-results {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(10, 12, 20, 0.92);
}

body.portal-app .pos-hit {
  color: #e2e8f0;
}

body.portal-app .pos-hit:hover {
  background: rgba(251, 146, 60, 0.1);
}

body.portal-app .pos-cart-line {
  color: #e2e8f0;
  border-bottom-color: rgba(148, 163, 184, 0.14);
}

body.portal-app .balances-grid .card .sub,
body.portal-app .pos-grid .card .sub {
  color: var(--portal-fg-muted);
}

body.portal-app .badge-warn {
  color: #fde68a;
}

body.portal-app .grid-menu .tile .t {
  color: #f8fafc;
}

body.portal-app .grid-menu .tile .d {
  color: #cbd5e1;
}

body.portal-app .wrap-wide:has(> .portal-home-main) .grid-menu .tile .d {
  color: #dce4ee;
}

.portal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.65rem 0.35rem;
  margin: 0 0.45rem;
}

@media (min-width: 768px) {
  .portal-toolbar {
    margin: 0 0.85rem;
    padding: 0.35rem 0.15rem 0.5rem;
  }
}

.portal-toolbar-meta {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-left: auto;
}

body.portal-app .portal-toolbar-meta {
  color: var(--portal-fg-muted);
}

.portal-toolbar-btn {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  padding: 0.5rem 1.1rem !important;
  border-radius: 12px !important;
}

.portal-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem 1.25rem;
  font-size: 0.84rem;
}

.portal-pager a,
.portal-pager span {
  min-width: 2.2rem;
  padding: 0.38rem 0.55rem;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}

.portal-pager a {
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.4);
  background: rgba(251, 146, 60, 0.1);
}

.portal-pager a:hover {
  background: rgba(251, 146, 60, 0.2);
  color: #ffedd5;
}

.portal-pager span[aria-current="page"] {
  font-weight: 750;
  color: #0f172a;
  background: linear-gradient(160deg, #fb923c, #ea580c);
  border: 1px solid rgba(251, 146, 60, 0.5);
}

/* Panel principal: 2 columnas en móvil, más columnas en tablet/escritorio */
.grid-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
  padding: 0.75rem 0.65rem;
}

@media (min-width: 720px) {
  .grid-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    padding: 1rem;
  }
}

@media (min-width: 1100px) {
  .grid-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.95rem;
  }
}

.tile {
  display: block;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(165deg, rgba(24, 30, 47, 0.95), rgba(15, 20, 33, 0.95));
  border-radius: 16px;
  padding: 0.78rem 0.62rem;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  transition:
    border-color 0.22s var(--ease-out),
    transform 0.28s var(--ease-out),
    box-shadow 0.28s var(--ease-out);
}

@media (min-width: 720px) {
  .tile {
    padding: 1.08rem;
  }
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, rgba(251, 146, 60, 0.12), transparent 52%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 0;
}

.tile > * {
  position: relative;
  z-index: 1;
}

.tile:hover {
  border-color: rgba(251, 146, 60, 0.55);
  box-shadow:
    0 16px 34px rgba(232, 93, 4, 0.2),
    0 0 0 1px rgba(251, 146, 60, 0.1);
  transform: translateY(-3px);
}

.tile:hover::after {
  opacity: 1;
}

.tile:active {
  transform: translateY(-1px);
}

.tile .icon {
  font-size: 1.22rem;
  margin-bottom: 0.35rem;
  transition: transform 0.28s var(--ease-out);
}

@media (min-width: 720px) {
  .tile .icon {
    font-size: 1.45rem;
    margin-bottom: 0.5rem;
  }
}

.tile:hover .icon {
  transform: scale(1.06);
}

.tile .t {
  font-weight: 650;
  font-size: 0.86rem;
  color: #f8fafc;
  letter-spacing: 0.01em;
}

@media (min-width: 720px) {
  .tile .t {
    font-size: 0.98rem;
  }
}

.tile .d {
  font-size: 0.7rem;
  color: #9fb0c8;
  margin-top: 0.25rem;
  line-height: 1.35;
}

@media (min-width: 720px) {
  .tile .d {
    font-size: 0.78rem;
    margin-top: 0.3rem;
    line-height: 1.45;
  }
}
.badge-warn { font-size: 0.72rem; color: #fde68a; }

.table-wrap { overflow-x: auto; margin: 1rem; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.86rem; background: rgba(15, 20, 33, 0.66); border-radius: 14px; overflow: hidden; }
table.data th, table.data td { padding: 0.56rem 0.5rem; border-bottom: 1px solid rgba(148, 163, 184, 0.14); text-align: left; }
table.data th { color: #a8b8d0; font-weight: 600; background: rgba(30, 41, 59, 0.45); }
.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.pos-grid { display: grid; gap: 1rem; padding: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .pos-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

.pos-search-results {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  margin-top: 0.5rem;
  background: rgba(15, 20, 33, 0.82);
}

.pos-hit {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.52rem 0.68rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  cursor: pointer;
  font-size: 0.86rem;
}

.pos-hit:hover { background: rgba(51, 65, 85, 0.36); }

.pos-cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.86rem;
}

.pos-cart-line input { width: 3.5rem; margin: 0; }

.balances-grid { display: grid; gap: 1rem; padding: 1rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .balances-grid { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .tile,
  .tile::after,
  .tile .icon,
  .btn,
  .card,
  .sistema-hamburger-btn,
  .sistema-dropdown-item,
  .sistema-dropdown-menu {
    transition: none !important;
    animation: none !important;
  }
  .tile:hover,
  .btn:hover,
  .sistema-dropdown-item:hover,
  .sistema-dropdown-item:focus {
    transform: none !important;
  }
  .tile:hover .icon {
    transform: none !important;
  }
}
