:root {
  --primary: #007FFC;
  --primary-dark: #0066CC;
  --primary-darker: #0052A3;
  --primary-light: #E6F2FF;
  --primary-muted: #B3D9FF;
  --bg: #F0F5FA;
  --surface: #FFFFFF;
  --text: #1A2332;
  --text-muted: #5C6B7F;
  --border: #DDE5EF;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --purple: #8B5CF6;
  --purple-light: #EDE9FE;
  --shadow: 0 2px 12px rgba(0, 79, 204, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 79, 204, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, sans-serif;
  --sidebar-w: 260px;
  --topbar-h: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ========== AUTH ========== */
.auth-app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #007FFC 0%, #0052A3 100%);
  position: relative;
  overflow: hidden;
}

.auth-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.auth-screen--active { display: flex; }

.auth-decoration {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
  pointer-events: none;
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem;
  width: min(420px, 100%);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s ease;
}

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

.auth-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.75rem;
}

.app-logo {
  display: block;
  object-fit: contain;
}

.app-logo--auth {
  height: 72px;
  width: auto;
  margin: 0 auto;
}

.app-logo--sidebar {
  height: 36px;
  width: auto;
}

.app-logo--topbar {
  height: 28px;
  width: auto;
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .app-logo--topbar { display: none; }
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
}

.link-btn:hover { color: var(--primary-dark); }

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  transition: transform 0.3s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  padding: calc(0.6rem + env(safe-area-inset-top)) 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar__nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.sidebar__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar__link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar__link.active {
  background: var(--primary);
  color: #fff;
}

.sidebar__footer {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar__user strong {
  display: block;
  font-size: 0.85rem;
}

.sidebar__user small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.app-body {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--topbar-h);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.topbar__title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.month-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
}

.month-picker__btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--primary);
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}

.month-picker__btn:hover { background: var(--primary-light); }

.month-picker span {
  font-size: 0.88rem;
  font-weight: 600;
  min-width: 120px;
  text-align: center;
}

.content {
  flex: 1;
  padding: 1.5rem;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page--active { display: block; }

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

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

.sidebar-overlay.show { display: block; }

/* ========== COMPONENTS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.btn--ghost:hover { background: var(--bg); }

.btn--danger {
  background: var(--danger-light);
  color: var(--danger);
  border: none;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
}

.btn--danger:hover { background: #FECACA; }

.btn--sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; }
.btn--block { width: 100%; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group--full { grid-column: 1 / -1; }

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

.form-group input,
.form-group select,
.form-group textarea {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 127, 252, 0.15);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ========== STATS ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.stat-card__icon--blue { background: var(--primary-light); }
.stat-card__icon--green { background: var(--success-light); }
.stat-card__icon--orange { background: var(--warning-light); }
.stat-card__icon--purple { background: var(--purple-light); }

.stat-card__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
}

.stat-card__value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

/* ========== PANELS ========== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.panel__header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.panel__body { padding: 1.25rem; }
.panel__body--flush { padding: 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ========== CHARTS ========== */
.bar-chart { display: flex; flex-direction: column; gap: 0.75rem; }

.bar-item {
  display: grid;
  grid-template-columns: 120px 1fr 80px;
  align-items: center;
  gap: 0.75rem;
}

.bar-item__label {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-item__track {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}

.bar-item__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-muted));
  border-radius: 999px;
  transition: width 0.5s ease;
  min-width: 4px;
}

.bar-item__value {
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
}

