/* ================= Темы ================= */
:root, [data-theme="gold"] {
  --bg: #0a0a0a; --bg2: #101010;
  --surface: #161514; --surface2: #1e1c1a; --surface3: #282521;
  --border: #2c2823; --border2: #3a342c;
  --text: #f3eee4; --muted: #a39a8a; --faint: #6c6458;
  --accent: #d4af37; --accent2: #f1d27a; --accent3: #a8841f;
  --accent-soft: rgba(212, 175, 55, .13); --on-accent: #1a1200;
  --glow: rgba(212, 175, 55, .08); --glow-strong: rgba(212, 175, 55, .45);
  --topbar: rgba(16, 16, 16, .88); --hover: rgba(255, 255, 255, .03);
  --green: #22c55e; --green2: #16a34a; --red: #ef4444; --red-soft: rgba(239, 68, 68, .12);
  --blue: #60a5fa; --warn: #f59e0b;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --scheme: dark; --blur: none;
}
[data-theme="light"] {
  --bg: #eef1f6; --bg2: #ffffff;
  --surface: #ffffff; --surface2: #f2f5f9; --surface3: #e6ebf2;
  --border: #e2e7ee; --border2: #d2d9e3;
  --text: #121826; --muted: #5b6676; --faint: #97a1af;
  --accent: #f59e0b; --accent2: #fbbf24; --accent3: #d97706;
  --accent-soft: rgba(245, 158, 11, .14); --on-accent: #2a1800;
  --glow: rgba(245, 158, 11, .10); --glow-strong: rgba(245, 158, 11, .35);
  --topbar: rgba(255, 255, 255, .86); --hover: rgba(0, 0, 0, .03);
  --green: #16a34a; --green2: #15803d; --red: #dc2626; --red-soft: rgba(220, 38, 38, .10);
  --blue: #2563eb; --warn: #d97706;
  --shadow: 0 10px 30px rgba(15, 23, 42, .10);
  --scheme: light; --blur: none;
}
[data-theme="violet"] {
  --bg: #0b0914; --bg2: #100d1c;
  --surface: #15112a; --surface2: #1d1836; --surface3: #272145;
  --border: #29234a; --border2: #3a3263;
  --text: #efebff; --muted: #9f97c4; --faint: #665e8f;
  --accent: #8b5cf6; --accent2: #b197fc; --accent3: #6d28d9;
  --accent-soft: rgba(139, 92, 246, .16); --on-accent: #fff;
  --glow: rgba(139, 92, 246, .12); --glow-strong: rgba(177, 151, 252, .5);
  --topbar: rgba(16, 13, 28, .85); --hover: rgba(255, 255, 255, .03);
  --blue: #60a5fa;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --scheme: dark; --blur: none;
}
[data-theme="teal"] {
  --bg: #061013; --bg2: #09161a;
  --surface: #0e1e23; --surface2: #14292f; --surface3: #1b353c;
  --border: #1c3940; --border2: #294c55;
  --text: #e5f6f6; --muted: #8db0b4; --faint: #587a7f;
  --accent: #14b8a6; --accent2: #5eead4; --accent3: #0f766e;
  --accent-soft: rgba(20, 184, 166, .15); --on-accent: #022420;
  --glow: rgba(20, 184, 166, .10); --glow-strong: rgba(94, 234, 212, .45);
  --topbar: rgba(9, 22, 26, .85); --hover: rgba(255, 255, 255, .03);
  --blue: #38bdf8;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --scheme: dark; --blur: none;
}
[data-theme="graphite"] {
  --bg: #0d0d0f; --bg2: #131315;
  --surface: #18181b; --surface2: #202024; --surface3: #29292e;
  --border: #29292e; --border2: #37373d;
  --text: #f4f4f5; --muted: #a1a1aa; --faint: #6b6b73;
  --accent: #e4e4e7; --accent2: #ffffff; --accent3: #a1a1aa;
  --accent-soft: rgba(228, 228, 231, .10); --on-accent: #111113;
  --glow: rgba(255, 255, 255, .04); --glow-strong: rgba(255, 255, 255, .3);
  --topbar: rgba(19, 19, 21, .86); --hover: rgba(255, 255, 255, .03);
  --blue: #93c5fd;
  --shadow: 0 12px 34px rgba(0, 0, 0, .45);
  --scheme: dark; --blur: none;
}
[data-theme="ocean"] {
  --bg: #050b18; --bg2: #081122;
  --surface: #0c1830; --surface2: #11203d; --surface3: #172a4d;
  --border: #1a2c50; --border2: #243b66;
  --text: #e8f0ff; --muted: #8ea3c7; --faint: #566b91;
  --accent: #3b82f6; --accent2: #60a5fa; --accent3: #1d4ed8;
  --accent-soft: rgba(59, 130, 246, .16); --on-accent: #fff;
  --glow: rgba(59, 130, 246, .13); --glow-strong: rgba(96, 165, 250, .5);
  --topbar: rgba(8, 17, 34, .85); --hover: rgba(255, 255, 255, .03);
  --blue: #22d3ee;
  --shadow: 0 12px 34px rgba(0, 0, 0, .5);
  --scheme: dark;
}
[data-theme="sunset"] {
  --bg: #140b0e; --bg2: #1a0f13;
  --surface: #22131a; --surface2: #2b1820; --surface3: #36202a;
  --border: #3a222c; --border2: #4d2d3a;
  --text: #fff1f0; --muted: #c4a1a6; --faint: #85636a;
  --accent: #fb7185; --accent2: #fdba74; --accent3: #e11d48;
  --accent-soft: rgba(251, 113, 133, .15); --on-accent: #2a0610;
  --glow: rgba(251, 146, 60, .13); --glow-strong: rgba(251, 113, 133, .5);
  --topbar: rgba(26, 15, 19, .85); --hover: rgba(255, 255, 255, .03);
  --blue: #fdba74; --red: #f43f5e;
  --shadow: 0 12px 34px rgba(0, 0, 0, .5);
  --scheme: dark;
}
[data-theme="latte"] {
  --bg: #f4efe9; --bg2: #fffdfa;
  --surface: #fffdfa; --surface2: #f6f0e8; --surface3: #ece3d7;
  --border: #e8ded1; --border2: #d9ccbb;
  --text: #2b2118; --muted: #7a6a5a; --faint: #ad9c8a;
  --accent: #a0673a; --accent2: #c08457; --accent3: #7c4a24;
  --accent-soft: rgba(160, 103, 58, .13); --on-accent: #fff;
  --glow: rgba(192, 132, 87, .14); --glow-strong: rgba(160, 103, 58, .35);
  --topbar: rgba(255, 253, 250, .86); --hover: rgba(0, 0, 0, .03);
  --green: #15803d; --green2: #166534; --red: #dc2626; --red-soft: rgba(220, 38, 38, .10);
  --blue: #2563eb; --warn: #b45309;
  --shadow: 0 10px 30px rgba(60, 40, 20, .10);
  --scheme: light;
}
:root { --radius: 14px; }

