/*
 * Panel de Dicard Empresas (/empresa/<slug>/panel).
 * Mobile first: una columna a 375px; en escritorio el equipo pasa a una columna propia.
 * Marca: Naranja Señal solo en la acción principal y en las barras de progreso (ver brand.css).
 */

:root {
  --pn-bg: #f5f5f7;
  --pn-card: #fff;
  --pn-ink: #1d1d1f;
  --pn-ink-2: #424245;
  --pn-muted: #6e6e73;
  --pn-line: #d2d2d7;
  --pn-hair: rgba(0, 0, 0, .08);
  --pn-fill: #f2f2f4;
  /* Marca vigente: botón principal negro; Azul Proximitty solo en foco, progreso y selección. */
  --pn-signal: #0071e3;
  --pn-primary: #1d1d1f;
  --pn-primary-hover: #000;
  --pn-signal-ink: #424245;
  --pn-ok: #1f7a4a;
  --pn-warn: #b45309;
  --pn-danger: #c62828;
  --pn-gray: #8e8e93;
  --pn-gutter: 16px;
  --pn-radius: 22px;
  --pn-ease: cubic-bezier(.22, .8, .24, 1);
  --pn-font: "Archivo", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--pn-bg); }
body.pn {
  min-height: 100vh;
  margin: 0;
  background: var(--pn-bg);
  color: var(--pn-ink);
  font-family: var(--pn-font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.pn.is-locked { overflow: hidden; }
:where(.pn) :where(h1, h2, p, ol, ul) { margin: 0; }
:where(.pn) :where(ol, ul) { padding: 0; list-style: none; }
/* :where() deja estos estilos base sin peso: cualquier clase de componente los sobrescribe. */
:where(.pn) a { color: inherit; text-decoration: none; }
:where(.pn) :where(button, input) { font: inherit; color: inherit; }
:where(.pn) button { cursor: pointer; }
.pn :focus-visible { outline: 2px solid var(--pn-signal); outline-offset: 2px; border-radius: 8px; }
.pn-wrap { width: min(100% - var(--pn-gutter) * 2, 1080px); margin-inline: auto; }

/* ── Encabezado ── */
.pn-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 245, 247, .86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--pn-hair);
}
.pn-header__bar { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.pn-brand { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.pn-brand img { width: 88px; height: auto; }
.pn-brand span { padding-left: 9px; border-left: 1px solid var(--pn-line); font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.pn-account-btn {
  width: 40px; height: 40px; margin-right: -2px;
  border: 0; border-radius: 50%;
  background: var(--pn-ink); color: #fff;
  font-size: 16px; font-weight: 650;
  display: grid; place-items: center;
}

/* ── Saludo ── */
.pn-main { padding: 24px 0 calc(48px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pn-hello { padding: 4px 4px 0; }
.pn-eyebrow { color: var(--pn-muted); font-size: 13px; font-weight: 500; }
.pn-title { margin-top: 2px; font-size: 30px; line-height: 1.12; font-weight: 650; letter-spacing: -.03em; overflow-wrap: anywhere; }
.pn-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.pn-chip { padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .06); color: var(--pn-ink-2); font-size: 12px; font-weight: 600; }
.pn-chip--demo { background: #fff4e5; color: var(--pn-warn); }

/* ── Avisos ── */
.pn-notice {
  padding: 14px 16px;
  border-radius: 18px;
  display: grid; gap: 10px;
  font-size: 14px; line-height: 1.45;
  background: var(--pn-card);
  box-shadow: inset 4px 0 0 var(--pn-notice-accent, var(--pn-ink));
}
.pn-notice b { font-weight: 650; }
.pn-notice--info { --pn-notice-accent: var(--pn-ink); }
.pn-notice--ok { --pn-notice-accent: var(--pn-ok); }
.pn-notice--warn { --pn-notice-accent: var(--pn-warn); }
.pn-notice--danger { --pn-notice-accent: var(--pn-danger); }
.pn-notice__action {
  justify-self: start;
  min-height: 40px; padding: 0 16px;
  border: 0; border-radius: 999px;
  display: inline-flex; align-items: center;
  background: var(--pn-ink); color: #fff !important;
  font-size: 14px; font-weight: 600;
}
.pn-notice--danger .pn-notice__action { background: var(--pn-danger); }

/* ── Tarjetas ── */
/* minmax(0, 1fr): un nombre largo sin cortes no debe ensanchar la columna en móvil. */
.pn-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pn-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.pn-card { padding: 20px; border-radius: var(--pn-radius); background: var(--pn-card); }
.pn-card__title { font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.pn-subtitle { margin-top: 18px; color: var(--pn-muted); font-size: 13px; font-weight: 600; }
.pn-note { margin-top: 10px; color: var(--pn-muted); font-size: 13px; line-height: 1.4; }
.pn-note strong { color: inherit; font-weight: 600; }
.pn-muted { color: var(--pn-muted); font-size: 14px; }
.pn-error { min-height: 0; color: var(--pn-danger); font-size: 13px; }
.pn-error:not(:empty) { margin-top: 10px; }

/* ── Botones ── */
.pn-btn {
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; text-align: center;
  transition: background .2s, transform .2s var(--pn-ease), opacity .2s;
}
.pn-btn:active:not(:disabled) { transform: scale(.98); }
.pn-btn:disabled, .pn-btn.is-disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.pn-btn--block { width: 100%; }
.pn-btn--primary { background: var(--pn-primary); color: #fff; }
.pn-btn--primary:hover:not(:disabled) { background: var(--pn-primary-hover); }
.pn-btn--soft { background: var(--pn-fill); color: var(--pn-ink); }
.pn-btn--soft:hover { background: #e8e8ed; }
.pn-btn--danger { background: var(--pn-danger); color: #fff; }
.pn-btn--danger-text { min-height: 44px; background: none; color: var(--pn-danger); }

/* ── Cupos ── */
.pn-seats__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pn-seats__count { color: var(--pn-muted); font-size: 14px; white-space: nowrap; }
.pn-seats__count b { color: var(--pn-ink); font-weight: 650; }
.pn-progress { height: 8px; margin-top: 14px; border-radius: 999px; background: var(--pn-fill); overflow: hidden; }
.pn-progress i { display: block; height: 100%; border-radius: inherit; background: var(--pn-signal); transition: width .6s var(--pn-ease); }
.pn-seats__hint { margin: 10px 0 18px; color: var(--pn-muted); font-size: 14px; }

.pn-invite { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--pn-fill); }
.pn-invite[hidden] { display: none; }
.pn-invite__label { font-size: 13px; font-weight: 650; }
.pn-invite__url {
  margin-top: 6px;
  color: var(--pn-ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  overflow-wrap: anywhere;
}
.pn-invite__actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pn-invite__actions .pn-btn { min-height: 44px; background: var(--pn-card); }
.pn-invite__help { margin-top: 10px; color: var(--pn-muted); font-size: 12.5px; }

/* ── Accesos ── */
.pn-links { padding: 6px 20px; display: grid; }
.pn-link {
  min-height: 68px; padding: 0;
  border: 0; background: none;
  display: flex; align-items: center; gap: 14px;
  text-align: left; width: 100%;
}
.pn-link + .pn-link { border-top: 1px solid var(--pn-hair); }
.pn-link.is-disabled { opacity: .4; cursor: not-allowed; }
.pn-link::after {
  content: ""; margin-left: auto; flex: none;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--pn-gray); border-top: 1.5px solid var(--pn-gray);
  transform: rotate(45deg);
}
.pn-link__icon { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--pn-fill); display: grid; place-items: center; }
.pn-link__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--pn-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pn-link__icon circle { fill: var(--pn-ink); stroke: none; }
.pn-link__text b { display: block; font-size: 15px; font-weight: 600; }
.pn-link__text small { display: block; color: var(--pn-muted); font-size: 13px; }

/* ── Métricas ── */
.pn-stats { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pn-stat { padding: 14px; border-radius: 16px; background: var(--pn-fill); }
.pn-stat b { display: block; font-size: 28px; line-height: 1.1; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pn-stat span { color: var(--pn-muted); font-size: 12.5px; }
.pn-bars { margin-top: 8px; display: grid; gap: 2px; }
.pn-bars li { min-height: 36px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr) 32px; align-items: center; gap: 10px; }
.pn-bars__name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-bars__track { height: 6px; border-radius: 999px; background: var(--pn-fill); overflow: hidden; }
.pn-bars__track i { display: block; height: 100%; border-radius: inherit; background: var(--pn-ink); }
.pn-bars__value { color: var(--pn-muted); font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Equipo ── */
.pn-team { padding-bottom: 8px; }
.pn-team__head { display: flex; align-items: baseline; justify-content: space-between; }
.pn-team__count { color: var(--pn-muted); font-size: 14px; }
.pn-members { margin: 8px -12px 0; }
.pn-member {
  width: 100%; min-height: 72px; padding: 10px 12px;
  border: 0; border-radius: 16px; background: none;
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  transition: background .15s;
}
.pn-member:hover { background: var(--pn-fill); }
.pn-member:active { background: #ebebf0; }
.pn-members li { position: relative; }
/* Divisor recto que arranca después del avatar, como en las listas de iOS. */
.pn-members li + li::before { content: ""; position: absolute; top: 0; left: 68px; right: 12px; height: 1px; background: var(--pn-hair); }
.pn-member__text { flex: 1; min-width: 0; }
.pn-member__text b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-member__text small { display: block; color: var(--pn-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-chevron { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--pn-gray); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.pn-avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: #e5e5ea; color: var(--pn-ink-2);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 650;
  overflow: hidden;
}
.pn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pn-avatar--lg { width: 52px; height: 52px; font-size: 19px; }

.pn-status { margin-top: 3px; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--pn-muted); }
.pn-status::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--pn-status, var(--pn-gray)); }
.pn-status--green { --pn-status: var(--pn-ok); color: var(--pn-ok); }
.pn-status--yellow { --pn-status: #d97706; }
.pn-status--red { --pn-status: var(--pn-danger); }
.pn-status--gray { --pn-status: var(--pn-gray); }

.pn-empty { margin-top: 12px; padding: 28px 20px; border-radius: 16px; background: var(--pn-fill); text-align: center; color: var(--pn-muted); font-size: 14px; }
.pn-empty__title { margin-bottom: 4px; color: var(--pn-ink); font-size: 16px; font-weight: 600; }

/* ── Hojas: suben desde abajo en móvil, centradas en escritorio ── */
.pn-sheet {
  width: 100%; max-width: 100%;
  max-height: calc(100dvh - 32px);
  margin: auto 0 0; padding: 0;
  border: 0; border-radius: 24px 24px 0 0;
  background: var(--pn-card); color: var(--pn-ink);
  font-family: var(--pn-font);
  overflow-y: auto; overscroll-behavior: contain;
}
.pn-sheet::backdrop { background: rgba(0, 0, 0, .4); }
.pn-sheet[open] { animation: pn-sheet-in .32s var(--pn-ease); }
@keyframes pn-sheet-in { from { transform: translateY(40px); opacity: 0; } }
.pn-sheet__body { padding: 22px 20px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.pn-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pn-sheet__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pn-sheet__who > div { min-width: 0; }
.pn-sheet__title { font-size: 21px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pn-sheet__sub { margin-top: 2px; color: var(--pn-muted); font-size: 14px; overflow-wrap: anywhere; }
.pn-sheet__sub:empty { display: none; }
.pn-sheet__close {
  width: 36px; height: 36px; flex: none; margin: -4px -6px 0 0;
  border: 0; border-radius: 50%;
  background: var(--pn-fill);
  font-size: 22px; line-height: 1;
}
.pn-sheet .pn-stats { margin-top: 2px; }
.pn-sheet .pn-subtitle { margin-top: 6px; }
.pn-sheet .pn-bars { margin-top: 0; }
.pn-sheet__actions { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pn-btn--wide { grid-column: 1 / -1; }
.pn-sheet__row { margin-top: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pn-copy-fallback { display: grid; gap: 6px; font-size: 13px; color: var(--pn-muted); }
.pn-copy-fallback[hidden] { display: none; }
.pn-copy-fallback input { height: 44px; padding: 0 12px; border: 1px solid var(--pn-line); border-radius: 12px; font-size: 14px !important; }

.pn-field { display: grid; gap: 6px; }
.pn-field span { font-size: 13px; font-weight: 600; color: var(--pn-ink-2); }
.pn-field input {
  width: 100%; height: 50px; padding: 0 14px;
  border: 1px solid var(--pn-line); border-radius: 14px;
  background: var(--pn-card); font-size: 16px;
}
.pn-field input:focus { outline: none; border-color: var(--pn-signal); box-shadow: 0 0 0 3px rgba(0, 113, 227, .18); }

.pn-menu { margin: 4px -8px 0; display: grid; }
.pn-menu > * {
  min-height: 52px; padding: 0 8px;
  border: 0; background: none; border-radius: 12px;
  display: flex; align-items: center;
  font-size: 16px; font-weight: 500; text-align: left;
}
.pn-menu > * + * { border-top: 1px solid var(--pn-hair); border-radius: 0; }
.pn-menu > *:hover { background: var(--pn-fill); }

/* ── Aviso flotante ── */
.pn-toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 999px;
  background: var(--pn-ink); color: #fff;
  font-size: 14px; font-weight: 500;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--pn-ease);
}
.pn-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── Recorrido ── */
.pn-tour { position: fixed; inset: 0; z-index: 50; }
.pn-tour[hidden] { display: none; }
.pn-tour__ring {
  position: fixed; border-radius: 22px;
  box-shadow: 0 0 0 3px var(--pn-signal), 0 0 0 100vmax rgba(0, 0, 0, .55);
  /* Sin transición en top/left: el anillo sigue el scroll cuadro a cuadro. */
  transition: width .25s var(--pn-ease), height .25s var(--pn-ease);
  pointer-events: none;
}
.pn-tour__ring.is-center { top: 50%; left: 50%; width: 0; height: 0; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); }
.pn-tour__card {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 420px; margin-inline: auto;
  padding: 20px; border-radius: 22px;
  background: var(--pn-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.pn-tour__step { color: var(--pn-signal-ink); font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.pn-tour__title { margin-top: 4px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.pn-tour__text { margin-top: 6px; color: var(--pn-ink-2); font-size: 15px; }
.pn-tour__foot { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pn-tour__skip { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--pn-muted); font-size: 15px; }
.pn-tour__foot .pn-btn { min-height: 44px; }

/* ── Acceso al panel (login.html) ── */
.pn-login { padding: 32px 0 calc(48px + env(safe-area-inset-bottom)); }
.pn-login__card { max-width: 440px; margin-inline: auto; padding: 28px 22px 22px; }
.pn-login__badge {
  width: 48px; height: 48px; margin-bottom: 18px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--pn-ink); color: #fff;
  font-size: 20px; font-weight: 650;
}
.pn-login__lede { margin-top: 8px; color: var(--pn-muted); font-size: 15px; }
.pn-login__notice { margin-top: 18px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.pn-login__notice b { font-weight: 650; }
.pn-login__notice--error { background: #fdecec; color: var(--pn-danger); }
.pn-login__notice--ok { background: #e9f5ee; color: var(--pn-ok); }
.pn-login__cta { margin-top: 18px; }
.pn-login__form .pn-error:empty { display: none; }
.pn-login__form .pn-error:not(:empty) { margin-top: -6px; }
.pn-login__form { margin-top: 22px; display: grid; gap: 16px; }
.pn-login__password { position: relative; display: block; }
.pn-login__password input { padding-right: 52px; }
.pn-login__toggle {
  position: absolute; right: 4px; top: 50%;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: none;
  color: var(--pn-muted);
  display: grid; place-items: center;
  transform: translateY(-50%);
}
.pn-login__toggle[aria-pressed="true"] { color: var(--pn-ink); }
.pn-login__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pn-login__links { margin-top: 14px; display: grid; justify-items: center; }
.pn-login__links a {
  min-height: 44px; display: inline-flex; align-items: center;
  color: var(--pn-ink-2); font-size: 14px;
  text-decoration: underline; text-decoration-color: var(--pn-line); text-underline-offset: 3px;
}

/* ── Pantallas pequeñas (320px) ── */
@media (max-width: 359px) {
  :root { --pn-gutter: 12px; }
  .pn-card { padding: 18px 16px; }
  .pn-links { padding-inline: 16px; }
  .pn-title { font-size: 26px; }
  .pn-stat b { font-size: 24px; }
  .pn-sheet__actions { grid-template-columns: 1fr; }
}

/* ── Escritorio ── */
@media (min-width: 900px) {
  :root { --pn-gutter: 32px; }
  .pn-main { padding-top: 40px; gap: 20px; }
  .pn-title { font-size: 40px; }
  .pn-grid { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .pn-col { gap: 20px; }
  .pn-card { padding: 24px; }
  .pn-links { padding: 6px 24px; }
  .pn-notice { grid-template-columns: 1fr auto; align-items: center; padding: 14px 18px 14px 22px; }
  .pn-sheet {
    width: min(480px, calc(100% - 48px));
    margin: auto;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .2);
  }
  .pn-sheet__body { padding: 26px; }
  .pn-tour__card { left: auto; right: 32px; bottom: 32px; width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  .pn *, .pn *::before, .pn *::after, .pn-sheet[open] { transition-duration: .01ms !important; animation: none !important; }
}
