/* ============================================================
   Adjoltz Ledger — Operate surface, dark Adjoltz brand.
   Tokens from Adjoltz Brand Kit/tokens.css (live adjoltz.com).
   Void ground + green glow field, glassmorphic panels, one green,
   gold reserved for rank #1. Receipt masthead + glass scoreboard.
   ============================================================ */

:root {
  --bg:      #08090a;
  --bg2:     #0b0c0e;
  --panel:   #101113;
  --panel2:  #16181b;

  --brand:   #25d366;
  --brand2:  #3ee382;
  --teal:    #14b88c;
  --ink:     #04231d;   /* text on green */

  --gold:    #f4c95d;
  --gold-dim:rgba(244,201,93,.10);
  --red:     #ff8b8b;
  --red-dim: rgba(255,139,139,.12);

  --head:    #f5f7f7;
  --text:    #bcc3c7;
  --mut:     #828a8f;
  --dim:     #737b81;   /* lifted from brand #5d646a to clear AA on the void ground */

  --line:    rgba(255,255,255,.08);
  --line2:   rgba(255,255,255,.06);
  --gline:   rgba(255,255,255,.12);

  --glass:   linear-gradient(158deg, rgba(255,255,255,.085), rgba(255,255,255,.022) 46%, rgba(255,255,255,.006));
  --ginset:  inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.35);
  --glift:   0 26px 60px -34px rgba(0,0,0,.95), 0 0 0 1px rgba(37,211,102,.055);
  --blur:    blur(22px) saturate(140%);

  --btn:     linear-gradient(180deg, var(--brand2), var(--brand));
  --btn-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -2px 6px rgba(0,0,0,.22), 0 10px 28px -10px rgba(37,211,102,.6);
  --ring:    rgba(37,211,102,.55);

  --r-card: 22px;
  --r-md:   14px;
  --r-sm:   11px;
  --r-pill: 99px;

  --maxw: 960px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Partner monogram tints — dark, distinct, green-family. */
