/* Ledra Finance. Dashboard for a finance product, separate from the Thirdcore site and its tokens. */
:root {
  /* Brand */
  --forest: #0f3b2c;
  --forest-2: #17503c;
  --lime: #93e35b;
  --lime-soft: #c9f0ab;
  --mint: #e3f2df;
  --sage: #cfe8d2;
  /* Surfaces and text. Panels are white on paper with no outline. */
  --paper: #f1f4ef;
  --white: #fff;
  --ink: #10211a;
  --soft: #5d6e65;
  --faint: #8c9a92;
  --line: #e7ece5;
  --hover: #f1f4ef;
  /* Data */
  --in: #1e7a4b;
  --up: #1e7a4b;
  --down: #b3402e;
  --warn: #9a6a00;
  --bar-off: #e9ede7;
  /* Layout */
  --side: 216px;
  --gap: 12px;
  --pad: clamp(10px, 1vw, 16px);
  --max: 1520px;
  --r: 14px;
  --r-sm: 8px;
  --lift: 0 1px 2px rgb(16 33 26 / .05), 0 4px 14px rgb(16 33 26 / .06);
  /* Motion, from the Animation Guidelines */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 420ms;
  accent-color: var(--forest);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
* { scrollbar-width: thin; scrollbar-color: #cdd6ca transparent; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 13.5px/1.45 "General Sans", "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: clamp(1.4rem, 1.8vw, 1.7rem); font-weight: 600; }
h2 { font-size: .95rem; letter-spacing: -.005em; }
svg { display: block; }
svg:not([viewBox]) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--in); outline-offset: 2px; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--forest); color: #fff; border-radius: var(--r-sm); }
.skip:focus { top: 12px; }

