/* AQUA CAPITAL CRM v2: цвета и стиль приложения AQUA WORK, адаптированные под компьютер */
:root {
  --ink: #151927; --muted: #596178; --faint: #8A91A8; --milk: #F4F5FB; --surface: #fff;
  --blue: #2849DF; --blue-2: #3F5FF0; --blue-bg: #EAEEFF; --night: #101426; --lime: #E4FFA0; --lime-ink: #2F4A00;
  --line: #E1E4EE; --line-2: #EEF0F6; --bad: #C2413B; --bad-bg: #F9E5E3; --warn: #8A5A00; --warn-bg: #FFF2D2; --ok: #2F7A3B; --ok-bg: #E6F6E1;
  --kaspi: #E3262E; --kaspi-bg: #FDE8E9;
  --surface-2: #FAFBFE; --glass: rgba(255, 255, 255, .85);
  --r: 20px; --r-s: 12px; --row: 46px; --fs: 14px;
  --shadow: 0 1px 2px rgba(20, 25, 50, .04), 0 6px 22px rgba(20, 25, 50, .06);
  --font: "Inter", -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
body.compact { --row: 36px; --fs: 13px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: var(--fs)/1.4 var(--font); color: var(--ink); background: var(--milk); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, td.r, .tnum { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 16px; color: #fff; overflow: hidden;
  background: radial-gradient(ellipse at 20% 0%, rgba(82, 124, 255, .75) 0%, transparent 38%), radial-gradient(ellipse at 100% 70%, rgba(39, 68, 216, .45) 0%, transparent 50%), linear-gradient(170deg, #121830 0%, #080E20 70%, #14245A 100%); }
.brand { padding: 2px 10px 22px; }
.brand b { display: block; font-weight: 500; letter-spacing: .28em; font-size: 13px; }
.brand span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 14px; background: transparent; color: rgba(255, 255, 255, .82); text-align: left; font-size: 15px; }
.nav button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav button.on { background: var(--lime); color: var(--ink); font-weight: 500; }
.nav button .k { margin-left: auto; font-size: 11px; opacity: .55; }
.nav button .cnt { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-size: 12px; text-align: center; }
.nav button.on .cnt { background: rgba(21, 25, 39, .1); }
.side .sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 14px 8px; }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 0; color: #fff; text-align: left; width: 100%; }
.who .av { width: 32px; height: 32px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-weight: 600; }
.who small { display: block; color: rgba(255, 255, 255, .55); font-size: 11px; }
.proto { font-size: 11px; color: rgba(255, 255, 255, .5); padding: 0 10px; }

.main { min-width: 0; background: radial-gradient(ellipse at 10% 0%, rgba(83, 118, 255, .22) 0%, transparent 28%), radial-gradient(ellipse at 100% 0%, rgba(52, 75, 224, .3) 0%, transparent 30%), linear-gradient(180deg, #E8ECFC 0%, var(--milk) 300px); background-repeat: no-repeat; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 36px 120px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head .t { margin-right: auto; }
.kick { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
h1 { font-size: 36px; font-weight: 300; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
h2 { font-size: 20px; font-weight: 400; margin: 0 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 8px; }
.sub { color: var(--muted); margin-top: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ---------- элементы ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 18px 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .9); white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: #C9CEE0; background: var(--surface); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.primary { border: 0; color: #fff; background: radial-gradient(ellipse at 100% 90%, rgba(220, 255, 145, .45) 0%, transparent 45%), linear-gradient(140deg, #6E8BFF 0%, #2A49DA 48%, #253BC3 100%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 6px 18px rgba(35, 65, 230, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.lime { border: 0; background: var(--lime); color: var(--ink); }
.btn.lime:hover { filter: brightness(.97); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(40, 73, 223, .07); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.ibtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid transparent; background: transparent; display: inline-grid; place-items: center; color: var(--muted); }
.ibtn:hover { background: var(--blue-bg); color: var(--blue); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .85); color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--lime); border-color: var(--lime); color: var(--ink); font-weight: 500; }
.chip .n { font-size: 12px; opacity: .7; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--wait, #EEF1FA); color: var(--muted); }
.badge.ok { background: var(--lime); color: var(--lime-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.kaspi { background: var(--kaspi-bg); color: var(--kaspi); }
.badge.tag { background: #F1F2F8; color: var(--ink); font-weight: 400; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #EBEDF5; gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(20, 25, 50, .12); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.inp, select.inp, textarea.inp { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); outline: none; width: 100%; min-width: 0; }
textarea.inp { height: auto; padding: 10px 12px; resize: vertical; }
.inp:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40, 73, 223, .12); }
.search { position: relative; }
.search > svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .inp { padding-left: 42px; border-radius: 999px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty .ic { width: 54px; height: 54px; border-radius: 50%; background: var(--lime); color: var(--ink); display: grid; place-items: center; margin: 0 auto 12px; }
kbd { font: 11px/1 var(--font); padding: 3px 6px; border-radius: 6px; background: rgba(21, 25, 39, .07); color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.hide { display: none !important; }

/* ---------- главная ---------- */
.acts { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.act { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; padding: 20px; border-radius: 24px; border: 1px solid var(--line); background: var(--glass); text-align: left; box-shadow: var(--shadow); }
.act:hover { transform: translateY(-1px); border-color: #C9CEE0; }
.act .ic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-bg); color: var(--blue); }
.act .ic svg.i { width: 22px; height: 22px; }
.act b { font-size: 20px; font-weight: 500; letter-spacing: -.01em; }
.act small { display: block; color: var(--muted); margin-top: 2px; }
.act kbd { position: absolute; top: 20px; right: 20px; }
.act.hero { color: #fff; border: 0; background: radial-gradient(ellipse at 100% 90%, rgba(220, 255, 145, .6) 0%, transparent 42%), linear-gradient(140deg, #7591FF 0%, #2A49DA 45%, #253BC3 100%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), 0 10px 28px rgba(35, 65, 230, .28); }
.act.hero .ic { background: rgba(255, 255, 255, .95); color: var(--blue); }
.act.hero small { color: rgba(255, 255, 255, .8); }
.act.hero kbd { background: rgba(255, 255, 255, .2); color: #fff; }
.act.hero b { font-size: 26px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat small { display: block; font-size: 12px; color: var(--muted); }
.stat b { font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.dash { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dash > * { min-width: 0; }
.dash .card { display: flex; flex-direction: column; }
.dash .card .ch { display: flex; align-items: center; gap: 10px; padding: 16px 18px 8px; }
.dash .card .ch h3 { margin: 0; font-weight: 500; font-size: 16px; }
.dash .card .ch .badge { margin-left: auto; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line-2); cursor: pointer; }
.li:hover { background: var(--surface-2); }
.li .grow small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .grow > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .more { margin-top: auto; padding: 10px 18px 14px; border-top: 1px solid var(--line-2); }

/* ---------- таблицы ---------- */
.tblwrap { overflow: auto; border-radius: var(--r); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); height: 40px; padding: 0 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl th.c, .tbl td.c { text-align: center; }
.tbl th[draggable=true] { cursor: grab; }
.tbl th[draggable=true]:hover { color: var(--ink); background: #F2F4FB; }
.tbl th.drop-l { box-shadow: inset 3px 0 0 var(--blue); }
.tbl th.drop-r { box-shadow: inset -3px 0 0 var(--blue); }
.tbl th.dragging { opacity: .4; }
.tbl td { height: var(--row); padding: 0 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: var(--surface-2); }
.tbl tr.sel td { background: #F3F6FF; }
.tbl td.name { white-space: normal; min-width: 220px; }
.tbl td.name small { display: block; color: var(--faint); font-size: 12px; }
.tbl td .z { color: #C3C7D6; }
.tbl td .low { color: var(--bad); font-weight: 600; }
.tbl td.wh-on, .tbl th.wh-on { background: #F4F7FF; }
.tbl .ci { height: 34px; border: 1px solid transparent; border-radius: 10px; background: #F5F6FB; padding: 0 8px; width: 100%; outline: none; text-align: right; }
.tbl .ci:hover { border-color: var(--line); background: var(--surface); }
.tbl .ci:focus { border-color: var(--blue); background: var(--surface); box-shadow: 0 0 0 3px rgba(40, 73, 223, .12); }
.tbl input[type=checkbox], .ck { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.tbl tr.subrow td { height: auto; padding: 0 12px 12px; background: transparent; border-bottom: 1px solid var(--line-2); white-space: normal; }
.tbl tr.has-sub td { border-bottom: 0; }
.base { display: block; font-size: 11px; color: var(--faint); text-align: right; }
.base.up { color: var(--kaspi); }

/* ---------- журнал и фильтры ---------- */
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.bar .search { width: 320px; max-width: 100%; }
.bar select.inp { width: auto; border-radius: 999px; height: 34px; padding: 0 30px 0 14px; color: var(--muted); }
.colpop { position: absolute; right: 0; top: 44px; z-index: 30; width: 270px; padding: 10px; }
.colpop .ci-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; cursor: grab; }
.colpop .ci-row:hover { background: #F5F6FB; }
.colpop .ci-row.fixed { cursor: default; opacity: .6; }
.colpop .ci-row.drop { box-shadow: inset 0 -2px 0 var(--blue); }
.grip { color: var(--faint); }

/* ---------- документ ---------- */
.doc-head { display: grid; grid-template-columns: minmax(220px, 1.4fr) auto minmax(200px, 1fr) auto; gap: 14px; align-items: end; }
.doc-head .field .seg { width: max-content; }
.newline { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px dashed var(--line); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); }
.plusbtn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--night); box-shadow: 0 4px 12px rgba(120, 160, 20, .25); }
.plusbtn:hover { transform: scale(1.06); }
.plusbtn svg.i { width: 24px; height: 24px; stroke-width: 2.4; }
.addbar { position: relative; flex: 1; min-width: 0; }
.addbar .inp { scroll-margin-bottom: 120px; scroll-margin-top: 480px; height: 44px; font-size: 15px; background: var(--surface); }
.addbar .inp:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40, 73, 223, .12); }
.addbar .hint { position: absolute; right: 16px; top: 14px; color: var(--faint); font-size: 12px; pointer-events: none; }
.newline .dd { top: auto; bottom: calc(100% + 8px); box-shadow: 0 16px 40px rgba(16, 20, 38, .18); }
.dd { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; max-height: 440px; overflow: auto; padding: 6px; }
.dd .opt { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.dd .opt.on, .dd .opt:hover { background: var(--blue-bg); }
.dd .opt small { display: block; color: var(--muted); font-size: 12px; }
.dd .opt .st { font-size: 12px; text-align: right; color: var(--muted); min-width: 120px; }
.dd .opt .pr { font-weight: 600; min-width: 90px; text-align: right; }
.dd .note { padding: 8px 12px; font-size: 12px; color: var(--muted); }
mark { background: var(--lime); color: inherit; border-radius: 4px; padding: 0 2px; }
.sz { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--blue-bg); color: var(--blue); font-weight: 600; font-size: 12px; }
.tip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: 14px; font-size: 13px; }
.tip.short { background: var(--warn-bg); color: var(--warn); }
.tip.kit { background: #F2FBDC; color: var(--lime-ink); }
.tip.info { background: var(--blue-bg); color: var(--blue); }
.tip.kaspi { background: var(--kaspi-bg); color: #8E1A1F; }
.tip .btn.sm { background: var(--surface); border-color: transparent; }
.tip label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--surface); color: var(--ink); cursor: pointer; }
.docbar { position: sticky; bottom: 16px; z-index: 20; margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 22px; border-radius: 24px; color: #fff; flex-wrap: wrap;
  background: radial-gradient(ellipse at 7% 0%, #527AFF, transparent 56%), linear-gradient(140deg, #294BE7, #111A48 85%); box-shadow: 0 10px 30px rgba(20, 30, 90, .25), inset 0 1px 1px rgba(255, 255, 255, .35); }
.docbar .tot small { display: block; font-size: 12px; color: rgba(255, 255, 255, .7); }
.docbar .tot b { font-size: 26px; font-weight: 500; letter-spacing: -.01em; }
.docbar .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .18); color: #fff; }
.docbar .btn:hover { background: rgba(255, 255, 255, .2); }
.docbar .btn.lime { background: var(--lime); color: var(--ink); border: 0; height: 46px; padding: 0 22px; font-size: 15px; }
.docbar .sp { flex: 1; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- канбан ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.kcol { border-radius: 22px; background: rgba(255, 255, 255, .55); border: 1px solid var(--line); padding: 12px; min-height: 300px; }
.kcol.over { background: #F2FBDC; border-color: #C7E58A; }
.kcol .kh { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.kcol .kh b { font-weight: 500; font-size: 15px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; margin-bottom: 10px; cursor: grab; box-shadow: 0 1px 2px rgba(20, 25, 50, .04); }
.kcard:hover { border-color: #C9CEE0; }
.kcard.dragging { opacity: .4; }
.kcard .top { display: flex; gap: 8px; align-items: flex-start; }
.kcard .top b { font-weight: 500; }
.kcard .sum { font-size: 19px; font-weight: 500; color: var(--blue); margin: 6px 0 4px; }
.kcard .meta { font-size: 12px; color: var(--muted); }
.kcard .note { font-size: 13px; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.kcard .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- касса ---------- */
.boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.box { padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--shadow); }
.box.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40, 73, 223, .12); }
.box .nm { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.box .sum { font-size: 24px; font-weight: 500; margin: 10px 0 2px; letter-spacing: -.01em; }
.box .split { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.box.total { background: linear-gradient(160deg, #fff 0%, #EEF1FF 100%); }
.box .resp { font-size: 12px; color: var(--muted); margin-top: 4px; }
.box .subs { display: grid; gap: 4px; margin-top: 10px; }
.box .subs span { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 12px; background: var(--milk); font-size: 13px; }
.box .subs small { color: var(--muted); font-size: 12px; }
.box .subs b { font-weight: 500; font-variant-numeric: tabular-nums; }
.box .subs .kaspi { background: var(--kaspi-bg); }
.box .subs .kaspi small { color: #8E1A1F; }
/* номенклатура: папки слева внутри одной карточки */
.nomcard { display: grid; grid-template-columns: 252px minmax(0, 1fr); overflow: hidden; }
.frail { padding: 14px 10px; background: var(--surface-2); border-right: 1px solid var(--line); max-height: calc(100vh - 230px); overflow: auto; }
.frail-h { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 0 10px 8px; }
.fold { margin: 0; line-height: 1; border: 0; background: none; display: flex; align-items: center; gap: 4px; width: 100%; height: 36px; padding: 0 10px 0 4px; border-radius: 10px; font-size: 14px; text-align: left; color: var(--ink); }
.fold:hover { background: #F0F2FA; }
.fold.on { background: var(--lime); font-weight: 500; }
.fold .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fold .tw { width: 20px; height: 20px; display: grid; place-items: center; flex: none; border-radius: 6px; color: var(--faint); }
.fold .tw:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.fold .tw svg.i { width: 13px; height: 13px; transition: transform .15s; }
.fold .tw.op svg.i { transform: rotate(90deg); }
.fold .n { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fold.on .n { color: var(--lime-ink); }
.foldkids { margin-left: 13px; padding-left: 4px; border-left: 1px solid var(--line); }
.fold.sub { font-size: 13.5px; color: var(--muted); }
.fold.sub.on { color: var(--ink); }
.nommain { min-width: 0; display: flex; flex-direction: column; }
.nomhead { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.nomhead .faint { margin-left: auto; font-size: 13px; white-space: nowrap; }
.nommain .tblwrap { max-height: calc(100vh - 290px); }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.crumbs button { border: 0; background: none; color: var(--muted); padding: 2px 4px; border-radius: 6px; }
.crumbs button:hover { color: var(--blue); background: var(--blue-bg); }
.crumbs b { font-weight: 500; }
.crumbs svg.i { width: 12px; height: 12px; color: var(--faint); }
.nomt td.acts2 { width: 76px; }
.nomt td.acts2 .ibtn { opacity: .35; }
.nomt tr:hover td.acts2 .ibtn { opacity: 1; }
.tbl.tight th, .tbl.tight td { padding: 0 8px; }
.tbl.tight td.name { min-width: 200px; }
.tbl th.res, .tbl td.res { background: rgba(244, 245, 250, .7); }
.tbl th.res { color: var(--muted); }
.tbl th.mainwh { color: var(--blue); }
/* большая кнопка + */
.bigplus { border: 0; display: inline-flex; align-items: center; gap: 14px; padding: 10px 22px 10px 10px; border-radius: 999px; color: #fff; text-align: left; background: radial-gradient(ellipse at 100% 100%, rgba(220, 255, 145, .55) 0%, transparent 45%), linear-gradient(140deg, #7591FF 0%, #2A49DA 50%, #253BC3 100%); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), 0 10px 24px rgba(35, 65, 230, .28); }
.bigplus:hover { transform: translateY(-1px); }
.bigplus .pl { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--night); flex: none; }
.bigplus .pl svg.i { width: 28px; height: 28px; stroke-width: 2.4; }
.bigplus b { display: block; font-size: 18px; font-weight: 500; }
.bigplus small { display: block; font-size: 12px; color: rgba(255, 255, 255, .8); }
.act .ic.plus { width: 58px; height: 58px; background: var(--lime) !important; color: var(--night) !important; }
.act .ic.plus svg.i { width: 30px; height: 30px; stroke-width: 2.4; }
h1.docno span { color: var(--blue); white-space: nowrap; }
.head .sub b { font-weight: 500; color: var(--ink); margin-right: 4px; }
.in { color: var(--ok); }
.out { color: var(--bad); }

/* ---------- боковая карточка товара ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 460px; max-width: 100%; z-index: 60; background: var(--surface); box-shadow: -10px 0 40px rgba(16, 20, 38, .15); overflow: auto; padding: 24px; }
.drawer-bg { position: fixed; inset: 0; z-index: 59; background: rgba(16, 20, 38, .25); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; }
.whrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); }

/* ---------- модальные окна ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(16, 20, 38, .42); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal { width: 520px; max-width: 100%; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border-radius: 26px; padding: 24px; box-shadow: 0 30px 80px rgba(16, 20, 38, .3); }
.modal.wide { width: 720px; }
.modal h2 { font-size: 24px; font-weight: 300; margin-bottom: 4px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.paygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.paygrid .field .inp { height: 48px; font-size: 18px; text-align: right; }
.bigsum { font-size: 34px; font-weight: 300; letter-spacing: -.02em; }

/* ---------- палитра поиска ---------- */
.pal { position: fixed; inset: 0; z-index: 90; background: rgba(16, 20, 38, .42); backdrop-filter: blur(3px); padding-top: 12vh; }
.pal .box2 { width: 720px; max-width: calc(100% - 32px); margin: 0 auto; background: var(--surface); border-radius: 24px; box-shadow: 0 30px 80px rgba(16, 20, 38, .3); overflow: hidden; }
.pal .inp { height: 60px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 18px; padding-left: 52px; box-shadow: none !important; }
.pal .dd { position: static; max-height: 60vh; box-shadow: none; border: 0; }

/* ---------- отчёты ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 18px 20px; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 26px; font-weight: 500; letter-spacing: -.01em; margin-top: 4px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding: 10px 0 0; }
.bars .b { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bars .stack { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 4px 4px; overflow: hidden; }
.bars .stack i { display: block; }
.bars .b small { font-size: 11px; color: var(--faint); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.tile { padding: 18px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--shadow); }
.tile.on { background: var(--lime); border-color: var(--lime); }
.tile b { display: block; font-weight: 500; font-size: 16px; margin-top: 10px; }
.tile small { color: var(--muted); }
.perm td { text-align: center; }

/* ---------- уведомления ---------- */
.toasts { position: fixed; right: 24px; top: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100% - 32px); }
.toast { display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border-radius: 16px; background: var(--night); color: #fff; box-shadow: 0 10px 30px rgba(16, 20, 38, .3); animation: up .18s ease-out; }
.toast .btn { height: 32px; background: var(--lime); color: var(--ink); border: 0; }
@keyframes up { from { transform: translateY(-8px); opacity: 0; } }

/* ---------- печать ---------- */
#print { display: none; }
@media print {
  body { background: var(--surface); }
  .app, .toasts, .modal-bg { display: none !important; }
  #print { display: block; padding: 10mm; font: 12px/1.4 Arial, sans-serif; color: #000; }
  #print table { width: 100%; border-collapse: collapse; margin: 10px 0; }
  #print th, #print td { border: 1px solid #000; padding: 4px 6px; }
  #print .r { text-align: right; }
}

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .acts { grid-template-columns: 1fr 1fr; }
  .dash { grid-template-columns: 1fr 1fr; }
  .boxes, .kpis, .tiles { grid-template-columns: 1fr 1fr; }
  .doc-head { grid-template-columns: 1fr 1fr; }
  .doc-head .field .seg { width: 100%; overflow-x: auto; }
  .nomcard { grid-template-columns: 200px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 10px; left: 10px; right: 10px; height: auto; z-index: 50; padding: 6px; border-radius: 24px; flex-direction: row; }
  .brand, .side .sep, .side .foot, .nav button .k { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-between; gap: 2px; }
  .nav button { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 11px; text-align: center; border-radius: 18px; }
  .nav button .cnt { display: none; }
  .wrap { padding: 18px 16px 120px; }
  h1 { font-size: 30px; }
  .acts, .dash, .kanban, .grid3 { grid-template-columns: 1fr; }
  .act { min-height: 110px; }
  .doc-head, .grid2, .paygrid { grid-template-columns: 1fr; }
  .bar .search { width: 100%; }
  .docbar { position: static; padding: 14px; }
  .docbar .btn:not(.lime) { height: 36px; padding: 0 12px; font-size: 13px; }
  .docbar .btn.lime { width: 100%; }
  .docbar kbd, .addbar .hint { display: none; }
  .tip label { white-space: normal; }
  .toasts { top: auto; bottom: 96px; right: 16px; }
  .dd .opt { grid-template-columns: 1fr auto; }
  .dd .opt .st { display: none; }
  .drawer { width: 100%; }
  .nomcard { grid-template-columns: 1fr; }
  .frail { display: flex; gap: 6px; overflow-x: auto; max-height: none; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .frail-h, .frail .tw { display: none; }
  .frail .foldkids { display: contents; }
  .frail .fold { width: auto; flex: none; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .frail .fold.on { background: var(--lime); border-color: transparent; }
  .nomt td.acts2 .ibtn { opacity: 1; }
  .bigplus { width: 100%; }
  h1.docno { font-size: 24px; }
}

@media (min-width: 861px) and (max-width: 1366px) { .nomt td.name { min-width: 170px; } .nomcard { grid-template-columns: 236px minmax(0, 1fr); } }

/* комплект: свёрнут по умолчанию */
.kitchip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border: 1px dashed #B9D98A; border-radius: 999px; background: #F7FFE6; color: var(--lime-ink); font-size: 13px; cursor: pointer; }
.kitchip:hover { background: var(--lime); border-style: solid; }
.kitchip svg.i { width: 15px; height: 15px; }
.kitchip svg.i:last-child { width: 13px; height: 13px; opacity: .7; }

/* ===== дашборд и новые экраны ===== */
.side { position: sticky; }
.bell { position: absolute; top: 22px; right: 14px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #fff; display: grid; place-items: center; cursor: pointer; }
.bell:hover, .bell.on { background: rgba(255, 255, 255, .16); }
.bell svg.i { width: 18px; height: 18px; }
.bell .dotn { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--kaspi); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.bell-bg { position: fixed; inset: 0; z-index: 70; }
.bellp { position: fixed; top: 16px; left: 252px; width: 420px; max-height: calc(100vh - 32px); overflow: auto; z-index: 71; background: var(--surface); border-radius: 20px; box-shadow: 0 20px 60px rgba(16, 20, 38, .25); }
.bellp .li { cursor: default; }
.bellp .li[data-act] { cursor: pointer; }
.li.fresh { background: #F3F6FF; }
.av.sm { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--lime); color: var(--ink); font-size: 11px; font-weight: 600; flex: none; vertical-align: middle; margin-right: 6px; }
.link { color: var(--blue); cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.viz { display: grid; grid-template-columns: 1.7fr 1.15fr 1fr; gap: 14px; margin-bottom: 14px; }
.viz > * { min-width: 0; }
.viz .big { font-size: 28px; font-weight: 500; letter-spacing: -.01em; }
.viz .mid { font-size: 18px; font-weight: 500; }
.trend { font-size: 12px; padding: 2px 7px; border-radius: 99px; vertical-align: 3px; }
.trend.up { background: var(--ok-bg); color: var(--ok); }
.trend.down { background: var(--bad-bg); color: var(--bad); }
.chart { width: 100%; height: 190px; display: block; margin: 10px 0 6px; }
.chart g:hover rect { opacity: .82; }
.donutw { position: relative; flex: none; }
.donutw .dc { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donutw .dc b { font-size: 19px; font-weight: 600; }
.donutw .dc small { font-size: 11px; color: var(--muted); }
.lg { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; cursor: pointer; }
.lg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.seg3 { display: flex; gap: 3px; height: 14px; margin-top: 10px; }
.seg3 i { border-radius: 4px; display: block; }
.seg3 i.new, .agel i.new { background: #C9CFDF; }
.seg3 i.mid, .agel i.mid { background: #F2B640; }
.seg3 i.old, .agel i.old { background: #E0564F; }
.agel { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.agel i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.lvl { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 99px; font-variant-numeric: tabular-nums; font-weight: 500; }
.lvl i { width: 7px; height: 7px; border-radius: 50%; }
.lvl.g { background: #EAF7E4; color: #2F6B2A; } .lvl.g i { background: #4CAF50; }
.lvl.y { background: #FFF3D6; color: #8A5A00; } .lvl.y i { background: #F2B640; }
.lvl.r { background: #FBE6E4; color: #B3352F; } .lvl.r i { background: #E0564F; }
.lvlt.y { color: #8A5A00; } .lvlt.r { color: #B3352F; }
.spark { margin: 18px 0 0; padding: 14px; border-radius: 16px; background: var(--milk); }
.spark svg { width: 100%; height: 56px; display: block; margin-top: 8px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid4 small { font-size: 12px; }
.shiftgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 14px; align-items: end; }
.shiftgrid > div, .shiftgrid > label { padding: 14px; border-radius: 16px; background: var(--milk); }
.shiftgrid small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.shiftgrid b { font-size: 20px; font-weight: 500; }
.shiftgrid .inp { height: 40px; font-size: 18px; }
.shiftgrid .res.ok { background: var(--ok-bg); color: var(--ok); }
.shiftgrid .res.bad { background: var(--bad-bg); color: var(--bad); }
.shiftgrid .res.over { background: var(--blue-bg); color: var(--blue); }
.drawer.client { width: 520px; }
.cav { width: 48px; height: 48px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 500; margin-right: 12px; flex: none; }
.inp.bare { border: 1px solid transparent; background: transparent; padding: 0 6px; margin-left: -6px; }
.inp.bare:hover, .inp.bare:focus { border-color: var(--line); background: var(--surface); }
.inp.h2 { font-size: 22px; font-weight: 500; height: 40px; width: 100%; }
.debtbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; }
.debtbox small { display: block; font-size: 12px; opacity: .8; }
.debtbox b { font-size: 22px; font-weight: 500; }
.debtbox.new { background: #F1F2F7; } .debtbox.mid { background: #FFF3D6; color: #8A5A00; } .debtbox.old { background: #FBE6E4; color: #B3352F; }
.cstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.cstats div { padding: 10px 12px; border-radius: 14px; background: var(--milk); }
.cstats small { display: block; font-size: 11px; color: var(--muted); }
.cstats b { font-size: 15px; font-weight: 500; }
.drawer .li { padding: 10px 4px; }
.agecards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.agecards > div { padding: 14px 18px; border-radius: 18px; }
.agecards small { display: block; font-size: 12px; opacity: .8; }
.agecards b { font-size: 22px; font-weight: 500; }
.agecards .new { background: #F1F2F7; } .agecards .mid { background: #FFF3D6; color: #8A5A00; } .agecards .old { background: #FBE6E4; color: #B3352F; }
.agebadge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.agebadge.new { background: #F1F2F7; color: var(--muted); } .agebadge.mid { background: #FFF3D6; color: #8A5A00; } .agebadge.old { background: #FBE6E4; color: #B3352F; }
.debtbar { position: relative; display: flex; align-items: center; gap: 10px; }
.debtbar i { display: block; height: 10px; border-radius: 99px; }
.debtbar.new i { background: #C9CFDF; } .debtbar.mid i { background: #F2B640; } .debtbar.old i { background: #E0564F; }
.debtbar b { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.hrow { margin: 10px 0; }
.hrow .row { font-size: 13px; gap: 8px; margin-bottom: 5px; }
.hrow .hbar { height: 8px; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rk { display: inline-block; width: 18px; color: var(--faint); font-variant-numeric: tabular-nums; }
.dbl { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; margin-top: 5px; font-size: 13px; }
.dbl b { text-align: right; font-weight: 500; }
.tiles.six { grid-template-columns: repeat(6, 1fr); }
.btn.danger-fill { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.danger-fill:disabled { opacity: .45; }
.docbar.ret { background: linear-gradient(140deg, #6B2A2A, #3A1720); }
.tbl tr.neg td { background: #FDF3F2; }
.tbl tr.pos td { background: #F3F7FF; }
.tbl tr.okr td { background: #F6FBF3; }
.seg .n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 11px; margin-left: 4px; }
.tip.banner a.link { color: inherit; text-decoration: underline; }
@media (max-width: 1180px) { .viz { grid-template-columns: 1fr 1fr; } .viz .vz-sales { grid-column: 1 / -1; } .tiles.six { grid-template-columns: repeat(3, 1fr); } }
.kitchip { align-self: flex-start; }
.brand { padding-right: 50px; }
.vz-money .lg { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; }
.vz-money .lg span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-money .lg b { font-weight: 500; }
a.btn { text-decoration: none; }
.retpay { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 12px; }
.retpay .seg { flex-wrap: wrap; }
.viz { grid-template-columns: 1.45fr 1.35fr 1fr; }
.vz-money .lg { font-size: 12.5px; }
.brand span { white-space: nowrap; font-size: 11px; }

/* ===== современный дашборд ===== */
.qa { display: flex; gap: 8px; flex-wrap: wrap; }
.qa .btn { height: 42px; }
.kgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kc { position: relative; padding: 18px 20px 16px; overflow: hidden; display: flex; flex-direction: column; min-height: 150px; }
.kc.click { cursor: pointer; }
.kc.click:hover { border-color: #C9CEE0; }
.kc .kt { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.kc > b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kc > small { color: var(--faint); font-size: 12px; margin-top: 2px; }
.kc .spk { width: 100%; height: 38px; margin-top: auto; display: block; }
.dl { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.dl.up { background: #E7F8E1; color: #2E7D32; }
.dl.down { background: #FDECEA; color: #C2413B; }
.big .dl { vertical-align: 5px; margin-left: 4px; }
.mseg { display: flex; gap: 3px; height: 10px; margin-top: auto; padding-top: 0; }
.mseg i { display: block; border-radius: 99px; min-width: 4px; }
.mseg i.new, .mleg i.new { background: #C9CFDF; }
.mseg i.mid, .mleg i.mid { background: #F2B640; }
.mseg i.old, .mleg i.old { background: #E0564F; }
.kc .mseg { margin-top: auto; }
.mleg { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.mleg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.bento { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.chartc .big { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.area { width: 100%; height: auto; display: block; margin-top: 12px; overflow: visible; }
.area .hv line, .area .hv circle { opacity: 0; transition: opacity .12s; }
.area .hv:hover line, .area .hv:hover circle { opacity: 1; }
.seg.sm button { height: 30px; padding: 0 12px; font-size: 12.5px; }
.planc { display: flex; flex-direction: column; gap: 12px; }
.ringw { position: relative; align-self: center; margin: 4px 0; }
.ringw .rc { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ringw .rc b { font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.ringw .rc small { color: var(--muted); font-size: 12px; }
.split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.split2 div { padding: 10px 12px; border-radius: 14px; background: var(--milk); }
.split2 small { display: block; font-size: 11px; color: var(--muted); }
.split2 b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agedot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.agedot.new { background: #C9CFDF; } .agedot.mid { background: #F2B640; } .agedot.old { background: #E0564F; }
.dash .card .more { display: flex; gap: 8px; align-items: center; }
@media (max-width: 1280px) { .kgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento { grid-template-columns: 1fr; } .planc { flex-direction: row; flex-wrap: wrap; align-items: center; } }
/* верхняя панель */
.topbar { display: flex; align-items: center; gap: 12px; margin: -8px 0 18px; }
.tsearch { flex: 0 1 380px; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .8); color: var(--faint); cursor: pointer; font-size: 14px; text-align: left; }
.tsearch span { flex: 1; }
.tsearch:hover { border-color: #C9CEE0; color: var(--muted); }
.tstrip { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .6); border: 1px solid var(--line); }
.tstrip button { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--muted); cursor: pointer; }
.tstrip button:hover { background: var(--surface); color: var(--ink); }
.tstrip b { color: var(--ink); font-weight: 600; margin-left: 2px; }
.ratechip { margin-left: auto; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 13px; }
.ratechip .cur { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.ratechip b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ratechip:hover { border-color: #C9CEE0; }
.agecards { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.agecards .cons { background: var(--blue-bg); color: var(--blue); }
@media (max-width: 1280px) { .tstrip { display: none; } }
.modal .grid2 .seg { flex-wrap: wrap; height: auto; }
/* ===== сервер: вход, ассистент, задачи, аналитика ===== */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.gate-side { padding: 48px; color: #fff; background: radial-gradient(ellipse at 20% 0%, #3552E8 0%, transparent 60%), linear-gradient(160deg, #101426, #1B2A7A); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.gate-side h1 { font-size: 44px; color: #fff; }
.gate-side p { color: rgba(255, 255, 255, .75); max-width: 380px; }
.gate-form { display: grid; place-items: center; padding: 32px; }
.gate-card { width: 100%; max-width: 420px; display: grid; gap: 14px; }
.gate-card h2 { margin: 0; }
.inp.big { height: 54px; font-size: 18px; }
.inp.code { letter-spacing: .4em; text-align: center; font-size: 24px; }
.btn.big { height: 50px; font-size: 16px; justify-content: center; }
.asgrid { display: grid; grid-template-columns: 320px minmax(0, 1fr) 320px; gap: 14px; margin-top: 14px; align-items: start; }
.aslist { max-height: calc(100vh - 260px); overflow: auto; }
.aslist .li.on { background: var(--blue-bg); }
.aslist .li .r { text-align: right; }
.av.stranger { background: #FFE3B3; }
.aschat { display: flex; flex-direction: column; min-height: 520px; max-height: calc(100vh - 260px); }
.ch2 { padding: 14px 18px; border-bottom: 1px solid var(--line-2); gap: 12px; }
.ch2 .av { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 600; }
.msgs { flex: 1; overflow: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.msg { max-width: 72%; align-self: flex-start; }
.msg.me { align-self: flex-end; text-align: right; }
.msg .bub { display: inline-block; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); text-align: left; white-space: pre-wrap; }
.msg.me .bub { background: var(--blue); color: #fff; border-color: var(--blue); border-radius: 16px 16px 4px 16px; }
.msg small { display: block; font-size: 11px; color: var(--faint); margin-top: 3px; }
.chtasks { padding: 8px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line-2); }
.composer textarea { flex: 1; resize: none; height: 56px; padding: 10px 14px; }
.asside { display: grid; gap: 14px; }
.can { margin: 6px 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.waic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #E7F8E1; color: #2E7D32; }
.pair { display: flex; gap: 16px; align-items: center; }
.pair .qr { width: 190px; height: 190px; border-radius: 14px; background: var(--milk); display: grid; place-items: center; flex: none; }
.pair ol { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.taskadd { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.kanban.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcard .meta svg.i { width: 13px; height: 13px; }
.tcard.late { border-color: #F3B3AE; }
.tcard .tmv { display: flex; justify-content: space-between; margin-top: 6px; }
.ibtn.sm { width: 26px; height: 26px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.staffrow.off { opacity: .55; }
.staffadd { gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.staffadd .inp { flex: 1 1 140px; }
.tiles.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.tile { position: relative; }
.tdot { position: absolute; top: 12px; right: 12px; min-width: 20px; height: 20px; border-radius: 99px; background: var(--kaspi); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.lockchip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); font-size: 12.5px; font-weight: 500; }
.lockchip svg.i, .wachip svg.i { width: 15px; height: 15px; }
.wachip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--bad); font-size: 12.5px; cursor: pointer; }
.wachip.ok { color: #2E7D32; }
.svwarn { margin-bottom: 14px; }
.mytasks { margin-bottom: 14px; }
@media (max-width: 1400px) { .asgrid { grid-template-columns: 280px minmax(0, 1fr); } .asside { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; } .tiles.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* админка, долги в накладной, кассовый отчёт */
.debtfloat { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 16px; border-radius: 16px; }
.debtfloat > svg.i { width: 22px; height: 22px; flex: none; }
.debtfloat b { display: block; font-weight: 600; }
.debtfloat small { font-size: 12px; opacity: .85; }
.debtfloat.new { background: #F1F2F7; color: var(--ink); }
.debtfloat.mid { background: #FFF3D6; color: #7A4F00; }
.debtfloat.old { background: #FBE6E4; color: #9E2E28; }
.debtfloat.we { background: var(--blue-bg); color: var(--blue); }
.whhint { display: block; font-size: 11px; color: var(--blue); white-space: nowrap; }
.whhint.out { color: var(--bad); }
.tbl.cday tr.first td { border-top: 2px solid var(--line); }
.tbl.cday tr.sub td { background: var(--surface-2); font-size: 13px; }
.tbl.cday tr.tot td { background: var(--blue-bg); }
.topbar { flex-wrap: nowrap; }
.topbar > * { white-space: nowrap; flex-shrink: 0; }
.tsearch { flex-shrink: 1; min-width: 180px; }
.tsearch span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1600px) { .tstrip { display: none; } }
/* очередь заявок */
.qcards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.qc { text-align: left; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.qc b { font-size: 26px; font-weight: 600; line-height: 1.1; }
.qc span { font-size: 13px; font-weight: 500; }
.qc small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qc.on { outline: 3px solid rgba(40, 73, 223, .25); border-color: var(--blue); }
.qc.qn b { color: var(--blue); } .qc.qr b { color: #B7791F; } .qc.qt b { color: #7A5AF8; } .qc.qp b { color: #2E7D32; } .qc.qx b { color: var(--bad); } .qc.qret b { color: var(--muted); }
.qb { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.qb.qn { background: var(--blue-bg); color: var(--blue); } .qb.qr { background: #FFF3D6; color: #8A5A00; } .qb.qt { background: #F0EBFF; color: #5B3FD6; } .qb.qp { background: var(--lime); color: var(--lime-ink); } .qb.qx { background: var(--bad-bg); color: var(--bad); }
.badge.aw { background: #E8F4FF; color: #1663B8; }
.badge.aw svg.i { width: 12px; height: 12px; }
.tbl tr.qnew td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.hist { margin-top: 14px; padding: 0; }
.hist summary { cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 8px; font-weight: 500; list-style: none; }
.hist summary svg.i { width: 16px; height: 16px; }
.hrow2 { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; padding: 9px 18px; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.pastebtn { flex: none; }
@media (max-width: 1280px) { .qcards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* поиск внутри карточки номенклатуры */
.nomhead { gap: 12px; padding: 12px 14px 12px 18px; flex-wrap: wrap; }
.nomhead .crumbs { flex: none; }
.nomhead .crumbs .cnt { margin-left: 6px; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--milk); }
.nomhead .faint.cnt { margin-left: 6px; }
.nomsearch { flex: 1 1 280px; max-width: 460px; position: relative; }
.nomsearch .inp { height: 40px; background: var(--milk); border-color: transparent; }
.nomsearch .inp:focus { background: var(--surface); border-color: var(--blue); }
.nomsearch .clr { position: absolute; right: 6px; top: 7px; }
.nomhead .right { margin-left: auto; }
.tiles.seven { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.wsrow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line-2); }
.wsrow.off { opacity: .5; }
.wsrow svg.i { width: 18px; height: 18px; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tbl tr.off td { opacity: .55; }
/* единый вид шапок: заголовок слева, кнопки справа в одну линию */
.head { align-items: center; flex-wrap: nowrap; }
.head .t { min-width: 0; }
.head .t .sub { max-width: 640px; }
.head > .btn, .head > .seg, .head > .bigplus, .head > .qa, .head > .search { flex-shrink: 0; }
.head .actrow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1280px) { .head { flex-wrap: wrap; } }
/* сайдбар тянется на всю высоту длинных страниц */
.app { background: linear-gradient(90deg, #0B1126 0, #0B1126 236px, transparent 236px); }
.toasts { top: 76px; }
/* колокольчик справа вверху */
.topbar .bell { position: relative; top: auto; right: auto; width: 42px; height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); flex: none; }
.topbar .bell:hover, .topbar .bell.on { background: var(--milk); }
.topbar .ratechip { margin-left: auto; }
.bellp { left: auto; right: 24px; top: 70px; }
.brand { padding-right: 10px; }
.acts { margin-bottom: 18px; }
.act { min-height: 132px; }

/* ===== тёмная тема (выбор в «Моё место») ===== */
body.dark {
  --ink: #E6E9F2; --muted: #A2A9BF; --faint: #737B95; --milk: #0C1020; --surface: #151A2D; --surface-2: #1A2036; --glass: rgba(21, 26, 45, .9);
  --blue: #7B95FF; --blue-2: #8FA6FF; --blue-bg: #1D2856; --night: #05070F; --lime-ink: #2F4A00;
  --line: #283050; --line-2: #1F2640; --bad: #FF7A72; --bad-bg: #3A1D21; --warn: #F5C263; --warn-bg: #352A12; --ok: #7BD389; --ok-bg: #17301D;
  --kaspi: #FF5A61; --kaspi-bg: #3A1A1E; --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
body.dark .main { background: radial-gradient(ellipse at 10% 0%, rgba(83, 118, 255, .18) 0%, transparent 30%), radial-gradient(ellipse at 100% 0%, rgba(52, 75, 224, .2) 0%, transparent 30%), linear-gradient(180deg, #121833 0%, var(--milk) 300px); background-repeat: no-repeat; }
body.dark .inp, body.dark .ci, body.dark select.inp, body.dark textarea.inp { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
body.dark .tbl th { background: var(--surface-2); }
body.dark .tbl tbody tr.click:hover td, body.dark .li:hover, body.dark .fold:hover { background: #1E2540; }
body.dark .tbl tr.sel td, body.dark .li.fresh, body.dark .aslist .li.on { background: #1C2550; }
body.dark .btn { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
body.dark .btn.primary { color: #fff; }
body.dark .btn.lime, body.dark .tile.on, body.dark .fold.on, body.dark .nav button.on, body.dark .chip.on, body.dark .badge.ok { color: #1A2A00; }
body.dark .btn.ghost { background: transparent; }
body.dark .chip, body.dark .seg { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
body.dark .seg button.on { background: var(--surface); color: var(--ink); }
body.dark .badge { background: #222A45; }
body.dark .badge.tag { background: #222A45; color: var(--ink); }
body.dark .frail, body.dark .msgs, body.dark .newline, body.dark .tbl.cday tr.sub td, body.dark .spark, body.dark .split2 div, body.dark .cstats div, body.dark .shiftgrid > div, body.dark .shiftgrid > label { background: var(--surface-2); }
body.dark .box .subs span { background: var(--surface-2); }
body.dark .tbl th.res, body.dark .tbl td.res { background: rgba(255, 255, 255, .03); }
body.dark .lvl.g { background: #17301D; color: #8FE09B; } body.dark .lvl.y { background: #352A12; color: #F5C263; } body.dark .lvl.r { background: #3A1D21; color: #FF8E86; }
body.dark .agebadge.new, body.dark .agecards .new, body.dark .debtbox.new, body.dark .debtfloat.new { background: #222A45; color: var(--ink); }
body.dark .agebadge.mid, body.dark .agecards .mid, body.dark .debtbox.mid, body.dark .debtfloat.mid, body.dark .qb.qr { background: #352A12; color: #F5C263; }
body.dark .agebadge.old, body.dark .agecards .old, body.dark .debtbox.old, body.dark .debtfloat.old, body.dark .qb.qx { background: #3A1D21; color: #FF8E86; }
body.dark .qb.qt { background: #2A2350; color: #B9A6FF; } body.dark .badge.aw { background: #15304A; color: #7CC0FF; }
body.dark .dl.up { background: #17301D; color: #7BD389; } body.dark .dl.down { background: #3A1D21; color: #FF8E86; }
body.dark .tip.short { background: #352A12; color: #F5C263; } body.dark .tip.kit { background: #1F2E12; color: #CDEB8F; } body.dark .kitchip { background: #1F2E12; color: #CDEB8F; border-color: #3E5A20; }
body.dark .tbl tr.neg td { background: #2A1719; } body.dark .tbl tr.pos td { background: #172040; } body.dark .tbl tr.okr td { background: #142418; }
body.dark .msg .bub { background: var(--surface); border-color: var(--line); }
body.dark .ratechip, body.dark .tsearch, body.dark .topbar .bell { background: var(--surface); border-color: var(--line); color: var(--ink); }
body.dark .area line[stroke="#EEF0F7"], body.dark .chart line { stroke: #283050; }
body.dark .area .hv circle { fill: var(--surface); }
body.dark .modal-bg { background: rgba(0, 0, 0, .55); }
body.dark .gate-form { background: var(--milk); }
body.dark .act .ic { background: #1D2856; }
body.dark .box.total { background: linear-gradient(160deg, var(--surface) 0%, #1A2350 100%); }
body.dark .kcol { background: rgba(255, 255, 255, .03); }
body.dark .app { background: linear-gradient(90deg, #070A16 0, #070A16 236px, transparent 236px); }
body.dark .hbar, body.dark .seg3, body.dark .mseg { --empty: #222A45; }
body.dark .hbar { background: #222A45; }

/* ===== спокойные уведомления: маленькие, снизу справа, не перекрывают работу ===== */
.toasts { top: auto !important; bottom: 20px; right: 20px; gap: 6px; }
.toast { padding: 8px 10px 8px 14px; border-radius: 12px; font-size: 13px; gap: 10px; box-shadow: 0 6px 18px rgba(16, 20, 38, .22); max-width: 420px; opacity: .96; }
.toast .btn { height: 28px; font-size: 12.5px; }
.toast svg.i { width: 15px; height: 15px; }
.bell.ping { animation: ping .9s ease-out 1; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(40, 73, 223, .45); } 100% { box-shadow: 0 0 0 12px rgba(40, 73, 223, 0); } }
.topbar .themebtn { margin-left: auto; } .topbar .themebtn + .ratechip { margin-left: 0; } .topbar .themebtn .dotn { display: none; }
.iconbtn { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--surface-2); }
.iconbtn svg.i { width: 18px; height: 18px; }
body.dark .who .av, body.dark .av.sm, body.dark .ratechip .cur { color: #151927; } body.dark .act.hero .ic { background: rgba(255,255,255,.95); }
.mgin { display: inline-flex; align-items: center; gap: 2px; border-radius: 10px; padding-right: 8px; } .mgin .ci { width: 52px; text-align: right; background: transparent; border: 0; font-weight: 600; } .mgin i { font-style: normal; font-weight: 600; } .mgin.good { background: #E7F8E1; color: #2E7D32; } .mgin.mid { background: #FFF3D6; color: #8A5A00; } .mgin.bad { background: #FBE6E4; color: #B3352F; } .mgin b { padding: 4px 0 4px 8px; } .mgcell small { display: block; font-size: 11px; } body.dark .mgin.good { background: #17301D; color: #8FE09B; } body.dark .mgin.mid { background: #352A12; color: #F5C263; } body.dark .mgin.bad { background: #3A1D21; color: #FF8E86; }
/* валюта, маржа, долги по магазинам, прайс */
.usub { display: block; font-size: 11px; color: var(--faint); font-weight: 400; line-height: 1.2; white-space: nowrap; }
.curseg { margin-left: auto; }
.curseg button { padding: 0 10px; }
.topbar .curseg + .themebtn { margin-left: 0; }
.mgin.money { margin-left: 4px; } .mgin.money .ci { width: 70px; }
.btn.mgon { background: var(--lime); border-color: transparent; color: #1A2A00; }
.dstores { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.ipblock { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.dtbl { margin-top: 6px; } .dtbl td { height: 40px; }
.plgrid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.plset .field > span { font-size: 12px; }
.plfolders { max-height: 260px; overflow: auto; display: grid; gap: 2px; margin-top: 4px; }
.plf { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.pltbl tr.plg td { background: var(--surface-2); font-size: 13px; }
#print .plg td { background: #eee; }
.head { flex-wrap: wrap; row-gap: 12px; }
.head .t { flex: 1 1 340px; }

/* ассистент: журнал действий вместо переписок */
.asgrid2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; margin-top: 14px; align-items: start; }
.jrsum { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 12px; }
.jrst { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; }
.jrst small { display: block; color: var(--muted); font-size: 12px; }
.jrst.on { border-color: var(--blue); background: var(--blue-bg); }
.jrst.tot { cursor: default; background: transparent; border-style: dashed; }

/* прайс поставщика */
.spsetup { display: grid; grid-template-columns: minmax(220px, 1.2fr) auto minmax(260px, 1.4fr); gap: 16px; align-items: start; }
.spsetup .field small { display: block; margin-top: 6px; font-size: 12px; }
.spcols { margin-top: 12px; } .spcols summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.spsum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.spmode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 12px 16px; }
.sptbl td { vertical-align: top; } .sptbl td.name small { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.spour { display: flex; align-items: flex-start; gap: 8px; } .spour > span { flex: 1; }
.spcand { display: flex; flex-wrap: wrap; gap: 6px; } .spcand .chip { font-size: 12px; }
.sppick { display: grid; gap: 4px; min-width: 300px; padding: 8px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 24px rgba(20, 30, 60, .08); }
.spopt { text-align: left; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.spopt:hover { background: var(--blue-bg); } .spopt small { display: block; color: var(--muted); font-size: 12px; }
.spfoot { position: sticky; bottom: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; z-index: 5; }
@media (max-width: 1100px) { .spsetup { grid-template-columns: 1fr; } .spsum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.modal.wide:has(.rfmodal) { width: min(1080px, calc(100vw - 48px)); }
.rfmodal .sptbl td.name { max-width: 300px; }

/* значок сохранения в общую базу */
#syncb { display: inline-flex; margin-left: 10px; }
.syncb { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.syncb i { width: 8px; height: 8px; border-radius: 50%; background: #2BAA63; display: inline-block; }
.syncb.wait i { background: #F2B640; animation: syncp 1s infinite alternate; }
.syncb.bad { color: #C9372C; font-weight: 600; } .syncb svg { width: 14px; height: 14px; }
@keyframes syncp { to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .syncb.wait i { animation: none; } }

/* архив и корзина */
.archbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.archbar .faint { flex-basis: 100%; }

/* переезд с МоегоСклада */
.msgrid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.msmap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.msmap h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.msmap .kv select { max-width: 200px; height: 34px; }
.msbanner { margin-bottom: 12px; }
@media (max-width: 1100px) { .msgrid, .msmap { grid-template-columns: 1fr; } }

.aikgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 12px; }
@media (max-width: 1000px) { .aikgrid { grid-template-columns: 1fr; } }

/* ================= мобильная CRM ================= */
.m-app { min-height: 100vh; background: var(--milk); padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.m-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--night); color: #fff; }
.m-top b { letter-spacing: .14em; font-size: 13px; }
.m-top .syncb { color: rgba(255, 255, 255, .75); }
.m-main { padding: 14px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }
.m-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.m-head h1 { margin: 2px 0 0; font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.m-kick { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); font-weight: 600; }
.m-card { background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 8px; min-width: 0; }
.m-lbl { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.m-inp { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); font-size: 16px; }
.m-inp:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
textarea.m-inp { min-height: 110px; resize: vertical; }
.m-row2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; }
.m-seg { display: flex; background: var(--milk); border-radius: 12px; padding: 3px; gap: 3px; }
.m-seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 13px; font-weight: 500; color: var(--muted); }
.m-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20, 25, 50, .1); }
.m-addbar { position: relative; }
.m-addbar .m-inp { padding-left: 40px; }
.m-sic { position: absolute; left: 12px; top: 13px; color: var(--faint); }
.m-sic svg { width: 18px; height: 18px; }
.m-dd { display: grid; gap: 2px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.m-opt { text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 10px 8px; min-height: 48px; display: grid; gap: 2px; }
.m-opt:active { background: var(--blue-bg); }
.m-opt small, .m-ln small, .m-item small { color: var(--muted); font-size: 12px; }
.m-empty { color: var(--muted); padding: 10px 4px; font-size: 14px; }
.m-tools { display: flex; gap: 8px; }
.m-ghost { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 500; font-size: 14px; }
.m-ghost svg, .m-btn svg, .m-item svg { width: 18px; height: 18px; }
.m-paste { display: grid; gap: 8px; }
.m-pv { display: grid; gap: 4px; font-size: 13px; max-height: 180px; overflow: auto; }
.m-chiprow { display: flex; align-items: center; gap: 8px; }
.m-chip { padding: 8px 12px; border-radius: 999px; background: var(--blue-bg); color: var(--blue); font-weight: 500; font-size: 14px; }
.m-x { border: 0; background: transparent; width: 40px; height: 40px; display: grid; place-items: center; color: var(--faint); border-radius: 10px; }
.m-x svg { width: 18px; height: 18px; }
.m-lines { display: grid; gap: 8px; }
.m-line { background: var(--surface); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; }
.m-ln { grid-column: 1 / -1; display: grid; gap: 2px; min-width: 0; }
.m-qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; width: max-content; }
.m-qty button { width: 44px; height: 42px; border: 0; background: var(--milk); font-size: 20px; }
.m-qty input { width: 56px; height: 42px; border: 0; text-align: center; font-size: 16px; font-weight: 600; background: var(--surface); }
.m-ls { display: flex; align-items: center; gap: 4px; justify-self: end; font-variant-numeric: tabular-nums; }
.m-empty2 { justify-items: center; text-align: center; padding: 26px 16px; color: var(--muted); }
.m-empty2 svg { width: 28px; height: 28px; color: var(--blue); }
.m-empty2 b { color: var(--ink); font-size: 16px; }
.m-total { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); z-index: 10; background: var(--night); color: #fff; border-radius: 20px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 10px 30px rgba(16, 20, 38, .35); }
.m-total > div:first-child { display: grid; }
.m-total b { font-size: 26px; font-variant-numeric: tabular-nums; }
.m-total small { color: rgba(255, 255, 255, .7); font-size: 12px; }
.m-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border: 0; border-radius: 14px; background: var(--lime); color: var(--lime-ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.m-btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; }
.m-card .m-btn.ghost { background: var(--milk); color: var(--ink); }
.m-btn:disabled { opacity: .5; }
.m-list, .m-links { display: grid; gap: 8px; }
.m-links { gap: 0; padding: 4px 14px; }
.m-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; width: 100%; min-height: 60px; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
.m-item > div { display: grid; gap: 3px; min-width: 0; }
.m-links .m-item { box-shadow: none; border-radius: 0; padding: 12px 0; border-top: 1px solid var(--line-2); }
.m-links .m-item:first-child { border-top: 0; }
.m-item span { display: inline-flex; align-items: center; gap: 8px; }
.m-item.danger { color: var(--bad); }
.m-who { display: flex; align-items: center; gap: 12px; }
.m-who > div { display: grid; }
.m-prod { gap: 10px; }
.m-pt { display: grid; } .m-pt small { color: var(--faint); font-size: 12px; }
.m-prices { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.m-prices b { color: var(--ink); }
.m-stock { display: flex; flex-wrap: wrap; gap: 6px; }
.m-stock span { padding: 5px 10px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 13px; }
.m-stock span.zero { background: var(--bad-bg); color: var(--bad); }
.m-stock span.res { background: var(--blue-bg); color: var(--blue); }
.m-prod .m-ghost { justify-self: start; }
.m-hint { color: var(--muted); font-size: 13px; padding: 0 4px; }
.m-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.m-tabs button { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 54px; border: 0; background: transparent; color: var(--faint); font-size: 11px; font-weight: 500; border-radius: 12px; }
.m-tabs button svg { width: 22px; height: 22px; }
.m-tabs button.on { color: var(--blue); }
.m-tabs button i { position: absolute; top: 4px; right: calc(50% - 22px); min-width: 18px; height: 18px; border-radius: 9px; background: var(--blue); color: #fff; font-size: 11px; font-style: normal; display: grid; place-items: center; padding: 0 5px; }
.m-back { padding: 8px 16px; }
.out { color: var(--bad); }
body.dark .m-app { background: var(--milk); }
body.dark .m-total { background: #0B0F1E; }
@media (max-width: 760px) {
  .gate { grid-template-columns: 1fr; }
  .gate-side { padding: 28px 20px; } .gate-side h1 { font-size: 30px; }
  .gate-form { padding: 16px; } .gate-card { width: 100%; }
  .toasts { left: 12px; right: 12px; top: calc(56px + env(safe-area-inset-top, 0px)); bottom: auto; }
}
.aikroles { display: grid; gap: 10px; }
.m-prow { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.m-prow input { margin-top: 3px; width: 18px; height: 18px; }

/* логотип AQUA (как в приложении AQUA WORK) */
.side .brand { display: flex; align-items: center; gap: 10px; }
.side .brand > div { display: grid; }
.brandlogo { border-radius: 10px; flex: none; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.m-brand { display: inline-flex; align-items: center; gap: 9px; }
.m-brand img { border-radius: 8px; }

/* взаиморасчёты: группы по валюте */
.curcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.curcard { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; color: inherit; }
.curcard small { color: var(--muted); font-size: 12px; } .curcard b { font-size: 18px; font-variant-numeric: tabular-nums; } .curcard .faint { font-size: 12px; }
.curcard.on { border-color: var(--blue); background: var(--blue-bg); }
@media (max-width: 760px) { .curcards { grid-template-columns: 1fr; } }
.tiles .tile b { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
