.admin-mobile-menu-toggle,
.admin-mobile-menu-backdrop {
  display: none;
}

.admin-logo-home{padding:0;border:0;background:transparent}
.superadmin-header{position:fixed;top:0;right:0;left:0;z-index:1200;height:64px;background:#080808;box-shadow:0 8px 24px rgba(0,0,0,.18)}
body.has-admin-topbar .app-shell .sidebar{z-index:1250}
body.has-admin-topbar .content{padding-top:88px!important}
@media(max-width:980px){.superadmin-header{left:0;padding:8px 16px 8px 70px}body.has-admin-topbar .content{padding-top:84px!important}}

@media (max-width: 980px) {
  body.admin-mobile-menu-open {
    overflow: hidden;
  }

  .admin-mobile-menu-toggle {
    position: fixed;
    z-index: 1302;
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: #17191d;
    box-shadow: 0 10px 30px rgba(0,0,0,.20);
    font-size: 21px;
  }

  .admin-mobile-menu-backdrop {
    position: fixed;
    z-index: 1298;
    inset: 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    background: rgba(12,14,17,.58);
    backdrop-filter: blur(3px);
    transition: opacity .2s ease, visibility .2s ease;
  }

  .app-shell .sidebar {
    position: fixed !important;
    z-index: 1300 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: min(86vw, 310px) !important;
    height: 100dvh !important;
    padding: calc(22px + env(safe-area-inset-top)) 18px 20px !important;
    overflow-y: auto !important;
    border-radius: 0 24px 24px 0 !important;
    transform: translateX(-106%);
    transition: transform .23s ease;
    box-shadow: 20px 0 55px rgba(0,0,0,.24);
  }

  .app-shell .sidebar > .d-flex:first-child {
    display: flex !important;
    min-height: 58px;
    padding-left: 52px;
  }

  .app-shell .sidebar .brand-logo {
    display: block !important;
    max-width: 122px;
  }

  .app-shell .sidebar .nav-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 5px !important;
    overflow: visible !important;
  }

  .app-shell .sidebar .nav-pill {
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 13px !important;
  }

  .app-shell .sidebar > .mt-4 {
    display: block !important;
  }

  body.admin-mobile-menu-open .app-shell .sidebar {
    transform: translateX(0);
  }

  body.admin-mobile-menu-open .admin-mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .app-shell .content {
    padding-top: 68px !important;
  }

  body.has-admin-topbar .app-shell .content {
    padding-top: 84px !important;
  }

  .app-shell .panel-actions {
    position: sticky;
    z-index: 80;
    top: 8px !important;
    min-height: 54px;
    padding: 5px 5px 5px 50px;
    border: 1px solid rgba(222,222,217,.9);
    border-radius: 18px;
    background: rgba(255,255,255,.91);
    box-shadow: 0 12px 35px rgba(23,25,29,.10);
    backdrop-filter: blur(16px);
  }
}

@media (max-width: 560px) {
  .app-shell .content {
    padding-right: 8px !important;
    padding-left: 8px !important;
  }
  .app-shell .panel-actions {
    flex-wrap: nowrap !important;
    gap: 5px !important;
  }
  .app-shell .panel-actions > .d-flex {
    flex-wrap: nowrap !important;
  }
}

.btn.is-refreshing {
  cursor: wait;
  opacity: .78;
}

.btn.is-refreshing i {
  display: inline-block;
  animation: admin-refresh-spin .7s linear infinite;
}

@keyframes admin-refresh-spin {
  to { transform: rotate(360deg); }
}

