/* ==========================================================================
   Boletim Premium de Gestão Financeira — Frontend
   Paleta: violeta #7C3AED · Mobile-first · Público 35-65 anos
   ========================================================================== */

:root {
  --bpgf-primary:      #7C3AED;
  --bpgf-primary-dark: #5B21B6;
  --bpgf-primary-xd:   #4C1D95;
  --bpgf-primary-lite: #EDE9FE;
  --bpgf-primary-mid:  #DDD6FE;
  --bpgf-secondary:    #059669;
  --bpgf-accent:       #F59E0B;
  --bpgf-bg:           #F5F3FF;
  --bpgf-card-bg:      #FFFFFF;
  --bpgf-text:         #1F2937;
  --bpgf-text-light:   #6B7280;
  --bpgf-border:       #E5E7EB;
  --bpgf-success:      #059669;
  --bpgf-danger:       #DC2626;
  --bpgf-warning:      #D97706;
  --bpgf-info:         #2563EB;
  --bpgf-radius:       12px;
  --bpgf-radius-lg:    18px;
  --bpgf-shadow:       0 1px 8px rgba(124,58,237,.10);
  --bpgf-shadow-lg:    0 4px 24px rgba(124,58,237,.18);
  --bpgf-bottom-nav-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── PORTAL ROOT ──────────────────────────────────────────────────────────── */
.bpgf-portal {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--bpgf-text);
  background: var(--bpgf-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bpgf-bottom-nav-h); /* space for bottom nav on mobile */
}

/* ── TOP NAV ──────────────────────────────────────────────────────────────── */
.bpgf-nav {
  background: var(--bpgf-primary);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124,58,237,.3);
  position: sticky;
  top: 0;
  z-index: 200;
}
.bpgf-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}
.bpgf-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.3px;
}
.bpgf-nav-logo { font-size: 22px; }
.bpgf-nav-menu {
  display: flex;
  list-style: none;
  gap: 2px;
  flex: 1;
}
.bpgf-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.bpgf-nav-link:hover,
.bpgf-nav-active .bpgf-nav-link {
  background: rgba(255,255,255,.18);
  color: #fff;
}
.bpgf-nav-active .bpgf-nav-link {
  font-weight: 700;
}
.bpgf-nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.bpgf-nav-greeting { font-size: 14px; color: rgba(255,255,255,.9); white-space: nowrap; }

/* ── BOTTOM NAV — mobile app style ─────────────────────────────────────────── */

/*
 * Layout: CSS Grid with repeat(5, 1fr) — every column is mathematically equal.
 * The FAB in column 3 uses position:absolute so it floats above without
 * affecting column widths.
 */
.bpgf-bottom-nav {
  display: none;          /* shown on mobile via @media as display:grid */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 60px;
  grid-template-columns: repeat(5, 1fr); /* 5 perfectly equal columns */
  align-items: stretch;
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.07);
  z-index: 300;
  overflow: visible;      /* allow FAB to protrude above bar */
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* ── Every cell ────────────────────────────────────────────────────────────── */
.bpgf-bni {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: #9CA3AF;
  font-size: 10px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 0 2px 0;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease;
}
.bpgf-bni.is-active {
  color: var(--bpgf-primary);
}

/* ── Icon container — always exactly 20×20 px ──────────────────────────────── */
.bpgf-bni-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;        /* never grow, never shrink */
}
.bpgf-bni-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* ── Label ─────────────────────────────────────────────────────────────────── */
.bpgf-bni-label {
  display: block;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Center cell (column 3 — FAB) ──────────────────────────────────────────── */
.bpgf-bni-action {
  position: relative;    /* anchor for the absolute FAB */
  overflow: visible;     /* FAB floats above; don't clip it */
  /* vertical centering: keep cell aligned with others */
  justify-content: flex-end;
  padding-bottom: 8px;
}

/* ── FAB circle ─────────────────────────────────────────────────────────────── */
.bpgf-bni-fab {
  position: absolute;
  top: -10px;             /* floats 10px above the nav bar top edge */
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bpgf-primary);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.40);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bpgf-bni-fab svg {
  display: block;
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.bpgf-bni-action:active .bpgf-bni-fab {
  transform: translateX(-50%) scale(0.93);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.50);
}
.bpgf-bni-action.is-active .bpgf-bni-fab {
  background: var(--bpgf-primary-dark);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.50);
}
.bpgf-bni-action.is-active .bpgf-bni-fab {
  background: var(--bpgf-primary-dark);
}

