/* ALICARS CRM — дизайн «Приложение». Акцент #ffbd27, зелёного нет. Стили только из этого файла (CSP: style-src 'self'). */
:root {
	--bg: #0b0b0b;
	--bg2: #101010;
	--card: #151515;
	--card2: #1b1b1b;
	--line: #262626;
	--line2: #353535;
	--text: #f4f4f4;
	--muted: #a8a8a8;
	--mut2: #7b7b7b;
	--accent: #ffbd27;
	--acc-i: #1c1400;
	--acc-s: rgba(255, 189, 39, .14);
	--err: #ff6b6b;
	--err-s: rgba(255, 107, 107, .13);
	--r: 18px;
	--rs: 10px;
	--gap: 12px;
	--shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
body.lock { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.2px; margin: 0 0 6px; }
h2 { font-size: 16px; font-weight: 650; margin: 26px 0 10px; }
h3 { font-size: 14px; font-weight: 650; margin: 0 0 8px; }
p { margin: 0 0 10px; }
img, video { max-width: 100%; }
code { background: #1d1d1d; border: 1px solid #2a2a2a; border-radius: 6px; padding: 0 5px; font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.inline { display: inline; margin: 0; }
.grow { flex: 1; min-width: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.err-text { color: #ff9a9a; }
.hide { display: none !important; }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 16px; height: 16px; }

/* ---------- каркас ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 236px; flex: none; position: sticky; top: 0; height: 100vh; background: #0d0d0d; border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.brand { font-weight: 800; letter-spacing: .4px; color: var(--text); font-size: 19px; }
.brand span { color: var(--accent); font-weight: 800; }
.brand:hover { text-decoration: none; }
.side .brand { padding: 4px 10px 16px; }
.nv { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 550; position: relative; }
.nv:hover { background: #171717; color: var(--text); text-decoration: none; }
.nv.on { background: var(--acc-s); color: var(--accent); }
.nv .cnt, .tb .cnt { margin-left: auto; background: var(--accent); color: var(--acc-i); font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; min-width: 20px; text-align: center; font-style: normal; }
.nv .cnt.e, .tb .cnt.e { background: var(--err); color: #210; }
.nvh { font-size: 11px; color: var(--mut2); text-transform: uppercase; letter-spacing: .6px; padding: 14px 12px 4px; }
.meuser { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.meuser .mu { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--text); }
.meuser .mu:hover { text-decoration: none; }
.meuser .mu b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meuser .mu small { display: block; color: var(--mut2); font-size: 11px; }
.meuser form { margin: 0; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 24px; min-height: 60px; border-bottom: 1px solid var(--line); background: rgba(11, 11, 11, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top .ttl { font-size: 16px; font-weight: 650; margin: 0 8px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.top .brand { display: none; }
.srch { position: relative; flex: 1; min-width: 150px; margin: 0; }
.srch svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--mut2); pointer-events: none; }
.srch input { padding-left: 36px; }
.top .srch { max-width: 420px; flex: 1 1 280px; }
.top .sp { flex: 1; }
.top .only-m { display: none; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px 24px 56px; flex: 1; }
.tabbar { display: none; }
.av { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #3a2f12, #1c1707); border: 1px solid #4a3c14; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.av.s { width: 30px; height: 30px; font-size: 11.5px; }
.av.l { width: 56px; height: 56px; font-size: 20px; }
.ib { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line2); background: transparent; color: var(--text); position: relative; cursor: pointer; padding: 0; flex: none; }
.ib:hover { background: #1c1c1c; text-decoration: none; }
.ib.acc { background: var(--accent); border-color: var(--accent); color: var(--acc-i); }
.ib.ghost { border: 0; }
.ib .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.ib .dot.e { background: var(--err); }

/* ---------- шторки (создать / ещё / профиль) ---------- */
.layer { position: fixed; inset: 0; z-index: 100; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .18s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 88%; background: var(--card); border-top: 1px solid var(--line2); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .22s ease-out; box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); padding-bottom: env(safe-area-inset-bottom); }
.sheet .grab { width: 42px; height: 4px; border-radius: 9px; background: #3a3a3a; margin: 9px auto 2px; flex: none; }
.sheet .sh { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px 6px; flex: none; }
.sheet .sh h3 { font-size: 17px; margin: 0; }
.sheet .sc { overflow-y: auto; padding: 8px 18px 22px; }
.sheet .sc form { margin: 0; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-list { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.menu-list > a, .menu-list > form > button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid #1d1d1d; background: none; color: var(--text); width: 100%; text-align: left; font: inherit; cursor: pointer; }
.menu-list > form:last-child > button, .menu-list > a:last-child { border-bottom: 0; }
.menu-list > a:hover, .menu-list > form > button:hover { background: #191919; text-decoration: none; }
.menu-list b { display: block; font-weight: 600; }
.menu-list small { display: block; color: var(--muted); font-size: 12.5px; }
.menu-list .grow { min-width: 0; }
.menu-list form { margin: 0; }
.fi { width: 38px; height: 38px; border-radius: 10px; background: #211c0d; color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.grid-m { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gm { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px; border-radius: 14px; background: #1a1a1a; border: 1px solid #2a2a2a; font-size: 12.5px; text-align: center; color: var(--text); position: relative; }
.gm:hover { text-decoration: none; border-color: #444; }
.gm.on { border-color: var(--accent); color: var(--accent); }
.gm svg { width: 24px; height: 24px; }
.gm .cnt { position: absolute; top: 6px; right: 8px; background: var(--err); color: #210; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 0 5px; }
.sheet .logout-row { margin-top: 14px; }

/* ---------- кнопки ---------- */
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border-radius: var(--rs); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: filter .15s, transform .05s, background .15s; text-decoration: none; }
.btn { background: var(--accent); color: var(--acc-i); border: 1px solid var(--accent); }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active, .btn-ghost:active { transform: scale(.98); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line2); font-weight: 550; }
.btn-ghost:hover { background: #1c1c1c; text-decoration: none; }
.btn-ghost.danger { border-color: #5a2f2f; color: #ff9a9a; }
.btn-ghost.danger:hover { background: var(--err-s); }
.btn.sm, .btn-ghost.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; }
.btn.xl { min-height: 48px; font-size: 15px; border-radius: 12px; padding: 10px 20px; }
.btn.blk, .btn-ghost.blk { width: 100%; }
.btn[disabled], .btn-ghost[disabled] { opacity: .4; pointer-events: none; }
a.btn-ghost, a.btn { text-align: center; }

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.form.inline-grid { max-width: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }
.form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
.form label.check { flex-direction: row; align-items: center; gap: 9px; color: var(--text); font-size: 14px; }
.form .span2 { grid-column: 1 / -1; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: #0e0e0e; border: 1px solid var(--line2); border-radius: var(--rs); padding: 9px 11px; min-height: 40px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s; color-scheme: dark; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--acc-s); }
textarea { resize: vertical; min-height: 80px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
input[type=file] { padding: 8px; }
input::placeholder, textarea::placeholder { color: #666; }
.form.row { flex-direction: row; flex-wrap: wrap; align-items: center; max-width: none; gap: 8px; margin: 8px 0 0; }
.form.row input, .form.row select { width: auto; min-height: 36px; padding: 6px 10px; font-size: 14px; }
.form.row > .grow { flex: 1 1 100%; min-width: 160px; width: auto; }
.form.row > .grow ~ * { flex: 0 0 auto; }
@media (min-width: 1100px) { .form.row > .grow { flex: 1 1 220px; } }
.form .row-label { flex-direction: row; align-items: center; gap: 6px; }
.form.filters { margin-bottom: 14px; }
.form.filters .reset { align-self: end; }
.w70 { width: 76px !important; } .w120 { width: 130px !important; } .w160 { width: 170px !important; }
.fbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.fbar select { width: auto; min-width: 140px; }
.fbar .srch { flex: 1 1 220px; }
.card-form { margin: 0; }

/* ---------- карточки, KPI ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: var(--gap); }
a.card { color: var(--text); display: block; }
a.card:hover { border-color: #3a3a3a; text-decoration: none; }
.card.in { padding: 0; overflow: hidden; }
.card.soft { background: var(--bg2); }
.card-alert, .card.alert { border-color: #6a3030 !important; background: linear-gradient(180deg, #1c1313, #151515); }
.card-label { color: var(--muted); font-size: 12px; }
.card-value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-h h3 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--gap); margin: 0 0 var(--gap); }
.cards .card { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.kpi { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; color: var(--text); transition: border-color .15s; }
a.kpi:hover { border-color: #4a4a4a; text-decoration: none; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 26px; font-weight: 700; line-height: 1.15; margin-top: 2px; letter-spacing: -.4px; }
.kpi .h { color: var(--mut2); font-size: 11.5px; margin-top: 2px; }
.kpi.alert { border-color: #6a3030; background: linear-gradient(180deg, #1c1313, #151515); }
.kpi.alert .v { color: var(--err); }
.kpi.hl { border-color: #5b4515; }
.kpi.hl .v { color: var(--accent); }
.hero { background: linear-gradient(135deg, #231b07, #151515 60%); border: 1px solid #4a3a12; border-radius: 22px; padding: 22px; margin-bottom: var(--gap); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 189, 39, .18), transparent 70%); pointer-events: none; }
.hero > * { position: relative; }
.hero h2 { font-size: 22px; margin: 4px 0 6px; }
.hero.alert { border-color: #6a3030; background: linear-gradient(135deg, #2a1414, #151515 60%); }
.hero.alert::after { background: radial-gradient(circle, rgba(255, 107, 107, .16), transparent 70%); }
.hero .btn { margin-top: 14px; }
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 16px; }
.ph h1 { margin: 0; }
.ph .sub { color: var(--muted); margin-top: 3px; }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.sec { margin: 24px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec h2 { margin: 0; font-size: 15px; }
.sec .n { color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 400; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); margin: 0 0 12px; font-size: 13.5px; }
.back:hover { color: var(--text); text-decoration: none; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .ei { width: 54px; height: 54px; border-radius: 50%; background: #1c1c1c; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--mut2); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.empty .btn, .empty .btn-ghost { margin-top: 12px; }
.flash { padding: 10px 14px; border-radius: var(--rs); margin: 0 0 14px; border: 1px solid var(--line2); background: var(--card2); }
.flash.ok { background: var(--acc-s); border-color: #5b4515; color: #ffd77a; }
.flash.err { background: var(--err-s); border-color: #6a3030; color: #ffb0b0; }
.bar { height: 6px; border-radius: 99px; background: #262626; overflow: hidden; }
.storage-bar, .a-bar { display: block; width: 100%; height: 6px; border: 0; border-radius: 99px; background: #262626; overflow: hidden; -webkit-appearance: none; appearance: none; accent-color: var(--accent); margin-top: 6px; }
.storage-bar::-webkit-progress-bar, .a-bar::-webkit-progress-bar { background: #262626; border-radius: 99px; }
.storage-bar::-webkit-progress-value, .a-bar::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
.storage-bar::-moz-progress-bar, .a-bar::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
.card-alert .storage-bar::-webkit-progress-value { background: var(--err); }
.a-bar { min-width: 60px; height: 5px; }

/* ---------- бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: #262626; color: #cfcfcf; white-space: nowrap; }
.badge.ok { background: var(--acc-s); color: var(--accent); }
.badge.err, .badge.danger { background: var(--err-s); color: var(--err); }
.badge.warn { background: var(--acc-s); color: var(--accent); }
.badge.o { background: transparent; border: 1px solid var(--line2); color: var(--muted); }
.badge[class*="stage-"] { color: hsl(var(--h) var(--sat, 85%) 72%); background: hsl(var(--h) var(--sat, 60%) 50% / .15); }
.badge.stage-new { --h: 215; }
.badge.stage-contact { --h: 195; }
.badge.stage-selection { --h: 265; }
.badge.stage-reservation { --h: 43; }
.badge.stage-contract { --h: 33; }
.badge.stage-payment { --h: 20; }
.badge.stage-delivery { --h: 300; }
.badge.stage-closed { --h: 0; --sat: 0%; }
.badge.stage-lost { --h: 355; --sat: 70%; }
.badge.prio-hot { background: var(--err-s); color: #ff9d9d; }
.badge.prio-warm { background: var(--acc-s); color: var(--accent); }
.badge.prio-cold { background: #262c36; color: #9fb6d8; }
.badge-sale { background: var(--acc-s); color: var(--accent); }
.badge-sold { background: #2a2a2a; color: #cfcfcf; }
.badge-archive { background: #202020; color: #777; }
.badge-reserved { background: hsl(265 60% 50% / .16); color: hsl(265 85% 78%); }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-bottom: var(--gap); }
.table th { text-align: left; color: var(--mut2); font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #121212; }
.table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #1d1d1d; vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #181818; }
.table tr.inactive td, .table tr.inactive-soft td { opacity: .55; }
.table tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.table.compact td { padding: 8px 12px; }
.table.compact th { padding: 9px 12px; }
.table td.num, .table th.num { text-align: right; }
.table td .badge + .badge { margin-left: 4px; }
.table td form.inline + form.inline, .table td form.inline + a, .table td a + form.inline { margin-left: 6px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #1d1d1d; }
.row-between:first-of-type { border-top: 0; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 18px 0; color: var(--muted); }
.pager a { display: inline-flex; padding: 7px 14px; border: 1px solid var(--line2); border-radius: var(--rs); color: var(--text); }
.pager a:hover { background: #1c1c1c; text-decoration: none; }

/* ---------- списки-строки ---------- */
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #1d1d1d; color: var(--text); position: relative; }
.li:last-child { border-bottom: 0; }
a.li:hover { background: #191919; text-decoration: none; }
.li .t1 { font-weight: 600; }
.li .t2 { color: var(--muted); font-size: 12.5px; }
.li.ov { box-shadow: inset 3px 0 0 var(--err); }
.li form { margin: 0; flex: none; }
.li .grow a { color: inherit; }
.li .end { text-align: right; flex: none; }
.err-t { color: var(--err); }

/* заявки */
.lead { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #1d1d1d; }
.lead:last-child { border-bottom: 0; }
.lead.ov { box-shadow: inset 3px 0 0 var(--err); }
.lead .who { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.lead .nm { font-weight: 650; font-size: 15px; }
.lead .meta { color: var(--muted); font-size: 12.5px; }
.lead .meta a { color: inherit; text-decoration: underline; text-decoration-color: #444; }
.lead .want { margin-top: 3px; }
.lead .acts { display: flex; gap: 8px; align-items: center; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.lead .acts form { margin: 0; }

/* ---------- клиент ---------- */
.chead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.chead h1 { margin: 0 0 2px; }
.chead .meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.chead .meta a { color: var(--text); }
.chead .btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.site-line { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.tabs-s { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; }
.tabs-s::-webkit-scrollbar { display: none; }
.tabs-s button { border: 0; background: transparent; color: var(--muted); padding: 10px 13px; font: inherit; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs-s button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tabs-s button .c { background: #262626; color: #ddd; border-radius: 99px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.tabs-js .tpane { display: none; }
.tabs-js .tpane.on { display: block; }
.tabs-s { display: none; }
.tabs-js .tabs-s { display: flex; }
.tpane > h2:first-child { margin-top: 4px; }
.pane-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.grid2 section > h2:first-child { margin-top: 12px; }
.card.deal { margin-bottom: 12px; }
.deal-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.card.inactive { opacity: .7; }
.next-task { margin: 0 0 12px; }
.next-task .t { font-size: 15.5px; font-weight: 650; margin: 3px 0 10px; }
.next-task .row { display: flex; gap: 8px; flex-wrap: wrap; }
.next-task form { margin: 0; }
details.card summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::before { content: "+"; color: var(--accent); font-weight: 700; width: 14px; }
details.card[open] summary::before { content: "−"; }
details.card[open] summary { margin-bottom: 12px; }
.note { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; }
.deal-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* маршрут заказа */
.rt { display: flex; align-items: flex-start; overflow-x: auto; padding: 8px 0 10px; scrollbar-width: thin; margin: 0; list-style: none; }
.rt li { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 78px; flex: 1 0 78px; position: relative; font-size: 11.5px; color: var(--mut2); text-align: center; }
.rt li i { width: 14px; height: 14px; border-radius: 50%; background: #2a2a2a; border: 2px solid #3a3a3a; z-index: 1; display: block; }
.rt li::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: #2a2a2a; }
.rt li:first-child::before { display: none; }
.rt li.done i { background: var(--accent); border-color: var(--accent); }
.rt li.done::before, .rt li.cur::before { background: var(--accent); }
.rt li.cur i { background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 4px var(--acc-s); }
.rt li.done, .rt li.cur { color: var(--text); }
.rt li.cur { font-weight: 650; }
.ocard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: var(--gap); }
.ocard.inactive { opacity: .6; }
.ocard .oh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ocard .ot { font-weight: 650; font-size: 15px; }
.ocard .om { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ocard .ob { margin-top: 8px; }
.ocard .ofoot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: 12.5px; }

/* воронка */
.kbw { overflow-x: auto; padding-bottom: 10px; margin: 0 -24px; padding-left: 24px; padding-right: 24px; scroll-snap-type: x proximity; scroll-padding: 0 24px; }
.kanban { display: flex; gap: 10px; align-items: flex-start; min-width: max-content; }
.kanban-col { flex: 0 0 236px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 8px; min-height: 120px; scroll-snap-align: start; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 8px; }
.kanban-card { display: block; background: var(--card); border: 1px solid #2a2a2a; border-radius: 12px; padding: 10px; margin-bottom: 7px; color: var(--text); transition: border-color .12s, transform .12s; }
.kanban-card:hover { border-color: #555; transform: translateY(-1px); text-decoration: none; }
.kanban-card .kn { font-weight: 600; }
.kanban-card .kt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.kanban-empty { color: var(--mut2); font-size: 12.5px; padding: 6px; }

/* авто */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.ccard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 9px; }
.ccard .ph-img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 12px; background: #111; }
.ccard .no-ph { height: 150px; border-radius: 12px; background: linear-gradient(135deg, #222, #141414); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .35); }
.ccard .no-ph svg { width: 64px; height: 64px; stroke-width: 1.3; }
.ccard .ct { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ccard .ct a { color: var(--text); font-weight: 650; }
.ccard .cp { font-size: 17px; font-weight: 700; }
.ccard .cm { color: var(--muted); font-size: 12px; }
.car-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.car-actions form { margin: 0; }
.cars-head { align-items: center; }
.media-thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; vertical-align: middle; margin-right: 8px; background: #222; }

/* загрузка */
.uploader { border: 1.5px dashed #3a3a3a; border-radius: 14px; padding: 14px; }
.upload-list:empty { display: none; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid #2a2a2a; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row progress { width: 100%; accent-color: var(--accent); }
.upload-error .muted { color: #ff9a9a; }
.car-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.car-video { margin: 0; }
.car-video video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; margin-bottom: 8px; }
.car-video-wait { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: #161616; border-radius: 10px; margin-bottom: 8px; padding: 8px; text-align: center; }

/* ---------- аналитика ---------- */
.a-tabs, .a-periods { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px 0 14px; padding-bottom: 2px; }
.a-tabs::-webkit-scrollbar, .a-periods::-webkit-scrollbar { display: none; }
.a-tabs { background: #0e0e0e; border: 1px solid var(--line2); border-radius: 14px; padding: 4px; gap: 2px; width: max-content; max-width: 100%; }
.a-tabs a { padding: 7px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.a-tabs a:hover { color: var(--text); text-decoration: none; }
.a-tabs a.active { background: var(--accent); color: var(--acc-i); font-weight: 650; }
.a-periods a { padding: 5px 12px; border: 1px solid var(--line2); border-radius: 999px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.a-periods a.active { background: var(--accent); border-color: var(--accent); color: var(--acc-i); }
.a-block { margin-bottom: var(--gap); overflow-x: auto; }
.a-block h3 { margin: 0 0 10px; }
.a-block .table { margin-bottom: 0; border: 0; border-radius: 0; background: transparent; }
.a-block td { overflow-wrap: anywhere; }
.a-hot { color: var(--accent); font-weight: 600; }
.a-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.a-head h1 { margin-bottom: 0; }
.a-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 14px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.a-filter label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.a-filter label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; padding-bottom: 9px; }
.a-filter select, .a-filter input[type=date], .a-filter input[type=search] { width: auto; min-height: 38px; padding: 7px 10px; font-size: 14px; }
.a-filter .a-search input { min-width: 200px; }
.a-dates { display: none !important; }
.a-dates.a-dates-on { display: flex !important; }
.a-dates-row { display: flex; gap: 6px; }
.a-kpis { margin-top: 0; margin-bottom: var(--gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.a-kpi { padding: 13px 14px; }
.a-kpi .card-value { font-size: 24px; letter-spacing: -.3px; }
.a-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.a-block-head h3 { margin: 0; }
.a-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: var(--gap); }
.a-kinds .a-kind { display: block; color: inherit; padding: 12px; margin: 0; border-radius: 14px; }
.a-kind.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.card .a-kinds { margin-bottom: 0; }
.srv-warn { margin: 6px 0 0; padding-left: 20px; }

/* вход */
.bare { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.auth-box { width: 100%; max-width: 400px; padding: 28px 26px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.auth-box h1 { font-size: 20px; text-align: center; margin: 0 0 14px; }
.brand.big { font-size: 26px; text-align: center; margin-bottom: 22px; display: block; }
.auth-box .form { max-width: none; }
.auth-box .btn { width: 100%; min-height: 46px; }
.steps { color: var(--muted); padding-left: 20px; margin: 0 0 16px; font-size: 14px; }
.steps li { margin-bottom: 4px; }
.qr { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr img { background: #fff; padding: 10px; border-radius: 14px; image-rendering: pixelated; }
code.secret { color: var(--text); background: #0f0f0f; padding: 2px 6px; border-radius: 6px; letter-spacing: 1px; word-break: break-all; }

/* ---------- планшет и телефон ---------- */
@media (max-width: 1100px) {
	.kpis, .a-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
	html, body { font-size: 15px; }
	.side { display: none; }
	.top { padding: 8px 12px; min-height: 56px; }
	.top .brand { display: block; font-size: 19px; }
	.top .ttl, .top .srch, .top .only-d { display: none; }
	.top .only-m { display: inline-flex; }
	.top .back-m { display: inline-flex; }
	.top.sub .brand { display: none; }
	.top.sub .ttl { display: block; font-size: 17px; margin: 0; }
	.container { padding: 14px 14px 96px; }
	.tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(14, 14, 14, .96); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
	.tb { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 4px; border: 0; background: none; color: var(--mut2); font: inherit; font-size: 11px; font-weight: 550; border-radius: 12px; position: relative; cursor: pointer; }
	.tb:hover { text-decoration: none; }
	.tb.on { color: var(--accent); }
	.tb .cnt { position: absolute; top: 0; left: calc(50% + 6px); margin: 0; font-size: 10px; padding: 0 5px; min-width: 16px; }
	h1 { font-size: 21px; }
	.ph { margin-bottom: 12px; }
	.kpis { gap: 9px; }
	.kpi { padding: 10px 12px; }
	.kpi .v { font-size: 22px; }
	.hero { padding: 18px; border-radius: 20px; }
	.hero h2 { font-size: 20px; }
	.hero .btn { width: 100%; }
	.form.inline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.grid2, .pane-grid { grid-template-columns: 1fr; gap: 0; }
	.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.card { padding: 14px; }
	input, select, textarea { font-size: 16px; min-height: 46px; }
	.form.row input, .form.row select { min-height: 42px; font-size: 16px; }
	.btn, .btn-ghost { min-height: 44px; }
	.btn.sm, .btn-ghost.sm { min-height: 38px; }
	.fbar select { flex: 1; min-width: 0; width: 100%; }
	.a-filter label, .a-filter .a-search input { flex: 1 1 140px; min-width: 0; }
	.a-filter select, .a-filter input { width: 100%; }
	.kbw { margin: 0 -14px; padding-left: 14px; padding-right: 14px; scroll-padding: 0 14px; }
	.kanban-col { flex-basis: 78vw; max-width: 300px; }
	.lead { flex-direction: column; align-items: stretch; gap: 10px; }
	.lead .acts { justify-content: flex-start; }
	.lead .acts .btn, .lead .acts .btn-ghost, .lead .acts form { flex: 1 1 auto; }
	.lead .acts form .btn, .lead .acts form .btn-ghost { width: 100%; }
	.cgrid { grid-template-columns: 1fr; }
	.only-d { display: none !important; }
	.chead { gap: 12px; }
	.meuser { display: none; }
	.upload-row { grid-template-columns: 1fr; gap: 4px; }
	.car-actions .btn-ghost, .car-actions .btn { flex: 1 1 auto; }
	.car-actions form { flex: 1 1 auto; }
	.car-actions form .btn-ghost { width: 100%; }
	.pager { gap: 10px; }
	.sheet { max-height: 92%; }
}
@media (min-width: 861px) {
	.only-m { display: none !important; }
	.layer .sheet { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); max-height: 86%; border: 1px solid var(--line2); border-radius: 18px; animation: fade .18s; box-shadow: var(--shadow); padding-bottom: 0; }
	.layer .sheet .grab { display: none; }
	.layer .sheet .sh { padding: 14px 18px 6px; }
}

/* таблицы → карточки на телефоне (подписи расставляет crm.js) */
@media (max-width: 760px) {
	.table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
	.table.stack { background: transparent; border: 0; border-radius: 0; overflow: visible; }
	.table.stack thead { display: none; }
	.table.stack tr { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin-bottom: 10px; position: relative; overflow: hidden; }
	.table.stack tr.overdue { border-color: #6a3030; }
	.table.stack tr.overdue td:first-child { box-shadow: none; }
	.table.stack tbody tr:hover td { background: transparent; }
	.table.stack td { border: 0; padding: 4px 0; }
	.table.stack td:empty { display: none; }
	.table.stack td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; text-align: right; }
	.table.stack td[data-label]::before { content: attr(data-label); color: var(--mut2); font-size: 12px; text-align: left; flex: none; max-width: 40%; }
	.table.stack td .tv { min-width: 0; overflow-wrap: anywhere; }
	.table.stack td:first-child { font-size: 15px; font-weight: 600; text-align: left; padding-bottom: 6px; }
	.table.stack td:first-child::before { display: none; }
	.table.stack td:not([data-label]):not(:first-child) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 8px; }
	.table.stack td[colspan] { display: block; text-align: left; }
	.table.stack td[colspan]::before { display: none; }
	.table.stack td.small, .table.stack td .small { font-size: 12.5px; }
	.table.compact.stack tr { padding: 8px 12px; }
	.a-block .table.stack tr { background: #111; }
	.table.stack td.car-actions { display: flex; }
}
@media (max-width: 420px) {
	.kpis, .a-kpis { gap: 8px; }
	.kpi .v { font-size: 20px; }
	.grid-m { gap: 6px; }
}

/* ---------- добавки ---------- */
.dash { display: flex; flex-direction: column; }
.dash > * { flex: none; }
.dash .stor-free { font-size: 20px; margin: 10px 0 4px; }
.dash .stor-free .small { font-size: 12.5px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.seg { display: inline-flex; background: #0e0e0e; border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; }
.seg::-webkit-scrollbar { display: none; }
.seg a { padding: 6px 12px; border-radius: 9px; font-size: 13.5px; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.seg a:hover { color: var(--text); text-decoration: none; }
.seg a.on { background: var(--accent); color: var(--acc-i); font-weight: 650; }
.seg a .c { font-size: 11px; opacity: .75; }
.form.wide { max-width: none; }
.card.form.wide { padding: 16px; }
.li.done { opacity: .55; }
details#new { scroll-margin-top: 80px; }
.chead .meta code { font-size: 12px; }
.card .form { max-width: none; }
.card > .form:last-child, .card > p:last-child { margin-bottom: 0; }
.tpane > .card:last-child { margin-bottom: 0; }
.menu-list .fi { background: #211c0d; }
.table .who { gap: 10px; }
.hero .muted { color: #c9c2ad; }

@media (max-width: 860px) {
	.dash > .kpis { order: 5; }
	.dash > .stor { order: 6; }
	.dash > .card-form { margin-top: 0; }
	.dash > .kpis { margin-top: 18px; }
	.chead .btns .btn, .chead .btns .btn-ghost { flex: 1 1 auto; }
	.chead { flex-wrap: wrap; }
	.tabs-s { margin-left: -14px; margin-right: -14px; padding: 0 14px; }
	.tabs-s button { padding: 12px 13px; }
	.card.form.wide { padding: 14px; }
	.ocard { padding: 12px 14px; }
}

@media (min-width: 861px) { .table .who > :last-child { white-space: nowrap; } .table td { vertical-align: middle; } }
@media (max-width: 760px) { .table.stack td:empty, .tv td:empty { display: none; } }
.card h3:not(:first-child), .card h4:not(:first-child) { margin-top: 18px; }
