/* Учёт — премиальный редизайн (Figma «Учёт · Премиальный редизайн»): графит, глубокий зелёный, кремовый фон,
   заголовки Lora, текст Inter. Подключается последним и переопределяет токены и вид основных блоков. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/lora-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/lora-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #f3f1ec; --surface: #fdfcf9; --surface2: #f3f1ec; --surface3: #eae7df; --text: #202b2b; --muted: #7a807b;
  --border: #dedfd7; --border-strong: #cdcfc5;
  --accent: #386a5d; --accent-text: #ffffff; --accent-soft: #e3ece8;
  --pos: #386a5d; --pos-soft: #e3ece8; --neg: #a26151; --neg-soft: #f5e7e2;
  --warn: #8a6d3b; --warn-soft: #f3ecdd; --gold: #a58a59;
  --ink: #20292a; --ink-2: #344442; --ink-text: #fdfcf9; --ink-muted: #a7aeaa;
  --shadow: none; --shadow-lg: 0 24px 60px rgba(20, 28, 27, .22);
  --radius: 12px; --radius-sm: 7px; --side-w: 232px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Lora", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161c1c; --surface: #1d2525; --surface2: #232c2b; --surface3: #2b3534; --text: #ecebe5; --muted: #9aa29d;
    --border: #2f3a38; --border-strong: #3e4b48;
    --accent: #6fa595; --accent-text: #0f1716; --accent-soft: #233631;
    --pos: #7fb7a5; --pos-soft: #1f322c; --neg: #d79a89; --neg-soft: #3a2621;
    --warn: #d8bd85; --warn-soft: #352d1d; --gold: #c9ad78;
    --ink: #111717; --ink-2: #26302f; --ink-text: #f4f2ec; --ink-muted: #9aa29d;
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  }
}

body { font-size: 13px; }
h1, .modal-head h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: 36px; line-height: 1.2; }
h2 { font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
.eyebrow, .kpi .label, .hero-label, .chip-l, .tbl th, .erow.head, .side .navgroup, .gs-gtitle {
  font-size: 10px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow { margin: 0 0 6px; }
a { color: var(--accent); }

/* ---------- знак ---------- */
.mark, .mark.big {
  background: var(--accent); color: #fdfcf9; font-family: var(--serif); font-weight: 400; font-size: 24px;
  border-radius: 8px; box-shadow: none; text-transform: lowercase; line-height: 1; padding-bottom: 3px;
}
.mark { width: 36px; height: 36px; }

