.ndh-hero{
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(1200px 420px at 18% 0%, rgba(255,255,255,.08), transparent 55%),
    radial-gradient(900px 360px at 85% 10%, rgba(255,140,0,.10), transparent 55%),
    rgba(2,6,23,.78);
  box-shadow: 0 18px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 1.1rem 1.1rem;
  margin-bottom: 1rem;
}

.ndh-hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
}

.ndh-hero h1{
  margin:0;
  letter-spacing:-.02em;
}

.ndh-hero p{
  margin:.25rem 0 0;
  color: var(--text-muted);
}

.ndh-hero-actions{
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
}

.ndh-pill{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.35rem .6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(15,23,42,.35);
  color: var(--text-main);
  font-size: .82rem;
  text-decoration:none;
  white-space:nowrap;
}

.ndh-pill:hover{
  text-decoration:none;
}

.ndh-divider{
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  margin: 1rem 0;
}

.ndh-section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  flex-wrap:wrap;
  margin:.2rem 0 .6rem;
}

.ndh-section-head h3{
  margin:0;
  font-size:.86rem;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: var(--text-muted);
  display:flex;
  align-items:center;
  gap:.55rem;
}

.ndh-section-head .count{
  color: var(--text-muted);
  font-size:.85rem;
}

.ndh-biz-card{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(900px 320px at 12% 0%, rgba(255,255,255,.06), transparent 55%),
    rgba(2,6,23,.70);
  box-shadow: 0 14px 55px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  overflow:hidden;
}

.ndh-biz-card:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 18px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
}

.ndh-biz-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.85rem;
  flex-wrap:wrap;
}

.ndh-meta{
  display:flex;
  gap:.4rem;
  align-items:center;
  flex-wrap:wrap;
  margin-top:.35rem;
}

.ndh-meta small{
  color: var(--text-muted);
  font-size:.78rem;
}

.ndh-badge{
  display:inline-flex;
  align-items:center;
  padding:.18rem .5rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(15,23,42,.35);
  color: var(--text-muted);
  font-size:.72rem;
  letter-spacing:.02em;
}

.ndh-enter{
  display:flex;
  justify-content:flex-end;
}

.ndh-card-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:1rem;
  flex-wrap:wrap;
  width:100%;
}

.ndh-card-head .left{
  min-width:260px;
}

.ndh-card-head .right{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:.55rem;
  flex-wrap:wrap;
}

.ndh-quick{
  display:flex;
  gap:.45rem;
  flex-wrap:wrap;
  margin-top:.75rem;
}

.ndh-quick a{
  text-decoration:none;
}

.ndh-discover-categories{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
  align-items:flex-start;
}

.ndh-discover-form{
  display:grid;
  gap:.75rem;
}

.ndh-discover-switch-row{
  display:flex;
  gap:.75rem 1rem;
  flex-wrap:wrap;
  align-items:center;
}

.ndh-discover-switch{
  display:inline-flex;
  align-items:center;
  gap:.65rem;
  cursor:pointer;
  user-select:none;
  min-width:0;
  position:relative;
}

.ndh-discover-switch input{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
  pointer-events:none;
}

.ndh-discover-switch .ndh-switch-track{
  display:inline-block;
  position:relative;
  width:48px;
  height:26px;
  border-radius:999px;
  background:#6b7280;
  border:1px solid rgba(255,255,255,.25);
  transition:background .2s ease;
  flex:0 0 48px;
}

.ndh-discover-switch .ndh-switch-track::after{
  content:"";
  position:absolute;
  top:2px;
  left:2px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  transition:transform .2s ease, background .2s ease;
}

.ndh-discover-switch input:checked + .ndh-switch-track{
  background:var(--accent);
}

.ndh-discover-switch input:checked + .ndh-switch-track::after{
  transform:translateX(22px);
}

.ndh-discover-switch .ndh-switch-text{
  font-weight:700;
  color:var(--text-main);
  white-space:normal;
  line-height:1.25;
}

