/* Ajustes propios de la app única sobre la hoja del Painel (css/style.css): paneles embebidos,
   equipo, perfil y mensajes. Todo usa los mismos tokens (--red, --surface, --line...). */

.muted{color:var(--muted);font-size:.9rem}
.empty-state{color:var(--muted);font-size:.9rem;padding:18px 4px}
.success-msg{background:color-mix(in srgb,var(--green) 14%,transparent);color:var(--green-text);padding:10px 14px;border-radius:var(--radius-sm);font-size:.88rem;margin-bottom:14px}
.hub-home-grid{display:grid;gap:18px;margin-top:22px}

/* Perfil y equipo */
.profile-card{max-width:560px;margin-bottom:18px}
.profile-card h3,.team-card h3{font-size:1rem;color:var(--text-strong);margin-bottom:14px}
.profile-card .form-grid .btn{justify-self:start;margin-top:6px}
.table-scroll{overflow-x:auto}
.team-card{max-width:760px;margin-top:18px}
.team-form{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));align-items:center}
.team-form .btn{justify-self:start}
.team-check{display:flex;align-items:center;gap:8px;font-size:.88rem}
.team-grant{display:inline-flex;align-items:center;gap:6px;background:var(--surface-2);border:1px solid var(--line);border-radius:999px;padding:2px 4px 2px 10px;font-size:.78rem;margin:2px 4px 2px 0;color:var(--ink-2)}
.team-grant-x{border:none;background:none;color:var(--red-text);cursor:pointer;font-size:.95rem;line-height:1;padding:2px 6px;border-radius:999px}
.team-grant-x:hover{background:color-mix(in srgb,var(--red) 14%,transparent)}
.btn--sm{padding:6px 14px;font-size:.78rem}
.form-grid select{width:100%;padding:10px 12px;border:1.5px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink-2)}

/* Paneles embebidos: los iframes viven en #frames (fuera del shell) para no recargarse. */
.frames{position:fixed;top:0;bottom:0;right:0;left:64px;z-index:1;display:none;background:var(--bg)}
.frames.on{display:block}
.frames iframe{width:100%;height:100%;border:0;display:none;background:var(--bg)}
.frames iframe.on{display:block}
.embed-topbar{display:none}

@media (min-width:821px){
  /* Con un panel abierto el menú del hub se vuelve un riel de íconos (el panel trae su propio menú). */
  .app-shell.is-embedded{grid-template-columns:64px 1fr}
  .app-shell.is-embedded .app-sidebar{padding:20px 10px;align-items:center;position:relative;z-index:60}
  .app-shell.is-embedded .app-logo,
  .app-shell.is-embedded .app-logo-sub,
  .app-shell.is-embedded .app-nav-label,
  .app-shell.is-embedded .profile-trigger-info,
  .app-shell.is-embedded .profile-trigger-chevron{display:none}
  .app-shell.is-embedded .app-nav{align-items:center}
  .app-shell.is-embedded .app-nav button{justify-content:center;padding:11px}
  .app-shell.is-embedded .app-nav button.active::before{left:-10px}
  .app-shell.is-embedded .profile-trigger{padding:6px;justify-content:center}
  .app-shell.is-embedded .profile-panel{position:fixed;left:74px;right:auto;bottom:16px;width:260px}
  .app-shell.is-embedded .top-bar-float{display:none}
}