/* ================= База ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 85% -10%, var(--glow), transparent 60%), var(--bg);
  color: var(--text);
  font-size: 15px;
  overflow: hidden;
  user-select: none;
  transition: background-color .3s, color .3s;
}
input, button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
input, select { user-select: text; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }


/* ================= Заставка ================= */
#splash {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, var(--glow), transparent 55%), var(--bg);
  transition: opacity .6s ease, visibility .6s;
}
#splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; }
.splash-drop { width: 96px; height: 96px; animation: drop 1.1s cubic-bezier(.2, .9, .3, 1.3) both; filter: drop-shadow(0 10px 30px var(--glow-strong)); }
.splash-drop path { fill: var(--accent); }
.splash-drop .shine { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; opacity: .7; }
.splash-title { font-size: 84px; font-weight: 800; letter-spacing: 10px; margin-top: 18px; animation: rise .9s .35s ease both; }
.splash-title span { color: var(--text); }
.splash-title b { background: linear-gradient(180deg, var(--accent2), var(--accent) 60%, var(--accent3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.splash-sub { color: var(--muted); letter-spacing: 8px; font-size: 13px; margin-top: 6px; animation: rise .9s .6s ease both; }
.splash-bar { width: 220px; height: 3px; background: var(--surface2); border-radius: 3px; margin: 34px auto 0; overflow: hidden; animation: rise .6s .8s ease both; }
.splash-bar i { display: block; height: 100%; width: 0; background: var(--accent); animation: load 1.5s .9s ease forwards; }
@keyframes drop { from { transform: translateY(-60px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes load { to { width: 100%; } }

/* ================= Логотип ================= */
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: 3px; font-size: 20px; white-space: nowrap; }
.logo svg { width: 26px; height: 26px; }
.logo svg path { fill: var(--accent); }
.logo b { color: var(--accent); }
.logo.big { font-size: 34px; letter-spacing: 5px; gap: 12px; }
.logo.big svg { width: 40px; height: 40px; }

/* ================= Шапка ================= */
.topbar {
  height: 64px; display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--topbar); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: relative; z-index: 10;
}
.burger { width: 42px; height: 42px; border-radius: 10px; display: grid; place-content: center; gap: 5px; transition: background .15s; }
.burger:hover { background: var(--surface2); }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; }
.crumb { color: var(--muted); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.crumb::before { content: ""; width: 1px; height: 22px; background: var(--border2); }
.clock { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.25; font-size: 13px; }
.clock b { color: var(--text); font-size: 17px; font-weight: 600; }

/* ================= Меню ================= */
.drawer-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transition: .25s; z-index: 40; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; z-index: 50;
  background: var(--bg2); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform .28s cubic-bezier(.3, .8, .3, 1);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
body.menu-open .drawer { transform: none; }
body.menu-open .drawer-bg { opacity: 1; visibility: visible; }
.drawer-head { padding: 26px 24px; border-bottom: 1px solid var(--border); position: relative; }
.drawer-head .logo { font-size: 26px; }
.drawer-items { padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: 11px; color: var(--muted); font-size: 15.5px; text-align: left; transition: .15s; }
.nav-item svg { width: 21px; height: 21px; flex: none; }
.nav-item .n { width: 22px; height: 22px; border-radius: 6px; background: var(--surface2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--faint); flex: none; }
.nav-item .lock { margin-left: auto; width: 15px; height: 15px; opacity: .6; }
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active .n { background: var(--accent); color: var(--on-accent); }
[data-theme="graphite"] .nav-item.active { color: var(--text); }
.drawer-foot { padding: 18px 24px; color: var(--faint); font-size: 12px; letter-spacing: 2px; border-top: 1px solid var(--border); }

/* ================= Контент ================= */
main { height: calc(100% - 64px); overflow-y: auto; padding: 28px 34px 60px; position: relative; z-index: 1; }
.page { max-width: 1280px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: .2px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head p b { color: var(--accent); font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.watermark { position: fixed; right: 26px; bottom: 14px; font-weight: 800; letter-spacing: 4px; font-size: 12px; color: var(--faint); opacity: .5; pointer-events: none; z-index: 2; }

/* Поля */
.inp { width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--border2); outline: none; transition: border-color .15s, box-shadow .15s; }
.inp::placeholder { color: var(--faint); }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp:disabled { opacity: .45; }

/* Кнопки */
.btn { height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .15s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent2); }
.btn.ghost { border: 1px dashed var(--border2); color: var(--muted); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.soft { background: var(--surface2); border: 1px solid var(--border2); }
.btn.soft:hover { background: var(--surface3); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.icon-btn { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--faint); transition: .15s; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }

/* ================= Продажа ================= */
.sale-card { padding: 8px 22px 22px; }
.sale-grid { display: grid; grid-template-columns: 44px 190px 1fr 120px 170px 44px; gap: 14px; align-items: center; }
.sale-grid.head { padding: 14px 0 10px; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.sale-row { padding: 12px 0; border-bottom: 1px solid var(--border); animation: fade .2s ease; align-items: start; }
.sale-row.open { position: relative; z-index: 20; }
.sale-row .no { width: 34px; height: 46px; display: grid; place-items: center; color: var(--faint); font-weight: 700; }
.price-wrap { position: relative; }
.price-wrap .inp { font-size: 18px; font-weight: 600; padding-right: 50px; }
.price-wrap .cur { position: absolute; right: 14px; top: 13px; color: var(--faint); font-size: 14px; pointer-events: none; }
.prod-info { font-size: 12.5px; color: var(--muted); margin-top: 7px; min-height: 17px; display: flex; gap: 12px; flex-wrap: wrap; }
.prod-info .tag { color: var(--accent); }
.prod-info .warn { color: var(--red); }
.prod-info .ok { color: var(--green); }
.sum-cell { height: 46px; display: flex; align-items: center; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sale-row .icon-btn { margin-top: 4px; }
.add-row { margin-top: 16px; width: 100%; height: 50px; }

/* Поиск товара */
.combo { position: relative; }
.combo-field { position: relative; }
.combo-field svg { position: absolute; left: 14px; top: 14px; width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.combo-field .inp { padding-left: 42px; font-weight: 500; }
.combo-list {
  display: none; position: absolute; left: 0; right: 0; top: 52px; z-index: 30;
  max-height: 360px; overflow-y: auto; padding: 6px;
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 12px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0, 0, 0, .05);
  animation: pop .14s ease;
}
.sale-row.open .combo-list { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.combo-head { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); padding: 6px 10px 8px; }
.combo-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; cursor: pointer; transition: background .1s; }
.combo-item:hover, .combo-item.act { background: var(--accent-soft); }
.combo-item.sel .ci-main b { color: var(--accent); }
.combo-item.out { opacity: .45; cursor: not-allowed; }
.combo-item.out:hover { background: transparent; }
.ci-main { flex: 1; min-width: 0; }
.ci-main b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-main span { font-size: 12.5px; color: var(--muted); }
.ci-side { text-align: right; flex: none; }
.ci-side b { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.ci-side span { font-size: 12px; color: var(--green); }
.ci-side span.low { color: var(--warn); }
.ci-side span.none { color: var(--red); }
.combo-empty { padding: 18px; text-align: center; color: var(--muted); }

.sale-footer { margin-top: 20px; display: flex; align-items: center; gap: 24px; padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.total span { display: block; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; }
.total b { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.total small { color: var(--muted); font-size: 13px; margin-left: 10px; }
.btn.sold {
  margin-left: auto; height: 68px; padding: 0 56px; border-radius: 14px;
  background: linear-gradient(180deg, #2bd566, #16a34a); color: #fff;
  font-size: 22px; font-weight: 800; letter-spacing: 3px;
  box-shadow: 0 10px 28px rgba(34, 197, 94, .3);
}
.btn.sold svg { width: 26px; height: 26px; stroke-width: 2.6; }
.btn.sold:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.sold:active { transform: translateY(1px); }

.today { margin-top: 26px; }
.today h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.today-list { display: flex; flex-direction: column; gap: 8px; }
.today-item { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.today-item time { color: var(--faint); font-variant-numeric: tabular-nums; width: 44px; }
.today-item .names { flex: 1; color: var(--muted); }
.today-item .names b { color: var(--text); font-weight: 600; }
.today-item .s { font-weight: 700; }

/* ================= Остатки ================= */
.stock-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.cat-list { padding: 8px; position: sticky; top: 0; display: flex; flex-direction: column; }
.cat-scroll { display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 300px); overflow-y: auto; }
.add-cat { margin-top: 8px; height: 42px; font-size: 14px; }
.cat { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; text-align: left; color: var(--muted); transition: .15s; flex: none; }
.cat:hover { background: var(--surface2); color: var(--text); }
.cat.active { background: var(--accent-soft); color: var(--accent); }
[data-theme="graphite"] .cat.active { color: var(--text); }
.cat-num { min-width: 26px; height: 26px; padding: 0 4px; border-radius: 7px; background: var(--surface2); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.cat.active .cat-num { background: var(--accent); color: var(--on-accent); }
.cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { font-size: 12px; color: var(--faint); }
.stock-card { padding: 20px 22px 22px; }
.cat-title { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cat-title input { flex: 1; background: transparent; border: 1px solid transparent; border-radius: 10px; font-size: 22px; font-weight: 700; padding: 6px 10px; margin-left: -10px; outline: none; }
.cat-title input:hover { border-color: var(--border2); }
.cat-title input:focus { border-color: var(--accent); background: var(--bg2); }
.cat-title .hint { color: var(--faint); font-size: 13px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; font-weight: 600; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.stock-tbl td:first-child { color: var(--faint); width: 34px; text-align: center; font-weight: 600; }
.stock-tbl .inp { height: 40px; background: transparent; border-color: transparent; }
.stock-tbl .inp:hover { border-color: var(--border2); }
.stock-tbl .inp:focus { background: var(--bg2); border-color: var(--accent); }
.stock-tbl .w-num { width: 140px; }
.stock-tbl .w-sm { width: 100px; }
.stock-tbl tr.empty .q { color: var(--red); font-weight: 700; }
.stock-tbl tr.low .q { color: var(--warn); font-weight: 700; }
.stock-sum { margin-top: 16px; display: flex; gap: 28px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.stock-sum b { color: var(--text); }

/* ================= Замок ================= */
.lock-screen { min-height: 70vh; display: grid; place-items: center; }
.lock-card { width: 400px; padding: 40px 36px; text-align: center; box-shadow: var(--shadow); }
.lock-card .logo { justify-content: center; margin-bottom: 20px; }
.lock-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.lock-card p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.lock-card .inp { text-align: center; font-size: 24px; letter-spacing: 10px; height: 56px; }
.lock-card .btn { width: 100%; margin-top: 14px; height: 50px; }
.lock-card .err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ================= Отчёты ================= */
.rep-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.day-list { padding: 10px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 230px); overflow-y: auto; position: sticky; top: 0; }
.day-pick { display: flex; gap: 8px; padding: 6px 4px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.day-pick .inp { height: 40px; color-scheme: var(--scheme); }
.day { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 11px; text-align: left; transition: .15s; }
.day:hover { background: var(--surface2); }
.day.active { background: var(--accent-soft); }
.day .d { width: 48px; height: 48px; border-radius: 11px; background: var(--surface2); display: grid; place-content: center; text-align: center; flex: none; line-height: 1.05; }
.day .d b { font-size: 19px; }
.day .d small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; }
.day.active .d { background: var(--accent); color: var(--on-accent); }
.day.active .d small { color: var(--on-accent); opacity: .7; }
.day .info { flex: 1; min-width: 0; }
.day .info div { font-weight: 600; }
.day .info span { font-size: 12.5px; color: var(--muted); }
.day .rv { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.empty-note { color: var(--faint); text-align: center; padding: 40px 10px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.tiles.five { grid-template-columns: repeat(5, 1fr); }
.tile { padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--border2)); }
.tile span { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; }
.tile b { display: block; font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile.rev { --c: var(--blue); }
.tile.cost { --c: var(--red); }
.tile.profit { --c: var(--green); }
.tile.profit b { color: var(--green); }
.tile.profit.neg b { color: var(--red); }
.tile.acc { --c: var(--accent); }

.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.detail-head h2 { font-size: 22px; }
.detail-head h2 small { color: var(--muted); font-weight: 400; font-size: 15px; margin-left: 8px; }
.receipt { padding: 16px 20px; margin-bottom: 12px; }
.receipt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.receipt-head .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.receipt-head .no { color: var(--faint); font-size: 13px; }
.receipt-head .btn { margin-left: auto; height: 32px; padding: 0 12px; font-size: 13px; }
.receipt .tbl td { padding: 9px 8px; font-size: 14px; }
.receipt .tbl tr:last-child td { border-bottom: none; }
.receipt .tbl .pos { color: var(--green); }
.receipt .tbl .negv { color: var(--red); }
.muted { color: var(--muted); }

/* ================= Статистика ================= */
.seg { display: inline-flex; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; gap: 4px; }
.seg button { height: 38px; padding: 0 20px; border-radius: 9px; color: var(--muted); font-weight: 600; transition: .15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--on-accent); }
.period-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.period-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.period-nav .icon-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.period-nav .icon-btn:hover { background: var(--surface2); color: var(--accent); }
.period-nav .icon-btn:disabled { opacity: .3; pointer-events: none; }
.period-label { min-width: 240px; text-align: center; font-weight: 600; font-size: 16px; }

.chart-card { padding: 20px 22px; margin-bottom: 20px; }
.chart-top { display: flex; align-items: center; margin-bottom: 14px; }
.chart-top h3 { font-size: 16px; }
.legend { margin-left: auto; display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 240px; padding-top: 10px; border-bottom: 1px solid var(--border2); position: relative; }
.chart .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); pointer-events: none; }
.chart .grid span { position: absolute; right: 0; top: -18px; font-size: 11px; color: var(--faint); }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; position: relative; border-radius: 6px 6px 0 0; }
.col:hover { background: var(--hover); }
.bar { width: 42%; max-width: 30px; border-radius: 5px 5px 0 0; min-height: 0; transition: height .4s ease; }
.bar.r { background: linear-gradient(180deg, var(--accent2), var(--accent)); }
.bar.p { background: linear-gradient(180deg, #4ade80, #16a34a); }
.bar.p.neg { background: var(--red); }
.col .tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5;
  background: var(--surface3); border: 1px solid var(--border2); border-radius: 9px; padding: 8px 11px; font-size: 12.5px;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: var(--shadow);
}
.col:hover .tip { opacity: 1; }
.col .tip b { display: block; margin-bottom: 3px; }
.xlabels { display: flex; gap: 6px; margin-top: 8px; }
.xlabels span { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); }
.top-card { padding: 20px 22px; }
.top-card h3 { font-size: 16px; margin-bottom: 10px; }
.top-card .tbl td { padding: 11px 8px; font-size: 14px; }
.rank { width: 26px; height: 26px; border-radius: 7px; background: var(--surface2); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }

/* ================= Настройки ================= */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.set-card { padding: 24px; }
.set-card h3 { font-size: 17px; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.set-card h3 svg { width: 20px; height: 20px; color: var(--accent); }
.set-card > p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.path { font-family: Consolas, monospace; font-size: 12px; color: var(--faint); word-break: break-all; margin-top: 14px; user-select: text; }
.about { text-align: center; padding: 30px 24px; }
.about .logo { justify-content: center; margin-bottom: 10px; }

/* Выбор темы */
.theme-set { margin-bottom: 20px; }
.theme-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.theme-card { text-align: left; border-radius: 14px; padding: 8px; background: var(--surface2); border: 2px solid transparent; transition: .18s; }
.theme-card:hover { transform: translateY(-2px); border-color: var(--border2); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tc-name { display: flex; align-items: center; justify-content: space-between; padding: 10px 6px 4px; }
.tc-name b { display: block; font-size: 15px; }
.tc-name span { font-size: 12.5px; color: var(--muted); }
.tc-check { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; opacity: 0; transform: scale(.6); transition: .18s; flex: none; }
.tc-check svg { width: 15px; height: 15px; }
.theme-card.on .tc-check { opacity: 1; transform: none; }

/* мини-превью темы (своя тема через data-theme) */
.tp { position: relative; height: 150px; border-radius: 10px; overflow: hidden; background: radial-gradient(260px 120px at 90% -20%, var(--glow), transparent 70%), var(--bg); border: 1px solid var(--border); }
.tp i { display: block; }
.tp-top { height: 22px; background: var(--topbar); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; padding: 0 8px; position: relative; }
.tp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.tp-line { width: 44px; height: 5px; border-radius: 3px; background: var(--text); opacity: .7; }
.tp-body { display: flex; gap: 8px; padding: 8px; height: calc(100% - 22px); position: relative; z-index: 1; }
.tp-side { width: 46px; display: flex; flex-direction: column; gap: 5px; }
.tp-side i { height: 8px; border-radius: 3px; background: var(--surface3); }
.tp-side i.a { background: var(--accent); }
.tp-main { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.tp-row { display: flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 6px; }
.tp-sum { flex: 1; height: 9px; border-radius: 3px; background: var(--text); opacity: .75; max-width: 50px; }
.tp-btn { margin-left: auto; width: 46px; height: 16px; border-radius: 4px; background: #22c55e; }


/* ================= Уведомления и окна ================= */
#toasts { position: fixed; right: 26px; bottom: 40px; display: flex; flex-direction: column; gap: 10px; z-index: 90; }
.toast { min-width: 300px; max-width: 420px; padding: 14px 18px; border-radius: 12px; background: var(--surface3); border: 1px solid var(--border2); box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start; animation: tin .25s ease; }
.toast svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--green); }
.toast.err svg { color: var(--red); }
.toast b { display: block; }
.toast span { color: var(--muted); font-size: 13.5px; }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
@keyframes tin { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; z-index: 95; animation: fade .15s; }
.modal { width: 440px; padding: 26px; box-shadow: var(--shadow); background: var(--surface2); }
.modal h3 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--muted); margin-bottom: 22px; line-height: 1.5; }
.modal .row-btns { justify-content: flex-end; }

[data-theme="sunset"] .btn.primary, [data-theme="sunset"] .seg button.on { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
[data-theme="sunset"] .logo b, [data-theme="sunset"] .splash-title b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
