/* ==========================================================================
   PULSO SHELL — CSS compartilhado (tokens + layout)
   Versão: 2026-04-21
   Usado em: painel.html, check-in.html, biblioteca.html, canal.html, perfil.html
   ========================================================================== */

:root {
  --pulso-roxo: #9f00ff;
  --pulso-ciano: #00bcd4;
  --pulso-pink: #ff0073;
  --pulso-lime: #84cc16;
  --pulso-bg: #0a0a0f;
  --pulso-bg-elevated: #1a1a24;
  --pulso-bg-elevated-2: #232332;
  --pulso-text: #F4F4F8;
  --pulso-text-muted: #A0A0B8;
  --pulso-border: rgba(160, 160, 184, 0.10);
  --pulso-border-strong: rgba(160, 160, 184, 0.22);

  --pulso-gradient-main: linear-gradient(135deg, #9f00ff 0%, #00bcd4 100%);
  --pulso-gradient-urgent: linear-gradient(135deg, #ff0073 0%, #9f00ff 100%);
  --pulso-gradient-ambient: radial-gradient(circle, rgba(159, 0, 255, 0.18) 0%, transparent 70%);
  --pulso-gradient-lime: linear-gradient(135deg, #84cc16 0%, #00bcd4 100%);

  --pulso-font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --pulso-font-heading: 'Outfit', system-ui, sans-serif;
  --pulso-font-body: 'Inter', system-ui, sans-serif;
  --pulso-font-mono: 'Geist Mono', 'JetBrains Mono', monospace;
  --pulso-font-brand: 'Plus Jakarta Sans', system-ui, sans-serif;

  --pulso-radius-sm: 8px;
  --pulso-radius-md: 12px;
  --pulso-radius-lg: 16px;
  --pulso-radius-xl: 24px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --nav-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--pulso-bg);
  color: var(--pulso-text);
  font-family: var(--pulso-font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--pulso-ciano); outline-offset: 3px; border-radius: 4px; }

/* SHELL */
.shell {
  max-width: 100%; margin: 0 auto;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + var(--space-6));
}
@media (min-width: 1024px) {
  .shell { display: flex; flex-direction: row; min-height: 100vh; padding-bottom: 0; }
}

/* TOPBAR */
.topbar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); height: 72px;
  background: var(--pulso-bg);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--pulso-border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.avatar-wrap { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.avatar-ring { position: absolute; inset: -2px; border-radius: 50%; background: var(--pulso-gradient-main); filter: drop-shadow(0 0 8px rgba(159,0,255,0.35)); }
.avatar-inner { position: absolute; inset: 2px; border-radius: 50%; background: var(--pulso-bg-elevated); display: grid; place-items: center; font-family: var(--pulso-font-heading); font-weight: 700; font-size: 18px; color: var(--pulso-text); letter-spacing: -0.02em; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who-name { font-family: var(--pulso-font-heading); font-weight: 700; font-size: 16px; color: var(--pulso-text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-role { font-family: var(--pulso-font-mono); font-size: 11px; color: var(--pulso-text-muted); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; transition: background 160ms; flex-shrink: 0; }
.bell:hover { background: var(--pulso-bg-elevated); }
.bell svg { width: 22px; height: 22px; stroke: var(--pulso-text-muted); stroke-width: 1.8; fill: none; }

@media (min-width: 1024px) {
  .topbar { padding: var(--space-8) var(--space-8) var(--space-6); height: auto; min-height: 80px; position: static; border-bottom: 1px solid var(--pulso-border); }
  .who-name { font-size: 20px; }
  .who-role { font-size: 13px; }
}

/* SIDEBAR (desktop) */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .sidebar {
    display: flex; flex-direction: column; gap: var(--space-6);
    padding: var(--space-6); border-right: 1px solid #1e293b;
    background: var(--pulso-bg); position: sticky; top: 0;
    height: 100vh; width: 240px; flex-shrink: 0;
    overflow-y: auto; overflow-x: hidden;
  }
  .brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); margin-bottom: var(--space-4); }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--pulso-gradient-main); display: grid; place-items: center; font-family: var(--pulso-font-display); font-weight: 800; color: white; font-size: 18px; }
  .brand-name { font-family: var(--pulso-font-brand); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }
  .sidebar-nav { display: flex; flex-direction: column; gap: var(--space-1); }
  .sidebar-nav a {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--pulso-radius-md);
    color: var(--pulso-text-muted);
    font-family: var(--pulso-font-heading); font-weight: 500; font-size: 15px;
    transition: background 160ms, color 160ms;
  }
  .sidebar-nav a:hover { background: var(--pulso-bg-elevated); color: var(--pulso-text); }
  .sidebar-nav a.active {
    background: var(--pulso-bg-elevated); color: var(--pulso-text);
    font-weight: 600; position: relative;
  }
  .sidebar-nav a.active::before {
    content: ''; position: absolute; left: 0; top: 50%;
    transform: translateY(-50%); width: 3px; height: 24px;
    border-radius: 0 3px 3px 0; background: var(--pulso-gradient-main);
  }
  .sidebar-nav svg { width: 22px; height: 22px; stroke-width: 1.8; fill: none; }
  .sidebar-nav a.active svg { stroke: url(#grad-icon); }
  .sidebar-foot {
    margin-top: auto; flex-shrink: 0;
    padding: var(--space-4); border-radius: var(--pulso-radius-md);
    background: var(--pulso-bg-elevated); border: 1px solid var(--pulso-border);
    font-size: 12px; color: var(--pulso-text-muted);
    display: flex; align-items: flex-start; gap: var(--space-2);
  }
  .sidebar-foot strong { color: var(--pulso-text); font-weight: 600; }
}

/* MAIN */
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-4); }
@media (min-width: 640px) { .main { padding: var(--space-6); } }
@media (min-width: 1024px) { .main-wrap { overflow-y: auto; } .main { max-width: 960px; width: 100%; margin-inline: auto; padding: var(--space-8) clamp(var(--space-4), 3vw, var(--space-8)); gap: var(--space-8); } }