@media (max-width:820px){
  .frames{left:0;top:52px}
  .embed-topbar{display:flex;position:fixed;top:0;left:0;right:0;height:52px;z-index:180;align-items:center;justify-content:space-between;gap:10px;padding:0 14px 0 72px;background:var(--ink);color:#fff}
  .embed-topbar-title{font-weight:700;font-size:.95rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .embed-topbar .lang-switch-float button{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.2);color:rgba(255,255,255,.7);box-shadow:none}
  .embed-topbar .lang-switch-float button.active{background:#fff;color:var(--ink);border-color:#fff}
  .app-shell.is-embedded .mobile-menu-toggle{top:4px;left:8px;width:44px;height:44px;background:transparent;box-shadow:none}
}

.status-pill{white-space:nowrap}

/* ===================================================================================================
   Móvil / app instalada en el iPhone (PWA con barra de estado translúcida)
   - Márgenes seguros (notch / barra de estado / indicador de inicio) en TODA pantalla.
   - Toques de al menos 44px. - 100dvh para que la barra de Safari no tape el fondo.
   =================================================================================================== */
:root{--sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px);--sal:env(safe-area-inset-left,0px);--sar:env(safe-area-inset-right,0px)}
.auth-shell{min-height:100vh;min-height:100dvh}
.auth-remember{display:flex;align-items:center;gap:10px;margin-top:12px;padding:6px 0;font-size:.88rem;color:rgba(255,255,255,.7)}
.auth-remember input{width:18px!important;height:18px;flex-shrink:0}
.team-table td .team-grants{display:flex;flex-wrap:wrap;gap:4px}

@media (max-width:820px){
  /* login / registro / recuperar */
  .auth-shell{padding:calc(24px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal))}
  .auth-card{padding:24px 20px}
  .auth-tabs button{padding:13px 0}
  .auth-label-row{align-items:center}
  .auth-inline-link{padding:12px 0 12px 12px;font-size:.82rem}
  .password-toggle{width:44px;height:44px;right:0;padding:0;display:flex;align-items:center;justify-content:center}
  .auth-lang-switch button{padding:11px 22px;min-height:44px}
  .auth-link-row button,.auth-link-row a{display:inline-block;padding:12px 10px}
  .auth-remember input{width:22px!important;height:22px}
  .btn{min-height:44px}
  .btn--sm{min-height:40px;padding:8px 16px}

  /* shell: botón de menú, cajón, contenido y PT/ES respetan la barra de estado */
  .mobile-menu-toggle{top:calc(8px + var(--sat));left:calc(10px + var(--sal))}
  .app-sidebar{height:100vh;height:100dvh;padding-top:calc(76px + var(--sat));padding-bottom:calc(24px + var(--sab))}
  .app-nav button{padding:13px 12px;min-height:46px}
  .app-main{padding:calc(72px + var(--sat)) calc(16px + var(--sar)) calc(28px + var(--sab)) calc(16px + var(--sal))}
  .top-bar-float{top:calc(10px + var(--sat));right:calc(12px + var(--sar))}
  .lang-switch-float button{padding:10px 15px;min-height:40px}
  .dash-link{padding:12px 4px}
  .profile-menu-item{padding:12px 8px}
  .theme-switch button{min-height:44px}

  /* panel abierto: barra fina con el botón de apps del hub (los paneles traen su propio menú e idioma) */
  .embed-topbar{height:calc(48px + var(--sat));padding:var(--sat) 14px 0 calc(64px + var(--sal))}
  .embed-topbar-title{font-size:.9rem;letter-spacing:.01em}
  .frames{top:calc(48px + var(--sat));bottom:var(--sab)}
  .app-shell.is-embedded .mobile-menu-toggle{top:calc(2px + var(--sat));left:calc(6px + var(--sal));color:#fff}

  /* Equipo: cada persona como una tarjeta en vez de una tabla que se desborda */
  .team-table thead{display:none}
  .team-table,.team-table tbody{display:block;width:100%;min-width:0}   /* .data-table trae min-width:520px: forzaba el desborde */
  .team-table tr{display:block;padding:14px 0;border-bottom:1px solid var(--line)}
  .team-table tr:last-child{border-bottom:none}
  .team-table td{min-width:0;display:flex;justify-content:space-between;align-items:flex-start;gap:14px;border:none;padding:6px 0;text-align:right;white-space:normal;word-break:break-word}
  .team-table td::before{content:attr(data-label);flex-shrink:0;color:var(--muted);font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;text-align:left;padding-top:3px}
  .team-table td .team-grants{justify-content:flex-end}
  .team-grant-x{min-width:36px;min-height:36px}
  .team-check{padding:10px 0}
  .team-check input{width:22px!important;height:22px}
  .team-form{grid-template-columns:1fr}
  .team-form .btn{justify-self:stretch}
  .profile-card .form-grid .btn{justify-self:stretch}
}

/* Foto del perfil único */
img.profile-avatar{object-fit:cover;background:var(--surface-2)}
.profile-hero{display:flex;align-items:center;gap:16px;margin-bottom:18px}
.profile-avatar--lg{width:72px;height:72px;font-size:1.3rem;flex-shrink:0}
