/* WebDoctor Analytics — CSS v1.3.0 */
.wd-score-card {
  border-top-width: 4px;
  border-top-style: solid;
  text-align: center;
  padding: 12px 8px;
}
.wd-score-val {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}
.wd-score-lbl {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 4px;
}
.wd-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
#wd-run-btn:disabled { cursor: not-allowed; }

/* ===================================================================
   Portal cliente — dashboard "Tu web" (mobile-first, para pymes)
   =================================================================== */
.wd-portal {
  font-size: 16px;
  color: #2b2b2b;
  padding-bottom: 24px;
}
.wd-portal .wd-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 8px 0 4px;
}
.wd-portal h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 8px 0 14px;
}
.wd-portal .wd-sub {
  font-size: 1rem;
  color: #6c757d;
  margin: 8px 0 0;
}
.wd-portal .wd-sec {
  margin-bottom: 32px;
}

/* Tarjetas semaforo */
.wd-portal .wd-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  padding: 22px 14px;
  text-align: center;
  margin-bottom: 16px;
}
.wd-portal .wd-traffic {
  border-top: 6px solid #ccc;
}
.wd-portal .wd-emoji {
  font-size: 2.2rem;
  line-height: 1;
}
.wd-portal .wd-cap {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 6px;
}
.wd-portal .wd-big {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin: 8px 0 4px;
}
.wd-portal .wd-state {
  font-size: 1rem;
  font-weight: 600;
}

