/* Identidad Plexus International (Brand Identity Guide 2022) */
:root {
  --plexus-blue: #022768;
  --steel-blue: #4D6994;
  --pale-blue: #B8C9E1;
  --bright-blue: #489FDF;
  --n1: #4F4F4F;
  --n2: #737373;
  --n3: #B0B0B0;
  --n4: #DEDEDE;
  --bg: #F4F6FA;
  --white: #FFFFFF;
  --ok: #1E7F4F;
  --warn: #9A5B00;
  --danger: #B3261E;
  --radius: 14px;
  --font-head: 'Roboto', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--n1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--bright-blue); }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  color: var(--plexus-blue);
  margin: 0 0 .5rem;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 999px; cursor: pointer;
  font-family: var(--font-body); font-weight: 900; text-transform: uppercase;
  letter-spacing: .04em; font-size: .85rem;
  padding: .85rem 1.4rem; text-decoration: none;
  background: var(--plexus-blue); color: var(--white);
  transition: transform .08s ease, background .15s ease;
}
.btn:hover { background: #03338A; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--plexus-blue); box-shadow: inset 0 0 0 2px var(--pale-blue); }
.btn.ghost:hover { background: #EAF0F8; }
.btn.small { padding: .5rem .9rem; font-size: .75rem; }
.cta2 {
  font-weight: 900; text-transform: uppercase; color: var(--bright-blue);
  text-decoration: none; letter-spacing: .04em; font-size: .85rem;
}
.cta2::after { content: ' >>'; }

/* ---------- Tarjeta pública ---------- */
.pc-page { min-height: 100vh; display: flex; justify-content: center; background: var(--bg); }
.pc {
  width: 100%; max-width: 440px; background: var(--white);
  min-height: 100vh; display: flex; flex-direction: column;
  box-shadow: 0 0 40px rgba(2, 39, 104, .08);
}
.pc-top { padding: 18px 20px 14px; background: var(--white); }
.pc-logo { height: 34px; width: auto; }
.pc-logo-text {
  font-family: var(--font-head); font-weight: 700; letter-spacing: .18em;
  color: var(--plexus-blue); font-size: 1.25rem;
}
.pc-hero { position: relative; background: var(--plexus-blue); height: 120px; }
.pc-hero svg.curve { position: absolute; left: 0; bottom: -1px; width: 100%; height: 48px; }
.pc-photo {
  position: absolute; left: 50%; bottom: -56px; transform: translateX(-50%);
  width: 124px; height: 124px; border-radius: 50%;
  border: 5px solid var(--white); background: var(--pale-blue);
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 500; font-size: 2.6rem; color: var(--plexus-blue);
}
.pc-photo img { width: 100%; height: 100%; object-fit: cover; }
.pc-id { text-align: center; padding: 68px 24px 8px; }
.pc-name { font-size: 1.6rem; line-height: 1.2; margin-bottom: .25rem; }
.pc-role { color: var(--steel-blue); font-size: 1rem; font-weight: 700; margin: 0; }
.pc-company { color: var(--n2); font-size: .9rem; margin: .25rem 0 0; }
.pc-main { padding: 18px 20px 8px; }
.pc-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 6px; }
.pc-act {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--plexus-blue); font-size: .75rem; font-weight: 700;
  background: none; border: 0; cursor: pointer; font-family: var(--font-body); padding: 0;
}
.pc-act .ic {
  width: 52px; height: 52px; border-radius: 50%; background: #E6EEF8;
  display: flex; align-items: center; justify-content: center;
}
.pc-act .ic svg { width: 24px; height: 24px; stroke: var(--plexus-blue); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pc-list { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--n4); }
.pc-list li { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--n4); font-size: .95rem; }
.pc-list li svg { width: 20px; height: 20px; flex: none; stroke: var(--steel-blue); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pc-list a { color: var(--n1); text-decoration: none; word-break: break-word; }
.pc-more { text-align: center; padding: 20px 0 8px; }
.pc-share { text-align: center; padding: 4px 0 18px; }
.pc-share button { background: none; border: 0; color: var(--steel-blue); font-family: var(--font-body); font-weight: 700; cursor: pointer; font-size: .85rem; }
.pc-foot { margin-top: auto; position: relative; background: var(--plexus-blue); color: var(--white); text-align: center; padding: 46px 20px 22px; }
.pc-foot svg.curve { position: absolute; left: 0; top: -1px; width: 100%; height: 40px; }
.pc-tag { font-family: var(--font-head); font-weight: 500; font-size: 1.05rem; margin: 0 0 .25rem; }
.pc-foot a { color: var(--pale-blue); text-decoration: none; font-size: .85rem; }
.pc-msg { padding: 40px 24px; text-align: center; }
.pc-msg p { line-height: 1.5; }

/* ---------- App de administración ---------- */
.app-bar {
  position: sticky; top: 0; z-index: 10; background: var(--white);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--n4);
}
.app-bar .who { font-size: .8rem; color: var(--n2); text-align: right; line-height: 1.3; }
.app-bar .who button { background: none; border: 0; color: var(--bright-blue); font-weight: 900; text-transform: uppercase; font-size: .7rem; cursor: pointer; padding: 0; font-family: var(--font-body); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.tabs button {
  flex: none; border: 0; background: var(--white); color: var(--steel-blue);
  padding: .6rem 1rem; border-radius: 999px; font-family: var(--font-body); font-weight: 700;
  cursor: pointer; font-size: .85rem; box-shadow: inset 0 0 0 1px var(--n4);
}
.tabs button.on { background: var(--plexus-blue); color: var(--white); box-shadow: none; }
.panel { background: var(--white); border-radius: var(--radius); padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04); margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1.1fr .9fr; align-items: start; } }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: .8rem; font-weight: 700; color: var(--steel-blue); margin-bottom: 4px; }
.field small { display: block; color: var(--n2); font-size: .75rem; margin-top: 3px; }
.field input, .field select {
  width: 100%; font: inherit; font-size: 16px; padding: .7rem .8rem;
  border: 1px solid var(--n3); border-radius: 10px; background: var(--white); color: var(--n1);
}
.field input:focus { outline: 2px solid var(--bright-blue); border-color: transparent; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--n2); font-size: .85rem; }
.note { border-radius: 10px; padding: 12px 14px; font-size: .9rem; line-height: 1.45; margin: 0 0 14px; }
.note.info { background: #EAF2FB; color: var(--plexus-blue); }
.note.warn { background: #FFF4E0; color: var(--warn); }
.note.ok { background: #E6F4EC; color: var(--ok); }
.preview-frame { border-radius: 22px; overflow: hidden; border: 1px solid var(--n4); max-width: 380px; margin: 0 auto; }
.preview-frame .pc { min-height: 0; box-shadow: none; }
.qr-box { background: var(--white); padding: 18px; border-radius: 12px; border: 1px solid var(--n4); max-width: 320px; margin: 0 auto 14px; }
.qr-box svg { width: 100%; height: auto; display: block; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; color: var(--plexus-blue); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--bg); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-family: var(--font-head); font-weight: 500; font-size: 1.6rem; color: var(--plexus-blue); }
.kpi span { font-size: .78rem; color: var(--n2); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; color: var(--steel-blue); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; padding: 8px 6px; border-bottom: 2px solid var(--n4); }
td { padding: 10px 6px; border-bottom: 1px solid var(--n4); vertical-align: middle; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.pill.on { background: #E6F4EC; color: var(--ok); }
.pill.off { background: #F3E5E4; color: var(--danger); }
.bars { width: 100%; height: 140px; display: block; }
.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--plexus-blue);
}
.login .panel { max-width: 380px; width: 100%; text-align: center; padding: 28px 22px; }
.login img { height: 40px; margin: 0 auto 18px; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--plexus-blue); color: var(--white); padding: 10px 16px; border-radius: 999px;
  font-size: .9rem; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.hidden { display: none !important; }

/* ---------- Barra superior y QR en pantalla completa ---------- */
.bar-right { display: flex; align-items: center; gap: 12px; }
.qr-full {
  position: fixed; inset: 0; z-index: 100; background: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
  text-align: center;
}
.qr-full-close {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 16px;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--bg); color: var(--plexus-blue); font-size: 1.8rem; line-height: 1;
}
.qr-full-logo { height: 36px; width: auto; margin-bottom: 20px; }
.qr-full-code { width: min(82vw, 58vh, 420px); }
.qr-full-code svg { width: 100%; height: auto; display: block; }
.qr-full-name { font-family: var(--font-head); font-weight: 500; color: var(--plexus-blue); font-size: 1.5rem; margin: 18px 0 2px; }
.qr-full-role { color: var(--steel-blue); font-weight: 700; margin: 0 0 14px; }
.qr-full-hint { color: var(--n2); font-size: .9rem; margin: 0; max-width: 32ch; }