[data-p="Manu"]  { --p-bg: #12251c; }
[data-p="Yash"]  { --p-bg: #122b3a; }
[data-p="Onkar"] { --p-bg: #10322a; }
[data-p="Kyle"]  { --p-bg: #1c2b16; }

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 72% -6%, rgba(37,211,102,.13), transparent 62%),
    radial-gradient(760px 620px at -8% 30%, rgba(20,184,140,.08), transparent 60%),
    radial-gradient(820px 640px at 92% 96%, rgba(37,211,102,.06), transparent 65%),
    var(--bg);
  background-attachment: fixed;
}

::selection { background: rgba(37,211,102,.28); color: #fff; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ring); border-radius: 6px; }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); background-clip: padding-box; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- Glass ---------- */
/* No backdrop-filter on the big scroll cards: they sit on a smooth dark
   ground (blur is invisible) and it caused a repaint flicker when hovering
   nearby controls. Kept only on real overlays (drawer, dropdowns). */
.glass, .masthead, .standings, .ledger, .lock-card, .drawer-inner {
  background: var(--glass);
  border: 1px solid var(--gline);
  border-radius: var(--r-card);
  box-shadow: var(--ginset), var(--glift);
}

/* ---------- Buttons ---------- */
.btn {
  --_bg: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.9375rem; letter-spacing: -0.01em;
  padding: 11px 17px; border-radius: 12px;
  border: 1px solid transparent; background: var(--_bg); color: var(--text);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn .ico { width: 18px; height: 18px; }

.btn-primary {
  background: var(--btn); color: var(--ink); font-weight: 700;
  border-color: rgba(255,255,255,.22); box-shadow: var(--btn-shadow);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.99); }

.btn-ghost { border-color: var(--gline); color: var(--text); background: var(--glass); box-shadow: var(--ginset); }
.btn-ghost:hover { border-color: var(--line2); color: var(--head); background: rgba(255,255,255,.05); }

.btn-icon { padding: 0; width: 42px; height: 42px; color: var(--mut); border-radius: 12px; }
.btn-icon:hover { background: rgba(255,255,255,.06); color: var(--head); }
.btn-icon-sm { width: 30px; height: 30px; }
.btn-icon-sm .ico { width: 16px; height: 16px; }
.btn-block { width: 100%; padding: 14px; }

.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand2); cursor: pointer; text-underline-offset: 3px; text-decoration: underline; }
.linkbtn:hover { color: var(--brand); }

/* ---------- Logo wordmark ---------- */
.brand-mark { font-family: "Inter Tight", Inter; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.04em; color: var(--head); display: inline-flex; align-items: center; line-height: 1; }
.brand-mark .bolt { height: 1.5em; width: auto; margin: 0 0.02em; }
.lock-mark { font-size: 2rem; margin-bottom: 22px; }
.lock-mark .bolt { height: 1.7em; }

/* ---------- Lock ---------- */
.lock { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.lock-card { padding: 40px 36px; width: min(400px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; animation: rise .5s var(--ease) both; }
.lock-logo { height: 30px; width: auto; margin-bottom: 20px; }
.lock-title { font-family: "Inter Tight", Inter; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; color: var(--head); }
.lock-sub { color: var(--mut); font-size: 0.9375rem; margin-top: 6px; margin-bottom: 26px; }
.lock-field { width: 100%; text-align: left; }
.lock-error { color: var(--red); font-size: 0.875rem; font-weight: 600; margin: 12px 0 2px; }
.lock .btn-primary { margin-top: 18px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field, .field-row + .field, .field + .field-row { margin-top: 11px; }
.field-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: var(--mut); }
.field-label .opt { text-transform: none; letter-spacing: 0; color: var(--dim); font-weight: 500; margin-left: 4px; }
.input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--head);
  background: rgba(0,0,0,.28); border: 1px solid var(--gline); border-radius: var(--r-sm);
  padding: 11px 14px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.input::placeholder { color: var(--dim); }
.input:hover { border-color: var(--line2); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring), 0 0 18px -4px rgba(37,211,102,.35); }
.with-tag { position: relative; }
.input[type="date"] { color-scheme: dark; }

/* ---------- App shell ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 34px);
  background: rgba(8,9,10,.72);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line2);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { height: 22px; }
.brand-word { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; color: var(--head); padding-left: 12px; border-left: 1px solid var(--gline); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* Custom glass dropdown (native select can't be themed on its open list) */
.dd { position: relative; }
.dd-trigger {
  appearance: none; font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--text);
  background: var(--glass); box-shadow: var(--ginset); border: 1px solid var(--gline); border-radius: var(--r-sm);
  padding: 10px 12px 10px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.dd-trigger:hover { border-color: var(--line2); color: var(--head); }
.dd-caret { width: 16px; height: 16px; color: var(--mut); transition: transform .18s var(--ease); }
.dd-trigger[aria-expanded="true"] .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 190px;
  list-style: none; padding: 6px; margin: 0; max-height: 320px; overflow-y: auto;
  background-image: var(--glass); background-color: var(--panel2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--gline); border-radius: var(--r-md); box-shadow: var(--ginset), var(--glift);
  animation: ddIn .16s var(--ease);
}
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 11px; border-radius: 9px; font-size: 0.9rem; font-weight: 600; color: var(--text);
  cursor: pointer; white-space: nowrap; transition: background-color .12s var(--ease), color .12s var(--ease);
}
.dd-opt:hover, .dd-opt:focus-visible { background: rgba(255,255,255,.07); color: var(--head); outline: none; }
.dd-opt.is-active { color: var(--brand2); }
.dd-opt .ico { width: 16px; height: 16px; color: var(--brand2); flex: none; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.content {
  width: 100%; max-width: var(--maxw); margin: 0 auto; flex: 1; min-width: 0;
  padding: clamp(20px, 4vw, 38px) clamp(16px, 4vw, 34px) 40px;
  display: flex; flex-direction: column; gap: 18px;
}
.masthead, .standings, .ledger { min-width: 0; }

/* ---------- Receipt masthead ---------- */
.masthead { padding: clamp(24px, 4vw, 34px) clamp(24px, 4vw, 38px) 26px; position: relative; }
.masthead::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(560px 300px at 20% 24%, rgba(37,211,102,.12), transparent 66%); }
.rc-head { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mut); }
.rc-g { color: var(--brand2); }
.perf { height: 1px; background: repeating-linear-gradient(90deg, var(--gline) 0 6px, transparent 6px 12px); margin: 16px 0; }
.statement-label { position: relative; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.statement-figure { position: relative; display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.statement-figure .cur { font-size: clamp(1rem, 2.2vw, 1.4rem); font-weight: 800; letter-spacing: 0.02em; color: var(--mut); line-height: 1; }
.total-num {
  font-family: "Inter Tight", Inter; font-size: clamp(3rem, 8.5vw, 5rem); font-weight: 900; letter-spacing: -0.045em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--brand2);
  text-shadow: 0 6px 30px rgba(37,211,102,.28);
}
.rc-rows { position: relative; display: flex; flex-direction: column; gap: 2px; }
.rc-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 0.95rem; }
.rc-k { color: var(--text); }
.rc-v { color: var(--head); font-weight: 700; font-variant-numeric: tabular-nums; }
.cur-sm { font-size: 0.72em; font-weight: 700; color: var(--mut); }
.rc-foot { position: relative; text-align: center; color: var(--dim); font-size: 0.8rem; letter-spacing: 0.04em; }