/* ========== TABLES ========== */
.table-wrap { overflow-x: auto; }

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

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.badge--pago { background: var(--success-light); color: #047857; }
.badge--pendente { background: var(--warning-light); color: #B45309; }

.table-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-icon {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover { background: var(--primary-muted); }
.btn-icon--danger { background: var(--danger-light); color: var(--danger); }
.btn-icon--danger:hover { background: #FECACA; }

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
}

/* ========== FILTERS ========== */
.page-toolbar {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-select,
.filter-search {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.filter-search { min-width: 200px; }

.inline-form {
  display: flex;
  gap: 0.5rem;
}

.inline-form input {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-width: 260px;
}

/* ========== MONTH OVERVIEW ========== */
.month-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.month-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.month-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.month-card__label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========== PAYMENT / COST GRIDS ========== */
.payment-grid,
.cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.payment-card,
.cost-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  position: relative;
}

.payment-card__icon,
.cost-card__icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.payment-card__name,
.cost-card__name {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
}

.payment-card__total,
.cost-card__total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.payment-card__count,
.cost-card__count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cost-card__delete {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.cost-card:hover .cost-card__delete { opacity: 1; }
.cost-card__delete:hover { color: var(--danger); }

.cost-card__color {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 0.75rem;
}

/* ========== FORECAST ========== */
.forecast-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.forecast-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
}

.forecast-card--light {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.forecast-card__label {
  font-size: 0.82rem;
  opacity: 0.85;
  display: block;
  margin-bottom: 0.25rem;
}

.forecast-card--light .forecast-card__label { opacity: 1; color: var(--text-muted); }

.forecast-card__value {
  font-size: 1.5rem;
  font-weight: 700;
}

.badge--recurring {
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* ========== OCR ========== */
.ocr-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone__icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.upload-zone p { font-weight: 500; margin-bottom: 0.25rem; }
.upload-zone small { color: var(--text-muted); font-size: 0.8rem; }

.ocr-preview {
  margin-bottom: 1rem;
  text-align: center;
}

.ocr-preview img {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.ocr-progress { margin-top: 1rem; }

.ocr-progress__bar {
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.ocr-progress__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s;
}

.ocr-progress span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.ocr-text {
  margin-bottom: 1rem;
}

.ocr-text label {
  font-size: 0.82rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.35rem;
}

.ocr-text pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-size: 0.75rem;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.ocr-form { margin-top: 0.5rem; }

/* ========== QR CUPOM ========== */
.qr-cupom__hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  text-align: center;
}

.qr-reader {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--primary-light);
  background: #000;
  min-height: 280px;
}

.qr-reader video {
  border-radius: var(--radius);
}

.qr-cupom__actions {
  margin-top: 1rem;
}

.qr-cupom__file {
  cursor: pointer;
  text-align: center;
}

.qr-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  margin-top: 1rem;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

.qr-status p {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary-dark);
}

.qr-result {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--success-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #047857;
}

.qr-result strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

/* ========== MODAL ========== */
.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 520px;
  width: 92vw;
  box-shadow: var(--shadow-lg);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal__header h3 { font-size: 1.05rem; }

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal__body { padding: 1.5rem; }

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.35s ease;
  z-index: 1000;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { background: var(--primary-dark); }
.toast.error { background: var(--danger); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .ocr-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }

  .app-body {
    margin-left: 0;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .menu-toggle { display: flex; }

  .stats-grid,
  .month-overview,
  .forecast-summary { grid-template-columns: 1fr 1fr; }

  .stat-card { padding: 1rem; }
  .stat-card__value { font-size: 1.1rem; }
  .stat-card__icon { width: 40px; height: 40px; font-size: 1.1rem; }

  .form-grid { grid-template-columns: 1fr; }

  .topbar {
    padding: calc(0.6rem + env(safe-area-inset-top)) 1rem 0.6rem;
  }

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

  .topbar__actions .btn--primary:not(.bottom-nav *) {
    display: none;
  }

  .month-picker span { min-width: auto; font-size: 0.82rem; }

  .bar-item { grid-template-columns: 80px 1fr 65px; gap: 0.5rem; }

  .filters { width: 100%; }
  .filter-select, .filter-search { flex: 1; min-width: 0; }

  .inline-form { flex-direction: column; width: 100%; }
  .inline-form input { min-width: 0; width: 100%; }

  .content { padding: 1rem; padding-bottom: 0.5rem; }

  .ocr-layout { grid-template-columns: 1fr; }

  /* Tabelas viram cards no mobile */
  .data-table thead { display: none; }

  .data-table tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.75rem;
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border: none;
    font-size: 0.85rem;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .data-table td.table-actions {
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
  }

  .data-table td.table-actions::before { display: none; }

  .data-table tbody tr:hover { background: var(--surface); }

  .empty-row td { display: block; text-align: center; }
  .empty-row td::before { display: none; }

  .payment-grid,
  .cost-grid { grid-template-columns: 1fr 1fr; }

  .plans-grid { grid-template-columns: 1fr; }

  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ========== BOTTOM NAV (MOBILE) ========== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  z-index: 300;
  justify-content: space-around;
  align-items: flex-end;
  box-shadow: 0 -4px 20px rgba(0, 79, 204, 0.08);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  min-width: 56px;
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav__item.active { color: var(--primary); }

.bottom-nav__item--fab {
  background: var(--primary);
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin-top: -20px;
  box-shadow: 0 4px 16px rgba(0, 127, 252, 0.4);
  justify-content: center;
}

.bottom-nav__item--fab svg { width: 26px; height: 26px; }

@media (max-width: 768px) {
  .bottom-nav { display: flex; }
}

/* ========== PLANOS ========== */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.plan-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  position: relative;
  box-shadow: var(--shadow);
}

.plan-card--featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.plan-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}

.plan-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

.plan-card__price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.plan-card__price small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-card__desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.plan-card ul {
  list-style: none;
  margin-bottom: 1.25rem;
}

.plan-card li {
  font-size: 0.88rem;
  padding: 0.3rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.plan-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.plan-active-banner {
  background: var(--success-light);
  color: #047857;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.plan-modal-desc {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ========== TERMOS / CHECKBOX ========== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  cursor: pointer;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.terms-content {
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
}

.terms-content h3 { color: var(--primary); margin-bottom: 0.75rem; }

.modal--wide { max-width: 640px; }

/* ========== LOADING ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.empty-chart {
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

@media (max-width: 480px) {
  .stats-grid,
  .month-overview,
  .forecast-summary { grid-template-columns: 1fr; }

  .payment-grid,
  .cost-grid { grid-template-columns: 1fr; }

  .auth-card { padding: 1.75rem 1.25rem; }
}

