/* ============================================================
   ScreenReward — Stylesheet Principal
   Design: Soft Minimal · Paleta Verde-Esmeralda + Branco Gelo
   Tipografia: DM Sans (corpo) + Fraunces (títulos)
   Mobile First | Sidebar Vertical
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&display=swap');

/* ============================================================
   VARIÁVEIS
   ============================================================ */
:root {
  --bg:             #F4F7F4;
  --bg-card:        #FFFFFF;
  --sidebar-bg:     #1A2E20;
  --sidebar-w:      260px;

  --primary:        #2D6A4F;
  --primary-light:  #40916C;
  --primary-pale:   #D8F3DC;
  --accent:         #52B788;
  --accent-glow:    rgba(82,183,136,.18);

  --danger:         #E63946;
  --danger-pale:    #FFE0E2;
  --warning:        #F4A261;
  --warning-pale:   #FFF1E6;
  --info:           #4361EE;
  --info-pale:      #E8ECFD;
  --success:        #2D6A4F;
  --success-pale:   #D8F3DC;

  --text:           #1A2E20;
  --text-muted:     #6B7F72;
  --text-light:     #9EB3A4;
  --border:         #E0EBE3;

  --shadow-sm:      0 1px 4px rgba(0,0,0,.06);
  --shadow:         0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:      0 12px 40px rgba(0,0,0,.12);
  --radius:         14px;
  --radius-sm:      8px;
  --radius-lg:      20px;
  --transition:     .22s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', serif;
  line-height: 1.2;
  color: var(--text);
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* SVG icons — always inline-block and vertically centred */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: transform var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 199;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
}

.sidebar-brand .brand-logo img {
  height: 44px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar-user .user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  font-weight: 700;
  font-size: .88rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user .user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user .user-info { overflow: hidden; }

.sidebar-user .user-name {
  font-size: .88rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-plan {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  color: var(--accent);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-title {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 14px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px;
  font-size: .88rem;
  font-weight: 500;
  color: rgba(255,255,255,.62);
  transition: background var(--transition), color var(--transition);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.nav-item .nav-icon svg { display: block; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  transition: color var(--transition);
  text-decoration: none;
}

.sidebar-footer a:hover { color: rgba(255,255,255,.85); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: 62px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  align-items: center;
  justify-content: center;
}

.menu-toggle:hover { background: var(--bg); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  padding: 28px;
  flex: 1;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.filho-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ============================================================
   CARD BASE
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  font-weight: 600;
}

.card-body { padding: 22px; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.green::after  { background: var(--primary); }
.stat-card.blue::after   { background: var(--info); }
.stat-card.orange::after { background: var(--warning); }
.stat-card.red::after    { background: var(--danger); }

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}

.stat-card .stat-icon svg { display: block; }

.stat-card.green  .stat-icon { background: var(--primary-pale); color: var(--primary); }
.stat-card.blue   .stat-icon { background: var(--info-pale);    color: var(--info); }
.stat-card.orange .stat-icon { background: var(--warning-pale); color: var(--warning); }
.stat-card.red    .stat-icon { background: var(--danger-pale);  color: var(--danger); }

.stat-card .stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 2px;
}

.stat-card .stat-sub {
  font-size: .78rem;
  color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn svg { flex-shrink: 0; }

.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); color: #fff; border-color: var(--primary-light); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(45,106,79,.3); }

.btn-accent   { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: #3da876; color: #fff; transform: translateY(-1px); }

.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-pale); }

.btn-ghost    { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c62f3a; }

.btn-sm  { font-size: .8rem; padding: 6px 14px; }
.btn-lg  { font-size: 1rem; padding: 13px 28px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge svg { flex-shrink: 0; }

.badge-success  { background: var(--success-pale); color: var(--primary); }
.badge-danger   { background: var(--danger-pale);  color: var(--danger); }
.badge-warning  { background: var(--warning-pale); color: #CC5500; }
.badge-info     { background: var(--info-pale);    color: var(--info); }
.badge-muted    { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label span { color: var(--danger); margin-left: 2px; }

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  color: var(--text);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex; align-items: flex-start; gap: 5px;
}

.form-error {
  font-size: .78rem;
  color: var(--danger);
  margin-top: 4px;
}

.radio-group,
.check-group { display: flex; flex-direction: column; gap: 10px; }

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.radio-option.selected { border-color: var(--accent); background: var(--primary-pale); }
.radio-option input { margin-top: 2px; accent-color: var(--primary); }
.radio-label { font-weight: 600; font-size: .9rem; }
.radio-desc  { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.file-drop:hover { border-color: var(--accent); background: var(--primary-pale); }
.file-drop input[type="file"] { display: none; }

.audio-recorder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
}

.record-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(230,57,70,.35);
}

.record-btn:hover { transform: scale(1.07); }
.record-btn.recording { animation: pulse 1.4s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,.5); }
  50%       { box-shadow: 0 0 0 14px rgba(230,57,70,0); }
}

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: .88rem; }

thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }

/* ============================================================
   FILHO CARDS
   ============================================================ */
.filho-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

.filho-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.filho-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.filho-avatar img { width: 100%; height: 100%; object-fit: cover; }

.filho-nome {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2px;
}

.filho-idade {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 14px;
}

.saldo-box {
  background: var(--primary-pale);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}

.filho-card .saldo-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
  margin-bottom: 4px;
}

.filho-card .saldo-valor {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.filho-card .streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--warning);
}

.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-wrap {
  background: var(--bg);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 20px;
  width: 0%;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}

.empty-icon {
  width: 64px; height: 64px;
  background: var(--bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: var(--text-light);
}

.empty-icon svg { display: block; }

.empty-state h3 { font-size: 1rem; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: .88rem; max-width: 320px; margin: 0 auto; }

/* ============================================================
   GAMIFICATION
   ============================================================ */
.medal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.medal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.medal-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.medal-card.conquistada { background: var(--primary-pale); border-color: var(--accent); }

.medal-icon {
  height: 48px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}

.medal-icon svg { display: block; }
.medal-card.bloqueada .medal-icon { opacity: .3; filter: grayscale(1); }

.medal-nome { font-size: .78rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.medal-desc { font-size: .7rem; color: var(--text-muted); }

.streak-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #FFF1E6, #FFE0CC);
  border-radius: var(--radius);
  border: 1px solid var(--warning);
  margin-bottom: 18px;
}

.streak-num {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--warning);
  line-height: 1;
}

/* ============================================================
   REPORTS
   ============================================================ */
.chart-container { position: relative; width: 100%; height: 260px; }

.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.report-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
}

.report-stat-num {
  font-family: 'Fraunces', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.report-stat-lbl { font-size: .75rem; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   SCREEN TIME
   ============================================================ */
.saldo-grande { text-align: center; padding: 32px 0; }

.saldo-grande .saldo-num {
  font-family: 'Fraunces', serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.saldo-grande .saldo-sub { font-size: .85rem; color: var(--text-muted); margin-top: 6px; }

.time-buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0; }

.time-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}

.time-log-item:last-child { border-bottom: none; }

.log-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.log-dot.credito { background: var(--primary); }
.log-dot.debito  { background: var(--danger); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body {
  background: linear-gradient(135deg, #1A2E20 0%, #2D6A4F 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo img { height: 48px; margin: 0 auto; }
.auth-title { text-align: center; font-size: 1.4rem; margin-bottom: 6px; }
.auth-sub   { text-align: center; font-size: .88rem; color: var(--text-muted); margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .85rem; color: var(--text-muted); }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert-success { background: var(--success-pale); color: var(--primary); border-color: var(--accent); }
.alert-danger  { background: var(--danger-pale);  color: var(--danger);  border-color: var(--danger); }
.alert-warning { background: var(--warning-pale); color: #8B4513;        border-color: var(--warning); }
.alert-info    { background: var(--info-pale);    color: var(--info);    border-color: var(--info); }

/* ============================================================
   AVATAR UPLOAD
   ============================================================ */
.avatar-upload { position: relative; display: inline-block; cursor: pointer; }
.avatar-upload input[type="file"] { display: none; }

.avatar-preview {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 3px solid var(--border);
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-upload-btn {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 26px; height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* ============================================================
   SUBSCRIPTION / PLAN CARDS
   ============================================================ */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.plan-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}

.plan-card:hover { border-color: var(--accent); }
.plan-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.plan-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.plan-badge {
  position: absolute;
  top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 99px; white-space: nowrap;
}

.plan-name { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 8px; }
.plan-price { font-family: 'Fraunces', serif; font-size: 2.4rem; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.plan-price span { font-size: 1rem; font-family: 'DM Sans', sans-serif; font-weight: 400; color: var(--text-muted); }
.plan-per { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.plan-savings { display: inline-block; background: var(--success-pale); color: var(--primary); font-size: .65rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; margin-top: 6px; }

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] { position: relative; cursor: help; }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--sidebar-bg); color: #fff;
  font-size: .72rem; padding: 4px 10px; border-radius: 6px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--transition); z-index: 500;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   SUBSCRIPTION STATUS (topbar)
   ============================================================ */
.assinatura-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  text-decoration: none;
}

.assinatura-status.ativa    { background: var(--success-pale); color: var(--primary); }
.assinatura-status.vencida  { background: var(--danger-pale);  color: var(--danger); }
.assinatura-status.cancelada{ background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ============================================================
   UTILITIES
   ============================================================ */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.w-full { width: 100%; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

/* ============================================================
   RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1024px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .plan-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .filho-cards { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE — SMALL
   ============================================================ */
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .auth-card  { padding: 28px 20px; }
  .plan-cards { grid-template-columns: 1fr; }
  .medal-grid { grid-template-columns: repeat(3, 1fr); }
}