/* ===================================================
   FinançasPessoais - CSS Principal
   =================================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #e0e7ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e2e8f0;
  --border2: #cbd5e1;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active: #4f46e5;
  --sidebar-hover: #334155;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --transition: .2s ease;
}

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

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ====== SIDEBAR ====== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}
.sidebar-logo i { color: var(--primary); font-size: 1.4rem; }

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--sidebar-text);
  font-size: 1.1rem;
  padding: 4px 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--sidebar-text);
  font-size: .92rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  border-radius: 0;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  background: var(--primary);
  color: #fff;
}
.nav-item i { width: 18px; text-align: center; font-size: 1rem; }

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
}
.nav-badge.danger { background: var(--danger); }
.nav-badge:empty, .nav-badge[data-count="0"] { display: none; }

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 8px 20px;
}

.sidebar-footer {
  padding: 16px 20px;
  color: var(--text-light);
  font-size: .82rem;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ====== OVERLAY ====== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 150;
}
.overlay.active { display: block; }

/* ====== MAIN ====== */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin var(--transition);
}

/* ====== TOPBAR ====== */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 6px;
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-xs { padding: 5px 10px; font-size: .8rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border2);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ====== PAGES ====== */
.page { display: none; padding: 24px; flex-direction: column; gap: 20px; }
.page.active { display: flex; }

/* ====== CARDS RESUMO ====== */
.cards-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent;
  transition: box-shadow var(--transition);
}
.summary-card:hover { box-shadow: var(--shadow); }

.card-total { border-left-color: var(--primary); }
.card-pendente { border-left-color: var(--warning); }
.card-vencida { border-left-color: var(--danger); }
.card-paga { border-left-color: var(--success); }

.summary-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.card-total .summary-icon { background: var(--primary-light); color: var(--primary); }
.card-pendente .summary-icon { background: var(--warning-light); color: var(--warning); }
.card-vencida .summary-icon { background: var(--danger-light); color: var(--danger); }
.card-paga .summary-icon { background: var(--success-light); color: var(--success); }

.summary-info { display: flex; flex-direction: column; gap: 4px; }
.summary-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.summary-value { font-size: 1.4rem; font-weight: 800; color: var(--text); }

