/* SYD Docs -- «Fresh Bento». Без зовнішніх бібліотек і CDN.
   Шрифти: Unbounded (заголовки) і Manrope (текст), OFL -- public/assets/fonts. Іконки: Lucide (ISC). */

@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/unbounded-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(../fonts/unbounded-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(../fonts/manrope-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f6f5fb; --surface: #ffffff; --surface-2: #f2f0fa; --surface-3: #e9e6f5;
  --border: #e6e2f2; --border-strong: #d4cfe6;
  --text: #17132b; --muted: #6e6889; --faint: #9c97b3;
  --primary: #7c5cff; --primary-ink: #5a3df0; --on-primary: #ffffff; --primary-ring: rgba(124, 92, 255, .28);
  --lime: #c6f432; --on-lime: #1d2700;
  --violet-soft: #ece7ff; --violet-ink: #4b2fd6;
  --lime-soft: #eefbc9; --lime-ink: #3c5700;
  --sky-soft: #ddf0ff; --sky-ink: #0b5a9b;
  --peach-soft: #ffe8da; --peach-ink: #9f420d;
  --pink-soft: #ffe2ee; --pink-ink: #ad1658;
  --mint-soft: #d9f6ea; --mint-ink: #0a6845;
  --danger: #e0245e; --warning: #c26a00; --success: #12936a;
  --shadow-sm: 0 1px 2px rgba(23, 19, 43, .05);
  --shadow: 0 1px 2px rgba(23, 19, 43, .04), 0 8px 24px -12px rgba(54, 37, 140, .18);
  --shadow-lg: 0 24px 60px -20px rgba(54, 37, 140, .35);
  --r-xl: 24px; --r-lg: 20px; --r-md: 14px; --r-sm: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --sidebar: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e0c17; --surface: #17141f; --surface-2: #1d1a29; --surface-3: #26223a;
    --border: #2a2540; --border-strong: #3a3456; --text: #efecfa; --muted: #a29cbd; --faint: #6f6a8a;
    --primary: #9d85ff; --primary-ink: #b8a6ff; --on-primary: #12091f; --primary-ring: rgba(157, 133, 255, .35);
    --lime: #c6f432; --on-lime: #1d2700;
    --violet-soft: #2a2350; --violet-ink: #c9bcff; --lime-soft: #25300c; --lime-ink: #d4f56a;
    --sky-soft: #10293f; --sky-ink: #8ccaff; --peach-soft: #3a2316; --peach-ink: #ffb588;
    --pink-soft: #3b1629; --pink-ink: #ff9cc7; --mint-soft: #0f3224; --mint-ink: #7fe1b6;
    --danger: #ff5c8a; --warning: #ffb547; --success: #4fd6a3;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -14px rgba(0,0,0,.6); --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.7);
    color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0e0c17; --surface: #17141f; --surface-2: #1d1a29; --surface-3: #26223a;
  --border: #2a2540; --border-strong: #3a3456; --text: #efecfa; --muted: #a29cbd; --faint: #6f6a8a;
  --primary: #9d85ff; --primary-ink: #b8a6ff; --on-primary: #12091f; --primary-ring: rgba(157, 133, 255, .35);
  --violet-soft: #2a2350; --violet-ink: #c9bcff; --lime-soft: #25300c; --lime-ink: #d4f56a;
  --sky-soft: #10293f; --sky-ink: #8ccaff; --peach-soft: #3a2316; --peach-ink: #ffb588;
  --pink-soft: #3b1629; --pink-ink: #ff9cc7; --mint-soft: #0f3224; --mint-ink: #7fe1b6;
  --danger: #ff5c8a; --warning: #ffb547; --success: #4fd6a3;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -14px rgba(0,0,0,.6); --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.7);
  color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(22px, 2.6vw, 30px); }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
::selection { background: var(--lime); color: var(--on-lime); }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 8px; }
.icon { width: 18px; height: 18px; flex: none; }
.icon.lg { width: 22px; height: 22px; }
.icon.sm { width: 15px; height: 15px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ каркас */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 16px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--lime); color: var(--on-lime); box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.brand small { display: block; font: 600 11px/1 var(--font); color: var(--muted); letter-spacing: .02em; margin-top: 3px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--muted); font-weight: 650; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--violet-soft); color: var(--violet-ink); }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 750; padding: 1px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text); }
.nav a.active .count { background: var(--primary); color: var(--on-primary); }
.sidebar .cta { margin: 6px 0 4px; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-md); color: var(--text); }
.me:hover { background: var(--surface-2); text-decoration: none; }
.me b { display: block; font-size: 14px; line-height: 1.2; }
.me span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.search { position: relative; flex: 1 1 auto; max-width: 560px; }
.search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 64px 0 42px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; box-shadow: var(--shadow-sm); }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
kbd { font: 700 11px/1 var(--font); padding: 4px 7px; border-radius: 7px; border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--muted); background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.content { padding: 8px 32px 48px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 10px 0 22px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.mobile-top, .tabbar { display: none; }

/* ------------------------------------------------------------------ кнопки, поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 99px; border: 1px solid transparent; font: 700 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: transform .08s ease, background .15s, box-shadow .15s; text-decoration: none !important; color: var(--text); background: var(--surface-2); }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px -8px var(--primary); }
.btn.primary:hover { background: var(--primary-ink); }
:root[data-theme="dark"] .btn.primary:hover { background: #8a70ff; }
.btn.lime { background: var(--lime); color: var(--on-lime); box-shadow: inset 0 -3px 0 rgba(0,0,0,.1); }
.btn.lime:hover { filter: brightness(.96); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--pink-soft); color: var(--pink-ink); }
.btn.danger:hover { background: color-mix(in srgb, var(--pink-soft) 70%, var(--danger)); color: #fff; }
.btn.sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.lg { height: 52px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 42px; padding: 0; }
.btn.sm.icon-only { width: 34px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary-ink); cursor: pointer; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field .hint { font-size: 12.5px; color: var(--faint); }
.field .error, .error-text { font-size: 13px; color: var(--danger); font-weight: 650; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 15px/1.4 var(--font); transition: border .15s, box-shadow .15s; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input.invalid { border-color: var(--danger); }
.input.code { font: 700 22px/1 var(--mono); letter-spacing: .35em; text-align: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 500; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); }

/* ------------------------------------------------------------------ картки, bento */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 600; }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; }
.c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: 1 / -1; }
.tile { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px; min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; color: inherit; border: 1px solid transparent; transition: transform .15s ease, box-shadow .15s ease; }
a.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }
.tile .tile-ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.55); }
:root[data-theme="dark"] .tile .tile-ic { background: rgba(255,255,255,.06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile .tile-ic { background: rgba(255,255,255,.06); } }
.tile .big { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 4vw, 46px); line-height: 1; letter-spacing: -.03em; margin-top: 16px; }
.tile .foot { font-size: 13px; font-weight: 650; opacity: .85; margin-top: 8px; }
.tile.violet { background: var(--violet-soft); color: var(--violet-ink); }
.tile.lime { background: var(--lime-soft); color: var(--lime-ink); }
.tile.sky { background: var(--sky-soft); color: var(--sky-ink); }
.tile.peach { background: var(--peach-soft); color: var(--peach-ink); }
.tile.pink { background: var(--pink-soft); color: var(--pink-ink); }
.tile.mint { background: var(--mint-soft); color: var(--mint-ink); }
.tile.ink { background: #17132b; color: #f3f0ff; }
:root[data-theme="dark"] .tile.ink { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile.ink { background: var(--surface-3); } }
.tile.ink .muted { color: #b7b0d6; }
.tile .blob { position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%; background: currentColor; opacity: .07; pointer-events: none; }
.spark { display: flex; align-items: flex-end; gap: 5px; height: 46px; margin-top: 14px; }
.spark span { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--lime); min-height: 4px; opacity: .9; }
.spark span:last-child { background: #fff; }
:root[data-theme="dark"] .spark span:last-child { background: var(--primary); }

/* дроп-зона */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 26px 20px; border-radius: var(--r-xl); border: 2px dashed var(--border-strong); background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--surface-2) 70%, transparent) 14px 28px), var(--surface); cursor: pointer; transition: border-color .15s, background .15s; min-height: 150px; }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--violet-soft); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop .drop-ic { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--lime); color: var(--on-lime); }
.drop b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.drop .muted { font-size: 13px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; width: 100%; max-width: 260px; }
.progress span { display: block; height: 100%; background: var(--primary); width: 30%; animation: indet 1.1s ease-in-out infinite; border-radius: 99px; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(330%); } }