/* Admin and Superadmin: chat activity lives inside the fixed black top bar. */
body.has-admin-topbar .app-shell .panel-actions {
  position: fixed !important;
  z-index: 1260 !important;
  top: 0 !important;
  right: auto !important;
  left: 284px !important;
  width: auto !important;
  height: 64px;
  min-height: 64px;
  margin: 0 !important;
  padding: 7px 0 !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.has-admin-topbar .app-shell .panel-actions > div {
  flex-wrap: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 980px) {
  body.has-admin-topbar .app-shell .panel-actions {
    right: 8px !important;
    left: 64px !important;
    justify-content: flex-start !important;
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  body.has-admin-topbar .admin-chat-alerts {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 42px 42px;
    gap: 5px;
    overflow: visible;
  }

  body.has-admin-topbar .admin-chat-alerts .admin-driver-chat-alert {
    position: relative;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    min-height: 42px;
    padding: 3px;
    overflow: visible;
    border-radius: 13px;
  }

  body.has-admin-topbar .admin-chat-alerts .admin-driver-chat-alert-icon {
    width: 34px;
    height: 34px;
  }

  body.has-admin-topbar .admin-chat-alerts .admin-driver-chat-alert-copy {
    display: none;
  }

  body.has-admin-topbar .admin-chat-alerts .admin-driver-chat-alert-count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    font-size: 8px;
    box-shadow: 0 0 0 2px #080808;
  }
}

#overview-box .metric.store::after {
  background: #ff6500 !important;
}

#overview-box .metric.license::after {
  background: #7c3aed !important;
}

/* Indicadores principales del Superadmin en una sola fila. */
#overview-box.overview-single-row {
  display: grid !important;
  overflow-x: auto;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin-inline: 0 !important;
  padding: 0 0 7px;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

#overview-box.overview-single-row > .overview-metric-col {
  width: auto !important;
  min-width: 0;
  padding: 0 !important;
  scroll-snap-align: start;
}

#overview-box.overview-single-row .metric {
  height: 100%;
  min-height: 86px !important;
  padding: 14px 15px !important;
}

#overview-box.overview-single-row .metric .label {
  overflow: hidden;
  font-size: 9px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#overview-box.overview-single-row .metric .value {
  font-size: 24px !important;
}

@media (max-width: 980px) {
  #overview-box.overview-single-row {
    grid-template-columns: repeat(4, minmax(142px, 1fr));
  }
}

.overview-scope-note {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: -2px 0 18px;
  padding: 11px 14px;
  border: 1px solid #e3e7ec;
  border-radius: 14px;
  color: #343941;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 7px 18px rgba(20, 24, 31, .045);
}

.overview-scope-note > i {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: #ff6500;
}

.overview-scope-note > span {
  display: grid;
  min-width: 0;
}

.overview-scope-note strong {
  font-size: 11px;
  font-weight: 900;
}

.overview-scope-note small {
  color: #777f89;
  font-size: 9px;
}

@media (max-width: 560px) {
  .overview-scope-note {
    align-items: flex-start;
  }
}

/* Feedback de carga por sección. Se mantiene aislado del flujo de pedidos. */
.admin-section-loading-host {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

.admin-section-loading-host.is-admin-section-initial {
  min-height: clamp(300px, 48vh, 520px);
}

.admin-section-preloader {
  z-index: 18;
  color: #17191c;
}

.admin-section-preloader.is-initial {
  position: absolute;
  inset: 0;
  display: grid;
  min-height: 300px;
  padding: clamp(24px, 6vw, 64px);
  place-items: center;
  overflow: hidden;
  border: 1px solid #ebe8e3;
  border-radius: 16px;
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 101, 0, .13), transparent 34%),
    radial-gradient(circle at 86% 78%, rgba(23, 25, 28, .06), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(249, 248, 245, .97));
  animation: admin-section-preloader-in .2s ease-out;
}

.admin-section-preloader.is-initial::before,
.admin-section-preloader.is-initial::after {
  position: absolute;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 101, 0, .09);
  border-radius: 50%;
  content: "";
}

.admin-section-preloader.is-initial::before {
  top: -90px;
  right: 7%;
}

.admin-section-preloader.is-initial::after {
  bottom: -118px;
  left: 4%;
  width: 230px;
  height: 230px;
}

.admin-section-preloader-card {
  position: relative;
  z-index: 1;
  width: min(100%, 570px);
  padding: clamp(18px, 3.2vw, 27px);
  border: 1px solid rgba(226, 222, 214, .95);
  border-radius: 24px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 24px 70px rgba(29, 25, 20, .12);
}

.admin-section-preloader-main {
  display: flex;
  align-items: center;
  gap: 17px;
}

.admin-section-preloader-mark {
  position: relative;
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #ff6b00, #ec5800);
  box-shadow: 0 12px 28px rgba(255, 101, 0, .25);
  font-size: 23px;
}