/* Shared keyframes (guidelines 1, 3, 8, 10, 17) */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.95); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.95); } }
@keyframes confirm { 50% { transform: scale(1.06); } }
@keyframes fresh { from { background-color: var(--mint); } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Controls: filled, not outlined. Press to 0.97 (guideline 4); hover in 200ms, out 160ms (guideline 15). */
.btn, .icon-btn, .seg button, .seg label, .tile__go, .dd__btn, .tabs button, .hero__go, .balance__actions span, .nav a, .link, th button {
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
:is(.btn, .icon-btn, .seg button, .seg label, .tile__go, .dd__btn, .tabs button, .nav a, th button):hover { transition-duration: 200ms, 200ms, 200ms, var(--dur-micro); }
:is(.btn, .icon-btn, .seg button, .seg label, .tile__go, .dd__btn, .tabs button, .nav a, th button):active { transform: scale(.97); }
.is-done { animation: confirm 260ms var(--ease-out); }

.btn { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: var(--r-sm); background: var(--white); font-weight: 500; white-space: nowrap; box-shadow: 0 1px 2px rgb(16 33 26 / .06); }
.btn:hover { background: #fafbf9; box-shadow: 0 1px 2px rgb(16 33 26 / .06), 0 2px 8px rgb(16 33 26 / .06); }
.btn--dark { background: var(--forest); color: var(--white); }
.btn--dark:hover { background: var(--forest-2); }
.btn svg { width: 15px; height: 15px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgb(16 33 26 / .06); }
.icon-btn--flat { width: 30px; height: 30px; border-radius: var(--r-sm); background: transparent; box-shadow: none; color: var(--soft); }
.icon-btn--flat:hover { background: var(--hover); color: var(--ink); }
.icon-btn--flat svg { width: 16px; height: 16px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 2px var(--white); }
.link { display: inline-flex; align-items: center; gap: 2px; padding: 6px 0; color: var(--in); font-weight: 500; font-size: 13px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.link svg { width: 14px; height: 14px; }
.tag { padding: 3px 9px; border-radius: 20px; background: var(--hover); color: var(--soft); font-size: 12px; font-weight: 500; white-space: nowrap; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-sm); background: var(--hover); }
.seg button, .seg label { min-height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 6px; color: var(--soft); font-weight: 500; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.seg [aria-pressed="true"], .seg label:has(:checked) { background: var(--white); color: var(--ink); box-shadow: 0 1px 2px rgb(16 33 26 / .1); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(:focus-visible) { outline: 2px solid var(--in); }

/* Dropdowns (custom; the native select stays hidden in the form). 180ms in from the trigger, 150ms out. */
.dd { position: relative; display: inline-block; }
.field .dd { display: block; }
.dd__native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dd__btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 150px; min-height: 34px; padding: 0 10px 0 12px; border-radius: var(--r-sm); background: var(--white); box-shadow: 0 1px 2px rgb(16 33 26 / .06); font-weight: 500; text-align: left; }
.dd__btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd__btn svg { width: 15px; height: 15px; color: var(--soft); transition: rotate var(--dur-short) var(--ease-in-out); }
.dd__btn[aria-expanded="true"] svg { rotate: 180deg; }
.filters .dd__btn { background: var(--hover); box-shadow: none; }
.filters .dd__btn:hover { background: #e9eee6; }
.field .dd__btn { width: 100%; min-height: 40px; background: var(--hover); box-shadow: none; font-weight: 400; font-size: 14px; color: var(--ink); }
.dd__menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; display: none; min-width: 100%; max-height: 264px; overflow-y: auto; padding: 4px; border-radius: 10px; background: var(--white); box-shadow: 0 12px 32px rgb(16 33 26 / .16), 0 0 0 1px rgb(16 33 26 / .05); transform-origin: top left; outline: none; }
.dd.is-up .dd__menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.dd.is-open .dd__menu { display: block; animation: pop-in 180ms var(--ease-out) both; }
.dd.is-closing .dd__menu { animation: pop-out 150ms var(--ease-out) both; }
.dd__menu li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 9px 7px 10px; border-radius: 6px; color: var(--ink); font-size: 13.5px; font-weight: 400; white-space: nowrap; cursor: pointer; }
.dd__menu li.is-active { background: var(--hover); }
.dd__menu li[aria-selected="true"] { font-weight: 500; }
.dd__menu li svg { width: 14px; height: 14px; color: var(--in); stroke-width: 2.2; opacity: 0; }
.dd__menu li[aria-selected="true"] svg { opacity: 1; }

/* Status chips: text only, colour plus wording (no icons) */
.status { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.status--cleared, .status--ok { background: var(--mint); color: var(--up); }
.status--pending, .status--watch { background: #f7efd6; color: var(--warn); }
.status--over { background: #f8e6e1; color: var(--down); }

/* Shell */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 16px 12px; background: var(--white); border-right: 1px solid var(--line); overflow-y: auto; }
.side__logo { display: block; padding: 2px 20px 16px; margin: 0 -12px 14px; border-bottom: 1px solid var(--line); color: var(--forest); }
.side__logo svg { height: 24px; width: auto; }
.nav { position: relative; display: grid; gap: 2px; }
.nav__ink { position: absolute; top: 0; left: 0; right: 0; z-index: 0; border-radius: var(--r-sm); background: var(--white); box-shadow: var(--lift); pointer-events: none; transition: transform 280ms var(--ease-in-out), height 280ms var(--ease-in-out); }
.nav__ink::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--forest); }
.nav__ink.is-instant { transition: none; }
.nav__label { padding: 0 8px 6px; color: var(--faint); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--soft); font-weight: 500; }
.nav a svg { width: 17px; height: 17px; }
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a[aria-current] { color: var(--ink); background: transparent; }
.nav a[aria-current] svg { color: var(--in); }
.nav a svg { stroke-width: 1.8; }
.nav .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 20px; background: var(--lime); color: var(--forest); font-size: 11px; font-weight: 600; text-align: center; }
.side__foot { display: grid; gap: 10px; margin-top: auto; }
.side__foot .org { border-top: 1px solid var(--line); margin: 0 -12px; padding: 12px 22px 0; }
.side__note { position: relative; padding: 14px; border-radius: var(--r); background: var(--forest); color: var(--white); overflow: hidden; isolation: isolate; }
.side__note p { color: rgb(255 255 255 / .75); font-size: 12.5px; line-height: 1.4; }
.side__note b { display: block; margin-bottom: 3px; color: var(--white); font-weight: 500; font-size: 13.5px; }
.side__note .under { display: inline-block; margin-top: 6px; padding: 4px 0; color: var(--lime); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.side__note .motif { background-size: 40px 40px; -webkit-mask-image: linear-gradient(to bottom left, #000, transparent 60%); mask-image: linear-gradient(to bottom left, #000, transparent 60%); }
.org { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.org__mark { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.org b, .me b { display: block; font-weight: 500; line-height: 1.25; }
.org small, .me small { display: block; color: var(--soft); font-size: 11.5px; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgb(16 33 26 / .4); animation: fade-in 200ms var(--ease-out); }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 var(--pad); background: rgb(241 244 239 / .88); backdrop-filter: blur(10px); }
.top__menu { display: none; }
.top__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.search { position: relative; display: flex; align-items: center; width: min(320px, 100%); }
.search > svg { position: absolute; left: 11px; color: var(--soft); width: 15px; height: 15px; }
.search input { width: 100%; min-height: 34px; padding: 0 38px 0 33px; border: 0; border-radius: 20px; background: var(--white); box-shadow: 0 1px 2px rgb(16 33 26 / .06); outline: none; transition: box-shadow 160ms var(--ease-out); }
.search input:focus-visible { box-shadow: 0 0 0 2px var(--in); }
.search input::placeholder { color: var(--faint); }
.search kbd { position: absolute; right: 9px; padding: 0 6px; border-radius: 5px; background: var(--hover); color: var(--soft); font: 500 11px/1.6 inherit; }
.me { display: flex; align-items: center; gap: 9px; }
.me__face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--mint); }
.team { display: flex; padding-right: 4px; }
.team li + li { margin-left: -8px; }
.team img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--paper); background: var(--mint); }
.face { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--mint); flex: none; }

