/* ═══════════════════════════════════════════════════════════
   LÍDERES DO BRASIL — STYLE.CSS
   Design System: Azul escuro premium + dourado/âmbar
═══════════════════════════════════════════════════════════ */

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

:root {
  --primary:       #1a2e5a;
  --primary-light: #2a4580;
  --primary-dark:  #0f1e3d;
  --accent:        #f0a500;
  --accent-light:  #f5c040;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --bg:            #f0f4f9;
  --surface:       #ffffff;
  --surface2:      #f8fafc;
  --border:        #e2e8f0;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --text-light:    #94a3b8;
  --sidebar-w:     260px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:     0 8px 32px rgba(0,0,0,.12);
  --transition:    .2s ease;
}

html { font-size: 15px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── LOGIN ─────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  padding: 1rem;
}
.login-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 2rem; background: #fff; border-radius: 12px; padding: 1rem .5rem .5rem; }
.logo-circle {
  display: none;
}
.login-logo-img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: .75rem;
}
.login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.login-logo p  { color: var(--text-muted); font-size: .875rem; }
.login-form .form-group { margin-bottom: 1.25rem; }
.login-form label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .05em; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: .875rem; }
.input-icon input {
  width: 100%; padding: .75rem .75rem .75rem 2.5rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; background: var(--surface2);
}
.input-icon input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,46,90,.12); }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; border-radius: var(--radius-sm);
  padding: .6rem .9rem; font-size: .85rem; margin-bottom: 1rem;
}
.btn-login {
  width: 100%; padding: .85rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: opacity var(--transition), transform var(--transition);
  letter-spacing: .03em;
}
.btn-login:hover { opacity: .9; transform: translateY(-1px); }
.login-hint { text-align: center; margin-top: 1.5rem; color: var(--text-light); }

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

/* ── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon i { color: var(--primary-dark); font-size: 1rem; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { color: #fff; font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-role { color: var(--accent-light); font-size: .72rem; font-weight: 500; margin-top: .1rem; }

.sidebar-nav { flex: 1; padding: 1rem .75rem; overflow-y: auto; }
.nav-section-title {
  color: rgba(255,255,255,.4);
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: .75rem .5rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.75);
  font-size: .875rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  margin-bottom: .15rem;
}
.nav-item i { width: 18px; text-align: center; font-size: .9rem; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-item.active { background: rgba(240,165,0,.2); color: var(--accent-light); font-weight: 600; }
.nav-item.active i { color: var(--accent); }

.sidebar-footer {
  padding: 1rem .75rem;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: .5rem;
}
.sidebar-user { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem; color: var(--primary-dark);
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: rgba(255,255,255,.5); font-size: .72rem; }
.btn-logout {
  background: rgba(255,255,255,.1); border: none;
  color: rgba(255,255,255,.7); width: 32px; height: 32px;
  border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.btn-logout:hover { background: rgba(239,68,68,.3); color: #fff; }

/* ── MAIN CONTENT ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: .875rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.menu-toggle {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.1rem; padding: .25rem;
  display: none;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--text); flex: 1; }
.current-date { color: var(--text-muted); font-size: .82rem; font-weight: 500; }

.pages-container { padding: 1.5rem; flex: 1; }

/* ── PAGE (tela) ───────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── SECTION HEADER ─────────────────────────────────────── */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.section-header h2 { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.section-header p  { color: var(--text-muted); font-size: .875rem; margin-top: .2rem; }

/* ── STATS GRID ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .5rem;
  border-left: 4px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.blue   { border-left-color: var(--info); }
.stat-card.green  { border-left-color: var(--success); }
.stat-card.yellow { border-left-color: var(--warning); }
.stat-card.red    { border-left-color: var(--danger); }
.stat-card.gold   { border-left-color: var(--accent); }
.stat-icon { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .95rem; }
.stat-icon.blue   { background: #eff6ff; color: var(--info); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.yellow { background: #fffbeb; color: var(--warning); }
.stat-icon.red    { background: #fef2f2; color: var(--danger); }
.stat-icon.gold   { background: #fffbeb; color: var(--accent); }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.stat-sub   { font-size: .78rem; color: var(--text-light); }

/* ── CARDS / PANELS ─────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.25rem;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
}
.card-header h3 { font-size: 1rem; font-weight: 700; color: var(--text); }
.card-body { padding: 1.25rem; }

/* ── TABLE ──────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table.data-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
}
table.data-table thead tr {
  background: var(--surface2); border-bottom: 2px solid var(--border);
}
table.data-table thead th {
  padding: .75rem 1rem; text-align: left;
  font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); white-space: nowrap;
}
table.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
table.data-table tbody tr:hover { background: var(--surface2); }
table.data-table tbody td { padding: .7rem 1rem; vertical-align: middle; }
table.data-table tbody td:first-child { font-weight: 600; }

/* ── BADGES / PILLS ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .6rem; border-radius: 99px;
  font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.badge-green   { background: #dcfce7; color: #166534; }
.badge-red     { background: #fee2e2; color: #991b1b; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-gold    { background: #fef3c7; color: #92400e; }
.badge-purple  { background: #f3e8ff; color: #6b21a8; }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress-bar-wrap { background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.pb-green  { background: var(--success); }
.pb-yellow { background: var(--warning); }
.pb-red    { background: var(--danger); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.1rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .85rem; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent  { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover  { background: var(--accent-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; }
.btn-icon { padding: .45rem .55rem; }

/* ── FORM ───────────────────────────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: .4rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; color: var(--text);
  background: var(--surface2);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26,46,90,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: center; gap: .6rem; cursor: pointer; }
.form-check input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.form-check label { font-size: .875rem; color: var(--text); cursor: pointer; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.1rem; cursor: pointer; padding: .25rem;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  background: var(--primary-dark); color: #fff;
  padding: .75rem 1.25rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: fadeIn .25s ease;
  max-width: 320px;
}
.toast.success { background: #166534; }
.toast.error   { background: #991b1b; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── ENGAJAMENTO MEMBRO ─────────────────────────────────── */
.membro-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); padding: 1rem 1.1rem;
  margin-bottom: .75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.membro-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.membro-card-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.membro-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.membro-info { flex: 1; min-width: 0; }
