:root {
  font-family: "Aptos", "Avenir Next", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #28253b;
  background: #f6f5fa;
  --ink: #28253b;
  --soft: #655f76;
  --accent: #573eb0;
  --accent-dark: #44318d;
  --line: #e8e4f0;
  --tint: #f1ecfd;
  --green: #1b6a54;
  --red: #a23758;
  --radius: 17px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.05rem); line-height: 1.06; letter-spacing: -.065em; }
h2 { font-size: 1.19rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
p { line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid #8a66e5; outline-offset: 2px; }
.shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: #26223a; color: #e7e0f4; padding: 28px 15px 18px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; line-height: 1.06; font-size: 1.12rem; font-weight: 710; letter-spacing: -.04em; width: max-content; margin: 0 10px 34px; }
.brand-icon { width: 37px; height: 37px; flex: none; background: #d8c6ff; border-radius: 12px; display: flex; gap: 3px; justify-content: center; align-items: end; padding-bottom: 8px; transform: rotate(-5deg); }
.brand-icon i { height: 10px; width: 4px; border-radius: 4px; background: #53399a; }
.brand-icon i:nth-child(2) { height: 15px; }
.brand-icon i:nth-child(3) { height: 21px; }
.navigation { display: grid; gap: 5px; }
.navigation a, .data-link { padding: 10px 11px; min-height: 43px; border-radius: 8px; display: flex; align-items: center; gap: 10px; font-size: .91rem; font-weight: 600; }
.navigation b { width: 19px; font-size: 1.1rem; text-align: center; color: #c7b7ea; }
.navigation a:hover, .data-link:hover { background: #3a3350; }
.navigation a[aria-current], .data-link[aria-current] { background: #49396d; color: #fff; }
.data-link { border-top: 1px solid #4a405e; border-radius: 0 0 8px 8px; margin-top: auto; }
.workspace { min-width: 0; }
.topbar { min-height: 61px; padding: 10px clamp(16px, 4vw, 50px); border-bottom: 1px solid var(--line); background: white; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--soft); font-size: .9rem; font-weight: 600; }
#status-data { color: var(--accent-dark); padding: 5px 9px; border-radius: 50px; background: var(--tint); font-size: .81rem; }
main { max-width: 1510px; margin: auto; padding: 29px clamp(16px, 4vw, 50px) 45px; }
main:focus { outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 15px; flex-wrap: wrap; margin-bottom: 18px; }
.subtitle, .muted { color: var(--soft); }
.subtitle { margin-top: 7px; }
.controls, .form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn, .periodo button { border: 1px solid transparent; border-radius: 9px; min-height: 41px; padding: 8px 13px; font-weight: 660; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; }
.primary { color: white; background: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.outline, .periodo button { color: var(--accent-dark); background: white; border-color: #dcd4ec; }
.outline:hover, .periodo button:hover { background: var(--tint); }
.ghost { color: var(--accent-dark); background: transparent; }
.ghost:hover { background: var(--tint); }
.danger { color: var(--red); background: #fff2f5; border-color: #f0d7df; }
.link { color: var(--accent-dark); font-size: .9rem; font-weight: 680; }
.link:hover { text-decoration: underline; }
.periodo { display: flex; align-items: center; gap: 4px; }
.periodo button { font-size: 1.25rem; padding: 4px 10px; }
.month { min-height: 41px; padding: 6px 8px; font-size: .89rem; color: var(--ink); background: white; border: 1px solid #dcd4ec; border-radius: 9px; }
.demo { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #eee8fb; color: #443363; border: 1px solid #e4daf8; border-radius: 12px; padding: 11px 14px; margin-bottom: 15px; font-size: .9rem; }
.metrics { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 13px; margin-bottom: 15px; }
.card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; min-width: 0; }
.metric { min-height: 125px; display: flex; flex-direction: column; justify-content: center; }
.metric.major { background: radial-gradient(ellipse at 100% 0%, #6649a0, #37305a 75%); color: #fff; border-color: transparent; }
.metric .kicker { color: var(--soft); font-size: .91rem; font-weight: 650; }
.metric.major .kicker { color: #eee6ff; }
.metric strong { display: block; font-size: clamp(1.3rem, 2.85vw, 2.04rem); font-variant-numeric: tabular-nums; line-height: 1.08; letter-spacing: -.05em; margin: 7px 0; overflow-wrap: anywhere; }
.metric small { font-size: .83rem; color: var(--soft); }
.metric.major small { color: #e3d9fa; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(255px,1fr); gap: 14px; margin: 0 0 14px; }
.card-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head p { color: var(--soft); font-size: .9rem; margin-top: 3px; }
.chart-weeks { display: grid; grid-template-columns: repeat(4,1fr); height: 163px; margin-top: 9px; background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), #ebe7f1 calc(25% - 1px) 25%); border-bottom: 1px solid #e5e0ed; }
.bar-pair { display: flex; justify-content: center; align-items: end; gap: 5px; }
.bar { width: clamp(15px, 26%, 33px); height: var(--size); background: var(--color); border-radius: 5px 5px 0 0; }
.axis { display: grid; grid-template-columns: repeat(4,1fr); margin-top: 4px; text-align: center; color: var(--soft); font-size: .84rem; }
.legend { display: flex; gap: 12px; color: var(--soft); font-size: .84rem; margin-top: 11px; flex-wrap: wrap; }
.legend i, .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--color); margin-right: 5px; }
.list { padding: 0; margin: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top-color: transparent; }
.row-title { font-weight: 640; overflow-wrap: anywhere; }
.row small { color: var(--soft); font-size: .83rem; }
.row-amount { text-align: right; font-variant-numeric: tabular-nums; }
.row-amount .btn { min-height: 30px; padding: 3px 6px; }
.trend { padding-top: 5px; margin-bottom: 10px; }
.track { background: #efebf5; height: 8px; border-radius: 7px; overflow: hidden; margin: 8px 0 4px; }
.track > i { display: block; height: 100%; background: var(--color, #7c62c9); width: var(--progress); border-radius: inherit; }
.split { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--soft); font-size: .87rem; }
.split strong { color: var(--ink); }
.split .negative { color: var(--red); }
.tag { white-space: nowrap; border-radius: 9px; background: var(--tint); color: var(--accent-dark); padding: 5px 8px; font-size: .81rem; font-weight: 650; }
.plan-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 13px; margin-top: 13px; }
.plan-card > strong { display: block; margin-top: 6px; font-size: 1.23rem; overflow-wrap: anywhere; }
.plan-card .form-actions { margin-top: 12px; }
.empty { color: var(--soft); padding: 9px 0; }
.single, .quiz { max-width: 730px; }
.single .card + .card { margin-top: 12px; }
.single .card p { margin: 6px 0; }
.search { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.search input, .search select { min-height: 39px; min-width: 140px; padding: 7px 9px; border-radius: 8px; color: var(--ink); border: 1px solid #dcd4ec; background: white; }
dialog { width: min(520px,calc(100% - 24px)); max-height: calc(100dvh - 26px); border: 1px solid var(--line); border-radius: 17px; color: var(--ink); padding: 19px; }
dialog::backdrop { background: #231934a8; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.modal-close { border: 0; background: var(--tint); color: var(--accent-dark); font-size: 1.4rem; width: 32px; height: 32px; border-radius: 7px; }
.fields { display: grid; gap: 11px; }
.field { display: grid; gap: 4px; color: var(--ink); font-size: .92rem; font-weight: 620; }
.field input, .field select { width: 100%; min-height: 41px; border: 1px solid #d9d1e8; border-radius: 8px; color: var(--ink); padding: 7px 9px; background: white; font-weight: 450; }
.form-actions { margin-top: 14px; }
.error { color: var(--red); margin-top: 8px; font-size: .89rem; }
.error:empty { display: none; }
.quiz > .card { padding: clamp(17px,4vw,31px); }
.quiz .primary { margin-top: 4px; }
.quiz h1 { font-size: clamp(1.65rem,4vw,2.45rem); }
.quiz .fields { margin-top: 13px; }
.choice { display: flex; gap: 9px; align-items: center; min-height: 44px; padding: 8px 10px; border: 1px solid #e2d9ed; border-radius: 8px; cursor: pointer; }
.choice:has(:checked) { background: var(--tint); border-color: #b8a7e7; }
.choice input, input[type=checkbox] { accent-color: var(--accent); }
.score { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.score-number { display: grid; place-content: center; text-align: center; height: 75px; width: 75px; flex: none; border: 5px solid #b69ce9; border-radius: 50%; color: var(--accent-dark); font-size: 1.34rem; font-weight: 730; }
.score-number small { font-size: .73rem; color: var(--soft); }
.tip { margin: 10px 0; padding: 11px 12px; border-radius: 10px; background: var(--tint); color: #4a3d66; }
details { margin-top: 11px; }
summary { cursor: pointer; color: var(--accent-dark); font-weight: 640; }
.habit { display: flex; gap: 8px; align-items: center; }
.habit input { width: 19px; height: 19px; flex: none; }
.habit-done .row-title { color: var(--green); }
#notice { position: fixed; z-index: 4; right: 15px; bottom: 15px; max-width: min(480px,calc(100% - 30px)); padding: 10px 13px; background: #37285b; color: white; border-radius: 9px; box-shadow: 0 4px 25px #33234b36; }
#notice:empty { display: none; }
@media (max-width: 1020px) {
  .shell { grid-template-columns: 170px minmax(0,1fr); }
}
@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 10px 12px; display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; }
  .brand, .data-link { margin: 0; }
  .brand { font-size: .94rem; }
  .brand-icon { width: 32px; height: 32px; padding-bottom: 6px; }
  .data-link { border: 0; border-radius: 8px; }
  .navigation { order: 3; display: flex; flex-wrap: wrap; width: 100%; }
  .navigation a { min-height: 35px; font-size: .83rem; padding: 5px 8px; gap: 5px; }
  .navigation b { font-size: .87rem; width: 15px; }
  .topbar { min-height: 47px; }
}
@media (max-width: 570px) {
  main { padding-top: 19px; }
  .grid, .plan-cards { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 7px; }
  .metric { min-height: 100px; }
  .metric.major { grid-column: 1 / -1; }
  .card { padding: 13px; }
  .search input { flex: 1 0 150px; }
}

:root {
  --accent: #5437b5;
  --accent-dark: #432b90;
  --line: #e7e3f2;
  background: #f7f7fc;
}
.sidebar { background: linear-gradient(160deg, #211a39 0, #19172f 65%, #252345 100%); }
.brand-icon { background: linear-gradient(145deg, #dbcbff, #b4abff 64%, #a3d8fa); }
.navigation a[aria-current] { box-shadow: inset 2px 0 #a995ff; }
.navigation .luna-nav b { color: #c7b3ff; }
.topbar { background: #fff; }
.intro-financas { position: relative; padding: clamp(15px, 3.5vw, 26px); margin-bottom: 14px; border-radius: 20px;
  border: 1px solid #e2def1; background: radial-gradient(ellipse at 100% 0%, #e3e6ff 0, transparent 61%),
  radial-gradient(ellipse at 0% 100%, #eee5ff, transparent 58%), #fbfaff; }
.intro-financas .page-head { margin-bottom: 10px; }
.intro-luna { display: flex; align-items: center; justify-content: space-between; gap: 11px; flex-wrap: wrap; color: var(--soft); }
.luna-button { background: #fff; border-color: #ded2f4; color: var(--accent-dark); }
.luna-button:hover { background: #eee8fc; }
.metric.major { background: radial-gradient(ellipse at 106% -20%, #7359bc, transparent 70%), linear-gradient(124deg,#322957,#292744); }
.luna-shell { max-width: 925px; }
.luna-card { padding: clamp(14px, 2.6vw, 22px); box-shadow: 0 11px 35px #2b225b0c; }
.luna-mast { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; border: 1px solid #e8e0f6;
  background: linear-gradient(112deg,#f1eaff,#f8f6ff 58%,#edf6fd); }
.luna-orb { width: 47px; height: 47px; flex: none; display: grid; place-items: center; border-radius: 15px; color: #fff;
  background: linear-gradient(155deg,#5c3fc0,#7557d1 65%,#5f99cc); font-size: 1.42rem; }
.luna-mast p { font-size: .9rem; color: var(--soft); margin-top: 4px; }
.luna-mode { display: inline-flex; flex: none; margin-left: auto; font-size: .78rem; color: #4b368a; background: #fff;
  border: 1px solid #e0d7f1; border-radius: 30px; font-weight: 650; padding: 5px 9px; }
.chat-log { min-height: 148px; max-height: 420px; overflow-y: auto; display: grid; align-content: start; gap: 8px; margin: 13px 0; padding: 7px 2px; }
.chat-intro { color: var(--soft); padding: 8px 6px; }
.chat-bubble { justify-self: start; width: fit-content; max-width: min(94%, 65ch); padding: 10px 12px;
  background: #f6f2fe; color: #302746; border: 1px solid #eee7f8; border-radius: 12px; overflow-wrap: anywhere; }
.chat-bubble strong { display: block; font-size: .83rem; margin-bottom: 4px; }
.chat-bubble p { white-space: pre-wrap; }
.chat-user { justify-self: end; background: #efeffa; border-color: #e6e3f5; }
.chat-pending { color: var(--accent-dark); padding: 8px 5px; font-size: .9rem; animation: pulse 1.7s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .58; } to { opacity: 1; } }
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.chat-suggestions .btn { min-height: 34px; font-size: .83rem; }
.check-chat { display: flex; align-items: center; gap: 5px; font-size: .88rem; color: var(--soft); margin: 2px 0 8px; }
.chat-composer { display: flex; align-items: end; gap: 7px; }
.chat-composer textarea { width: 100%; min-width: 0; min-height: 69px; padding: 9px; border: 1px solid #d9d0ea;
  border-radius: 9px; font: inherit; color: var(--ink); resize: vertical; }
.chat-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--soft); font-size: .85rem; margin-top: 8px; }
.chat-footer .btn { min-height: 34px; padding: 5px 8px; font-size: .84rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 570px) {
  .luna-mast { display: grid; grid-template-columns: auto 1fr; align-items: start; }
  .luna-mode { margin-left: 0; grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { .chat-pending { animation: none; } }
