/* ==========================================================================
   Graviton Growth Hub — Tema Claro (branco + roxo)
   ========================================================================== */

:root {
  --purple:       #6C3CE9;
  --purple-600:   #5a2fd0;
  --purple-700:   #4a25b0;
  --purple-300:   #b8a3f2;
  --purple-100:   #ece5fc;
  --purple-50:    #f6f3fe;

  --ink:          #211d33;
  --ink-soft:     #443f5c;
  --muted:        #7b768f;
  --line:         #e9e4f6;
  --line-soft:    #f1edfa;
  --card:         #ffffff;
  --bg:           #f5f2fc;

  --green:        #16a34a;
  --amber:        #d97706;
  --red:          #dc2626;
  --blue:         #2563eb;

  --shadow-sm:    0 1px 2px rgba(76,44,160,.06), 0 1px 3px rgba(76,44,160,.05);
  --shadow-md:    0 4px 16px rgba(76,44,160,.08), 0 2px 6px rgba(76,44,160,.05);
  --shadow-lg:    0 12px 40px rgba(76,44,160,.14);
  --radius:       16px;
  --radius-sm:    10px;

  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(108,60,233,.10), transparent 55%),
    radial-gradient(900px 500px at -5% 110%, rgba(108,60,233,.08), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ============ LOGIN ============ */
#login-screen.active { display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login-card {
  position: relative; z-index: 2; width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 44px 40px; box-shadow: var(--shadow-lg); text-align: center;
}
.login-symbol { width: 74px; height: 74px; object-fit: contain; margin-bottom: 10px;
  filter: drop-shadow(0 8px 18px rgba(108,60,233,.3)); animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.login-logo { height: 30px; object-fit: contain; margin: 6px auto 4px; display:block; }
.login-title { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.login-title span { color: var(--purple); }
.login-subtitle { color: var(--muted); font-size: 14.5px; margin: 8px 0 26px; }
.login-roles { display: flex; flex-direction: column; gap: 12px; }
.btn-role {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--purple-50); cursor: pointer; text-align: left;
  transition: .18s; font-size: 15px; font-weight: 600; color: var(--ink); width: 100%;
}
.btn-role:hover { border-color: var(--purple-300); background: var(--purple-100); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-role i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--purple); color: #fff; font-size: 16px; flex-shrink: 0; }
.btn-role small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.login-member-pick { margin-top: 14px; text-align: left; display: none; }
.login-member-pick.show { display: block; animation: fade .3s; }
.login-member-pick label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.login-member-pick select {
  width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--line); font-size: 14.5px; font-family: inherit; color: var(--ink); background: #fff;
}
.login-member-pick .btn { width: 100%; margin-top: 12px; justify-content: center; }
.auth-err { background: #fdeaea; color: var(--red); font-size: 13px; font-weight: 500; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.login-card .login-title { margin-top: 4px; }
.login-foot { margin-top: 26px; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; }
.login-foot img { width: 16px; opacity: .8; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); z-index: 1; opacity: .5; }
.orb-1 { width: 380px; height: 380px; background: rgba(108,60,233,.35); top: -100px; right: -80px; }
.orb-2 { width: 300px; height: 300px; background: rgba(168,120,255,.30); bottom: -90px; left: -70px; }
@keyframes fade { from{opacity:0; transform:translateY(6px)} to{opacity:1;transform:none} }

/* ============ APP SHELL ============ */
#app-screen.active { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--purple-700), var(--purple) 55%, var(--purple-600));
  color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden; }