/* ---------- Section heads ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; margin: 6px 4px 2px; flex-wrap: wrap; }
.section-head h2 { font-family: "Inter Tight", Inter; font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.01em; color: var(--head); }
.section-meta { font-size: 0.82rem; color: var(--dim); }

/* ---------- Standings (glass scoreboard) ---------- */
.standings, .ledger { padding: clamp(16px, 3vw, 22px); }
.standings-list { list-style: none; display: flex; flex-direction: column; }
.st-row {
  display: grid; align-items: center; gap: 4px 16px;
  grid-template-columns: 34px 46px minmax(0, 1fr) minmax(0, 2.1fr) auto;
  grid-template-areas: "rank avatar main bar amount";
  padding: 14px 8px; border-bottom: 1px solid var(--line2);
}
.st-row:last-child { border-bottom: 0; }
.st-rank { grid-area: rank; font-size: 1rem; font-weight: 800; color: var(--dim); font-variant-numeric: tabular-nums; text-align: center; }
.st-avatar {
  grid-area: avatar; position: relative; width: 46px; height: 46px; border-radius: 14px;
  background: var(--p-bg, var(--panel2)); border: 1px solid var(--gline); box-shadow: var(--ginset);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 0.95rem;
}
.st-crown { position: absolute; top: -9px; right: -8px; width: 22px; height: 22px; color: var(--gold); background: var(--panel); border: 1px solid var(--gline); border-radius: 50%; padding: 2px; }
.st-crown .ico { width: 16px; height: 16px; stroke-width: 1.9; }
.st-main { grid-area: main; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-name { font-weight: 700; font-size: 1.02rem; letter-spacing: -0.01em; color: var(--head); }
.st-deals { font-size: 0.8rem; color: var(--dim); }
.st-bar { grid-area: bar; height: 10px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 100%; border-radius: 999px; transform: scaleX(0); transform-origin: left center; transition: transform .9s var(--ease);
  background: linear-gradient(90deg, var(--teal), var(--brand2)); box-shadow: 0 0 16px rgba(37,211,102,.5); }
.st-amount { grid-area: amount; text-align: right; font-weight: 800; font-size: 1.22rem; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--head); }
.st-amount .cur { font-size: 0.6em; font-weight: 700; color: var(--mut); margin-right: 3px; }

.st-row.is-first { background: radial-gradient(420px 200px at 12% 50%, var(--gold-dim), transparent 70%); border-radius: 14px; border-bottom-color: transparent; }
.st-row.is-first .st-rank { color: var(--gold); }
.st-row.is-first .st-avatar { box-shadow: 0 0 0 2px var(--gold), var(--ginset); }