/* Content is capped and centred on wide screens; the top bar lines up with it. */
#view { display: block; max-width: var(--max); margin-inline: auto; padding: 4px var(--pad) var(--pad); outline: none; }
.top { padding-inline: max(var(--pad), calc((100% - var(--max)) / 2 + var(--pad))); }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.head p { margin-top: 2px; font-size: 12.5px; }
.head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Mounting a page (every time it opens). Containers rise in first, then their details and charts
   (guidelines 1, 3, 6): bars grow from the baseline, meter ticks fill left to right, arcs and lines draw. */
@keyframes grow { from { transform: scaleY(0); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes settle { from { opacity: 0; transform: translateY(4px); filter: blur(2px); } }
.is-mounting { animation: fade-in 160ms var(--ease-out); }
.is-mounting :is(.balance, .tile, .hero, .activity, .summary, .cards > .panel, .filters, .table-wrap) { animation: rise var(--dur-short) var(--ease-out) both; }
.is-mounting .board__main > :nth-child(1) { animation-delay: 40ms; }
.is-mounting .board__main > :nth-child(2), .is-mounting .hero, .is-mounting .cards > .panel:nth-child(2) { animation-delay: 70ms; }
.is-mounting .board__main > :nth-child(3), .is-mounting .cards > .panel:nth-child(3) { animation-delay: 100ms; }
.is-mounting .board__main > :nth-child(4), .is-mounting .activity { animation-delay: 130ms; }
.is-mounting .board__main > :nth-child(5) { animation-delay: 160ms; }
.is-mounting .tile__big, .is-mounting .balance strong, .is-mounting .hero strong { animation: settle 360ms var(--ease-out) 160ms both; }
.is-mounting .grow { transform-box: fill-box; transform-origin: bottom; animation: grow 520ms var(--ease-out) both; animation-delay: calc(200ms + var(--i, 0) * 12ms); }
.is-mounting .draw { stroke-dasharray: 1; animation: draw 900ms var(--ease-out) 220ms both; }
.is-mounting .fade { animation: fade-in 600ms var(--ease-out) 500ms both; }
.is-mounting .meter i { animation: reveal 700ms var(--ease-out) 200ms both; }
.row-in { animation: row-in 200ms var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 10) * 30ms); }
.row-in.is-done { animation: row-in 200ms var(--ease-out) both, fresh 1400ms var(--ease-out); transform: none; }

/* Overview board: twelve columns */
.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.board > * { min-width: 0; }
.balance { grid-column: 1 / -1; }
.board__main { grid-column: span 8; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: auto 1fr; gap: var(--gap); }
.board__side { grid-column: span 4; display: grid; gap: var(--gap); align-content: start; }

