/* ============================================================
   DIESTRO — design system compartido
   Importado por: administration, concursales, rama_notifications
   y cualquier módulo futuro del panel.
   ============================================================ */

/* ── Brand tokens ─────────────────────────────────────────── */
:root {
  --brand-blue: #0c377b;
  --brand-blue-dark: #082655;
  --brand-blue-soft: #e8eef7;
  --brand-gold: #e3ba5f;
  --brand-gold-dark: #c89e44;
  --brand-gold-soft: #fdf6e3;
  --brand-ink: #1f2937;
  --brand-muted: #6b7280;
  --brand-bg: #f7f8fb;
  --brand-border: #e5e7eb;

  --background: #f7f8fb;
  --foreground: #1f2937;
  --card: #ffffff;
  --muted: #f3f4f6;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
}

:root[data-theme="dark"] {
  --brand-blue: #4d8bff;
  --brand-blue-dark: #6ea3ff;
  --brand-blue-soft: #1a2540;
  --brand-gold: #e3ba5f;
  --brand-gold-dark: #c89e44;
  --brand-gold-soft: #2a2418;
  --brand-ink: #e5e7eb;
  --brand-muted: #9ca3af;
  --brand-bg: #0f1115;
  --brand-border: #2a2f3a;

  --background: #0f1115;
  --foreground: #e5e7eb;
  --card: #161a22;
  --muted: #1f2532;
  --muted-foreground: #9ca3af;
  --border: #2a2f3a;

  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  background: var(--brand-bg);
  color: var(--brand-ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ─────────────────────────────────────────── */
.admin-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.admin-page {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

@media (min-width: 992px) {
  .admin-page {
    padding: 1.5rem;
  }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--card);
  border-right: 1px solid var(--brand-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
  transition: width .3s ease;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar-logo {
  height: 64px;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--brand-border);
}

.logo-square {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text p {
  margin: 0;
  line-height: 1.1;
}

.sidebar-logo .logo-text .name {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-ink);
}

.sidebar-logo .logo-text .sub {
  font-size: 12px;
  color: var(--brand-muted);
}

.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 0;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.sidebar-section {
  padding: .75rem;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-section::-webkit-scrollbar {
  display: none;
}

.sidebar-section.bottom {
  flex: 0 0 auto;
  border-top: 1px solid var(--brand-border);
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .5rem .75rem;
  margin: 0;
}

.sidebar.collapsed .sidebar-section-label {
  display: none;
}

/* Nav items */
.nav-link-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-muted);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  position: relative;
  text-decoration: none;
  transition: all .15s;
}

.nav-link-item:hover {
  background: var(--muted);
  color: var(--brand-ink);
}

.nav-link-item.active {
  background: var(--brand-blue-soft);
  color: var(--brand-ink);
}

.nav-link-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand-blue);
  border-radius: 0 4px 4px 0;
}

.nav-link-item.active i {
  color: var(--brand-blue);
}

.nav-link-item i {
  font-size: 18px;
  flex-shrink: 0;
}

.nav-link-item .label {
  flex: 1;
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--brand-muted);
}

.nav-link-item.active .nav-badge {
  background: var(--brand-blue);
  color: #fff;
}

.sidebar.collapsed .nav-link-item {
  justify-content: center;
}

.sidebar.collapsed .nav-link-item .label,
.sidebar.collapsed .nav-link-item .nav-badge {
  display: none;
}

/* Submenús */
.nav-group {
  width: 100%;
}

.nav-toggle {
  width: 100%;
}

.nav-toggle .chev {
  margin-left: auto;
  font-size: 14px;
  transition: transform .2s ease;
}

.nav-group[data-open="true"] .nav-toggle .chev {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  position: relative;
  margin: 4px 0 8px 1.4rem;
  padding: 4px 0;
  gap: 2px;
}

.nav-submenu.open {
  display: flex;
}

.nav-submenu::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 26px;
  width: 1px;
  background: var(--brand-muted);
  border-radius: 1px;
}

.nav-sublink {
  position: relative;
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.25;
  color: var(--brand-muted);
  padding: .4rem .65rem .4rem 30px;
  border-radius: 7px;
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-sublink::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 50%;
  border-left: 1px solid var(--brand-muted);
  border-bottom: 1px solid var(--brand-muted);
  border-bottom-left-radius: 10px;
  pointer-events: none;
}

.nav-sublink:hover {
  background: linear-gradient(to right, transparent 22px, var(--muted) 22px);
  color: var(--brand-ink);
}

.nav-sublink.active {
  background: linear-gradient(to right, transparent 22px, var(--brand-blue-soft) 22px);
  color: var(--brand-blue);
  font-weight: 600;
}

