:root {
  --fresa-rojo: #e63950;
  --fresa-rojo-oscuro: #c22a40;
  --fresa-rosa: #ffe0e6;
  --fresa-rosa-suave: #fff5f7;
  --fresa-texto: #3a2530;
  --vino-tinto: #4a1224;
  --vino-tinto-claro: #6b1c34;
}

/* Red de seguridad: aunque Bootstrap no cargue por alguna razón (ruta
   rota, CDN caído, etc.), el mostrar/ocultar de pantallas completas
   sigue funcionando porque no depende solo de la utilidad de Bootstrap. */
.d-none { display: none !important; }

body {
  background: #ffffff;
  color: var(--fresa-texto);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.btn-fresa {
  background: var(--fresa-rojo);
  border-color: var(--fresa-rojo);
  color: #fff;
}
.btn-fresa:hover { background: var(--fresa-rojo-oscuro); border-color: var(--fresa-rojo-oscuro); color: #fff; }

.card { border-radius: 12px; border: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

.pantalla-login {
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.tarjeta-login {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--fresa-rojo) 0%, var(--fresa-rojo-oscuro) 100%);
  border: none;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(230, 57, 80, .25);
  overflow: hidden;
}
.login-marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.25rem 1rem 1rem;
}
.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--fresa-rojo);
  margin-bottom: .7rem;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-nombre {
  font-weight: 800;
  font-size: 1.4rem;
  color: #ffffff;
  letter-spacing: .3px;
}
.login-titulo { color: var(--fresa-texto); font-weight: 700; margin-bottom: .15rem; }
.login-subtitulo { color: #8a7480; font-size: .85rem; margin-bottom: 1.5rem; }

.tarjeta-login .card-body {
  background: #ffffff;
  margin-top: .5rem;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar-fresa {
  width: 240px;
  flex-shrink: 0;
  min-height: 100vh;
  background: var(--vino-tinto);
  display: flex;
  flex-direction: column;
  padding: 0 .75rem 1rem;
}

.sidebar-marca {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.25rem .5rem 1.5rem;
}
.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  color: var(--fresa-rojo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.sidebar-nombre { color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: .3px; }

.sidebar-sucursal {
  padding: 0 .5rem 1.25rem;
}
.sidebar-sucursal-label {
  display: block;
  color: rgba(255,255,255,.55);
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .35rem;
}
.sidebar-sucursal select {
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.25);
  color: #000;
}
.sidebar-sucursal select:focus { color: #000; }
.sidebar-sucursal select option { color: #000; background: #fff; }

.sidebar-nav { display: flex; flex-direction: column; gap: .15rem; }

.btn-tab {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: .65rem .8rem;
  border-radius: 10px;
  color: rgba(255,255,255,.75);
}
.btn-tab:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn-tab.active { background: var(--fresa-rojo); color: #fff; }

.main-area {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--fresa-rosa-suave);
  min-height: 100vh;
}

.topbar-fresa {
  background: #ffffff;
  border-bottom: 1px solid var(--fresa-rosa);
  height: 60px;
}

.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--fresa-rosa);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.kpi-icono {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: .6rem;
}
.kpi-icono-rojo    { background: #ffe0e6; color: #e63950; }
.kpi-icono-rojo2   { background: #ffdada; color: #d6334a; }
.kpi-icono-verde   { background: #d7f5e3; color: #21a366; }
.kpi-icono-azul    { background: #dbeafe; color: #2f6fed; }
.kpi-icono-morado  { background: #e6e0fb; color: #7c5cd4; }
.kpi-icono-amarillo{ background: #fff3cd; color: #b8860b; }
.kpi-label { font-size: .75rem; color: #8a7480; text-transform: uppercase; letter-spacing: .03em; }
.kpi-valor { font-size: 1.5rem; font-weight: 700; }
.kpi-delta { font-size: .75rem; margin-top: .2rem; }
.kpi-delta.delta-positivo { color: #21a366; }
.kpi-delta.delta-negativo { color: #e63950; }

.producto-card { background: #fff; border-radius: 12px; padding: 1rem; margin-bottom: .75rem; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.producto-card h6 { color: var(--fresa-rojo-oscuro); }

.lista-top-productos {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
.lista-top-productos li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem 0;
  border-bottom: 1px solid var(--fresa-rosa-suave);
}
.lista-top-productos li:last-child { border-bottom: none; }
.top-producto-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fresa-rojo);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  margin-right: .5rem;
}

.badge-estado-recibido    { background: #8a7480; }
.badge-estado-en_proceso  { background: #3b82f6; }
.badge-estado-demorado    { background: #f59e0b; }
.badge-estado-listo       { background: #22c55e; }
.badge-estado-completado  { background: #16a34a; }
.badge-estado-cancelado   { background: #6b7280; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar-fresa { width: 100%; min-height: auto; flex-direction: row; align-items: center; padding: .5rem; }
  .sidebar-marca { padding: .25rem .5rem; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .main-area { min-height: auto; }
}
