/* ═══════════════════════════════════════════
   CONECTA MAIS · style.css
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

:root {
  --bg:         #F8FAFC;
  --surface:    #FFFFFF;
  --primary:    #22C55E;
  --primary-lt: #16A34A;
  --primary-dk: #15803D;
  --accent:     #22C55E;
  --text:       #1E293B;
  --muted:      #94A3B8;
  --border:     #E2E8F0;
  --danger:     #EF4444;
  --warning:    #F59E0B;
  --info:       #3B82F6;
  --shadow:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.12);
  --r:          16px;
  --r-sm:       10px;
  --r-xs:       8px;
  --nav-h:      64px;
  --head-h:     56px;
  --font-head:  'Sora', sans-serif;
  --font-body:  'Inter', sans-serif;
  --max-w:      480px;
}

/* ══════════════════════════════════
   DARK MODE
══════════════════════════════════ */
[data-theme="dark"] {
  --bg:         #0F172A;
  --surface:    #1E293B;
  --text:       #F1F5F9;
  --muted:      #64748B;
  --border:     #334155;
  --shadow:     0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.5);
}
[data-theme="dark"] .post-card,
[data-theme="dark"] .setting-item,
[data-theme="dark"] .rank-card,
[data-theme="dark"] .org-card,
[data-theme="dark"] .notif-item,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .event-card,
[data-theme="dark"] .dash-card,
[data-theme="dark"] .insight-card,
[data-theme="dark"] .insight-section { border-color: var(--border); }
[data-theme="dark"] .chip { border-color: var(--border); color: var(--muted); }
[data-theme="dark"] .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .chip:hover:not(.active) { border-color: var(--primary); color: var(--text); }
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea { background: #0F172A; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus,
[data-theme="dark"] .field textarea:focus { background: #1E293B; border-color: var(--primary); }
[data-theme="dark"] .post-event-preview { background: #0F172A; border-color: var(--border); }
[data-theme="dark"] .post-event-preview:hover { background: #1E293B; }
[data-theme="dark"] .search-bar { background: #0F172A; border-color: var(--border); }
[data-theme="dark"] .search-bar:focus-within { background: #1E293B; border-color: var(--primary); }
[data-theme="dark"] .comment-row input { background: #0F172A; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .modal { background: #1E293B; }
[data-theme="dark"] .modal-bg { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .modal-head > button { background: #0F172A; }
[data-theme="dark"] .modal-head > button:hover { background: var(--border); }
[data-theme="dark"] .btn-google { background: #0F172A; border-color: var(--border); color: var(--text); }
[data-theme="dark"] .btn-google:hover { border-color: var(--primary); }
[data-theme="dark"] .btn-link-dark:hover { color: var(--danger); }
[data-theme="dark"] #app-header,
[data-theme="dark"] #bottom-nav,
[data-theme="dark"] .screen-top,
[data-theme="dark"] .chips,
[data-theme="dark"] .screen { background: var(--surface); }
[data-theme="dark"] .chips { border-color: var(--border); }
[data-theme="dark"] .stats-row { background: var(--surface); }
[data-theme="dark"] .equip-section { background: var(--surface); }
[data-theme="dark"] .c-bubble { background: #0F172A; }
[data-theme="dark"] .map-search-row { background: #0F172A; border-color: var(--border); }
[data-theme="dark"] .map-search-row:focus-within { border-color: var(--primary); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ══════════════════════════════════
   SCROLLBAR
══════════════════════════════════ */
.screen::-webkit-scrollbar { width: 4px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ══════════════════════════════════
   BRANDING — Conecta Mais
══════════════════════════════════ */
.logo {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: var(--text); letter-spacing: -0.5px; line-height: 1;
  display: inline-flex; align-items: center; gap: 8px;
}
.logo-img {
  height: 28px; width: auto; display: block;
}
.logo-dot { color: var(--primary); }
.logo-icon {
  width: 28px; height: 28px; margin-right: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); border-radius: 8px; color: #fff;
}
.logo-icon svg { width: 16px; height: 16px; }

.auth-brand { text-align: center; }
.auth-brand-logo {
  display: inline-flex; align-items: center; gap: 10px;
}
.auth-brand-logo img {
  height: 64px; width: auto; display: block;
}
.brand-name {
  font-family: var(--font-head); font-size: 36px; font-weight: 800;
  color: #fff; letter-spacing: -1.5px; line-height: 1;
  display: inline-flex; align-items: center; gap: 2px;
}
.brand-dot { color: var(--primary); }
.brand-text {
  font-family: var(--font-head); font-size: 44px; font-weight: 800;
  color: #fff; letter-spacing: -2px; line-height: 1;
  display: inline-flex; align-items: center; gap: 4px;
}
.brand-dot { color: var(--primary); }
.auth-tagline { color: rgba(255,255,255,.7); font-size: 14px; margin-top: 10px; letter-spacing: .3px; }

/* ══════════════════════════════════
   THEME SWITCHER
══════════════════════════════════ */
.theme-selector {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--border);
}
.theme-option {
  border: none; background: transparent; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.theme-option.active {
  background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

/* ══════════════════════════════════
   ICONS (Lucide)
══════════════════════════════════ */
.icon-sm { width: 16px; height: 16px; stroke-width: 2; display: inline-block; vertical-align: middle; }
.icon-md { width: 20px; height: 20px; stroke-width: 2; display: inline-block; vertical-align: middle; }
.icon-lg { width: 24px; height: 24px; stroke-width: 1.75; display: inline-block; vertical-align: middle; }
.nav-ico { width: 22px; height: 22px; stroke-width: 1.75; display: block; }

/* ══════════════════════════════════
   AUTH
══════════════════════════════════ */
#auth-screen {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #22C55E 0%, #16A34A 50%, #15803D 100%);
  display: flex; flex-direction: column; overflow: hidden;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(255,255,255,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,.08) 0%, transparent 50%);
}
.auth-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.auth-top {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 24px 20px; position: relative; z-index: 1;
}
.auth-card {
  background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 28px 24px 36px; position: relative; z-index: 1;
  width: 100%; max-width: 420px; margin: 0 auto;
}
.auth-tabs {
  display: flex; gap: 4px; background: var(--bg);
  border-radius: var(--r-sm); padding: 4px; margin-bottom: 22px;
}
.tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  border-radius: 8px; font-family: var(--font-body); font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: all .2s;
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.or { display: flex; align-items: center; gap: 12px; margin: 6px 0; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ══════════════════════════════════
   FIELDS
══════════════════════════════════ */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 11px 13px; font-family: var(--font-body); font-size: 14px;
  color: var(--text); background: var(--bg); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.err { font-size: 12px; color: var(--danger); min-height: 16px; margin-bottom: 8px; line-height: 1.4; }
.input-group {
  display: flex; align-items: center; gap: 8px;
}
.input-group input { flex: 1; }

/* ══════════════════════════════════
   BUTTONS
══════════════════════════════════ */
.btn-main {
  display: block; width: 100%; padding: 12px 20px;
  background: var(--primary); color: #fff; border: none; border-radius: var(--r-sm);
  font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
}
.btn-main:hover    { background: var(--primary-lt); }
.btn-main:focus    { outline: 3px solid rgba(34, 197, 94, 0.4); outline-offset: 2px; }
.btn-main:active   { transform: scale(.98); }
.btn-main:disabled { opacity: .5; cursor: not-allowed; }
.btn-main.sm       { width: auto; padding: 8px 16px; font-size: 13px; }

.btn-outline {
  display: block; width: 100%; padding: 12px 20px;
  background: transparent; color: var(--primary); border: 1.5px solid var(--primary);
  border-radius: var(--r-sm); font-family: var(--font-body); font-size: 14px;
  font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-outline:hover { background: rgba(34, 197, 94, 0.06); }
.btn-outline.sm    { width: auto; padding: 8px 16px; font-size: 13px; }

.btn-ghost {
  background: none; border: none; color: var(--muted); font-size: 13px;
  cursor: pointer; font-family: var(--font-body); transition: color .2s;
  padding: 6px 8px; border-radius: var(--r-xs);
}
.btn-ghost:hover { color: var(--text); background: var(--bg); }

.btn-link-dark { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; font-family: var(--font-body); transition: color .2s; }
.btn-link-dark:hover { color: var(--danger); }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); font-family: var(--font-body); font-size: 14px;
  font-weight: 500; color: var(--text); cursor: pointer; transition: border-color .2s;
}
.btn-google:hover { border-color: var(--primary); background: rgba(34, 197, 94, 0.03); }

.btn-icon {
  width: 40px; height: 40px; border-radius: var(--r-xs);
  border: none; background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all .2s;
}
.btn-icon:hover { background: var(--border); color: var(--text); }

/* ══════════════════════════════════
   APP SHELL
══════════════════════════════════ */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
#app-header {
  height: var(--head-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; flex-shrink: 0; z-index: 100;
}
#main { flex: 1; overflow: hidden; position: relative; }
.screen {
  position: absolute; inset: 0; overflow-y: auto;
  padding: 0 0 calc(var(--nav-h) + 8px);
  -webkit-overflow-scrolling: touch;
}
.screen-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 10;
}
.screen-title {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: var(--text); letter-spacing: -.4px;
}
.screen-sub {
  font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500;
}
.header-right {
  display: flex; align-items: center; gap: 8px;
}
#header-user {
  font-size: 12px; color: var(--muted);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════
   BOTTOM NAV
══════════════════════════════════ */
#bottom-nav {
  height: var(--nav-h); background: var(--surface);
  border-top: 1px solid var(--border); display: flex;
  flex-shrink: 0; z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; border: none; background: transparent;
  cursor: pointer; color: var(--muted); transition: color .2s; position: relative;
  padding: 6px 4px;
}
.nav-btn.active { color: var(--primary); }
.nav-btn.active::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; background: var(--primary); border-radius: 0 0 2px 2px;
}
.nav-lbl { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

/* ══════════════════════════════════
   HEADER BADGE
══════════════════════════════════ */
#header-badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 100px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* ══════════════════════════════════
   FEED — POST CARDS
══════════════════════════════════ */
#feed-list { padding: 12px 12px; display: flex; flex-direction: column; gap: 12px; }

.post-card {
  background: var(--surface); border-radius: var(--r); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.post-card:active { box-shadow: var(--shadow-md); }

.post-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 8px; cursor: pointer;
}
.post-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; color: #fff; font-size: 13px;
  background: var(--primary);
}
.post-author-info { flex: 1; min-width: 0; }
.post-author-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-meta {
  font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px;
}
.post-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

.post-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 100px; letter-spacing: .3px;
}
.post-type-event    { background: #DBEAFE; color: #1E40AF; }
.post-type-project  { background: #D1FAE5; color: #065F46; }
.post-type-text     { background: #F1F5F9; color: #475569; }
.post-type-image    { background: #FEF3C7; color: #92400E; }

.post-content { padding: 6px 14px 10px; }
.post-text {
  font-size: 14px; color: var(--text); line-height: 1.6;
  white-space: pre-wrap; word-wrap: break-word;
}
.post-image {
  width: 100%; max-height: 400px; object-fit: cover;
  border-radius: var(--r-xs); margin-top: 8px; cursor: pointer;
  background: var(--bg);
}

.post-event-preview {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 12px; margin-top: 8px; cursor: pointer;
  transition: background .15s;
}
.post-event-preview:hover { background: var(--surface); }
.post-event-title { font-family: var(--font-head); font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.post-event-date { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.post-event-date svg { width: 12px; height: 12px; }

.post-actions {
  display: flex; border-top: 1px solid var(--border);
  padding: 4px 0; margin: 0 14px;
}
.post-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 10px 6px; border: none; background: transparent;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all .15s;
  border-radius: 6px;
}
.post-action-btn:hover { background: var(--bg); color: var(--text); }
.post-action-btn.liked { color: var(--primary); }
.post-action-btn.liked svg { fill: var(--primary); }
.post-action-btn.saved { color: var(--warning); }
.post-action-btn.saved svg { fill: var(--warning); }
.post-action-btn svg { width: 18px; height: 18px; }

/* ══════════════════════════════════
   EVENT INFO ROWS (inside feed cards)
══════════════════════════════════ */
.event-card-info { display: flex; flex-direction: column; gap: 6px; }
.event-card-info-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.event-card-info-row svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--primary); }

/* ══════════════════════════════════
   MAP SCREEN
══════════════════════════════════ */
#map-container {
  position: absolute; inset: 0; top: 0;
  display: flex; flex-direction: column;
}
#screen-mapa .screen-top { position: absolute; top: 0; left: 0; right: 0; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); }
#screen-mapa #bottom-nav { position: relative; z-index: 10; }
#main-map {
  flex: 1; position: relative; min-height: 0; height: 100%;
}
#screen-mapa { padding-bottom: var(--nav-h); display: flex; flex-direction: column; }
#screen-mapa .screen-top { position: sticky; top: 0; }

#main-map .leaflet-container {
  width: 100%; height: 100%;
}

.map-event-popup h3 {
  font-family: var(--font-head); font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.map-event-popup p {
  font-size: 12px; color: var(--muted); margin-bottom: 2px;
  display: flex; align-items: center; gap: 4px;
}
.map-event-popup p svg { width: 12px; height: 12px; }

/* ══════════════════════════════════
   PERFIL
══════════════════════════════════ */
.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  padding: 28px 20px 22px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pf-avatar-wrap { position: relative; margin-bottom: 10px; }
.pf-avatar-big  { width: 80px; height: 80px; border-radius: 50%; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 22px; font-weight: 800; color: #fff;
}
.pf-avatar-edit {
  position: absolute; bottom: -4px; right: -4px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary-dk);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--primary-dk);
  box-shadow: var(--shadow);
}
.pf-avatar-edit svg { width: 12px; height: 12px; }
.pf-name  { font-family: var(--font-head); font-size: 20px; font-weight: 800; color: #fff; }
.pf-email { font-size: 13px; color: rgba(255,255,255,.65); margin-top: 4px; }
.pf-bio   { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 8px; max-width: 300px; line-height: 1.5; }

.stats-row {
  display: flex; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stat {
  flex: 1; text-align: center; padding: 16px 12px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat-n { font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--text); }
.stat-l { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* Settings list */
.settings-list  { padding: 14px 14px 24px; }
.settings-title {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px;
  padding: 0 2px;
}
.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px 14px;
  margin-bottom: 6px; cursor: pointer; transition: background .15s;
}
.setting-item:hover { background: var(--bg); }
.setting-left { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: var(--text); }
.setting-ico  { color: var(--primary); flex-shrink: 0; }
.setting-arrow { color: var(--muted); }

/* Avatar grid */
.avatar-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
}
.avatar-opt {
  aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 26px; cursor: pointer;
  border: 3px solid transparent; transition: transform .15s, border-color .15s;
  position: relative;
}
.avatar-opt:hover  { transform: scale(1.06); }
.avatar-opt.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.avatar-check {
  position: absolute; bottom: 2px; right: 2px;
  width: 18px; height: 18px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.avatar-check svg { width: 11px; height: 11px; }

/* ══════════════════════════════════
   DASHBOARD
══════════════════════════════════ */
.dash-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 14px;
}
.dash-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 14px; text-align: center;
  box-shadow: var(--shadow);
}
.dash-card.full { grid-column: 1 / -1; text-align: left; }
.dash-card-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; font-weight: 600;
  margin-bottom: 6px;
}
.dash-card-value {
  font-family: var(--font-head); font-size: 24px; font-weight: 800;
  color: var(--text); line-height: 1;
}
.dash-card-value.green { color: var(--primary); }
.dash-section {
  padding: 14px;
}
.dash-section-title {
  font-family: var(--font-head); font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 10px;
}

/* Level bar */
.level-bar-wrap {
  background: var(--bg); border-radius: 100px; height: 8px;
  overflow: hidden; margin: 8px 0;
}
.level-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dk));
  border-radius: 100px; transition: width .5s ease;
}
.level-info {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted);
}

/* ══════════════════════════════════
   RANKING
══════════════════════════════════ */
#ranking-list { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.rank-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.rank-card:hover { box-shadow: var(--shadow-md); }
.rank-number {
  font-family: var(--font-head); font-size: 16px; font-weight: 800;
  color: var(--muted); min-width: 28px; text-align: center;
}
.rank-number.gold   { color: #D4AF37; }
.rank-number.silver { color: #9E9E9E; }
.rank-number.bronze { color: #CD7F32; }
.rank-info { flex: 1; min-width: 0; }
.rank-name {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rank-points {
  font-family: var(--font-head); font-size: 16px; font-weight: 800;
  color: var(--primary); flex-shrink: 0;
}
.rank-points span { font-size: 10px; font-weight: 600; color: var(--muted); }

/* ══════════════════════════════════
   ORGANIZATIONS
══════════════════════════════════ */
#orgs-list { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.org-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; box-shadow: var(--shadow);
  cursor: pointer; transition: box-shadow .2s;
}
.org-card:hover { box-shadow: var(--shadow-md); }
.org-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.org-avatar {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-weight: 700; color: #fff; font-size: 18px;
  background: var(--primary);
}
.org-info { flex: 1; min-width: 0; }
.org-name { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); }
.org-category { font-size: 11px; color: var(--muted); margin-top: 2px; }
.org-desc { font-size: 13px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ══════════════════════════════════
   NOTIFICATIONS
══════════════════════════════════ */
#notif-list { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px;
  cursor: pointer; transition: background .15s;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { border-left: 3px solid var(--primary); }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 16px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text); }
.notif-text { font-size: 12px; color: var(--muted); margin-top: 2px; }
.notif-time { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ══════════════════════════════════
   CATEGORY BADGES
══════════════════════════════════ */
.cat-badge {
  padding: 4px 10px; border-radius: 100px;
  font-size: 10px; font-weight: 700; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .3px;
}

/* ══════════════════════════════════
   CHIPS
══════════════════════════════════ */
.chips {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 12px 12px; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 12px; border-radius: 100px; border: 1.5px solid var(--border);
  background: transparent; font-family: var(--font-body); font-size: 12px;
  font-weight: 600; color: var(--muted); cursor: pointer;
  white-space: nowrap; transition: all .2s; flex-shrink: 0;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:hover:not(.active) { border-color: var(--primary); color: var(--text); }

/* ══════════════════════════════════
   MODAIS
══════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px); display: flex; align-items: flex-end;
  justify-content: center; z-index: 1000;
}
.modal {
  background: var(--surface); border-radius: 28px 28px 0 0;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  padding: 0 0 28px; animation: slideUp .3s cubic-bezier(.32,.72,0,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 36px; height: 4px; background: var(--border);
  border-radius: 2px; margin: 10px auto 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 0; margin-bottom: 12px;
}
.modal-head strong {
  font-family: var(--font-head); font-size: 17px; font-weight: 800; color: var(--text);
}
.modal-head > button {
  width: 32px; height: 32px; border-radius: 10px; border: none;
  background: var(--bg); cursor: pointer; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.modal-head > button:hover { background: var(--border); }
.modal-body { padding: 0 20px; }

/* ══════════════════════════════════
   GAMIFICATION — BADGES & CONQUISTAS
══════════════════════════════════ */
.badges-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.badge-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
}
.badge-item.unlocked .badge-icon { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.badge-item.unlocked:hover .badge-icon { transform: scale(1.08); }
.badge-item.locked .badge-icon { background: var(--bg) !important; border: 1.5px dashed var(--border); }
.badge-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; line-height: 1.2;
}
.badge-chip {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 100px; margin: 2px;
}

/* Medal/achievement modal */
.achievement-list { display: flex; flex-direction: column; gap: 8px; }
.achievement-option {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--border); cursor: pointer;
  transition: all .2s; background: var(--surface);
}
.achievement-option:hover {
  border-color: var(--primary); background: #f0fdf4; transform: translateY(-1px);
}
.achievement-option.selected {
  border-color: var(--primary); background: #f0fdf4; box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}
.achievement-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.achievement-info { flex: 1; }
.achievement-name {
  font-family: var(--font-head); font-size: 13px; font-weight: 700;
  margin-bottom: 2px;
}
.achievement-desc { font-size: 12px; color: var(--muted); }

/* ══════════════════════════════════
   FAB (Float Action Button)
══════════════════════════════════ */
.fab {
  position: fixed; bottom: calc(var(--nav-h) + 20px); right: 20px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  box-shadow: var(--shadow-lg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 50; transition: transform .15s, background .15s;
}
.fab:hover { transform: scale(1.06); background: var(--primary-lt); }
.fab:active { transform: scale(.94); }
.fab svg { width: 24px; height: 24px; }

/* ══════════════════════════════════
   CONQUISTA EQUIPADA
══════════════════════════════════ */
.equip-section {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* ══════════════════════════════════
   SPINNER & TOAST & EMPTY STATE
══════════════════════════════════ */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 48px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; bottom: calc(var(--nav-h) + 14px); left: 50%;
  transform: translateX(-50%); background: var(--text); color: #fff;
  padding: 10px 20px; border-radius: 100px; font-size: 13px; font-weight: 600;
  z-index: 9999; opacity: 0; transition: opacity .3s; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; }
.empty {
  text-align: center; padding: 60px 24px;
}
.empty-ico  { width: 48px; height: 48px; color: var(--border); margin: 0 auto 16px; display: block; }
.empty-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-desc  { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ══════════════════════════════════
   ADMIN
══════════════════════════════════ */
.admin-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; margin-bottom: 10px;
}
.admin-card-top  { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.admin-card-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
}
.admin-card-meta  { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.admin-card-desc  { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px; border: none;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.admin-btn:hover { opacity: .82; }
.admin-btn svg   { flex-shrink: 0; }
.admin-btn-danger { background: #FEE2E2; color: #991B1B; }

/* ══════════════════════════════════
   DETAIL / SINGLE EVENT VIEW
══════════════════════════════════ */
.det-title  {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: var(--text); margin-bottom: 10px; line-height: 1.25;
}
.det-desc   { font-size: 14px; color: var(--muted); margin-bottom: 14px; line-height: 1.65; }
.det-meta   { font-size: 12px; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }
.det-meta svg { width: 13px; height: 13px; }
.det-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.det-actions .btn-main, .det-actions .btn-outline { flex: 1; }

/* ══════════════════════════════════
   SEARCH BAR
══════════════════════════════════ */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 9px 14px;
  transition: all .2s; margin: 10px 12px 6px;
}
.search-bar:focus-within {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}
.search-ico  { color: var(--muted); flex-shrink: 0; }
.search-input {
  flex: 1; border: none; outline: none; font-family: var(--font-body);
  font-size: 14px; color: var(--text); background: transparent;
}
.search-input::placeholder { color: var(--muted); }
.search-clear {
  background: none; border: none; cursor: pointer; color: var(--muted);
  display: flex; align-items: center; padding: 2px; border-radius: 4px;
  transition: color .2s;
}
.search-clear:hover { color: var(--danger); }

/* ══════════════════════════════════
   COMMENTS
══════════════════════════════════ */
.comments { border-top: 1px solid var(--border); padding-top: 16px; }
.comments h4 { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 14px; }
.comment { display: flex; gap: 9px; margin-bottom: 12px; }
.c-av { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.c-bubble { flex: 1; background: var(--bg); border-radius: 12px; padding: 9px 13px; }
.c-author { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.c-text   { font-size: 13px; color: var(--text); line-height: 1.5; }
.comment-row { display: flex; gap: 8px; margin-top: 12px; }
.comment-row input {
  flex: 1; border: 1.5px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 13px; font-family: var(--font-body); font-size: 13px;
  background: var(--bg); outline: none; color: var(--text); transition: border-color .2s;
}
.comment-row input:focus { border-color: var(--primary); }
.comment-row button {
  width: 40px; height: 40px; border-radius: var(--r-sm); border: none;
  background: var(--primary); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.comment-row button:hover { background: var(--primary-lt); }
.comment-row button svg { width: 16px; height: 16px; }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 360px) {
  .nav-lbl { font-size: 8px; letter-spacing: .2px; }
  .brand-text { font-size: 36px; }
  .auth-card { padding: 24px 18px 28px; }
  .badges-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 480px) {
  .modal { border-radius: 24px; margin-bottom: 20px; }
  #feed-list { max-width: var(--max-w); margin: 0 auto; }
  #events-list { max-width: var(--max-w); margin: 0 auto; }
  #ranking-list { max-width: var(--max-w); margin: 0 auto; }
  #orgs-list { max-width: var(--max-w); margin: 0 auto; }
  #notif-list { max-width: var(--max-w); margin: 0 auto; }
  #app-header { padding: 0 24px; }
  .screen-top { padding: 16px 24px 12px; }
  .chips { padding: 10px 24px 12px; }
  .settings-list { padding: 14px 24px 24px; }
  .dash-grid { padding: 14px 24px; }
  .dash-section { padding: 14px 24px; }
}

/* ══════════════════════════════════
   UID ROW
══════════════════════════════════ */
.uid-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-radius: var(--r-sm);
  padding: 10px 14px; margin-top: 8px;
  border: 1px solid var(--border);
}
.uid-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.uid-value {
  font-family: monospace; font-size: 11px; color: var(--muted);
  cursor: pointer; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px; transition: background .15s;
}
.uid-value:hover { background: var(--border); color: var(--text); }

/* ══════════════════════════════════
   MODAL CREATE EVENT
══════════════════════════════════ */
.create-event-map { width: 100%; height: 200px; border-radius: 8px; border: 1.5px solid var(--border); overflow: hidden; }
.create-event-map-hint { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0 8px; }

/* ══════════════════════════════════
   NOTIFS badge count
══════════════════════════════════ */
.notif-badge {
  position: absolute; top: 2px; right: 4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Conquista equipada header */
.header-equip-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 100px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px; max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}