/* COMMON: eyebrow / cards / lock */
.eyebrow { font-family: var(--pulso-font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--pulso-ciano); font-weight: 500; line-height: 1; }
.eyebrow-gradient { background: var(--pulso-gradient-main); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.eyebrow-lime { color: var(--pulso-lime); }
.eyebrow-pink { color: var(--pulso-pink); }

.card {
  background: var(--pulso-bg-elevated);
  border: 1px solid var(--pulso-border);
  border-radius: var(--pulso-radius-lg);
  padding: var(--space-6);
  position: relative;
}

.sec-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 0 var(--space-1); margin-bottom: var(--space-4); }
.sec-head-left { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex-wrap: wrap; }
.sec-link { font-family: var(--pulso-font-mono); font-size: 11px; color: var(--pulso-ciano); text-transform: uppercase; letter-spacing: 0.15em; transition: color 160ms; }
.sec-link:hover { color: var(--pulso-text); }

/* BOTTOM NAV MOBILE */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--pulso-bg-elevated);
  border-top: 1px solid var(--pulso-border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 40;
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-2); color: var(--pulso-text-muted); font-family: var(--pulso-font-mono); font-size: 10px; letter-spacing: 0.05em; text-decoration: none; text-transform: uppercase; flex: 1; position: relative; transition: color 160ms; }
.nav-item:hover { color: var(--pulso-text); }
.nav-item svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.nav-item.active { color: var(--pulso-text); }
.nav-item.active svg { stroke: url(#grad-icon); }
.nav-item.active::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 2px; border-radius: 0 0 2px 2px; background: var(--pulso-gradient-main); }
@media (min-width: 1024px) { .bottom-nav { display: none; } }

/* privacy note */
.privacy-note { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: rgba(132, 204, 22, 0.06); border: 1px solid rgba(132, 204, 22, 0.2); border-radius: var(--pulso-radius-md); font-size: 13px; color: var(--pulso-text-muted); }
.privacy-note strong { color: var(--pulso-lime); }
