/* Panel de AnuDash - mismo sistema de diseno que min/css/shell.css (tokens, tarjetas, botones,
   etiquetas, campos, tablas, ventanas) copiado aqui porque el Panel vive en su propio docroot
   (panel.anudash.com -> Panel/) y no puede importar archivos de ../min/. */

:root {
  --sh-purple: #5b3df0;
  --sh-blue: #2f6bff;
  --sh-gradient: linear-gradient(135deg, var(--sh-purple), var(--sh-blue));
  --sh-ink: #15172b;
  --sh-ink-soft: #4a4d63;
  --sh-muted: #868aa3;
  --sh-border: #e9eaf3;
  --sh-bg-soft: #f6f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 0; background: var(--sh-bg-soft); color: var(--sh-ink); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: var(--sh-purple); }

/* Paleta por modulo (misma de la landing) */
.card-blue   { --card-bg: #e9f1ff; --card-icon: #3b63e0; --card-icon-bg: #d3e2ff; }
.card-green  { --card-bg: #e7f8f0; --card-icon: #1f9d6c; --card-icon-bg: #cdf0dd; }
.card-violet { --card-bg: #efeafe; --card-icon: #6c4cf0; --card-icon-bg: #ddd2fc; }
.card-orange { --card-bg: #fdf0e4; --card-icon: #e4823a; --card-icon-bg: #fbdcbd; }
.card-pink   { --card-bg: #fdeaec; --card-icon: #de4f68; --card-icon-bg: #f9d2d8; }
.card-yellow { --card-bg: #fdf6e1; --card-icon: #cc9a2e; --card-icon-bg: #f8e8b8; }
.card-purple { --card-bg: #f1ecfd; --card-icon: #7c53e8; --card-icon-bg: #ddd0fb; }
.card-coral  { --card-bg: #fdeee5; --card-icon: #e06a3e; --card-icon-bg: #fad9c4; }

/* ---------- Acceso (login / 2FA) ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--sh-border); border-radius: 24px;
  padding: 36px 34px 32px; text-align: center; box-shadow: 0 30px 60px -30px rgba(45,40,130,.35);
}
.auth-logo { height: 54px; margin-bottom: 22px; }
.auth-card h2 { margin: 0 0 6px; font-size: 21px; font-weight: 700; }
.auth-card p.sub { margin: 0 0 22px; font-size: 13.5px; color: var(--sh-muted); }
.auth-card .form-group { text-align: left; margin-bottom: 14px; }
.auth-error { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: #de4f68; }

/* ---------- Barra superior ---------- */
.pn-topbar {
  position: sticky; top: 0; z-index: 50; height: 68px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--sh-border);
}
.pn-brand { display: flex; align-items: center; gap: 14px; }
.pn-brand img { height: 34px; }
.pn-brand h1 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.pn-brand small { display: block; font-size: 11.5px; font-weight: 500; color: var(--sh-muted); letter-spacing: 0; }
.pn-menu { position: relative; }
.pn-user {
  display: flex; align-items: center; gap: 10px; border: 1.5px solid transparent; background: transparent;
  border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; text-align: left;
  transition: background .15s ease, border-color .15s ease;
}
.pn-user:hover, .pn-user.open { background: #f3f4fb; border-color: #dcdffa; }
.pn-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--sh-gradient); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 15px; box-shadow: 0 6px 14px -6px rgba(91,61,240,.7);
}
.pn-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.pn-user-info strong { font-size: 13px; }
.pn-user-info span { font-size: 11px; color: var(--sh-muted); }
.pn-panel-pop {
  position: absolute; top: calc(100% + 10px); right: 0; width: 220px; background: #fff; border: 1px solid var(--sh-border);
  border-radius: 16px; box-shadow: 0 24px 50px -18px rgba(30,27,90,.35); padding: 8px; animation: pn-in .16s ease; z-index: 60;
}
.pn-panel-pop a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  color: var(--sh-ink-soft); text-decoration: none; cursor: pointer;
}
.pn-panel-pop a i { width: 18px; text-align: center; color: var(--sh-muted); }
.pn-panel-pop a:hover { background: #fdeaec; color: #de4f68; }
.pn-panel-pop a:hover i { color: #de4f68; }
@keyframes pn-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Contenido ---------- */
.pn-main { max-width: 1180px; margin: 0 auto; padding: 30px 28px 60px; }
.pn-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.pn-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.pn-head p { margin: 4px 0 0; font-size: 14px; color: var(--sh-muted); }

.pn-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.pn-stat {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: #fff; border: 1px solid var(--sh-border);
  border-radius: 18px; box-shadow: 0 10px 26px -20px rgba(45,40,130,.35);
}
.pn-stat-ico { width: 46px; height: 46px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: var(--card-icon-bg); color: var(--card-icon); }
.pn-stat strong { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.pn-stat span { font-size: 12.5px; color: var(--sh-muted); }

.ui-card { background: #fff; border: 1px solid var(--sh-border); border-radius: 18px; padding: 24px 28px 28px; margin-bottom: 20px; }
.ui-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ui-card-title { margin: 0; font-size: 18px; font-weight: 700; }

/* Botones */
.btn-ui {
  display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 12px; padding: 11px 20px; font-size: 14px; font-weight: 600;
  background: var(--sh-gradient); color: #fff; cursor: pointer; transition: opacity .15s ease, transform .15s ease;
}
.btn-ui:hover { opacity: .92; color: #fff; }
.btn-ui[disabled] { opacity: .5; cursor: default; }
.btn-ui-ghost {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--sh-border); border-radius: 12px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; background: #fff; color: var(--sh-ink-soft); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.btn-ui-ghost:hover { background: var(--sh-bg-soft); color: var(--sh-ink); }
.btn-ui-ghost.danger:hover { background: #fdeaec; color: #de4f68; border-color: #f9d2d8; }
.btn-ui-sm { padding: 7px 14px; font-size: 12.5px; border-radius: 10px; }

/* Etiquetas */
.ui-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #eceef5; color: var(--sh-muted); }
.ui-pill.ok   { background: #e7f8f0; color: #1f9d6c; }
.ui-pill.bad  { background: #fdeaec; color: #de4f68; }
.ui-pill.wait { background: #fdf6e1; color: #b8860b; }
.ui-pill.main { background: #efeafe; color: #6c4cf0; }

/* Buscador */
.pn-search {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; max-width: 420px; flex: 1 1 260px;
  background: #f3f4fb; border: 1.5px solid transparent; border-radius: 14px; color: var(--sh-muted);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pn-search:hover { background: #eceefa; border-color: #dcdffa; }
.pn-search:focus-within { background: #fff; border-color: var(--sh-purple); box-shadow: 0 0 0 4px rgba(91,61,240,.12); }
.pn-search:focus-within > i { color: var(--sh-purple); }
.pn-search input { flex: 1; border: none; background: none; outline: none; font-size: 14px; color: var(--sh-ink); }

/* Tabla de clientes */
.pn-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.pn-table th { font-size: 11.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--sh-muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--sh-border); }
.pn-table td { padding: 15px 12px; border-bottom: 1px solid var(--sh-border); font-size: 14px; vertical-align: middle; }
.pn-table tbody tr:hover td { background: var(--sh-bg-soft); }
.pn-table td.actions { text-align: right; white-space: nowrap; }
.pn-slug { display: inline-block; margin-left: 8px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 8px; background: var(--sh-bg-soft); border: 1px solid var(--sh-border); color: var(--sh-muted); }
.pn-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pn-chip { width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; background: var(--card-icon-bg); color: var(--card-icon); }
.pn-empty { text-align: center; padding: 36px 12px !important; color: var(--sh-muted); }

/* Campos */
.pn-field label, .pn-fields label { font-size: 12.5px; font-weight: 600; color: var(--sh-ink-soft); margin-bottom: 6px; display: block; }
.pn-fields .form-control, .auth-card .form-control {
  height: 44px; border: 1px solid var(--sh-border); border-radius: 10px; box-shadow: none; font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pn-fields .form-control:focus, .auth-card .form-control:focus { border-color: var(--sh-purple); box-shadow: 0 0 0 3px rgba(91,61,240,.12); }
.pn-fields .form-group { margin-bottom: 16px; }
.pn-section { margin: 26px 0 10px; font-size: 15px; font-weight: 700; }
.pn-hint { margin: 0 0 14px; font-size: 12.5px; color: var(--sh-muted); }

/* ---------- Tarjetas de modulo (interruptor + limites) ---------- */
.pn-mod-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12.5px; color: var(--sh-muted); }
.pn-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.pn-mod { background: #fff; border: 1.5px solid var(--sh-border); border-radius: 18px; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.pn-mod.on { background: var(--card-bg); border-color: var(--card-icon-bg); box-shadow: 0 12px 26px -20px rgba(45,40,130,.5); }
.pn-mod-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; }
.pn-mod.soon .pn-mod-head { cursor: default; }
.pn-mod-ico {
  width: 44px; height: 44px; flex: none; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 17px;
  background: #eef0f6; color: #a3a7ba; transition: background .15s ease, color .15s ease;
}
.pn-mod.on .pn-mod-ico { background: var(--card-icon-bg); color: var(--card-icon); }
.pn-mod-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pn-mod-txt strong { font-size: 14.5px; }
.pn-mod-txt span { font-size: 12px; color: var(--sh-muted); line-height: 1.35; }
.pn-switch { width: 42px; height: 24px; flex: none; border-radius: 999px; background: #d7dae8; position: relative; transition: background .2s ease; }
.pn-switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(20,20,60,.25); transition: left .2s ease; }
.pn-switch.on { background: var(--sh-gradient); }
.pn-switch.on i { left: 21px; }
.pn-soon { flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #fdeee5; color: #e06a3e; }
.pn-mod.soon { opacity: .75; }
.pn-mod-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.pn-mod-limits label { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--sh-ink-soft); }
.pn-mod-limits label small { font-weight: 500; color: var(--sh-muted); }
.pn-mod-limits .form-control { height: 38px; margin-top: 5px; background: #fff; }
.pn-general { margin-top: 18px; padding: 16px 18px; background: var(--sh-bg-soft); border: 1px solid var(--sh-border); border-radius: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.pn-general label { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--sh-ink-soft); }
.pn-general .form-control { height: 38px; margin-top: 5px; background: #fff; }

/* ---------- Ventanas ---------- */
.pn-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 5vh 16px;
  background: rgba(21,23,43,.45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: pn-fade .18s ease;
}
.pn-modal {
  position: relative; width: 100%; max-width: 860px; background: #fff; border-radius: 24px; padding: 30px 32px 28px;
  box-shadow: 0 30px 70px -22px rgba(20,20,60,.55); animation: pn-pop .2s ease;
}
@keyframes pn-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pn-pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.pn-modal h3 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.pn-modal .sub { margin: 0 0 20px; font-size: 13.5px; color: var(--sh-muted); }
.pn-close {
  position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--sh-border);
  background: var(--sh-bg-soft); color: var(--sh-muted); cursor: pointer; font-size: 14px; transition: background .15s ease, color .15s ease, transform .2s ease;
}
.pn-close:hover { background: #fdeaec; color: #de4f68; border-color: #f9d2d8; transform: rotate(90deg); }
.pn-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--sh-border); }
.pn-actions .spacer { flex: 1; }
.pn-msg { font-size: 13px; font-weight: 600; margin: 12px 0 0; }
.pn-msg.err { color: #de4f68; }
.pn-msg.ok { color: #1f9d6c; }
.pn-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 200; background: var(--sh-ink); color: #fff; padding: 13px 20px; border-radius: 14px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 20px 40px -16px rgba(20,20,60,.6); animation: pn-pop .2s ease;
}
.pn-toast i { color: #4ade80; margin-right: 8px; }

@media (max-width: 640px) {
  .pn-topbar { padding: 0 16px; }
  .pn-user-info { display: none; }
  .pn-main { padding: 22px 16px 50px; }
  .pn-modal { padding: 24px 18px 22px; border-radius: 20px; }
  .pn-table th:nth-child(4), .pn-table td:nth-child(4) { display: none; }
  .pn-mods { grid-template-columns: 1fr; }
}

/* Datos de la empresa / conexion con Anunciamex */
.pn-checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 2px 0 14px; }
.pn-checks label { font-weight: 500; font-size: 13px; margin: 0; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.pn-amx { margin: 6px 0 4px; padding: 14px 16px; border: 1.5px solid var(--sh-border); border-radius: 14px; background: var(--sh-bg-soft); }
.pn-amx-txt { margin-left: 8px; font-size: 13px; color: var(--sh-ink-soft); }
.pn-radios label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; margin: 8px 0; cursor: pointer; }
.pn-radio-extra { margin: 0 0 10px 24px; max-width: 420px; }
.pn-ok { color: #15803d; font-size: 13px; font-weight: 600; margin-left: 12px; }

/* ---- demos ---- */
.pn-tabs { display: flex; gap: 8px; margin: 0 0 18px; }
.pn-tabs button { border: 1.5px solid var(--sh-border, #e4e7f0); background: #fff; color: var(--sh-ink-soft, #4a4d63); border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.pn-tabs button.on { background: #efeafe; border-color: #cfc5fa; color: #5b3df0; }
.pn-tabs button i { margin-right: 6px; } .pn-tabs button b { margin-left: 6px; background: #5b3df0; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.pn-demo-vence { font-size: 12px; color: #b8860b; margin-top: 3px; } .pn-demo-vence i { margin-right: 4px; }
.pn-enlace input { font-size: 13px; }


/* =====================================================================================================================
   Tema oscuro (igual que la app): fondo morado profundo del logo y recuadros claros encima.
   ===================================================================================================================== */
:root { --sh-dark: #190e3a; --sh-on-dark: #f3f0ff; --sh-on-dark-soft: #c9c0f2; }
html { background: var(--sh-dark); }
body {
  background:
    radial-gradient(1100px 620px at 90% -8%, rgba(91,61,240,.55), transparent 62%),
    radial-gradient(900px 560px at -8% 108%, rgba(47,107,255,.28), transparent 58%),
    var(--sh-dark);
  background-attachment: fixed; min-height: 100vh;
}
.pn-head h2 { color: var(--sh-on-dark); }
.pn-head p { color: var(--sh-on-dark-soft); }
.auth-wrap > .auth-logo { background: #fff; padding: 16px 26px; border-radius: 20px; height: auto; box-sizing: content-box; max-height: 54px; }
.auth-card { box-shadow: 0 40px 80px -30px rgba(0,0,0,.65); }

/* ---------- Prospectos ---------- */
.pr-filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.pr-chips { margin: 0; flex-wrap: wrap; }
.pr-pts { display: flex; gap: 6px; margin-bottom: 5px; }
.pr-pts span { white-space: nowrap; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 8px; background: #eceef5; color: var(--sh-muted); }
.pr-pts span.baja { background: #fdeaec; color: #de4f68; } .pr-pts span.media { background: #fdf6e1; color: #b8860b; } .pr-pts span.alta { background: #e7f8f0; color: #1f9d6c; }
.pr-debil { font-size: 12.5px; color: var(--sh-ink-soft, #4a4d63); }
.pr-nota { font-size: 12.5px; color: var(--sh-muted); margin-top: 4px; } .pr-nota i { margin-right: 4px; }
.pn-table td.actions a.btn-ui { text-decoration: none; }
.pr-flag { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; margin-right: 4px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }

/* ---- lista unica de clientes y demos ---- */
.pn-head-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.pn-table tbody tr.pn-row-demo td { background: #f7f3ff; } .pn-table tbody tr.pn-row-demo:hover td { background: #efe8ff; }
.pn-table tbody tr.pn-row-demo td:first-child { box-shadow: inset 4px 0 0 #9b7cf6; }
.pn-ident { font-size: 12.5px; color: var(--sh-ink-soft, #4a4d63); margin-top: 4px; line-height: 1.4; } .pn-ident i { width: 14px; color: var(--sh-muted); margin-right: 4px; }
.pn-ident strong { font-weight: 700; }
.pn-tabs button b { font-weight: 800; font-size: 12px; margin-left: 4px; opacity: .75; }
