/* Finance app — dark technical interface inspired by the supplied visual direction */
:root {
  --primary: #9bea4c;
  --primary-strong: #b7ff62;
  --primary-soft: rgba(155, 234, 76, .14);
  --primary-border: rgba(155, 234, 76, .34);
  --danger: #ff5f6d;
  --success: #9bea4c;
  --warning: #ffc857;
  --info: #77c8ff;
  --bg-color: #050505;
  --bg-elevated: #0a0a0a;
  --card-color: #101010;
  --card-hover: #151515;
  --panel-2: #0d0d0d;
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.15);
  --text-color: #f4f5ef;
  --text-muted: #8b8d86;
  --text-soft: #b7b9b2;
  --shadow-sm: 0 10px 30px rgba(0,0,0,.18);
  --shadow-md: 0 18px 54px rgba(0,0,0,.26);
  --shadow-lg: 0 28px 90px rgba(0,0,0,.46);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --sidebar-width: 246px;
  --transition: 180ms cubic-bezier(.2,.8,.2,1);
  --mono: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg-color); }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% -10%, rgba(155,234,76,.08), transparent 34rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg-color);
  background-size: auto, 40px 40px, 40px 40px, auto;
  color: var(--text-color);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 12%, transparent 88%, rgba(155,234,76,.025));
  z-index: -1;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
a { color: inherit; }

.app-container { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); }