/* ── MAIN CONTENT ─────────────────────────────────────────────────────────── */
.bpgf-main { flex: 1; padding: 0; }
.bpgf-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ── PAGE HEADING ─────────────────────────────────────────────────────────── */
.bpgf-page-head { margin-bottom: 24px; }
.bpgf-page-head h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--bpgf-primary);
  margin-bottom: 4px;
  letter-spacing: -.4px;
}
.bpgf-page-head p { color: var(--bpgf-text-light); font-size: 16px; }

/* ── GREETING CARD ────────────────────────────────────────────────────────── */
.bpgf-greeting-card {
  background: linear-gradient(135deg, var(--bpgf-primary) 0%, var(--bpgf-primary-dark) 100%);
  color: #fff;
  border-radius: var(--bpgf-radius-lg);
  padding: 24px 24px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: var(--bpgf-shadow-lg);
  gap: 12px;
}
.bpgf-greeting-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.4px; }
.bpgf-greeting-sub   { font-size: 15px; opacity: .85; }
.bpgf-greeting-date  { font-size: 14px; opacity: .8; text-align: right; white-space: nowrap; }

/* ── SUMMARY CARDS ────────────────────────────────────────────────────────── */
.bpgf-cards-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.bpgf-summary-card {
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  box-shadow: var(--bpgf-shadow);
  padding: 18px 16px;
  text-align: center;
  border-top: 4px solid var(--bpgf-border);
  transition: box-shadow .2s;
}
.bpgf-summary-card:hover { box-shadow: var(--bpgf-shadow-lg); }
.bpgf-card-income   { border-top-color: var(--bpgf-success); }
.bpgf-card-expense  { border-top-color: var(--bpgf-danger); }
.bpgf-card-positive { border-top-color: var(--bpgf-success); }
.bpgf-card-negative { border-top-color: var(--bpgf-danger); }
.bpgf-card-goals    { border-top-color: var(--bpgf-primary); }
.bpgf-summary-icon  { font-size: 28px; margin-bottom: 6px; }
.bpgf-summary-label { font-size: 13px; color: var(--bpgf-text-light); margin-bottom: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.bpgf-summary-value { font-size: 20px; font-weight: 800; color: var(--bpgf-text); letter-spacing: -.3px; }

/* ── TIP CARD ─────────────────────────────────────────────────────────────── */
.bpgf-tip-card {
  background: var(--bpgf-primary-lite);
  border-left: 4px solid var(--bpgf-primary);
  border-radius: var(--bpgf-radius);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.bpgf-tip-icon { font-size: 22px; flex-shrink: 0; margin-top: 1px; }
.bpgf-tip-content strong { display: block; margin-bottom: 4px; color: var(--bpgf-primary); font-size: 14px; text-transform: uppercase; letter-spacing: .5px; }
.bpgf-tip-content p { margin: 0; font-size: 15px; color: var(--bpgf-text); }

/* ── SHORTCUTS ────────────────────────────────────────────────────────────── */
.bpgf-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.bpgf-shortcut {
  background: var(--bpgf-card-bg);
  border: 2px solid var(--bpgf-border);
  border-radius: var(--bpgf-radius);
  padding: 18px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--bpgf-text);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.bpgf-shortcut:hover {
  border-color: var(--bpgf-primary);
  box-shadow: var(--bpgf-shadow);
  transform: translateY(-2px);
  color: var(--bpgf-primary);
}
.bpgf-shortcut-icon { font-size: 28px; }

/* ── SECTIONS ─────────────────────────────────────────────────────────────── */
.bpgf-section { margin-bottom: 28px; }
.bpgf-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--bpgf-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bpgf-primary-mid);
}
.bpgf-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bpgf-primary-mid);
}
.bpgf-section-header .bpgf-section-title { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.bpgf-link-more { font-size: 14px; color: var(--bpgf-primary); text-decoration: none; font-weight: 600; }
.bpgf-link-more:hover { text-decoration: underline; }

/* ── CARD ─────────────────────────────────────────────────────────────────── */
.bpgf-card {
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  box-shadow: var(--bpgf-shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* ── TABLE ────────────────────────────────────────────────────────────────── */
.bpgf-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bpgf-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  overflow: hidden;
  box-shadow: var(--bpgf-shadow);
}
.bpgf-table th {
  background: var(--bpgf-primary);
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.bpgf-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--bpgf-border);
  font-size: 15px;
  color: var(--bpgf-text);
}
.bpgf-table tr:last-child td { border-bottom: none; }
.bpgf-table tr:nth-child(even) td { background: var(--bpgf-bg); }
.bpgf-value-positive { color: var(--bpgf-success); font-weight: 700; }
.bpgf-value-negative { color: var(--bpgf-danger);  font-weight: 700; }

/* ── BADGES ───────────────────────────────────────────────────────────────── */
.bpgf-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}
.bpgf-type-income  { background: #D1FAE5; color: #065F46; }
.bpgf-type-expense { background: #FEE2E2; color: #991B1B; }

/* ── BUTTONS ──────────────────────────────────────────────────────────────── */
.bpgf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s, box-shadow .15s;
  letter-spacing: -.1px;
  -webkit-tap-highlight-color: transparent;
}
.bpgf-btn:hover   { transform: translateY(-1px); box-shadow: var(--bpgf-shadow); }
.bpgf-btn:active  { transform: translateY(0); }
.bpgf-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.bpgf-btn-primary  { background: var(--bpgf-primary); color: #fff; }
.bpgf-btn-primary:hover { background: var(--bpgf-primary-dark); color: #fff; }
.bpgf-btn-secondary{ background: var(--bpgf-card-bg); color: var(--bpgf-text); border-color: var(--bpgf-border); }
.bpgf-btn-secondary:hover { border-color: var(--bpgf-primary); color: var(--bpgf-primary); }
.bpgf-btn-success  { background: var(--bpgf-success); color: #fff; }
.bpgf-btn-success:hover { background: #047857; color: #fff; }
.bpgf-btn-danger   { background: var(--bpgf-danger); color: #fff; }
.bpgf-btn-danger:hover { background: #B91C1C; color: #fff; }
.bpgf-btn-outline  { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.bpgf-btn-outline:hover { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.8); color: #fff; box-shadow: none; }
.bpgf-btn-full     { width: 100%; }
.bpgf-btn-lg       { padding: 16px 28px; font-size: 18px; border-radius: 12px; }
.bpgf-btn-sm       { padding: 7px 14px; font-size: 14px; border-radius: 8px; }

/* ── FORMS ────────────────────────────────────────────────────────────────── */
.bpgf-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.bpgf-form-group  { display: flex; flex-direction: column; gap: 6px; }
.bpgf-form-full   { grid-column: 1 / -1; }
.bpgf-label { font-size: 15px; font-weight: 600; color: var(--bpgf-text); }
.bpgf-input,
.bpgf-select {
  padding: 13px 14px;
  border: 2px solid var(--bpgf-border);
  border-radius: 10px;
  font-size: 16px;
  color: var(--bpgf-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
.bpgf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%237C3AED' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}
.bpgf-input:focus,
.bpgf-select:focus {
  outline: none;
  border-color: var(--bpgf-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,.18);
}
.bpgf-input-sm { padding: 9px 12px; font-size: 15px; }
.bpgf-input-hint { font-size: 13px; color: var(--bpgf-text-light); }

.bpgf-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.bpgf-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 16px;
  border: 2px solid var(--bpgf-border);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
  flex: 1;
  justify-content: center;
}
.bpgf-radio-label:has(input:checked) {
  border-color: var(--bpgf-primary);
  background: var(--bpgf-primary-lite);
  color: var(--bpgf-primary);
}
.bpgf-radio-label input[type="radio"] { accent-color: var(--bpgf-primary); }

/* ── ALERTS ───────────────────────────────────────────────────────────────── */
.bpgf-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
}
.bpgf-alert-error   { background: #FEE2E2; color: #991B1B; border-left: 4px solid var(--bpgf-danger); }
.bpgf-alert-success { background: #D1FAE5; color: #065F46; border-left: 4px solid var(--bpgf-success); }

/* ── LOGIN PAGE ───────────────────────────────────────────────────────────── */
.bpgf-login-wrapper {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bpgf-primary-xd) 0%, var(--bpgf-primary) 55%, #A78BFA 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bpgf-login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(76,29,149,.3);
  padding: 44px 36px 40px;
  width: 100%;
  max-width: 420px;
}
.bpgf-login-header   { text-align: center; margin-bottom: 32px; }
.bpgf-login-icon     { font-size: 52px; margin-bottom: 14px; line-height: 1; }
.bpgf-login-title    { font-size: 28px; font-weight: 900; color: var(--bpgf-primary); margin-bottom: 6px; letter-spacing: -.5px; }
.bpgf-login-subtitle { font-size: 15px; color: var(--bpgf-text-light); }
.bpgf-login-footer   { text-align: center; margin-top: 24px; font-size: 14px; color: var(--bpgf-text-light); }

/* ── MONTH SELECTOR ───────────────────────────────────────────────────────── */
.bpgf-month-selector { margin-bottom: 20px; }
.bpgf-inline-form    { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bpgf-inline-form label { font-weight: 600; font-size: 15px; }
.bpgf-inline-form select {
  padding: 9px 14px;
  border: 2px solid var(--bpgf-border);
  border-radius: 10px;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}
.bpgf-inline-form select:focus {
  outline: none;
  border-color: var(--bpgf-primary);
}

/* ── CATEGORY BARS ────────────────────────────────────────────────────────── */
.bpgf-category-list { display: flex; flex-direction: column; gap: 14px; }
.bpgf-category-row  { display: flex; align-items: center; gap: 10px; }
.bpgf-category-name { min-width: 110px; font-size: 14px; font-weight: 600; }
.bpgf-category-bar-wrap { flex: 1; background: var(--bpgf-primary-mid); border-radius: 8px; height: 10px; overflow: hidden; }
.bpgf-category-bar  { height: 10px; background: var(--bpgf-primary); border-radius: 8px; transition: width .5s; }
.bpgf-category-value{ min-width: 80px; text-align: right; font-size: 14px; font-weight: 600; }
.bpgf-category-pct  { min-width: 36px; text-align: right; font-size: 13px; color: var(--bpgf-text-light); }

/* ── GOALS ────────────────────────────────────────────────────────────────── */
.bpgf-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.bpgf-goal-card {
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  box-shadow: var(--bpgf-shadow);
  padding: 20px;
  border-top: 4px solid var(--bpgf-primary);
}
.bpgf-goal-completed { border-top-color: var(--bpgf-success); opacity: .85; }
.bpgf-goal-header    { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 8px; }
.bpgf-goal-title     { font-size: 17px; font-weight: 700; color: var(--bpgf-text); }
.bpgf-goal-type-badge { font-size: 12px; background: var(--bpgf-bg); color: var(--bpgf-text-light); padding: 3px 10px; border-radius: 20px; white-space: nowrap; font-weight: 600; }
.bpgf-goal-amounts   { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 15px; align-items: baseline; }
.bpgf-goal-current   { font-weight: 800; color: var(--bpgf-primary); }
.bpgf-goal-target    { color: var(--bpgf-text-light); }
.bpgf-goal-pct       { font-weight: 800; font-size: 20px; color: var(--bpgf-primary); }
.bpgf-progress-bar   { background: var(--bpgf-primary-mid); border-radius: 8px; height: 12px; margin-bottom: 8px; overflow: hidden; }
.bpgf-progress-fill  { height: 12px; background: linear-gradient(90deg, var(--bpgf-primary), #A78BFA); border-radius: 8px; transition: width .6s ease; }
.bpgf-goal-remaining  { font-size: 14px; color: var(--bpgf-text-light); margin-bottom: 6px; }
.bpgf-goal-motivation { font-size: 14px; color: var(--bpgf-secondary); font-style: italic; margin-bottom: 12px; }
.bpgf-goal-progress-form { display: flex; gap: 8px; margin-bottom: 10px; }
.bpgf-goal-actions   { display: flex; gap: 8px; justify-content: flex-end; }
.bpgf-details-summary { cursor: pointer; font-size: 17px; font-weight: 700; color: var(--bpgf-primary); padding: 10px 0; list-style: none; }
.bpgf-details-summary::-webkit-details-marker { display: none; }

/* ── LOTTERY ──────────────────────────────────────────────────────────────── */
.bpgf-lottery-sync {
  font-size: 12px;
  color: var(--bpgf-text-light);
  margin: 0;
  opacity: .75;
}

.bpgf-lottery-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.bpgf-tab-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid var(--bpgf-border);
  color: var(--bpgf-text);
  background: #fff;
  transition: all .15s;
}
.bpgf-tab-btn.active,
.bpgf-tab-btn:hover {
  background: var(--bpgf-primary);
  color: #fff;
  border-color: var(--bpgf-primary);
  box-shadow: var(--bpgf-shadow);
}

.bpgf-draw-card {
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  box-shadow: var(--bpgf-shadow);
  padding: 16px 18px;
  margin-bottom: 10px;
  border-left: 4px solid var(--bpgf-primary);
}
.bpgf-draw-meta { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; }
.bpgf-draw-number { font-weight: 700; color: var(--bpgf-primary); }
.bpgf-draw-date   { color: var(--bpgf-text-light); }
.bpgf-draw-balls  { display: flex; flex-wrap: wrap; gap: 8px; }

.bpgf-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bpgf-primary) 0%, #A78BFA 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(124,58,237,.3);
  flex-shrink: 0;
}
.bpgf-ball-sm   { width: 34px; height: 34px; font-size: 13px; }
.bpgf-ball-cold { background: linear-gradient(135deg, #9CA3AF 0%, #6B7280 100%); box-shadow: 0 2px 6px rgba(0,0,0,.15); }

.bpgf-two-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.bpgf-note { font-size: 13px; color: var(--bpgf-text-light); font-style: italic; margin-bottom: 10px; }

.bpgf-freq-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.bpgf-freq-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bpgf-card-bg);
  border-radius: 10px;
  border: 2px solid var(--bpgf-border);
  min-width: 54px;
}
.bpgf-freq-1 { border-color: #C4B5FD; background: #F5F3FF; }
.bpgf-freq-2 { border-color: #A78BFA; background: #EDE9FE; }
.bpgf-freq-3 { border-color: #7C3AED; background: #DDD6FE; }
.bpgf-freq-4 { border-color: #DC2626; background: #FEE2E2; }
.bpgf-freq-5 { border-color: #991B1B; background: #FCA5A5; }
.bpgf-freq-num { font-size: 17px; font-weight: 800; }
.bpgf-freq-cnt { font-size: 12px; color: var(--bpgf-text-light); }

.bpgf-stats-table td:first-child { padding: 8px 12px; }
.bpgf-mini-bar  { background: var(--bpgf-primary-mid); border-radius: 4px; height: 8px; width: 100px; overflow: hidden; }
.bpgf-mini-fill { height: 8px; border-radius: 4px; }
.bpgf-fill-hot  { background: var(--bpgf-danger); }
.bpgf-fill-cold { background: #9CA3AF; }

/* ── ARTICLES ─────────────────────────────────────────────────────────────── */
.bpgf-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.bpgf-filter-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid var(--bpgf-border);
  color: var(--bpgf-text);
  background: #fff;
  transition: all .15s;
}
.bpgf-filter-btn.active,
.bpgf-filter-btn:hover {
  background: var(--bpgf-primary);
  color: #fff;
  border-color: var(--bpgf-primary);
}

.bpgf-articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bpgf-article-card {
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  box-shadow: var(--bpgf-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s, transform .1s;
}
.bpgf-article-card:hover { box-shadow: var(--bpgf-shadow-lg); transform: translateY(-2px); }
.bpgf-article-cat {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bpgf-primary-lite);
  color: var(--bpgf-primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
.bpgf-article-card-title { font-size: 17px; font-weight: 700; color: var(--bpgf-text); line-height: 1.35; }
.bpgf-article-card-title a { color: inherit; text-decoration: none; }
.bpgf-article-card-title a:hover { color: var(--bpgf-primary); }
.bpgf-article-summary { font-size: 15px; color: var(--bpgf-text-light); flex: 1; }
.bpgf-article-time    { font-size: 13px; color: var(--bpgf-text-light); }

/* Article full view */
.bpgf-article-full { max-width: 720px; }
.bpgf-article-header { margin: 0 0 24px; }
.bpgf-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--bpgf-primary); text-decoration: none; font-weight: 600; margin-bottom: 16px; }
.bpgf-back-link:hover { text-decoration: underline; }
.bpgf-article-title { font-size: 26px; font-weight: 900; color: var(--bpgf-text); margin: 8px 0 8px; letter-spacing: -.4px; }
.bpgf-article-meta  { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--bpgf-text-light); }
.bpgf-article-summary { font-size: 17px; color: var(--bpgf-text-light); margin-bottom: 20px; font-style: italic; }
.bpgf-article-body  { font-size: 17px; line-height: 1.75; color: var(--bpgf-text); }
.bpgf-article-body p { margin-bottom: 16px; }

/* ── MODAL ────────────────────────────────────────────────────────────────── */
.bpgf-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.bpgf-modal-content {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 -8px 32px rgba(0,0,0,.2);
  max-height: 90vh;
  overflow-y: auto;
}
.bpgf-modal-content h3 { font-size: 20px; font-weight: 800; margin-bottom: 20px; color: var(--bpgf-primary); }
.bpgf-modal-actions    { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */
.bpgf-empty-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--bpgf-card-bg);
  border-radius: var(--bpgf-radius);
  color: var(--bpgf-text-light);
  font-size: 16px;
  box-shadow: var(--bpgf-shadow);
}
.bpgf-empty-state p { margin-bottom: 8px; }
.bpgf-empty-state p:last-child { margin-bottom: 0; }

/* ── FOOTER ───────────────────────────────────────────────────────────────── */
.bpgf-footer {
  background: var(--bpgf-primary-xd);
  color: rgba(255,255,255,.65);
  padding: 20px;
  font-size: 13px;
  text-align: center;
  margin-top: auto;
}
.bpgf-footer-inner    { max-width: 960px; margin: 0 auto; }
.bpgf-footer-copy     { margin-bottom: 4px; color: rgba(255,255,255,.8); }
.bpgf-footer-disclaimer { font-size: 12px; opacity: .6; }

/* ── RESPONSIVE: TABLET ───────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .bpgf-cards-row    { grid-template-columns: repeat(4, 1fr); }
  .bpgf-shortcuts    { grid-template-columns: repeat(4, 1fr); }
}

/* ── RESPONSIVE: MOBILE (≤ 767px) ────────────────────────────────────────── */
@media (max-width: 767px) {
  :root { --bpgf-bottom-nav-h: 60px; }

  /* Show bottom nav, hide top nav tabs */
  .bpgf-bottom-nav  { display: grid; grid-template-columns: repeat(5, 1fr); }
  .bpgf-nav-menu    { display: none; }
  .bpgf-nav-user    { margin-left: auto; }
  .bpgf-nav-greeting{ display: none; }

  .bpgf-portal      { padding-bottom: var(--bpgf-bottom-nav-h); }

  .bpgf-greeting-card  { flex-direction: column; align-items: flex-start; }
  .bpgf-greeting-title { font-size: 22px; }
  .bpgf-greeting-date  { text-align: left; }

  .bpgf-login-card  { padding: 32px 24px 28px; }
  .bpgf-login-title { font-size: 24px; }

  .bpgf-container   { padding: 16px 14px; }

  .bpgf-form-row    { grid-template-columns: 1fr; }
  .bpgf-two-cols    { grid-template-columns: 1fr; }

  .bpgf-table th,
  .bpgf-table td    { padding: 9px 10px; font-size: 13px; }

  .bpgf-ball  { width: 36px; height: 36px; font-size: 13px; }
  .bpgf-ball-sm { width: 28px; height: 28px; font-size: 11px; }

  .bpgf-modal { align-items: flex-end; }
  .bpgf-modal-content { border-radius: 20px 20px 0 0; padding: 24px 18px; }

  .bpgf-summary-value { font-size: 18px; }

  /* bottom nav adjustments for notch phones */
  .bpgf-bottom-nav {
    height: calc(var(--bpgf-bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overflow: visible;
  }
}

/* ── DESKTOP ──────────────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .bpgf-portal     { padding-bottom: 0; }
  .bpgf-bottom-nav { display: none !important; }
  .bpgf-nav-menu   { display: flex !important; }
}

@media print {
  .bpgf-nav, .bpgf-footer, .bpgf-btn, .bpgf-bottom-nav { display: none !important; }
  .bpgf-portal { background: #fff; padding-bottom: 0; }
}

/* ── PROFILE TAB ──────────────────────────────────────────────────────────── */
.bpgf-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  text-align: center;
  gap: 10px;
}
.bpgf-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bpgf-primary) 0%, #A78BFA 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124,58,237,.3);
  margin-bottom: 4px;
}
.bpgf-profile-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--bpgf-text);
  letter-spacing: -.3px;
}
.bpgf-profile-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
.bpgf-status-active   { background: #D1FAE5; color: #065F46; }
.bpgf-status-inactive { background: #FEE2E2; color: #991B1B; }

.bpgf-profile-rows { padding: 8px 0; }
.bpgf-profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--bpgf-border);
  gap: 12px;
}
.bpgf-profile-row:last-child { border-bottom: none; }
.bpgf-profile-label {
  font-size: 14px;
  color: var(--bpgf-text-light);
  font-weight: 500;
  flex-shrink: 0;
}
.bpgf-profile-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--bpgf-text);
  text-align: right;
  word-break: break-word;
}
