:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2036;
  background: #f6f7fb;
  --muted: #65697f;
  --primary: #5d48d9;
  --primary-hover: #4c37bf;
  --border: #e5e6ef;
  --nav: #17182e;
  --surface: #fff;
  --shadow: 0 3px 10px #25234407;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -.055em; line-height: 1.1; }
h2 { font-size: 1.3rem; letter-spacing: -.028em; line-height: 1.2; }
h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid #8875f2; outline-offset: 3px; }
.icon { flex-shrink: 0; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.symbol-bank { position: absolute; width: 0; height: 0; overflow: hidden; }
.muted { color: var(--muted); line-height: 1.55; }
.small { font-size: .85rem; }
.button, .text-button, .icon-button, .nav-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; min-height: 44px; font-weight: 650;
}
.button { padding: 10px 15px; text-decoration: none; }
.primary { background: var(--primary); color: white; box-shadow: 0 3px 8px #5d48d92b; }
.primary:hover { background: var(--primary-hover); }
.secondary { background: white; color: #37384e; border-color: #dcdde9; }
.secondary:hover, .icon-button:hover { background: #f0eefc; }
.danger { background: #fff1f0; color: #a1263a; }
.danger-solid { background: #a1263a; color: #fff; }
.text-button { background: transparent; padding: 0 5px; color: #5142ba; }
.text-button:hover { text-decoration: underline; }
.icon-button { width: 44px; padding: 0; background: transparent; color: var(--muted); }
.message { border: 1px solid #dbd6ff; background: #f1eeff; color: #3d3091; padding: 10px 13px; border-radius: 10px; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.message.error { border-color: #f0c7cd; background: #fff0f1; color: #902438; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.3rem; font-weight: 780; letter-spacing: -.035em; }
.brand-icon { display: grid; place-items: center; flex: 0 0 39px; height: 39px; border-radius: 12px; background: #6c55ef; color: #fff; }
.brand-icon .icon { width: 23px; height: 23px; }
.boot { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 24px; text-align: center; }

.login { min-height: 100svh; display: grid; grid-template-columns: minmax(390px, .9fr) minmax(0, 1.1fr); background: white; }
.login-content { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 48px; padding: 42px clamp(32px, 6vw, 96px); }
.login-form-wrap { width: min(100%, 410px); margin: auto; }
.login-form-wrap > p { margin-top: 13px; }
.login-form { display: grid; gap: 18px; margin-top: 30px; }
.login-form > .button { width: 100%; margin-top: 4px; }
.login-art { position: relative; isolation: isolate; overflow: hidden; display: grid; align-content: center; justify-items: center; gap: 60px; padding: 65px 32px; color: #fff; background: radial-gradient(ellipse at 60% 37%, #5140ad, transparent 62%), linear-gradient(145deg, #292151, #1b1738 77%); }
.login-art-copy { z-index: 1; text-align: center; }
.login-art-copy h2 { font-size: clamp(1.7rem, 3.4vw, 3rem); font-weight: 740; letter-spacing: -.045em; }
.login-art-copy p { margin: 15px auto 0; max-width: 350px; color: #dfd9fa; line-height: 1.6; }
.orbit { position: absolute; z-index: -1; left: 50%; top: 39%; width: var(--size); aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid #d3c5fd27; }
.orbit-one { --size: 360px; }.orbit-two { --size: 500px; }.orbit-three { --size: 660px; }
.illustration { position: relative; width: min(100%, 260px); height: 218px; }
.art-calendar { position: absolute; left: 16px; top: 12px; width: 212px; background: #eeebff; box-shadow: 0 19px 50px #16102d7d; border-radius: 23px; transform: rotate(-10deg); }
.art-calendar-top { display: flex; justify-content: space-between; align-items: center; padding: 0 27px; height: 48px; background: #8068f1; border-radius: 23px 23px 0 0; }
.art-calendar-top i { display: block; width: 9px; height: 20px; border-radius: 8px; background: #cfc3ff; }
.art-calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; padding: 19px 17px 23px; }
.art-calendar-grid i { aspect-ratio: 1; display: block; border-radius: 4px; background: #d8cff7; }
.art-calendar-grid i:nth-child(11) { background: #674de7; box-shadow: 0 0 0 3px #c5b6ff; }
.art-bell { position: absolute; bottom: 22px; right: 3px; width: 75px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 23px; background: #bdabff; color: #372572; box-shadow: 0 12px 20px #2016436b; transform: rotate(13deg); }
.art-bell .icon { width: 38px; height: 38px; }

.app { min-height: 100svh; display: grid; grid-template-columns: 234px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 38px; padding: 29px 19px 18px; background: var(--nav); color: #fff; }
.sidebar .brand { margin-left: 10px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-button { justify-content: flex-start; padding: 10px 12px; background: transparent; color: #c6c6db; width: 100%; text-align: left; }
.nav-button:hover, .nav-button.current { background: #322a5b; color: #fff; }
.nav-button.current .icon { color: #c0afff; }
.account { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 16px; border-top: 1px solid #ffffff20; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; color: #dacfff; background: #322a5b; font-size: .88rem; font-weight: 750; }
.account-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; color: #cfcee2; }
.logout { margin-left: auto; flex-shrink: 0; color: #ccc6e7; width: 40px; }
.logout:hover { background: #352b5b; }
.dashboard { width: min(100%, 1440px); margin-inline: auto; padding: 42px clamp(24px, 4vw, 62px) 55px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.page-header h1 + p { margin-top: 9px; }
.today-label { margin-bottom: 10px; color: #5545a7; font-size: .85rem; font-weight: 700; }
.dashboard > .message { margin-bottom: 18px; }
.overview { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 17px; margin-bottom: 30px; }
.next-card, .totals-card { min-height: 150px; border-radius: 18px; padding: 21px 22px; }
.next-card { display: flex; justify-content: space-between; align-items: center; gap: 14px; overflow: hidden; background: radial-gradient(ellipse at 100% 0, #6655b8, transparent 67%), #3d337e; color: #fff; }
.next-copy { min-width: 0; }
.next-copy > p { margin-bottom: 9px; color: #ede7ff; font-size: .9rem; }
.next-copy h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); overflow-wrap: anywhere; }
.next-detail { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: .95rem; }
.next-detail #next-amount { font-weight: 750; }
.mini-calendar { display: grid; flex: 0 0 70px; height: 70px; place-items: center; border: 1px solid #e4daff50; border-radius: 20px; color: #e8deff; background: #9680e84d; transform: rotate(8deg); }
.mini-calendar .icon { width: 38px; height: 38px; }
.totals-card, .payments { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.totals-heading { display: flex; align-items: center; gap: 11px; }
.totals-heading .muted { font-size: .82rem; margin-top: 4px; }
.square-icon { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border-radius: 12px; color: #5d48c7; background: #eeebff; }
.total-values { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px; margin-top: 15px; }
.total-value { max-width: 100%; overflow-wrap: anywhere; font-size: 1.15rem; font-weight: 750; }
.currency-code { color: var(--muted); font-size: .75rem; font-weight: 700; margin-left: 5px; }

.payments { border-radius: 18px; padding: 23px; }
.payments-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px; }
.payments-header p { margin-top: 4px; font-size: .89rem; }
.filters { display: flex; gap: 9px; flex-wrap: wrap; }
.filters input, .filters select { font-size: .9rem; }
.search-label { position: relative; display: block; flex: 1 1 155px; }
.search-label .icon { position: absolute; left: 11px; top: 11px; width: 18px; color: var(--muted); pointer-events: none; }
.search-label input { padding-left: 35px; width: 100%; }
#payment-list { margin-top: 18px; }
.payment-group + .payment-group { margin-top: 19px; }
.group-heading { padding: 9px 12px; border-radius: 7px; background: #f5f5fb; color: #5c5d75; font-size: .8rem; font-weight: 700; }
.payment-items { list-style: none; margin: 0; padding: 0; }
.payment-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(100px, .62fr) minmax(90px, .55fr) 44px; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid #eeeef5; }
.payment-row:last-child { border-bottom: 0; }
.payment-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.payment-text { min-width: 0; overflow-wrap: anywhere; }
.payment-text strong { display: block; font-size: .95rem; }
.payment-meta, .payment-date { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.payment-date time { color: #3e3f58; }
.payment-amount { text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.payment-empty { min-height: 260px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 20px 8px; background: #faf9fe; border: 1px dashed #e1dcf5; border-radius: 14px; }
.payment-empty .square-icon { width: 54px; height: 54px; }
.payment-empty .square-icon .icon { width: 26px; height: 26px; }
.payment-empty .button { margin-top: 4px; }

label { display: grid; gap: 6px; color: #36374d; font-size: .88rem; font-weight: 620; }
input, select, textarea { background: #fff; color: #23243b; min-width: 0; min-height: 43px; width: 100%; border: 1px solid #dcdde9; border-radius: 9px; padding: 9px 11px; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #74778d; }
dialog { width: min(550px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; border: 1px solid #deddec; border-radius: 18px; color: inherit; background: #fff; box-shadow: 0 16px 65px #0d092e50; }
dialog::backdrop { background: #17152f8c; }
.dialog-header, .dialog-footer { display: flex; align-items: center; gap: 9px; padding: 14px 19px; }
.dialog-header { justify-content: space-between; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 19px; }
.dialog-footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }
.spacer { flex: 1; }
.form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.wide { grid-column: 1 / -1; }
.optional { display: inline; font-size: .75rem; font-weight: 400; margin-top: -6px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.checkbox-label input { min-height: 0; width: 19px; height: 19px; margin: 0; accent-color: var(--primary); }
.settings-body form > .button, .settings-body .message, #delete-error { margin-top: 12px; }
.push-settings { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 18px; }
.push-settings h3, .push-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.push-settings p, .install-body > *, #install-instructions p + p { margin-top: 10px; }
.install-body p, #delete-description { line-height: 1.5; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .app { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .dashboard { padding-inline: 23px; }
  .next-card, .totals-card, .payments { padding: 17px; }
  .mini-calendar { flex-basis: 48px; height: 48px; border-radius: 13px; }
  .mini-calendar .icon { width: 29px; height: 29px; }
}
@media (max-width: 690px) {
  .login { display: flex; flex-direction: column; }
  .login-content { padding: 25px 24px 20px; gap: 31px; }
  .login-art { gap: 8px; padding: 10px 21px 28px; }
  .illustration { transform: scale(.66); margin: -32px 0; }
  .login-art-copy p { margin-top: 8px; font-size: .9rem; }
  .app { display: block; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; z-index: 2; top: auto; bottom: 0; left: 0; right: 0; display: flex; flex-direction: row; justify-content: space-between; gap: 0; height: auto; padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); }
  .sidebar .brand, .sidebar .avatar, .sidebar .account-email { display: none; }
  .sidebar nav { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .nav-button { flex-direction: column; justify-content: center; gap: 3px; padding: 4px; font-size: .72rem; min-height: 49px; }
  .account { margin: 0 0 0 6px; padding: 0; border: 0; }
  .logout { width: 44px; }
  .dashboard { padding: 24px 16px; }
  .page-header { flex-wrap: wrap; margin-bottom: 20px; }
  .overview { gap: 10px; margin-bottom: 18px; }
}
@media (max-width: 480px) {
  .overview { grid-template-columns: 1fr; }
  .next-card, .totals-card { min-height: 106px; }
  .total-values { margin-top: 11px; }
  .payments-header > div { width: 100%; }
  .filters { flex-wrap: nowrap; }
  .filters select { width: auto; max-width: 48%; }
  .payment-row { grid-template-columns: minmax(0, 1fr) minmax(62px, .67fr) 40px; gap: 4px 6px; }
  .payment-title { grid-column: 1; grid-row: 1; }
  .payment-title .square-icon { display: none; }
  .payment-date { grid-column: 1; grid-row: 2; }
  .payment-amount { grid-column: 2; grid-row: 1 / 3; }
  .payment-row .icon-button { grid-column: 3; grid-row: 1 / 3; width: 40px; }
}