/* Tiles: icon and title, two corner figures, one large figure, then a meter or chart */
.tile { grid-column: span 2; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px 14px; border-radius: var(--r); background: var(--white); }
.tile--wide { grid-column: span 3; }
.tile__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.tile__head h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--soft); letter-spacing: 0; }
.tile__head h2 svg { width: 16px; height: 16px; color: var(--ink); }
.tile__go { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--ink); }
.tile__go:hover { background: var(--hover); }
.tile__go svg { width: 15px; height: 15px; }
.tile__body { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "l r" "big big"; align-items: start; gap: 2px 8px; }
.tile__body--wide { grid-template-columns: 1fr auto 1fr; grid-template-areas: "l big r"; align-items: center; }
.tile__stat { grid-area: l; }
.tile__stat--r { grid-area: r; text-align: right; }
.tile__stat b { display: block; font-size: 14px; font-weight: 600; }
.tile__stat small { display: block; color: var(--soft); font-size: 11.5px; }
.tile__big { grid-area: big; justify-self: center; font-size: clamp(1.9rem, 2.6vw, 2.5rem); font-weight: 500; line-height: 1; letter-spacing: -.03em; margin: 6px 0 2px; }
.tile__big sup { font-size: .42em; font-weight: 500; margin-left: 2px; vertical-align: super; color: var(--soft); }
.tile__big sup.pre { margin: 0 2px 0 0; }
.tile__foot { margin-top: auto; }
.tile__foot > p { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--soft); font-size: 11.5px; }
.ticks { width: 100%; height: 26px; }
.arc { position: relative; display: grid; justify-items: center; margin-top: -6px; }
.arc svg { width: 100%; max-width: 200px; }
.arc .tile__big { grid-area: auto; position: absolute; left: 0; right: 0; bottom: 0; margin: 0; text-align: center; }
.tile--wide .tile__foot { flex: 1; display: flex; flex-direction: column; }
.tick-chart { flex: 1; min-height: 100px; }
.tick-chart svg { width: 100%; height: 100%; overflow: visible; }
.tick-chart svg rect { transition: opacity 160ms var(--ease-out); }
.tick-chart svg:focus-visible { outline-offset: 4px; border-radius: 4px; }
.axis-row { color: var(--faint) !important; }
.axis-row span:nth-child(2) { color: var(--soft); }
.bills li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.bills li:first-child { border-top: 0; }
/* Bill dates as small tear-off calendar pages: month band on top, day below. The next one due is dark. */
.bills .date { display: grid; grid-template-rows: 14px 1fr; flex: none; width: 38px; height: 40px; border-radius: 7px; overflow: hidden; background: var(--white); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgb(16 33 26 / .06); text-align: center; }
.bills .date small { display: grid; place-items: center; background: var(--sage); color: var(--forest); font-size: 8.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.bills .date b { display: grid; place-items: center; color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.bills li:first-child .date small { background: var(--forest); color: var(--lime); }
.bills .who { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bills .who img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.bills .who > span { min-width: 0; }
.bills .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bills .who small { color: var(--soft); font-size: 12px; }
.bills li > b { font-weight: 600; white-space: nowrap; }

/* Recent activity list */
.activity ul li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); border-radius: 6px; }
.activity ul li:first-child { border-top: 0; padding-top: 2px; }
.activity .who { min-width: 0; }
.activity .who span { min-width: 0; }
.activity .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity .who small .status { margin-left: 4px; padding: 0 7px; font-size: 11px; }
.activity li > b { font-weight: 600; white-space: nowrap; }
.panel { min-width: 0; padding: 14px 16px 16px; border-radius: var(--r); background: var(--white); }
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 30px; }

