/* Finoice web app — shared design tokens and components (preview).
   Same world as the homepage and the iOS app: cream paper, periwinkle and gold silk,
   navy actions, Manrope. One file for every page, so a change here changes them all. */

:root {
  --white: #ffffff;
  --cream: #fcf6f0;
  --paper: #fffaf5;
  --peach-1: #f8ece2;
  --silk-blue: #7d9dd6;
  --silk-blue-deep: #3a5a99;
  --silk-blue-soft: #dbe5f6;
  --gold: #f1bf72;
  --gold-soft: #f8e2bf;
  --ink: #14161c;
  --ink-2: #3a3d46;
  --muted: #66625b;
  --line: #ece6de;
  --line-2: #e0d8cd;
  --navy: #1e2a4a;
  --navy-hover: #131c35;
  --emerald: #1f7a57;  --emerald-bg: #e3f2ea;
  --ochre: #a04a0c;    --ochre-bg: #fbeadb;
  --plum: #6b4380;     --plum-bg: #f1e8f5;
  --red: #b3261e;      --red-bg: #fbe6e4;
  --focus: #3b6aa5;

  --sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: 30px; --fs-title: 20px; --fs-body: 15px; --fs-small: 13px; --fs-label: 12px; --fs-figure: 28px;
  --fw-title: 500; --fw-strong: 600; --fw-display: 400;
  --r-xs: 8px; --r-s: 12px; --r-m: 18px; --r-l: 24px;
  --e1: 0 1px 2px rgba(20, 22, 28, .05), 0 6px 18px rgba(20, 22, 28, .05);
  --e2: 0 1px 2px rgba(20, 22, 28, .06), 0 18px 44px rgba(20, 22, 28, .1);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--cream); color: var(--ink); font: var(--fs-body)/1.55 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Silk behind frosted paper — the same backdrop as the homepage, still (no drifting inside the app) */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; left: -20vw; width: 140vw; height: 46vh; border-radius: 50%; filter: blur(60px); }
