:root{--accent:#8055e8;--ink:#202039;--muted:#858592;--line:#efeff4;--bg:#f7f7f9;--card:#fff;--cyan:#88d9ec;--good:#487c85;--bad:#985e89;--shadow:0 12px 40px rgba(31,28,58,.025)}
*{box-sizing:border-box}body{margin:0;font-family:Inter,"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--ink);font-size:14px;-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit}button{cursor:pointer}button,a,input,select,textarea{outline-offset:4px}button:focus-visible,a:focus-visible{outline:2px solid var(--accent)}button{transition:background .18s,color .18s}svg{vertical-align:middle}.icon{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.shell{display:grid;grid-template-columns:94px minmax(0,1fr);min-height:100vh;padding:16px 16px 16px 0}.side{background:white;border-radius:0 16px 16px 0;position:sticky;top:16px;height:calc(100vh - 32px);display:flex;align-items:center;flex-direction:column;padding:24px 16px;z-index:5}.brand{display:flex;align-items:center;gap:10px;font-weight:650;font-size:19px;margin-bottom:30px}.brand .icon{width:31px;height:31px;color:var(--accent)}.side .brand{padding:7px;margin-bottom:32px}.side .brand-label,.nav-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.nav{display:flex;flex-direction:column;gap:17px;width:100%}.nav button,.signout{border:0;background:transparent;color:var(--ink);border-radius:10px;width:48px;height:48px;display:grid;place-items:center}.nav button:hover,.nav button.active{background:#f3efff;color:var(--accent)}.signout{margin-top:auto;color:var(--muted)}.signout:hover{background:var(--bg);color:var(--accent)}.main{width:100%;max-width:1660px;margin:0 auto;padding:12px 30px 26px;min-width:0}.header{height:52px;display:flex;justify-content:space-between;gap:24px;align-items:center;margin-bottom:35px}.search-wrap{position:relative;width:min(570px,70%)}.search-box{display:flex;align-items:center;gap:14px;background:white;padding:13px 17px;border-radius:9px;color:var(--accent)}.search-box input{border:0;outline:0;background:transparent;min-width:0;width:100%;font-size:12px;color:var(--ink)}input::placeholder{color:#a0a0ad}.search-results{position:absolute;top:52px;left:0;right:0;padding:8px;background:white;border:1px solid var(--line);box-shadow:0 15px 40px #20203912;z-index:10;border-radius:10px}.search-result{width:100%;background:white;text-align:left;border:0;padding:12px;border-radius:6px;display:block}.search-result:hover{background:#f5f2fc}.search-result small{display:block;color:var(--muted);margin-top:4px}.account{display:flex;align-items:center;gap:12px;font-size:12px}.avatar{width:36px;height:36px;display:grid;place-items:center;background:#eeebf7;color:var(--accent);border-radius:50%;font-size:12px;font-weight:600}.account small{display:block;color:var(--muted);margin-top:4px}.top{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:27px}.title h1{margin:0;font-size:28px;letter-spacing:-1px;font-weight:600}.title p{margin:8px 0 0;color:var(--muted);font-size:12px}.btn{display:inline-flex;justify-content:center;align-items:center;gap:9px;border:0;background:var(--accent);color:#fff;padding:12px 17px;border-radius:8px;font-size:12px;font-weight:500;white-space:nowrap}.btn:hover{background:#7044d7}.btn .icon{width:16px;height:16px}.btn.secondary{background:#fff;border:1px solid var(--line);color:var(--ink)}.btn.secondary:hover{background:#f6f3fc}.text-btn{border:0;background:transparent;color:var(--accent);font-size:11px;padding:5px 0;display:inline-flex;align-items:center;gap:6px}.text-btn .icon{width:14px;height:14px}.dashboard-grid{display:grid;grid-template-columns:.85fr 1.4fr 1.15fr;gap:20px}.card{background:#fff;border-radius:13px;padding:26px;box-shadow:var(--shadow);min-width:0}.card h2,.toolbar h2{font-size:13px;font-weight:550;margin:0}.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:26px}.card-head>.icon{color:#a4a1b0;width:15px}.balance-card,.aging-card,.activity-card{min-height:320px}.label{font-size:11px;color:var(--muted)}.balance-value{font-size:31px;font-weight:600;letter-spacing:-1px;margin:30px 0 10px;overflow-wrap:anywhere}.overdue-line{font-size:11px;color:var(--muted)}.overdue-line span{color:var(--accent);margin-right:5px}.balance-stats{display:flex;gap:30px;border-top:1px solid var(--line);margin-top:34px;padding-top:23px}.balance-stats strong{display:block;font-size:20px;font-weight:550;margin-top:7px}.balance-footer{display:flex;justify-content:space-between;align-items:center;margin-top:24px;font-size:10px;color:var(--muted)}.circles{width:39px;height:22px;position:relative}.circles:before,.circles:after{content:'';width:23px;height:23px;border-radius:50%;position:absolute;background:#e4ddfa}.circles:after{left:15px;background:#caeaf4b8}.aging-body{display:grid;grid-template-columns:115px minmax(0,1fr);align-items:center;gap:4px}.aging-stat{margin-bottom:19px}.aging-stat:last-child{margin-bottom:0}.aging-stat strong{display:block;font-size:14px;font-weight:500;margin-top:5px}.radar{width:100%;height:auto;overflow:visible}.chart-label{font-size:9px;fill:var(--muted)}.legend{display:flex;gap:17px;flex-wrap:wrap;font-size:10px;color:var(--muted);margin-top:22px}.legend span:before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);margin-right:6px}.legend span.cyan:before{background:var(--cyan)}.activity-chart{width:100%;height:200px}.activity-card .card-head{margin-bottom:12px}.chart-caption{font-size:10px;color:var(--muted);margin:15px 0 0}.dashboard-bottom{display:grid;grid-template-columns:1.05fr 1fr;gap:20px;margin-top:20px}.payment-card,.recent-card{min-height:358px}.payment-content{display:grid;grid-template-columns:.8fr 1.2fr;align-items:center;gap:10px}.payment-ring{position:relative;width:90px;height:90px;margin:7px 0 21px}.payment-ring svg{width:100%;height:100%;transform:rotate(-90deg)}.payment-ring strong{position:absolute;inset:0;display:grid;place-items:center;font-size:20px;font-weight:450}.payment-copy h3{font-size:21px;line-height:1.3;font-weight:500;letter-spacing:-.6px;margin:0 0 12px}.payment-copy p{font-size:10px;color:var(--muted);line-height:1.7;margin:0 0 16px}.payment-art{width:100%;max-height:255px;object-fit:contain}.recent-card table{font-size:11px}.recent-card th,.recent-card td{padding:16px 6px;font-size:11px}.recent-card th:last-child,.recent-card td:last-child{text-align:right}.recent-card .card-head{margin-bottom:16px}.section{margin-top:22px}.toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-bottom:18px}table{width:100%;border-collapse:collapse;background:#fff;text-align:left}th,td{padding:16px;border-bottom:1px solid var(--line);font-size:12px;white-space:nowrap}th{color:var(--muted);font-size:11px;font-weight:400}td b{font-weight:500}tr:last-child td{border-bottom:0}.table-scroll{overflow-x:auto}.status{display:inline-block;font-size:10px;padding:4px 8px;border-radius:5px;color:#83709e;background:#f5f1fb}.status.good{background:#edf8fa;color:var(--good)}.status.bad{background:#f6eff9;color:var(--bad)}.empty{padding:35px 14px;text-align:center;color:var(--muted);font-size:12px;line-height:1.8}.page-footer{margin-top:24px;display:flex;justify-content:space-between;gap:16px;color:#9999a4;font-size:10px}.connection:before{content:'';display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--cyan);margin-right:6px}.modal{position:fixed;inset:0;background:#20203955;backdrop-filter:blur(4px);display:none;align-items:center;justify-content:center;padding:20px;z-index:20}.modal.show{display:flex}.panel{background:#fff;border-radius:16px;width:min(680px,100%);max-height:90vh;overflow:auto;padding:30px;box-shadow:0 25px 100px #20203922}.panel h3{margin:0 0 25px;font-weight:550;font-size:20px}.formgrid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.field label{display:block;font-size:11px;color:var(--muted);margin-bottom:7px}.field input,.field select,.field textarea{width:100%;border:1px solid #e7e5ee;border-radius:7px;padding:11px;background:#fff;color:var(--ink);font-size:13px}.field input:focus,.field select:focus,.field textarea:focus{outline:1px solid var(--accent)}.field.full{grid-column:1/-1}.actions{display:flex;justify-content:flex-end;gap:9px;margin-top:24px}.toast{position:fixed;right:20px;bottom:20px;background:var(--ink);color:#fff;padding:14px 18px;border-radius:10px;display:none;max-width:min(380px,90vw);z-index:30;font-size:12px}.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}.loginbox{width:min(420px,100%);background:#fff;border-radius:18px;padding:36px;box-shadow:var(--shadow)}.loginbox h1{margin:0 0 8px;font-size:25px;font-weight:550}.loginbox p{color:var(--muted);margin:0 0 25px;font-size:12px}.hidden{display:none!important}
@media(min-width:1550px){.main{padding-top:24px}.dashboard-grid{gap:24px}.card{padding:32px}.balance-card,.aging-card,.activity-card{min-height:365px}.dashboard-bottom{gap:24px;margin-top:24px}.payment-card,.recent-card{min-height:390px}}
@media(max-width:1150px){.main{padding:12px 22px 22px}.dashboard-grid{grid-template-columns:.8fr 1.2fr}.activity-card{grid-column:1/-1;min-height:270px}.activity-chart{height:160px}.dashboard-bottom{grid-template-columns:1fr 1fr}.card{padding:22px}.payment-content{grid-template-columns:1fr}.payment-art{max-height:160px}.payment-copy{display:grid;grid-template-columns:90px 1fr;column-gap:18px}.payment-ring{grid-row:1/4}.payment-copy h3{font-size:18px}.payment-copy p{margin-bottom:4px}}
@media(max-width:720px){.shell{grid-template-columns:64px minmax(0,1fr);padding:0}.side{top:0;height:100dvh;border-radius:0;padding:22px 8px}.side .brand{padding:5px;margin-bottom:24px}.nav{gap:12px}.nav button,.signout{width:46px;height:46px}.main{padding:18px 16px}.header{margin-bottom:25px;gap:10px}.search-wrap{width:100%}.search-box{padding:12px}.search-box input{font-size:11px}.account>div:last-child{display:none}.account{gap:0}.avatar{width:30px;height:30px}.title h1{font-size:24px}.title p{line-height:1.6;font-size:11px}.top{align-items:flex-start;gap:12px;flex-wrap:wrap}.dashboard-grid,.dashboard-bottom{grid-template-columns:1fr;gap:16px}.activity-card{grid-column:auto}.balance-card,.aging-card{min-height:285px}.dashboard-bottom{margin-top:16px}.balance-value{margin-top:20px}.balance-stats{margin-top:24px}.payment-content{grid-template-columns:1fr}.payment-copy{display:block}.payment-art{max-height:210px}.payment-content{grid-template-columns:.9fr 1.1fr}.payment-copy h3{font-size:18px}.recent-card{min-height:280px}.card{padding:22px 18px}.formgrid{grid-template-columns:1fr}.field.full{grid-column:auto}.panel{padding:22px}.page-footer{flex-wrap:wrap}.aging-body{grid-template-columns:100px minmax(0,1fr)}}
.radar{max-height:260px}.aging-stat{margin-bottom:13px}.aging-stat strong{line-height:1.3}.recent-card th,.recent-card td{padding-top:14px;padding-bottom:14px}.search-box input{font-size:12px}.chart-label{font-size:10px}
@media(max-width:720px){.aging-body{display:flex;flex-direction:column-reverse;gap:20px}.radar{width:220px;max-width:100%;height:220px}.aging-body>div{display:grid;grid-template-columns:1fr 1fr;gap:14px;width:100%}.aging-stat{margin:0}.payment-content{display:flex;flex-direction:column-reverse;gap:16px;align-items:stretch}.payment-art{height:180px;max-height:180px}.payment-copy{display:grid;grid-template-columns:90px 1fr;gap:0 14px}.payment-ring{grid-row:1/4}.payment-copy .text-btn{text-align:left}.recent-card td,.recent-card th{font-size:11px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.btn.compact{padding:8px 10px;font-size:11px}.inline-select,.compact-select{border:1px solid #e7e5ee;border-radius:7px;background:#fff;color:var(--ink);font-size:12px;padding:8px;min-width:150px}.compact-select{min-width:220px}.admin-only.hidden{display:none!important}.payment-admin-only.hidden{display:none!important}
@media(max-width:720px){.compact-select{min-width:0;width:100%}.toolbar{align-items:flex-start;flex-wrap:wrap}.btn.compact{padding:8px 9px}}
.link-btn{border:0;background:transparent;color:var(--accent);padding:0;font-size:12px;text-align:left;white-space:normal}.link-btn:hover{text-decoration:underline}.invoice-link{font-weight:600;color:var(--ink)}.filter-chip{display:inline-flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:9px 12px;margin:-6px 0 16px;color:var(--muted);font-size:12px}.filter-chip span{color:var(--ink);font-weight:500}.wide-panel{width:min(980px,100%)}.modal-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.modal-title-row h3{margin-bottom:0}.readonly-note{background:#f7f4fc;border:1px solid var(--line);border-radius:8px;padding:11px 12px;margin-bottom:16px;color:var(--muted);font-size:12px}.line-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 12px}.line-toolbar h4{font-size:12px;font-weight:550;margin:0}.line-items{display:grid;gap:10px}.line-row{display:grid;grid-template-columns:minmax(220px,1.9fr) minmax(86px,.7fr) minmax(105px,.8fr) minmax(86px,.7fr) minmax(92px,.7fr) auto;gap:10px;align-items:end;border:1px solid var(--line);border-radius:8px;padding:12px;background:#fff}.line-row .field input:disabled,.formgrid .field input:disabled,.formgrid .field select:disabled{background:#fafafa;color:#777783}.line-total{padding-bottom:10px}.line-total span,.detail-summary span{display:block;color:var(--muted);font-size:10px;margin-bottom:5px}.line-total strong,.detail-summary strong{font-size:12px;font-weight:550}.line-remove{align-self:end;margin-bottom:1px}.detail-summary{display:grid;grid-template-columns:repeat(5,minmax(95px,1fr));gap:10px;margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}.detail-summary div{background:#fafafd;border-radius:8px;padding:12px}.detail-summary div:last-child{background:#f3efff;color:var(--accent)}
.invoice-controls{display:grid;grid-template-columns:minmax(260px,1fr) minmax(180px,240px) auto;gap:12px;align-items:end;margin:-4px 0 16px}.invoice-controls .field input,.invoice-controls .field select{height:39px;padding:9px 11px;font-size:12px}.invoice-controls .label{padding-bottom:11px;text-align:right;white-space:nowrap}
.line-row.quote-line{grid-template-columns:minmax(200px,1.8fr) minmax(70px,.55fr) minmax(95px,.7fr) minmax(70px,.5fr) minmax(70px,.55fr) minmax(88px,.7fr) auto}
.detail-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;margin-top:16px}.detail-fields div{background:#fafafd;border-radius:8px;padding:12px;min-width:0}.detail-fields span{display:block;color:var(--muted);font-size:10px;margin-bottom:5px}.detail-fields strong{font-size:12px;font-weight:550;word-break:break-word;white-space:pre-line}.client-id{color:var(--muted);font-variant-numeric:tabular-nums}
@media(max-width:900px){.line-row,.line-row.quote-line{grid-template-columns:1fr 1fr}.line-desc{grid-column:1/-1}.line-total,.line-remove{align-self:center}.detail-summary{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.invoice-controls{grid-template-columns:1fr}.invoice-controls .label{text-align:left;padding-bottom:0}.invoice-status{max-width:none}}
@media(max-width:520px){.line-row,.detail-summary{grid-template-columns:1fr}.modal-title-row{align-items:flex-start;flex-direction:column}.actions{flex-wrap:wrap}.actions .btn{width:100%}}
.detail-payments{margin-top:18px}.compact-table th,.compact-table td{padding:11px 10px}.compact-table th:last-child,.compact-table td:last-child{text-align:right}.compact-empty{padding:18px 12px}
.settings-card{max-width:860px}.settings-card h2{margin-bottom:18px}.settings-grid{margin-top:12px}.toggle-row{display:flex;align-items:center;gap:10px;align-self:end;min-height:39px;color:var(--ink);font-size:12px}.toggle-row input{width:16px;height:16px;accent-color:var(--accent)}
.settings-card{margin-bottom:20px}.settings-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:6px}.settings-head h2{margin:0}.settings-hint{margin:0 0 6px;line-height:1.7;max-width:64ch}.settings-result{margin-top:14px;border-radius:8px;padding:11px 12px;font-size:12px;line-height:1.6;border:1px solid var(--line);background:#f7f4fc;color:var(--ink);overflow-wrap:anywhere}.settings-result.ok{background:#edf8fa;border-color:#d7eef2;color:var(--good)}.settings-result.bad{background:#f9eff6;border-color:#f0dfeb;color:var(--bad)}.btn[aria-busy="true"]{opacity:.6;pointer-events:none}
.pay-links{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.pay-links a{text-decoration:none}
.send-block{margin-top:18px;padding:14px 16px;background:#faf9fd;border:1px solid var(--line);border-radius:9px}.send-block .toggle-row{min-height:auto}.send-block .label{margin-top:7px;line-height:1.6}
.pay-qr-row{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:14px}.pay-qr{margin:0;text-align:center}.pay-qr img{display:block;width:132px;height:132px;border:1px solid var(--line);border-radius:9px;image-rendering:pixelated}.pay-qr figcaption{font-size:10px;color:var(--muted);margin-top:6px}.pay-qr-row p{margin:0;flex:1 1 220px;line-height:1.7}
.report-controls{margin-bottom:20px}.report-controls .formgrid{grid-template-columns:repeat(4,minmax(0,1fr))}.report-presets{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}.report-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:20px}.report-card{display:flex;flex-direction:column;min-height:186px}.report-card h3{margin:0 0 10px;font-size:14px;font-weight:600}.report-card p{margin:0;line-height:1.7;flex:1}.report-card .actions{margin-top:18px;justify-content:flex-start}#reportResult{margin-top:22px}.report-result-head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:16px;flex-wrap:wrap}.report-result-head h3{margin:0;font-size:14px;font-weight:600}td.num,th.num{text-align:right;white-space:nowrap}td.wrap{white-space:normal;max-width:320px;word-break:break-word}tr.total-row td{background:#faf9fd;border-top:1.5px solid var(--accent);border-bottom:0}
@media(max-width:1150px){.report-controls .formgrid{grid-template-columns:1fr 1fr}}
@media(max-width:720px){.report-controls .formgrid{grid-template-columns:1fr}.report-grid{grid-template-columns:1fr}}

/* Full-width action button. Was a style="" attribute on the sign-in button; moved here
   so the Content-Security-Policy can forbid inline styles. */
.btn-block {
  width: 100%;
  margin-top: 16px;
}

/* ---------------------------------------------------------------- sidebar
   The menu shows its labels by default. Someone new should be able to read the
   navigation rather than decode nine icons; collapsing to icons stays available for
   people who know the app and want the width back. */
.shell{grid-template-columns:232px minmax(0,1fr)}
.side{align-items:stretch;padding:20px 14px}
.side .brand-label,.nav-label{position:static;width:auto;height:auto;overflow:visible;clip-path:none;white-space:nowrap}
.side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:26px}
.side .brand{margin:0;padding:4px;font-size:16px;min-width:0;overflow:hidden}
.side .brand .icon{width:26px;height:26px}
.side-toggle{border:0;background:transparent;color:var(--muted);border-radius:8px;width:30px;height:30px;display:grid;place-items:center;flex-shrink:0}
.side-toggle:hover{background:#f3efff;color:var(--accent)}
.nav{gap:4px}
.nav button{width:100%;height:42px;display:flex;align-items:center;gap:12px;padding:0 12px;justify-content:flex-start;font-size:13px;text-align:left}
.nav-caret{margin-left:auto;transition:transform .18s}
.nav-group{display:flex;flex-direction:column}
.nav-sub{display:none;flex-direction:column;gap:2px;margin:2px 0 4px 34px;padding-left:10px;border-left:1px solid var(--line)}
.nav-group.open .nav-sub{display:flex}
.nav-group.open .nav-caret{transform:rotate(180deg)}
.nav-sub button{height:34px;font-size:12px;color:var(--muted);padding:0 10px}
.nav-sub button:hover,.nav-sub button.active{background:#f3efff;color:var(--accent)}
.signout{width:100%;height:42px;display:flex;align-items:center;gap:12px;padding:0 12px;justify-content:flex-start;font-size:13px}
.signout+.signout{margin-top:0}

/* Collapsed: icons only, labels hidden, submenu suppressed. */
.side-collapsed .shell,.shell.side-collapsed{grid-template-columns:94px minmax(0,1fr)}
.side-collapsed .side{padding:24px 16px}
.side-collapsed .brand-label,.side-collapsed .nav-label,.side-collapsed .nav-caret{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.side-collapsed .side-head{justify-content:center;flex-direction:column;gap:10px}
.side-collapsed .nav button,.side-collapsed .signout{width:48px;height:48px;justify-content:center;padding:0;gap:0;margin-inline:auto}
.side-collapsed .nav{gap:14px}
.side-collapsed .nav-sub{display:none}

/* Schedules table: a second line of context under the main value. */
#schedulesTable td small.label{display:block;margin-top:4px;font-size:10px}
#schedulesTable td .btn.compact{margin-right:6px}
.num{text-align:right}

@media(max-width:720px){
  .shell{grid-template-columns:64px minmax(0,1fr)}
  .side .brand-label,.nav-label,.nav-caret{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
  .side-head{flex-direction:column;gap:8px;justify-content:center}
  .nav button,.signout{width:46px;height:46px;justify-content:center;padding:0;gap:0;margin-inline:auto}
  .nav-sub{display:none!important}
}

/* ================================================================ sign in
   Split panel: the form on the left, an animated billing scene on the right.
   Colours are the app's own (--accent purple, --cyan) so signing in feels like
   arriving somewhere you already know, rather than a separate product.

   Strict CSP here: no inline styles and no inline handlers, so every state is a
   class and every animation is CSS. */

.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 600px at 12% -10%, #efe9ff 0%, transparent 60%),
    radial-gradient(900px 520px at 105% 110%, #e2f5fb 0%, transparent 55%),
    var(--bg);
}

.login-shell {
  width: min(1120px, 100%);
  min-height: min(680px, 88vh);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  background: var(--card);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(31, 28, 58, .16), 0 2px 6px rgba(31, 28, 58, .04);
  animation: login-rise .7s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes login-rise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- left */

.login-form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 46px 26px;
  background: linear-gradient(168deg, #ffffff 0%, #fbfaff 52%, #f4f0ff 100%);
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  align-self: flex-start;
  padding: 9px 16px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
  animation: login-fade .6s .05s both;
}
.login-logo .icon { width: 19px; height: 19px; color: var(--accent); }

.login-form {
  margin: auto 0;
  padding: 34px 0;
  display: flex;
  flex-direction: column;
}
.login-form h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.9px;
  animation: login-fade .6s .12s both;
}
.login-sub {
  margin: 9px 0 30px;
  font-size: 13px;
  color: var(--muted);
  animation: login-fade .6s .18s both;
}

/* Fields reveal in sequence rather than all at once - one orchestrated entrance
   reads as considered; three simultaneous ones read as a page that just appeared. */
[data-reveal] { animation: login-fade .55s both; }
[data-reveal="1"] { animation-delay: .24s; }
[data-reveal="2"] { animation-delay: .32s; }
[data-reveal="3"] { animation-delay: .40s; }

@keyframes login-fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.login-field { position: relative; margin-bottom: 16px; }

.login-field input {
  width: 100%;
  height: 58px;
  padding: 22px 46px 8px 15px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-field input:hover { border-color: #ded8f4; }
.login-field input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(128, 85, 232, .13);
}

/* The label lives inside the box and lifts out of the way on focus or content. */
.login-field label {
  position: absolute;
  left: 16px;
  top: 19px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform .18s cubic-bezier(.2, .8, .25, 1), color .18s;
}
.login-field input:focus + label,
.login-field input:not(:placeholder-shown) + label {
  transform: translateY(-11px) scale(.78);
}
.login-field input:focus + label { color: var(--accent); }

.login-field-icon,
.login-peek {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #b9b6c6;
  transition: color .18s;
}
.login-field-icon .icon, .login-peek .icon { width: 18px; height: 18px; }
.login-peek { border: 0; background: transparent; padding: 4px; border-radius: 7px; }
.login-peek:hover { color: var(--accent); }
.login-field input:focus ~ .login-field-icon { color: var(--accent); }
.login-peek[aria-pressed="true"] { color: var(--accent); }

/* Failure is shown in place, next to the thing that failed, and the panel flinches
   once. A toast in the corner is easy to miss when you are looking at the password. */
.login-error {
  margin: 0 0 14px;
  min-height: 17px;
  font-size: 12px;
  color: var(--bad);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .2s, transform .2s;
}
.login-error.show { opacity: 1; transform: none; }

.login-shell.shake { animation: login-shake .5s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes login-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

.login-submit {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 550;
  letter-spacing: .1px;
  background: linear-gradient(135deg, var(--accent) 0%, #6a43d6 100%);
  box-shadow: 0 10px 26px rgba(128, 85, 232, .3);
  transition: transform .18s, box-shadow .18s, filter .18s;
}
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(128, 85, 232, .38); }
.login-submit:active { transform: translateY(0); }

.login-submit.busy { pointer-events: none; filter: saturate(.85); }
.login-submit.busy .login-submit-label { opacity: 0; }
.login-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 19px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
}
.login-submit.busy .login-spinner { opacity: 1; animation: login-spin .7s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }

.login-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  color: var(--muted);
  animation: login-fade .6s .5s both;
}
.login-dot { width: 3px; height: 3px; border-radius: 50%; background: #cfcbdb; }

/* ---------------------------------------------------------------- right */

.login-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #8055e8 0%, #6d46d4 42%, #4a8fb5 100%);
}
.login-visual-inner { position: absolute; inset: 0; }

/* Two slow-drifting orbs give the panel depth and keep it from reading as a flat
   block of colour. They move far enough to notice only if you look. */
.login-orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; }
.login-orb-a {
  width: 340px; height: 340px; top: -90px; right: -60px;
  background: var(--cyan);
  animation: login-drift-a 17s ease-in-out infinite;
}
.login-orb-b {
  width: 300px; height: 300px; bottom: -80px; left: -70px;
  background: #b79bff;
  animation: login-drift-b 21s ease-in-out infinite;
}
@keyframes login-drift-a {
  50% { transform: translate(-42px, 54px) scale(1.12); }
}
@keyframes login-drift-b {
  50% { transform: translate(48px, -40px) scale(1.08); }
}

/* The artwork is line art on a solid white background. `multiply` drops the white to
   nothing over the panel and keeps the strokes, which is the only blend mode that
   works for this kind of asset - `luminosity` left a visible white rectangle.
   Wrapped in a positioned container so the float animation does not fight the
   centring transform. */
.login-art-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84%;
  max-width: 460px;
  transform: translate(-50%, -50%);
  /* The blend lives here, not on the img: the wrapper's own transform creates a
     stacking context, so a child blending inside it composites against the wrapper
     rather than against the purple panel, and the white background survives. */
  mix-blend-mode: multiply;
  opacity: .9;
  /* Opacity only. login-fade finishes on `transform: none`, which would cancel the
     centring translate above and drop the artwork into the corner. */
  animation: art-in 1s .3s both;
}
@keyframes art-in { from { opacity: 0; } to { opacity: .9; } }

.login-art {
  display: block;
  width: 100%;
  height: auto;
  animation: login-hover 9s 1.2s ease-in-out infinite;
}
@keyframes login-hover { 50% { transform: translateY(-13px); } }

/* Floating cards. Each drifts on its own cycle so they never move in lockstep. */
.float-card {
  position: absolute;
  background: rgba(255, 255, 255, .96);
  border-radius: 14px;
  padding: 13px 15px;
  box-shadow: 0 18px 44px rgba(18, 14, 40, .26);
  backdrop-filter: blur(6px);
  animation: login-fade .6s both, float-bob 7s ease-in-out infinite;
}
.float-card-invoice { top: 7%;  left: 5%;  width: 196px; animation-delay: .55s, .9s; }
.float-card-revenue { bottom: 8%; left: 6%; width: 172px; animation-delay: .7s, 1.9s; }
.float-card-ping {
  top: 26%; right: 5%; width: 214px;
  display: flex; align-items: center; gap: 11px;
  animation-delay: .85s, 2.8s;
}
@keyframes float-bob { 50% { transform: translateY(-11px); } }

.float-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.float-tag { font-size: 10.5px; color: var(--muted); letter-spacing: .2px; }
.float-pill { font-size: 10px; padding: 3px 8px; border-radius: 6px; font-weight: 550; }
.float-pill-paid { background: #e7f6f2; color: var(--good); }
.float-amount { font-size: 19px; font-weight: 600; letter-spacing: -.5px; margin-top: 7px; }
.float-meta { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.float-strong { font-size: 12.5px; font-weight: 550; }

/* Bars grow from nothing on entry, then hold - a chart that redraws forever is a
   distraction on a page you are trying to leave. */
.float-bars { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-top: 9px; }
.float-bars i {
  flex: 1;
  background: linear-gradient(180deg, var(--accent) 0%, #b9a2f2 100%);
  border-radius: 3px 3px 1px 1px;
  transform-origin: bottom;
  animation: bar-grow .75s cubic-bezier(.2, .8, .25, 1) both;
}
.float-bars .b1 { height: 42%; animation-delay: 1.0s; }
.float-bars .b2 { height: 64%; animation-delay: 1.07s; }
.float-bars .b3 { height: 38%; animation-delay: 1.14s; }
.float-bars .b4 { height: 82%; animation-delay: 1.21s; }
.float-bars .b5 { height: 56%; animation-delay: 1.28s; }
.float-bars .b6 { height: 96%; animation-delay: 1.35s; }
@keyframes bar-grow { from { transform: scaleY(0); opacity: .4; } }

.float-ping { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex-shrink: 0; }
.float-ping::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--good);
  animation: ping 2.4s ease-out infinite;
}
@keyframes ping {
  0%   { transform: scale(.55); opacity: .85; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .login { padding: 0; }
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border-radius: 0;
  }
  /* The visual panel is atmosphere, not information. On a phone the keyboard takes
     half the screen, so it goes rather than squashing the form. */
  .login-visual { display: none; }
  .login-form-side { padding: 26px 22px 22px; }
  .login-form h1 { font-size: 26px; }
}

/* Someone who has asked for less motion gets the layout and none of the movement. */
@media (prefers-reduced-motion: reduce) {
  .login-shell, .login-logo, .login-form h1, .login-sub, [data-reveal],
  .login-art, .float-card, .float-bars i, .login-foot {
    animation: none !important;
  }
  .login-orb, .float-ping::after, .login-shell.shake { animation: none !important; }
  .login-art-wrap { animation: none !important; opacity: .9; }
  .login-submit.busy .login-spinner { animation: login-spin 1.1s linear infinite; }
}
