/* =========================================================
   Panel minorista — estilos
   ========================================================= */
:root {
  --ench-dark: #701E3A;
  --ench-dark-deep: #581730;
  --ench-pink: #eb1c74;
  --ench-light: #f4e8ee;
  --ench-bg: #f7f3f5;
  --ench-border: #e9dde3;
  --sidebar-width: 250px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-soft: 0 4px 24px rgba(112, 30, 58, .08);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--ench-bg);
  color: #2b2228;
}

/* ---------- Sidebar ---------- */
.panel-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--ench-dark);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}
.panel-sidebar .sidebar-brand {
  padding: 1.3rem 1.15rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.panel-sidebar .sidebar-brand .brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-sidebar .sidebar-brand .brand-sub {
  color: rgba(255, 255, 255, .45);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.panel-sidebar .nav-link {
  position: relative;
  color: rgba(255, 255, 255, .72);
  padding: .58rem 1rem;
  border-radius: 10px;
  margin: 2px 10px;
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .7rem;
  transition: background .2s ease, color .2s ease;
}
.panel-sidebar .nav-link i { font-size: 1.05rem; opacity: .85; }
.panel-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.panel-sidebar .nav-link.active {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.panel-sidebar .nav-link.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: var(--ench-pink);
}
.panel-sidebar .sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: .85rem 1rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.panel-sidebar .sidebar-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: var(--ench-pink);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-sidebar .sidebar-user .user-name {
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-sidebar .sidebar-user .user-role {
  color: rgba(255, 255, 255, .45);
  font-size: .7rem;
}
.panel-sidebar .sidebar-user .btn-logout {
  margin-left: auto;
  color: rgba(255, 255, 255, .55);
  font-size: 1.05rem;
  padding: .3rem .45rem;
  border-radius: 8px;
  transition: background .2s ease, color .2s ease;
}
.panel-sidebar .sidebar-user .btn-logout:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

/* ---------- Topbar ---------- */
.panel-topbar {
  background: #fff;
  border-bottom: 1px solid var(--ench-border);
  padding: .8rem 2rem;
  margin-left: var(--sidebar-width);
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 58px;
}
.panel-topbar .topbar-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ench-dark);
}

/* ---------- Main ---------- */
.panel-main {
  margin-left: var(--sidebar-width);
  padding: 2rem;
}

/* ---------- KPI cards ---------- */
.kpi-card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(112, 30, 58, .12);
}
.kpi-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
.kpi-bordo  { background: var(--ench-light);  color: var(--ench-dark); }
.kpi-pink   { background: #fde4ef;            color: var(--ench-pink); }
.kpi-green  { background: #ddf2e6;            color: #157347; }
.kpi-blue   { background: #e0eafc;            color: #1d4fb8; }
.kpi-orange { background: #fdebd9;            color: #c4660a; }
.kpi-purple { background: #ece2fb;            color: #6233b8; }
.kpi-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: #2b2228;
}
.kpi-label {
  font-size: .8rem;
  color: #8a7680;
}

/* ---------- Cards ---------- */
.card { border: none; }
.rounded-lg  { border-radius: var(--radius-lg) !important; }
.shadow-soft { box-shadow: var(--shadow-soft) !important; }

/* ---------- Tablas ---------- */
.table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 600;
  color: #8a7680;
  background: #fbf8f9;
  border-bottom: 1px solid var(--ench-border);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
.table tbody td {
  border-color: #f3edf0;
  font-variant-numeric: tabular-nums;
}
.table-hover tbody tr:hover { background: #fdf8fa; }

/* ---------- Badges de estado ---------- */
.badge[class*="badge-"] {
  border-radius: 50rem;
  font-weight: 600;
  font-size: .72rem;
  padding: .38em .75em;
  text-transform: capitalize;
  letter-spacing: .01em;
}
.badge-pendiente  { background: #fdf3d8 !important; color: #8d6d08 !important; }
.badge-confirmado { background: #d8eef7 !important; color: #0c6e8a !important; }
.badge-en_proceso { background: #ece2fb !important; color: #6233b8 !important; }
.badge-enviado    { background: #dde8fc !important; color: #1d4fb8 !important; }
.badge-entregado  { background: #d9f2e3 !important; color: #157347 !important; }
.badge-cancelado  { background: #fbdfe3 !important; color: #b02a37 !important; }
.badge-aprobado   { background: #d9f2e3 !important; color: #157347 !important; }
.badge-rechazado  { background: #fbdfe3 !important; color: #b02a37 !important; }

/* ---------- Botones ---------- */
.btn-ench {
  background: var(--ench-dark);
  border: 1px solid var(--ench-dark);
  color: #fff;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease;
}
.btn-ench:hover, .btn-ench:focus {
  background: var(--ench-dark-deep);
  border-color: var(--ench-dark-deep);
  color: #fff;
}
.btn-ench-pink {
  background: var(--ench-pink);
  border: 1px solid var(--ench-pink);
  color: #fff;
  font-weight: 600;
  transition: background .2s ease, border-color .2s ease;
}
.btn-ench-pink:hover, .btn-ench-pink:focus {
  background: #cf1463;
  border-color: #cf1463;
  color: #fff;
}
.btn-outline-ench {
  border: 1px solid var(--ench-border);
  color: var(--ench-dark);
  background: #fff;
  font-weight: 500;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-outline-ench:hover {
  background: var(--ench-light);
  border-color: var(--ench-dark);
  color: var(--ench-dark);
}

/* ---------- Forms ---------- */
.form-label { font-size: .8rem; font-weight: 600; color: #574852; }
.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--ench-border);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--ench-pink);
  box-shadow: 0 0 0 .2rem rgba(235, 28, 116, .12);
}
.form-check-input:checked {
  background-color: var(--ench-pink);
  border-color: var(--ench-pink);
}
.form-switch .form-check-input { cursor: pointer; }
.section-card .card-header {
  background: #fff;
  border: 0;
  padding: 1.4rem 1.5rem .25rem;
}
.section-card .section-title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .1rem;
  color: var(--ench-dark);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-card .section-desc {
  font-size: .8rem;
  color: #8a7680;
  margin-bottom: 0;
}

/* ---------- Paginación ---------- */
.pagination .page-link {
  color: var(--ench-dark);
  border-color: var(--ench-border);
  transition: background .2s ease;
}
.pagination .page-link:hover { background: var(--ench-light); }
.pagination .page-item.active .page-link {
  background: var(--ench-dark);
  border-color: var(--ench-dark);
  color: #fff;
}
.pagination .page-link:focus { box-shadow: 0 0 0 .2rem rgba(235, 28, 116, .15); }

/* ---------- Estado vacío ---------- */
.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #8a7680;
}
.empty-state i {
  font-size: 2.2rem;
  color: #d4bfc9;
  display: block;
  margin-bottom: .6rem;
}
.empty-state .empty-title { font-weight: 600; color: #574852; }

/* ---------- Login ---------- */
.auth-bg {
  background: var(--ench-light);
  position: relative;
  overflow: hidden;
}
.auth-bg::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -180px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(235, 28, 116, .07);
}
.auth-bg::after {
  content: "";
  position: absolute;
  bottom: -220px;
  left: -160px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(112, 30, 58, .06);
}
.auth-card {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(112, 30, 58, .14);
}
.auth-card .brand-logo svg { width: 190px; height: auto; }

/* ---------- Detalles ---------- */
a { color: var(--ench-pink); }
a:hover { color: #cf1463; }
.panel-sidebar a, .btn { text-decoration: none; }
:focus-visible { outline: 2px solid var(--ench-pink); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible { outline: none; }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
  .panel-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: none;
  }
  .panel-sidebar.show {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0, 0, 0, .25);
  }
  .panel-main, .panel-topbar { margin-left: 0; }
  .panel-main { padding: 1.25rem; }
  .panel-topbar { padding: .7rem 1.25rem; }
}
