/* Студия: тёплый бежевый фон, тёмно-синее меню, белые карточки с крупным скруглением, мягкие пастельные кнопки. */
:root, :root:not([data-theme="light"]) {
  --bg: #f3efe7; --card: #ffffff; --ink: #14161c; --muted: #6f6d68; --line: #ece6db; --line-2: #ddd6c8;
  --side: #1d2848; --side-2: #26335a; --side-ink: #ffffff; --accent: #2f55e4; --accent-soft: #e2e8ff;
  --ok: #15803d; --ok-soft: #dcf5e4; --warn: #a16207; --warn-soft: #fbf0d6; --bad: #d92d20; --bad-soft: #fde6e3;
  --blue: #2f55e4; --blue-soft: #e2e8ff; --sand: #e9e3d6; --field: #f4f0e8;
  --r: 26px; --font: "Onest", system-ui, sans-serif;
  color-scheme: light;
}
body { background: var(--bg); color: var(--ink); }
h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 0 0 6px; }
h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 16px; }
h3 { font-weight: 800; }
.muted { color: var(--muted); }

/* меню */
.layout { grid-template-columns: 270px minmax(0, 1fr); }
.side { background: var(--side); padding: 26px 16px 18px; gap: 6px; }
.side .brand { padding: 0 8px 26px; gap: 12px; align-items: center; }
.side .brand i { width: 44px; height: 44px; transform: none; border-radius: 12px; background: #3563f0; display: grid; place-items: center; font: 800 22px/1 var(--font); font-style: normal; color: #fff; }
.side .brand i::before { content: "К"; }
.side .brand div { font: 800 21px/1.1 var(--font); color: #fff; }
.side .brand small { margin-top: 4px; font: 600 11px/1.3 var(--font); letter-spacing: .1em; text-transform: uppercase; color: #c3c9da; }
.side a { gap: 14px; justify-content: flex-start; padding: 13px 14px; border-radius: 16px; color: #fff; font: 700 17px/1 var(--font); }
.side a svg { width: 22px; height: 22px; flex: none; opacity: .9; }
.side a:hover { background: rgba(255,255,255,.06); }
.side a.on { background: var(--side-2); color: #fff; box-shadow: none; }
.side a .badge { margin-left: auto; background: #ffe2dd; color: #d92d20; font-weight: 800; min-width: 28px; text-align: center; }
.side-state { margin-top: auto; padding: 16px; border-radius: 18px; background: var(--side-2); color: #dfe3ee; font-size: 14px; line-height: 1.45; display: grid; gap: 8px; }
.side-state b { font: 700 11px/1 var(--font); letter-spacing: .12em; text-transform: uppercase; color: #aab2c8; }
.side-state span { display: flex; gap: 8px; align-items: baseline; }
.side-state span::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #34d399; transform: translateY(-1px); }
.side-state span.off::before { background: #f59e0b; }
.side .out { margin-top: 10px; color: #fff; font: 700 16px/1 var(--font); padding: 12px 14px; }
.main { padding: 32px clamp(16px, 2.6vw, 40px) 70px; }
.head { margin-bottom: 26px; align-items: center; }
.head .muted { font-size: 16px; }
.mbar { background: var(--side); color: #fff; }

/* элементы */
.card { border: 0; border-radius: var(--r); padding: 26px 28px; margin-bottom: 20px; box-shadow: 0 1px 0 rgba(20,22,28,.03); }
.btn { border: 0; border-radius: 14px; padding: 12px 20px; background: var(--sand); color: var(--ink); font-weight: 700; }
.btn:hover { filter: brightness(.97); border: 0; }
.btn.primary { background: var(--side); color: #fff; }
.btn.soft-blue { background: var(--blue-soft); color: var(--blue); }
.btn.soft-red, .btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.ghost.danger { background: transparent; }
.btn.sm { padding: 7px 12px; border-radius: 10px; }
label.f { font-weight: 700; font-size: 14px; color: var(--ink); gap: 8px; }
label.f small { font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input:not([type]), select, textarea {
  background: var(--field); border: 1.5px solid transparent; border-radius: 14px; padding: 12px 14px; font-size: 15px; transition: border-color .15s, background .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #c9c1b1; background: #fff; }
.switch { font-weight: 600; }
.pill { padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.savebar { border-radius: 20px; background: #fff; box-shadow: 0 10px 40px rgba(20,22,28,.12); border: 0; }
.toast { border-radius: 14px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* фильтры */
.filters { display: grid; gap: 18px; }
.filters .row1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: 16px; background: var(--sand); }
.seg button { border: 0; background: transparent; padding: 9px 14px; border-radius: 12px; font: 700 14px/1 var(--font); color: #5b5850; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.seg button span { font-weight: 600; color: #8b877e; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg button:hover:not(.on) { color: var(--ink); }

/* таблица предложений */
.tbl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tbl-head b { font-size: 19px; font-weight: 800; }
.tbl-head .muted { margin-left: 10px; }
table.offers-t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.offers-t th { text-align: left; font-size: 14px; font-weight: 700; color: #4a4843; padding: 12px 12px 14px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.offers-t td { padding: 18px 12px; border-bottom: 1.5px solid var(--line); vertical-align: middle; }
table.offers-t tr:last-child td { border-bottom: 0; }
table.offers-t tbody tr { cursor: pointer; transition: background .15s; }
table.offers-t tbody tr:hover td { background: #faf8f3; }
.t-time { font-size: 16px; letter-spacing: .02em; white-space: nowrap; }
.t-time small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.t-client b { display: block; font-weight: 800; font-size: 16px; }
.t-client small { color: var(--muted); font-size: 13px; }
.t-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-last { color: #4e5ea8; font-size: 14px; line-height: 1.35; max-width: 280px; }
.t-last small { display: block; color: var(--muted); }
.heat { height: 8px; border-radius: 8px; background: var(--sand); overflow: hidden; margin-top: 6px; min-width: 90px; }
.heat i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #5b8def, #f5a524, #ef4444); }
.heat-n { font-weight: 800; }
.trail { display: flex; flex-wrap: wrap; gap: 4px; }
.trail span { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--field); color: #a29c90; }
.trail span.on { background: var(--ok-soft); color: var(--ok); }
.st-draft { background: var(--sand); color: #5b5850; }
.st-sent { background: var(--blue-soft); color: var(--blue); }
.st-talk { background: var(--warn-soft); color: var(--warn); }
.st-won { background: var(--ok-soft); color: var(--ok); }
.st-lost { background: var(--bad-soft); color: var(--bad); }

/* редактор */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.ed-side { position: sticky; top: 20px; display: grid; gap: 0; }
.link-box { display: flex; gap: 8px; }
.link-box input { flex: 1; font-family: var(--mono); font-size: 12px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpis div { background: var(--field); border-radius: 16px; padding: 12px 14px; }
.kpis b { display: block; font-size: 22px; font-weight: 800; }
.kpis span { font-size: 12px; color: var(--muted); }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 440px; overflow: auto; }
.tl li { display: grid; grid-template-columns: 86px 1fr; gap: 10px; font-size: 14px; }
.tl time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl small { display: block; color: var(--muted); }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.shot { border-radius: 16px; overflow: hidden; background: var(--field); display: grid; }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; }
.shot.mobile img { aspect-ratio: 9 / 16; }
.shot .bar { display: flex; gap: 4px; padding: 8px; align-items: center; }
.shot .bar input { flex: 1; min-width: 0; font-size: 12px; padding: 6px 8px; background: #fff; }
.drop { border: 2px dashed var(--line-2); border-radius: 18px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; background: var(--field); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.list-ed { display: grid; gap: 10px; }
.list-ed .li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.list-ed .li > div { display: grid; gap: 6px; }
.money-sum { display: grid; gap: 6px; font-size: 15px; padding: 16px 18px; border-radius: 16px; background: var(--field); }
.money-sum div { display: flex; justify-content: space-between; }
.money-sum .tot { font-weight: 800; font-size: 18px; border-top: 1.5px solid var(--line-2); padding-top: 8px; margin-top: 4px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.color-in { width: 52px; height: 44px; padding: 3px; border-radius: 12px; border: 0; background: var(--field); }
details summary { cursor: pointer; font-weight: 600; }
@media (max-width: 1200px) { .ed { grid-template-columns: 1fr; } .ed-side { position: static; } .filters .row1 { grid-template-columns: 1fr 1fr; } .filters .row1 > :first-child { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .mbar { display: flex; }
  table.offers-t thead { display: none; }
  table.offers-t tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1.5px solid var(--line); }
  table.offers-t td { padding: 0; border: 0; }
  table.offers-t td.hide-m { display: none; }
}
/* вход */
.login { background: radial-gradient(circle at 75% 15%, #2c3b6b, var(--side) 60%); }
.login form { border-radius: var(--r); padding: 34px; }
.login .logo { font: 800 22px/1 var(--font); }
.login .logo i { width: 36px; height: 36px; transform: none; border-radius: 10px; background: #3563f0; }

/* Полосы прокрутки — тонкие, без стрелок */
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: rgba(128,136,150,.5) transparent; } }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,136,150,.45); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(128,136,150,.75); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
