:root {
  --bg: #EEE7D5;
  --text: #1F2933;
  --primary: #D52B1C;
  --primary-dark: #B21E13;
  --blue: #00437A;
  --yellow: #EA9A2E;
  --radius: 14px;
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.5rem;
  background: rgba(238, 231, 213, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.header__menu-btn {
  display: none;
  border: none;
  background: #fff;
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.logo-img {
  height: 52px;
  width: auto;
}

.header__nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  align-items: center;
}

.header__nav a,
.header__nav .header__nav-link{
  display: inline-flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #4b5563;
  background: transparent;
}

.header__nav a:hover,
.header__nav .header__nav-link:hover{
  color: var(--primary);
  background: rgba(0,0,0,0.04);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  border: none;
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 1.1rem;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.1s ease;
}

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

/* LAYOUT */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.section {
  margin-top: 3rem;
}

.section--light {
  background: #ffffff;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-top: 3rem;
}

.section__header h2 {
  font-family: "Pacifico", cursive;
  margin-bottom: 0.25rem;
  color: var(--blue);
}

.section__header p {
  margin-top: 0;
  color: #666;
}
.section__header--with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.section__header-actions {
  display: inline-flex;
  gap: 0.35rem;
}
.icon-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
}
.icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-soft);
}

/* --- Admin icons en tarjeta de producto --- */
.product-card {
  position: relative;
}

.product-card__admin-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.product-card__icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 4px 6px;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
  line-height: 1;
}

.product-card__icon-btn--delete {
  color: #D52B1C;
}

.product-card__icon-btn:hover {
  background: #ffffff;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.hero__badge {
  display: inline-block;
  background: rgba(213, 43, 28, 0.08);
  color: var(--primary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-family: "Pacifico", cursive;
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin: 0 0 0.75rem;
  color: var(--blue);
}

.hero__subtitle {
  color: #4b5563;
  font-size: 0.95rem;
}

.hero__actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__image {
  display: flex;
  justify-content: center;
}

.product-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.products-feedback {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.products-feedback--error {
  color: var(--primary);
}

.admin-panel {
  display: none;
  background: #fff7ee;
  border: 1px solid #f5c7bf;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-soft);
}

.admin-panel.is-visible {
  display: block;
}

.admin-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.admin-panel__status {
  color: #6b7280;
  font-size: 0.9rem;
}

.admin-form {
  display: grid;
  gap: 0.75rem;
}

.admin-form__grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.admin-form label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #374151;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  padding: 0.55rem 0.7rem;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}
.admin-form select {
  background: #fff;
}

.admin-form__span2 {
  grid-column: span 2;
}

.admin-form__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero__logo-img {
  max-width: 320px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.18));
  border-radius: 24px;
}

/* BOTONES */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: rgba(213, 43, 28, 0.06);
}

.btn-outline.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* CATEGORÍAS / GRID */
.grid-categories,
.grid-products {
  display: grid;
  gap: 1.5rem;
}