.sidebar.collapsed .nav-submenu,
.sidebar.collapsed .nav-toggle .chev {
  display: none;
}

@keyframes subOpen {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-group[data-open="true"] .nav-submenu.open {
  animation: subOpen .2s ease;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--brand-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 20;
}

@media (min-width: 992px) {
  .topbar {
    padding: 0 1.5rem;
  }
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar .icon-btn {
  padding: .5rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--brand-ink);
  cursor: pointer;
  transition: background .15s;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar .icon-btn:hover {
  background: var(--muted);
}

.topbar .icon-btn i {
  font-size: 20px;
}

.topbar .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--brand-gold);
  border-radius: 50%;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.topbar-brand .brand-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-ink);
}

.topbar-brand .brand-text .accent {
  color: var(--brand-blue);
}

@media (max-width: 575px) {
  .topbar-brand .brand-text {
    display: none;
  }
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  margin: 0 1.5rem;
  position: relative;
}

@media (max-width: 767px) {
  .topbar-search {
    display: none;
  }
}

.topbar-search input {
  width: 100%;
  padding: .5rem .75rem .5rem 2.25rem;
  font-size: 14px;
  background: var(--muted);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  color: var(--brand-ink);
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}

.topbar-search input:focus {
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--brand-gold);
}

.topbar-search i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-muted);
  font-size: 14px;
}

/* Avatar */
.avatar-block {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-left: .5rem;
  border-left: 1px solid var(--brand-border);
  margin-left: .25rem;
  background: transparent;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
}

.avatar-block:hover {
  opacity: .85;
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.avatar-block .meta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
  gap: 1px;
}

.avatar-block .meta p {
  margin: 0;
  padding: 0;
}

.avatar-block .meta .n {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ink);
}

.avatar-block .meta .s {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-muted);
}

@media (max-width: 575px) {
  .avatar-block .meta {
    display: none;
  }
}

.avatar-block-wrap .avatar-block {
  gap: .55rem;
}

.avatar-block-wrap .avatar-caret {
  font-size: .75rem;
  opacity: .6;
  transition: transform .15s ease;
}

.avatar-block-wrap.show .avatar-caret {
  transform: rotate(180deg);
}

.avatar-dropdown {
  min-width: 200px;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.breadcrumb-mini {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: 12px;
  color: var(--brand-muted);
  margin-bottom: .25rem;
}

.breadcrumb-mini .current {
  color: var(--brand-blue);
}

.page-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.page-title-row h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-ink);
  margin: 0;
  line-height: 1.2;
}

.page-title-row p {
  font-size: 14px;
  color: var(--brand-muted);
  margin: .25rem 0 0;
  line-height: 1.5;
}

.system-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: 12px;
  font-weight: 500;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  flex-shrink: 0;
}

.system-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

@media (max-width: 575px) {
  .system-chip {
    display: none;
  }
}

/* ── Stats grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: box-shadow .15s;
}

.stat-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, .06);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.stat-icon.warn {
  background: rgba(251, 191, 36, .15);
  color: #d97706;
}

.stat-text {
  min-width: 0;
}

.stat-text .label {
  font-size: 12px;
  color: var(--brand-muted);
  margin: 0;
  line-height: 1.5;
}

.stat-text .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-ink);
  margin: 0;
  line-height: 1.1;
}

.stat-text .trend {
  font-size: 12px;
  margin: 2px 0 0;
  line-height: 1.5;
}

.stat-text .trend.up {
  color: #16a34a;
}

.stat-text .trend.warn {
  color: #d97706;
}

.stat-text .trend.neutral {
  color: var(--brand-muted);
}

/* ── Table card (contenedor base) ────────────────────────── */
.table-card {
  background: var(--card);
  border: 1px solid var(--brand-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  overflow: hidden;
}

.table-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--brand-border);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

@media (min-width: 576px) {
  .table-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.table-toolbar h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--brand-ink);
}

.toolbar-tools {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar-search,
.toolbar-filter {
  position: relative;
}

.toolbar-search input,
.toolbar-filter select {
  padding: .5rem .75rem .5rem 2rem;
  font-size: 14px;
  background: var(--muted);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  color: var(--brand-ink);
  outline: none;
}

.toolbar-search input {
  width: 300px;
}

.toolbar-filter select {
  padding-right: 1.75rem;
  cursor: pointer;
  appearance: none;
}

.toolbar-search i,
.toolbar-filter i {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-muted);
  font-size: 14px;
}

