:root {
  --bg-main: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 34, 52, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --danger: #f43f5e;
  --danger-glow: rgba(244, 63, 94, 0.2);
  --warning: #f59e0b;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --font: 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font);
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 3rem;
}

/* NAVBAR */
.navbar {
  border-bottom: 1px solid var(--border-card);
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-logo {
  font-size: 1.8rem;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.4rem 1rem 0.4rem 0.5rem;
  border-radius: 9999px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-phone {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.plan-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-tag.free {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.plan-tag.pago {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-ghost {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-card);
}

/* MAIN CONTENT */
.main-content {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ALERTA DE LIMITE */
.limit-alert {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  color: #fde68a;
}

.limit-icon {
  font-size: 1.6rem;
}

.limit-content strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
  color: #fbbf24;
}

.limit-content p {
  font-size: 0.85rem;
  color: #fde68a;
}

/* BUSCA DE TELEFONE */
.phone-bar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.phone-search-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.phone-search-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-with-button {
  display: flex;
  gap: 0.75rem;
}

.input-with-button input {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-with-button input:focus {
  border-color: var(--primary);
}

/* BOTOES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
}

/* LOADING */
.loading-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 1.4rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-icon {
  font-size: 1.3rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.text-success { color: #10b981; }
.text-danger { color: #f43f5e; }

.kpi-footer {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* BARRA DE PROGRESSO DO LIMITE */
.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  margin: 0.5rem 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.progress-bar-fill.warning {
  background: #f59e0b;
}

.progress-bar-fill.danger {
  background: #f43f5e;
}

/* CHARTS SECTION */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.chart-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.chart-wrapper {
  position: relative;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TABELA DE TRANSAÇÕES */
.table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 1.8rem;
  backdrop-filter: blur(12px);
}

.table-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.table-header-controls h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.table-header-controls .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-input, .select-filter {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  color: white;
  font-size: 0.85rem;
  outline: none;
}

.search-input:focus, .select-filter:focus {
  border-color: var(--primary);
}

.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 0.9rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
}

.data-table td {
  padding: 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.pill-type {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.pill-type.receita {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.pill-type.despesa {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.category-tag {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-icon-danger:hover {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.1);
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  width: 100%;
  max-width: 460px;
  padding: 1.8rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalEnter 0.25s ease-out;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
}

.radio-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.radio-label input {
  display: none;
}

.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
  color: white;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

/* NAV TABS */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(18, 24, 38, 0.6);
  padding: 0.3rem 0.4rem;
  border-radius: 12px;
  border: 1px solid var(--border-card);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  position: relative;
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tab-badge {
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  margin-left: 0.2rem;
}

/* TAB CONTENT SWITCHER */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PERIOD NAVIGATOR BAR */
.period-navigator-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.85rem 1.25rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.period-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-period-nav {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.btn-period-nav:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.period-active-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  padding: 0.45rem 1rem;
  border-radius: 10px;
}

.period-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-period-today {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-period-today:hover {
  color: white;
  border-color: var(--primary);
}

.period-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary);
  color: #a5b4fc;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-outline-primary:hover {
  background: rgba(99, 102, 241, 0.15);
  color: white;
}

.btn-outline-warning {
  background: transparent;
  border: 1px solid var(--warning);
  color: #fcd34d;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.15);
}

.btn-danger {
  background: var(--danger);
  border: 1px solid var(--danger);
  color: white;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px var(--danger-glow);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* WIDGET DE CONTAS NO DASHBOARD */
.bills-widget-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.bills-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.bills-widget-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fcd34d;
}

.bills-widget-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.bills-quick-list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.bill-quick-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bill-quick-item .desc {
  font-weight: 600;
  font-size: 0.9rem;
}

.bill-quick-item .val {
  color: #fcd34d;
  font-weight: 700;
  font-size: 1.05rem;
}

.bill-quick-item .due {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* FILTROS PILLS NO EXTRATO */
.extrato-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filters-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.pill-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #a5b4fc;
}

.custom-date-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.custom-date-fields {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.custom-date-fields label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.date-input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  color: white;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
  font-size: 0.88rem;
  outline: none;
}

.table-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 220px;
}

/* ABA CONTAS A VENCER */
.bills-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bill-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  padding: 1.2rem;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease-in-out;
}

.bill-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.bill-kpi-card.active-kpi-filter {
  outline: 2px solid var(--primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
}

.bill-kpi-card.pending { border-left: 4px solid var(--primary); }
.bill-kpi-card.debt { border-left: 4px solid #8b5cf6; }
.bill-kpi-card.debt-paid { border-left: 4px solid #14b8a6; }
.bill-kpi-card.alert { border-left: 4px solid var(--warning); }
.bill-kpi-card.overdue { border-left: 4px solid var(--danger); }
.bill-kpi-card.paid { border-left: 4px solid var(--success); }

.bill-kpi-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.bill-kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
}

.bill-kpi-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.bills-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.bills-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.bill-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s;
}

.bill-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.bill-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.bill-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.bill-badge.pendente { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.bill-badge.soon { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.bill-badge.atrasada { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.bill-badge.paga { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.bill-card-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.bill-card-info .bill-category {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bill-card-middle {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.bill-card-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
}

.bill-card-due {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bill-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-card);
}

/* Box de Progresso e Resumo de Parcelas */
.bill-parcelas-box {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bill-parcelas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.bill-parcelas-header .label {
  color: #94a3b8;
  font-weight: 500;
}

.bill-parcelas-header .fraction {
  color: var(--primary, #6366f1);
  font-weight: 700;
}

.bill-parcelas-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.bill-parcelas-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #10b981);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.bill-parcelas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.bill-parcelas-grid .item-title {
  color: #94a3b8;
  display: block;
  font-size: 0.72rem;
  margin-bottom: 2px;
}

.bill-parcelas-grid .item-val-pago {
  color: #10b981;
  font-size: 0.9rem;
  font-weight: 700;
}

.bill-parcelas-grid .item-val-total {
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 700;
}

.bill-parcelas-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bill-parcelas-footer .left {
  color: #f59e0b;
}

.bill-parcelas-footer .remaining-val {
  color: #f59e0b;
  font-weight: 700;
}

/* ABA MINHA CONTA */
.account-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.5rem;
}

.card-title-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.card-title-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.info-val {
  font-size: 0.95rem;
  color: white;
}

.token-copy-box {
  display: flex;
  gap: 0.5rem;
}

.token-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  color: #a5b4fc;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.plan-info-card {
  border-color: rgba(99, 102, 241, 0.3);
}

.plan-header-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.plan-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: white;
}

.plan-status-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.plan-usage-box {
  margin-bottom: 1.25rem;
}

.plan-usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.plan-comparison-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.plan-comparison-box h4 {
  font-size: 0.85rem;
  color: #a5b4fc;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.plan-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.danger-zone-card {
  background: rgba(244, 63, 94, 0.05);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.danger-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.danger-icon {
  font-size: 1.8rem;
}

.danger-header h3 {
  font-size: 1.1rem;
  color: #fda4af;
  font-weight: 700;
}

.danger-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.danger-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.danger-action-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.25rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
}

.danger-action-box h4 {
  font-size: 0.95rem;
  color: white;
  font-weight: 700;
}

.danger-action-box p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  padding: 0.9rem 1.4rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  font-size: 0.9rem;
  display: none;
  z-index: 2000;
}

.toast.show {
  display: block;
  animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======================================================== */
/* RESPONSIVIDADE MOBILE & TABLET (Telas <= 768px)          */
/* ======================================================== */
@media (max-width: 768px) {
  /* 1. Header Superior Compacto */
  .navbar {
    padding: 0.6rem 0;
  }

  .nav-container {
    padding: 0 1rem;
    position: relative;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand-logo {
    font-size: 1.5rem;
  }

  .brand h1 {
    font-size: 1.05rem;
  }

  .brand-subtitle {
    display: none;
  }

  .user-profile-badge {
    padding: 0.25rem 0.6rem 0.25rem 0.35rem;
    gap: 0.4rem;
  }

  .user-phone {
    display: none;
  }

  .user-name {
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
  }

  .plan-tag {
    font-size: 0.62rem;
    padding: 0.15rem 0.45rem;
  }

  .btn-ghost {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
  }

  /* 2. Menu de Navegação - Dock Inferior Estilo App Nativo */
  .nav-tabs {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: rgba(10, 14, 23, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    border-top: 1px solid var(--border-card) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    z-index: 1000 !important;
    display: flex !important;
    justify-content: space-around !important;
    gap: 0.25rem !important;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.6) !important;
  }

  .nav-tab {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.45rem 0.2rem !important;
    font-size: 0.68rem !important;
    gap: 0.25rem !important;
    border-radius: 12px !important;
    text-align: center !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    position: relative !important;
  }

  .nav-tab.active {
    color: #818cf8 !important;
    background: rgba(99, 102, 241, 0.18) !important;
    box-shadow: none !important;
  }

  .nav-tab .tab-icon {
    font-size: 1.25rem !important;
    line-height: 1 !important;
  }

  .nav-tab .tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    font-size: 0.62rem;
    padding: 0.05rem 0.35rem;
  }

  /* Espaçamento no corpo para o conteúdo não ficar escondido atrás do menu inferior */
  body {
    padding-bottom: 5.5rem !important;
  }

  .main-content {
    padding: 0 1rem;
    margin: 1rem auto;
  }

  /* 3. Barra de Navegação por Período */
  .period-navigator-bar {
    padding: 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .period-controls {
    justify-content: space-between;
    width: 100%;
  }

  .period-active-display {
    flex: 1;
    justify-content: center;
    padding: 0.4rem 0.5rem;
  }

  .period-text {
    font-size: 0.88rem;
  }

  .period-quick-actions {
    display: flex;
    width: 100%;
    gap: 0.5rem;
  }

  .period-quick-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 0.65rem 0.4rem;
  }

  /* 4. Filtros de Extrato com Rolagem Horizontal Suave */
  .filters-pills-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .filter-pills {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .pill-btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 0.45rem 0.85rem;
  }

  /* 5. Grids Responsivos */
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .charts-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .chart-wrapper {
    height: 220px;
  }

  .bills-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .bills-list-grid {
    grid-template-columns: 1fr;
  }

  .danger-actions-grid {
    grid-template-columns: 1fr;
  }

  /* 6. Modais Responsivos no Celular */
  .modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    padding: 1.5rem 1.25rem !important;
    border-radius: 16px !important;
  }

  .extrato-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .extrato-toolbar .btn {
    width: 100%;
  }

  /* 7. Toast Notificação Acima do Menu Inferior */
  .toast {
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    text-align: center;
  }
}

/* ========================================================
   AÇÕES DO EXTRATO & ESCOLHA DINÂMICA DE PLANOS
   ======================================================== */
.btn-icon-edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s;
  margin-right: 0.35rem;
}

.btn-icon-edit:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  transform: scale(1.08);
}

.user-plan-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.user-plan-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.user-plan-card.is-current {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.05);
}

.user-plan-card.is-featured {
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.user-plan-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.user-plan-price {
  font-size: 1.45rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.25rem;
}

.user-plan-price small {
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--text-muted);
}

.user-plan-features {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #cbd5e1;
}

.user-plan-features li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Switches e Chips de Lembrete */
.switch-toggle input:checked + .switch-slider {
  background-color: var(--color-primary, #3b82f6) !important;
}
.switch-toggle input:not(:checked) + .switch-slider {
  background-color: #64748b !important;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(20px);
}
.btn-weekday-chip.active {
  background: var(--color-primary, #3b82f6) !important;
  color: #ffffff !important;
  border-color: var(--color-primary, #3b82f6) !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.reminder-mode-chip.active {
  border-color: var(--color-primary, #3b82f6) !important;
  background: rgba(59, 130, 246, 0.1) !important;
}

