:root {
  --navy: #0d172b;
  --ink: #15223a;
  --muted: #788293;
  --line: #e6ebf1;
  --paper: #f5f7fb;
  --green: #18b47b;
  --red: #f05b68;
  --gold: #f3ba52;
  --purple: #7167e8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 79% 4%, #e8f8f1 0, transparent 22%), var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
}

/* SIDEBAR */
.sidebar {
  position: fixed;
  width: 246px;
  inset: 0 auto 0 0;
  padding: 35px 20px 28px;
  background: linear-gradient(155deg, #101c33 0%, #0b1428 74%);
  color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #26354d;
  z-index: 10;
}

.brand {
  color: #fff;
  text-decoration: none;
  font: 700 28px Outfit, sans-serif;
  letter-spacing: -1.5px;
  margin: 0 12px 64px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand img {
  width: 29px;
  height: 29px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px #0bb27c59);
  background: #fff;
  border-radius: 9px;
  padding: 2px;
}

nav { display: grid; gap: 7px; }
nav a {
  color: #8f9bb0;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: .2s ease;
}
nav a:hover, nav a.active {
  background: linear-gradient(100deg, #223451, #1a2b46);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--green);
}

.sidebar-foot {
  margin-top: auto;
  color: #c4cada;
  font-size: 12px;
  line-height: 1.7;
  padding: 17px 12px;
  border-top: 1px solid #26344a;
}
.sidebar-foot small { color: #718097; }

/* MAIN & DASHBOARD HEADER */
main {
  max-width: 1410px;
  margin-left: 246px;
  padding: 45px 58px 78px;
}

header, .history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8794a6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.35px;
}
.eyebrow i {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin: 0 6px 1px 0;
  box-shadow: 0 0 0 4px #cdf3e5;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Outfit, sans-serif; letter-spacing: -.7px; }
h1 { font-size: 36px; line-height: 1.1; margin: 0 0 8px; }
h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #16ac76, #4bc999);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.header-copy { margin: 0; color: #778497; font-size: 13px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

/* PERIOD SELECTOR */
.period-selector {
  display: flex;
  background: #eef3f7;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}
.period-btn {
  border: 0;
  background: transparent;
  color: #68768a;
  padding: 7px 12px;
  border-radius: 8px;
  font: 700 11px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: .18s;
}
.period-btn:hover { color: var(--ink); }
.period-btn.active {
  background: #fff;
  color: #129a6b;
  box-shadow: 0 3px 8px #14284018;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #15ad77 0%, #0d9662 100%);
  color: #ffffff;
  border: 0;
  border-radius: 9px;
  padding: 9px 15px;
  font: 700 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 4px 12px rgba(21, 173, 119, 0.22);
}
.import-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21, 173, 119, 0.32);
  background: linear-gradient(135deg, #17b77f 0%, #0fa36b 100%);
}
.import-btn span {
  font-size: 13px;
  color: #ffea79;
}

.ghost-btn, .outline-btn, .export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d9e0e8;
  border-radius: 9px;
  background: #ffffff;
  padding: 9px 14px;
  color: #4b5869;
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .18s ease;
}
.ghost-btn:hover, .outline-btn:hover, .export-btn:hover {
  border-color: #17b37b;
  background: #eef8f3;
  color: #0f8b5f;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #fee2e2;
  border-radius: 9px;
  background: #fef2f2;
  padding: 9px 14px;
  color: #dc2626;
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .18s ease;
}
.logout-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.balance-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(105deg, #111e36 0%, #172b4b 56%, #193553 100%);
  color: white;
  border-radius: 18px;
  padding: 27px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 15px 35px #14203823;
  margin-top: 24px;
}
.balance-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 55px solid #4bd2a51c;
  border-radius: 50%;
  right: 7%;
  top: -170px;
  pointer-events: none;
}
.balance-content { position: relative; }
.balance-label { display: flex; align-items: center; gap: 8px; }
.wallet-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #3ba986;
  color: #d5fff0;
  font-size: 15px;
}
.balance-card p { margin: 0; color: #a9b7cb; font-size: 12px; }
.balance-card strong { display: block; font: 700 34px Outfit, sans-serif; letter-spacing: -1.2px; margin-top: 7px; }
.balance-card small { color: #b2bfd0; font-size: 12px; }
.outline-btn { position: relative; background: #ffffff0c; border-color: #ffffff3d; color: #fff; padding: 11px 14px; }
.outline-btn:hover { background: #ffffff19; }
.outline-btn span { font-size: 16px; margin-left: 5px; }

/* METRICS GRID (6 CARDS) */
.metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.metrics article, .panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 3px 12px #293b5610;
}
.metrics article {
  padding: 16px 17px;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.metrics article:hover { transform: translateY(-3px); box-shadow: 0 10px 22px #293b5615; }
.metric-head { display: flex; justify-content: space-between; align-items: center; }
.metrics p { color: #7c8797; font-size: 11px; font-weight: 600; margin-bottom: 9px; }
.metric-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
}
.profit-icon { color: #139b69; background: #e4f8f0; }
.roi-icon { color: #665bdc; background: #eeedff; }
.hit-icon { color: #d99314; background: #fff4d9; }
.streak-icon { color: #e65625; background: #ffede6; }
.potential-icon { color: #108a61; background: #dff7ed; }
.exposure-icon { color: #da5463; background: #ffe9ec; }
.metrics article:nth-child(1) { border-top: 3px solid #18b47b; }
.metrics article:nth-child(2) { border-top: 3px solid #7167e8; }
.metrics article:nth-child(3) { border-top: 3px solid #f1b847; }
.metrics article:nth-child(4) { border-top: 3px solid #e65625; }
.metrics article:nth-child(5) { border-top: 3px solid #108a61; }
.metrics article:nth-child(6) { border-top: 3px solid #f05b68; }

.metrics strong { display: block; font: 700 22px Outfit, sans-serif; margin-bottom: 5px; letter-spacing: -.5px; }
.metrics small { font-size: 10px; color: #9ba4b1; }
.positive { color: var(--green); }
.negative { color: var(--red); }

/* STAKE PRESETS */
.stake-presets {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.stake-presets button {
  border: 1px solid #dce4eb;
  background: #f4f7fa;
  color: #5d6d80;
  border-radius: 6px;
  padding: 3px 7px;
  font: 700 10px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: .15s;
}
.stake-presets button:hover {
  background: #18b47b;
  color: #fff;
  border-color: #18b47b;
}

/* BANKROLL TOOLS (PROTEÇÃO DE BANCA) */
.bankroll-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 22px;
  margin: 18px 0;
  box-shadow: 0 4px 16px rgba(25, 43, 70, 0.04);
}
.bankroll-tools > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #edfdf6;
  color: #15ad77;
  font-size: 16px;
  flex-shrink: 0;
}
.bankroll-tools p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bankroll-tools p b {
  font: 700 13px 'DM Sans', sans-serif;
  color: #10203a;
}
.bankroll-tools p small {
  font-size: 11px;
  color: #718096;
}
.tool-numbers {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f8fafc;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.tool-numbers span {
  font-size: 11px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-numbers b {
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
}
.tool-numbers b.negative {
  color: #ef4444;
}

/* ANALYTICS GRID & CHARTS */
.analytics-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.chart-panel {
  display: flex;
  flex-direction: column;
}
.chart-total {
  font: 700 16px Outfit, sans-serif;
  padding: 4px 10px;
  border-radius: 8px;
}
.chart-total.positive { color: #15ad77; background: #eefcf5; }
.chart-total.negative { color: #ef4444; background: #fef2f2; }

.chart-area {
  flex: 1;
  min-height: 160px;
  position: relative;
  margin: 12px 0 6px;
}
.chart-labels {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

/* PERFORMANCE BREAKDOWN (LEITURA RÁPIDA) */
.performance-breakdown {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.breakdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 10px 14px;
  transition: all .18s ease;
}
.breakdown-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.breakdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}
.sport-name {
  font: 700 12px 'DM Sans', sans-serif;
  color: #0f172a;
}
.sport-badge {
  font-size: 10px;
  color: #64748b;
}
.breakdown-bar-wrap {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, #15ad77, #34d399);
  border-radius: 3px;
}
.breakdown-profit {
  font: 700 12px 'DM Sans', sans-serif;
  color: #0f172a;
  min-width: 75px;
  text-align: right;
}
.breakdown-profit.positive { color: #15ad77; }
.breakdown-profit.negative { color: #ef4444; }
.analysis-empty {
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  padding: 30px 10px;
}

/* CONTENT GRID & PANELS */
.content-grid {
  display: grid;
  grid-template-columns: 1.55fr .9fr;
  gap: 18px;
}
.panel { padding: 27px; box-shadow: 0 10px 28px #293b560c; }
.panel-title { margin-bottom: 23px; display: flex; justify-content: space-between; align-items: flex-start; }
.panel-marker {
  font: 700 11px Outfit;
  color: #bdc7d2;
  border: 1px solid #e3e8ed;
  width: 28px;
  height: 28px;
  display: grid;
  place-content: center;
  border-radius: 50%;
}
.panel h2 { font-size: 21px; margin-bottom: 0; }

.field { display: grid; gap: 7px; margin-bottom: 15px; position: relative; }
.field label, dialog label { font-size: 11px; font-weight: 700; color: #687486; }
input, select {
  font: 500 13px 'DM Sans';
  color: var(--ink);
  border: 1px solid #dce2e9;
  border-radius: 9px;
  background: #fcfdfe;
  padding: 11px 12px;
  width: 100%;
  outline: none;
  transition: .18s;
}
input:hover, select:hover { border-color: #bdc9d5; }
input:focus, select:focus { border-color: #20a97a; box-shadow: 0 0 0 3px #dff5ed; background: #fff; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.three { grid-template-columns: repeat(3, 1fr); }
.form-footer {
  border-top: 1px solid var(--line);
  margin-top: 7px;
  padding-top: 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #748093;
}
.form-footer strong { color: var(--green); font-size: 15px; margin-left: 5px; }

.receipt-field {
  margin-bottom: 18px;
}
.receipt-picker {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: #f4fbf7 !important;
  border: 1px dashed #17b37b !important;
  border-radius: 10px !important;
  padding: 12px 16px !important;
  cursor: pointer !important;
  transition: all .2s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 4px !important;
}
.receipt-picker:hover {
  background: #eaf7f1 !important;
  border-color: #0fa770 !important;
  box-shadow: 0 4px 14px rgba(21, 173, 119, 0.15) !important;
}
.receipt-picker span {
  font-size: 16px !important;
  color: #15ad77 !important;
}
.receipt-picker strong {
  color: #10203a !important;
  font: 600 13px 'DM Sans', sans-serif !important;
}
.receipt-picker small {
  margin-left: auto !important;
  color: #6a798c !important;
  font-size: 10px !important;
  background: #ffffff !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  border: 1px solid #d5e5dc !important;
  font-weight: 600 !important;
}
.receipt-picker.has-file {
  background: #eefcf5 !important;
  border-style: solid !important;
  border-color: #10b981 !important;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clear-form {
  border: 1px solid #d9e0e8;
  border-radius: 9px;
  background: #ffffff;
  padding: 11px 16px;
  color: #526176;
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .18s ease;
}
.clear-form:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
}

.primary-btn {
  border: 0;
  border-radius: 9px;
  background: linear-gradient(100deg, #16af78, #1bb886);
  padding: 12px 16px;
  color: #fff;
  font: 700 12px 'DM Sans';
  cursor: pointer;
  box-shadow: 0 5px 12px #13a3713b;
  transition: .2s;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 16px #13a3714d; }
.primary-btn span { font-size: 17px; vertical-align: -1px; margin-left: 5px; }

.insights { display: flex; flex-direction: column; background: linear-gradient(145deg, #fff 50%, #f5fcf9); }
.donut-wrap { display: flex; align-items: center; gap: 27px; flex: 1; padding: 17px 3px 22px; }
.donut {
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, var(--green) 0deg, #e9edf1 0deg);
  position: relative;
  display: grid;
  place-content: center;
  text-align: center;
  box-shadow: 0 8px 20px #20aa7830;
  border: 5px solid #f4fcf8;
}
.donut:after {
  content: '';
  position: absolute;
  inset: 15px;
  background: #fff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px #eef1f4;
}
.donut span, .donut small { z-index: 1; }
.donut span { font: 700 26px Outfit; }
.donut small { font-size: 9px; color: #8791a0; }

.legend { flex: 1; }
.legend p { font-size: 12px; color: #718094; margin: 13px 0; display: flex; align-items: center; gap: 7px; }
.legend strong { color: var(--ink); margin-left: auto; }
.legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 4px #f1f4f5; }
.green { background: var(--green); }
.red { background: var(--red); }
.gray { background: #dfe4e9; }

.tip { display: flex; gap: 10px; background: #eaf8f1; border: 1px solid #dcf2e8; border-radius: 10px; padding: 12px; color: #527766; }
.tip span { color: var(--green); }
.tip p { font-size: 11px; line-height: 1.45; margin: 0; }

/* HISTORY TABLE & DEMO BUTTON */
.history { margin-top: 18px; padding-bottom: 16px; }
.history-header { align-items: center; margin-bottom: 20px; }
.filter-wrap { display: flex; align-items: center; gap: 8px; color: #8a96a6; font-size: 11px; }
.history-header select { width: 126px; padding: 8px; font-size: 11px; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
th { text-align: left; color: #8893a2; font-size: 10px; letter-spacing: .6px; padding: 0 10px 12px; }
td { padding: 15px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
td:first-child { font-weight: 700; }
.sub { display: block; color: #8994a2; font-size: 10px; font-weight: 400; margin-top: 3px; }

.badge { font-weight: 700; border-radius: 20px; padding: 5px 8px; font-size: 10px; cursor: pointer; display: inline-block; transition: .15s; }
.badge.pending { background: #fff6df; color: #b67f00; }
.badge.won { background: #def7ee; color: #07885b; }
.badge.lost { background: #fee9ea; color: #d9444d; }
.badge.void { background: #edf0f3; color: #798493; }
.badge:hover { opacity: .85; transform: scale(1.03); }

.receipt-btn-table {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #c2ebd9;
  background: #f0fdf6;
  color: #129a6a;
  border-radius: 7px;
  padding: 6px 11px;
  font: 600 11px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .18s ease;
}
.receipt-btn-table:hover {
  background: #15ad77;
  color: #ffffff;
  border-color: #15ad77;
  box-shadow: 0 4px 10px rgba(21, 173, 119, 0.25);
  transform: translateY(-1px);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all .18s ease;
  padding: 0;
}
.action-btn.edit-btn:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
  transform: scale(1.08);
}
.action-btn.delete-btn:hover {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #ef4444;
  transform: scale(1.08);
}

.delete { color: #a2aab4; border: 0; background: transparent; cursor: pointer; font-size: 17px; }
.empty-state { text-align: center; padding: 42px 15px; color: #8d98a7; }
.empty-state span { font: 600 34px Outfit; color: #9cd9c2; }
.empty-state h3 { font-size: 17px; margin: 8px 0; }
.empty-state p { font-size: 12px; margin: 0 0 18px; }
.demo-btn { background: #eef9f4; border-color: #bad8cc; color: #128e62; font-weight: 700; }
.demo-btn:hover { background: #dff4eb; }

/* LANDING PAGE STYLES */
.landing {
  min-height: 100vh;
  background: radial-gradient(circle at 85% 20%, #d7f9ea 0, transparent 24%), radial-gradient(circle at 15% 85%, #e8ebff 0, transparent 25%), #fbfcfe;
  padding: 25px clamp(24px, 6vw, 100px);
  display: flex;
  flex-direction: column;
  font-family: 'DM Sans', sans-serif;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.landing-brand, .auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #10203a;
  font: 700 27px Outfit, sans-serif;
  letter-spacing: -1.4px;
  text-decoration: none;
}
.landing-brand img, .auth-brand img {
  width: 31px;
  height: 31px;
  padding: 2px;
  background: #fff;
  border-radius: 9px;
  filter: drop-shadow(0 5px 9px #18b47b3a);
}

.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: #58677c;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
}
.nav-links a:hover { color: #15ac76; }

.nav-actions { display: flex; gap: 9px; }
.landing-login, .landing-cta {
  font: 700 12px 'DM Sans';
  border-radius: 9px;
  padding: 11px 15px;
  cursor: pointer;
}
.landing-login { border: 0; background: transparent; color: #5d6c80; }
.landing-cta { border: 0; background: #10203a; color: white; box-shadow: 0 8px 18px #10203a28; }

.landing-hero {
  width: min(1180px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: 1fr .92fr;
  align-items: center;
  gap: 80px;
  padding: 60px 0 40px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  background: #e1f7ed;
  color: #119e6b;
  font: 700 11px 'DM Sans', sans-serif;
  margin-bottom: 16px;
}
.hero-copy h1 { font-size: clamp(40px, 5vw, 68px); line-height: 1.02; max-width: 650px; margin: 0 0 20px; }
.hero-copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #0fa770, #4bc79a);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}
.hero-copy > p:not(.eyebrow) { max-width: 505px; color: #69788d; line-height: 1.65; font-size: 16px; }
.hero-actions { display: flex; gap: 12px; margin: 31px 0 20px; }
.hero-main {
  border: 0;
  background: linear-gradient(110deg, #15ac76, #22bd8c);
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font: 700 13px 'DM Sans';
  box-shadow: 0 10px 18px #16ad7540;
  cursor: pointer;
}
.hero-secondary {
  border: 1px solid #d9e1e9;
  background: #fff;
  color: #526176;
  padding: 14px 18px;
  border-radius: 10px;
  font: 700 13px 'DM Sans';
  cursor: pointer;
}
.trust { color: #8290a1; font-size: 11px; }

.hero-dashboard {
  border: 1px solid #e1eaf0;
  border-radius: 22px;
  padding: 23px;
  background: #fff;
  box-shadow: 0 28px 60px #233a5320;
  transform: rotate(2deg);
}
.preview-top { display: flex; justify-content: space-between; border-bottom: 1px solid #e8edf1; padding-bottom: 16px; color: #8995a4; font-size: 10px; font-weight: 700; }
.preview-balance { margin: 23px 0; }
.preview-balance small, .preview-metrics span { display: block; color: #8390a1; font-size: 11px; }
.preview-balance strong { display: block; font: 700 35px Outfit, sans-serif; margin: 5px 0; }
.preview-balance em { font-size: 11px; color: #12a270; font-style: normal; font-weight: 700; }
.preview-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview-metrics div { background: #f6f9fb; border-radius: 9px; padding: 12px; }
.preview-metrics b { display: block; font: 700 15px Outfit, sans-serif; margin-top: 5px; }
.preview-row { display: flex; align-items: center; gap: 8px; padding: 14px 2px 2px; font-size: 11px; }
.preview-row i { width: 7px; height: 7px; background: #19b37d; border-radius: 50%; }
.preview-row b { margin-left: auto; color: #15a973; }

/* LANDING STATS COUNTER */
.landing-stats {
  width: min(1180px, 100%);
  margin: 40px auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: #fff;
  padding: 30px;
  border-radius: 18px;
  border: 1px solid #e3eaf0;
  box-shadow: 0 10px 30px #1a2b400a;
}
.stat-card { text-align: center; }
.stat-card strong { display: block; font: 800 32px Outfit, sans-serif; color: #12a673; }
.stat-card span { font-size: 12px; color: #728194; font-weight: 600; }

/* LANDING FEATURES GRID */
.landing-features {
  width: min(1180px, 100%);
  margin: 60px auto;
}
.section-head { text-align: center; margin-bottom: 40px; }
.section-head h2 { font-size: 32px; margin: 0; color: #10203a; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature-card {
  background: #fff;
  border: 1px solid #e5ecef;
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: 0 6px 20px #182a3d08;
  transition: transform .25s, box-shadow .25s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px #182a3d12;
  border-color: #bee3d3;
}
.feature-icon { font-size: 32px; margin-bottom: 14px; }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; color: #15223a; }
.feature-card p { font-size: 13px; color: #6d7c90; line-height: 1.55; margin: 0; }

/* LANDING FAQ ACCORDION */
.landing-faq {
  width: min(850px, 100%);
  margin: 40px auto 70px;
}
.faq-list { display: grid; gap: 12px; }
.faq-item {
  background: #fff;
  border: 1px solid #e4ecf1;
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color .2s;
}
.faq-item[open] { border-color: #1bb784; background: #fafdcb05; }
.faq-item summary {
  font: 700 15px Outfit, sans-serif;
  color: #15233c;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary span { font-size: 18px; color: #1bb784; }
.faq-item p { font-size: 13px; color: #6a798c; line-height: 1.6; margin: 12px 0 0; }

/* LANDING FOOTER */
.landing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #9aa6b4;
  font-size: 11px;
  padding-top: 25px;
  border-top: 1px solid #e8edf2;
  margin-top: auto;
}
.footer-left p { margin: 6px 0 0; color: #7f8e9f; }

/* MODAIS & DIALOGS */
[hidden], .field[hidden], #authNameField[hidden] { display: none !important; }
input[type="file"] { display: none !important; }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed #b5e2cc;
  border-radius: 14px;
  padding: 26px 20px;
  background: #f4fbf7;
  cursor: pointer;
  transition: all .2s ease;
  margin: 12px 0 16px;
}
.drop-zone:hover {
  border-color: #17b37b;
  background: #eaf7f1;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px #17b37b15;
}
.upload-symbol {
  font-size: 28px;
  color: #15ad77;
  margin-bottom: 6px;
}
.drop-zone strong {
  color: #10203a;
  font: 700 14px 'DM Sans', sans-serif;
  margin-bottom: 4px;
}
.drop-zone small {
  color: #647385;
  font-size: 12px;
  margin-bottom: 6px;
}
.drop-zone em {
  font-size: 10px;
  color: #129a6a;
  font-style: normal;
  font-weight: 700;
  background: #dff5eb;
  padding: 3px 9px;
  border-radius: 12px;
}

dialog {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 15px 60px #101b2d45;
  padding: 0;
  width: min(390px, calc(100% - 30px));
}
dialog::backdrop { background: #101b2d8c; backdrop-filter: blur(3px); }
dialog form { padding: 28px; position: relative; }
dialog h2 { margin: 0 0 8px; }
.dialog-copy { font-size: 12px; color: #7b8798; line-height: 1.5; margin-bottom: 20px; }
.close { position: absolute; right: 15px; top: 12px; border: 0; background: none; font-size: 24px; color: #8994a1; cursor: pointer; }
dialog .primary-btn { width: 100%; margin-top: 18px; }

.auth-switch {
  text-align: center !important;
  color: #748395 !important;
  margin: 18px 0 0 !important;
  font-size: 12px !important;
}
.auth-switch button {
  all: unset !important;
  border: 0 !important;
  background: transparent !important;
  color: #15ad77 !important;
  font: 700 12px 'DM Sans', sans-serif !important;
  cursor: pointer !important;
  padding: 0 4px !important;
  text-decoration: underline !important;
  display: inline-block !important;
  box-shadow: none !important;
  outline: none !important;
}
.auth-switch button:hover {
  color: #0f8f61 !important;
}

/* RESPONSIVIDADE & MOBILE OPTIMIZATION */
@media (max-width: 1200px) {
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .landing-stats { grid-template-columns: repeat(2, 1fr); gap: 15px; }
}

@media (max-width: 900px) {
  .analytics-grid {
    grid-template-columns: 1fr !important;
  }
  .bankroll-tools {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 16px !important;
  }
  .bankroll-tools > div:first-child {
    margin-bottom: 4px;
  }
  .tool-numbers {
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .bankroll-tools .ghost-btn {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 768px) {
  .landing { padding: 18px 16px !important; }
  .nav-links { display: none !important; }
  .landing-hero { grid-template-columns: 1fr !important; gap: 30px !important; padding: 25px 0 !important; }
  .hero-dashboard { max-width: 100% !important; margin: auto !important; transform: none !important; }
  
  .sidebar { position: static !important; width: auto !important; height: auto !important; padding: 14px 18px !important; flex-direction: row !important; align-items: center !important; }
  .brand { margin: 0 auto 0 0 !important; }
  .sidebar-foot { display: none !important; }
  nav { display: flex !important; gap: 3px !important; }
  nav a { font-size: 11px !important; padding: 8px 10px !important; }
  
  main { margin: 0 !important; padding: 20px 14px !important; }
  .content-grid { grid-template-columns: 1fr !important; }
  
  /* Header & Action Buttons */
  .main-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
  }
  .header-actions {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .period-selector {
    width: 100% !important;
    display: flex !important;
  }
  .period-selector button {
    flex: 1 !important;
    text-align: center !important;
    padding: 8px 4px !important;
    font-size: 11px !important;
  }
  .header-buttons {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .import-btn, .ghost-btn, .logout-btn {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 10px 8px !important;
  }

  /* Metrics Cards */
  .metrics {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .metrics article {
    padding: 12px 14px !important;
  }
  .metrics strong {
    font-size: 19px !important;
  }

  /* Balance Card */
  .balance-card {
    padding: 20px 18px !important;
  }
  .balance-card strong {
    font-size: 28px !important;
  }

  /* Form Rows */
  .form-row, .form-row.three {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .form-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .form-actions {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
  }
  .form-actions button {
    flex: 1 !important;
    justify-content: center !important;
  }

  /* History Table Filters */
  .history-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .filter-wrap {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .filter-wrap input, .filter-wrap select, .filter-wrap button {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Table Horizontal Scroll */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
  }
  table {
    min-width: 620px !important;
  }

  /* Dialog Modals */
  dialog {
    width: calc(100vw - 24px) !important;
    max-width: 440px !important;
    margin: auto !important;
  }
  dialog form {
    padding: 20px 16px !important;
  }
}

@media (max-width: 440px) {
  .metrics {
    grid-template-columns: 1fr !important;
  }
  .tool-numbers {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .hero-copy h1 { font-size: 32px !important; }
}

/* --- DARK MODE TEMA ESCURO --- */
:root[data-theme="dark"] {
  --bg: #090e17;
  --card-bg: #111a2e;
  --panel-bg: #111a2e;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: #1e2d44;
  --border: #1e2d44;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .landing {
  background: #070b12 !important;
  color: #f1f5f9 !important;
}

:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .metrics article,
:root[data-theme="dark"] .bankroll-tools,
:root[data-theme="dark"] .goal-card,
:root[data-theme="dark"] .breakdown-item,
:root[data-theme="dark"] .tool-numbers,
:root[data-theme="dark"] dialog {
  background: #10192b !important;
  border-color: #1c2b45 !important;
  color: #f1f5f9 !important;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select {
  background: #17243b !important;
  border-color: #243756 !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] th {
  color: #94a3b8 !important;
}
:root[data-theme="dark"] td {
  border-top-color: #1c2b45 !important;
  color: #f1f5f9 !important;
}

:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .icon-toggle-btn,
:root[data-theme="dark"] .action-btn {
  background: #16233a !important;
  border-color: #253959 !important;
  color: #e2e8f0 !important;
}
:root[data-theme="dark"] .ghost-btn:hover,
:root[data-theme="dark"] .icon-toggle-btn:hover {
  background: #1e3152 !important;
  border-color: #17b37b !important;
  color: #34d399 !important;
}

:root[data-theme="dark"] .sub,
:root[data-theme="dark"] .metrics p,
:root[data-theme="dark"] .panel-title p {
  color: #94a3b8 !important;
}

:root[data-theme="dark"] .calc-result {
  background: #16233a !important;
  border-color: #253959 !important;
  color: #e2e8f0 !important;
}

/* GOAL CARD (META MENSAL) */
.goal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 22px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(25, 43, 70, 0.04);
}
.goal-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
}
.goal-info span {
  font: 700 13px 'DM Sans', sans-serif;
  color: var(--ink);
}
.goal-info strong {
  color: #15ad77;
}
.goal-info small {
  font-size: 11px;
  color: #718096;
}
.goal-bar-wrap {
  flex: 1;
  height: 10px;
  background: #e2e8f0;
  border-radius: 5px;
  overflow: hidden;
}
.goal-bar {
  height: 100%;
  background: linear-gradient(90deg, #15ad77, #34d399);
  border-radius: 5px;
  transition: width .4s ease;
}
.goal-btn {
  font-size: 11px !important;
  padding: 8px 12px !important;
}

/* HEADER BUTTONS & TOGGLES */
.header-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.icon-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e0e8;
  border-radius: 9px;
  background: #ffffff;
  padding: 9px 12px;
  color: #4b5869;
  font: 700 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .18s ease;
}
.icon-toggle-btn:hover {
  border-color: #17b37b;
  background: #eef8f3;
  color: #0f8b5f;
}

/* CALCULATOR TAB BUTTONS */
.tab-buttons {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.tab-btn {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  font: 700 12px 'DM Sans', sans-serif;
  color: #718096;
  cursor: pointer;
  border-radius: 6px;
  transition: all .18s;
}
.tab-btn.active {
  background: #edfdf6;
  color: #15ad77;
}
.calc-result {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
  font-size: 13px;
  color: #334155;
  text-align: center;
}
.calc-result strong {
  color: #15ad77;
  font-weight: 700;
}

/* SHARE CARD CANVAS */
.share-dialog {
  width: min(720px, calc(100vw - 24px)) !important;
}
.share-canvas-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  margin: 14px 0 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
#shareCanvas {
  width: 100%;
  height: auto;
  display: block;
}