/* ── Botones ──────────────────────────────────────────────── */
.btn-brand {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .75rem;
  font-size: 14px;
  font-weight: 600;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.btn-brand:hover {
  background: var(--brand-blue-dark);
  color: #fff;
}

.btn-brand i {
  font-size: 15px;
}

.btn-outline-brand {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .75rem;
  font-size: 14px;
  font-weight: 600;
  background: #fff;
  color: var(--brand-ink);
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.btn-outline-brand:hover {
  background: var(--muted);
}

/* ── Acciones de icono ────────────────────────────────────── */
.icon-action {
  padding: .35rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--brand-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-action:hover {
  background: var(--muted);
  color: var(--brand-ink);
}

.icon-action.danger:hover {
  background: #fee2e2;
  color: #dc2626;
}

.icon-action i {
  font-size: 15px;
}

/* ── Estado vacío ─────────────────────────────────────────── */
.empty-state {
  padding: 4rem 1rem;
  text-align: center;
}

.empty-state .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: .75rem;
}

.empty-state .title {
  font-weight: 600;
  color: var(--brand-ink);
  margin: 0;
}

.empty-state .desc {
  font-size: 14px;
  color: var(--brand-muted);
  margin-top: 4px;
}

.empty-state .clear-btn {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-blue);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  margin-top: .5rem;
}

/* ── Badges de estado (paquetes/servicios) ────────────────── */
.pkg-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
}

.pkg-status.activo {
  background: #dcfce7;
  color: #16a34a;
}

.pkg-status.suspendido {
  background: #fef9c3;
  color: #d97706;
}

.pkg-status.cancelado,
.pkg-status.vencido {
  background: #fee2e2;
  color: #dc2626;
}

.pkg-status.pendiente {
  background: #dbeafe;
  color: #1e40af;
}

/* ── Responsive — sidebar ─────────────────────────────────── */
@media (max-width: 767.98px) {
  .sidebar:not(.offcanvas-body) {
    display: none !important;
  }
}

@media (max-width: 1199.98px) and (min-width: 768px) {
  .sidebar {
    width: 64px !important;
  }

  .sidebar .sidebar-logo {
    justify-content: center;
    padding: 0;
  }

  .sidebar .logo-text,
  .sidebar .sidebar-section-label,
  .sidebar .nav-link-item .label,
  .sidebar .nav-link-item .nav-badge {
    display: none;
  }

  .sidebar .nav-link-item {
    justify-content: center;
    padding: .65rem;
  }

  .sidebar .nav-submenu,
  .sidebar .nav-toggle .chev {
    display: none !important;
  }

  #btnToggleSidebar {
    display: none !important;
  }
}

/* ── Offcanvas/Modal backdrop ─────────────────────────────── */
.offcanvas-backdrop.show,
.modal-backdrop.show {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background-color: rgba(15, 17, 21, .35);
  opacity: 1;
}

:root:not([data-theme="dark"]) .offcanvas-backdrop.show {
  background-color: rgba(255, 255, 255, .25);
}

/* ── Dark mode ────────────────────────────────────────────── */
:root[data-theme="dark"] body {
  background: var(--brand-bg);
  color: var(--brand-ink);
}

:root[data-theme="dark"] .topbar {
  box-shadow: 0 1px 0 var(--brand-border);
}

:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .table-card {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

:root[data-theme="dark"] .btn-outline-brand {
  background: var(--card);
  color: var(--brand-ink);
  border-color: var(--brand-border);
}

:root[data-theme="dark"] .icon-action.danger:hover {
  background: rgba(220, 38, 38, .18);
  color: #f87171;
}

:root[data-theme="dark"] .pkg-status.activo {
  background: rgba(34, 197, 94, .15);
  color: #4ade80;
}

:root[data-theme="dark"] .pkg-status.suspendido,
:root[data-theme="dark"] .pkg-status.pendiente {
  background: rgba(217, 119, 6, .18);
  color: #fbbf24;
}

:root[data-theme="dark"] .pkg-status.cancelado,
:root[data-theme="dark"] .pkg-status.vencido {
  background: rgba(220, 38, 38, .18);
  color: #f87171;
}

:root[data-theme="dark"] .dropdown-menu {
  background-color: var(--card);
  border-color: var(--brand-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .5);
  --bs-dropdown-bg: var(--card);
  --bs-dropdown-color: var(--brand-ink);
  --bs-dropdown-link-color: var(--brand-ink);
  --bs-dropdown-link-hover-bg: var(--muted);
  --bs-dropdown-link-active-bg: var(--brand-blue);
  --bs-dropdown-border-color: var(--brand-border);
  --bs-dropdown-divider-bg: var(--brand-border);
}

:root[data-theme="dark"] .dropdown-item {
  color: var(--brand-ink);
}

:root[data-theme="dark"] .dropdown-item:hover {
  background: var(--muted);
  color: #fff;
}

:root[data-theme="dark"] .dropdown-item.active {
  background: var(--brand-blue);
  color: #fff;
}

:root[data-theme="dark"] .dropdown-item.text-danger {
  color: #f87171 !important;
}

:root[data-theme="dark"] .dropdown-item.text-danger:hover {
  background: rgba(220, 38, 38, .18);
}

:root[data-theme="dark"] .dropdown-divider {
  border-top-color: var(--brand-border);
}

:root[data-theme="dark"] select,
:root[data-theme="dark"] option {
  background-color: var(--card);
  color: var(--brand-ink);
}
/* ── Botón "Comprar / Renovar" del encabezado de cada producto ── */
.btn-comprar-producto {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--brand-blue, #0c377b);
  background: var(--brand-blue, #0c377b);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, transform .15s;
}
.btn-comprar-producto:hover { background: var(--brand-blue-dark, #082655); color: #fff; transform: translateY(-1px); }
.page-header-aside .btn-comprar-producto { margin-top: .6rem; align-self: flex-end; }
/* Se acabaron las consultas / no hay paquete */
.btn-comprar-producto.is-urgente {
  background: #e8590c;
  border-color: #e8590c;
  animation: comprar-pulso 1.8s ease-in-out infinite;
}
.btn-comprar-producto.is-urgente:hover { background: #c94a06; }
@keyframes comprar-pulso {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 89, 12, .45); }
  50% { box-shadow: 0 0 0 7px rgba(232, 89, 12, 0); }
}
@media (prefers-reduced-motion: reduce) { .btn-comprar-producto.is-urgente { animation: none; } }

/* ═══════════════════════════════════════════════════════════════
   Celular (≤ 576px): ajustes comunes a todos los productos
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 576px) {
  .admin-page { padding-left: .75rem; padding-right: .75rem; }

  /* Encabezado: título arriba y "Tu paquete" / botones debajo, a lo ancho */
  .admin-page .page-title-row { flex-direction: column; align-items: stretch; gap: .75rem; }
  .admin-page .page-title-row h1 { font-size: 1.45rem; }
  .admin-page .page-header-aside { width: 100%; align-items: stretch; }
  .admin-page .page-header-aside .paquete-meta { flex-direction: row; justify-content: space-between; }
  .admin-page .page-header-aside .btn-comprar-producto { align-self: stretch; justify-content: center; }

  /* Barra de herramientas de las tablas: buscador a lo ancho, sin desbordarse */
  .admin-page .table-toolbar { padding-left: .9rem; padding-right: .9rem; }
  .admin-page .toolbar-tools { width: 100%; }
  .admin-page .toolbar-search { flex: 1 1 100%; min-width: 0; }
  .admin-page .toolbar-search input { width: 100%; min-width: 0; }

  /* Las tablas se desplazan de lado dentro de su tarjeta (no se cortan columnas) */
  .admin-page .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tarjetas de resumen: 2 por fila con texto que no se desborda */
  .admin-page .stats-grid { gap: .6rem; }
  .admin-page .stat-card { padding: .8rem; min-width: 0; }
  .admin-page .stat-card .label { font-size: .72rem; }

  /* Ventanas modales a pantalla casi completa */
  .modal-dialog { margin: .5rem; }
}

/* ═══════════════════════════════════════════════════════════════
   Indicador "Cargando…" único de la plataforma (diseño de Notificaciones Rama)
   JS: DiestroCargando.mostrar('Texto…') / .ocultar() / .html('Texto…')
   ═══════════════════════════════════════════════════════════════ */
.diestro-cargando {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 17, 21, .45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
}
.diestro-cargando.is-visible { display: flex; }
.diestro-cargando-caja,
.diestro-cargando-inline .diestro-cargando-caja {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--card, #fff);
  color: var(--brand-ink, #1f2937);
  border: 1px solid var(--brand-border, #e5e7eb);
  border-radius: 12px;
  padding: .75rem 1.25rem;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}
.diestro-cargando-caja .spinner-grow { color: var(--brand-blue, #0c377b); }
/* Marcador dentro de un panel o tabla: reserva el espacio; la ventanita se muestra en la
   pantalla completa (ver diestro.js), igual que en Notificaciones Rama. */
.diestro-cargando-inline { display: flex; justify-content: center; padding: 1.5rem .5rem; width: 100%; min-height: 4rem; }
.diestro-cargando-inline .diestro-cargando-caja { visibility: hidden; }

/* Tablas DataTables: su indicador propio se oculta; diestro.js muestra la pantalla completa */
div.dataTables_processing { display: none !important; }