/* ---------- боковая панель ---------- */
.side { background: var(--ink); border-right: 0; color: var(--ink-text); padding: 24px 16px 20px; gap: 1px; }
.side .brand { color: var(--ink-text); padding: 0 0 12px; gap: 12px; }
.side .brand .brand-name { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.side .brand small { color: var(--ink-muted); font-size: 10px; }
a.brand:hover { background: transparent; }
.side-toggle { background: transparent; border: 0; color: var(--ink-muted); top: 30px; right: 8px; }
.side-toggle:hover { background: var(--ink-2); color: var(--ink-text); }
.side .gs-box { padding: 0 0 10px; }
.side input[type=search] { background-color: var(--ink-2); border-color: transparent; color: var(--ink-text); border-radius: var(--radius-sm); min-height: 38px; font-size: 12px; }
.side input[type=search]::placeholder { color: var(--ink-muted); opacity: 1; }
.side input[type=search]:focus { background-color: var(--ink-2); border-color: var(--accent); box-shadow: none; }
.side-add { min-height: 42px; margin: 0 0 12px; font-size: 12px; }
.side .navgroup { color: var(--ink-muted); font-size: 9px; margin: 10px 0 4px; }
.navlink { color: var(--ink-muted); min-height: 30px; padding: 6px 12px; border-radius: var(--radius-sm); gap: 12px; font-size: 12px; }
.navlink .ico { color: var(--ink-muted); width: 17px; height: 17px; stroke-width: 1.6; }
.side .navlink:hover { background: color-mix(in srgb, var(--ink-2) 60%, transparent); color: var(--ink-text); }
.side .navlink.active { background: var(--ink-2); color: var(--ink-text); font-weight: 600; }
.side .navlink.active .ico { color: var(--ink-text); }
.side .count { background: var(--ink-2); color: var(--ink-text); font-weight: 500; font-size: 10px; min-width: 19px; line-height: 19px; }
.side .navlink.active .count { background: var(--accent); }
.side .who-row { border-top: 1px solid var(--ink-2); padding-top: 12px; }
.side .who { color: var(--ink-muted); font-size: 10px; }
.side .who-name { color: var(--ink-text); font-size: 11px; font-weight: 400; }
.side .ava { background: var(--ink-2); color: var(--ink-text); width: 30px; height: 30px; font-size: 10px; font-weight: 500; }
a.who:hover { background: color-mix(in srgb, var(--ink-2) 60%, transparent); }
.side-logout { color: var(--ink-muted); }
/* обычные (не боковые) списки ссылок — например «Ещё» на телефоне */
.morelist .navlink { color: var(--text); font-size: 14px; }
.morelist .navlink .ico { color: var(--muted); }

/* ---------- верхняя панель (ПК) ---------- */
.main { padding: 32px 40px 56px; max-width: 1280px; }
@media (min-width: 900px) {
  .topbar {
    display: flex; align-items: center; gap: 22px; min-height: 80px; padding: 0 40px; border-bottom: 1px solid var(--border);
    background: var(--bg); position: sticky; top: 0; z-index: 20;
  }
  .topbar .mark, .topbar .top-brand, .topbar .gs-topbtn, .topbar .top-ava { display: none; }
  .top-path { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted); }
  .top-path a { color: var(--muted); }
  .top-path .ttl { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-date { font-size: 11px; color: var(--muted); white-space: nowrap; }
  .topbar .top-chat {
    display: inline-grid; place-items: center; position: relative; width: 32px; height: 32px; color: var(--text); border-radius: 999px;
    text-decoration: none !important;
  }
  .topbar .top-chat:hover { background: var(--surface3); }
  .topbar .top-chat .ico { width: 17px; height: 17px; stroke-width: 1.6; }
  .topbar .top-chat .count { position: absolute; top: -3px; right: -5px; margin: 0; min-width: 17px; line-height: 17px; font-size: 10px; padding: 0 4px; }
}

/* ---------- заголовок страницы ---------- */
.pagehead { margin-bottom: 24px; gap: 10px; align-items: flex-end; }
.pagehead h1 { line-height: 1.15; }
.crumbs { font-size: 12px; margin-bottom: 4px; }

/* ---------- кнопки ---------- */
.btn { border-radius: var(--radius-sm); min-height: 40px; padding: 8px 16px; font-size: 12px; font-weight: 500; border-color: var(--border); background: var(--surface); }
.btn:hover { background: var(--surface3); }
.btn.primary { font-weight: 600; min-height: 42px; }
.btn.primary:hover { filter: none; background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.small { min-height: 32px; font-size: 12px; padding: 4px 12px; }
.btn.link { color: var(--accent); font-weight: 500; }

/* ---------- карточки ---------- */
.card { border-color: var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: none; }
.card > h2, .card > .cardhead { margin-bottom: 14px; }
.cardhead a, .block > .cardhead a { font-size: 12px; font-weight: 500; }
.block { margin-bottom: 24px; }
.block > .cardhead { margin-bottom: 14px; padding: 0; }
.grid { gap: 12px; }
.kpi { padding: 18px; }
.kpi .value { font-size: 22px; font-weight: 500; letter-spacing: -.02em; margin-top: 8px; }
.kpi .sub { font-size: 11px; }

/* главный итог */
.hero { background: var(--ink); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; }
.hero::after { display: none; }
.hero-value { font-weight: 500; font-size: clamp(30px, 6vw, 40px); letter-spacing: -.03em; margin: 12px 0 14px; }
.hero-value .money .dec, .hero-value .money .cur { color: var(--ink-muted); opacity: 1; font-size: .62em; }
.hero-rates, .hero-sub { font-size: 10px; }
.hero a { color: #cfe0d8; }
.chip { background: transparent; border: 0; border-bottom: 1px solid var(--ink-2); border-radius: 0; padding: 11px 0; font-size: 16px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.chip-l { font-size: 10px; color: var(--ink-muted); }
@media (min-width: 1100px) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); column-gap: 48px; align-items: center; }
  .hero > * { grid-column: 1; }
  .hero > .hero-cur { grid-column: 2; grid-row: 1 / span 4; flex-direction: column; flex-wrap: nowrap; gap: 0; align-self: center; }
}
.hero-cur { flex-direction: column; gap: 0; }

/* плитки касс */
.tiles { gap: 12px; }
.tile { border-radius: var(--radius); padding: 18px; gap: 18px; }
.tile:hover { border-color: var(--border-strong); }
.tile-ic, .tile-ic.k-cash, .tile-ic.k-card, .tile-ic.k-bank { width: 30px; height: 32px; border-radius: 6px; background: var(--surface2); color: var(--accent); }
.tile-ic .ico { width: 17px; height: 17px; stroke-width: 1.6; }
.tile-name { font-size: 11px; font-weight: 500; }
.tile-kind { font-size: 10px; }
.tile-bal { font-size: 17px; font-weight: 600; }

/* ---------- значки, уведомления ---------- */
.badge { font-size: 11px; padding: 2px 9px; line-height: 18px; background: var(--surface2); color: var(--muted); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }
.notice { border-radius: var(--radius-sm); padding: 13px 18px; font-size: 12px; }
.notice.warn { background: var(--warn-soft); color: var(--text); }
.notice-link { font-weight: 500; color: var(--text); min-height: 46px; padding-top: 0; padding-bottom: 0; }
.notice-link .go { color: var(--gold); font-weight: 600; }

/* ---------- формы ---------- */
.field > label, .field > .lbl { font-size: 11px; font-weight: 400; margin-bottom: 7px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  min-height: 43px; border-color: var(--border); border-radius: var(--radius-sm); background-color: var(--surface); font-size: 12px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.seg { background: var(--surface3); border: 0; border-radius: 9px; padding: 3px; gap: 2px; }
.seg label { font-size: 11px; padding: 7px 12px; border-radius: 7px; color: var(--muted); }
.seg label.on { background: var(--surface); color: var(--text); font-weight: 600; border-color: transparent; box-shadow: 0 1px 2px rgba(20, 28, 27, .08); }
.tabs { background: var(--surface3); border-radius: 9px; padding: 3px; }
.tabs a { font-size: 12px; border-radius: 7px; padding: 7px 14px; }
.tabs a.active { box-shadow: 0 1px 2px rgba(20, 28, 27, .08); font-weight: 600; }

/* ---------- таблицы, лента ---------- */
.tbl th { font-size: 9px; font-weight: 400; padding: 8px 12px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 12px; font-size: 12px; }
.tbl td.first { font-weight: 500; }
.tbl tbody tr.click:hover, .erow:hover { background: var(--surface2); }
.erow { padding: 12px 24px; }
.erows { margin: 0 -24px; }
.erow .e-title { font-weight: 500; font-size: 12px; }
.erow .e-amt { font-weight: 600; font-size: 13px; }
.erow.k-out { box-shadow: inset 3px 0 0 var(--neg); }

/* ---------- окна ---------- */
.overlay { background: rgba(20, 28, 27, .55); }
.modal { border-radius: 14px; border-color: var(--border); }
.modal-head { padding: 22px 24px 12px; }
.modal-head h2 { font-size: 24px; }
.modal-body { padding: 6px 24px 16px; }
.modal-foot { padding: 14px 24px 18px; }
.toast { background: var(--ink); border-radius: var(--radius-sm); }
.chat-fab { background: var(--accent); }

/* ---------- вход ---------- */
.authwrap { padding: 0; align-items: stretch; justify-content: stretch; display: grid; grid-template-columns: minmax(0, 650fr) minmax(0, 790fr); }
.auth-aside {
  background: var(--ink); color: var(--ink-text); padding: 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
}
.auth-aside small { color: var(--ink-muted); font-size: 11px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .mark { width: 36px; height: 36px; }
.auth-name { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.auth-brand small { display: block; font-size: 10px; }
.auth-motto i { display: block; width: 48px; height: 2px; background: var(--gold); margin-bottom: 28px; }
.auth-motto p { color: var(--ink-muted); font-size: 15px; line-height: 1.7; max-width: 380px; margin: 0; }
.auth-motto .auth-big { font-family: var(--serif); font-size: clamp(32px, 3.4vw, 48px); line-height: 1.25; color: var(--ink-text); margin-bottom: 28px; max-width: none; }
.authbox { max-width: none; width: 100%; padding: 64px clamp(24px, 8.4vw, 120px); align-self: center; }
.authbox .mark.big { display: none; }
.authbox h1 { font-size: 36px; margin-bottom: 12px; }
.authbox > .muted { font-size: 12px; margin-bottom: 32px; }
.authbox .card { background: none; border: 0; padding: 0; margin: 0; }
.authbox .field { margin-bottom: 24px; }
.authbox .btn.primary { min-height: 52px; justify-content: space-between; padding: 0 20px; margin-top: 8px; }
.authbox .btn.primary::after {
  content: ""; width: 17px; height: 17px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.auth-safe { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 8px; }
.auth-safe .ico { width: 15px; height: 15px; }

/* ---------- телефон ---------- */
@media (max-width: 899px) {
  .authwrap { display: block; }
  .auth-aside { display: none; }
  .authbox { padding: 48px 20px; max-width: 480px; margin: 0 auto; }
  .authbox .mark.big { display: grid; width: 44px; height: 44px; margin-bottom: 24px; }
  .authbox h1 { font-size: 30px; }

  .topbar {
    background: var(--ink); color: var(--ink-text); border-bottom: 0; min-height: 64px; backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: 12px 20px; padding-top: calc(12px + env(safe-area-inset-top));
  }
  .top-path, .top-date { display: none; }
  .top-brand { flex: 1 1 auto; min-width: 0; font-family: var(--serif); font-size: 22px; color: var(--ink-text); text-decoration: none !important; }
  .topbar .mark { width: 32px; height: 32px; font-size: 22px; }
  .gs-topbtn, .top-chat { background: transparent !important; border: 0 !important; color: var(--ink-text) !important; }
  .top-ava { background: var(--ink-2); color: var(--ink-text); width: 30px; height: 30px; font-size: 10px; font-weight: 500; }
  .main { padding: 24px 20px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); }
  .pagehead h1 { display: block; font-size: 32px; }
  .pagehead:not(:has(> :not(h1))) { display: flex; }
  .pagehead { margin-bottom: 20px; }
  .card { padding: 18px; border-radius: var(--radius); }
  .hero { padding: 22px; border-radius: var(--radius); }
  .tile { padding: 14px 16px; }
  .tile-bal { font-size: 14px; flex: 0 0 auto; max-width: 62%; }
  .tile-name { white-space: normal; font-size: 12px; }
  .bottom { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bottom .bi { font-size: 10px; }
  .bottom .bi .ico { width: 22px; height: 22px; stroke-width: 1.4; }
  .bottom .bi.active { color: var(--accent); font-weight: 500; }
  .bottom .plus { margin-top: 0; color: var(--muted); font-size: 10px; font-weight: 400; gap: 3px; }
  .bottom .plus .ico { width: 22px; height: 22px; padding: 0; border-radius: 0; background: none; color: var(--muted); box-shadow: none; stroke-width: 1.4; }
  .modal { border-radius: 16px 16px 0 0; }
  .erows { margin: 0 -18px; }
  .erow { padding: 12px 18px; }
  h1 { font-size: 30px; }
}

/* ---------- логотип (картинка вместо буквы) ---------- */
.mark, .mark.big { background: url(logo.png) center / cover no-repeat; color: transparent; border-radius: 9px; padding: 0; }
.authbox .auth-logo { display: block; width: 168px; height: auto; margin-bottom: 28px; }
@media (max-width: 899px) { .authbox .auth-logo { width: 132px; margin-bottom: 20px; } }
