/* ──────────────────────────────────────────────────────────────────
   Webzi overrides sobre CloudBox.
   Cargar DESPUÉS de backend.css.
   En esta primera etapa solo trae ajustes mínimos de marca:
     - Panel brand mark: [logo] | "Panel" en Caveat
   La paleta Webzi se aplicará en una segunda iteración.
   ────────────────────────────────────────────────────────────────── */

/* ─── Brand mark "[Logo] | Panel" usado en topbar, sidebar y auth ─── */
.panel-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  line-height: 1;
}
.panel-brand:hover { text-decoration: none; }
.panel-brand__logo { height: 22px; width: auto; display: block; }
.panel-brand__sep {
  color: #cbd5e1;
  font-size: 1.5rem;
  font-weight: 300;
  user-select: none;
}
.panel-brand__name {
  font-family: 'Caveat', cursive;
  font-weight: 600;
  font-size: 1.5rem;
  color: #535f6b;
}

/* En dark mode el separador y el nombre se aclaran */
body.dark .panel-brand__sep  { color: #4a4a4d; }
body.dark .panel-brand__name { color: #a6a6a6; }

/* En la card de auth: brand un poco más grande, centrado, con margen */
.sign-user_card .panel-brand {
  justify-content: center;
  margin-bottom: 1.5rem;
}
.sign-user_card .panel-brand__logo { height: 28px; }
.sign-user_card .panel-brand__name { font-size: 1.75rem; }

/* En sidebar: brand alineado a la izquierda dentro de iq-sidebar-logo */
.iq-sidebar-logo .panel-brand__name { font-size: 1.5rem; }

/* ─── Sub-contacto: chip pequeño sobre el avatar/caption del topbar ─── */
.caption-content { position: relative; }
.caption-subindicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #8f93f6;
  color: #8f93f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  pointer-events: none;
}
body.dark .caption-subindicator { background: #1d1d1f; }

/* ─── Stat cards: PIN morado claro + dark mode ─── */
.stat-pin {
  background: linear-gradient(180deg, #ecedfd 0%, #dde0fb 100%);
  border: 0;
}
body.dark .stat-pin {
  background: linear-gradient(180deg, #2a2641 0%, #1d1a30 100%);
}
.stat-pin .pin-label { color: #6c71e3; font-weight: 600; font-size: .875rem; margin-bottom: .75rem; }
body.dark .stat-pin .pin-label { color: #9c9ff8; }
.stat-pin .pin-value {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1;
  margin: 0 0 1rem 0;
  color: #303030;
}
body.dark .stat-pin .pin-value { color: #e6e6e6; }
.stat-pin .pin-action { font-size: .875rem; color: #6c71e3; font-weight: 600; }
body.dark .stat-pin .pin-action { color: #9c9ff8; }

/* Stat card: número grande sin colores fijos (heredan body para dark mode) */
.stat-number {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1;
  margin: 0 0 .5rem 0;
}
.stat-number-warning { color: #fd7e14; }
.stat-topicon {
  position: absolute;
  top: 16px; right: 18px;
  color: #94a3b8;
  font-size: 18px;
}
body.dark .stat-topicon { color: #6c757d; }

/* ─── Buscador global en topbar (flex centrado, NO absolute) ────── */
.webzi-search {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 24px;
  min-width: 0;
}
.webzi-search__input-wrap {
  position: relative;
  width: 100%;
  max-width: 560px;
}
.webzi-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #94a3b8;
  pointer-events: none;
}
#webzi-search-input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 42px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e8e8ea;
  font-size: 14px;
  color: #303030;
  transition: border-color .15s, box-shadow .15s;
}
#webzi-search-input::placeholder { color: #a0a4ad; }
#webzi-search-input:focus {
  outline: none;
  border-color: #c4c5fb;
  box-shadow: 0 1px 4px rgba(143,147,246,.12);
}
body.dark #webzi-search-input {
  background: #1d1d1f;
  border-color: #27272a;
  color: #d6d6d6;
}
body.dark #webzi-search-input:focus { border-color: #8f93f6; }
.webzi-search__esc {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: #e2e8f0;
  color: #64748b;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: inherit;
}
body.dark .webzi-search__esc { background: #3a3a3d; color: #a6a6a6; }

/* Ocultar buscador en móvil — habilitamos un icono toggle más adelante */
@media (max-width: 991px) {
  .webzi-search { display: none; }
}

/* ─── Auth forms (login, 2FA) — layout limpio, labels arriba ─────── */
.sign-user_card {
  padding: 2.25rem 2rem;
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .06);
}
body.dark .sign-user_card { box-shadow: 0 2px 14px rgba(0,0,0,.3); }

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: .25rem 0 .25rem;
  color: #1e293b;
}
body.dark .auth-title { color: #f1f5f9; }

.auth-subtitle {
  font-size: .95rem;
  color: #64748b;
  margin: 0 0 1.75rem;
}
body.dark .auth-subtitle { color: #94a3b8; }

.sign-user_card .form-group { margin-bottom: 1.25rem; }
.sign-user_card label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: #303030;
  margin-bottom: .5rem;
}
body.dark .sign-user_card label { color: #d6d6d6; }

.sign-user_card .form-control {
  height: 46px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 14px;
  color: #303030;
  transition: border-color .15s, box-shadow .15s;
}
.sign-user_card .form-control::placeholder { color: #a0a4ad; }
.sign-user_card .form-control:focus {
  outline: none;
  border-color: #8f93f6;
  box-shadow: 0 0 0 3px rgba(143,147,246,.15);
}
body.dark .sign-user_card .form-control {
  background: #1d1d1f;
  border-color: #27272a;
  color: #d6d6d6;
}
body.dark .sign-user_card .form-control:focus { border-color: #8f93f6; }

.auth-meta {
  display: flex;
  justify-content: flex-end;
  margin: -.5rem 0 1.25rem;
  font-size: .85rem;
}
.auth-meta a { color: #6c71e3; font-weight: 600; }
.auth-meta a:hover { color: #5b5fd1; text-decoration: none; }

/* CTA grande estilo Webzi (login, 2FA verify) */
.btn-webzi-cta {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  background: #6c71e3;
  border: 1px solid #6c71e3;
  color: #fff;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn-webzi-cta:hover,
.btn-webzi-cta:focus {
  background: #5b5fd1;
  border-color: #5b5fd1;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(143,147,246,.20);
}
.btn-webzi-cta:active { transform: translateY(1px); }
.btn-webzi-cta:disabled { background: #c7c9f4; border-color: #c7c9f4; cursor: not-allowed; }

/* Bloque de ayuda al pie del form (links pequeños, separadores) */
.auth-help {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f1f5f9;
  font-size: .85rem;
  color: #64748b;
}
body.dark .auth-help { border-top-color: #27272a; color: #94a3b8; }
.auth-help a { color: #6c71e3; font-weight: 600; }
.auth-help a:hover { color: #5b5fd1; text-decoration: none; }

/* ─── Selector de idioma (login + dropdown perfil) ─────────────── */
.lang-switch {
  display: inline-flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}
body.dark .lang-switch { background: #27272a; }

.lang-btn {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.lang-btn:hover { color: #303030; }
body.dark .lang-btn { color: #94a3b8; }
body.dark .lang-btn:hover { color: #f1f5f9; }
.lang-btn.is-active {
  background: #fff;
  color: #6c71e3;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
body.dark .lang-btn.is-active {
  background: #1d1d1f;
  color: #9c9ff8;
}

/* En la card de auth: switcher centrado al pie */
.auth-lang-switch {
  margin-top: 1.5rem;
  text-align: center;
}

/* ─── Service detail: cards con un poco más de profundidad ──────── */
.service-detail .card {
  border: 1px solid #eef0f4;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
}
body.dark .service-detail .card {
  border-color: #27272a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.service-detail .card-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  padding: 1rem 1.25rem;
}
body.dark .service-detail .card-header {
  background: #1d1d1f;
  border-bottom-color: #27272a;
}
.service-detail .card-header h5 {
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ─── Detail dl rows ─────────────────────────────────────────────── */
.detail-dl { margin: 0; padding: 0; }
.detail-dl-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  border-bottom: 1px solid #f1f5f9;
  padding: .8rem 1.25rem;
  gap: 1rem;
}
body.dark .detail-dl-row { border-bottom-color: #27272a; }
.detail-dl-row:last-child { border-bottom: 0; }
.detail-dl-row > dt {
  flex: 0 0 42%;
  margin: 0;
  font-weight: 500;
  color: #64748b;
  font-size: .82rem;
  line-height: 1.5;
}
body.dark .detail-dl-row > dt { color: #94a3b8; }
.detail-dl-row > dd {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: .9rem;
  line-height: 1.5;
  color: #303030;
  word-break: break-word;
}
body.dark .detail-dl-row > dd { color: #e2e8f0; }

/* Botón inline (copy / show password) más sutil */
.detail-dl-row .btn-link {
  color: #94a3b8;
  font-size: .9rem;
  vertical-align: baseline;
  text-decoration: none;
}
.detail-dl-row .btn-link:hover { color: #6c71e3; text-decoration: none; }

/* `display: contents` para que el <form> no rompa el grid de tiles */
.service-tile-form { display: contents; }

/* ─── Tiles ModulesGarden style ───────────────────────────────────── */
.service-tiles-group { margin-bottom: 1.5rem; }
.service-tiles-group:last-child { margin-bottom: 0; }
.service-tiles-group__title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #94a3b8;
  margin: 0 0 1rem .25rem;
}
body.dark .service-tiles-group__title { color: #6c757d; }

.service-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  width: 100%;
}

.service-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 22px 12px 18px;
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  text-align: center;
  text-decoration: none;
  color: #303030;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .15s ease, background .18s ease;
  min-height: 132px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  appearance: none;
  font: inherit;
}
body.dark .service-tile {
  background: #1d1d1f;
  border-color: #27272a;
  color: #d6d6d6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.service-tile:not([disabled]):hover {
  border-color: #c4c5fb;
  box-shadow: 0 8px 24px rgba(143, 147, 246, .18);
  transform: translateY(-3px);
  text-decoration: none;
  color: #303030;
}
body.dark .service-tile:not([disabled]):hover {
  border-color: #6c71e3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  color: #f1f5f9;
}
.service-tile[disabled],
.service-tile.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

.service-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef0fe 0%, #d4d6fa 100%);
  color: #6c71e3;
  font-size: 24px;
  margin-bottom: 12px;
  transition: transform .18s ease, background .18s ease;
}
body.dark .service-tile__icon {
  background: linear-gradient(135deg, #2e2a48 0%, #1e1b34 100%);
  color: #9c9ff8;
}
.service-tile:not([disabled]):hover .service-tile__icon {
  transform: scale(1.08) rotate(-3deg);
}

.service-tile__label {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.3;
  color: #303030;
}
body.dark .service-tile__label { color: #e2e8f0; }

.service-tile--danger .service-tile__icon {
  background: linear-gradient(135deg, #fee4e2 0%, #fecdca 100%);
  color: #d92d20;
}
body.dark .service-tile--danger .service-tile__icon {
  background: linear-gradient(135deg, #3d1d1c 0%, #2a1413 100%);
  color: #f97066;
}
.service-tile--warning .service-tile__icon {
  background: linear-gradient(135deg, #fef0c7 0%, #fedf89 100%);
  color: #b54708;
}
body.dark .service-tile--warning .service-tile__icon {
  background: linear-gradient(135deg, #3a2a0c 0%, #2a1d05 100%);
  color: #fdb022;
}

/* ─── Header del detalle ─────────────────────────────────────────── */
.service-header {
  background: #fff;
  border: 1px solid #eef0f4;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
body.dark .service-header {
  background: #1d1d1f;
  border-color: #27272a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.service-header__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef0fe 0%, #d4d6fa 100%);
  color: #6c71e3;
  font-size: 32px;
  flex: none;
}
body.dark .service-header__icon {
  background: linear-gradient(135deg, #2e2a48 0%, #1e1b34 100%);
  color: #9c9ff8;
}
.service-header__name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0;
  line-height: 1.2;
}
.service-header__name .text-muted { font-weight: 400; color: #64748b !important; }
body.dark .service-header__name .text-muted { color: #94a3b8 !important; }
.service-header__domain {
  font-size: .9rem;
  color: #64748b;
  margin-top: .25rem;
}
body.dark .service-header__domain { color: #94a3b8; }
.service-header__badge { font-size: .85rem; padding: .55em 1.1em; }

/* ─── Recursos: barras de progreso más pulidas ───────────────────── */
.resource-row { padding: .25rem 0; }
.resource-row + .resource-row { margin-top: 1rem; }
.resource-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .5rem;
}
.resource-row__label { font-weight: 600; font-size: .9rem; }
.resource-row__usage { color: #64748b; font-size: .82rem; }
body.dark .resource-row__usage { color: #94a3b8; }
.resource-row .progress {
  height: 8px;
  border-radius: 999px;
  background: #f1f5f9;
}
body.dark .resource-row .progress { background: #27272a; }
.resource-row .progress-bar { border-radius: 999px; }

/* ─── Tiles compactas (sidebar "Mi plan") ───────────────────────── */
.service-tiles--compact {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.service-tiles--compact .service-tile {
  min-height: 110px;
  padding: 16px 8px 14px;
}
.service-tiles--compact .service-tile__icon {
  width: 44px;
  height: 44px;
  font-size: 20px;
  margin-bottom: 8px;
}
.service-tiles--compact .service-tile__label { font-size: .78rem; }

/* ─── Config upsell footer ──────────────────────────────────────── */
.config-upsell {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #fafbff 0%, #f3f4fc 100%);
  border-top: 1px solid #f1f5f9;
}
body.dark .config-upsell {
  background: linear-gradient(135deg, #1d1d1f 0%, #232326 100%);
  border-top-color: #27272a;
}
.config-upsell__icon {
  flex: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef0fe 0%, #d4d6fa 100%);
  color: #6c71e3;
  font-size: 20px;
}
body.dark .config-upsell__icon {
  background: linear-gradient(135deg, #2e2a48 0%, #1e1b34 100%);
  color: #9c9ff8;
}
.config-upsell__text { flex: 1; min-width: 0; }
.config-upsell__text strong { font-size: .9rem; }
.config-upsell .btn-webzi-cta {
  width: auto;
  padding: 9px 16px;
  font-size: .8rem;
  border-radius: 8px;
}

/* ─── cPanel backup ─────────────────────────────────────────────── */
.cpanel-backup {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #fafbfc 0%, #f5f6fa 100%);
  border: 1px dashed #d8dbe6;
  border-radius: 14px;
  margin-top: .5rem;
}
body.dark .cpanel-backup {
  background: linear-gradient(135deg, #1d1d1f 0%, #232326 100%);
  border-color: #3a3a3d;
}
.cpanel-backup__icon {
  flex: none;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #64748b;
  font-size: 22px;
}
body.dark .cpanel-backup__icon {
  background: #27272a;
  border-color: #3a3a3d;
  color: #a6a6a6;
}
.cpanel-backup__text { flex: 1; min-width: 0; }
.cpanel-backup__title { font-weight: 600; font-size: .9rem; margin: 0; }
.cpanel-backup__desc { font-size: .8rem; color: #64748b; margin: .2rem 0 0; }
body.dark .cpanel-backup__desc { color: #94a3b8; }

/* ─── Breadcrumb ─────────────────────────────────────────────────── */
.detail-breadcrumb {
  font-size: .8rem;
  margin-bottom: .9rem;
  color: #94a3b8;
}
.detail-breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  transition: color .12s;
}
.detail-breadcrumb a:hover { color: #6c71e3; text-decoration: none; }
.detail-breadcrumb__current { color: #303030; font-weight: 600; }
body.dark .detail-breadcrumb__current { color: #e2e8f0; }

/* ─── Overlay y panel de resultados ───────────────────────────────── */
/* Top deja libre la zona del topbar (~70 px) para que el input y los
   íconos sigan visibles e interactivos mientras se busca. */
.webzi-search-overlay {
  position: fixed;
  top: 70px;
  left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1040;
  overflow-y: auto;
  animation: webzi-fade .15s ease-out;
}
@keyframes webzi-fade { from { opacity: 0 } to { opacity: 1 } }
body.dark .webzi-search-overlay { background: rgba(0,0,0,0.6); }

.webzi-search-panel {
  max-width: 720px;
  margin: 16px auto 40px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  overflow: hidden;
}
body.dark .webzi-search-panel { background: #1d1d1f; }

.webzi-search-tabs {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 14px 18px 0;
  margin: 0;
  border-bottom: 1px solid #f1f1f1;
}
body.dark .webzi-search-tabs { border-bottom-color: #27272a; }
.webzi-search-tabs li {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .15s, border-color .15s;
}
.webzi-search-tabs li:hover { color: #303030; }
body.dark .webzi-search-tabs li:hover { color: #fff; }
.webzi-search-tabs li.active {
  color: #8f93f6;
  border-bottom-color: #8f93f6;
}
.webzi-search-tabs .count {
  background: #f1f5f9;
  color: #64748b;
  padding: 1px 7px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
body.dark .webzi-search-tabs .count { background: #27272a; color: #a6a6a6; }
.webzi-search-tabs li.active .count {
  background: rgba(143,147,246,.15);
  color: #8f93f6;
}

.webzi-search-body {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.webzi-search-empty {
  padding: 40px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}
.webzi-search-loading {
  padding: 30px;
  text-align: center;
  color: #94a3b8;
}
.webzi-search-group + .webzi-search-group { border-top: 1px solid #f1f1f1; }
body.dark .webzi-search-group + .webzi-search-group { border-top-color: #27272a; }
.webzi-search-group__title {
  padding: 12px 20px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #94a3b8;
}
.webzi-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f8f8f8;
  transition: background .15s;
}
body.dark .webzi-search-item { border-bottom-color: #232326; }
.webzi-search-item:last-child { border-bottom: 0; }
.webzi-search-item:hover {
  background: #f5f5f9;
  color: inherit;
  text-decoration: none;
}
body.dark .webzi-search-item:hover { background: #232326; }
.webzi-search-item i { font-size: 22px; color: #8f93f6; flex: none; }
.webzi-search-item__main { flex: 1; min-width: 0; }
.webzi-search-item__title { font-weight: 600; font-size: 14px; line-height: 1.3; }
.webzi-search-item__sub { font-size: 12px; color: #94a3b8; margin-top: 2px; }