.sidebar::before { content: ''; position: absolute; bottom: -50px; right: -55px; width: 220px; height: 220px;
  background: url('assets/SIMBOLO-BRANCO.png') no-repeat center / contain; opacity: .07; pointer-events: none; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { padding: 22px 22px 16px; display: flex; align-items: center; gap: 10px; }
.sidebar-head img { height: 26px; }
.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.nav-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.55); padding: 14px 12px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,.82); cursor: pointer; font-size: 14px; font-weight: 500; margin-bottom: 2px; transition: .15s; }
.nav-item i { width: 18px; text-align: center; font-size: 15px; }
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.active { background: #fff; color: var(--purple-700); font-weight: 600; box-shadow: var(--shadow-sm); }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-foot img { height: 20px; opacity: .9; margin-bottom: 12px; }
.btn-logout { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
  cursor: pointer; font-size: 13.5px; font-weight: 500; transition: .15s; }
.btn-logout:hover { background: rgba(255,255,255,.18); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 28px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hamburger { display: none; background: none; border: none; font-size: 20px; color: var(--purple-700); cursor: pointer; }
.topbar-symbol { height: 26px; width: 26px; object-fit: contain; flex-shrink: 0; }
.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.topbar-search input { width: 100%; padding: 10px 14px 10px 38px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; font-family: inherit; font-size: 14px; color: var(--ink); }
.topbar-search input:focus { outline: none; border-color: var(--purple-300); box-shadow: 0 0 0 3px var(--purple-100); }
.topbar-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar { width: 38px; height: 38px; border-radius: 10px; background: var(--purple); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.user-chip .u-name { font-size: 13.5px; font-weight: 600; line-height: 1.1; }
.user-chip .u-role { font-size: 11.5px; color: var(--muted); }
.role-pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px; }
.role-pill.socio { background: var(--purple-100); color: var(--purple-700); }
.role-pill.equipe { background: #e6efff; color: var(--blue); }

.content { padding: 28px; max-width: 1400px; width: 100%; }
.view { animation: fade .25s; }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--purple), var(--purple-600)); color: #fff; font-size: 19px; flex-shrink: 0; box-shadow: 0 6px 16px rgba(108,60,233,.3); }
.page-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.page-desc { color: var(--muted); font-size: 14px; margin-top: 2px; }
.page-head .spacer { flex: 1; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: .18s; }
.kpi:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi::after { content: ''; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%; background: var(--purple-50); }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; margin-bottom: 12px; background: var(--purple-100); color: var(--purple); font-size: 15px; position: relative; z-index: 1; }
.kpi .k-val { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1; position: relative; z-index: 1; }
.kpi .k-label { font-size: 12.5px; color: var(--muted); margin-top: 6px; position: relative; z-index: 1; }
.kpi .k-sub { font-size: 11.5px; margin-top: 6px; font-weight: 600; position: relative; z-index: 1; }
.k-sub.up { color: var(--green); } .k-sub.down { color: var(--red); } .k-sub.flat { color: var(--muted); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 10px; }
.panel-head h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 1024px){ .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data thead th { text-align: left; padding: 12px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--purple-50); position: sticky; top: 0; }
table.data tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
table.data tbody tr { transition: .12s; cursor: pointer; }
table.data tbody tr:hover { background: var(--purple-50); }
table.data tbody tr:last-child td { border-bottom: none; }
.cell-name { font-weight: 600; color: var(--ink); }
.cell-main { display: flex; align-items: center; gap: 10px; }
.mini-avatar { width: 30px; height: 30px; border-radius: 8px; background: var(--purple-100); color: var(--purple-700); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.badge.green { background: #e7f7ec; color: var(--green); }
.badge.amber { background: #fdf1e0; color: var(--amber); }
.badge.red   { background: #fdeaea; color: var(--red); }
.badge.blue  { background: #e6efff; color: var(--blue); }
.badge.purple{ background: var(--purple-100); color: var(--purple-700); }
.badge.gray  { background: #eef0f4; color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.green{background:var(--green)} .dot.amber{background:var(--amber)} .dot.red{background:var(--red)} .dot.gray{background:#b9b6c6}

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters select, .filters input { padding: 9px 12px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-family: inherit; font-size: 13.5px; color: var(--ink); }
.filters input { min-width: 220px; }
.filters select:focus, .filters input:focus { outline: none; border-color: var(--purple-300); box-shadow: 0 0 0 3px var(--purple-100); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: none; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 600; transition: .15s; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 4px 12px rgba(108,60,233,.28); }
.btn-primary:hover { background: var(--purple-600); }
.btn-ghost { background: var(--purple-50); color: var(--purple-700); border: 1.5px solid var(--line); }
.btn-ghost:hover { background: var(--purple-100); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

.prog { height: 8px; background: var(--line-soft); border-radius: 20px; overflow: hidden; }
.prog > span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--purple-300)); border-radius: 20px; }

.client-hero { background: linear-gradient(120deg, var(--purple-700), var(--purple)); color: #fff; border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.client-hero::after { content:''; position:absolute; right:-40px; top:-40px; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,.08); }
.client-hero .ch-name { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.client-hero .ch-sub { opacity: .9; font-size: 14px; margin-top: 4px; }
.client-hero .ch-meta { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 18px; }
.client-hero .ch-meta > div b { display:block; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.client-hero .ch-meta > div small { opacity: .8; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--purple-700); font-weight: 600; font-size: 13.5px; cursor: pointer; margin-bottom: 16px; background: none; border: none; }
.back-link:hover { text-decoration: underline; }

.timeline { list-style: none; position: relative; padding-left: 26px; }
.timeline::before { content:''; position:absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 18px; }
.timeline li::before { content:''; position:absolute; left:-24px; top:3px; width: 14px; height: 14px; border-radius:50%; background:#fff; border: 3px solid var(--purple); }
.timeline li.done::before { background: var(--purple); }
.timeline .tl-date { font-size: 12px; color: var(--muted); }
.timeline .tl-title { font-weight: 600; font-size: 14px; }

.check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 8px 12px; border-radius: 9px; background: var(--purple-50); }
.check-item i { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; color: #fff; flex-shrink: 0; }
.check-item i.ok { background: var(--green); } .check-item i.no { background: #cdc9db; }
.check-item.clickable { cursor: pointer; transition: .12s; }
.check-item.clickable:hover { background: var(--purple-100); transform: translateY(-1px); }

.meet-bars { display: flex; gap: 6px; align-items: flex-end; height: 110px; }
.meet-bars .mb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.meet-bars .mb .bar { width: 100%; background: linear-gradient(180deg, var(--purple), var(--purple-300)); border-radius: 5px 5px 0 0; min-height: 3px; }
.meet-bars .mb .lbl { font-size: 9.5px; color: var(--muted); }
.meet-bars .mb .q { font-size: 10.5px; font-weight: 700; color: var(--purple-700); }

.tag-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--purple-100); color: var(--purple-700); }
.tag .x { cursor: pointer; opacity: .6; } .tag .x:hover { opacity: 1; }
.tag-input { border: 1.5px dashed var(--line); background: #fff; border-radius: 20px; padding: 4px 10px; font-size: 12px; font-family: inherit; width: 130px; }
.health-pick { display: flex; gap: 8px; }
.health-pick button { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.health-pick button.on.g { background: var(--green); color: #fff; border-color: var(--green); }
.health-pick button.on.y { background: var(--amber); color: #fff; border-color: var(--amber); }
.health-pick button.on.r { background: var(--red); color: #fff; border-color: var(--red); }

.access-table td, .access-table th { text-align: center; }
.access-table td:first-child, .access-table th:first-child { text-align: left; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #d9d5e6; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch .track::before { content:''; position:absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--purple); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }
/* Marca d'água do símbolo Graviton no fundo do app */
#app-screen.active::after { content: ''; position: fixed; bottom: 24px; right: 30px; width: 300px; height: 300px;
  background: url('assets/SIMBOLO-ROXO.png') no-repeat center / contain; opacity: .035; pointer-events: none; z-index: 0; }
.main { position: relative; z-index: 1; }
/* Símbolo no cabeçalho de página */
.page-icon { position: relative; overflow: hidden; }
.page-head::after { content: ''; }
.note { font-size: 12.5px; color: var(--muted); }
code { background: var(--purple-100); color: var(--purple-700); padding: 1px 6px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, Menlo, monospace; }
.hr { height: 1px; background: var(--line-soft); margin: 18px 0; border: none; }
.mt-2 { margin-top: 14px; } .mt-3 { margin-top: 20px; } .mb-2 { margin-bottom: 14px; }
.text-right { text-align: right; } .flex { display: flex; align-items: center; gap: 10px; } .wrap { flex-wrap: wrap; }
.stat-line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.stat-line:last-child { border: none; }
.stat-line b { font-weight: 700; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.rank-row:last-child { border: none; }
.rank-bar { flex: 1; height: 8px; background: var(--line-soft); border-radius: 20px; overflow: hidden; }
.rank-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--purple-300)); }

#toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 200; transition: .25s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(33,29,51,.45); backdrop-filter: blur(3px); z-index: 150; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; flex: 1; }
.modal-x { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal-x:hover { color: var(--ink); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; background: var(--purple-50); }
.modal-input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--ink); background: #fff; margin-bottom: 14px; }
.modal-input:focus { outline: none; border-color: var(--purple-300); box-shadow: 0 0 0 3px var(--purple-100); }
textarea.modal-input { min-height: 80px; resize: vertical; }
.modal-body .note { margin-bottom: 6px; }

@media (max-width: 860px){
  #app-screen.active { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; width: 256px; transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: none; }
  .content { padding: 18px; }
  .hamburger { display: block; }
  .check-list { grid-template-columns: 1fr; }
}