/* Sidebar */
aside {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  padding: 22px 14px 18px;
  background: rgba(7,7,7,.92);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 80;
}
aside h2 {
  margin: 0 6px 28px;
  min-height: 48px;
  display: flex;
  align-items: center;
  font-size: 0;
  color: var(--text-color);
  letter-spacing: -.04em;
}
aside h2 i { display: none; }
aside h2::before {
  content: "CONTROLE";
  font: 800 24px/1 system-ui, sans-serif;
  letter-spacing: -.06em;
}
aside h2::after {
  content: ".";
  font: 800 25px/1 system-ui, sans-serif;
  color: var(--primary);
  margin-left: 1px;
}
#sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; min-height: 0; }
.nav-link {
  min-height: 48px;
  padding: 0 13px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9b9d96;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
  border: 1px solid transparent;
  position: relative;
}
.nav-link i { width: 20px; text-align: center; font-size: 15px; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.045); transform: translateX(2px); }
.nav-link.active {
  color: var(--text-color);
  background: linear-gradient(90deg, rgba(155,234,76,.14), rgba(155,234,76,.035));
  border-color: rgba(155,234,76,.2);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  box-shadow: 0 0 20px rgba(155,234,76,.5);
}
#exportLink { margin-top: auto; }
#logoutButton { margin-top: 4px !important; border-top: 0 !important; padding-top: 0 !important; color: #7f817a; }
.user-info {
  order: 2;
  margin: 12px 0 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  display: grid;
  grid-template-columns: 36px minmax(0,1fr);
  gap: 10px;
  align-items: center;
}
.user-avatar { width: 36px; height: 36px; border-radius: 11px; overflow: hidden; background: #151515; border: 1px solid var(--primary-border); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-details { min-width: 0; }
.user-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { margin-top: 2px; font: 10px/1.3 var(--mono); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main */
main { min-width: 0; width: 100%; max-width: 1640px; margin: 0 auto; padding: 22px clamp(20px,3vw,48px) 48px; }
main > header {
  min-height: 70px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
main > header h1 {
  margin: 0;
  font-size: clamp(21px,2vw,30px);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 760;
}
main > header h1::after {
  content: "  / FINANCE";
  color: var(--text-muted);
  font: 10px/1 var(--mono);
  letter-spacing: .15em;
  vertical-align: middle;
  margin-left: 10px;
}
.container {
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.container > h2, .chart-header > h2 {
  margin: 0;
  font-size: clamp(28px,3vw,42px);
  line-height: 1.04;
  letter-spacing: -.05em;
  font-weight: 760;
}
.container > h2::before, .chart-header > h2::before {
  content: "// ";
  color: var(--primary);
  font-family: var(--mono);
  font-size: .42em;
  vertical-align: middle;
  letter-spacing: 0;
}

/* Dashboard top controls */
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.chart-header > .d-flex { padding: 7px; background: #0d0d0d; border: 1px solid var(--border); border-radius: 14px; }
.chart-title { margin: 0; font-size: 15px; font-weight: 720; letter-spacing: -.02em; }

.dashboard-cards {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) repeat(2,minmax(0,1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.dashboard-card {
  min-height: 164px;
  padding: 18px;
  background: linear-gradient(155deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.dashboard-card::after {
  content: "";
  position: absolute;
  right: -58px;
  bottom: -75px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155,234,76,.08), transparent 67%);
  pointer-events: none;
}
.dashboard-card:first-child {
  background: linear-gradient(145deg, rgba(155,234,76,.13), rgba(16,16,16,.8) 58%);
  border-color: rgba(155,234,76,.25);
}
.dashboard-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background-color: var(--card-hover); }
.dashboard-card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dashboard-card-title { color: var(--text-muted); font: 10px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.dashboard-card-icon {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(155,234,76,.18);
  font-size: 12px;
}
.dashboard-card-value {
  margin-top: 27px;
  font-size: clamp(28px,3vw,43px);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}
.dashboard-card:first-child .dashboard-card-value { color: #fff; }
.dashboard-card-label { margin-top: 10px; color: var(--text-muted); font-size: 11px; }
.dashboard-card .d-flex .btn-icon { width: 31px; height: 31px; border-radius: 9px; }

/* Surface panels */
.chart-container, .chart-panel, .table-container, .config-tab-content {
  border: 1px solid var(--border);
  background: rgba(13,13,13,.84);
  border-radius: var(--radius-md);
}
.chart-container { padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.chart-container > h3 { margin: 0 0 18px; font-size: 16px; }
.grafico-painel-container { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr); gap: 12px; margin-top: 14px; }
.chart-panel { min-width: 0 !important; padding: 16px; }
.chart-panel h4 { font-size: 12px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .08em; }
.despesas-lista { display: grid; gap: 7px; }
.despesa-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  background: rgba(255,255,255,.024);
  border: 1px solid rgba(255,255,255,.055);
  border-radius: 11px;
}
.despesa-info { min-width: 0; flex: 1; }
.despesa-titulo { font-size: 12px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.despesa-detalhe { margin-top: 4px; font: 10px/1.3 var(--mono); color: var(--text-muted); }
.despesa-valor { font: 700 12px/1 var(--mono); color: #e9ece5; white-space: nowrap; }

/* Buttons */
.btn, .btn-icon, .calendar-nav-btn {
  border: 1px solid transparent;
  color: var(--text-color);
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
}
.btn {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: -.01em;
}
.btn:hover, .btn-icon:hover, .calendar-nav-btn:hover { transform: translateY(-1px); }
.btn:active, .btn-icon:active, .calendar-nav-btn:active { transform: translateY(0) scale(.98); }
.btn-primary { background: var(--primary); color: #071004; border-color: var(--primary); box-shadow: 0 8px 26px rgba(155,234,76,.12); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-success { background: rgba(155,234,76,.12); color: var(--primary); border-color: rgba(155,234,76,.25); }
.btn-danger { background: rgba(255,95,109,.12); color: #ff818d; border-color: rgba(255,95,109,.24); }
.btn-outline { background: rgba(255,255,255,.025); color: #d5d7d0; border-color: var(--border-strong); }
.btn-outline:hover { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.22); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding-inline: 12px; }
.btn-icon, .calendar-nav-btn {
  width: 38px; height: 38px; padding: 0; border-radius: 10px;
  display: inline-grid; place-items: center;
  background: rgba(255,255,255,.035); border-color: var(--border);
}

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; margin-bottom: 7px; color: #a6a8a1; font: 10px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.form-control, textarea.form-control {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: #0a0a0a;
  color: var(--text-color);
  font-size: 12px;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
textarea.form-control { min-height: 112px; resize: vertical; }
.form-control:hover { border-color: rgba(255,255,255,.22); }
.form-control:focus { border-color: var(--primary); background: #0e0e0e; box-shadow: 0 0 0 3px rgba(155,234,76,.09); outline: none; }
.form-control::placeholder { color: #5d5f59; }
select.form-control { appearance: auto; color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .55; }

/* Tables */
.table-container { overflow-x: auto; box-shadow: none; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  color: #757870;
  background: rgba(255,255,255,.018);
  font: 9px/1.2 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
}
td { color: #d3d5ce; font-size: 12px; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(155,234,76,.025); }
tbody tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 999px; font: 9px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.bg-success { color: var(--primary); background: rgba(155,234,76,.1); border: 1px solid rgba(155,234,76,.18); }
.bg-warning { color: #ffd77a; background: rgba(255,200,87,.1); border: 1px solid rgba(255,200,87,.18); }
.bg-danger { color: #ff8994; background: rgba(255,95,109,.1); border: 1px solid rgba(255,95,109,.18); }

/* Tabs */
.config-tabs, .relatorio-tabs { display: flex; gap: 6px; margin: 18px 0 12px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.config-tabs::-webkit-scrollbar, .relatorio-tabs::-webkit-scrollbar { display: none; }
.config-tab-btn, .relatorio-tab-btn {
  min-height: 39px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
  transition: all var(--transition);
}
.config-tab-btn:hover, .relatorio-tab-btn:hover { color: #fff; border-color: var(--border-strong); }
.config-tab-btn.active, .relatorio-tab-btn.active { color: #081004; background: var(--primary); border-color: var(--primary); }
.config-tab-content { padding: 14px; }
.config-tab-pane { animation: panelIn 180ms ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Renda, categorias, cartões */
.renda-item, .categoria-item, .cartao-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.022);
  margin-bottom: 8px;
}
.renda-info, .categoria-info, .cartao-info { min-width: 0; flex: 1; }
.renda-titulo, .categoria-titulo, .cartao-titulo { font-size: 12px; font-weight: 700; }
.renda-detalhe, .categoria-detalhe, .cartao-detalhe, .renda-pagamentos { margin-top: 4px; color: var(--text-muted); font: 10px/1.5 var(--mono); }

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 20px;
  background: rgba(0,0,0,.78);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
}
.modal-content {
  width: min(100%, 560px);
  max-height: min(88vh,820px);
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background: #0b0b0b;
  box-shadow: var(--shadow-lg);
  animation: modalIn 200ms cubic-bezier(.2,.8,.2,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-header, .modal-footer { padding: 16px 18px; display: flex; align-items: center; gap: 10px; }
.modal-header { justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--border); }
.modal-body { padding: 18px; }
.modal-title { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.close { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.02); color: #a7a9a2; cursor: pointer; font-size: 19px; }
.close:hover { color: #fff; background: rgba(255,255,255,.06); }

/* Calendar */
.calendar-container { padding: 0; background: transparent; border: 0; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.calendar-title { margin: 0; font-size: 14px; text-transform: capitalize; }
.calendar-nav { display: flex; gap: 6px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(34px,1fr)); gap: 5px; }
.calendar-day-header { padding: 5px; text-align: center; color: #696b65; font: 8px/1 var(--mono); text-transform: uppercase; }
.calendar-day { min-height: 48px; border: 1px solid var(--border); border-radius: 9px; display: grid; place-items: center; color: #bfc1ba; font: 10px/1 var(--mono); position: relative; transition: all var(--transition); }
.calendar-day:not(:empty):hover { border-color: var(--primary-border); background: var(--primary-soft); color: #fff; cursor: pointer; }
.calendar-day.has-events::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 8px rgba(155,234,76,.5); }

/* Alerts */
.alertas-container { display: grid; gap: 12px; }
.alertas-section { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.02); }
.alertas-header { margin: 0 0 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.alerta-item { padding: 12px; margin-top: 7px; border-radius: 11px; background: #0b0b0b; border: 1px solid var(--border); }
.alerta-title { font-size: 11px; font-weight: 650; }
.alerta-details { margin-top: 5px; color: var(--text-muted); font: 9px/1.5 var(--mono); }
.alerta-vencida { border-color: rgba(255,95,109,.22); }
.alerta-vencimento { border-color: rgba(255,200,87,.22); }
.alerta-limite { border-color: rgba(119,200,255,.22); }
.alerta-progress { height: 5px; margin-top: 9px; background: #1a1a1a; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--primary); }

/* Third party */
.apexcharts-canvas, .apexcharts-svg { background: transparent !important; }
.apexcharts-text, .apexcharts-legend-text, .apexcharts-xaxis-label, .apexcharts-yaxis-label { fill: #878a82 !important; color: #878a82 !important; }
.apexcharts-gridline { stroke: rgba(255,255,255,.07) !important; }
.apexcharts-tooltip, .apexcharts-xaxistooltip {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid var(--border-strong) !important;
  box-shadow: var(--shadow-md) !important;
}
.apexcharts-tooltip-title { background: #0b0b0b !important; border-bottom: 1px solid var(--border) !important; }
.apexcharts-datalabels text { fill: #fff !important; }
.daterangepicker { background: #0c0c0c !important; color: #ddd !important; border: 1px solid var(--border-strong) !important; border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; }
.daterangepicker .calendar-table { background: transparent !important; border: 0 !important; }
.daterangepicker td.available:hover, .daterangepicker th.available:hover { background: rgba(155,234,76,.12) !important; }
.daterangepicker td.active, .daterangepicker td.active:hover, .daterangepicker .ranges li.active { background: var(--primary) !important; color: #071004 !important; }
.daterangepicker .ranges li:hover { background: rgba(255,255,255,.05) !important; }
.daterangepicker select { background: #111; color: #fff; border-color: var(--border); }
.toastify { border-radius: 12px !important; box-shadow: var(--shadow-md) !important; font-size: 12px !important; }

/* Login */
body.login-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-container { width: min(100%,420px); padding: 24px; border: 1px solid var(--border-strong); border-radius: 22px; background: rgba(10,10,10,.94); box-shadow: var(--shadow-lg); }
.login-header { margin-bottom: 22px; }
.login-header h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.05em; }
.login-header h1 i { color: var(--primary); }
.login-header p, .login-footer { color: var(--text-muted); font-size: 11px; }
.login-form { display: grid; gap: 4px; }
.login-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: #666862; font: 9px/1 var(--mono); text-transform: uppercase; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.social-login { display: grid; }
.btn-google { background: #101010; color: #e4e6df; border-color: var(--border-strong); }
.login-footer { margin-top: 18px; text-align: center; }
.login-footer a { color: var(--primary); text-decoration: none; }

/* Utility */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 16px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 5px !important; }
.mb-2 { margin-bottom: 10px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mt-1 { margin-top: 5px !important; }
.mt-2 { margin-top: 10px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.hidden { display: none !important; }
.loading-spinner { min-height: 150px; display: grid; place-items: center; gap: 8px; color: var(--text-muted); font-size: 11px; }
.empty-state { padding: 30px 18px; text-align: center; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--text-muted); }
.menu-toggle { display: none; }

/* Tablet */
@media (max-width: 1120px) {
  :root { --sidebar-width: 210px; }
  main { padding-inline: 22px; }
  .dashboard-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-card:first-child { grid-column: 1 / -1; }
  .grafico-painel-container { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 780px) {
  body { background-size: auto, 32px 32px, 32px 32px, auto; }
  .app-container { display: block; }
  main { max-width: none; padding: 74px 14px 26px; }
  main > header {
    position: fixed;
    z-index: 55;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    min-height: 58px;
    margin: 0;
    padding: 0 58px 0 15px;
    background: rgba(5,5,5,.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
  }
  main > header h1 { font-size: 18px; }
  main > header h1::after { display: none; }
  .menu-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    z-index: 120;
    top: 11px;
    right: 13px;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--border-strong);
    background: #0c0c0c;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
  }
  aside {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(88vw,340px);
    height: 100dvh;
    padding: 18px 14px 22px;
    transform: translateX(105%);
    transition: transform 240ms cubic-bezier(.2,.8,.2,1);
    box-shadow: -30px 0 80px rgba(0,0,0,.6);
    border-left: 1px solid var(--border);
    border-right: 0;
    background: rgba(7,7,7,.98);
  }
  aside.active { transform: translateX(0); }
  aside.active::before {
    content: "";
    position: fixed;
    inset: 0 100% 0 -100vw;
    background: rgba(0,0,0,.58);
    pointer-events: none;
  }
  aside h2 { margin-bottom: 14px; }
  #sidebar-nav { overflow-y: auto; padding-bottom: 8px; }
  .nav-link { min-height: 49px; font-size: 13px; }
  .user-info { position: static; order: initial; margin: 0 0 12px; }
  #exportLink { margin-top: 8px; }

  .chart-header { align-items: flex-start; flex-direction: column; gap: 13px; }
  .chart-header > h2 { font-size: 30px; }
  .chart-header > .d-flex { width: 100%; display: grid; grid-template-columns: 1fr .85fr auto; gap: 6px; padding: 6px; }
  .chart-header > .d-flex .form-group { min-width: 0; }
  .chart-header > .d-flex .form-control { min-width: 0; padding-inline: 8px; }
  .chart-header > .d-flex .btn { width: 42px; padding: 0; }
  .chart-header > .d-flex .btn span { display: none; }

  .dashboard-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dashboard-card:first-child { grid-column: 1 / -1; }
  .dashboard-card { min-height: 138px; padding: 14px; }
  .dashboard-card-value { margin-top: 23px; font-size: clamp(25px,8vw,35px); }
  .dashboard-card-title { font-size: 8px; }
  .dashboard-card-label { font-size: 9px; }
  .dashboard-card-icon { width: 29px; height: 29px; }

  .chart-container { padding: 13px; border-radius: 14px; }
  .chart-panel { padding: 12px; }
  .grafico-painel-container { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .container > h2 { font-size: 30px; }
  .container > p { font-size: 11px; color: var(--text-muted); }
  .btn { min-height: 42px; }
  .btn-block { position: sticky; bottom: 10px; z-index: 30; box-shadow: 0 10px 34px rgba(0,0,0,.55); }

  .table-container { margin-inline: -3px; border-radius: 12px; }
  table { min-width: 690px; }
  th, td { padding: 11px 12px; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-content {
    width: 100%;
    max-height: 91dvh;
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .modal-content::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 99px; background: #393939; margin: 8px auto -3px; }
  .modal-header, .modal-footer { padding-inline: 15px; }
  .modal-body { padding: 15px; }
  .modal-footer { position: sticky; bottom: 0; background: #0b0b0b; }

  .calendar-grid { gap: 3px; }
  .calendar-day { min-height: 42px; }
  .config-tabs, .relatorio-tabs { margin-top: 14px; }
  .config-tab-content { padding: 10px; }
  .renda-item, .categoria-item, .cartao-item { align-items: flex-start; }
}

@media (max-width: 460px) {
  main { padding-inline: 11px; }
  .dashboard-cards { grid-template-columns: 1fr; }
  .dashboard-card:first-child { grid-column: auto; }
  .dashboard-card { min-height: 128px; }
  .chart-header > .d-flex { grid-template-columns: 1.15fr .75fr 40px; }
  .d-flex.flex-wrap.mb-3 { gap: 7px; }
  .d-flex.flex-wrap.mb-3 > .btn { flex: 1 1 auto; }
  .modal-footer .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
