:root{
  --bg:#f3f6f5;
  --surface:#ffffff;
  --surface-soft:#f8faf9;
  --surface-strong:#edf3f1;
  --ink:#10231f;
  --ink-2:#334b45;
  --muted:#71837e;
  --line:#dfe8e5;
  --line-soft:#edf2f0;
  --brand:#12a77c;
  --brand-2:#08765c;
  --brand-deep:#0b2b27;
  --brand-tint:#e8f8f2;
  --income:#14966f;
  --expense:#e15f51;
  --expense-tint:#fff0ed;
  --warning:#c68928;
  --warning-tint:#fff7e8;
  --blue:#3d79c6;
  --blue-tint:#edf5ff;
  --purple:#7b67c8;
  --purple-tint:#f2efff;
  --shadow:0 12px 38px rgba(14,49,42,.08);
  --shadow-soft:0 4px 20px rgba(14,49,42,.06);
  --sidebar-w:258px;
  --sidebar-collapsed:84px;
  --topbar-h:82px;
  --radius:18px;
  --radius-sm:12px;
  font-family:"DM Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--ink)}
body{font-size:14px;overflow-x:hidden}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.58}
.hidden{display:none!important}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* auth */
.auth-view{min-height:100vh;display:grid;grid-template-columns:minmax(480px,45%) 1fr;position:relative;overflow:hidden;background:linear-gradient(130deg,#f9fbfa 0%,#edf4f1 48%,#0b2b27 48%,#0a2421 100%)}
.auth-panel{position:relative;z-index:2;width:min(510px,calc(100% - 70px));margin:auto;padding:54px 0}
.auth-ambient{position:absolute;border-radius:999px;filter:blur(1px);pointer-events:none}
.auth-ambient-a{width:360px;height:360px;background:rgba(18,167,124,.09);left:-150px;bottom:-100px}
.auth-ambient-b{width:250px;height:250px;background:rgba(255,255,255,.05);right:12%;top:-110px}
.brand{display:flex;align-items:center;gap:11px}
.brand strong{display:block;font:800 23px/1 "Manrope",sans-serif;letter-spacing:-.7px}
.brand small{display:block;margin-top:4px;font-size:9px;font-weight:800;letter-spacing:.24em;color:var(--brand)}
.brand-mark{width:36px;height:36px;display:flex;align-items:flex-end;gap:3px;padding:8px;border-radius:11px;background:var(--brand-deep)}
.brand-mark span{display:block;width:5px;border-radius:5px;background:#63e0bc}
.brand-mark span:nth-child(1){height:9px}.brand-mark span:nth-child(2){height:17px}.brand-mark span:nth-child(3){height:13px}
.brand-auth{margin-bottom:70px}
.auth-copy .eyebrow,.eyebrow{font-size:10px;font-weight:800;letter-spacing:.16em;color:var(--brand-2)}
.auth-copy h1{font:800 clamp(34px,4vw,55px)/1.06 "Manrope",sans-serif;letter-spacing:-2.7px;margin:18px 0 20px;max-width:600px}
.auth-copy p{color:var(--ink-2);font-size:16px;line-height:1.7;max-width:545px;margin:0}
.auth-highlights{display:grid;gap:13px;margin:38px 0 32px}
.auth-highlights>div{display:flex;gap:14px;align-items:flex-start}
.auth-highlights i{font-style:normal;color:var(--brand);font-weight:800;font-size:11px;padding-top:2px}
.auth-highlights span{color:var(--muted);font-size:13px;line-height:1.45}.auth-highlights b{display:block;color:var(--ink);font-size:14px;margin-bottom:2px}
.google-button{border:0;background:var(--brand-deep);color:#fff;width:100%;height:54px;border-radius:14px;display:flex;align-items:center;justify-content:center;gap:12px;font-weight:700;box-shadow:0 13px 25px rgba(11,43,39,.19);transition:.2s ease}
.google-button:hover{transform:translateY(-1px);background:#103934}.google-button svg{width:21px;height:21px;stroke:none}
.auth-status{font-size:12px;color:var(--muted);text-align:center;margin-top:15px;min-height:18px}
.auth-status.error{color:var(--expense)}
.auth-footnote{margin-top:24px;padding-top:22px;border-top:1px solid var(--line);font-size:11px;line-height:1.55;color:var(--muted)}
.auth-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;z-index:1;padding:50px}
.preview-window{width:min(760px,92%);aspect-ratio:1.35;background:#f8fbfa;border-radius:22px;box-shadow:0 35px 85px rgba(0,0,0,.28);display:flex;overflow:hidden;transform:perspective(1200px) rotateY(-4deg) rotateX(1deg)}
.preview-sidebar{width:18%;background:#0f3530;padding:7%;display:flex;flex-direction:column;gap:8%;align-items:flex-start}.preview-logo{width:40%;height:5%;background:#64dfbd;border-radius:5px;margin-bottom:20%}.preview-sidebar i{width:95%;height:3%;border-radius:5px;background:rgba(255,255,255,.17)}
.preview-content{flex:1;padding:5%;background:#eef3f1}.preview-top{display:flex;justify-content:space-between;margin-bottom:5%}.preview-top span:first-child{width:30%;height:12px;background:#24433e;border-radius:8px}.preview-top span:last-child{width:12%;height:12px;background:#cddbd7;border-radius:8px}
.preview-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:3%;margin-bottom:4%}.preview-cards i{height:72px;border-radius:12px;background:#fff;box-shadow:0 4px 15px rgba(20,45,40,.06)}.preview-cards i:first-child{background:#123c36}
.preview-grid{display:grid;grid-template-columns:1.6fr 1fr;gap:4%;height:47%}.preview-chart,.preview-list{background:#fff;border-radius:14px;padding:8%;display:flex}.preview-chart{align-items:flex-end;justify-content:space-between}.preview-chart b{display:block;width:8%;border-radius:5px 5px 0 0;background:#49c39f}.preview-chart b:nth-child(1){height:35%}.preview-chart b:nth-child(2){height:64%;background:#ef8c7f}.preview-chart b:nth-child(3){height:48%}.preview-chart b:nth-child(4){height:75%;background:#ef8c7f}.preview-chart b:nth-child(5){height:70%}.preview-chart b:nth-child(6){height:45%;background:#ef8c7f}.preview-list{flex-direction:column;gap:10%;justify-content:center}.preview-list i{height:8%;border-radius:8px;background:#dce6e3}.preview-list i:nth-child(2){width:70%}.preview-list i:nth-child(4){width:80%}
.preview-caption{margin-top:28px;color:#d6ebe5;font-size:12px;display:flex;align-items:center;gap:8px}.live-dot{width:8px;height:8px;border-radius:50%;background:#54dfb8;box-shadow:0 0 0 5px rgba(84,223,184,.12);display:inline-block}

/* loaders and error */
.loading-view,.error-view{min-height:100vh;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 45%,#f9fcfb,#edf4f1);text-align:center;padding:30px}
.loader-logo{width:70px;height:70px;margin:0 auto 24px;border-radius:21px;background:var(--brand-deep);display:flex;align-items:flex-end;justify-content:center;gap:6px;padding:17px;box-shadow:var(--shadow)}.loader-logo span{width:8px;background:#60ddba;border-radius:7px;animation:pulseBar 1.2s infinite ease-in-out}.loader-logo span:nth-child(1){height:17px}.loader-logo span:nth-child(2){height:34px;animation-delay:.15s}.loader-logo span:nth-child(3){height:24px;animation-delay:.3s}@keyframes pulseBar{50%{opacity:.38;transform:scaleY(.7)}}
.loading-view h2{font:800 27px "Manrope",sans-serif;margin:0 0 8px}.loading-view p{color:var(--muted);margin:0}.loading-line{width:250px;height:4px;background:#dbe6e2;border-radius:20px;overflow:hidden;margin:25px auto 0}.loading-line i{display:block;width:45%;height:100%;background:var(--brand);border-radius:20px;animation:loadingMove 1.25s infinite ease-in-out}@keyframes loadingMove{0%{transform:translateX(-110%)}100%{transform:translateX(330%)}}
.error-card{background:#fff;border:1px solid var(--line);width:min(520px,100%);padding:45px;border-radius:24px;box-shadow:var(--shadow)}.error-icon{width:55px;height:55px;border-radius:17px;background:var(--expense-tint);color:var(--expense);display:grid;place-items:center;font:800 25px "Manrope";margin:0 auto 22px}.error-card h2{font:800 27px "Manrope";letter-spacing:-.8px;margin:12px 0}.error-card p{line-height:1.65;color:var(--muted);margin:0}.error-details{margin-top:18px;padding:12px;border-radius:10px;background:#f6f8f7;color:#687a75;font:11px/1.5 ui-monospace,monospace;text-align:left;word-break:break-word}.error-actions{display:flex;gap:10px;margin-top:27px}.primary-button,.secondary-button{height:45px;border-radius:12px;padding:0 20px;font-weight:700;flex:1}.primary-button{border:0;background:var(--brand-deep);color:#fff}.secondary-button{border:1px solid var(--line);background:#fff;color:var(--ink)}

/* shell */
.app-shell{min-height:100vh;display:grid;grid-template-columns:var(--sidebar-w) minmax(0,1fr);transition:grid-template-columns .22s ease}
.app-shell.sidebar-collapsed{grid-template-columns:var(--sidebar-collapsed) minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;background:var(--brand-deep);color:#fff;display:flex;flex-direction:column;z-index:35;overflow:hidden;box-shadow:7px 0 25px rgba(11,43,39,.05)}
.sidebar-head{height:var(--topbar-h);display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid rgba(255,255,255,.08);flex-shrink:0}.sidebar .brand strong{color:#fff}.sidebar .brand small{color:#62dbb8}.sidebar .brand-mark{background:rgba(255,255,255,.07)}
.icon-button{width:39px;height:39px;border-radius:11px;border:1px solid var(--line);background:#fff;color:var(--ink-2);display:grid;place-items:center;padding:0;transition:.18s}.icon-button:hover{background:var(--surface-strong)}.sidebar-collapse{border-color:rgba(255,255,255,.1);background:rgba(255,255,255,.05);color:#cfe3dd;flex-shrink:0}.sidebar-collapse:hover{background:rgba(255,255,255,.1)}.sidebar-collapse svg{transition:transform .22s ease}.sidebar-collapse.is-collapsed svg{transform:rotate(180deg)}
.main-nav{padding:18px 12px;display:flex;flex-direction:column;gap:4px;overflow-y:auto;scrollbar-width:none}.main-nav::-webkit-scrollbar{display:none}.nav-item{border:0;background:transparent;color:#a9c1ba;border-radius:11px;height:45px;padding:0 12px;display:flex;align-items:center;gap:13px;text-align:left;white-space:nowrap;font-size:13px;font-weight:600;transition:.18s}.nav-item:hover{color:#fff;background:rgba(255,255,255,.055)}.nav-item.active{background:rgba(76,219,177,.14);color:#79e7c6}.nav-icon{width:25px;height:25px;display:grid;place-items:center;font-size:19px;flex-shrink:0}.luna-nav-icon{font-size:17px;color:#8ceccf}.sidebar-bottom{margin-top:auto;padding:12px;border-top:1px solid rgba(255,255,255,.07)}.readonly-card{display:flex;align-items:center;gap:11px;padding:11px;border-radius:12px;background:rgba(255,255,255,.055);margin-bottom:7px;white-space:nowrap}.readonly-icon{width:25px;height:25px;display:grid;place-items:center;color:#61deb9}.readonly-card b{display:block;font-size:11px;color:#e7f4f0}.readonly-card small{display:block;font-size:9px;color:#8ea8a0;margin-top:2px}.logout-button{width:100%}
.app-shell.sidebar-collapsed .sidebar .brand,.app-shell.sidebar-collapsed .nav-item>span:last-child,.app-shell.sidebar-collapsed .readonly-card>div{display:none}.app-shell.sidebar-collapsed .sidebar-head{justify-content:center;padding:0}.app-shell.sidebar-collapsed .nav-item{justify-content:center;padding:0}.app-shell.sidebar-collapsed .readonly-card{justify-content:center}
.workspace{min-width:0;min-height:100vh}.topbar{height:var(--topbar-h);background:rgba(255,255,255,.92);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:25}.topbar-left{display:flex;align-items:center;gap:12px}.topbar-left h1{font:800 22px/1.1 "Manrope";letter-spacing:-.6px;margin:5px 0 0}.breadcrumb{font-size:10px;color:var(--muted);font-weight:600}.mobile-menu-button{display:none}.topbar-actions{display:flex;align-items:center;gap:11px}.sync-state{display:flex;align-items:center;gap:9px;border:1px solid var(--line);height:39px;border-radius:12px;padding:0 13px;color:var(--muted);font-size:11px;background:#fff}.sync-state.syncing .live-dot{background:#e0a13b;box-shadow:0 0 0 5px rgba(224,161,59,.12)}.sync-state.error .live-dot{background:var(--expense);box-shadow:0 0 0 5px rgba(225,95,81,.12)}
.luna-top-button{height:39px;border-radius:11px;border:0;background:var(--brand-deep);color:#fff;padding:0 15px;font-weight:700;display:flex;align-items:center;gap:8px}.luna-top-button span{color:#73e4c3}.user-menu{position:relative}.user-button{height:48px;border:0;background:transparent;border-left:1px solid var(--line);padding:0 0 0 15px;margin-left:3px;display:flex;align-items:center;gap:10px;text-align:left}.avatar{width:35px;height:35px;border-radius:11px;background:linear-gradient(145deg,var(--brand),var(--brand-2));color:#fff;display:grid;place-items:center;font-weight:800;overflow:hidden}.avatar img{width:100%;height:100%;object-fit:cover}.user-copy b,.user-copy small{display:block}.user-copy b{font-size:12px}.user-copy small{font-size:9px;color:var(--muted);margin-top:3px}.chevron{color:var(--muted)}.user-dropdown{position:absolute;right:0;top:56px;width:230px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:14px;padding:14px;z-index:50}.user-dropdown b,.user-dropdown span{display:block}.user-dropdown b{font-size:12px}.user-dropdown span{font-size:10px;color:var(--muted);margin-top:4px;overflow:hidden;text-overflow:ellipsis}.user-dropdown button{border:0;border-top:1px solid var(--line-soft);background:transparent;width:100%;text-align:left;margin-top:12px;padding:12px 3px 1px;color:var(--expense);font-weight:600;font-size:12px}
.workspace-body{padding:25px 28px 45px;max-width:1800px;margin:0 auto}.page{display:none}.active-page{display:block;animation:pageIn .22s ease}@keyframes pageIn{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}

/* reusable */
.page-intro{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:20px}.page-intro h2{font:800 22px "Manrope";letter-spacing:-.5px;margin:0}.page-intro p{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.55}.page-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.month-picker{height:40px;border:1px solid var(--line);background:#fff;border-radius:11px;display:flex;align-items:center;overflow:hidden}.month-picker button{width:37px;height:100%;border:0;background:#fff;color:var(--ink-2);font-size:18px}.month-picker button:hover{background:var(--surface-soft)}.month-picker span{min-width:135px;text-align:center;font-size:11px;font-weight:700;text-transform:capitalize}.tag{display:inline-flex;align-items:center;gap:6px;height:27px;border-radius:20px;padding:0 9px;font-size:9px;font-weight:800;letter-spacing:.04em}.tag.readonly{color:var(--blue);background:var(--blue-tint)}.tag.success{color:var(--income);background:var(--brand-tint)}.tag.warning{color:var(--warning);background:var(--warning-tint)}.tag.danger{color:var(--expense);background:var(--expense-tint)}.tag.neutral{color:var(--muted);background:var(--surface-strong)}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-soft)}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:19px 20px 14px;gap:15px}.panel-head h3{font:800 14px "Manrope";margin:0}.panel-head p{color:var(--muted);font-size:10px;margin:4px 0 0}.panel-body{padding:0 20px 20px}.panel-link{border:0;background:transparent;color:var(--brand-2);font-size:10px;font-weight:700}.empty-state{min-height:190px;display:flex;align-items:center;justify-content:center;text-align:center;padding:25px}.empty-state i{display:grid;place-items:center;width:45px;height:45px;border-radius:14px;background:var(--surface-strong);font-style:normal;font-size:20px;margin:0 auto 11px}.empty-state b{display:block;font-size:13px}.empty-state span{display:block;color:var(--muted);font-size:10px;line-height:1.55;margin-top:5px;max-width:300px}
.metric-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}.metric-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px;min-width:0;box-shadow:var(--shadow-soft);position:relative;overflow:hidden}.metric-card.featured{background:linear-gradient(145deg,#0c332d,#0b2925);border-color:transparent;color:#fff}.metric-card::after{content:"";position:absolute;width:90px;height:90px;border-radius:50%;background:var(--brand-tint);right:-35px;top:-40px;opacity:.7}.metric-card.featured::after{background:rgba(73,219,177,.11)}.metric-top{display:flex;justify-content:space-between;align-items:center;gap:10px;position:relative;z-index:1}.metric-label{font-size:10px;color:var(--muted);font-weight:600}.featured .metric-label{color:#b8d2cb}.metric-icon{width:29px;height:29px;border-radius:9px;background:var(--surface-strong);display:grid;place-items:center;font-size:13px}.featured .metric-icon{background:rgba(255,255,255,.09);color:#6de0be}.metric-value{font:800 21px "Manrope";letter-spacing:-.8px;margin-top:15px;position:relative;z-index:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.metric-foot{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:9px;margin-top:7px;position:relative;z-index:1}.featured .metric-foot{color:#9fbbb4}.metric-foot .positive{color:var(--income)}.metric-foot .negative{color:var(--expense)}
.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(300px,.9fr);gap:17px;margin-bottom:17px}.dashboard-secondary{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:17px}.chart-box{height:290px;position:relative}.chart-box.small{height:240px}.chart-toolbar{display:flex;gap:6px}.chart-toolbar button{height:28px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--muted);font-size:9px;padding:0 9px}.chart-toolbar button.active{background:var(--brand-tint);color:var(--brand-2);border-color:#bee8db}.financial-summary{display:grid;gap:10px}.summary-row{display:flex;justify-content:space-between;align-items:center;padding:11px 0;border-bottom:1px solid var(--line-soft)}.summary-row:last-child{border-bottom:0}.summary-row span{font-size:10px;color:var(--muted)}.summary-row b{font-size:11px}.summary-row.total{padding:13px 14px;background:var(--surface-soft);border:0;border-radius:11px}.summary-row.total b{font:800 14px "Manrope"}.progress-line{height:6px;background:var(--surface-strong);border-radius:20px;overflow:hidden;margin-top:7px}.progress-line i{display:block;height:100%;border-radius:20px;background:var(--brand);max-width:100%}

/* tables */
.table-panel{overflow:hidden}.table-scroll{overflow:auto}.data-table{width:100%;border-collapse:collapse;min-width:860px}.data-table th{background:#f7f9f8;color:#657873;text-align:left;font-size:9px;text-transform:uppercase;letter-spacing:.06em;padding:12px 15px;border-top:1px solid var(--line-soft);border-bottom:1px solid var(--line);white-space:nowrap}.data-table td{padding:13px 15px;border-bottom:1px solid var(--line-soft);font-size:11px;vertical-align:middle}.data-table tr:last-child td{border-bottom:0}.data-table tbody tr:hover{background:#fbfcfc}.cell-main{font-weight:700;color:var(--ink)}.cell-sub{font-size:9px;color:var(--muted);margin-top:3px}.amount-income{color:var(--income);font-weight:800}.amount-expense{color:var(--expense);font-weight:800}.scope-pill,.method-pill{display:inline-flex;height:23px;align-items:center;border-radius:8px;padding:0 8px;background:var(--surface-strong);color:var(--ink-2);font-size:9px;font-weight:700}.scope-pill.couple{background:var(--purple-tint);color:var(--purple)}.method-pill.credit{background:var(--warning-tint);color:#a46b16}.method-pill.pix{background:var(--brand-tint);color:var(--brand-2)}.status-dot{display:inline-flex;align-items:center;gap:7px;font-size:10px;font-weight:600}.status-dot i{width:7px;height:7px;border-radius:50%;background:var(--warning)}.status-dot.done i{background:var(--income)}
.table-filters{display:grid;grid-template-columns:minmax(220px,1.4fr) repeat(4,minmax(130px,.7fr)) auto;gap:9px;padding:15px 18px;border-bottom:1px solid var(--line)}.filter-control{height:39px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 11px;color:var(--ink-2);font-size:10px;min-width:0}.search-control{position:relative}.search-control input{width:100%;padding-left:34px}.search-control span{position:absolute;left:12px;top:10px;color:var(--muted)}.export-button{height:39px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 14px;color:var(--ink-2);font-size:10px;font-weight:700}.export-button:hover{background:var(--surface-soft)}.table-footer{display:flex;align-items:center;justify-content:space-between;padding:13px 18px;background:#fbfcfc;border-top:1px solid var(--line-soft);font-size:10px;color:var(--muted)}.table-footer b{color:var(--ink)}

/* dashboard lists */
.activity-list,.due-list{display:grid}.activity-item,.due-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:11px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line-soft)}.activity-item:last-child,.due-item:last-child{border-bottom:0}.activity-icon,.due-date{width:34px;height:34px;border-radius:10px;background:var(--surface-strong);display:grid;place-items:center;font-size:14px}.activity-copy b,.due-copy b{display:block;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.activity-copy small,.due-copy small{display:block;font-size:9px;color:var(--muted);margin-top:3px}.activity-amount,.due-amount{font-size:10px;font-weight:800;white-space:nowrap}.due-date{font-size:9px;font-weight:800;color:var(--brand-2);line-height:1.1;text-align:center}.due-date.warning{background:var(--warning-tint);color:#9c6716}.due-date.overdue{background:var(--expense-tint);color:var(--expense)}
.luna-insight{background:linear-gradient(145deg,#0d332e,#12463e);color:#fff;border-radius:14px;padding:17px;position:relative;overflow:hidden}.luna-insight::after{content:"✦";position:absolute;right:15px;top:5px;font-size:55px;color:rgba(109,224,190,.1)}.luna-insight .luna-label{font-size:9px;color:#7fe5c7;font-weight:800;letter-spacing:.08em}.luna-insight h4{font:800 14px/1.4 "Manrope";margin:10px 0 7px;max-width:90%}.luna-insight p{font-size:10px;color:#b7d1ca;line-height:1.55;margin:0}.luna-insight button{border:0;background:#63ddb9;color:#0b2b27;height:32px;border-radius:9px;padding:0 12px;font-size:9px;font-weight:800;margin-top:14px}

/* cards page */
.credit-grid{display:grid;grid-template-columns:repeat(3,minmax(250px,1fr));gap:16px}.credit-card-web{min-height:205px;border-radius:19px;padding:20px;color:#fff;background:linear-gradient(145deg,#0b2b27,#15564a);box-shadow:0 16px 30px rgba(12,54,47,.18);position:relative;overflow:hidden}.credit-card-web:nth-child(3n+2){background:linear-gradient(145deg,#27364d,#476483)}.credit-card-web:nth-child(3n+3){background:linear-gradient(145deg,#5b4223,#9d7441)}.credit-card-web::after{content:"";position:absolute;width:170px;height:170px;border-radius:50%;background:rgba(255,255,255,.07);right:-60px;top:-70px}.card-web-top,.card-web-bottom{display:flex;align-items:flex-start;justify-content:space-between;position:relative;z-index:1}.card-chip{width:37px;height:27px;border-radius:7px;background:linear-gradient(135deg,#f1d27a,#b68a34)}.card-web-name{font:800 17px "Manrope";margin:28px 0 3px;position:relative;z-index:1}.card-web-owner{font-size:10px;opacity:.7;position:relative;z-index:1}.card-web-bottom{margin-top:25px;border-top:1px solid rgba(255,255,255,.16);padding-top:15px}.card-web-bottom div span{display:block;font-size:8px;text-transform:uppercase;letter-spacing:.06em;opacity:.67}.card-web-bottom div b{display:block;font-size:12px;margin-top:4px}.card-invoice{background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px;margin-top:12px;display:grid;grid-template-columns:1fr 1fr 1fr;gap:12px}.card-invoice div{padding-right:12px;border-right:1px solid var(--line-soft)}.card-invoice div:last-child{border:0}.card-invoice span{display:block;color:var(--muted);font-size:9px}.card-invoice b{display:block;font:800 13px "Manrope";margin-top:5px}

/* category / budget */
.category-list{display:grid;gap:12px}.category-row{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px}.category-icon{width:38px;height:38px;border-radius:11px;background:var(--surface-strong);display:grid;place-items:center}.category-meta{min-width:0}.category-title{display:flex;justify-content:space-between;gap:8px}.category-title b{font-size:10px}.category-title span{font-size:9px;color:var(--muted)}.category-progress{height:6px;background:var(--surface-strong);border-radius:20px;margin-top:8px;overflow:hidden}.category-progress i{height:100%;display:block;background:var(--brand);border-radius:20px}.category-progress i.warning{background:var(--warning)}.category-progress i.danger{background:var(--expense)}.category-balance{font-size:9px;font-weight:700;white-space:nowrap}

/* shopping */
.list-selector{display:flex;gap:8px;flex-wrap:wrap}.list-selector button{height:34px;border:1px solid var(--line);background:#fff;border-radius:10px;padding:0 12px;font-size:9px;color:var(--muted);font-weight:700}.list-selector button.active{background:var(--brand-deep);color:#fff;border-color:var(--brand-deep)}.shopping-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.shopping-stat{background:#fff;border:1px solid var(--line);border-radius:14px;padding:14px}.shopping-stat span{font-size:9px;color:var(--muted);display:block}.shopping-stat b{font:800 16px "Manrope";display:block;margin-top:7px}.shopping-check{width:20px;height:20px;border-radius:7px;border:1px solid var(--line);display:grid;place-items:center;color:transparent}.shopping-check.checked{background:var(--brand);border-color:var(--brand);color:#fff}.shopping-name.checked{text-decoration:line-through;color:var(--muted)}

/* settings */
.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.settings-card{padding:20px}.settings-card h3{font:800 14px "Manrope";margin:0 0 5px}.settings-card p{font-size:10px;color:var(--muted);line-height:1.6;margin:0 0 18px}.settings-info{display:grid;gap:10px}.settings-row{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line-soft);padding-bottom:10px;font-size:10px}.settings-row:last-child{border:0}.settings-row span{color:var(--muted)}.settings-row b{text-align:right;word-break:break-all}.security-note{padding:14px;border-radius:12px;background:var(--brand-tint);color:var(--brand-2);font-size:10px;line-height:1.55}.danger-note{background:var(--expense-tint);color:#a74438}

/* Luna panel/page */
.luna-panel{position:fixed;right:0;top:0;width:min(430px,100vw);height:100vh;background:#fff;z-index:80;box-shadow:-18px 0 50px rgba(11,43,39,.16);display:flex;flex-direction:column;transform:translateX(105%);transition:transform .25s ease}.luna-panel.open{transform:none}.panel-backdrop{position:fixed;inset:0;background:rgba(7,26,23,.35);z-index:70;opacity:0;visibility:hidden;transition:.2s}.panel-backdrop.show{opacity:1;visibility:visible}.luna-panel-head{height:73px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.luna-identity{display:flex;align-items:center;gap:11px}.luna-identity>span{width:36px;height:36px;border-radius:12px;background:var(--brand-deep);color:#6ae1bf;display:grid;place-items:center;font-size:18px}.luna-identity b,.luna-identity small{display:block}.luna-identity b{font:800 14px "Manrope"}.luna-identity small{font-size:9px;color:var(--muted);margin-top:3px}.luna-context-chip{margin:12px 16px 0;background:var(--surface-strong);color:var(--ink-2);border-radius:9px;padding:9px 11px;font-size:9px;font-weight:700}.luna-messages{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:11px}.luna-message{max-width:88%;border-radius:14px;padding:11px 13px;font-size:11px;line-height:1.58}.luna-message.user{align-self:flex-end;background:var(--brand-deep);color:#fff;border-bottom-right-radius:5px}.luna-message.assistant{align-self:flex-start;background:#f2f6f5;color:var(--ink-2);border-bottom-left-radius:5px}.luna-message.assistant strong{color:var(--ink)}.luna-message.assistant h1,.luna-message.assistant h2,.luna-message.assistant h3{font:800 13px "Manrope";margin:8px 0 5px}.luna-message.assistant ul,.luna-message.assistant ol{padding-left:18px;margin:6px 0}.luna-message.loading{color:var(--muted)}.luna-composer{display:flex;gap:9px;padding:13px 16px;border-top:1px solid var(--line)}.luna-composer textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:12px;padding:11px 12px;outline:none;font-size:11px;line-height:1.45}.luna-composer textarea:focus{border-color:#90d6c1;box-shadow:0 0 0 3px rgba(18,167,124,.08)}.luna-composer button{width:43px;border:0;border-radius:12px;background:var(--brand-deep);color:#67dfbd;font-size:17px}.luna-disclaimer{padding:0 16px 13px;color:var(--muted);font-size:8px;line-height:1.45}.luna-page-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:17px}.luna-page-chat{height:calc(100vh - 185px);min-height:570px;display:flex;flex-direction:column}.luna-page-chat .luna-messages{padding:20px}.suggestion-list{display:grid;gap:8px}.suggestion-button{border:1px solid var(--line);background:#fff;border-radius:11px;padding:12px;text-align:left;color:var(--ink-2);font-size:10px;line-height:1.4}.suggestion-button:hover{border-color:#9bd7c6;background:var(--brand-tint)}

/* responsive */
@media(max-width:1250px){.metric-grid{grid-template-columns:repeat(2,1fr)}.credit-grid{grid-template-columns:repeat(2,1fr)}.table-filters{grid-template-columns:repeat(3,1fr)}.search-control{grid-column:span 2}}
@media(max-width:1050px){.auth-view{grid-template-columns:1fr;background:#f4f8f6}.auth-preview{display:none}.auth-panel{width:min(540px,calc(100% - 45px))}.app-shell{grid-template-columns:var(--sidebar-collapsed) 1fr}.sidebar .brand>div:last-child,.sidebar-collapse,.nav-item>span:last-child,.readonly-card>div{display:none}.sidebar-head{justify-content:center;padding:0}.nav-item{justify-content:center;padding:0}.readonly-card{justify-content:center}.dashboard-grid,.dashboard-secondary{grid-template-columns:1fr}.luna-page-layout{grid-template-columns:1fr}.luna-page-layout>.panel:last-child{display:none}.settings-grid{grid-template-columns:1fr}}
@media(max-width:760px){.app-shell,.app-shell.sidebar-collapsed{display:block}.sidebar{position:fixed;left:0;transform:translateX(-105%);width:258px;transition:.22s;z-index:90}.app-shell.mobile-nav-open .sidebar{transform:none}.sidebar .brand>div:last-child,.sidebar .nav-item>span:last-child,.sidebar .readonly-card>div{display:block}.sidebar-head{justify-content:space-between;padding:0 20px}.sidebar-collapse{display:none}.nav-item{justify-content:flex-start;padding:0 12px}.readonly-card{justify-content:flex-start}.topbar{padding:0 15px}.mobile-menu-button{display:grid}.sync-state,.user-copy,.chevron{display:none}.user-button{padding-left:10px}.workspace-body{padding:18px 14px 35px}.metric-grid{grid-template-columns:1fr 1fr;gap:10px}.metric-card{padding:14px}.metric-value{font-size:17px}.page-intro{flex-direction:column}.page-actions{width:100%}.credit-grid{grid-template-columns:1fr}.shopping-stats{grid-template-columns:1fr 1fr}.table-filters{grid-template-columns:1fr 1fr}.search-control{grid-column:1/-1}.export-button{grid-column:1/-1}.topbar-left h1{font-size:18px}.luna-top-button{width:40px;padding:0;justify-content:center}.luna-top-button{font-size:0}.luna-top-button span{font-size:17px}}
@media(max-width:470px){.metric-grid{grid-template-columns:1fr}.shopping-stats{grid-template-columns:1fr}.auth-panel{width:calc(100% - 30px);padding:35px 0}.brand-auth{margin-bottom:45px}.auth-copy h1{font-size:37px;letter-spacing:-2px}.auth-highlights{margin-top:28px}.topbar-actions{gap:6px}.topbar .icon-button{width:36px}.user-button{border:0;margin:0}.table-filters{grid-template-columns:1fr}.filter-control{grid-column:1/-1}}
.toast-region{position:fixed;right:20px;bottom:20px;z-index:200;display:grid;gap:8px}.toast{background:#102f2a;color:#fff;border-radius:11px;padding:12px 15px;font-size:11px;box-shadow:0 14px 30px rgba(0,0,0,.17);opacity:0;transform:translateY(8px);transition:.22s;max-width:340px}.toast.show{opacity:1;transform:none}.toast.warning{background:#8c651f}.toast.success{background:#08765c}


/* v1.1 — Sidebar recolhível também em notebooks/tablets horizontais */
@media (min-width:761px) and (max-width:1050px){
  .app-shell{grid-template-columns:var(--sidebar-w) minmax(0,1fr)}
  .app-shell.sidebar-collapsed{grid-template-columns:var(--sidebar-collapsed) minmax(0,1fr)}
  .sidebar .brand>div:last-child{display:block}
  .sidebar-collapse{display:grid}
  .nav-item>span:last-child{display:inline}
  .readonly-card>div{display:block}
  .sidebar-head{justify-content:space-between;padding:0 20px}
  .nav-item{justify-content:flex-start;padding:0 12px}
  .readonly-card{justify-content:flex-start}
  .app-shell.sidebar-collapsed .sidebar .brand,
  .app-shell.sidebar-collapsed .nav-item>span:last-child,
  .app-shell.sidebar-collapsed .readonly-card>div{display:none}
  .app-shell.sidebar-collapsed .sidebar-head{justify-content:center;padding:0}
  .app-shell.sidebar-collapsed .nav-item{justify-content:center;padding:0}
  .app-shell.sidebar-collapsed .readonly-card{justify-content:center}
}


/* v1.3 — Escrita controlada da Lista compartilhada */
.tag.write-enabled{background:var(--brand-tint);color:var(--brand-2);border:1px solid #bce7da}
.primary-action-button,.secondary-action-button{height:36px;border-radius:10px;padding:0 13px;font-size:10px;font-weight:800;white-space:nowrap}
.primary-action-button{border:0;background:var(--brand-deep);color:#fff}
.secondary-action-button{border:1px solid var(--line);background:#fff;color:var(--ink-2)}
.primary-action-button:hover{background:#123b35}.secondary-action-button:hover{background:var(--surface-soft)}
.shopping-check{background:#fff;padding:0;cursor:pointer}.shopping-check:hover{border-color:var(--brand)}
.shopping-table td:last-child{white-space:nowrap}.row-actions{display:flex;gap:6px}.row-actions button{height:29px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:0 9px;font-size:9px;font-weight:700;color:var(--ink-2)}.row-actions button:hover{background:var(--surface-soft)}.row-actions button.danger{color:var(--expense);border-color:#f0c9c4}.row-actions button.danger:hover{background:var(--expense-tint)}
.flow-dialog{border:0;padding:0;background:transparent;max-width:none}.flow-dialog::backdrop{background:rgba(7,26,23,.45);backdrop-filter:blur(2px)}
.dialog-card{width:min(570px,calc(100vw - 30px));background:#fff;border:1px solid var(--line);border-radius:20px;padding:24px;box-shadow:0 28px 80px rgba(7,34,29,.24)}
.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}.dialog-head h2{font:800 21px "Manrope";letter-spacing:-.5px;margin:7px 0 0}.dialog-head p{font-size:10px;color:var(--muted);margin:5px 0 0}.dialog-close{width:36px;height:36px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--muted);font-size:20px;line-height:1}.dialog-close:hover{background:var(--surface-soft)}
.dialog-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.dialog-field{display:grid;gap:7px}.dialog-field-wide{grid-column:1/-1}.dialog-field>span{font-size:10px;font-weight:700;color:var(--ink-2)}.dialog-field input{height:43px;border:1px solid var(--line);border-radius:11px;padding:0 12px;color:var(--ink);outline:none}.dialog-field input:focus{border-color:#91d7c2;box-shadow:0 0 0 3px rgba(18,167,124,.08)}
.dialog-check{display:flex;align-items:center;gap:9px;font-size:11px;color:var(--ink-2);padding:4px 0}.dialog-check input{width:18px;height:18px;accent-color:var(--brand)}
.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:23px}.dialog-actions .primary-button,.dialog-actions .secondary-button{flex:0 0 auto;min-width:130px}
@media(max-width:760px){.page-actions{flex-wrap:wrap}.primary-action-button,.secondary-action-button{flex:1}.dialog-grid{grid-template-columns:1fr}.dialog-field-wide{grid-column:auto}.dialog-actions{flex-direction:column-reverse}.dialog-actions .primary-button,.dialog-actions .secondary-button{width:100%}}


/* v2.0 — operação bidirecional completa */
.entity-dialog-card{width:min(720px,calc(100vw - 30px));max-height:calc(100vh - 30px);overflow:auto}
.dialog-field select,.dialog-field textarea{width:100%;height:43px;border:1px solid var(--line);border-radius:11px;padding:0 12px;color:var(--ink);background:#fff;outline:none}
.dialog-field textarea{height:auto;min-height:90px;padding:11px 12px;resize:vertical}
.dialog-field select:focus,.dialog-field textarea:focus{border-color:#91d7c2;box-shadow:0 0 0 3px rgba(18,167,124,.08)}
.dialog-field input:disabled,.dialog-field select:disabled{background:#f2f5f4;color:#81908c;cursor:not-allowed}
.dialog-note{padding:12px 14px;border-radius:11px;background:var(--surface-strong);color:var(--muted);font-size:10px;line-height:1.55}
.dialog-summary{display:flex;justify-content:space-between;align-items:center;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.dialog-summary span{font-size:10px;color:var(--muted)}.dialog-summary b{font:800 17px "Manrope"}
.inline-reset-button,.inline-add-button,.danger-inline-button{height:35px;border-radius:9px;padding:0 12px;font-size:9px;font-weight:800}
.inline-reset-button,.inline-add-button{border:1px solid var(--line);background:#fff;color:var(--ink-2)}
.danger-inline-button{border:1px solid #efc6c1;background:#fff;color:var(--expense)}
.inline-reset-button:hover,.inline-add-button:hover{background:var(--surface-soft)}.danger-inline-button:hover{background:var(--expense-tint)}
.dialog-actions-inline{display:flex;justify-content:space-between;gap:10px;align-items:center}
.income-other-list{display:grid;gap:8px}.income-other-row{display:grid;grid-template-columns:minmax(0,1.5fr) 80px 130px 34px;gap:8px}.income-other-row input{width:100%;height:39px;border:1px solid var(--line);border-radius:9px;padding:0 10px}.income-other-row button{border:1px solid #efc6c1;background:#fff;color:var(--expense);border-radius:9px;font-size:18px}
.card-actions{display:flex;gap:7px;margin-top:8px}.card-actions button{flex:1;height:34px;border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink-2);font-size:9px;font-weight:800}.card-actions button:hover{background:var(--surface-soft)}.card-actions button.danger{color:var(--expense);border-color:#efc6c1}
.status-toggle{height:30px;border:1px solid #f0c6c1;border-radius:999px;background:var(--expense-tint);color:#a74438;padding:0 10px;display:inline-flex;align-items:center;gap:6px;font-size:9px;font-weight:800}.status-toggle i{width:7px;height:7px;border-radius:50%;background:var(--expense)}.status-toggle.done{background:var(--brand-tint);color:var(--brand-2);border-color:#bce7da}.status-toggle.done i{background:var(--brand)}
.panel-head-actions{display:flex;align-items:center;gap:10px}.mini-primary-button{height:31px;border:0;border-radius:9px;background:var(--brand-deep);color:#fff;padding:0 11px;font-size:9px;font-weight:800}.settings-action{margin-top:16px;width:100%}
.category-row{grid-template-columns:auto minmax(0,1fr) auto auto}.category-row .row-actions{justify-content:flex-end}
.table-filters{grid-template-columns:minmax(210px,1.5fr) repeat(4,minmax(130px,1fr));}
.table-filters .export-button{min-width:100px}
@media(max-width:900px){.income-other-row{grid-template-columns:1fr 70px 110px 34px}.dialog-actions-inline{flex-direction:column;align-items:stretch}.category-row{grid-template-columns:auto minmax(0,1fr)}.category-row .category-balance,.category-row .row-actions{grid-column:2}}
@media(max-width:600px){.income-other-row{grid-template-columns:1fr 1fr}.income-other-row [data-income-other-name]{grid-column:1/-1}.income-other-row button{height:39px}.panel-head-actions{align-items:flex-end;flex-direction:column}.card-actions{flex-wrap:wrap}.card-actions button{min-width:45%}}