.admin-section-preloader-mark::before {
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(255, 101, 0, .16);
  border-top-color: #ff6500;
  border-radius: 22px;
  content: "";
  animation: admin-section-preloader-spin 1.1s linear infinite;
}

.admin-section-preloader-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.admin-section-preloader-copy small {
  color: #ff6500;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.admin-section-preloader-copy strong {
  color: #17191c;
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 900;
  letter-spacing: -.025em;
}

.admin-section-preloader-copy > span {
  color: #727780;
  font-size: 11px;
  line-height: 1.45;
}

.admin-section-preloader-skeleton {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.admin-section-preloader-skeleton > span {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0eee9 20%, #fff 42%, #f0eee9 64%);
  background-size: 240% 100%;
  animation: admin-section-preloader-shimmer 1.25s ease-in-out infinite;
}

.admin-section-preloader-skeleton > span:nth-child(1) { width: 100%; }
.admin-section-preloader-skeleton > span:nth-child(2) { width: 78%; }
.admin-section-preloader-skeleton > span:nth-child(3) { width: 56%; }

.admin-section-preloader-retry {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin-top: 18px;
  padding: 9px 15px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #17191c;
  font-size: 11px;
  font-weight: 900;
}

.admin-section-preloader-retry:not([hidden]) {
  display: inline-flex;
}

.admin-section-preloader.is-refresh {
  position: absolute;
  z-index: 24;
  top: 8px;
  right: 8px;
  pointer-events: none;
}

.admin-section-preloader.is-refresh .admin-section-preloader-card {
  width: auto;
  max-width: min(390px, calc(100vw - 36px));
  padding: 9px 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 30px rgba(23, 25, 28, .14);
  backdrop-filter: blur(12px);
}

.admin-section-preloader.is-refresh .admin-section-preloader-main { gap: 10px; }

.admin-section-preloader.is-refresh .admin-section-preloader-mark {
  flex-basis: 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 14px;
}

.admin-section-preloader.is-refresh .admin-section-preloader-mark::before {
  inset: -4px;
  border-radius: 13px;
}

.admin-section-preloader.is-refresh .admin-section-preloader-copy small,
.admin-section-preloader.is-refresh .admin-section-preloader-copy > span,
.admin-section-preloader.is-refresh .admin-section-preloader-skeleton {
  display: none;
}

.admin-section-preloader.is-refresh .admin-section-preloader-copy strong {
  font-size: 11px;
  white-space: nowrap;
}

.admin-section-preloader.is-error { pointer-events: auto; }

.admin-section-preloader.is-error .admin-section-preloader-mark {
  background: linear-gradient(145deg, #d92d3f, #a91e2f);
  box-shadow: 0 12px 28px rgba(217, 45, 63, .18);
}

.admin-section-preloader.is-error .admin-section-preloader-mark::before {
  border-color: rgba(217, 45, 63, .18);
  animation: none;
}

.admin-section-preloader.is-error .admin-section-preloader-skeleton { display: none; }

.admin-section-preloader.is-refresh.is-error .admin-section-preloader-copy > span {
  display: block;
  max-width: 300px;
}

.admin-section-preloader.is-refresh.is-error .admin-section-preloader-copy strong {
  white-space: normal;
}

@keyframes admin-section-preloader-spin {
  to { transform: rotate(360deg); }
}

@keyframes admin-section-preloader-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -120% 0; }
}

@keyframes admin-section-preloader-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .admin-section-loading-host.is-admin-section-initial { min-height: 290px; }
  .admin-section-preloader.is-initial { min-height: 290px; padding: 15px; }
  .admin-section-preloader-card { padding: 18px; border-radius: 19px; }
  .admin-section-preloader-main { align-items: flex-start; gap: 14px; }
  .admin-section-preloader-mark { flex-basis: 48px; width: 48px; height: 48px; border-radius: 15px; font-size: 19px; }
  .admin-section-preloader-copy strong { font-size: 16px; }
  .admin-section-preloader.is-refresh { top: 6px; right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-section-preloader,
  .admin-section-preloader-mark::before,
  .admin-section-preloader-skeleton > span {
    animation: none !important;
  }
}