.ndh-discover-sort-row{
  margin:0;
  max-width:320px;
}

.ndh-discover-actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
}

.ndh-discover-grid{
  display:grid;
  gap:.9rem;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
}

.ndh-discover-grid > .card{
  min-width:0;
  height:100%;
  display:flex;
  flex-direction:column;
  margin-top:0;
}

@media (max-width: 640px){
  .ndh-hero-actions{
    width:100%;
  }

  .ndh-hero-actions .btn,
  .ndh-hero-actions .btn-ndh-outline{
    width:100%;
    justify-content:center;
    white-space:normal;
    line-height:1.2;
  }

  .ndh-enter{
    width:100%;
  }

  .ndh-enter .btn,
  .ndh-enter .btn-ndh-outline{
    width:100%;
    justify-content:center;
  }

  .ndh-card-head .left,
  .ndh-card-head .right{
    width:100%;
  }

  .ndh-card-head .right{
    justify-content:flex-start;
  }

  .ndh-discover-categories,
  .ndh-discover-switch-row,
  .ndh-discover-actions{
    width:100%;
  }

  .ndh-discover-categories .btn-ndh-outline,
  .ndh-discover-actions .btn,
  .ndh-discover-actions .btn-ndh-outline{
    width:100%;
    justify-content:center;
    white-space:normal;
    line-height:1.2;
  }

  .ndh-discover-switch{
    width:100%;
    align-items:flex-start;
  }

  .ndh-discover-sort-row{
    max-width:none;
    width:100%;
  }

  .ndh-discover-sort-row select{
    width:100%;
  }

  .ndh-discover-grid{
    grid-template-columns:1fr;
  }
}

.ndh-mt-65 { margin-top: .65rem; }
.ndh-mt-90 { margin-top: .9rem; }
.ndh-mt-50 { margin-top: .5rem; }
.ndh-m-0 { margin: 0; }
.ndh-title-sm { font-size: 1.05rem; }
.ndh-text-muted-sm { font-size: .82rem; color: var(--text-muted); }
.ndh-text-muted { color: var(--text-muted); }
.ndh-note { font-size: .9rem; color: var(--text-muted); margin-top: .5rem; }
.ndh-biz-title-row { margin: .55rem 0 .2rem; }

.ndh-muted-inline {
  color: var(--text-muted);
}

.ndh-section-head-tight {
  margin-top: .35rem;
}

.ndh-biz-copy {
  margin: 0;
  font-size: .82rem;
  color: var(--text-muted);
}

.ndh-stat-grid-spaced {
  margin-top: .9rem;
}

.ndh-empty-note {
  font-size: .9rem;
  color: var(--text-muted);
  margin-top: .5rem;
}

.ndh-upload-row{
  display:flex;
  align-items:center;
  gap:.65rem;
  flex-wrap:wrap;
  min-width:0;
}

.ndh-upload-name{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.45rem .85rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(15,23,42,.36);
  color: var(--text-muted);
  font-size: .84rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="file"].ndh-file-hidden{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  overflow:hidden;
}

/* ===========================================================================
   Identidad de NDH (Configuración de Cuenta)
   Nombre de usuario + ID permanente. Clases propias para no tocar el resto
   de la página de ajustes.
   =========================================================================== */
.ndh-identity-block{
  display:flex;
  flex-direction:column;
  gap:.4rem;
}

.ndh-identity-block + .ndh-identity-block{
  margin-top:1.4rem;
  padding-top:1.4rem;
  border-top:1px solid var(--border-subtle);
}

.ndh-identity-value{
  margin:0;
  font-size:1.18rem;
  font-weight:600;
  color:var(--accent);
  /* Un nombre puede llegar a 30 caracteres: en móvil tiene que partirse en
     lugar de ensanchar la tarjeta. */
  overflow-wrap:anywhere;
}

.ndh-identity-empty{
  margin:0;
  color:var(--text-muted);
}

.ndh-identity-help{
  color:var(--text-muted);
  line-height:1.45;
}