/* Balance banner: forest, with the emblem repeated and fading in from the right */
.balance { position: relative; padding: 20px 22px; border-radius: var(--r); background: var(--forest); color: var(--white); overflow: hidden; isolation: isolate; }
.balance > p:first-of-type { color: rgb(255 255 255 / .72); }
.balance strong { display: block; margin: 4px 0 6px; font-size: clamp(2rem, 3.4vw, 2.8rem); font-weight: 600; line-height: 1; }
.balance__sub { color: rgb(255 255 255 / .72); }
.balance__sub b { color: var(--lime); font-weight: 500; }
.motif { position: absolute; inset: 0; z-index: -1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 60 60'%3E%3Cdefs%3E%3Cpath id='t' d='M3 20V17L17 3H23L33 13L25 21'/%3E%3C/defs%3E%3Cg fill='none' stroke='%231a4a37' stroke-width='3.4' stroke-linejoin='bevel'%3E%3Cuse href='%23t'/%3E%3Cuse href='%23t' transform='rotate(90 24 24)'/%3E%3Cuse href='%23t' transform='rotate(180 24 24)'/%3E%3Cuse href='%23t' transform='rotate(270 24 24)'/%3E%3C/g%3E%3C/svg%3E") right -10px top -10px / 64px 64px; -webkit-mask-image: linear-gradient(to left, #000 10%, transparent 70%); mask-image: linear-gradient(to left, #000 10%, transparent 70%); }
.balance__actions { position: absolute; right: 22px; top: 50%; translate: 0 -50%; display: flex; gap: 14px; }
.balance__actions > * { display: grid; justify-items: center; gap: 6px; font-size: 12px; color: rgb(255 255 255 / .8); }
.balance__actions span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--lime); color: var(--forest); }
.balance__actions > :last-child span { background: rgb(255 255 255 / .12); color: var(--white); }
.balance__actions > *:hover span { transform: translateY(-1px); }
.balance__actions > *:active span { transform: scale(.97); }

/* Corporate card: forest with a lime glow, and the emblem cropped by the card's top edge */
.hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 236px; padding: 18px 20px; border-radius: var(--r); overflow: hidden; isolation: isolate; color: var(--white); transition: transform var(--dur-short) var(--ease-out);
  background: radial-gradient(120% 90% at 0% 100%, #6fc24b 0%, #2f8a4a 32%, rgb(15 59 44 / 0) 68%), linear-gradient(135deg, #17503c, #0f3b2c 60%); }
.hero:active { transform: scale(.99); }
/* Big emblem rising from the bottom-right corner, cropped by the card's bottom and right edges */
.hero__mark { position: absolute; right: -70px; bottom: -120px; width: 300px; color: rgb(147 227 91 / .07); z-index: -1; }
.hero__top { display: flex; justify-content: space-between; gap: 12px; }
.hero__top p { color: rgb(255 255 255 / .72); font-size: 12.5px; letter-spacing: .02em; }
.hero .hero__sub { color: rgb(255 255 255 / .72); }
.hero strong { display: block; margin: 0 0 2px; font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 600; line-height: 1; }
.hero__sub b { color: var(--lime); font-weight: 500; }
.hero__logo { height: 18px; width: auto; margin-bottom: 6px; }
.hero__go { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--lime); color: var(--forest); }
.hero:hover .hero__go { transform: translateX(2px); }
.hero .holder { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.hero .holder img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid rgb(255 255 255 / .5); }
.hero .holder small { color: rgb(255 255 255 / .7); font-size: 11.5px; }
.hero__foot { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.hero__foot p { margin-top: 8px; font-size: 13px; line-height: 1.35; }
.chip { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--white); color: var(--forest); font-size: 12px; font-weight: 600; }