/* ------------------------------------------------------------------ бейджі, статуси */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 99px; font-size: 12.5px; font-weight: 750; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.violet { background: var(--violet-soft); color: var(--violet-ink); }
.pill.lime { background: var(--lime-soft); color: var(--lime-ink); }
.pill.sky { background: var(--sky-soft); color: var(--sky-ink); }
.pill.peach { background: var(--peach-soft); color: var(--peach-ink); }
.pill.pink { background: var(--pink-soft); color: var(--pink-ink); }
.pill.mint { background: var(--mint-soft); color: var(--mint-ink); }
.pill.solid { background: var(--lime); color: var(--on-lime); }
.pill.lg { height: 32px; padding: 0 14px; font-size: 13.5px; }
.marks { display: inline-flex; gap: 4px; }
.mark { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); }
.mark .icon { width: 15px; height: 15px; }
.mark.on.pay { background: var(--lime-soft); color: var(--lime-ink); }
.mark.on.recv { background: var(--sky-soft); color: var(--sky-ink); }
.mark.on.dn { background: var(--peach-soft); color: var(--peach-ink); }
.mark.on.medoc { background: var(--mint-soft); color: var(--mint-ink); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 700 13.5px/1 var(--font); cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--border-strong); }
.chip .n { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip.active .n { background: var(--lime); color: var(--on-lime); }

.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font: 700 13px/1 var(--display); flex: none; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
.avatar.violet { background: var(--violet-soft); color: var(--violet-ink); } .avatar.lime { background: var(--lime-soft); color: var(--lime-ink); }
.avatar.sky { background: var(--sky-soft); color: var(--sky-ink); } .avatar.peach { background: var(--peach-soft); color: var(--peach-ink); }
.avatar.pink { background: var(--pink-soft); color: var(--pink-ink); } .avatar.mint { background: var(--mint-soft); color: var(--mint-ink); }

/* ------------------------------------------------------------------ списки й таблиці */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--border); color: inherit; min-width: 0; }
.list-item:first-child { border-top: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .title { font-weight: 750; font-size: 15px; }
.list-item .meta { font-size: 13px; color: var(--muted); }
.list-item .amount { font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.inv-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table .r { text-align: right; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .empty-ic { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); }
.empty .empty-ic .icon { width: 28px; height: 28px; }
.empty b { display: block; color: var(--text); font-family: var(--display); font-weight: 600; margin-bottom: 4px; }

/* таймлайн історії */
.timeline { position: relative; display: flex; flex-direction: column; gap: 2px; }
.tl-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 8px 0; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 40px; bottom: -8px; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 11px; display: grid; place-items: center; }
.tl-dot .icon { width: 15px; height: 15px; }
.tl-dot.violet { background: var(--violet-soft); color: var(--violet-ink); } .tl-dot.lime { background: var(--lime-soft); color: var(--lime-ink); }
.tl-dot.sky { background: var(--sky-soft); color: var(--sky-ink); } .tl-dot.peach { background: var(--peach-soft); color: var(--peach-ink); }
.tl-dot.pink { background: var(--pink-soft); color: var(--pink-ink); } .tl-dot.mint { background: var(--mint-soft); color: var(--mint-ink); }
.tl-body b { font-weight: 750; }
.tl-body .meta { font-size: 12.5px; color: var(--muted); }
.src { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 750; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

/* ------------------------------------------------------------------ сторінка рахунку */
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.hero { border-radius: var(--r-xl); padding: 24px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero-top { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.hero h1 { font-size: clamp(24px, 3vw, 34px); }
.hero .supplier { margin-top: 6px; color: var(--muted); font-weight: 650; }
.hero .amount { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 3vw, 32px); white-space: nowrap; }
.hero .amount small { font: 700 14px var(--font); color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.step { border-radius: var(--r-lg); padding: 16px; background: var(--surface-2); border: 1px solid transparent; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.step-h { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.step-ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--faint); flex: none; }
.step .state { font-size: 13px; color: var(--muted); font-weight: 650; }
.step.done.pay { background: var(--lime-soft); color: var(--lime-ink); } .step.done.pay .step-ic { background: var(--lime); color: var(--on-lime); }
.step.done.recv { background: var(--sky-soft); color: var(--sky-ink); } .step.done.recv .step-ic { background: #4aa8ff; color: #fff; }
.step.done.dn { background: var(--peach-soft); color: var(--peach-ink); } .step.done.dn .step-ic { background: #ff9b5e; color: #fff; }
.step.done .state { color: inherit; opacity: .85; }
.step .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.step .acts .input { min-height: 34px; height: 34px; padding: 4px 10px; font-size: 13px; border-radius: 10px; width: auto; flex: 1 1 120px; }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 18px; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 650; }
.dl dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.viewer { border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.viewer iframe, .viewer img { width: 100%; border: 0; display: block; background: #fff; }
.viewer iframe { height: min(78vh, 900px); }
.viewer img { max-height: 78vh; object-fit: contain; }
.viewer .no-preview { padding: 40px; text-align: center; color: var(--muted); }
.files { display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.file:hover { border-color: var(--border-strong); }
.file.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.file .f-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.file b { display: block; font-size: 14px; }
.file .meta { font-size: 12px; color: var(--muted); }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 18px; border-radius: var(--r-lg); font-weight: 650; }
.banner.violet { background: var(--violet-soft); color: var(--violet-ink); }
.banner.peach { background: var(--peach-soft); color: var(--peach-ink); }
.banner.pink { background: var(--pink-soft); color: var(--pink-ink); }
.banner.lime { background: var(--lime-soft); color: var(--lime-ink); }
.banner.sky { background: var(--sky-soft); color: var(--sky-ink); }
.banner .btn { margin-left: auto; }

/* ------------------------------------------------------------------ сповіщення */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 650; animation: toast-in .22s ease; }
.toast .icon { margin-top: 2px; }
.toast.success .icon { color: var(--lime); } .toast.error .icon { color: #ff7aa2; } .toast.warning .icon { color: #ffc56b; }
.toast button { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 0; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }
.alert { padding: 12px 16px; border-radius: var(--r-md); font-weight: 650; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: var(--lime-soft); color: var(--lime-ink); } .alert.error { background: var(--pink-soft); color: var(--pink-ink); }
.alert.warning { background: var(--peach-soft); color: var(--peach-ink); } .alert.info { background: var(--sky-soft); color: var(--sky-ink); }

/* ------------------------------------------------------------------ вкладки, налаштування */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 99px; background: var(--surface-2); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 2px 8px -4px rgba(0,0,0,.15); }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.section-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.secret-box { font: 700 15px/1.6 var(--mono); letter-spacing: .08em; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font: 700 15px var(--mono); }
.codes span { padding: 8px 12px; background: var(--surface-2); border-radius: 10px; text-align: center; }
.qr { background: #fff; padding: 12px; border-radius: 16px; width: max-content; }
.qr svg { width: 180px; height: 180px; }
.health { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.health:first-of-type { border-top: 0; }
.health .s { width: 10px; height: 10px; border-radius: 50%; margin: auto; }
.s.ok { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 20%, transparent); }
.s.warn { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 20%, transparent); }
.s.fail { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }

/* пагінація */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 12px; display: inline-grid; place-items: center; font-weight: 750; color: var(--text); background: var(--surface-2); }
.pager a:hover { background: var(--surface-3); text-decoration: none; }
.pager .current { background: var(--text); color: var(--bg); }
.pager .disabled { opacity: .4; }

/* меню-«деталі» */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu .menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); background: none; border: 0; font: 650 14px var(--font); cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .danger { color: var(--danger); }

/* ------------------------------------------------------------------ вхід */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; background: #17132b; color: #f3f0ff; }
.auth-art h1 { font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: -.03em; max-width: 13ch; }
.auth-art h1 em { font-style: normal; color: var(--lime); }
.auth-art p { color: #b7b0d6; max-width: 44ch; font-size: 16px; }
.auth-art .brand { color: #fff; padding: 0; }
.floaty { position: absolute; border-radius: 22px; padding: 14px 16px; font-weight: 750; font-size: 14px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); display: flex; align-items: center; gap: 10px; }
.floaty .icon { width: 20px; height: 20px; }
.f1 { background: var(--lime); color: var(--on-lime); right: 9%; top: 22%; transform: rotate(4deg); }
.f2 { background: #ece7ff; color: #4b2fd6; right: 22%; top: 44%; transform: rotate(-5deg); }
.f3 { background: #ffe8da; color: #9f420d; right: 6%; top: 62%; transform: rotate(3deg); }
.auth-art .shape { position: absolute; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 46% 54% 41% 59% / 52% 39% 61% 48%; background: radial-gradient(circle at 30% 30%, #7c5cff, #3f22c9 70%); opacity: .55; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-card .stack > * + * { margin-top: 16px; }
.auth-foot { margin-top: 26px; font-size: 13px; color: var(--faint); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--faint); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.pw button:hover { background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------------ адаптив */
@media (max-width: 1180px) {
  .invoice-layout { grid-template-columns: minmax(0, 1fr); }
  .c-3 { grid-column: span 6; } .c-4, .c-5, .c-7, .c-8 { grid-column: span 12; } .c-6 { grid-column: span 6; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .topbar { display: none; }
  .mobile-top { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .mobile-top .brand { padding: 0; font-size: 16px; }
  .mobile-top .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .mobile-top .search { max-width: none; }
  .mobile-top .search input { height: 40px; padding-right: 14px; }
  .mobile-top .search kbd { display: none; }
  .content { padding: 4px 16px 110px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40; padding: 6px; border-radius: 24px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 18px; color: var(--muted); font-size: 11px; font-weight: 750; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--violet-ink); background: var(--violet-soft); }
  .tabbar a.plus .icon { width: 26px; height: 26px; padding: 4px; border-radius: 12px; background: var(--lime); color: var(--on-lime); box-sizing: content-box; }
  .c-3, .c-6 { grid-column: span 12; }
  .bento { gap: 12px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 28px 22px 34px; min-height: 0; }
  .auth-art .floaty, .auth-art .art-text p { display: none; }
  .auth-art h1 { font-size: 28px; margin-top: 18px; }
  .auth-art .shape { width: 300px; height: 300px; right: -120px; bottom: -160px; }
  .table .hide-sm { display: none; }
  .page-head { margin-top: 6px; }
  .card { padding: 18px; }
  .toasts { left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); max-width: none; }
  .viewer iframe { height: 60vh; }
}
@media (max-width: 520px) {
  .c-3 { grid-column: span 6; }
  .tile { min-height: 128px; padding: 16px; border-radius: 20px; }
  .tile .big { font-size: 32px; }
  .list-item { padding: 12px 14px; gap: 10px; }
  .list-item .hide-xs { display: none; }
  .hero { padding: 18px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .codes { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ Telegram Mini App */
body.tg .sidebar, body.tg .topbar { display: none; }
body.tg .app { grid-template-columns: minmax(0, 1fr); }
body.tg .mobile-top { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); }
body.tg .mobile-top .brand { display: none; }
body.tg .mobile-top .search { max-width: none; }
body.tg .mobile-top .search input { height: 40px; padding-right: 14px; }
body.tg .mobile-top .search kbd { display: none; }
body.tg .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 40; padding: 6px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
body.tg .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 16px; color: var(--muted); font-size: 11px; font-weight: 750; }
body.tg .tabbar a.active { color: var(--violet-ink); background: var(--violet-soft); }
body.tg .tabbar a.plus .icon { width: 26px; height: 26px; padding: 4px; border-radius: 12px; background: var(--lime); color: var(--on-lime); box-sizing: content-box; }
body.tg .content { padding: 4px 14px 104px; }
body.tg .hide-tg { display: none !important; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .mobile-top, .tabbar, .toasts, .btn, .acts { display: none !important; } .app { display: block; } .card, .hero { box-shadow: none; } }