.backdrop i:nth-child(1) { top: -12vh; background: linear-gradient(100deg, rgba(241, 191, 114, 0), rgba(241, 191, 114, .7) 55%, rgba(241, 191, 114, 0)); transform: rotate(-6deg); }
.backdrop i:nth-child(2) { top: 18vh; background: linear-gradient(100deg, rgba(125, 157, 214, 0), rgba(125, 157, 214, .55) 60%, rgba(125, 157, 214, 0)); transform: rotate(-4deg); }
.backdrop::after { content: ""; position: absolute; inset: 0; background: rgba(252, 246, 240, .3); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: var(--fs-small); font-weight: var(--fw-strong); cursor: pointer; transition: background .2s, border-color .2s, transform .2s var(--ease); white-space: nowrap; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-hover); }
.btn-ghost { background: var(--white); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-block { width: 100%; min-height: 46px; font-size: var(--fs-body); }
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-small); font-weight: var(--fw-strong); color: var(--ink-2); }
.input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--white); color: var(--ink); font: inherit; transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: #746e66; }
.input:focus { outline: none; border-color: var(--silk-blue-deep); box-shadow: 0 0 0 3px var(--silk-blue-soft); }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.p-paid { background: var(--emerald-bg); color: var(--emerald); }
.p-overdue { background: var(--red-bg); color: var(--red); }
.p-sent { background: var(--silk-blue-soft); color: var(--silk-blue-deep); }
.p-draft { background: var(--line); color: var(--muted); }
.p-bas { background: var(--plum-bg); color: var(--plum); }
.p-due { background: var(--ochre-bg); color: var(--ochre); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.lang { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.lang button, .lang span { padding: 3px 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.lang .on, .lang button[aria-pressed="true"] { background: var(--navy); color: var(--white); }

/* ===== Login ===== */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-story { position: relative; display: flex; flex-direction: column; padding: 40px 56px; overflow: hidden; }
.login-story .brand { align-self: flex-start; }
.login-pitch { margin: auto 0; padding: 40px 0; }
.login-story h1 { max-width: 13em; margin: 0; font-size: clamp(34px, 3.6vw, 52px); font-weight: var(--fw-display); line-height: 1.06; letter-spacing: -.04em; }
.login-story p { max-width: 30em; margin: 18px 0 0; color: var(--ink-2); font-size: 17px; }
.login-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; }
.login-facts li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .7); color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-strong); }
.login-facts svg.i { width: 16px; height: 16px; color: var(--silk-blue-deep); }
.login-pane { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(420px, 100%); padding: 36px 32px 28px; border: 1px solid var(--line); border-radius: var(--r-l); background: rgba(255, 255, 255, .86); box-shadow: var(--e2); }
.login-card .top { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.login-card h2 { margin: 0; font-size: 26px; font-weight: var(--fw-title); letter-spacing: -.03em; }
.login-card .sub { margin: 6px 0 24px; color: var(--muted); }
.login-form { display: grid; gap: 16px; }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw button { position: absolute; right: 6px; top: 6px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.pw button:hover { background: var(--cream); color: var(--ink); }
.pw .eye-off, .pw button[aria-pressed="true"] .eye { display: none; }
.pw button[aria-pressed="true"] .eye-off { display: block; }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--red-bg); }
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-s); background: var(--red-bg); color: var(--red); font-size: var(--fs-small); line-height: 1.45; }
.alert[hidden] { display: none; }
.alert svg.i { margin-top: 1px; }
.alert .link { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.btn:disabled { cursor: progress; opacity: .85; }
.btn .spin { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: var(--white); border-radius: 50%; animation: spin .8s linear infinite; }
.btn.is-loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn .spin { animation-duration: 2.4s; } }
.row-between { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-small); }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--navy); }
.link { color: var(--silk-blue-deep); font-weight: var(--fw-strong); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.login-foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); text-align: center; }
.login-legal { margin: 12px 0 0; color: var(--muted); font-size: var(--fs-label); text-align: center; }
.login-legal a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ===== App shell ===== */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; border-right: 1px solid var(--line); background: rgba(255, 250, 245, .72); }
.side .brand { padding: 2px 10px 8px; }
.company { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--white); cursor: pointer; }
.company b { display: block; font-size: var(--fs-small); font-weight: var(--fw-strong); }
.company small { color: var(--muted); font-size: var(--fs-label); }
.company .av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: var(--white); font-size: var(--fs-small); font-weight: 700; }
.company svg.i { margin-left: auto; color: var(--muted); }
.nav-group { display: grid; gap: 2px; }
.nav-group > small { padding: 0 10px 6px; color: var(--muted); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-size: var(--fs-small); font-weight: var(--fw-title); }
.nav-group a:hover { background: rgba(30, 42, 74, .05); color: var(--ink); }
.nav-group a.on { background: var(--white); color: var(--ink); box-shadow: var(--e1); font-weight: var(--fw-strong); }
.nav-group a .n { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--red-bg); color: var(--red); font-size: 11px; font-weight: 700; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.side-foot a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-small); }

.main { min-width: 0; padding: 26px 36px 56px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.search { position: relative; flex: 1; max-width: 420px; }
.search .input { height: 40px; padding-left: 40px; border-radius: 999px; background: rgba(255, 255, 255, .8); }
.search svg.i { position: absolute; left: 14px; top: 11px; color: var(--muted); }
.search kbd { position: absolute; right: 12px; top: 10px; padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--muted); font: 11px var(--sans); }
.topbar .spacer { flex: 1; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--white); color: var(--ink-2); cursor: pointer; }

