:root {
  --primary: #3a5a40;
  --primary-dark: #2f4834;
  --secondary: #588157;
  --bg-color: #f4f6f8;
  --surface: #ffffff;
  --text: #2b2d42;
  --text-muted: #6c757d;
  --border: #e2e8f0;
  --success: #25d366;
  --success-bg: #d1e7dd;
  --success-text: #0f5132;
  --warning-bg: #fff3cd;
  --warning-text: #664d03;
  --danger: #dc3545;
  --shadow: 0 4px 12px rgba(0,0,0,0.05);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body { background-color: var(--bg-color); color: var(--text); }

.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* LOGIN */
#loginScreen { align-items: center; justify-content: center; background: linear-gradient(135deg, #3a5a40, #344e41); padding: 20px; }
.login-card { background: var(--surface); padding: 32px 24px; border-radius: 16px; width: 100%; max-width: 380px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.logo-area { text-align: center; margin-bottom: 24px; color: var(--primary); }
.logo-icon { font-size: 42px; margin-bottom: 8px; }

/* FORMULÁRIOS & FILTROS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fafafa; outline: none;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.filter-grid { display: flex; gap: 10px; margin-bottom: 16px; }
.filter-grid input, .filter-grid select { padding: 10px; border-radius: 8px; border: 1px solid var(--border); flex: 1; }

/* DASHBOARD CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; border: 1px solid var(--border); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }

.stat-success .stat-icon { background: #d1e7dd; color: #0f5132; }
.stat-warning .stat-icon { background: #fff3cd; color: #664d03; }
.stat-info-card .stat-icon { background: #cff4fc; color: #055160; }
.stat-purple .stat-icon { background: #e2d9f3; color: #4a148c; }

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-info h3 { font-size: 20px; font-weight: 700; margin-top: 2px; }

/* GRÁFICOS */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.chart-box { background: var(--surface); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.chart-box h4 { font-size: 14px; margin-bottom: 14px; color: var(--primary); display: flex; align-items: center; gap: 8px; }
.canvas-container { position: relative; height: 230px; width: 100%; }

/* BOTÕES */
.btn { padding: 10px 14px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-whatsapp { background: var(--success); color: #fff; }
.btn-pay { background: #0d6efd; color: #fff; }
.btn-edit { background: #ffc107; color: #000; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.badge-pagamento { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-pago { background: var(--success-bg); color: var(--success-text); }
.badge-pendente { background: var(--warning-bg); color: var(--warning-text); }

/* LAYOUT E NAVBAR */
.navbar { background: var(--surface); height: 60px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary); }
.user-badge { display: flex; align-items: center; gap: 8px; font-size: 13px; }
#btnLogout { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; }

.tab-bar { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center; z-index: 100; }
.tab-item { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-muted); font-size: 11px; cursor: pointer; width: 100%; }
.tab-item.active { color: var(--primary); font-weight: 700; }

.content-area { padding: 16px; padding-bottom: 80px; max-width: 1000px; margin: 0 auto; width: 100%; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* CARDS */
.cards-list, .grid-list { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); padding: 16px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.card-user { display: flex; align-items: center; gap: 12px; }
.card-user img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* MODAL */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
.modal.active { display: flex; }
.modal-content { background: var(--surface); border-radius: 16px; width: 100%; max-width: 500px; padding: 20px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.close { font-size: 24px; cursor: pointer; color: var(--text-muted); }
.photo-upload-area { text-align: center; margin-bottom: 12px; }
.photo-upload-area img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 8px; }