/* Tablas */
.wd-portal .wd-table {
  font-size: 1rem;
  background: #fff;
}
.wd-portal .wd-table th {
  font-size: 0.95rem;
  white-space: nowrap;
}
.wd-portal .wd-table td,
.wd-portal .wd-table th {
  padding: 12px 10px;
  vertical-align: middle;
}
.wd-portal .wd-trend-up   { color: #28a745; font-weight: 700; }
.wd-portal .wd-trend-down { color: #dc3545; font-weight: 700; }
.wd-portal .wd-trend-eq   { color: #adb5bd; font-weight: 700; }

/* Barra de progreso del plan */
.wd-portal .wd-progress-wrap {
  background: #ececec;
  border-radius: 999px;
  height: 30px;
  overflow: hidden;
}
.wd-portal .wd-progress-bar {
  background: #28a745;
  height: 100%;
  color: #fff;
  text-align: center;
  line-height: 30px;
  font-weight: 700;
  font-size: 1rem;
  transition: width .4s ease;
}

/* Acciones del plan */
.wd-portal .wd-action {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 14px;
  border: 1px solid #ececec;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fff;
}
.wd-portal .wd-action .wd-ico {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1.3;
}
.wd-portal .wd-action .wd-txt {
  font-size: 1.05rem;
  line-height: 1.4;
}
.wd-portal .wd-action .wd-state { margin-top: 2px; }
.wd-portal .wd-st-done { color: #28a745; }
.wd-portal .wd-st-prog { color: #ff8c00; }
.wd-portal .wd-st-pend { color: #6c757d; }
.wd-portal .wd-st-canc { color: #adb5bd; }

/* Botones grandes */
.wd-portal .btn-wd {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 16px 20px;
  border-radius: 12px;
  margin: 6px 0;
}

/* Mensajes */
.wd-portal .wd-msg-list { margin-top: 14px; }
.wd-portal .wd-msg {
  display: block;
  padding: 14px;
  border: 1px solid #ececec;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #fff;
  color: #2b2b2b;
  text-decoration: none;
}
.wd-portal .wd-msg:hover { background: #f7f7f7; }
.wd-portal .wd-msg .wd-txt { font-size: 1.05rem; font-weight: 600; }

/* Badges de factura */
.wd-portal .wd-badge {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.wd-portal .wd-badge-ok   { background: #e3f6e8; color: #1e7e34; }
.wd-portal .wd-badge-grey { background: #ececec; color: #6c757d; }
.wd-portal .wd-badge-pay  { background: #dc3545; color: #fff; }

/* Movil — viewport pequeno (375px y similares) */
@media (max-width: 575px) {
  .wd-portal .wd-title { font-size: 1.5rem; }
  .wd-portal h2 { font-size: 1.2rem; }
  .wd-portal .wd-big { font-size: 2.4rem; }
  .wd-portal .wd-card { padding: 18px 8px; }
  .wd-portal .wd-table th { font-size: 0.82rem; padding: 10px 5px; }
  .wd-portal .wd-table td { padding: 10px 5px; }
}

/* ===================================================================
   Portal cliente — banner de contratacion + pagina de planes
   =================================================================== */

/* Banner promocional en el dashboard */
.wd-portal .wd-promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: linear-gradient(135deg, #2F3E46 0%, #3d5159 100%);
  color: #fff;
  border-radius: 14px;
  padding: 22px 24px;
  margin: 18px 0 26px;
  text-decoration: none;
}
.wd-portal .wd-promo-banner:hover { opacity: .96; }
.wd-portal .wd-promo-title { font-size: 1.25rem; font-weight: 800; }
.wd-portal .wd-promo-sub   { font-size: 1rem; opacity: .85; margin-top: 2px; }
.wd-portal .wd-promo-btn {
  background: #fff; color: #2F3E46; font-weight: 700;
  padding: 12px 22px; border-radius: 10px; white-space: nowrap;
}

/* Selector de planes */
.wd-contratar .wd-plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.wd-contratar .wd-plan-card {
  position: relative;
  background: #fff;
  border: 2px solid #e6e6e6;
  border-radius: 16px;
  padding: 26px 20px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.wd-contratar .wd-plan-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(47,62,70,.12); }
.wd-contratar .wd-plan-popular { border-color: #2F3E46; }
.wd-contratar .wd-plan-selected {
  border-color: #28a745;
  box-shadow: 0 0 0 3px rgba(40,167,69,.18);
}
.wd-contratar .wd-plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: #2F3E46; color: #fff; font-size: .78rem; font-weight: 700;
  padding: 5px 14px; border-radius: 999px; white-space: nowrap;
}
.wd-contratar .wd-plan-name {
  font-size: 1.05rem; font-weight: 800; letter-spacing: .04em;
  color: #2F3E46; text-align: center;
}
.wd-contratar .wd-plan-price {
  font-size: 2.6rem; font-weight: 800; color: #2F3E46;
  text-align: center; margin: 6px 0 14px;
}
.wd-contratar .wd-plan-price span { font-size: 1rem; font-weight: 600; color: #6c757d; }
.wd-contratar .wd-plan-features { list-style: none; padding: 0; margin: 0 0 16px; }
.wd-contratar .wd-plan-features li {
  font-size: 1rem; padding: 7px 0; border-bottom: 1px solid #f0f0f0;
}
.wd-contratar .wd-plan-features li:last-child { border-bottom: 0; }
.wd-contratar .wd-plan-pick {
  text-align: center; font-weight: 700; color: #2F3E46;
  border: 2px solid #2F3E46; border-radius: 10px; padding: 11px;
}
.wd-contratar .wd-plan-selected .wd-plan-pick { background: #28a745; border-color: #28a745; color: #fff; }

/* Seccion de firma */
.wd-contratar .wd-sign {
  background: #fff; border: 1px solid #e6e6e6; border-radius: 16px;
  padding: 24px; margin-top: 10px;
}
.wd-contratar .wd-contract-text {
  font-size: 1.05rem; line-height: 1.7; color: #2b2b2b;
  background: #f7f8f8; border-radius: 10px; padding: 18px; margin-bottom: 18px;
}
.wd-contratar .wd-accept {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 1.05rem; font-weight: 600; cursor: pointer; margin-bottom: 18px;
}
.wd-contratar .wd-accept input { margin-top: 4px; transform: scale(1.3); }
.wd-contratar .btn-wd[disabled] { opacity: .5; cursor: not-allowed; }

/* Movil — una tarjeta por fila */
@media (max-width: 767px) {
  .wd-contratar .wd-plans { grid-template-columns: 1fr; }
  .wd-portal .wd-promo-banner { flex-direction: column; align-items: flex-start; }
  .wd-portal .wd-promo-btn { width: 100%; text-align: center; }
}

/* ===================================================================
   Dashboard admin — ficha de cliente (client_detail.php)
   =================================================================== */

/* Respiracion entre paneles de seccion y titulos con mas peso */
.wd-admin .panel-bordered { margin-bottom: 20px; }
.wd-admin .panel-heading b { font-size: 1.02rem; letter-spacing: .005em; }

/* Cabecera de la ficha — se reordena con flex-wrap en pantallas medianas */
.wd-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wd-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wd-btn-group {
  display: flex;
  gap: 6px;
}
.wd-btn-group:empty { display: none; }

/* Aviso compacto de una sola linea (p.ej. Search Console sin datos) */
.wd-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
  background: #eef4fb;
  border-left: 3px solid #1a73e8;
  color: #3a4a5a;
}
.wd-note > i { font-size: 1rem; flex-shrink: 0; color: #1a73e8; }
.wd-note code { font-size: 0.82rem; }

/* Cabecera del panel del plan */
.wd-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.wd-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wd-panel-head-actions .wd-sep { color: #ccc; }
.wd-panel-head-actions .btn-link { padding: 2px 5px; color: #5a6670; }
.wd-panel-head-actions .btn-link:hover { color: #1a73e8; }

/* ---- Plan de accion: tarjetas-acordeon ---- */
.wd-plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wd-pa {
  border: 1px solid #e4e7ea;
  border-left: 4px solid #adb5bd;
  border-radius: 7px;
  background: #fff;
  transition: box-shadow .12s ease;
}
.wd-pa:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }

/* Acento lateral por estado: lectura del progreso de un vistazo */
.wd-pa-st-in_progress { border-left-color: #ffc107; }
.wd-pa-st-done        { border-left-color: #28a745; }
.wd-pa-st-cancelled   { border-left-color: #ced4da; }
.wd-pa-st-cancelled .wd-pa-title {
  text-decoration: line-through;
  color: #adb5bd;
}

.wd-pa-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

/* Boton-disparador del acordeon: ocupa el espacio libre de la fila */
.wd-pa-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.wd-pa-toggle:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
  border-radius: 3px;
}
.wd-pa-chev {
  flex-shrink: 0;
  font-size: .78rem;
  color: #98a2ab;
  transition: transform .15s ease;
}
.wd-pa-open .wd-pa-chev { transform: rotate(90deg); }

.wd-pa-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f0f2f4;
  color: #5a6670;
  font-size: .78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wd-pa-cat {
  flex-shrink: 0;
  color: #fff;
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.wd-pa-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  font-size: .93rem;
  color: #2b2b2b;
  line-height: 1.35;
}
.wd-pa-month {
  flex-shrink: 0;
  font-size: .78rem;
  color: #98a2ab;
  white-space: nowrap;
}

/* Controles siempre visibles en la fila colapsada */
.wd-pa-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wd-pa-controls .wd-status-select {
  width: auto;
  min-width: 118px;
}

/* Cuerpo desplegable */
.wd-pa-body {
  display: none;
  padding: 2px 14px 13px 35px;
}
.wd-pa-open .wd-pa-body { display: block; }
.wd-pa-block { margin-top: 10px; }
.wd-pa-lbl {
  display: block;
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #98a2ab;
  margin-bottom: 3px;
}
.wd-pa-block p {
  margin: 0;
  font-size: .9rem;
  line-height: 1.5;
  color: #3a4046;
}
.wd-pa-admin {
  background: #f6f7f8;
  border-radius: 6px;
  padding: 8px 11px;
}
.wd-pa-admin .wd-pa-lbl { color: #8a929b; }
.wd-pa-admin p { color: #6c757d; font-style: italic; }

/* Responsive — cabecera y plan en movil/tablet estrecha */
@media (max-width: 767px) {
  .wd-detail-head { align-items: flex-start; }
  .wd-head-actions { width: 100%; flex-direction: column; }
  .wd-btn-group { width: 100%; }
  .wd-btn-group .btn { flex: 1 1 auto; }
  .wd-pa-head { flex-wrap: wrap; }
  .wd-pa-toggle { flex-basis: 100%; }
  .wd-pa-controls { width: 100%; justify-content: flex-end; }
  .wd-pa-body { padding-left: 14px; }
}

/* ===================================================================
 *  WEBDOCTOR ADMIN THEME — Sprint 8 (tema visual)
 *  Tipografia de marca + colores WebDoctor en el area de admin.
 *  Este fichero se carga via app_admin_head y app_customers_head.
 *  Las @font-face viven aqui para estar disponibles en ambas areas.
 * =================================================================== */

@font-face { font-family: 'NeueHaasDisplay'; src: url('../fonts/neuehaasdisplay/NeueHaasDisplayLight.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'NeueHaasDisplay'; src: url('../fonts/neuehaasdisplay/NeueHaasDisplayRoman.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'NeueHaasDisplay'; src: url('../fonts/neuehaasdisplay/NeueHaasDisplayMediu.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'NeueHaasDisplay'; src: url('../fonts/neuehaasdisplay/NeueHaasDisplayBold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'NeueHaasDisplay'; src: url('../fonts/neuehaasdisplay/NeueHaasDisplayBlack.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --wd-c-dark:   #2F3E46;
  --wd-c-surface:#354F52;
  --wd-c-accent: #84A98C;
  --wd-c-light:  #CAD2C5;
}

/* Tipografia de marca en todo el CRM (admin y portal) */
body,
#wrapper,
.sidebar,
h1, h2, h3, h4, h5, h6,
.panel-heading,
.btn {
  font-family: 'NeueHaasDisplay', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* ── Sidebar del admin con el color de marca ─────────────────────────────── */
#menu.sidebar {
  background-color: var(--wd-c-dark);
}
#menu.sidebar #side-menu > li > a {
  color: var(--wd-c-light);
}
#menu.sidebar #side-menu > li > a:hover,
#menu.sidebar #side-menu > li > a:focus {
  color: #ffffff;
  background-color: rgba(132, 169, 140, 0.14);
}
#menu.sidebar #side-menu > li.active > a {
  color: #ffffff;
  background-color: rgba(132, 169, 140, 0.18);
  box-shadow: inset 3px 0 0 var(--wd-c-accent);
}
#menu.sidebar #side-menu .menu-icon,
#menu.sidebar #side-menu i {
  color: var(--wd-c-accent);
}

/* ── Cabecera del admin: borde inferior con el verde claro de marca ──────── */
#header {
  border-bottom: 2px solid var(--wd-c-light);
}

/* ── Botones primarios con el verde de marca ─────────────────────────────── */
.btn-primary {
  background-color: var(--wd-c-accent) !important;
  border-color: var(--wd-c-accent) !important;
  color: var(--wd-c-dark) !important;
  font-weight: 700;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: #95b89c !important;
  border-color: #95b89c !important;
  color: var(--wd-c-dark) !important;
}

/* ── Acentos: badges e items activos ─────────────────────────────────────── */
.label-success,
.bg-success {
  background-color: var(--wd-c-accent) !important;
}
.text-success {
  color: #5f8a6e !important;
}

/* ───────────────────────────────────────────────────────────────────────────
 *  Area de contenido del admin — oscurecimiento
 *  Selectores reales de Perfex 3.4.1: el contenido va en #wrapper > .content
 *  (lo confirman las propias vistas admin del modulo), la cabecera es #header.
 *  Todo acotado con body:not(.customers) para no afectar al portal cliente.
 * ─────────────────────────────────────────────────────────────────────────── */

/* Fondo general del area de contenido */
body:not(.customers),
body:not(.customers) #wrapper,
body:not(.customers) .content {
  background-color: #2F3E46 !important;
}
/* Texto por defecto del area de contenido (lo que no lleve una clase de
   color propia heredara este gris claro). */
body:not(.customers) #wrapper,
body:not(.customers) .content {
  color: #CAD2C5 !important;
}

/* Paneles y cards del admin */
body:not(.customers) .panel,
body:not(.customers) .panel_s,
body:not(.customers) .panel-default,
body:not(.customers) .panel-body {
  background-color: #354F52 !important;
  border-color: rgba(82, 121, 111, 0.3) !important;
  color: #CAD2C5 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18) !important;
}

/* Cabecera del panel */
body:not(.customers) .panel-heading,
body:not(.customers) .panel-title {
  background-color: #2F3E46 !important;
  color: #CAD2C5 !important;
  border-color: rgba(82, 121, 111, 0.3) !important;
}

/* Titulos y texto del admin */
body:not(.customers) h1,
body:not(.customers) h2,
body:not(.customers) h3,
body:not(.customers) h4,
body:not(.customers) .panel p,
body:not(.customers) .panel label,
body:not(.customers) .bold {
  color: #CAD2C5 !important;
}

/* Tablas del admin */
body:not(.customers) .table > tbody > tr > td,
body:not(.customers) .table > thead > tr > th,
body:not(.customers) .table > tfoot > tr > td {
  color: #CAD2C5 !important;
  border-color: rgba(82, 121, 111, 0.22) !important;
  background-color: transparent !important;
}
body:not(.customers) .table-hover > tbody > tr:hover > td {
  background-color: rgba(82, 121, 111, 0.12) !important;
}

/* Barra superior (#header) */
body:not(.customers) #header {
  background-color: #243038 !important;
  border-bottom: 1px solid rgba(82, 121, 111, 0.3) !important;
}

/* Inputs del admin */
body:not(.customers) .content input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
body:not(.customers) .content select,
body:not(.customers) .content textarea,
body:not(.customers) .panel input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
body:not(.customers) .panel select,
body:not(.customers) .panel textarea {
  background-color: #2F3E46 !important;
  color: #CAD2C5 !important;
  border-color: rgba(132, 169, 140, 0.4) !important;
}

/* ───────────────────────────────────────────────────────────────────────────
 *  Admin oscuro — correcciones de legibilidad
 *  La regla 1 va acotada a .content (no a todo body:not(.customers)) para no
 *  aclarar el texto de la tarjeta de perfil del sidebar, que es un recuadro
 *  blanco: el sidebar ya estaba correcto y no debe tocarse.
 * ─────────────────────────────────────────────────────────────────────────── */

/* 1. Texto con utilidades Tailwind tw-text-* dentro del area de contenido */
body:not(.customers) .content .tw-text-neutral-700,
body:not(.customers) .content .tw-text-neutral-600,
body:not(.customers) .content .tw-text-neutral-500,
body:not(.customers) .content .tw-text-neutral-400,
body:not(.customers) .content .tw-text-gray-700,
body:not(.customers) .content .tw-text-gray-600,
body:not(.customers) .content .tw-text-gray-500,
body:not(.customers) .content [class*="tw-text-neutral"],
body:not(.customers) .content [class*="tw-text-gray"] {
  color: #CAD2C5 !important;
}

/* 2. Texto generico en paneles y contenido */
body:not(.customers) .panel p,
body:not(.customers) .panel span:not(.badge),
body:not(.customers) .panel small,
body:not(.customers) .panel strong,
body:not(.customers) .panel li,
body:not(.customers) .content p,
body:not(.customers) .content span:not(.badge):not(.label),
body:not(.customers) .content small {
  color: #CAD2C5 !important;
}

/* 3. Barra superior (#header) */
body:not(.customers) #header {
  background-color: #243038 !important;
  border-bottom: 1px solid rgba(82, 121, 111, 0.3) !important;
}
body:not(.customers) #header * {
  color: #CAD2C5 !important;
}
body:not(.customers) #header input {
  background-color: #2F3E46 !important;
  color: #CAD2C5 !important;
  border-color: rgba(132, 169, 140, 0.3) !important;
}

/* 4. Links dentro del contenido admin */
body:not(.customers) .content a:not(.btn),
body:not(.customers) .panel a:not(.btn) {
  color: #84A98C !important;
}
body:not(.customers) .content a:not(.btn):hover,
body:not(.customers) .panel a:not(.btn):hover {
  color: #CAD2C5 !important;
}

/* 5. Subtitulos y texto descriptivo de modulos */
body:not(.customers) .content h4 + p,
body:not(.customers) .content .text-muted {
  color: #91B0A9 !important;
}

/* ===================================================================
 *  Sprint 9 — Modernizacion UX/UI del admin
 *  Principios aplicados: jerarquia visual (tamaño/peso), Von Restorff
 *  (un dato hero por card), contraste WCAG AA, profundidad por sombra.
 *  Acotado a body:not(.customers). Especificidad alta para vencer al
 *  whatsapp.css del modulo wd_whatsapp sin recurrir a !important salvo
 *  donde Perfex/Bootstrap obliga.
 * =================================================================== */

/* F — Contraste: meta de conexion (Numero/Nombre) iba en #2F3E46 (invisible) */
body:not(.customers) .wd-wa-conn-meta,
body:not(.customers) .wd-wa-conn-meta li {
  color: #91B0A9 !important;
  font-size: 14px;
}
body:not(.customers) .wd-wa-conn-meta strong {
  color: #FFFFFF !important;
  font-weight: 700;
}

/* C — Badges de estado: sistema de pills de marca con punto indicador */
body:not(.customers) .wd-wa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
}
body:not(.customers) .wd-wa-status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
body:not(.customers) .wd-wa-status-badge.wd-wa-connected {
  background: rgba(132, 169, 140, 0.12);
  border-color: #84A98C;
  color: #84A98C;
}
body:not(.customers) .wd-wa-status-badge.wd-wa-connected::before {
  animation: wd-pulse 1.8s ease-in-out infinite;
}
body:not(.customers) .wd-wa-status-badge.wd-wa-error {
  background: rgba(192, 73, 47, 0.16);
  border-color: #C0492F;
  color: #E08368;
}
body:not(.customers) .wd-wa-status-badge.wd-wa-qr,
body:not(.customers) .wd-wa-status-badge.wd-wa-connecting {
  background: rgba(233, 162, 59, 0.14);
  border-color: #E9A23B;
  color: #E9A23B;
}
@keyframes wd-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(132, 169, 140, 0.55); }
  50%      { box-shadow: 0 0 0 5px rgba(132, 169, 140, 0); }
}

/* D — Boton secundario de marca (Desconectar / Reiniciar servidor) */
body:not(.customers) .wd-wa-reset.btn-default {
  background: transparent !important;
  border: 1px solid #84A98C !important;
  color: #84A98C !important;
  border-radius: 4px !important;
  font-weight: 500;
  transition: background-color .2s ease, color .2s ease;
}
body:not(.customers) .wd-wa-reset.btn-default:hover,
body:not(.customers) .wd-wa-reset.btn-default:focus {
  background: #84A98C !important;
  color: #2F3E46 !important;
}
body:not(.customers) .wd-wa-reset.btn-danger {
  background: #C0492F !important;
  border-color: #C0492F !important;
  color: #FFFFFF !important;
  border-radius: 4px !important;
}
body:not(.customers) .wd-wa-reset.btn-danger:hover {
  background: #A83C25 !important;
}

/* B + E — Cards de stats: jerarquia interna, icono de acento, profundidad */
body:not(.customers) .wd-wa-stat {
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  transition: transform .18s ease, box-shadow .18s ease;
  animation: wd-card-in .4s ease both;
}
body:not(.customers) .wd-wa-stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32) !important;
}
body:not(.customers) .wd-wa-stat .fa-2x {
  color: #84A98C !important;
}
body:not(.customers) .wd-wa-stat .tw-text-3xl {
  font-family: 'NeueHaasDisplay', 'Helvetica Neue', sans-serif;
  font-weight: 900 !important;
  font-size: 40px !important;
  line-height: 1.1 !important;
  color: #FFFFFF !important;
}
body:not(.customers) .wd-wa-stat .tw-text-sm {
  color: #91B0A9 !important;
  font-weight: 500;
}
@keyframes wd-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Respeto a prefers-reduced-motion (accesibilidad) */
@media (prefers-reduced-motion: reduce) {
  body:not(.customers) .wd-wa-stat { animation: none !important; }
  body:not(.customers) .wd-wa-stat:hover { transform: none; }
  body:not(.customers) .wd-wa-status-badge.wd-wa-connected::before { animation: none !important; }
}

/* ===================================================================
 *  Sprint A3.1 — Plan de Accion: tarjetas oscuras en admin
 *  Las cards .wd-pa salian con bg blanco sobre el fondo oscuro del
 *  tema admin. Forzamos paleta WebDoctor solo en area admin (body
 *  no .customers) para no afectar el portal cliente.
 * =================================================================== */

body:not(.customers) .wd-plan-list .wd-pa,
body:not(.customers) [class*="wd-plan"] .wd-pa {
  background-color: #354F52 !important;
  border-color: rgba(82,121,111,0.3) !important;
  color: #CAD2C5 !important;
}

body:not(.customers) .wd-pa-title,
body:not(.customers) .wd-pa .wd-pa-toggle {
  color: #FFFFFF !important;
}

body:not(.customers) .wd-pa-num,
body:not(.customers) .wd-pa-month,
body:not(.customers) .wd-pa-lbl,
body:not(.customers) .wd-pa-block p {
  color: #91B0A9 !important;
}

/* Select de estado */
body:not(.customers) .wd-pa select,
body:not(.customers) .wd-pa .wd-status-select,
body:not(.customers) .wd-plan-list select {
  background-color: #2F3E46 !important;
  color: #CAD2C5 !important;
  border-color: rgba(132,169,140,0.4) !important;
}

/* Cuerpo expandible de la card */
body:not(.customers) .wd-pa-body,
body:not(.customers) .wd-pa .wd-pa-body {
  background-color: #2F3E46 !important;
  border-top-color: rgba(82,121,111,0.2) !important;
}

/* Bloques internos: hereda el bg del wd-pa-body, suaviza la nota tecnica */
body:not(.customers) .wd-pa-block {
  background-color: transparent !important;
}
body:not(.customers) .wd-pa .wd-pa-admin {
  background-color: rgba(255,193,7,0.06) !important;
  border-color: rgba(255,193,7,0.28) !important;
}
body:not(.customers) .wd-pa .wd-pa-admin .wd-pa-lbl,
body:not(.customers) .wd-pa .wd-pa-admin p {
  color: #E2C46B !important;
}


/* Sprint A3.2 — Health Score: barra propia con label encima */
.wd-hs-bar { height: 10px; background: #e9ecef; border-radius: 5px;
             overflow: hidden; margin-bottom: 18px; }
.wd-hs-fill { height: 100%; transition: width .4s ease; border-radius: 5px; }
body:not(.customers) .wd-hs-bar { background: #2F3E46; }