.greet { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; }
.greet h1 { margin: 0; font-size: var(--fs-display); font-weight: var(--fw-display); letter-spacing: -.035em; line-height: 1.15; }
.greet p { margin: 6px 0 0; color: var(--muted); }
.greet .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel { border: 1px solid var(--line); border-radius: var(--r-m); background: rgba(255, 255, 255, .88); box-shadow: var(--e1); }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 22px 0; }
.panel-h h2 { margin: 0; font-size: var(--fs-title); font-weight: var(--fw-title); letter-spacing: -.02em; }
.panel-h .link { font-size: var(--fs-small); }

/* Money summary: one panel, hairline-divided figures (not separate cards) */
.money { display: grid; grid-template-columns: repeat(4, 1fr); }
.money > div { padding: 20px 22px; border-left: 1px solid var(--line); }
.money > div:first-child { border-left: 0; }
.money small { display: block; color: var(--muted); font-size: var(--fs-small); }
.money b { display: block; margin: 6px 0 8px; font-size: var(--fs-figure); font-weight: var(--fw-strong); letter-spacing: -.03em; }
.money .meta { font-size: var(--fs-label); color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin-top: 20px; }
.grid-2 > * { min-width: 0; }

.todo { margin: 0; padding: 8px 10px 12px; list-style: none; }
.todo li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-s); }
.todo li:hover { background: var(--paper); }
.todo .ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; }
.todo .ic.red { background: var(--red-bg); color: var(--red); }
.todo .ic.ochre { background: var(--ochre-bg); color: var(--ochre); }
.todo .ic.plum { background: var(--plum-bg); color: var(--plum); }
.todo b { display: block; font-size: var(--fs-body); font-weight: var(--fw-strong); }
.todo span { color: var(--muted); font-size: var(--fs-small); }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); margin-bottom: 8px; }
.table th { padding: 14px 22px 10px; color: var(--muted); font-size: var(--fs-label); font-weight: var(--fw-strong); text-align: left; border-bottom: 1px solid var(--line); }
.table td { padding: 13px 22px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--paper); }
.table .num { text-align: right; font-weight: var(--fw-strong); }
.table td b { font-weight: var(--fw-strong); }
.table td small { display: block; color: var(--muted); }

.bas-mini { padding: 6px 22px 20px; }
.bas-mini .r { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-small); }
.bas-mini .code { display: grid; place-items: center; height: 22px; border-radius: 6px; background: var(--silk-blue-soft); color: var(--silk-blue-deep); font-size: 11px; font-weight: 700; }
.bas-mini .tot { display: flex; justify-content: space-between; padding-top: 12px; font-weight: var(--fw-strong); }
.bas-mini .tot b { color: var(--red); }
.bas-mini .due { margin-top: 14px; padding: 10px 12px; border-radius: var(--r-s); background: var(--plum-bg); color: var(--plum); font-size: var(--fs-small); font-weight: var(--fw-strong); }

.chart { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 14px; height: 150px; padding: 18px 22px 6px; }
.chart div { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; height: 100%; }
.chart i { display: block; border-radius: 6px 6px 3px 3px; }
.chart .paid { background: var(--silk-blue); }
.chart .owed { background: var(--gold); }
.chart-x { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; padding: 0 22px 18px; color: var(--muted); font-size: var(--fs-label); text-align: center; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: var(--fs-label); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend span::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--silk-blue); }
.legend span.owed::before { background: var(--gold); }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .money { grid-template-columns: repeat(2, 1fr); }
  .money > div:nth-child(3) { border-left: 0; }
  .money > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* The app pages are for computers and tablets. Phones use the iOS app, so there is no phone layout for them. */
.shell { min-width: 960px; }
/* The login page still works on a phone, for someone who taps "Log in" on the homepage. */
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-story { padding: 28px 24px 8px; gap: 28px; }
  .login-card { padding: 28px 20px 22px; }
}

/* ===== Interaction layer (preview) ===== */

/* Odometer figures: each digit rolls to its value on a column of 0-9 */
.odo { display: inline-flex; align-items: baseline; }
.odo-d { display: inline-block; height: 1.15em; overflow: hidden; vertical-align: bottom; }
.odo-col { display: block; transition: transform .9s cubic-bezier(.22, 1, .36, 1); }
.odo-col span { display: block; height: 1.15em; line-height: 1.15em; text-align: center; }