.grid-categories {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Tarjetas de categorías clicables */
.category-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.category-card h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.category-card p {
  margin: 0;
  color: #374151;
  font-size: 0.9rem;
}


/*.category-card h3 {
  margin-top: 0;
}*/


/* TARJETAS PRODUCTO: IMAGEN COMO BOTÓN */
.product-card__image-btn {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  border: 2px dashed rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.75rem;
}

.product-card__image-btn.disabled {
  cursor: default;
  border-style: solid;
}

.product-card__image-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__image-placeholder {
  font-size: 0.8rem;
  color: #6b7280;
}

.product-card__note {
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.2;
}

.product-card__note--out {
  color: #b00020;
}

.product-card__price {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.product-card__desc {
  font-size: 0.85rem;
  color: #6b7280;
}
.product-card__stock {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0.15rem 0 0.35rem;
}
.btn-primary--disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

/* DOS COLUMNAS GENÉRICO */
.section__two-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.section__photo-placeholder {
  background: linear-gradient(135deg, #ffe0dc, #fff2b3);
  border-radius: var(--radius);
  min-height: 220px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.badge--yellow {
  background: #fff2b3;
  color: #8a6b00;
}

.admin-btn--user {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
  gap: 2px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.admin-btn__name {
  font-size: 0.95rem;
  font-weight: 600;
}
.admin-btn__sub {
  font-size: 0.7rem;
  opacity: 0.85;
}

/* LISTAS PERSONALIZADAS */
.custom-list {
  padding-left: 1.2rem;
}

.custom-list li {
  margin-bottom: 0.4rem;
}

.custom-cta p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

/* CONTACTO */
.contact p {
  margin: 0.2rem 0;
}

/* CARRITO */
.cart-count {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 0 0.4rem;
  font-size: 0.7rem;
  margin-left: 0.2rem;
}

.cart-panel{
  position: fixed;
  top: 0;
  right: -360px;
  width: 320px;
  max-width: 100%;
  height: 100%;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  border-left: 1px solid var(--border, rgba(17,24,39,.10));
  box-shadow: -4px 0 24px rgba(0,0,0,0.22);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease-out;
}
.cart-panel--open{ right: 0; }

.cart-panel__header,
.cart-panel__footer{
  padding: 1rem;
  border-bottom: 1px solid var(--border, rgba(17,24,39,.10));
  background: var(--panel-soft, rgba(17,24,39,.06));
}
.cart-panel__footer{
  border-top: 1px solid var(--border, rgba(17,24,39,.10));
  border-bottom: none;
  margin-top: auto;
  background: transparent;
}

.cart-panel__header h3{
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text, #111827);
}

.cart-panel__items{
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  color: var(--text, #111827);
}
.cart-panel__items p{
  color: var(--muted, #6b7280);
}

.cart-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--text, #111827);
}
.cart-item__info{
  max-width: 70%;
  color: var(--text, #111827);
}
.cart-item__info small,
.cart-item__info span{
  color: var(--muted, #6b7280);
}

.cart-item__qty{
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-item__btn{
  border: 1px solid var(--border, rgba(17,24,39,.10));
  background: var(--panel-soft, rgba(17,24,39,.06));
  color: var(--text, #111827);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  cursor: pointer;
}
.cart-item__btn:hover{
  background: var(--panel-soft-2, rgba(17,24,39,.10));
}
.cart-item__btn[disabled],
.cart-item__btn--disabled{
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-panel__close{
  border: 1px solid var(--border, rgba(17,24,39,.10));
  background: transparent;
  color: var(--text, #111827);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 1rem;
}
.cart-panel__close:hover{
  background: var(--panel-soft, rgba(17,24,39,.06));
}

/* =========================
   ADMIN ORDERS
   ========================= */

.admin-only {
  display: none;
}

.admin-only.is-visible {
  display: block;
}

.admin-orders__table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.admin-orders__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-orders__table th,
.admin-orders__table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eee;
  text-align: left;
  white-space: nowrap;
}

.admin-orders__table th {
  font-weight: 600;
  background: #fafafa;
}

.order-status {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.order-status--pending {
  background: #fff6e5;
  color: #b86e00;
}

.order-status--paid {
  background: #e6f8ec;
  color: #1b7a3f;
}

.order-status--cancelled {
  background: #fdecee;
  color: #b3261e;
}

.admin-orders__actions {
  display: flex;
  gap: 0.4rem;
}

.admin-orders__btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.admin-orders__btn--primary {
  border-color: #e53935;
  background: #e53935;
  color: #fff;
}

.admin-orders__btn--danger {
  border-color: #b3261e;
  background: #fff;
  color: #b3261e;
}

.admin-orders__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* --- Pedidos: columna productos --- */
.order-products {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  white-space: nowrap;
}

.order-products__summary {
  font-weight: 600;
  color: #111827;
}

.order-products__hint {
  font-size: 12px;
  color: #6b7280;
  margin-left: 8px;
}

.btn-outline {
  border: 1px solid #d1d5db;
  background: transparent;
  color: #111827;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.btn-outline:hover {
  background: rgba(17, 24, 39, 0.04);
}

/* --- Modal elegante --- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal.is-open {
  display: block;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}

.modal__dialog {
  position: relative;
  width: min(720px, calc(100% - 32px));
  margin: 64px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
  background: #fbfbfc;
}

.modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

.modal__meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.modal__close {
  border: 1px solid #e5e7eb;
  background: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.modal__body {
  padding: 16px 18px;
}

.modal__table-wrap {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  overflow: hidden;
}

.modal__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.modal__table thead th {
  text-align: left;
  padding: 10px 12px;
  background: #f9fafb;
  border-bottom: 1px solid #eef2f7;
  color: #111827;
}

.modal__table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  color: #111827;
}

.modal__table tbody tr:last-child td {
  border-bottom: none;
}

.t-right {
  text-align: right;
}

.modal__total {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fbfbfc;
}

.modal__footer {
  padding: 14px 18px;
  border-top: 1px solid #eef2f7;
  display: flex;
  justify-content: flex-end;
  background: #fff;
}

/* =========================
   PANEL DE ANALÍTICA / VENTAS
   ========================= */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.analytics-card {
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.1rem;
}

.analytics-card__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
}

.analytics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.86rem;
}

.analytics-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.35rem;
  color: #4b5563;
}

.analytics-list li strong {
  font-weight: 600;
  color: #111827;
}

.analytics-label {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.analytics-value {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

.analytics-table-wrapper {
  margin-top: 1.5rem;
}

.analytics-table__title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.analytics-table__subtitle {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
}

@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}


.cart-panel__close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.cart-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.menu-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

/* ========================= */
/* MODAL IMAGEN PRODUCTO     */
/* ========================= */

.image-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.image-modal.is-open {
  display: flex;
}

.image-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.image-modal__content {
  position: relative;
  background: #ffffff;
  padding: 1rem;
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-modal__content img {
  max-width: 85vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
}

.image-modal__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.image-modal__caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  color: #444;
}

/* =========================
   SPLASH / PANTALLA DE CARGA
   ========================= */

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 20% 20%, #fff7e6, #eee7d5);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash__content {
  text-align: center;
}

.splash__circle {
  width: 180px;
  height: 180px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
  margin: 0 auto 1rem;
  position: relative;
  overflow: hidden;
}

/* Simulación de “máquina cociendo”: una línea que parpadea abajo */
.splash__circle::after {
  content: "";
  position: absolute;
  bottom: 18px;
  left: 20%;
  width: 60%;
  height: 2px;
  background: #d52b1c;
  border-radius: 999px;
  animation: stitch 1.4s infinite ease-in-out;
}

/* 💥 Aquí forzamos que la imagen JAMÁS ocupe toda la pantalla */
.splash__logo {
  max-width: 120px;
  max-height: 120px;
  height: auto;
  width: 120px;
  display: block;
  object-fit: contain;
}

/* Por si tienes una regla global img { width: 100%; } */
.splash img {
  width: auto !important;
  height: auto !important;
}

/* Texto debajo */
.splash__text {
  margin: 0;
  font-size: 0.95rem;
  color: #6b7280;
}

/* Estado oculto (cuando JS termina de cargar) */
.splash--hide {
  opacity: 0;
  visibility: hidden;
}

/* Animación “stitch” */
@keyframes stitch {
  0% {
    transform: translateX(-40%);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    transform: translateX(40%);
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
}


/* RESPONSIVE */
@media (max-width: 768px) {
  .header__nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 1rem 1.25rem;
    display: grid;
    gap: 0.75rem;
    box-shadow: var(--shadow-soft);
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .header__nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .header__menu-btn {
    display: inline-flex;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__image {
    order: -1;
  }

  .section--light {
    padding: 2rem 1rem;
  }

  .section__two-cols {
    grid-template-columns: 1fr;
  }
}

/* =========================
   PÁGINAS AUTH (login / signup / reset)
   ========================= */

.auth-page {
  min-height: 100vh;
  background: var(--bg);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.auth-logo-link {
  display: inline-block;
  margin: 1rem 1.5rem 0;
  font-family: "Pacifico", cursive;
  color: var(--blue);
  text-decoration: none;
  font-size: 1.1rem;
}

.auth-logo-link:hover {
  text-decoration: underline;
}

.auth-main {
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-soft);
}

.auth-title {
  margin: 0 0 0.25rem;
  font-size: 1.7rem;
  color: var(--text);
}

.auth-subtitle {
  margin: 0 0 1.5rem;
  color: #6b7280;
  font-size: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #374151;
}

.auth-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
  font-family: inherit;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(213, 43, 28, 0.2);
}

.auth-message {
  margin: 0.25rem 0 0.5rem;
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #b3261e; /* rojo error suave */
}

.auth-submit {
  margin-top: 0.5rem;
  width: 100%;
}

.auth-switch {
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
  color: #4b5563;
}

.auth-switch a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem;
  }
}

/* ====== Firma en pantallas de auth (login / signup / reset) ====== */
.auth-footer {
  text-align: center;
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

.auth-footer__divider {
  display: block;
  width: 120px;
  height: 1px;
  margin: 0 auto 0.8rem;
  background: rgba(148, 163, 184, 0.4); /* gris suave */
  border-radius: 999px;
}

.auth-footer__text {
  margin: 0;
  letter-spacing: 0.01em;
}

.auth-footer__text strong {
  font-weight: 600;
  color: #4b5563; /* gris más oscuro */
}

.auth-footer__brand {
  color: var(--blue);
  font-weight: 600;
}

.auth-footer__dot {
  margin: 0 0.25rem;
}

/* =========================
   HEADER ACTION BUTTONS
   ========================= */
.header__actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

/* Base pill button for header (both <a> and <button>) */
.header__actions a.btn-outline,
.header__actions a.btn-primary,
.header__actions button.btn-outline,
.header__actions button.btn-primary,
.header__actions .admin-header__btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border-radius:999px;
  font-weight:700;
  letter-spacing:.2px;
  text-decoration:none;
  line-height:1;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
  transition:transform .12s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, color .12s ease;
  border:2px solid var(--primary);
  color: var(--primary);
  background:#fff;
}

.header__actions a.btn-outline:hover,
.header__actions button.btn-outline:hover,
.header__actions .admin-header__btn--ghost:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(0,0,0,.09);
}

.header__actions a.btn-primary:hover,
.header__actions button.btn-primary:hover,
.header__actions .admin-header__btn--primary:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 26px rgba(0,0,0,.12);
}

/* Mapeo de clases del header admin (porque el HTML usa estas) */
.admin-header__btn{
  border:2px solid var(--primary);
  background:#fff;
  color:var(--primary);
}
.admin-header__btn--ghost{
  border:2px solid var(--primary);
  background:#fff;
  color:var(--primary);
}
.admin-header__btn--primary{
  border:2px solid var(--primary);
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;
}

/* Botón de sesión en dos líneas (Nombre + subtexto) */
.header__actions .admin-btn--user{
  flex-direction:column;
  align-items:flex-start;
  padding:8px 12px;
  min-width:150px;
}
.header__actions .admin-btn__name{
  font-size:14px;
  font-weight:800;
  line-height:1.05;
}
.header__actions .admin-btn__sub{
  font-size:11px;
  font-weight:700;
  opacity:.8;
  margin-top:2px;
}

@media (max-width: 520px){
  .header__actions .admin-btn--user{
    min-width:auto;
    align-items:center;
  }
}

/* =========================
   THEMES (CSP friendly) — tokens + contrast
   ========================= */
:root{
  /* UI tokens */
  --page-bg: #f6f0e3;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17,24,39,.10);
  --accent: #e11d2e;     /* rojo marca por defecto */
  --accent-2: #b91c1c;
  --shadow: 0 10px 28px rgba(17,24,39,.10);
  --accent-contrast: #ffffff;
  --panel-soft: rgba(17,24,39,.06);
  --panel-soft-2: rgba(17,24,39,.10);

  /* header glass */
  --header-bg: rgba(255,255,255,.90);

  /* pattern */
  --pattern-opacity: .06;
  --pattern-dot: rgba(0,0,0,.35);

  /* Backward-compat (para no romper tu CSS viejo) */
  --bg: var(--page-bg);
  --primary: var(--accent);
  --primary-dark: var(--accent-2);
}

body{
  background: var(--page-bg);
  color: var(--text);
}

/* patrón sutil global */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: var(--pattern-opacity);
  background-image: radial-gradient(circle at 1px 1px, var(--pattern-dot) 1px, transparent 0);
  background-size: 26px 26px;
  z-index: 0;
}
main, header, footer, .page, .container { position: relative; z-index: 1; }

/* === Theme: DEFAULT === */
body[data-theme="default"]{}

/* === Theme: REYES MAGOS (premium night + gold) === */
body[data-theme="reyes"]{
  --page-bg:#0b1220;
  --surface:#0f1b33;
  --surface-2:#13264a;
  --text:#f9fafb;
  --muted:#cbd5e1;
  --border: rgba(255,255,255,.14);
  --accent:#d4af37;      /* dorado */
  --accent-2:#f5d36a;    /* dorado claro */
  --shadow: 0 14px 34px rgba(0,0,0,.35);
  --header-bg: rgba(15,27,51,.88);
  --accent-contrast: #0b1220;

  --pattern-opacity:.10;
  --pattern-dot: rgba(212,175,55,.55);
  --primary: var(--accent);
  --primary-dark: var(--accent-2);
  --blue: var(--accent-2);
}

/* “Cometa” decorativo solo en Reyes */
body[data-theme="reyes"]::after{
  content:"";
  position: fixed;
  top: -80px;
  right: -120px;
  width: 520px;
  height: 220px;
  pointer-events: none;
  opacity: .35;
  transform: rotate(18deg);
  background:
    radial-gradient(circle at 22% 50%, rgba(245,211,106,.95) 0 6px, transparent 7px),
    linear-gradient(90deg, rgba(245,211,106,.0), rgba(245,211,106,.35), rgba(245,211,106,.0));
  filter: blur(.2px);
  z-index: 0;
}

/* === Otros temas (se conservan) === */
body[data-theme="valentin"]{
  --page-bg:#fff3f5;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --accent:#8b1531;
  --accent-2:#e11d48;
}
body[data-theme="valentin"]::before{ opacity:.10; background-image: radial-gradient(circle at 1px 1px, rgba(225,29,72,.45) 1px, transparent 0); }

body[data-theme="carnaval"]{
  --page-bg:#f7fbff;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --accent:#06b6d4;
  --accent-2:#7c3aed;
}
body[data-theme="carnaval"]::before{ opacity:.08; background-image: radial-gradient(circle at 1px 1px, rgba(124,58,237,.40) 1px, transparent 0); }

body[data-theme="primavera"]{
  --page-bg:#f4f1e7;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --accent:#4b7b5a;
  --accent-2:#b45309;
}
body[data-theme="primavera"]::before{ opacity:.08; background-image: radial-gradient(circle at 1px 1px, rgba(75,123,90,.42) 1px, transparent 0); }

body[data-theme="madres"]{
  --page-bg:#fff7f5;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --accent:#b76e79;
  --accent-2:#d4af37;
}
body[data-theme="madres"]::before{ opacity:.08; background-image: radial-gradient(circle at 1px 1px, rgba(183,110,121,.45) 1px, transparent 0); }

body[data-theme="padre"]{
  --page-bg:#0f172a;
  --surface:#111827;
  --surface-2:#111827;
  --text:#f9fafb;
  --muted:#cbd5e1;
  --border: rgba(255,255,255,.14);
  --accent:#b87333;
  --accent-2:#94a3b8;
}
body[data-theme="padre"]::before{ opacity:.10; background-image: radial-gradient(circle at 1px 1px, rgba(184,115,51,.45) 1px, transparent 0); }

body[data-theme="clases"]{
  --page-bg:#f7fbff;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --accent:#2563eb;
  --accent-2:#f59e0b;
}
body[data-theme="clases"]::before{ opacity:.08; background-image: radial-gradient(circle at 1px 1px, rgba(37,99,235,.38) 1px, transparent 0); }

body[data-theme="patrias"]{
  --page-bg:#fbf6ea;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --accent:#166534;
  --accent-2:#b91c1c;
}
body[data-theme="patrias"]::before{ opacity:.08; background-image: radial-gradient(circle at 1px 1px, rgba(22,101,52,.40) 1px, transparent 0); }

body[data-theme="halloween"]{
  --page-bg:#0b0f1a;
  --surface:#101827;
  --surface-2:#101827;
  --text:#f9fafb;
  --muted:#cbd5e1;
  --border: rgba(255,255,255,.14);
  --accent:#f97316;
  --accent-2:#7c3aed;
  --accent-contrast: #111827;
}
body[data-theme="halloween"]::before{ opacity:.10; background-image: radial-gradient(circle at 1px 1px, rgba(249,115,22,.45) 1px, transparent 0); }

body[data-theme="buenfin"]{
  --page-bg:#0b1220;
  --surface:#0f172a;
  --surface-2:#0f172a;
  --text:#f9fafb;
  --muted:#cbd5e1;
  --border: rgba(255,255,255,.14);
  --accent:#111827;
  --accent-2:#22c55e;
}
body[data-theme="buenfin"]::before{ opacity:.06; background-image: radial-gradient(circle at 1px 1px, rgba(34,197,94,.40) 1px, transparent 0); }

body[data-theme="navidad"]{
  --page-bg:#fbf6ea;
  --surface:#ffffff;
  --surface-2:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --accent:#14532d;
  --accent-2:#7f1d1d;
}
body[data-theme="navidad"]::before{ opacity:.09; background-image: radial-gradient(circle at 1px 1px, rgba(127,29,29,.38) 1px, transparent 0); }

body[data-theme="reyes"],
body[data-theme="padre"],
body[data-theme="halloween"],
body[data-theme="buenfin"]{
  --panel-soft: rgba(255,255,255,.08);
  --panel-soft-2: rgba(255,255,255,.14);
}

/* =========================
   Componentes: usar tokens (contraste)
   ========================= */

/* HEADER */
.header{
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

/* botones icon del header */
.header__menu-btn,
.btn-icon{
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* links del nav */
.header__nav a,
.header__nav-link{
  color: var(--muted);
}
.header__nav a:hover,
.header__nav-link:hover{
  color: var(--accent);
  background: rgba(255,255,255,.06);
}

/* secciones/cards principales */
.section--light,
.category-card,
.analytics-card{
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.section__header p,
.hero__subtitle,
.category-card p,
.products-feedback,
.analytics-label{
  color: var(--muted);
}

/* tabla admin */
.admin-orders__table th{
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.admin-orders__table td{
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* product image button */
.product-card__image-btn{
  background: rgba(255,255,255,.06);
  border: 2px dashed rgba(255,255,255,.18);
}
body[data-theme="default"] .product-card__image-btn{
  background: rgba(255,255,255,.70);
  border: 2px dashed rgba(0,0,0,.15);
}

/* Buttons hook */
.btn-primary{
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
}
.btn-outline{
  border-color: var(--accent);
  color: var(--accent);
}

/* Reyes: glow premium en CTA */
body[data-theme="reyes"] .btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 1px rgba(212,175,55,.32), 0 16px 34px rgba(212,175,55,.16);
}
body[data-theme="reyes"] .btn-primary:hover{
  filter: brightness(1.03);
  box-shadow: 0 0 0 1px rgba(212,175,55,.38), 0 18px 40px rgba(212,175,55,.20);
}
body[data-theme="reyes"] .btn-outline:hover{
  background: rgba(212,175,55,.10);
}

/* Reyes: títulos con dorado suave */
body[data-theme="reyes"] .hero h1,
body[data-theme="reyes"] .section__header h2{
  color: var(--accent-2);
  text-shadow: 0 10px 26px rgba(212,175,55,.10);
}

.theme-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.theme-modal.is-open{
  display: block;
}

/* Theme modal compatible con oscuro */
.theme-modal__panel{
  background: var(--surface, #fff);
  color: var(--text, #111827);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.theme-item{
  background: var(--panel-soft, rgba(17,24,39,.06));
  border: 1px solid var(--border);
  color: var(--text, #111827);
}
body[data-theme="default"] .theme-item{
  background: rgba(255,255,255,.60);
}
.theme-item__sub{ color: var(--muted); }
.theme-item.is-active{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(225,29,46,.14);
}
.theme-item__btn{
  border: 1px solid var(--border, rgba(17,24,39,.10));
  color: var(--text, #111827);
  background: transparent;
}
.theme-item__btn:hover{
  background: var(--panel-soft, rgba(17,24,39,.06));
}

/* Badge Reyes (opcional visual) */
body[data-theme="reyes"] .hero__badge{
  background: rgba(212,175,55,.14);
  color: var(--accent-2);
  border: 1px solid rgba(212,175,55,.22);
}

/* Nav link button same look as <a> */
.header__nav-link{
  appearance:none;
  border:0;
  background:transparent;
  font: inherit;
  color: inherit;
  cursor:pointer;
  padding: 10px 12px;
  border-radius: 10px;
}
.header__nav-link:hover{
  background: rgba(0,0,0,.05);
}

/* =========================
   THEME: REYES (mejoras pro)
   ========================= */
body[data-theme="reyes"]{
  /* ya defines vars, aquí refinamos */
  --muted: #d3dbe7;
}

body[data-theme="reyes"] .header{
  background: rgba(11,18,32,.88);
  border-bottom: 1px solid rgba(212,175,55,.18);
}

body[data-theme="reyes"] .header__nav a,
body[data-theme="reyes"] .header__nav .header__nav-link{
  color: var(--muted);
}
body[data-theme="reyes"] .header__nav a:hover,
body[data-theme="reyes"] .header__nav .header__nav-link:hover{
  color: var(--accent-2);
  background: rgba(212,175,55,.08);
}

body[data-theme="reyes"] .section--light,
body[data-theme="reyes"] .category-card,
body[data-theme="reyes"] .analytics-card,
body[data-theme="reyes"] .admin-panel,
body[data-theme="reyes"] .auth-card{
  background: rgba(15,27,51,.92);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: 0 18px 45px rgba(0,0,0,.25);
}

body[data-theme="reyes"] .section__header p,
body[data-theme="reyes"] .hero__subtitle,
body[data-theme="reyes"] .products-feedback,
body[data-theme="reyes"] .product-card__desc,
body[data-theme="reyes"] .product-card__stock{
  color: var(--muted);
}

body[data-theme="reyes"] .hero h1,
body[data-theme="reyes"] .section__header h2{
  color: var(--accent-2);
  text-shadow: 0 2px 18px rgba(212,175,55,.18);
}

body[data-theme="reyes"] .hero__badge{
  background: rgba(212,175,55,.14);
  border: 1px solid rgba(245,211,106,.35);
  color: var(--accent-2);
  box-shadow: 0 10px 22px rgba(212,175,55,.10);
}

body[data-theme="reyes"] .btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(245,211,106,.85);
  color: #0b1220;
  box-shadow: 0 14px 28px rgba(212,175,55,.18);
}
body[data-theme="reyes"] .btn-primary:hover{
  filter: brightness(1.03);
  box-shadow: 0 16px 34px rgba(212,175,55,.24);
}

body[data-theme="reyes"] .btn-outline,
body[data-theme="reyes"] .header__actions a.btn-outline,
body[data-theme="reyes"] .header__actions button.btn-outline{
  border-color: rgba(245,211,106,.85);
  color: var(--accent-2);
  background: rgba(255,255,255,.02);
}
body[data-theme="reyes"] .btn-outline:hover{
  background: rgba(212,175,55,.10);
  box-shadow: 0 0 0 3px rgba(212,175,55,.14);
}

body[data-theme="reyes"] .admin-orders__table th{
  background: rgba(255,255,255,.04);
  color: var(--text);
}
body[data-theme="reyes"] .admin-orders__table td{
  color: var(--text);
}
body[data-theme="reyes"] .order-status--pending{ background: rgba(245,211,106,.14); color: #f5d36a; }
body[data-theme="reyes"] .order-status--paid{ background: rgba(34,197,94,.14); color: #86efac; }
body[data-theme="reyes"] .order-status--cancelled{ background: rgba(239,68,68,.14); color: #fecaca; }

body[data-theme="reyes"] input,
body[data-theme="reyes"] textarea,
body[data-theme="reyes"] select{
  background: rgba(255,255,255,.04);
  border-color: var(--border);
  color: var(--text);
}

/* patrón “estrella/corona” más fino */
body[data-theme="reyes"]::before{
  opacity:.14;
  background-image:
    radial-gradient(circle at 12px 14px, rgba(245,211,106,.40) 1px, transparent 0),
    radial-gradient(circle at 2px 2px, rgba(212,175,55,.35) 1px, transparent 0),
    radial-gradient(circle at 20px 10px, rgba(245,211,106,.22) 1px, transparent 0);
  background-size: 26px 26px;
}

/* brillo sutil “mágico” en cards al hover */
body[data-theme="reyes"] .category-card:hover,
body[data-theme="reyes"] .analytics-card:hover{
  box-shadow: 0 0 0 3px rgba(212,175,55,.12), 0 20px 40px rgba(0,0,0,.28);
}

body[data-theme="reyes"] .theme-modal__panel{
  background: rgba(15,27,51,.96);
}
body[data-theme="reyes"] .theme-item{
  background: rgba(255,255,255,.06);
}

/* =========================
   THEME MENU UI (PILLS + MODAL)
   Solo PRESENTACIÓN (no lógica)
   ========================= */
.theme-modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.theme-modal.is-open{ display: block; }

.theme-modal__overlay{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.50);
  backdrop-filter: blur(6px);
}

.theme-modal__panel{
  position: relative;
  width: min(560px, calc(100% - 28px));
  margin: 7vh auto;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  box-shadow: 0 28px 80px rgba(0,0,0,.40);
  background:
    radial-gradient(120% 120% at 10% 0%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(180deg, rgba(12,18,32,.96) 0%, rgba(10,14,26,.96) 100%);
  color: #f9fafb;
}

.theme-modal__header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.theme-modal__title{
  margin:0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: .2px;
}
.theme-modal__subtitle{
  margin: 6px 0 0;
  font-size: .92rem;
  color: rgba(255,255,255,.72);
}

.theme-modal__close{
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.theme-modal__close:hover{ background: rgba(255,255,255,.10); }

.theme-modal__list{
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  max-height: 56vh;
  overflow: auto;
}

.theme-item{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.12);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.theme-item:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.14);
  box-shadow: 0 14px 34px rgba(0,0,0,.18);
}

.theme-item__left{
  display:flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.theme-item__title{
  font-weight: 800;
  color: #fff;
  display:flex;
  align-items:center;
  gap: 8px;
}
.theme-item__sub{
  font-size: .90rem;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-item__btn{
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
  min-width: 92px;
}
.theme-item__btn:hover{
  background: rgba(255,255,255,.14);
}

.theme-item.is-active{
  border-color: rgba(212,175,55,.85);
  box-shadow: 0 0 0 3px rgba(212,175,55,.14);
}
.theme-item.is-active .theme-item__btn{
  border-color: rgba(212,175,55,.95);
  background: rgba(212,175,55,.16);
  color: #fff;
  cursor: default;
}

.theme-modal__footer{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.theme-modal__footer .btn-outline,
.theme-modal__footer .btn-primary{
  border-width: 2px;
  font-weight: 800;
}

body[data-theme="default"] .theme-modal__panel{
  background: #0f172a;
}

.theme-modal__list::-webkit-scrollbar{ width: 10px; }
.theme-modal__list::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.12); border-radius: 999px; }
.theme-modal__list::-webkit-scrollbar-track{ background: rgba(255,255,255,.04); }

/* =========================
   BI FILTERS + TABLES
   ========================= */
.bi-filters{
  display:flex;
  flex-wrap:wrap;
  gap: 12px;
  align-items:center;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(2,6,23,.45);
}
.bi-filters__presets{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.bi-pill{
  border:1px solid var(--border);
  background: var(--surface-2, #fff);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  cursor:pointer;
}
.bi-pill.is-active{
  border-color: var(--accent);
  background: rgba(212,175,55,.12);
  color: var(--text);
}
.bi-filters__fields{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:flex-end;
}
.bi-field{
  display:flex;
  flex-direction: column;
  gap:4px;
  color: var(--muted);
  font-size: .9rem;
}
.bi-field input,
.bi-field select{
  min-height: 36px;
  border-radius: 10px;
  border:1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 6px 8px;
}
.bi-filters__actions{
  display:flex;
  gap:8px;
  margin-left:auto;
}

.bi-table-wrap--compact .bi-table thead th,
.bi-table-wrap--compact .bi-table tbody td{
  padding: 8px 10px;
}

@media (max-width: 980px){
  .bi-filters{ flex-direction: column; align-items: stretch; }
  .bi-filters__actions{ margin-left:0; }
}

/* =========================
   ADMIN BI DASHBOARD (executive)
   ========================= */
.bi{
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: radial-gradient(120% 120% at 20% 10%, rgba(255,255,255,.06), rgba(0,0,0,0)) ,
              linear-gradient(180deg, rgba(15,23,42,.92), rgba(11,18,32,.92));
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  color: #f8fafc;
}

.bi__header{
  display:flex;
  justify-content: space-between;
  align-items:flex-end;
  gap: 12px;
  margin-bottom: 14px;
}
.bi__title{
  margin:0;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing:.2px;
}
.bi__sub{
  margin:6px 0 0;
  color: rgba(226,232,240,.82);
  font-size: .92rem;
}

.bi__grid{
  display:grid;
  gap: 12px;
}
.bi__grid--kpi{
  grid-template-columns: repeat(4, minmax(0,1fr));
  margin-bottom: 12px;
}
.bi__grid--charts{
  grid-template-columns: repeat(2, minmax(0,1fr));
  margin-bottom: 12px;
}
.bi__grid--tables{
  grid-template-columns: 1fr;
}
.bi__grid--kpi-extended{
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
}

.bi-card{
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.bi-card--chart{ padding-bottom: 14px; }
.bi-card__head{
  display:flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.bi-card__title{
  margin:0;
  font-size: .98rem;
  font-weight: 800;
}
.bi-card__hint{
  margin:0;
  font-size: .82rem;
  color: rgba(226,232,240,.72);
}

.bi-kpi__label{
  margin:0;
  font-size: .82rem;
  color: rgba(226,232,240,.78);
}
.bi-kpi__value{
  margin: 8px 0 6px;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: .2px;
}
.bi-kpi__meta{
  margin:0;
  font-size: .82rem;
  color: rgba(226,232,240,.72);
}

/* Bars SVG */
.bi-chart{
  width: 100%;
  height: 92px;
  display:block;
}
.bi-chart__x{
  margin-top: 8px;
  font-size: .78rem;
  color: rgba(226,232,240,.70);
  display:flex;
  justify-content: space-between;
  gap: 8px;
}

/* Donut SVG */
.bi-donut{
  position: relative;
  width: 170px;
  height: 170px;
  margin: 6px auto 10px;
}
.bi-donut__svg{
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.bi-donut__track{
  fill: none;
  stroke: rgba(148,163,184,.22);
  stroke-width: 6;
}
.bi-donut__seg{
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  stroke-dashoffset: 0;
}
.bi-donut__seg--paid{ stroke: #86efac; }
.bi-donut__seg--pending{ stroke: #fde68a; }
.bi-donut__seg--cancelled{ stroke: #fecaca; }

.bi-donut__center{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}
.bi-donut__big{
  font-size: 1.25rem;
  font-weight: 900;
}
.bi-donut__small{
  font-size: .82rem;
  color: rgba(226,232,240,.78);
}

.bi-legend{
  list-style:none;
  padding:0;
  margin: 0;
  display:grid;
  gap: 6px;
  font-size: .88rem;
}
.bi-legend li{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(226,232,240,.86);
}
.bi-dot{
  width:10px;height:10px;border-radius:999px;display:inline-block;margin-right:8px;
}
.bi-dot--paid{ background:#86efac; }
.bi-dot--pending{ background:#fde68a; }
.bi-dot--cancelled{ background:#fecaca; }

.bi-table-wrap{
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 14px;
  overflow:hidden;
}
.bi-table{
  width:100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.bi-table thead th{
  background: rgba(255,255,255,.04);
  color: rgba(248,250,252,.92);
  text-align:left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,.18);
}
.bi-table tbody td{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,.14);
  color: rgba(226,232,240,.92);
}
.bi-table tbody tr:last-child td{ border-bottom: none; }

@media (max-width: 980px){
  .bi__grid--kpi{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bi__grid--charts{ grid-template-columns: 1fr; }
}