/* ---------- Ledger ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text); background: var(--glass); box-shadow: var(--ginset); border: 1px solid var(--gline); border-radius: var(--r-pill); padding: 6px 13px; cursor: pointer; transition: all .14s var(--ease); }
.chip:hover { border-color: var(--line2); color: var(--head); }
.chip.is-active { background: var(--btn); border-color: rgba(255,255,255,.22); color: var(--ink); box-shadow: var(--btn-shadow); }

.ledger-body { margin-top: 12px; }
.led-row {
  display: grid; align-items: center; gap: 4px 14px;
  grid-template-columns: 88px minmax(0, 1fr) 128px minmax(0, 124px) 72px;
  grid-template-areas: "date client member amount actions";
  padding: 13px 8px; border-bottom: 1px solid var(--line2);
}
.led-row:last-child { border-bottom: 0; }
.led-row:hover { background: rgba(255,255,255,.03); }
.led-date { grid-area: date; font-size: 0.84rem; color: var(--mut); font-weight: 600; font-variant-numeric: tabular-nums; }
.led-client { grid-area: client; font-weight: 600; font-size: 0.96rem; color: var(--head); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led-client .led-note { display: block; font-weight: 500; font-size: 0.8rem; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.led-member { grid-area: member; display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.led-member .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--p-bg, var(--panel2)); border: 1px solid var(--gline); color: #fff; display: grid; place-items: center; font-size: 0.62rem; font-weight: 800; }
.led-amount { grid-area: amount; text-align: right; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; color: var(--head); }
.led-amount .cur { font-size: 0.7em; font-weight: 700; color: var(--mut); margin-right: 3px; }
.led-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.led-pdf, .led-del { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--mut); background: none; border: 0; cursor: pointer; transition: all .14s var(--ease); text-decoration: none; }
.led-pdf .ico, .led-del .ico { width: 17px; height: 17px; }
.led-pdf:hover { color: var(--brand2); background: rgba(37,211,102,.12); }
.led-del:hover { color: var(--red); background: var(--red-dim); }

/* ---------- Empty ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--mut); }
.empty-title { font-weight: 700; color: var(--head); font-size: 1.05rem; }
.empty-sub { font-size: 0.92rem; margin-top: 6px; color: var(--mut); }
.empty .btn { margin-top: 18px; }

.foot { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 8px clamp(16px,4vw,34px) 30px; color: var(--dim); font-size: 0.8rem; }

/* ---------- Drawer ---------- */
.drawer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.drawer[open] { display: flex; justify-content: flex-end; }
.drawer::backdrop { background: rgba(2, 6, 4, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.drawer[open] .drawer-inner { animation: drawerIn .34s var(--ease); }
.drawer[open]::backdrop { animation: fade .34s var(--ease); }
.drawer-inner {
  width: min(468px, 100vw); height: 100dvh; overflow-y: auto;
  border-radius: 24px 0 0 24px; padding: 18px clamp(20px, 4vw, 28px) 18px;
  display: flex; flex-direction: column;
  background-color: var(--panel);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-head h2 { font-family: "Inter Tight", Inter; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; color: var(--head); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(0,0,0,.3); border: 1px solid var(--line2); border-radius: 13px; padding: 4px; margin-bottom: 16px; }
.seg-btn { font: inherit; font-weight: 700; font-size: 0.9rem; color: var(--mut); background: transparent; border: 0; border-radius: 10px; padding: 9px; cursor: pointer; transition: all .18s var(--ease); }
.seg-btn.is-active { background: var(--glass); box-shadow: var(--ginset); color: var(--head); }

.dropzone { border: 1.5px dashed var(--line2); border-radius: var(--r-md); padding: 14px 14px; text-align: center; margin-bottom: 10px; transition: all .16s var(--ease); background: rgba(0,0,0,.2); }
.dropzone.is-drag { border-color: var(--brand); background: rgba(37,211,102,.1); }
.dz-ico { width: 26px; height: 26px; color: var(--mut); margin-bottom: 8px; }
.dz-title { font-weight: 700; font-size: 0.98rem; color: var(--head); }
.dz-sub { font-size: 0.86rem; color: var(--mut); margin-top: 4px; }
.dz-file { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 10px 12px; background: rgba(0,0,0,.25); border: 1px solid var(--gline); border-radius: var(--r-sm); text-align: left; }
.dz-file .ico { color: var(--brand2); flex: none; }
.dz-file-name { font-weight: 600; font-size: 0.88rem; color: var(--head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.dz-status { font-size: 0.78rem; font-weight: 600; color: var(--mut); white-space: nowrap; }
.dz-status.ok { color: var(--brand2); }
.dz-status.warn { color: var(--gold); }

.amount-input { position: relative; display: flex; align-items: center; }
.amount-cur { position: absolute; left: 15px; font-weight: 800; color: var(--mut); font-size: 1.05rem; pointer-events: none; }
.input-amount { padding-left: 56px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--head); }
.auto-tag { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand2); background: rgba(37,211,102,.14); padding: 4px 8px; border-radius: 999px; }

.member-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.mp-btn { display: flex; align-items: center; gap: 10px; font: inherit; text-align: left; background: rgba(0,0,0,.22); border: 1px solid var(--gline); border-radius: var(--r-sm); padding: 9px 12px; cursor: pointer; transition: all .14s var(--ease); }
.mp-btn:hover { border-color: var(--line2); }
.mp-btn .dot { width: 28px; height: 28px; border-radius: 8px; background: var(--p-bg, var(--panel2)); border: 1px solid var(--gline); color: #fff; display: grid; place-items: center; font-size: 0.7rem; font-weight: 800; flex: none; }
.mp-btn .mp-name { font-weight: 700; font-size: 0.92rem; color: var(--text); }
.mp-btn.is-active { border-color: var(--brand); background: rgba(37,211,102,.1); box-shadow: 0 0 0 1px var(--brand), 0 0 20px -6px rgba(37,211,102,.5); }
.mp-btn.is-active .mp-name { color: var(--brand2); }

.field-row { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* Glass date picker */
.datepick { position: relative; }
.datepick .auto-tag { right: 46px; }
.dp-trigger {
  width: 100%; font: inherit; font-size: 1rem; color: var(--head);
  background: rgba(0,0,0,.28); border: 1px solid var(--gline); border-radius: var(--r-sm);
  padding: 11px 14px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.dp-trigger:hover { border-color: var(--line2); }
.dp-trigger[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.dp-trigger > .ico { color: var(--mut); width: 18px; height: 18px; }
.dp-pop {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 50; width: 300px; max-width: calc(100vw - 44px);
  background-image: var(--glass); background-color: var(--panel2);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--gline); border-radius: var(--r-md); box-shadow: var(--ginset), var(--glift);
  padding: 14px; animation: ddIn .16s var(--ease);
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dp-title { font-weight: 700; font-size: 0.95rem; color: var(--head); }
.dp-nav { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--gline); color: var(--text); cursor: pointer; transition: all .12s var(--ease); }
.dp-nav:hover { background: rgba(255,255,255,.08); color: var(--head); }
.dp-nav .ico { width: 16px; height: 16px; }
.dp-dows { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.dp-dows span { text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--dim); padding: 4px 0; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-day { aspect-ratio: 1; display: grid; place-items: center; font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--text); background: transparent; border: 0; border-radius: 9px; cursor: pointer; transition: background-color .12s var(--ease), color .12s var(--ease); }
.dp-day:hover { background: rgba(255,255,255,.08); color: var(--head); }
.dp-day.is-today { color: var(--brand2); box-shadow: inset 0 0 0 1px rgba(37,211,102,.4); }
.dp-day.is-sel { background: var(--btn); color: var(--ink); font-weight: 800; box-shadow: 0 0 14px -4px rgba(37,211,102,.6); }
.dp-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.dp-today { font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--brand2); background: rgba(37,211,102,.1); border: 1px solid rgba(37,211,102,.25); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.dp-today:hover { background: rgba(37,211,102,.16); }
.form-error { color: var(--red); font-size: 0.86rem; font-weight: 600; margin-top: 16px; }
.drawer-foot { display: flex; gap: 10px; margin-top: auto; padding-top: 16px; }
.drawer-foot .btn { flex: 1; }

/* ---------- Toast + confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 140%);
  z-index: 60; display: flex; align-items: center; gap: 11px;
  background: var(--panel2); border: 1px solid var(--gline); color: var(--head);
  padding: 13px 18px; border-radius: var(--r-pill); box-shadow: var(--glift);
  font-weight: 600; font-size: 0.92rem; max-width: calc(100vw - 32px);
  opacity: 0; transition: transform .4s var(--ease), opacity .3s var(--ease); pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast .tick { width: 22px; height: 22px; border-radius: 50%; background: var(--btn); color: var(--ink); display: grid; place-items: center; flex: none; box-shadow: 0 0 14px rgba(37,211,102,.5); }
.toast .tick .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.toast b { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--brand2); }
.confetti { position: fixed; inset: 0; z-index: 55; pointer-events: none; }

.skel { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .brand-word { display: none; }
  .btn-primary span { display: none; }
  .btn-primary { padding: 11px; }

  .st-row {
    grid-template-columns: 30px 42px minmax(0, 1fr) auto;
    grid-template-areas: "rank avatar main amount" "bar bar bar bar";
    row-gap: 10px; column-gap: 12px;
  }
  .st-avatar { width: 42px; height: 42px; }
  .st-amount { font-size: 1.05rem; }
  .st-deals { white-space: nowrap; }
  .st-bar { margin-top: 2px; }

  .led-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "client amount" "meta actions";
    gap: 6px 12px; padding: 14px 6px;
  }
  .led-date { display: none; }
  .led-member { grid-area: meta; }
  .led-member::after { content: attr(data-date); color: var(--dim); font-weight: 500; margin-left: 8px; }
}

@media (max-width: 400px) { .member-picker { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  .drawer[open] { align-items: flex-end; justify-content: center; }
  .drawer[open] .drawer-inner { animation: sheetIn .34s var(--ease); }
  .drawer-inner { width: 100%; height: auto; max-height: 94dvh; border-radius: 24px 24px 0 0; }
  .toast { bottom: 16px; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .st-bar i { transition: none; }
}