/* Skeleton while data loads, replacing a "Loading data..." line */
.is-loading [data-skel] { position: relative; color: transparent !important; border-color: transparent !important; background: linear-gradient(90deg, #efe8df 25%, #f8f3ed 50%, #efe8df 75%) 0 0 / 200% 100% !important; border-radius: 8px; animation: shimmer 1.3s linear infinite; }
.is-loading [data-skel] * { visibility: hidden; }
.is-loading [data-skel]::before { display: none; }
@keyframes shimmer { to { background-position: -200% 0; } }
.chart i { transition: height .7s cubic-bezier(.22, 1, .36, 1); }
.is-loading .chart i { height: 4% !important; background: #ece5dc; }

/* Chart hover: one tooltip per month */
.chart div { position: relative; cursor: default; border-radius: 6px; }
.chart div:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.chart div:hover i, .chart div:focus-visible i { filter: brightness(.94); }
.tip { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 2; min-width: 132px; padding: 8px 10px; border-radius: 10px; background: var(--navy); color: var(--white); font-size: var(--fs-label); line-height: 1.5; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.tip b { display: block; margin-bottom: 2px; font-size: var(--fs-small); }
.tip span { display: flex; justify-content: space-between; gap: 14px; }
.tip::after { content: ""; position: absolute; left: 50%; top: 100%; border: 6px solid transparent; border-top-color: var(--navy); transform: translateX(-50%); }
.chart div:hover .tip, .chart div:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }

/* Status change: the pill eases to its new colour, a small PAID stamp lands */
.pill { transition: background-color .45s, color .45s; }
.row-act { opacity: 0; transition: opacity .15s; }
tr:hover .row-act, tr:focus-within .row-act { opacity: 1; }
.btn-xs { min-height: 28px; padding: 0 10px; font-size: var(--fs-label); }
.stamp-mini { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 2px double #c0352b; border-radius: 5px; color: #c0352b; font-size: 10px; font-weight: 800; letter-spacing: .12em; transform: rotate(-10deg) scale(1.8); opacity: 0; transition: transform .45s cubic-bezier(.3, 1.6, .5, 1), opacity .2s; }
.stamp-mini.on { transform: rotate(-10deg) scale(1); opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--navy); color: var(--white); font-size: var(--fs-small); box-shadow: var(--e2); transform: translate(-50%, 16px); opacity: 0; transition: transform .3s cubic-bezier(.22, 1, .36, 1), opacity .3s; pointer-events: none; }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* Command palette (Cmd/Ctrl + K) */
.cmdk { position: fixed; inset: 0; z-index: 70; display: grid; justify-items: center; align-items: start; padding-top: 14vh; background: rgba(30, 42, 74, .18); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cmdk[hidden] { display: none; }
.cmdk-box { width: min(620px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--paper); box-shadow: 0 30px 80px rgba(20, 22, 28, .22); animation: pop .22s cubic-bezier(.22, 1, .36, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in svg.i { color: var(--muted); }
.cmdk-in input { flex: 1; border: 0; background: none; color: var(--ink); font: inherit; font-size: 17px; outline: none; }
.cmdk-in kbd, .cmdk-foot kbd { padding: 1px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--white); color: var(--muted); font: 11px var(--sans); }
.cmdk-list { max-height: 360px; margin: 0; padding: 8px; overflow: auto; list-style: none; }
.cmdk-list .g { padding: 10px 10px 4px; color: var(--muted); font-size: var(--fs-label); font-weight: var(--fw-strong); }
.cmdk-list .it { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-s); color: var(--ink-2); cursor: pointer; }
.cmdk-list .it small { margin-left: auto; color: var(--muted); }
.cmdk-list .it[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: var(--e1); }
.cmdk-empty { padding: 28px; color: var(--muted); text-align: center; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-label); }

/* Preview-only helper */
.demo { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; gap: 8px; padding: 8px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: var(--e2); }

@media (prefers-reduced-motion: reduce) {
  .odo-col, .chart i, .stamp-mini, .toast { transition: none; }
  .cmdk-box { animation: none; }
  .is-loading [data-skel] { animation-duration: 4s; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tip em { font-style: normal; font-weight: 700; }
.is-loading tr[data-skel] { background: none !important; animation: none; }
.is-loading tr[data-skel] td { position: relative; color: transparent; }
.is-loading tr[data-skel] td::after { content: ""; position: absolute; left: 22px; right: 22px; top: 12px; bottom: 12px; border-radius: 6px; background: linear-gradient(90deg, #efe8df 25%, #f8f3ed 50%, #efe8df 75%) 0 0 / 200% 100%; animation: shimmer 1.3s linear infinite; }
.is-loading tr[data-skel] td * { visibility: hidden; }
.is-loading .todo li[data-skel] { margin: 6px 0; }
.table th, .table td { padding-left: 16px; padding-right: 16px; white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.grid-2.wide { grid-template-columns: 2fr 1fr; }

/* ===== v2: components chosen from the reference search ===== */

/* Buttons: layered navy primary, lifted white secondary, press and click ripple */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary { background: linear-gradient(180deg, #2b3b66 0%, var(--navy) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(20, 22, 28, .2), 0 6px 16px rgba(30, 42, 74, .22); }
.btn-primary:hover { background: linear-gradient(180deg, #32447a 0%, #1b2644 100%); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 4px rgba(20, 22, 28, .2), 0 10px 22px rgba(30, 42, 74, .28); }
.btn-ghost { box-shadow: 0 1px 2px rgba(20, 22, 28, .06); }
.btn-ghost:hover { transform: translateY(-1px); border-color: var(--line-2); box-shadow: 0 2px 4px rgba(20, 22, 28, .06), 0 8px 18px rgba(20, 22, 28, .08); }
.btn:active { transform: translateY(0) scale(.985); }
.ripple { position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .35); transform: scale(0); animation: ripple .6s ease-out forwards; pointer-events: none; }
.btn-ghost .ripple { background: rgba(30, 42, 74, .12); }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* Login: full-screen drifting silk with one frosted-glass card */
.backdrop.live i { animation: silk-a 38s ease-in-out infinite alternate; }
.backdrop.live i:nth-child(2) { animation: silk-b 46s ease-in-out infinite alternate; }
.backdrop.live i:nth-child(3) { top: 52vh; background: linear-gradient(100deg, rgba(125, 157, 214, 0), rgba(125, 157, 214, .4) 45%, rgba(241, 191, 114, .35) 75%, rgba(241, 191, 114, 0)); animation: silk-a 52s ease-in-out infinite alternate-reverse; }
.backdrop.live::after { background: rgba(252, 246, 240, .12); }
@keyframes silk-a { from { transform: translate(-5vw, -2vh) rotate(-7deg); } to { transform: translate(6vw, 5vh) rotate(-2deg); } }
@keyframes silk-b { from { transform: translate(6vw, 3vh) rotate(-2deg) scaleY(1.1); } to { transform: translate(-6vw, -4vh) rotate(-8deg) scaleY(.9); } }
.auth { display: grid; grid-template-rows: auto 1fr auto; min-height: 100vh; }
.auth-top { display: flex; justify-content: space-between; align-items: center; padding: 26px 32px; }
.auth-mid { display: grid; place-items: center; padding: 12px 20px 28px; }
.glass { width: min(440px, 100%); padding: 38px 36px 28px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 30px; background: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .42)); -webkit-backdrop-filter: blur(26px) saturate(1.35); backdrop-filter: blur(26px) saturate(1.35); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(20, 22, 28, .05), 0 30px 70px rgba(58, 90, 153, .18); }
.glass .mark-lg { display: block; width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 14px; box-shadow: 0 8px 20px rgba(30, 42, 74, .22); }
.glass h1 { margin: 0; font-size: 28px; font-weight: var(--fw-title); letter-spacing: -.03em; text-align: center; }
.glass .sub { margin: 6px 0 26px; color: var(--ink-2); text-align: center; }
.auth-foot { padding: 0 20px 26px; color: var(--ink-2); font-size: var(--fs-label); text-align: center; }
.auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Floating-label fields */
.ff { position: relative; }
.ff .input { height: 54px; padding: 20px 14px 4px; border-color: rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .72); box-shadow: inset 0 0 0 1px var(--line-2); }
.ff .input::placeholder { color: transparent; }
.ff label { position: absolute; left: 15px; top: 17px; color: var(--muted); font-size: var(--fs-body); pointer-events: none; transform-origin: 0 0; transition: transform .2s var(--ease), color .2s; }
.ff .input:focus + label, .ff .input:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.78); color: var(--silk-blue-deep); }
.ff .input:focus { box-shadow: inset 0 0 0 1px var(--silk-blue-deep), 0 0 0 4px rgba(125, 157, 214, .28); background: var(--white); }
.ff .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--red); }
.ff.pw .input { padding-right: 46px; }
.ff.pw button { top: 11px; }
/* (entrance animation removed: fields must never start invisible) */

/* Collapsible sidebar */
.shell { transition: grid-template-columns .3s var(--ease); }
.shell.is-collapsed { grid-template-columns: 76px 1fr; }
.is-collapsed .side { align-items: center; padding-inline: 10px; }
.is-collapsed .side .brand { padding: 2px 0 8px; font-size: 0; gap: 0; }
.is-collapsed .company { padding: 6px; border-color: transparent; background: none; }
.is-collapsed .company > div, .is-collapsed .company svg.i, .is-collapsed .nav-group > small, .is-collapsed .nav-group .n, .is-collapsed .side-foot .lang { display: none; }
.is-collapsed .nav-group { justify-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.is-collapsed .nav-group:first-of-type { border-top: 0; padding-top: 0; }
.is-collapsed .nav-group a { width: 44px; height: 40px; padding: 0; justify-content: center; gap: 0; font-size: 0; position: relative; }
.is-collapsed .side-foot { padding: 0; } .is-collapsed .side-foot a { font-size: 0; gap: 0; }
.is-collapsed .nav-group a::after { content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; z-index: 5; padding: 5px 9px; border-radius: 8px; background: var(--navy); color: var(--white); font-size: var(--fs-label); font-weight: var(--fw-strong); white-space: nowrap; opacity: 0; transform: translate(-4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
.is-collapsed .nav-group a:hover::after, .is-collapsed .nav-group a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
.side { overflow: visible; z-index: 3; }

/* Tabs with a sliding indicator */
.tabs { position: relative; display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); }
.tabs button { position: relative; z-index: 1; padding: 5px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: var(--fs-label); font-weight: var(--fw-strong); cursor: pointer; transition: color .2s; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button small { margin-left: 4px; color: var(--muted); font-weight: 500; }
.tabs .ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 999px; background: var(--white); box-shadow: 0 1px 2px rgba(20, 22, 28, .1); transition: transform .3s var(--ease), width .3s var(--ease); }

/* Data table: sortable header, row hover, empty state */
.table th button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.table th button:hover { color: var(--ink); }
.table th button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .5; transition: transform .2s, opacity .2s; }
.table th[aria-sort="ascending"] button svg { opacity: 1; transform: rotate(180deg); }
.table th[aria-sort="descending"] button svg { opacity: 1; }
.table tbody tr { transition: opacity .2s; }
.table tr[hidden] { display: none; }
.table .empty td { padding: 30px 22px; color: var(--muted); text-align: center; white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  .backdrop.live i, .glass .login-form > *, .ripple { animation: none; }
  .btn:hover { transform: none; }
  .shell, .tabs .ind { transition: none; }
}
.table tbody tr:has(+ .empty[hidden]) td { border-bottom: 0; }

/* ===== Login card: three modes (log in, create account, reset password) ===== */
.login-card [hidden] { display: none !important; }
.alert.ok { background: var(--emerald-bg); color: var(--emerald); }
.alert.ok .link { color: var(--emerald); }
.strength { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.strength i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--red); transition: width .3s var(--ease), background-color .3s; }
.reqs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--fs-label); }
.reqs li { display: flex; align-items: center; gap: 6px; transition: color .2s; }
.reqs li::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--line-2); border-radius: 50%; transition: background-color .2s, border-color .2s; }
.reqs li.met { color: var(--emerald); }
.reqs li.met::before { border-color: var(--emerald); background: var(--emerald) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3.5 7.2l2.3 2.3 4.7-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 14px no-repeat; }
.pw-help { display: grid; gap: 10px; }
.btn-primary:disabled { cursor: not-allowed; opacity: .5; box-shadow: none; }
.btn-primary:disabled:hover { transform: none; background: linear-gradient(180deg, #2b3b66 0%, var(--navy) 100%); }
.btn-primary.is-loading:disabled { cursor: progress; opacity: .85; }
.back { display: inline-flex; align-items: center; gap: 6px; }
.login-legal { text-wrap: balance; }
.login-card h2:has(+ .sub[hidden]) { margin-bottom: 24px; }
.login-legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }

/* Login: rotating feature lines under the headline */
.feat-loop { margin-top: 26px; max-width: 30em; }
.feat-stack { display: grid; }
.feat-item { grid-area: 1 / 1; display: grid; gap: 6px; align-content: start; opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); pointer-events: none; }
.feat-item.is-on { opacity: 1; transform: none; pointer-events: auto; }
.feat-item b { font-size: 22px; font-weight: var(--fw-title); letter-spacing: -.02em; color: var(--ink); }
.feat-item span { color: var(--ink-2); font-size: 17px; line-height: 1.5; }
.feat-dots { display: flex; gap: 4px; margin-top: 18px; }
.feat-dots button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.feat-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--line-2); transition: width .3s var(--ease), background-color .3s; }
.feat-dots button:hover::before { background: var(--silk-blue); }
.feat-dots button[aria-current="true"]::before { width: 24px; background: var(--navy); }
@media (prefers-reduced-motion: reduce) { .feat-item { transition: none; transform: none; } }
/* Login: headline and the four features share one rotating slot, all at headline size */
.login-pitch.feat-loop { margin-top: auto; max-width: none; }
.login-story .feat-item { gap: 16px; align-content: center; }
.login-story .feat-item h1, .login-story .feat-item .big { max-width: 13em; margin: 0; color: var(--ink); font-size: clamp(34px, 3.6vw, 52px); font-weight: var(--fw-display); line-height: 1.06; letter-spacing: -.04em; text-wrap: balance; }
.login-story .feat-item span { max-width: 30em; }