.tip { position: fixed; z-index: 70; min-width: 150px; padding: 9px 11px; border-radius: var(--r-sm); background: var(--white); box-shadow: 0 10px 28px rgb(16 33 26 / .16); pointer-events: none; font-size: 12.5px; animation: fade-in 120ms var(--ease-out); }
.tip b { display: block; margin-bottom: 5px; font-weight: 600; }
.tip b:only-child { margin: 0; }
.tip div { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip div + div { margin-top: 2px; }
.tip div span { display: flex; align-items: center; gap: 6px; color: var(--soft); }
.tip i { width: 9px; height: 9px; border-radius: 3px; }

/* Bank cards */
.bank-card { position: relative; height: 184px; padding: 15px 17px; border-radius: 14px; background: linear-gradient(135deg, #17503c, #0f3b2c 70%); color: var(--white); overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; }
.bank-card--virtual { background: linear-gradient(140deg, #b5f08a, #8ddc58 75%); color: var(--forest); }
.bank-card--virtual .grid { position: absolute; right: 14px; top: 50%; translate: 0 -50%; width: 150px; color: rgb(15 59 44 / .09); z-index: -1; -webkit-mask-image: linear-gradient(to left, #000 30%, transparent); mask-image: linear-gradient(to left, #000 30%, transparent); }
.bank-card--virtual .holder img { border-color: rgb(15 59 44 / .25); }
.bank-card--travel { background: linear-gradient(160deg, #f2f8ef, #dcefd6); color: var(--forest); box-shadow: inset 0 0 0 1px rgb(15 59 44 / .08); }
.bank-card--travel .holder img { border-color: var(--white); }
.bank-card svg.mark { position: absolute; right: 18px; top: 50%; translate: 0 -50%; width: 120px; color: rgb(147 227 91 / .06); z-index: -1; }
.bank-card.bank-card--travel svg.mark--top { top: -64px; right: 70px; translate: none; width: 170px; color: rgb(15 59 44 / .08); }
.bank-card header { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.bank-card header svg.wordmark { width: auto; height: 18px; }
.bank-card .pan { font-size: clamp(1rem, 1.4vw, 1.2rem); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.bank-card .pan.pan--big { font-size: clamp(1.6rem, 2.4vw, 2rem); font-weight: 500; letter-spacing: .02em; }
.pan--big small { font-size: .6em; vertical-align: middle; opacity: .6; }
.bank-card footer { display: flex; gap: 22px; align-items: center; font-size: 11px; opacity: .9; }
.bank-card footer b { display: block; font-weight: 500; font-size: 13px; }
.holder { display: flex; align-items: center; gap: 8px; }
.holder img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 2px solid rgb(255 255 255 / .5); }
.limit { margin-top: 12px; }
.limit p { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--soft); }
.limit strong { color: var(--ink); font-size: 1.1rem; font-weight: 600; }
.meter { height: 7px; margin-top: 8px; border-radius: 8px; background: var(--bar-off); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--forest), var(--in)); transition: width var(--dur-long) var(--ease-in-out); }

/* Tables: rows separated by hairlines only */
.table-wrap { overflow-x: auto; margin: 0 -16px -16px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 16px; text-align: left; white-space: nowrap; }
td { border-top: 1px solid var(--line); }
th { color: var(--faint); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
th button { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; text-transform: inherit; letter-spacing: inherit; }
th button svg:not([viewBox]) { width: 11px; height: 11px; stroke-width: 2; color: var(--faint); }
td.amt, th.amt { text-align: right; }
td.amt { font-weight: 600; }
.amt--in { color: var(--up); }
tbody tr { transition: background-color 160ms var(--ease-out); }
tbody tr:hover { background: #fafbf9; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--mint); }
.who i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--hover); color: var(--forest); font-style: normal; font-weight: 600; font-size: 11px; }
.who i.in { background: var(--mint); }
.who b { display: block; font-weight: 500; }
.who small { color: var(--soft); font-size: 12px; }
.empty { padding: 36px 16px; text-align: center; color: var(--soft); border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.search--panel { width: min(300px, 100%); }
.search--panel input { padding-right: 12px; background: var(--hover); box-shadow: none; }

/* Cards page */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--gap); }
.cards .panel h2 { margin-bottom: 12px; }
.cards ul { margin-top: 14px; }
.cards li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.cards li span { color: var(--soft); }

/* Budgets: summary strip, then one section per owner with a schedule and totals */
.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: var(--gap); border-radius: var(--r); background: var(--white); }
.summary > div { padding: 14px 18px; border-left: 1px solid var(--line); }
.summary > div:first-child { border-left: 0; }
.summary dt { color: var(--soft); font-size: 12px; font-weight: 500; }
.summary dd { margin: 4px 0 2px; font-size: 1.35rem; font-weight: 600; letter-spacing: -.02em; }
.summary small { color: var(--faint); font-size: 11.5px; }
.is-good { color: var(--up); }
.is-bad { color: var(--down); }
.groups { display: grid; gap: var(--gap); }
.group { position: relative; border-radius: var(--r); background: var(--white); overflow: hidden; box-shadow: inset 4px 0 0 var(--g); animation: rise var(--dur-short) var(--ease-out) both; animation-delay: calc(var(--gi) * 60ms); }
.group__head { display: flex; align-items: center; gap: 14px; padding: 12px 14px 10px 20px; }
.group__head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.group__head h2 span { color: var(--soft); font-weight: 400; }
.group__used { margin-left: auto; color: var(--soft); font-size: 12.5px; }
.group__used b { color: var(--ink); font-weight: 600; }
.group__tools { display: flex; gap: 2px; }
.chev { transition: rotate var(--dur-short) var(--ease-in-out); }
.is-collapsed .chev { rotate: -90deg; }
.group__body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--dur-long) var(--ease-in-out); }
.is-collapsed .group__body { grid-template-rows: 0fr; transition-duration: 340ms; }
.group__inner { min-height: 0; overflow: hidden; }
.tabs { position: relative; display: flex; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.tabs button { width: 72px; padding: 6px 0 9px; color: var(--faint); font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs__ink { position: absolute; left: 20px; bottom: -1px; width: 72px; height: 2px; border-radius: 2px; background: var(--g); transform: translateX(calc(var(--tab, 0) * 90px)); transition: transform 240ms var(--ease-in-out); }
.tabpanel { animation: fade-in var(--dur-short) var(--ease-out); }
.tabpanel .table-wrap { margin: 0; }
.ledger th:first-child, .ledger td:first-child { padding-left: 20px; }
.ledger td { padding-top: 11px; padding-bottom: 11px; }
.ledger tbody tr:first-child td { border-top: 0; }

/* Day columns share the timeline width; --col is one day as a share of it. Scrolls sideways only when narrower than 22px a day. */
.gantt { display: grid; grid-template-columns: 470px minmax(calc(var(--days) * 22px), 1fr); overflow-x: auto; --col: calc(100% / var(--days)); }
.gantt__table { position: sticky; left: 0; z-index: 3; width: 470px; background: var(--white); box-shadow: 1px 0 0 var(--line); }
.gantt__table th { height: 58px; padding: 0 10px 9px; vertical-align: bottom; font-size: 10.5px; background: #f8faf7; }
.gantt__table th:first-child, .gantt__table td:first-child { padding-left: 20px; }
.gantt__table td { height: 44px; padding: 0 10px; font-size: 12.5px; }
.gantt__table td:first-child { max-width: 200px; }
.gantt__table td:first-child b { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 13px; }
.gantt__table td:first-child small { display: block; color: var(--faint); font-size: 11px; }
.gantt__table td:nth-child(2) { font-weight: 600; }
.gantt__table td:nth-child(n+4) { color: var(--soft); }
.gantt__time { position: relative; min-width: 0; }
.gantt__month { display: grid; place-items: center; height: 24px; border-bottom: 1px solid var(--line); background: #f8faf7; color: var(--soft); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; }
.gantt__days { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr));height: 34px; background: #f8faf7; }
.gantt__days span { display: grid; place-content: center; text-align: center; font-size: 11.5px; font-weight: 600; line-height: 1.1; }
.gantt__days small { color: var(--faint); font-size: 8.5px; font-weight: 500; letter-spacing: .04em; }
.gantt__days .is-weekend { background: #f0f4ee; }
.gantt__days .is-today { background: var(--forest); color: var(--white); }
.gantt__days .is-today small { color: var(--lime); }
.lane { position: relative; height: 44px; border-top: 1px solid var(--line); background: repeating-linear-gradient(to right, transparent 0 calc(var(--col) - 1px), #f1f4ef calc(var(--col) - 1px) var(--col)); }
.gbar { position: absolute; top: 9px; left: calc((var(--s) - 1) * var(--col) + 2px); width: calc(var(--d) * var(--col) - 4px); height: 26px; display: flex; align-items: center; padding: 0 9px; border-radius: 6px; background: var(--g-soft); box-shadow: inset 3px 0 0 var(--g); overflow: hidden; cursor: default;
  animation: reveal 420ms var(--ease-out) both; animation-delay: calc(120ms + min(var(--i), 10) * 30ms); transition: filter 160ms var(--ease-out); }
.gbar:hover { filter: brightness(.96); }
.gbar.is-open { background: repeating-linear-gradient(135deg, var(--g-soft) 0 6px, #fff 6px 9px); }
.gbar em, .gbar__out { font-style: normal; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbar__out { position: absolute; top: 0; height: 44px; display: flex; align-items: center; left: calc((var(--s) - 1) * var(--col) + 6px); color: var(--soft); font-weight: 400; pointer-events: none; }
.gbar__out--before { left: auto; right: calc((var(--days) - var(--s) + 1) * var(--col) + 6px); }
.today { position: absolute; top: 58px; bottom: 0; left: calc((var(--today) - .5) * var(--col) - 1px); width: 2px; background: var(--forest); z-index: 2; pointer-events: none; }
.today::before { content: attr(data-label); position: absolute; top: -55px; left: 50%; translate: -50% 0; padding: 1px 6px; border-radius: 4px; background: var(--forest); color: var(--lime); font-size: 10px; font-weight: 600; letter-spacing: .04em; }

/* Dialog: grows from 0.95 in 200ms, leaves in 160ms (guidelines 10 and 15) */
/* The browser's own `dialog:modal` rule makes the dialog a scroll box, which clipped the category menu;
   this selector outranks it. */
dialog.modal:modal { overflow: visible; max-height: none; }
.modal { width: min(440px, calc(100% - 32px)); margin: auto; padding: 20px; border: 0; border-radius: var(--r); box-shadow: 0 30px 60px rgb(16 33 26 / .25); }
.modal[open] { animation: pop-in 200ms var(--ease-out); }
.modal[open]::backdrop { animation: fade-in 200ms var(--ease-out); }
.modal.is-closing { animation: pop-out 160ms var(--ease-out) forwards; }
.modal.is-closing::backdrop { animation: fade-out 160ms var(--ease-out) forwards; }
.modal::backdrop { background: rgb(16 33 26 / .45); }
.modal form { display: grid; gap: 12px; }
.modal .panel__head { margin: 0; }
.modal .icon-btn { box-shadow: none; background: var(--hover); }
.seg--wide { display: flex; }
.seg--wide label { flex: 1; justify-content: center; min-height: 32px; }
.field { display: grid; gap: 5px; color: var(--soft); font-weight: 500; font-size: 12.5px; }
.field input { min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: var(--hover); color: var(--ink); font-size: 14px; outline: none; transition: box-shadow 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.field input:focus-visible { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--in); }
.field input::placeholder { color: var(--faint); }
.field.has-error input { background: #fcf3f1; box-shadow: inset 0 0 0 1.5px var(--down); }
.field__error { color: var(--down); font-size: 12px; font-weight: 500; }
.field__error:empty { display: none; }
.field__error:not(:empty) { animation: row-in 200ms var(--ease-out); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.modal__actions { display: flex; justify-content: end; gap: 8px; margin-top: 4px; }
.modal__actions .btn:not(.btn--dark) { background: var(--hover); box-shadow: none; }

@media (max-width: 1240px) {
  .board__main, .board__side { grid-column: 1 / -1; }
  .board__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(260px, 86vw); transform: translateX(-105%); transition: transform 240ms var(--ease-in-out); }
  .side.is-open { transform: none; box-shadow: 0 0 40px rgb(16 33 26 / .2); transition: transform 300ms var(--ease-out); }
  .top__menu { display: grid; }
  .me__text, .search kbd, .team { display: none; }
  .board__side { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary > div { border-left: 0; border-top: 1px solid var(--line); }
  .summary > div:nth-child(-n+2) { border-top: 0; }
  .summary > div:nth-child(even) { border-left: 1px solid var(--line); }
  .summary > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .group__used { display: none; }
  .group__tools { margin-left: auto; }
}
@media (max-width: 620px) {
  .head__actions { width: 100%; }
  .head__actions .btn--dark { flex: 1; justify-content: center; }
  .field-row { grid-template-columns: 1fr; }
  .board__main { grid-template-columns: minmax(0, 1fr); }
  .tile, .tile--wide { grid-column: 1 / -1; }
  .balance { padding: 18px 18px 84px; }
  .balance__actions { top: auto; bottom: 16px; left: 18px; right: auto; translate: none; }
  .gantt { grid-template-columns: 230px minmax(calc(var(--days) * 22px), 1fr); }
  .gantt__table { width: 230px; }
  .gantt__table th:nth-child(n+3), .gantt__table td:nth-child(n+3) { display: none; }
  .gantt__table td:first-child { max-width: 170px; }
  .group__head h2 span { display: none; }
}
/* Reduced motion: movement off everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
