:root {
  --ink: #17201e;
  --muted: #6b7773;
  --cream: #f3f1e9;
  --paper: #fffef9;
  --green: #2d7f64;
  --green-dark: #153c33;
  --green-soft: #dcece4;
  --orange: #e47942;
  --orange-soft: #f9e4d6;
  --line: #dedfd8;
  --shadow: 0 16px 45px rgba(32, 47, 42, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "DM Sans", sans-serif; }
.hidden { display: none !important; }
.auth-screen { min-height: 100vh; padding: 28px clamp(24px, 6vw, 90px); color: white; background: radial-gradient(circle at 15% 10%, rgba(81,178,139,.2), transparent 27%), #101b18; }
.auth-brand { display: flex; align-items: center; gap: 11px; font: 800 20px "Manrope"; }
.auth-brand strong > span { color: #87c8ad; }
.auth-layout { min-height: calc(100vh - 94px); display: grid; grid-template-columns: 1fr minmax(360px, 470px); gap: 9vw; align-items: center; max-width: 1250px; margin: auto; }
.auth-copy h1 { margin: 13px 0 20px; font: 800 clamp(43px, 6vw, 76px)/.98 "Manrope"; letter-spacing: -3px; }
.auth-copy h1 em { color: #8bc9b0; font-style: normal; }
.auth-copy > p:last-of-type { max-width: 560px; color: #adbbb6; font-size: 17px; line-height: 1.65; }
.auth-benefits { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.auth-benefits span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: #c7d3cf; font-size: 12px; }
.auth-card { padding: 10px 32px 32px; border: 1px solid rgba(255,255,255,.1); border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 70px rgba(0,0,0,.25); }
.auth-tabs { margin: 0 -22px 28px; padding: 7px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 16px; background: #eeeee8; }
.auth-tabs button { padding: 11px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; font-weight: 800; }
.auth-tabs button.active { color: var(--green-dark); background: white; box-shadow: 0 4px 14px rgba(20,35,30,.08); }
.auth-form { display: none; }
.auth-form.active { display: block; animation: rise .2s ease; }
.auth-form h2 { margin: 5px 0 20px; font: 800 25px "Manrope"; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; padding: 28px 20px; display: flex; flex-direction: column; background: #101b18; color: white; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; color: white; text-decoration: none; font: 800 20px "Manrope"; }
.brand > span:last-child span { color: #87c8ad; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px 12px 12px 4px; background: var(--green); font-size: 13px; letter-spacing: -.5px; }
.brand-mark img { width: 38px; height: 38px; display: block; border-radius: 11px; }
nav { margin-top: 48px; display: grid; gap: 8px; }
.nav-link { width: 100%; border: 0; border-radius: 12px; padding: 13px 15px; display: flex; gap: 12px; align-items: center; color: #a7b2ae; background: transparent; text-align: left; font-weight: 600; }
.nav-link span { width: 20px; font-size: 20px; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,.09); }
.side-note { margin-top: auto; padding: 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; display: flex; gap: 10px; background: rgba(255,255,255,.04); }
.logout-button { margin-top: 10px; padding: 11px; border: 0; color: #92a19b; background: transparent; font-size: 12px; font-weight: 700; }
.logout-button:hover { color: white; }
.side-note strong, .side-note small { display: block; }
.side-note strong { font-size: 12px; }
.side-note small { margin-top: 4px; color: #91a09a; font-size: 11px; line-height: 1.4; }
.pulse { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #67d6a8; box-shadow: 0 0 0 5px rgba(103,214,168,.12); }
main { grid-column: 2; min-width: 0; }
.topbar { height: 94px; padding: 20px 5vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(243,241,233,.85); backdrop-filter: blur(12px); }
.topbar h1 { margin: 3px 0 0; font: 700 23px "Manrope"; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.eyebrow.light { color: #91c8b3; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #c8cdc7; border-radius: 50%; background: var(--paper); color: var(--green-dark); font-size: 12px; font-weight: 800; }
.user-chip { display: flex; gap: 11px; align-items: center; }
.user-chip > div:first-child { text-align: right; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { max-width: 190px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; }
.mobile-logout { display: none; }
.menu-button { display: none; border: 0; background: transparent; font-size: 24px; }
.view { display: none; padding: 42px 5vw 70px; max-width: 1400px; margin: auto; }
.view.active { display: block; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.hero { min-height: 235px; padding: 36px 42px; border-radius: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; color: white; background: radial-gradient(circle at 76% 20%, rgba(103,214,168,.18), transparent 26%), linear-gradient(125deg, #10241f, #1d4d40); box-shadow: var(--shadow); }
.hero h2 { margin: 9px 0 12px; font: 800 clamp(31px, 4vw, 49px)/1.05 "Manrope"; letter-spacing: -2px; }
.hero h2 em { color: #98ceb8; font-style: normal; }
.hero p:last-child { max-width: 470px; margin: 0; color: #b9c9c3; }
.hero-total { min-width: 270px; padding: 24px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-total span, .hero-total small, .hero-total strong { display: block; }
.hero-total span { color: #a6beb5; font-size: 10px; font-weight: 800; letter-spacing: 1.4px; }
.hero-total strong { margin: 10px 0 5px; font: 800 32px "Manrope"; }
.hero-total small { color: #a6beb5; }
.stat-grid { margin: 22px 0 45px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat-card { padding: 22px 24px; display: flex; gap: 18px; align-items: center; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); }
.stat-icon, .panel-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: var(--green-dark); background: var(--green-soft); font-size: 22px; }
.stat-icon.orange, .panel-icon.orange { color: #a8491b; background: var(--orange-soft); }
.stat-icon.fuel, .panel-icon.fuel { color: #315f83; background: #dceaf4; }
.stat-card small, .stat-card strong { display: block; }
.stat-card small { margin-bottom: 3px; color: var(--muted); }
.stat-card strong { font: 800 24px "Manrope"; }
.section-heading { margin: 0 0 18px; display: flex; justify-content: space-between; align-items: end; }
.section-heading h2 { margin: 5px 0 0; font: 800 28px "Manrope"; }
.section-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.page-heading { margin-bottom: 28px; }
.text-button { border: 0; color: var(--green); background: transparent; font-weight: 700; }
.agenda { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.agenda-item { min-height: 78px; padding: 15px 20px; display: grid; grid-template-columns: 54px 1fr auto; gap: 17px; align-items: center; border-bottom: 1px solid #e8e8e2; }
.agenda-item:last-child { border-bottom: 0; }
.date-tile { width: 48px; height: 50px; display: grid; place-content: center; border-radius: 12px; color: var(--green-dark); background: var(--green-soft); text-align: center; }
.date-tile.orange { color: #a8491b; background: var(--orange-soft); }
.date-tile strong { font: 800 18px/1 "Manrope"; }
.date-tile small { margin-top: 2px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.agenda-copy strong, .agenda-copy small { display: block; }
.agenda-copy small { margin-top: 4px; color: var(--muted); }
.agenda-value { font-weight: 800; color: var(--green); }
.empty { padding: 40px 20px; color: var(--muted); text-align: center; }
.empty span { display: block; margin-bottom: 7px; font-size: 28px; }
.two-column { display: grid; grid-template-columns: minmax(300px, .78fr) minmax(420px, 1.35fr); gap: 24px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 10px 35px rgba(32,47,42,.04); }
.form-panel { padding: 26px; }
.panel-title { margin-bottom: 25px; display: flex; gap: 14px; align-items: center; }
.panel h3 { margin: 0; font: 800 19px "Manrope"; }
.panel p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
label { margin-top: 16px; display: block; font-size: 12px; font-weight: 700; }
label span { color: #98a19e; font-weight: 400; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 13px 14px; border: 1px solid #d6d9d3; border-radius: 11px; outline: none; color: var(--ink); background: white; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,127,100,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px; }
.primary-button { width: 100%; margin-top: 22px; padding: 14px; border: 0; border-radius: 11px; color: white; background: var(--green); font-weight: 800; box-shadow: 0 8px 20px rgba(45,127,100,.2); }
.primary-button:hover { filter: brightness(.94); transform: translateY(-1px); }
.orange-button { background: var(--orange); box-shadow: 0 8px 20px rgba(228,121,66,.2); }
.fuel-button { background: #397aa3; box-shadow: 0 8px 20px rgba(57,122,163,.2); }
.list-panel { overflow: hidden; }
.list-head { min-height: 92px; padding: 22px 25px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.list-head > strong { color: var(--green); font: 800 22px "Manrope"; }
.item-list { max-height: 520px; overflow-y: auto; }
.list-item { padding: 17px 22px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid #e8e8e2; }
.list-item:last-child { border-bottom: 0; }
.item-main { display: flex; gap: 13px; align-items: center; min-width: 0; }
.item-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.item-dot.alta { background: #d95640; }.item-dot.media { background: var(--orange); }.item-dot.baixa { background: #73a98d; }
.item-dot.fuel { background: #397aa3; }
.monthly-panel { margin-top: 22px; overflow: hidden; }
.monthly-history { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.monthly-total { margin: 0; }
.item-copy { min-width: 0; }
.item-copy strong, .item-copy small { display: block; }
.item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-copy small { margin-top: 4px; color: var(--muted); }
.item-actions { display: flex; gap: 9px; align-items: center; }
.amount { font-weight: 800; }
.icon-button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; }
.icon-button:hover { color: #b33b30; border-color: #e4b6b2; background: #fff5f4; }
.check-button { border: 0; color: var(--green); background: var(--green-soft); }
.list-item.done { opacity: .57; }
.list-item.done .item-copy strong { text-decoration: line-through; }
.badge { padding: 5px 8px; border-radius: 999px; background: var(--orange-soft); color: #a8491b; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.toast { position: fixed; right: 24px; bottom: 24px; padding: 13px 17px; border-radius: 11px; color: white; background: #17201e; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .2s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a83c32; }
.install-prompt { position: fixed; left: 50%; bottom: 22px; z-index: 40; width: min(520px, calc(100% - 32px)); padding: 12px 14px; display: grid; grid-template-columns: 46px 1fr auto 32px; gap: 12px; align-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; color: white; background: #12231e; box-shadow: 0 18px 55px rgba(8,24,19,.35); transform: translateX(-50%); animation: installRise .35s ease; }
.install-prompt img { width: 46px; height: 46px; border-radius: 12px; }
.install-copy strong, .install-copy small { display: block; }
.install-copy strong { font: 800 14px "Manrope"; }
.install-copy small { margin-top: 3px; color: #adbbb6; font-size: 11px; line-height: 1.35; }
.install-button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; color: #113127; background: #91ceb5; font-size: 12px; font-weight: 800; }
.install-close { width: 32px; height: 32px; border: 0; color: #94a7a0; background: transparent; font-size: 20px; }
@keyframes installRise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 850px) {
  .auth-layout { grid-template-columns: 1fr; padding: 60px 0; }
  .auth-copy { text-align: center; }
  .auth-copy > p:last-of-type { margin-inline: auto; }
  .auth-benefits { justify-content: center; }
  .auth-card { width: min(100%, 500px); margin: auto; }
  .app-shell { display: block; }
  .sidebar { inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px; width: auto; height: 68px; padding: 7px; border: 1px solid rgba(255,255,255,.1); border-radius: 19px; box-shadow: 0 14px 40px rgba(10,25,20,.28); }
  .sidebar .brand, .sidebar .side-note, .sidebar > .logout-button { display: none; }
  .sidebar nav { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .nav-link { min-height: 52px; padding: 5px 4px; justify-content: center; flex-direction: column; gap: 2px; border-radius: 13px; font-size: 9px; }
  .nav-link span { width: auto; font-size: 18px; line-height: 1; }
  main { display: block; }
  .menu-button { display: none; }
  .topbar { position: sticky; top: 0; z-index: 8; padding: 18px 20px; }
  .view { padding: 28px 18px calc(115px + env(safe-area-inset-bottom)); }
  .two-column { grid-template-columns: 1fr; }
  .mobile-logout { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 17px; }
  .item-list { max-height: none; }
  #appShell:not(.hidden) ~ .install-prompt { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .auth-screen { padding: 22px 17px; }
  .auth-layout { min-height: auto; padding: 42px 0 24px; gap: 40px; }
  .auth-copy h1 { font-size: 42px; letter-spacing: -2px; }
  .auth-benefits { display: none; }
  .auth-card { padding: 10px 23px 25px; }
  .user-chip > div:first-child { display: none; }
  .topbar { height: 82px; }
  .topbar h1 { font-size: 19px; }
  .hero { min-height: 305px; padding: 24px 22px; flex-direction: column; align-items: stretch; justify-content: space-between; border-radius: 20px; }
  .hero h2 { font-size: 34px; }
  .hero-total { padding: 18px 20px; }
  .hero-total { min-width: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: center; }
  .agenda-item { grid-template-columns: 48px 1fr; }
  .agenda-value { grid-column: 2; margin-top: -12px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .list-head { align-items: flex-start; }
  .list-head > strong { font-size: 17px; }
  .list-item { padding: 16px; }
  .item-actions { gap: 5px; }
  .panel { border-radius: 17px; }
  .form-panel { padding: 22px 19px; }
  input, select, textarea { min-height: 48px; font-size: 16px; }
  .primary-button { min-height: 50px; }
  .icon-button { width: 40px; height: 40px; }
  .install-prompt { grid-template-columns: 42px 1fr 30px; gap: 10px; padding: 11px 12px; }
  .install-prompt img { width: 42px; height: 42px; }
  .install-button { grid-column: 2; width: 100%; }
  .install-close { grid-column: 3; grid-row: 1; }
}