.membro-nome { font-weight: 700; font-size: .92rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.membro-sub  { font-size: .78rem; color: var(--text-muted); }
.membro-metrics { display: flex; gap: 1rem; flex-wrap: wrap; }
.metric-item { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-muted); }
.metric-dot { width: 8px; height: 8px; border-radius: 50%; }
.metric-dot.green  { background: var(--success); }
.metric-dot.red    { background: var(--danger); }
.metric-dot.yellow { background: var(--warning); }
.metric-dot.gray   { background: var(--text-light); }

/* ── PRESIDENT BOARD CARD ───────────────────────────────── */
.board-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1.5px solid var(--border); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.board-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.board-card-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  padding: 1rem 1.25rem; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
}
.board-card-header h4 { font-size: .95rem; font-weight: 700; }
.board-card-body { padding: 1rem 1.25rem; }
.board-meta { display: flex; gap: 1.5rem; margin-top: .5rem; }
.board-meta-item { display: flex; flex-direction: column; gap: .1rem; }
.board-meta-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.board-meta-value { font-size: 1.3rem; font-weight: 800; color: var(--text); }

/* ── TABS ───────────────────────────────────────────────── */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--border); }
.tab-btn {
  padding: .6rem 1.1rem; background: none; border: none;
  font-family: inherit; font-size: .875rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── UTILS ──────────────────────────────────────────────── */
.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-1  { flex: 1; }
.gap-sm  { gap: .5rem; }
.gap     { gap: .75rem; }
.gap-lg  { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.wrap    { flex-wrap: wrap; }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: .82rem; }
.fw-bold    { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: .75rem; opacity: .35; display: block; }
.empty-state p  { font-size: .9rem; }

/* ── GRIDS RESPONSIVOS ──────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }

/* ── CHECK ROW ──────────────────────────────────────────── */
.check-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 0; border-bottom: 1px solid var(--border); gap: 1rem;
}
.check-row:last-child { border-bottom: none; }
.check-row-info { flex: 1; min-width: 0; }
.check-row-name { font-weight: 600; font-size: .9rem; }
.check-row-sub  { font-size: .78rem; color: var(--text-muted); }
.check-row-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* ── SCORE INDICATOR ────────────────────────────────────── */
.score-circle {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem;
  flex-shrink: 0;
}
.score-a { background: #dcfce7; color: #166534; }
.score-b { background: #fef9c3; color: #854d0e; }
.score-c { background: #fee2e2; color: #991b1b; }

/* ── FORM CONTROL INLINE ────────────────────────────────── */
.form-control-sm {
  padding: .45rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
}
.form-control-sm:focus { border-color: var(--primary); }

/* ── MEMBRO CARD SELECTED ───────────────────────────────── */
.membro-card.selected { border-color: var(--primary); background: #f0f4ff; }

/* ── SIDEBAR OVERLAY (mobile) ───────────────────────────── */
@media (max-width: 900px) {
  .sidebar.open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: -1;
  }
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex !important; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row.col3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .pages-container { padding: 1rem; }
  .board-meta { flex-wrap: wrap; gap: .75rem; }
}