/* ====== DASHBOARD GRID ====== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.dash-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-card-header h3 i { color: var(--primary); }
.dash-card-sub { font-size: .8rem; color: var(--text-muted); }

.chart-card { width: 100%; }
.chart-wrapper { position: relative; height: 260px; }

.dash-list { display: flex; flex-direction: column; gap: 10px; }
.dash-list-empty { color: var(--text-muted); font-size: .9rem; text-align: center; padding: 20px 0; }

/* ====== DASH ITEM ====== */
.dash-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.dash-item:hover { border-color: var(--primary); }
.dash-item-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.dash-item-info { flex: 1; min-width: 0; }
.dash-item-name { font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-item-sub { font-size: .78rem; color: var(--text-muted); }
.dash-item-valor { font-size: 1rem; font-weight: 700; white-space: nowrap; }

/* ====== ALERTAS ====== */
.alerta {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  font-weight: 500;
}
.alerta-danger { background: var(--danger-light); color: #b91c1c; border: 1px solid #fca5a5; }
.alerta-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alerta-success { background: var(--success-light); color: #065f46; border: 1px solid #6ee7b7; }

/* ====== PAGE TOOLBAR ====== */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box i { position: absolute; left: 12px; color: var(--text-light); }
.search-box input {
  padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  width: 220px;
  transition: border var(--transition);
}
.search-box input:focus { outline: none; border-color: var(--primary); }

.select-filter, .select-sm {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
  cursor: pointer;
}
.select-filter:focus, .select-sm:focus { outline: none; border-color: var(--primary); }

/* ====== LISTA CONTAS ====== */
.lista-contas { display: flex; flex-direction: column; gap: 12px; }
.lista-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.lista-empty i { font-size: 3rem; color: var(--border2); margin-bottom: 12px; display: block; }
.lista-empty p { font-size: 1rem; }

/* ====== CONTA CARD ====== */
.conta-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: relative;
}
.conta-card:hover { box-shadow: var(--shadow); border-color: var(--primary); }

.conta-card.status-vencida { border-left: 4px solid var(--danger); background: #fff8f8; }
.conta-card.status-pendente { border-left: 4px solid var(--warning); }
.conta-card.status-paga { border-left: 4px solid var(--success); background: #f0fdf8; }
.conta-card.status-proxima { border-left: 4px solid var(--info); }

.conta-cat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  background: var(--primary-light);
  color: var(--primary);
}

.conta-info { flex: 1; min-width: 0; }
.conta-nome { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.conta-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.conta-badge {
  font-size: .73rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.badge-mensal { background: var(--primary-light); color: var(--primary); }
.badge-eventual { background: #f0f4ff; color: #6366f1; }
.badge-fixa { background: #ecfdf5; color: var(--success); }
.badge-variavel { background: #fff7ed; color: var(--warning); }
.badge-status-pendente { background: var(--warning-light); color: #92400e; }
.badge-status-pago { background: var(--success-light); color: #065f46; }
.badge-status-vencida { background: var(--danger-light); color: #991b1b; }

.conta-venc {
  font-size: .82rem;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 4px;
}
.conta-venc.vencida { color: var(--danger); font-weight: 600; }
.conta-venc.proxima { color: var(--warning); font-weight: 600; }

.conta-valores { text-align: right; flex-shrink: 0; }
.conta-valor-main { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.conta-valor-sub { font-size: .8rem; color: var(--text-muted); }

.conta-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Botão pagar */
.btn-pagar {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
}
.btn-pagar:hover { background: #059669; }

.btn-view { background: var(--primary-light); color: var(--primary); border: none; padding: 8px; border-radius: var(--radius-sm); }
.btn-view:hover { background: var(--primary); color: #fff; }
.btn-edit { background: #f0f4ff; color: #6366f1; border: none; padding: 8px; border-radius: var(--radius-sm); }
.btn-edit:hover { background: #6366f1; color: #fff; }
.btn-del { background: var(--danger-light); color: var(--danger); border: none; padding: 8px; border-radius: var(--radius-sm); }
.btn-del:hover { background: var(--danger); color: #fff; }
.btn-desfazer { background: var(--warning-light); color: #92400e; border: none; padding: 8px 12px; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600; }
.btn-desfazer:hover { background: var(--warning); color: #fff; }

/* ====== FORM ====== */
.form-container {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 760px;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
.form-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.form-title i { color: var(--primary); }

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
  margin-bottom: 16px;
}
.form-group.flex-2 { flex: 2; }

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.form-control {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .92rem;
  transition: border var(--transition);
  width: 100%;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control.error { border-color: var(--danger); }

textarea.form-control { resize: vertical; }
select.form-control { cursor: pointer; }

.form-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 16px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Radio group */
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .92rem;
  padding: 9px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  background: var(--surface);
}
.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.radio-label input { display: none; }

/* QR Code */
.qrcode-area {
  position: relative;
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition);
  overflow: hidden;
  background: var(--surface2);
}
.qrcode-area:hover { border-color: var(--primary); }
.qrcode-area.drag-over { border-color: var(--primary); background: var(--primary-light); }

.qrcode-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  padding: 20px;
  text-align: center;
}
.qrcode-placeholder i { font-size: 2.5rem; color: var(--border2); }
.qrcode-placeholder span { font-size: .88rem; }

#qrcodePreview { max-height: 200px; object-fit: contain; border-radius: 8px; }

.btn-remove-qr {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}

.btn-copy-hint {
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: .85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
}
.btn-copy-hint:hover { text-decoration: underline; }

/* ====== MODAIS ====== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
.modal-sm { max-width: 420px; }

@keyframes modalIn {
  from { transform: scale(.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Pagamento info box */
.pagamento-info {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.pagamento-info h4 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.pagamento-info p { font-size: .88rem; color: var(--text-muted); }
.pagamento-info .val { font-size: 1.3rem; font-weight: 800; color: var(--success); }

/* View detalhe */
.detalhe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detalhe-item label { font-size: .78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.detalhe-item p { font-size: .95rem; font-weight: 500; color: var(--text); word-break: break-all; }
.detalhe-item.full { grid-column: 1 / -1; }

.cod-barras-box {
  background: var(--surface2);
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: .85rem;
  word-break: break-all;
  font-family: monospace;
  position: relative;
}
.btn-copy-cb {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: .78rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ====== RELATÓRIOS ====== */
.relatorio-filters {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.relatorio-filters .form-group { margin-bottom: 0; }

.rel-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 4px;
}

.rel-summary-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.rel-summary-item .label { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; }
.rel-summary-item .value { font-size: 1.5rem; font-weight: 800; }

/* Tabela */
.table-responsive { overflow-x: auto; }
.rel-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rel-table th {
  padding: 10px 14px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  border-bottom: 2px solid var(--border);
  text-align: left;
}
.rel-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.rel-table tr:last-child td { border-bottom: none; }
.rel-table tr:hover td { background: var(--surface2); }
.text-right { text-align: right; }
.total-row { font-size: 1rem; font-weight: 800; color: var(--success); }

/* ====== TOASTS ====== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--sidebar-bg);
  color: #fff;
  font-size: .9rem;
  font-weight: 500;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s ease;
}
.toast.toast-success { background: #065f46; }
.toast.toast-danger { background: #991b1b; }
.toast.toast-warning { background: #78350f; }
.toast i { font-size: 1.1rem; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ====== LOADING ====== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.6);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.loading-overlay.active { display: flex; }
.loading-spinner { font-size: 2rem; color: var(--primary); }

/* ====== CONTA CADASTRADA CARD ====== */
.conta-cad-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.conta-cad-card:hover { box-shadow: var(--shadow); }
.conta-cad-info { flex: 1; min-width: 0; }
.conta-cad-nome { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.conta-cad-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.conta-cad-actions { display: flex; gap: 6px; }

/* ====== STATUS DOTS ====== */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-pendente { background: var(--warning); }
.dot-vencida { background: var(--danger); }
.dot-paga { background: var(--success); }

/* ====== EMPTY STATE ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}
.empty-state i { font-size: 3.5rem; color: var(--border2); }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-muted); }
.empty-state p { font-size: .9rem; color: var(--text-light); max-width: 300px; }

/* ====== DIAS BADGE ====== */
.dias-badge {
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}
.dias-vencida { background: var(--danger-light); color: var(--danger); }
.dias-hoje { background: var(--warning-light); color: var(--warning); }
.dias-proxima { background: var(--info-light); color: var(--info); }

/* ====== PRINT ====== */
@media print {
  .sidebar, .topbar, .relatorio-filters, .btn, button { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page { display: flex !important; padding: 0 !important; }
  body { background: white; }
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1200px) {
  .cards-summary { grid-template-columns: repeat(2, 1fr); }
  .rel-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-close { display: block; }

  .main-content { margin-left: 0; }

  .menu-btn { display: block; }

  .topbar { padding: 0 16px; }
  .topbar-title { font-size: 1rem; }
  .topbar-actions .btn span { display: none; }
  .topbar-actions .btn { padding: 8px 10px; }

  .page { padding: 16px; gap: 16px; }

  .cards-summary { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .summary-card { padding: 14px; }
  .summary-value { font-size: 1.1rem; }

  .form-container { padding: 20px 16px; }
  .form-row { flex-direction: column; gap: 0; }
  .form-group { min-width: 100%; }

  .conta-card { flex-wrap: wrap; gap: 10px; }
  .conta-actions { width: 100%; justify-content: flex-end; }

  .modal { max-height: 95vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .rel-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .detalhe-grid { grid-template-columns: 1fr; }

  .relatorio-filters { flex-direction: column; align-items: stretch; }
  .search-box input { width: 180px; }

  .page-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-wrap: wrap; }
  .search-box { flex: 1; }
  .search-box input { width: 100%; }
}

@media (max-width: 480px) {
  .cards-summary { grid-template-columns: 1fr 1fr; }
  .summary-icon { display: none; }
  .conta-cat-icon { display: none; }
  .rel-summary-grid { grid-template-columns: 1fr 1fr; }
}