/* ===== Login: flowing gold and blue silk behind an Apple-style glass card ===== */
.silkbg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: linear-gradient(160deg, #fdf8f2 0%, var(--cream) 45%, #f6e9dc 100%); }
.silkbg svg { position: absolute; inset: -6%; width: 112%; height: 112%; }
.rb { transform-box: fill-box; transform-origin: 50% 50%; will-change: transform; }
.rb-1 { animation: flow-1 19s ease-in-out infinite alternate; }
.rb-2 { animation: flow-2 23s ease-in-out infinite alternate; }
.rb-3 { animation: flow-3 27s ease-in-out infinite alternate; }
@keyframes flow-1 { 0% { transform: translate(-3%, -4%) rotate(-3deg) scaleY(1.12); } 50% { transform: translate(2%, 3%) rotate(1.5deg) scaleY(.9); } 100% { transform: translate(4%, -2%) rotate(-1deg) scaleY(1.06); } }
@keyframes flow-2 { 0% { transform: translate(3%, 4%) rotate(2.5deg) scaleY(.9); } 50% { transform: translate(-2%, -3%) rotate(-2deg) scaleY(1.14); } 100% { transform: translate(-4%, 2%) rotate(1deg) scaleY(.96); } }
@keyframes flow-3 { 0% { transform: translate(-2%, 2%) rotate(-1.5deg); } 100% { transform: translate(3%, -5%) rotate(2deg) scaleY(1.1); } }

.login-card.glassy { border: 1px solid rgba(255, 255, 255, .7); border-radius: 30px; background: linear-gradient(160deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, .34)); -webkit-backdrop-filter: blur(30px) saturate(1.6); backdrop-filter: blur(30px) saturate(1.6); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35), 0 1px 2px rgba(20, 22, 28, .05), 0 30px 70px rgba(58, 90, 153, .2); }
.glassy .sub, .glassy .login-foot, .glassy .login-legal { color: var(--ink-2); }
.glassy .login-foot { border-top-color: rgba(255, 255, 255, .7); }
.glassy .input { border-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .62); box-shadow: inset 0 0 0 1px rgba(30, 42, 74, .12); }
.glassy .input:focus { background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px var(--silk-blue-deep), 0 0 0 4px rgba(125, 157, 214, .3); }
.glassy .input[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--red); }
.glassy .input::placeholder { color: #5f5a53; }
.glassy .strength { background: rgba(30, 42, 74, .12); }
.glassy .reqs { color: var(--ink-2); }
/* Left text sits on the silk: keep it crisp */
.login-story .brand, .login-story .feat-item h1, .login-story .feat-item .big { text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
@media (prefers-reduced-motion: reduce) { .rb { animation: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .login-card.glassy { background: rgba(255, 255, 255, .88); } }
.login-story .feat-item span { color: var(--ink); }
/* Left copy sits level with the card heading instead of the vertical centre */
@media (min-width: 861px) {
  .login-story .login-pitch.feat-loop { position: absolute; left: 56px; right: 56px; top: 30vh; margin: 0; padding: 0; }
  .login-story .feat-item { align-content: start; }
}
/* Login headlines stay on one line on desktop */
@media (min-width: 861px) {
  .login-story .feat-item h1, .login-story .feat-item .big { max-width: none; font-size: clamp(28px, 3.3vw, 52px); white-space: nowrap; }
}

/* Login on wide screens: the brand, the copy and the card stay together in a centred band instead of drifting to the two edges.
   The silk background still fills the whole window. */
@media (min-width: 1240px) {
  .login { max-width: 1180px; margin-inline: auto; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .login-story { padding-left: 32px; padding-right: 24px; }
  .login-pane { justify-items: end; padding-right: 32px; }
}
@media (min-width: 1240px) { .login-story { padding-left: 56px; padding-right: 24px; } }
/* Centred login band: room for the longest rotating headline on one line */
@media (min-width: 1240px) {
  .login { max-width: 1280px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .login-story .feat-item h1, .login-story .feat-item .big { font-size: 44px; max-width: none; }
}
/* Login, wide screens (19 Nov, second pass): copy sits further left; the brand joins the copy, level with the card's top edge */
@media (min-width: 1240px) {
  .login { max-width: 1320px; }
  .login-story { padding-left: 0; }
  .login-story .login-pitch.feat-loop { left: 0; }
  .login-story .brand { position: absolute; left: 0; top: 0; }
}
@media (min-width: 1240px) and (max-width: 1400px) { .login-story { padding-left: 40px; } .login-story .login-pitch.feat-loop, .login-story .brand { left: 40px; } }

/* Wide screens: the copy and brand sit a little further left of the centred column (up to 60px, never closer than 40px to the window edge) */
@media (min-width: 1401px) { .login-story { margin-left: calc(-1 * min(60px, (100vw - 1400px) / 2)); } }
