/* ==========================================================================
   AETHEL by SESITEC — Hoja de estilos principal
   ========================================================================== */
:root,
:root[data-theme="dark"] {
  --bg-dark: #070b16;
  --bg-deep: #0a1020;
  --surface: #101a30;
  --surface-hover: #16223d;
  --border: #1f2c4a;
  --accent: #22d3ee;
  --accent-2: #7c3aed;
  --text: #e8eef7;
  --text-muted: #9aa8c0;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --topbar-width: 80%;
  --sidebar-width: 300px;
}

:root[data-theme="light"] {
  --bg-dark: #eef2f9;
  --bg-deep: #ffffff;
  --surface: #ffffff;
  --surface-hover: #e9eef7;
  --border: #d3dbe9;
  --accent: #0891b2;
  --accent-2: #7c3aed;
  --text: #1c2637;
  --text-muted: #5b6478;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --topbar-width: 80%;
  --sidebar-width: 300px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
}

.splash-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-dark);
}

.splash {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  animation: fadeUp 0.9s ease both;
}

.splash-logo {
  display: block;
  width: 100%;
  height: 100%;
  transition: filter 0.35s ease;
}

.splash-logo:hover,
.splash-logo:focus-visible {
  filter: brightness(1.05);
  outline: none;
}

/* El logo ocupa todo el navegador y se ajusta sin deformarse (responsive) */
.splash-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Frase principal: arriba, centrada, con mínima separación del borde */
.splash-tagline {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 860px;
  margin: 0;
  text-align: center;
  font-size: clamp(1.35rem, 5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

/* Texto secundario: izquierda (25% top, 10% left, 25% de ancho) */
.splash-sub {
  position: absolute;
  top: 25%;
  left: 10%;
  width: 25%;
  margin: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2.2vw, 1.1rem);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

/* Texto secundario: derecha (25% top, 10% right, 25% de ancho) */
.splash-sub-right {
  position: absolute;
  top: 25%;
  right: 10%;
  width: 25%;
  margin: 0;
  text-align: center;
  color: var(--text);
  font-weight: 600;
  font-size: clamp(0.85rem, 2.2vw, 1.1rem);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

/* Pie: botón y nota centrados */
.splash-footer {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  text-align: center;
}

.splash-enter {
  display: inline-block;
  margin-top: 0;
  padding: clamp(0.5rem, 1.4vw, 0.85rem) clamp(1.2rem, 3vw, 1.9rem);
  border-radius: 999px;
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: 600;
  color: #06121a;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.splash-enter:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(34, 211, 238, 0.35);
}

.splash-hint {
  margin-top: 0.9rem;
  font-size: clamp(0.65rem, 1.6vw, 0.9rem);
  color: var(--text-muted);
  opacity: 0.85;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar-wrap {
  position: relative;
  z-index: 50;
  flex-shrink: 0;
  background: rgba(7, 11, 22, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 1.5rem;
}

.topbar-brand {
  flex-shrink: 0;
}

.topbar-logo {
  height: 50.6px; /* 46px + 10% */
  width: auto;
  display: block;
  border-radius: 10px;
}

.topbar-menu {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  list-style: none;
}

.topbar-menu li {
  display: flex;
  align-items: center;
}

.topbar-menu a,
.topbar-menu .menu-link {
  position: relative;
  display: inline-block;
  padding: 0.55rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.topbar-menu .menu-link {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}

.topbar-menu a:hover,
.topbar-menu a.active,
.topbar-menu .menu-link:hover,
.topbar-menu .menu-link.active {
  color: var(--text);
  text-decoration: none;
  background: rgba(34, 211, 238, 0.08);
}

.topbar-menu a::after,
.topbar-menu .menu-link::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.3rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  width: 0;
  transition: width 0.25s ease;
}

.topbar-menu a:hover::after,
.topbar-menu a.active::after,
.topbar-menu .menu-link:hover::after,
.topbar-menu .menu-link.active::after {
  width: calc(100% - 1.7rem);
}

.cotizacion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  white-space: nowrap;
}

/* Menú de productos: ahora es una columna fija a la izquierda (ver .products-sidebar). */

body.home-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-layout {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 0;
}

.products-sidebar {
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  padding: 1.25rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--accent);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-item:hover {
  background: var(--surface);
  color: var(--accent);
}

.chevron {
  font-size: 0.85rem;
  transition: transform 0.25s ease;
}

.sidebar-item.open .chevron {
  transform: rotate(180deg);
}

.submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 1rem;
}

.submenu.open {
  max-height: 400px;
}

.submenu a {
  display: block;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.93rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.submenu a:hover,
.submenu a.active {
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
}

.content {
  min-height: 0;
  overflow-y: auto;
  padding: 2rem 2rem 3rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  padding: 4rem 0 3rem;
}

.hero-inner {
  max-width: 720px;
}

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 1.1rem;
}

.hero-title span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 620px;
  margin-bottom: 1.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-primary {
  color: #06121a;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 22px rgba(34, 211, 238, 0.28);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--accent);
}

.section {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.4rem;
}

.section-lead {
  color: var(--text-muted);
  max-width: 720px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  background: var(--surface-hover);
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

a.card {
  color: inherit;
}

a.card:hover {
  text-decoration: none;
}

a.card h3 {
  color: var(--accent);
}

.footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  :root {
    --topbar-width: 100%;
  }

  .topbar {
    padding: 0.6rem 1rem;
    flex-wrap: wrap;
  }

  .topbar-menu {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.8rem 1.2rem;
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .products-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 45vh;
  }
}

@media (max-width: 640px) {
  .splash-tagline {
    top: 5%;
    width: 94%;
  }

  .splash-sub {
    top: 18%;
    left: 5%;
    width: 90%;
  }

  .splash-sub-right {
    top: 36%;
    right: auto;
    left: 5%;
    width: 90%;
  }

  .splash-footer {
    bottom: 1rem;
  }
}

@media (max-width: 560px) {
  .products-sidebar {
    max-height: 40vh;
  }
}

/* ==========================================================================
   Listado de artículos (catálogo dinámico)
   ========================================================================== */
.articulos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.articulo {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.articulo:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.articulo-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--bg-deep);
}

.articulo-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.articulo-nombre {
  font-size: 1.05rem;
}

.articulo-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.articulo-precio {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.articulo-precio-usd {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.articulo-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.articulo-meta a {
  color: var(--accent);
}

.articulo-cantidad {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.articulo-cantidad-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.articulo-cantidad-input {
  width: 5rem;
  padding: 0.45rem 0.6rem;
}

.articulo-subtotal {
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.articulo-aviso {
  font-size: 0.8rem;
  color: #fbbf24;
  flex-basis: 100%;
}

.sidebar-error {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.5rem;
}

/* ==========================================================================
   Autenticación y carrito (plataforma de ventas)
   ========================================================================== */
.hidden {
  display: none !important;
}

.btn-login {
  color: #06121a;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}

.topbar-menu .btn-login:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.btn-ingresar {
  color: #ffffff;
  background: linear-gradient(135deg, #15803d, #052e16);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: filter 0.2s ease;
}

.topbar-menu .btn-ingresar {
  color: #ffffff;
}

.topbar-menu .btn-ingresar:hover {
  text-decoration: none;
  filter: brightness(1.06);
}

.btn-logout {
  color: #fff;
  background: linear-gradient(90deg, #f43f5e, #be123c);
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.topbar-menu .btn-logout:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.45);
}

.usuario-nombre {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121a;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.auth-box {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-box label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.auth-box textarea.input {
  min-height: 60px;
  resize: vertical;
}

.admin-col {
  flex: 1;
  min-width: 120px;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-cart {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-cart h3 {
  font-size: 1rem;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.sidebar-cart .btn-block {
  margin-top: 0.75rem;
}

.carrito-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 0.75rem;
}

.carrito-item-info {
  flex: 1;
  font-size: 0.95rem;
}

.carrito-item-info span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.carrito-item-controles {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.carrito-item-controles .btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
}

.carrito-cantidad {
  min-width: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.carrito-item-subtotal {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.carrito-total {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: right;
}

.checkout-acciones {
  margin-top: 1rem;
}

/* ==========================================================================
   Panel de carrito (derecha) — Ventas
   ========================================================================== */
.app-layout--ventas {
  grid-template-columns: var(--sidebar-width) 1fr 340px;
}

.carrito-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-deep);
  border-left: 1px solid var(--border);
  padding: 1.25rem;
  overflow-y: auto;
}

.carrito-panel-head {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.carrito-panel-head h2 {
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: var(--accent);
}

.carrito-panel-lista {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.carrito-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 0.75rem;
}

.carrito-item-desc {
  position: relative;
  padding-right: 1.5rem;
  margin-bottom: 0.75rem;
}

.carrito-item-desc strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.carrito-item-quitar {
  position: absolute;
  top: 0;
  right: 0;
  background: transparent;
  border: none;
  color: #f43f5e;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0.25rem;
  transition: filter 0.2s ease;
}

.carrito-item-quitar:hover {
  filter: brightness(1.3);
}

.carrito-item-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.carrito-item-bottom label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.carrito-precio-unitario {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 0.15rem;
}

.carrito-cant-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.carrito-cant-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carrito-cantidad-input {
  width: 3.5rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  text-align: center;
}

.carrito-cantidad-input:focus {
  outline: none;
  border-color: var(--accent);
}

.carrito-item-subtotal {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .app-layout--ventas {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .carrito-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 40vh;
  }
}

/* ==========================================================================
   Galería de imágenes (admin) y carrusel (catálogo)
   ========================================================================== */
.art-galeria {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.art-galeria-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.art-galeria-img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.art-galeria-acciones {
  display: flex;
  gap: 0.25rem;
  padding: 0.4rem;
}

.art-galeria-acciones .btn {
  flex: 1;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
}

.articulo-media {
  position: relative;
}

.articulo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(7, 11, 22, 0.65);
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.articulo-nav:hover {
  background: rgba(34, 211, 238, 0.85);
}

.articulo-nav.prev { left: 8px; }
.articulo-nav.next { right: 8px; }

.articulo-contador {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(7, 11, 22, 0.7);
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Badges de estado */
.estado-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.estado-badge.aprobado,
.estado-badge.pagado {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.estado-badge.pendiente {
  background: rgba(154, 168, 192, 0.18);
  color: var(--text-muted);
  border: 1px solid rgba(154, 168, 192, 0.35);
}

.estado-badge.rechazado {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

/* Mis pedidos */
.pedidos-lista {
  margin-top: 1rem;
}

.pedido-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pedido-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.pedido-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.pedido-titulo {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.pedido-titulo strong {
  font-size: 1.05rem;
}

.pedido-fecha {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pedido-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pedido-item-linea {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.pedido-item-linea span:last-child {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pedido-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  text-align: right;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
}

/* Perfil */
.perfil-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.perfil-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.perfil-head h3 {
  margin: 0;
}

.perfil-section {
  margin-bottom: 1.25rem;
}

.perfil-section h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.perfil-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.perfil-card label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 560px) {
  .perfil-grid {
    grid-template-columns: 1fr;
  }
}

.aviso {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid var(--accent-2);
  color: var(--text);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   Panel de administración
   ========================================================================== */
.admin-content {
  width: 80%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-card h3 {
  margin-bottom: 0.75rem;
}

.admin-card h4 {
  margin: 1rem 0 0.5rem;
}

.admin-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 0.75rem 0;
}

.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.tabla th,
.tabla td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.admin-usuario {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.6rem;
}

.admin-acciones {
  display: flex;
  gap: 0.5rem;
}

/* Admin: pestañas de módulos */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-tab {
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.admin-tab:hover {
  color: var(--text);
  border-color: var(--accent);
}

.admin-tab.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.admin-panel-head h3 {
  margin: 0;
}

.admin-filtro {
  max-width: 240px;
}

/* ==========================================================================
   Toggle de tema (día / noche)
   ========================================================================== */
.tema-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}

.tema-toggle:hover {
  border-color: var(--accent);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.4);
  transform: translateY(-1px);
}

.tema-toggle-fixed {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

:root[data-theme="light"] .topbar-wrap {
  background: rgba(238, 242, 249, 0.92);
}

.transferencia-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(7, 11, 22, 0.7);
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-head h3 {
  margin: 0;
}

.modal-head .btn-ghost {
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 0.5rem;
}