.ndh-identity-cooldown{
  color:var(--accent);
}

.ndh-identity-copied:not(:empty){
  color:var(--accent);
  font-weight:600;
}

.ndh-identity-form{
  display:flex;
  flex-direction:column;
  gap:.6rem;
  align-items:flex-start;
  margin-top:.5rem;
}

/* La arroba es decorativa y vive fuera del valor que se envía. */
.ndh-username-field{
  display:flex;
  align-items:stretch;
  width:100%;
  max-width:22rem;
  border:1px solid var(--border-subtle);
  border-radius:.55rem;
  background:rgba(15,23,42,.36);
  overflow:hidden;
}

.ndh-username-at{
  display:flex;
  align-items:center;
  padding:0 0 0 .7rem;
  color:var(--text-muted);
  font-weight:600;
  user-select:none;
}

.ndh-username-field input{
  /* `min-width:0` es lo que impide que un flex item con input se desborde. */
  flex:1 1 auto;
  min-width:0;
  border:0;
  background:transparent;
  /* Casi pegado a la arroba, para que se lea "@nombre" y no "@  nombre". */
  padding:.55rem .7rem .55rem .1rem;
}

.ndh-username-field input:focus{
  outline:none;
}

.ndh-username-field:focus-within{
  border-color:var(--accent);
}

.ndh-identity-id-row{
  display:flex;
  gap:.5rem;
  align-items:center;
  flex-wrap:wrap;
  width:100%;
}

.ndh-identity-id-row input{
  flex:1 1 16rem;
  min-width:0;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing:.02em;
}

.ndh-identity-copy,
.ndh-identity-reveal{
  flex:0 0 auto;
}

@media (max-width: 640px){
  .ndh-username-field{
    max-width:100%;
  }

  .ndh-identity-form .btn-ndh-outline{
    width:100%;
    justify-content:center;
  }

  .ndh-identity-id-row input{
    /* A 390px el ID (23 caracteres) no cabe junto al botón: ocupa su propia
       línea y los botones bajan debajo, en vez de provocar scroll
       horizontal. */
    flex:1 1 100%;
    font-size:.95rem;
  }

  /* Mostrar y Copiar comparten la fila de abajo, a mitad y mitad: dos
     botones a ancho completo harían la tarjeta innecesariamente larga. */
  .ndh-identity-copy,
  .ndh-identity-reveal{
    flex:1 1 0;
    justify-content:center;
  }
}

/* Privacidad de Invitaciones: tres interruptores independientes.
   Reutiliza el componente .ndh-switch de ndh-base.css (el mismo patrón que
   ya usa retail/warehouses/edit.html): un checkbox nativo con appearance:none
   estilizado como perilla, sin marcado ni JavaScript adicionales. */
.ndh-invite-privacy{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.ndh-invite-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  cursor:pointer;
  /* Área de toque cómoda en móvil: toda la fila es parte de la <label>,
     no solo el interruptor de 44x24. */
  padding:.35rem 0;
}

.ndh-invite-toggle > span{
  display:flex;
  flex-direction:column;
  gap:.15rem;
  min-width:0;
  flex:1 1 auto;
}

.ndh-invite-toggle strong{
  font-weight:600;
  line-height:1.3;
}

.ndh-invite-toggle .ndh-switch{
  /* El estado real sigue siendo el checkbox nativo: foco visible de serie
     (outline del navegador), y los lectores de pantalla lo anuncian como
     casilla marcada/sin marcar sin necesitar role="switch" + JS que lo
     mantenga sincronizado. */
  flex-shrink:0;
}

@media (max-width: 480px){
  .ndh-invite-toggle{
    /* Debajo de ~480px el texto más largo ("Permitir Invitaciones por
       Nombre de Usuario") y el interruptor de 44px ya no caben cómodos en
       una sola fila sin apretarse: se apilan, interruptor alineado a la
       izquierda bajo su propio texto, nunca envuelto a media frase. */
    flex-direction:column;
    align-items:flex-start;
    gap:.5rem;
  }
}
