:root{
  --rei-beige: #E8E1DC;
  --rei-red: #F03E34;
  --rei-black: #111111;
  --rei-white: #ffffff;

  --surface: #ffffff;
  --surface-2: #faf9f8;
  --text: #111111;
  --muted: rgba(17,17,17,.65);
  --border: rgba(17,17,17,.10);
}

.app{
  background: linear-gradient(180deg, var(--rei-beige) 0%, #f4f1ee 45%, #fbfbfc 100%);
  color: var(--text);
  min-height: 100vh;
}

/* Shell layout */
.app-shell{
  display:flex;
  min-height: 100vh;
}
.app-sidebar{
  width: 260px;
  background: rgba(255,255,255,.85);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  backdrop-filter: blur(10px);
}
.app-main{
  flex:1;
  display:flex;
  flex-direction: column;
  min-width: 0;
}
.app-topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  padding: .75rem 1rem;
  display:flex;
  align-items:center;
  justify-content: space-between;
}
.app-content{ flex: 1; }

.app-sidebar__header{
  padding: .9rem .9rem;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
}
.app-brand{
  display:flex;
  align-items:center;
  gap:.5rem;
  color: var(--rei-black);
  text-decoration:none;
  font-weight:700;
}
.app-brand__logo{ height: 28px; width:auto; }
.app-brand__text{ letter-spacing: .04em; }
.app-sidebar__toggle{ border-color: var(--border) !important; }

.app-menu{
  padding: .75rem .5rem 1rem;
  display:flex;
  flex-direction: column;
  gap: .15rem;
}
.app-menu__section{
  margin-top: .75rem;
  padding: .5rem .75rem .25rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.app-menu__item{
  display:flex;
  align-items:center;
  gap:.75rem;
  padding: .6rem .75rem;
  border-radius: .85rem;
  color: var(--rei-black);
  text-decoration:none;
  border: 1px solid transparent;
}
.app-menu__item i{ font-size: 1.05rem; width: 1.25rem; text-align:center; }
.app-menu__item:hover{
  background: rgba(240,62,52,.07);
  border-color: rgba(240,62,52,.18);
}

/* Collapsed sidebar */
.app-shell.sidebar-collapsed .app-sidebar{ width: 76px; }
.app-shell.sidebar-collapsed .app-brand__text,
.app-shell.sidebar-collapsed .app-badge{ display:none; }
.app-shell.sidebar-collapsed .app-menu__section{ display:none; }
.app-shell.sidebar-collapsed .app-menu__item span{ display:none; }
.app-shell.sidebar-collapsed .app-menu__item{ justify-content:center; padding: .65rem .5rem; }

@media (max-width: 991.98px){
  .app-sidebar{
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform .18s ease;
    z-index: 100;
  }
  .app-shell.sidebar-open .app-sidebar{ transform: translateX(0); }
}

main.container-fluid{
  max-width: 1600px;
}

.app-nav{
  border-bottom: 1px solid var(--border) !important;
}
.navbar .nav-link{ color: var(--rei-black) !important; opacity: .85; }
.navbar .nav-link:hover{ opacity: 1; }
.navbar .nav-link.active{ opacity: 1; font-weight: 600; }

.app-badge{
  background: var(--rei-red) !important;
  color: var(--rei-white) !important;
}

.btn-primary{
  background: var(--rei-red) !important;
  border-color: var(--rei-red) !important;
}
.btn-primary:hover{ filter: brightness(.95); }
.btn-outline-secondary{ border-color: var(--border) !important; }

.card{
  border-radius: 1.05rem;
  border: 1px solid var(--border);
}

.card.soft{
  background: #ffffff;
}

.table thead th{ white-space: nowrap; }

.table thead th{
  position: relative;
}
.table thead th:not([data-sort="false"]){
  cursor: pointer;
}
.table thead th:not([data-sort="false"]):after{
  content: '⇅';
  font-size: .65rem;
  opacity: .35;
  margin-left: .25rem;
}

.chip{
  display:inline-flex;
  gap:.4rem;
  align-items:center;
  padding:.25rem .6rem;
  border-radius: 999px;
  background:#f6f7f9;
  border:1px solid #e9ecef;
  font-size:.85rem;
}

.quality-score{
  height:.65rem;
  border-radius: 999px;
  background: #e9ecef;
  overflow:hidden;
}
.quality-score > div{
  height:100%;
  border-radius:999px;
}

/* Productos: cards */
.product-card{
  border-radius: 1.1rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.product-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(17,17,17,.12);
}
.product-thumb{
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, rgba(0,0,0,.04), rgba(0,0,0,.01));
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(0,0,0,.45);
}
.product-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toolbar{
  position: sticky;
  top: 72px;
  z-index: 20;
}

/* Tabs en ficha de producto */
.nav-tabs .nav-link{
  border:none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding:.45rem .9rem;
  font-weight:500;
}
.nav-tabs .nav-link.active{
  color: var(--rei-black);
  border-bottom-color: var(--rei-red);
}

