:root {
  --bg: #f5f3ee; --card: #fff; --ink: #1d1a2e; --muted: #6f6a7d; --line: #e7e2d9; --soft: #faf8f4;
  --accent: #f2b84b; --accent-ink: #3a2a05; --brand: #1d1a2e;
  --ok: #2f9e6d; --ok-bg: #e3f4ec; --warn: #b7791f; --warn-bg: #fdf1dc; --bad: #c2413b; --bad-bg: #fbe6e4; --info: #5b4bc4; --info-bg: #ece9fb;
  --r: 14px; --shadow: 0 1px 2px rgba(29,26,46,.06), 0 4px 14px rgba(29,26,46,.05);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.45 Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; } a:hover { color: var(--info); }
h1 { font-size: 23px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 14px; margin: 12px 0 8px; font-weight: 700; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; justify-content: center; }
.pos { color: var(--ok); font-weight: 700; } .neg { color: var(--bad); font-weight: 700; } .warn-t { color: var(--warn); }
.big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.done { text-decoration: line-through; color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.code { font-family: ui-monospace, Menlo, monospace; background: #f1eee8; padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin-right: 6px; vertical-align: middle; } .dot.big { width: 14px; height: 14px; }

/* ===== каркас ===== */
.layout { display: flex; min-height: 100vh; }
.side { width: 230px; background: var(--brand); color: #e9e6f5; padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; padding: 2px 8px 12px; color: #fff; text-decoration: none; }
.logo i { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-style: normal; color: var(--accent-ink); }
.nav { flex: 1; }
.nav-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7e789a; padding: 12px 10px 4px; }
.side .nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; text-decoration: none; color: #cfcae2; font-weight: 600; }
.side .nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side .nav a.on { background: rgba(242,184,75,.16); color: var(--accent); }
.side .ic { width: 20px; text-align: center; }
.cnt { margin-left: auto; background: rgba(255,255,255,.12); border-radius: 99px; padding: 0 7px; font-size: 11px; } .cnt.red { background: var(--bad); color: #fff; }
.side .me { font-size: 12px; color: #9d97b5; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; }
.side .me a { color: #cfcae2; }
.qsearch { position: relative; margin: 0 2px 6px; }
.qsearch input { background: rgba(255,255,255,.08); border: 0; color: #fff; padding: 8px 10px; }
.qsearch input::placeholder { color: #8f89a8; }
.dd { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; color: var(--ink); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-height: 320px; overflow-y: auto; }
.dd:empty { display: none; }
.dd a, .dd > div { display: block; padding: 8px 10px; text-decoration: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.dd a span { display: block; font-size: 12px; color: var(--muted); }
.dd a:hover, .dd > div:hover { background: var(--soft); }
.main { flex: 1; padding: 22px 28px 90px; min-width: 0; max-width: 1400px; }
.topbar, .bottom { display: none; }
@media (max-width: 900px) {
  .side { display: none; }
  .main { padding: 14px 12px 96px; }
  .layout { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: var(--brand); position: sticky; top: 0; z-index: 20; }
  .topbar .logo { padding: 0; font-size: 15px; }
  .tb-btn { background: none; border: 0; color: #cfcae2; font: inherit; font-size: 14px; padding: 4px 6px; }
  .bottom { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .bottom a { flex: 1; text-align: center; padding: 7px 2px 8px; font-size: 10.5px; font-weight: 700; color: var(--muted); text-decoration: none; }
  .bottom a span { display: block; font-size: 18px; line-height: 1.25; }
  .bottom a.on { color: var(--ink); }
  h1 { font-size: 20px; }
}
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid a { text-align: center; padding: 12px 4px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 13px; }
.menu-grid a span { display: block; font-size: 22px; }

/* ===== карточки и сетки ===== */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mbody .grid, .card .grid { gap: 10px; }
@media (max-width: 900px) { .g2, .g3 { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; } }
.stats { margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); text-decoration: none; display: block; }
.stat b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.stat > span { color: var(--muted); font-size: 12.5px; }
.card .stat { box-shadow: none; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 180px; }
.stack > * + * { margin-top: 8px; }
.filters { padding: 12px; } .filters select, .filters input:not([type=checkbox]) { width: auto; min-width: 150px; }
.filters .grow { width: auto; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; }
.prog-h { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 8px; } .prog-h h2 { margin: 0; }

/* списки */
.item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.item:last-child { border-bottom: 0; }
.item-main { flex: 1; min-width: 0; text-decoration: none; }
.item-main .t { font-weight: 600; } .item-main .s { color: var(--muted); font-size: 12.5px; }
a.item:hover, .clickable:hover { background: var(--soft); cursor: pointer; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--info-bg); color: var(--info); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 7px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
th.right, td.right { text-align: right; }
.table-wrap { overflow-x: auto; }
tr.clickable:hover td { background: var(--soft); }
.detail { background: var(--soft); border-radius: 10px; padding: 8px 12px; } .detail .row { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.dl { display: grid; grid-template-columns: 220px 1fr; gap: 6px 14px; margin: 0 0 12px; } .dl dt { color: var(--muted); } .dl dd { margin: 0; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl dt { margin-top: 6px; } }

/* строка клиента */
.list-card { padding: 4px 14px; }
.crow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.crow:last-child { border-bottom: 0; }
.crow .t { font-weight: 700; text-decoration: none; }
.crow .s { font-size: 12.5px; }
.crow .jn + .jn { margin-top: 6px; }
.selbox { width: 18px; height: 18px; }
.mini-actions { margin-top: 4px; gap: 10px; }
.lnk { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px; color: var(--info); cursor: pointer; font-weight: 600; }
@media (max-width: 900px) { .crow { grid-template-columns: 1fr; gap: 6px; } }
.bulk { margin: 8px 0; }
.state-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.state-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); border-left: 4px solid var(--c, var(--line)); }
.state-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); border-left-color: var(--c, var(--ink)); }
.state-tabs b { margin-left: 3px; }

/* канбан */
.kanban { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol { min-width: 230px; width: 230px; background: #ece8df; border-radius: 12px; padding: 8px; min-height: 120px; }
.khead { border-top: 4px solid; padding: 6px 4px 8px; font-size: 13px; }
.kcard { background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 7px; box-shadow: var(--shadow); cursor: grab; }
.kcard a { text-decoration: none; }

/* карточка клиента */
.client-head .money-box, .money-box { display: flex; gap: 8px; flex-wrap: wrap; }
.money-box > div { background: var(--card); border-radius: 12px; padding: 8px 14px; box-shadow: var(--shadow); min-width: 110px; }
.money-box span { display: block; font-size: 11.5px; color: var(--muted); } .money-box b { font-size: 17px; }
.state-sel { width: auto; border: 0; background: color-mix(in srgb, var(--c) 15%, white); color: var(--c); font-weight: 700; padding: 5px 10px; border-radius: 99px; }
.action-bar { margin-bottom: 12px; }
.contact-card { padding: 12px 16px; }
.sub .progress { margin: 8px 0; }
.msg { padding: 8px 10px; border-radius: 10px; background: var(--soft); margin: 6px 0; } .msg.in { background: var(--info-bg); }
.sumcard { text-align: center; margin-bottom: 10px; }

/* бейджи */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: #efedf3; color: var(--muted); vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.lvl { background: #fff4dc; color: #8a5a00; } .badge.mini { font-size: 10px; padding: 1px 6px; }

/* кнопки и формы */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; background: var(--ink); color: #fff; text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.15); color: #fff; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); } .btn.ghost:hover { background: var(--soft); color: var(--ink); }
.btn.danger { background: var(--bad-bg); color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(242,184,75,.5); border-color: var(--accent); }
input[type=color] { padding: 2px; height: 38px; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 500; cursor: pointer; }
.multi { display: flex; flex-wrap: wrap; gap: 2px 14px; max-height: 190px; overflow-y: auto; } .multi .check { margin-bottom: 4px; }
.picker { position: relative; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; font-weight: 700; padding: 9px 11px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--accent); }
.period { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .period input { width: auto !important; min-width: 0 !important; }
.pager { display: flex; gap: 4px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 8px; min-width: 34px; padding: 5px 8px; cursor: pointer; font: inherit; }
.pager button.on { background: var(--ink); color: #fff; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #d6d1c7; border-radius: 99px; cursor: pointer; transition: .2s; }
.switch i::after { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--ok); } .switch input:checked + i::after { left: 19px; }
.progress { height: 7px; background: #efedf3; border-radius: 99px; overflow: hidden; } .progress i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar { flex: 1; height: 8px; background: #efedf3; border-radius: 99px; overflow: hidden; min-width: 60px; } .bar i { display: block; height: 100%; background: var(--info); border-radius: 99px; } .bar.accent i { background: var(--accent); }
.brow { display: flex; align-items: center; gap: 10px; padding: 5px 0; text-decoration: none; } .brow > span { width: 40%; min-width: 120px; } .brow > b { min-width: 90px; text-align: right; }

/* группы */
.group-card { display: block; text-decoration: none; border-left: 5px solid #ccc; margin-bottom: 0; }
.group-card:hover { background: var(--soft); color: inherit; }

/* расписание */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } .week.one { grid-template-columns: 1fr; }
.daycols { display: grid; gap: 8px; overflow-x: auto; }
.day { background: var(--card); border-radius: 12px; padding: 8px; min-height: 120px; box-shadow: var(--shadow); }
.day.today { outline: 2px solid var(--accent); }
.day h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 700; cursor: pointer; }
.lesson { display: block; text-decoration: none; border-left: 4px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 9%, white); padding: 6px 8px; margin-bottom: 6px; font-size: 12px; line-height: 1.35; }
.lesson .ln { font-weight: 700; } .lesson.cancelled { opacity: .45; text-decoration: line-through; } .lesson.done { background: #f3f3f3; }
@media (max-width: 900px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* посещаемость */
.vrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.att { display: flex; gap: 5px; }
.att button { border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 42px; height: 38px; font-size: 15px; cursor: pointer; font-weight: 800; color: var(--muted); }
.att button.on.present { background: var(--ok); border-color: var(--ok); color: #fff; }
.att button.on.absent { background: var(--bad); border-color: var(--bad); color: #fff; }
.att button.on.sick { background: var(--warn); border-color: var(--warn); color: #fff; }
.vextra { display: flex; gap: 5px; } .grade { width: 70px !important; padding: 6px 8px; }
@media (max-width: 700px) { .vrow { grid-template-columns: 1fr auto; } .vextra { grid-column: 1 / -1; } }

/* модальные окна */
.modal-bg { position: fixed; inset: 0; background: rgba(20,18,32,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 540px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .modal-head h2 { margin: 0; }
.modal .x { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; align-items: center; } .modal .actions .sp { flex: 1; }
.modal .radio { align-items: center; margin: 0; padding: 10px 12px; }
.act-row { padding: 10px; margin-bottom: 8px; }
.rule { margin-bottom: 6px; }
@media (max-width: 900px) { .modal-bg { align-items: flex-end; padding: 0; } .modal, .modal.wide { border-radius: 16px 16px 0 0; max-height: 92vh; overflow-y: auto; padding-bottom: calc(18px + env(safe-area-inset-bottom)); } }

#toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--ink); color: #fff; padding: 9px 15px; border-radius: 10px; margin-top: 6px; font-weight: 600; box-shadow: var(--shadow); max-width: 90vw; }
#toast div.err { background: var(--bad); }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, #2c2747 0%, var(--brand) 60%); }
.login .card { width: 100%; max-width: 380px; padding: 24px; }
.login .logo { color: var(--ink); font-size: 19px; padding-bottom: 10px; }
.login .tabs { justify-content: center; }

/* кабинет родителя */
.kid { border-top: 4px solid var(--accent); }
.sub-mini { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; } .sub-mini .progress { margin: 6px 0; }

/* кабинет родителя: без бокового меню */
.parent-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--brand); position: sticky; top: 0; z-index: 20; }
.parent-top .logo { padding: 0; }
.parent-main { max-width: 720px; margin: 0 auto; padding-bottom: 40px; }

/* журнал посещаемости */
.journal-wrap { overflow-x: auto; }
table.journal { border-collapse: separate; border-spacing: 0; width: auto; min-width: 100%; }
table.journal th, table.journal td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 0; text-align: center; min-width: 38px; height: 36px; vertical-align: middle; }
table.journal th { font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--soft); padding: 4px 2px; }
table.journal th a { text-decoration: none; display: block; } table.journal th span { color: var(--muted); font-weight: 500; font-size: 11px; }
table.journal .jn { position: sticky; left: 0; background: #fff; text-align: left; padding: 4px 10px; min-width: 190px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
table.journal th.jn { background: var(--soft); }
td.jc { cursor: pointer; font-weight: 800; user-select: none; }
td.jc:hover { background: var(--soft); outline: 2px solid var(--accent); outline-offset: -2px; }
td.jc.present { background: var(--ok-bg); color: var(--ok); } td.jc.absent { background: var(--bad-bg); color: var(--bad); } td.jc.sick { background: var(--warn-bg); color: var(--warn); }
td.jc.debt { box-shadow: inset 0 0 0 2px var(--bad); }
td.jc sup { font-size: 9px; color: var(--info); margin-left: 1px; }
.canc { background: repeating-linear-gradient(45deg, #f4f2ee, #f4f2ee 4px, #fff 4px, #fff 8px) !important; color: var(--muted); }
tr.jt td { font-weight: 700; background: var(--soft); }

/* =====================================================================
   Тема v3: светлая, мягкие серые плашки, чёрные «таблетки», лаймовый акцент
   ===================================================================== */
:root {
  --bg: #e9e7e2; --frame: #f1efeb; --card: #fff; --tile: #f3f2ee; --ink: #141414; --muted: #8a877f; --line: #ebe9e4; --soft: #f6f5f2;
  --accent: #eef36b; --accent-ink: #141414; --brand: #141414; --lime: #eef36b;
  --info: #3b5bdb; --info-bg: #eaeefc;
  --r: 20px; --shadow: none;
}
html, body { background: var(--bg); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.005em; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -.025em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
a:hover { color: inherit; opacity: .8; }

/* каркас: всё приложение в светлой рамке */
.layout { padding: 14px; gap: 14px; background: var(--bg); }
.side { background: var(--card); color: var(--ink); border-radius: 26px; height: calc(100vh - 28px); top: 14px; padding: 16px 12px; width: 236px; }
.side .logo { color: var(--ink); font-weight: 600; font-size: 17px; padding: 4px 6px 14px; letter-spacing: -.02em; }
.side .logo i, .topbar .logo i { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--lime); font-size: 16px; }
.studio-card { display: flex; align-items: center; gap: 10px; background: var(--tile); border-radius: 16px; padding: 9px 10px; margin-bottom: 10px; text-decoration: none; }
.studio-card .sq { width: 34px; height: 34px; border-radius: 10px; background: #fff; display: grid; place-items: center; }
.studio-card b { display: block; font-weight: 600; font-size: 13.5px; } .studio-card span { font-size: 12px; color: var(--muted); }
.qsearch input { background: var(--tile); color: var(--ink); border-radius: 12px; padding: 9px 12px; }
.qsearch input::placeholder { color: var(--muted); }
.nav-h { color: var(--muted); text-transform: none; letter-spacing: 0; font-size: 12px; padding: 14px 10px 4px; }
.side .nav a { color: #2b2b2b; font-weight: 500; padding: 8px 12px; border-radius: 14px; gap: 11px; }
.side .nav a:hover { background: var(--tile); color: var(--ink); opacity: 1; }
.side .nav a.on { background: var(--ink); color: #fff; }
.side .ic { width: 20px; display: grid; place-items: center; }
.side .ic svg, .bottom svg, .icn { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cnt { background: none; color: var(--muted); font-weight: 500; font-size: 12.5px; padding: 0; }
.side .nav a.on .cnt { color: #bbb; }
.cnt.red { background: none; color: #d9480f; font-weight: 700; }
.auto-card { background: var(--lime); border-radius: 18px; padding: 12px; margin: 10px 0 8px; }
.auto-card .row1 { display: flex; align-items: center; gap: 10px; }
.auto-card .ic2 { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--lime); display: grid; place-items: center; }
.auto-card b { display: block; font-weight: 600; font-size: 13.5px; } .auto-card span { font-size: 12px; }
.auto-card a.pill { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 99px; padding: 8px 12px; margin-top: 10px; text-decoration: none; font-size: 12.5px; font-weight: 500; }
.side .me { border: 0; background: var(--tile); border-radius: 16px; padding: 9px 10px; color: var(--ink); display: flex; align-items: center; gap: 10px; margin-top: 0; }
.side .me .avatar { background: #d9d6cf; color: var(--ink); }
.side .me b { display: block; font-weight: 600; font-size: 13px; } .side .me span { font-size: 12px; color: var(--muted); }
.side .me a { color: var(--muted); font-size: 12px; }
.main { padding: 4px 6px 60px; max-width: none; }
@media (max-width: 900px) {
  .layout { padding: 0; } .main { padding: 12px 12px 96px; }
  .topbar { background: var(--card); border-bottom: 1px solid var(--line); } .topbar .logo { color: var(--ink); } .tb-btn { color: var(--ink); }
  .bottom a.on { color: var(--ink); } .bottom a.on span { background: var(--ink); color: #fff; border-radius: 12px; }
  .bottom a span { display: grid; place-items: center; width: 40px; height: 30px; margin: 0 auto 2px; }
  h1 { font-size: 23px; }
}

/* заголовок страницы */
.head { align-items: center; margin-bottom: 14px; min-height: 52px; }
.head .row .btn { height: 44px; }

/* карточки и плашки */
.card { border-radius: var(--r); box-shadow: none; padding: 18px 20px; }
.card.flat { border: 0; background: var(--tile); }
.stat { box-shadow: none; border-radius: 20px; padding: 14px 16px 16px; position: relative; min-height: 92px; }
.stat { display: flex; flex-direction: column; }
.stat > span:first-child { font-size: 13px; color: var(--muted); line-height: 1.3; padding-right: 4px; }
.stat b { font-size: 34px; font-weight: 400; letter-spacing: -.03em; margin-top: auto; padding-top: 10px; line-height: 1.1; }
.stat .delta { position: absolute; right: 14px; bottom: 18px; }
.stat.lime { background: var(--lime); } .stat.lime > span { color: var(--ink); }
.stat .delta { position: absolute; right: 14px; bottom: 16px; font-size: 12.5px; color: #444; }
.card .stat { border: 0; background: var(--tile); }
.money-box > div { box-shadow: none; border-radius: 16px; }
.filters { padding: 12px 14px; }
.list-card { padding: 6px 18px; }
.item { border-color: var(--line); }

/* кнопки — «таблетки» */
.btn { border-radius: 99px; padding: 9px 18px; font-weight: 500; background: var(--ink); }
.btn.accent { background: var(--ink); color: #fff; }
.btn.accent::before { content: '›'; font-size: 17px; line-height: 1; margin-right: 2px; }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.ghost { border: 1px solid var(--line); background: #fff; }
.btn.danger { background: #fdeee9; color: #c2410c; }
.btn.sm { padding: 6px 13px; border-radius: 99px; }
.btn.sm.accent::before { content: none; }
.chip { border-radius: 99px; border: 0; background: var(--tile); color: #555; font-weight: 500; padding: 7px 13px; }
.chip.on { background: var(--ink); color: #fff; }
.tabs { border: 0; gap: 4px; background: transparent; }
.tabs button { border: 0; border-radius: 99px; padding: 8px 15px; font-weight: 500; color: #555; }
.tabs button.on { background: var(--ink); color: #fff; }
.state-tabs button { border: 0; background: #fff; border-left: 0; padding: 7px 13px 7px 11px; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.state-tabs button::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #aaa); }
.state-tabs button.on { background: var(--ink); color: #fff; }

/* бейджи — серые таблетки с точкой */
.badge { background: var(--tile); color: #444; font-weight: 500; padding: 3px 10px; border-radius: 99px; font-size: 12px; }
.badge.ok, .badge.warn, .badge.bad, .badge.info { background: var(--tile); color: #333; }
.badge.ok::before, .badge.warn::before, .badge.bad::before, .badge.info::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.badge.ok::before { background: #7cb87a; } .badge.warn::before { background: #c9a35c; } .badge.bad::before { background: #d9480f; } .badge.info::before { background: #8a8aa8; }
.badge.lvl { background: var(--lime); color: var(--ink); }
.badge.mini::before { display: none; }
.pos { color: #2f7d4f; } .neg { color: #c2410c; }

/* формы */
input, select, textarea { border-radius: 12px; border-color: var(--line); background: #fff; padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); border-color: #c9cd4a; }
label.f > span { font-weight: 500; color: #6b6860; font-size: 12.5px; }

/* модальные окна — всегда одна колонка */
.modal, .modal.wide { max-width: 520px; border-radius: 24px; padding: 20px 22px; }
.modal .grid, .modal .g2, .modal .g3, .modal .g4 { grid-template-columns: 1fr !important; gap: 0; }
.modal .card.flat { background: var(--tile); }
.modal .multi { flex-direction: column; flex-wrap: nowrap; }
.modal-head h2 { font-size: 19px; font-weight: 600; }
.modal .actions { position: sticky; bottom: -20px; background: #fff; padding-top: 10px; }
.sumcard .big { font-weight: 500; }

/* таблицы */
th { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); }
table.journal th { background: var(--tile); }

/* ===== Дашборд ===== */
.dash-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dash-head h1 { flex: 1; min-width: 260px; font-size: 32px; }
.searchbox { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 99px; padding: 0 16px; height: 46px; min-width: 240px; position: relative; }
.searchbox input { border: 0; padding: 0; background: transparent; outline: none !important; }
.searchbox .dd { top: 50px; }
.pillsel { background: #fff; border: 0; border-radius: 99px; height: 46px; padding: 0 16px; width: auto; font-weight: 500; }
.iconbtn { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 0; display: grid; place-items: center; cursor: pointer; position: relative; text-decoration: none; }
.iconbtn .dotn { position: absolute; top: 11px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: #f76707; border: 2px solid #fff; }
.btn.big { height: 46px; padding: 0 22px; }
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpis .stat { text-decoration: none; }
@media (max-width: 1300px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-head h1 { font-size: 25px; } }
.pipe { background: #fff; border-radius: 24px; padding: 18px; margin-bottom: 14px; }
.pipe-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pipe-head h2 { margin: 0; font-size: 19px; } .pipe-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; background: var(--tile); border-radius: 99px; padding: 4px; }
.seg button { border: 0; background: none; border-radius: 99px; padding: 7px 14px; font: inherit; font-weight: 500; cursor: pointer; color: #555; }
.seg button.on { background: var(--ink); color: #fff; }
.pipe-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .pipe-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .pipe-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ptile { background: var(--tile); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; min-height: 178px; text-decoration: none; }
.ptile .top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ptile .lbl { background: #fff; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptile .lbl::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #a9a69e; margin-right: 6px; }
.ptile .pct { font-size: 12.5px; color: #444; white-space: nowrap; }
.ptile .barwrap { flex: 1; display: flex; align-items: flex-end; padding: 10px 2px 8px; }
.ptile .hatch { width: 100%; border: 1.5px solid #a9a69e; border-radius: 12px; background: repeating-linear-gradient(-45deg, transparent 0 7px, #c3c0b8 7px 8.5px); min-height: 14px; }
.ptile .num { font-size: 36px; font-weight: 400; letter-spacing: -.03em; line-height: 1; } .ptile .num small { font-size: 12.5px; color: var(--muted); letter-spacing: 0; margin-left: 6px; }
.ptile.first .lbl { background: var(--lime); } .ptile.first .lbl::before { display: none; }
.ptile.last { background: #fff; border: 1.5px solid var(--line); }
.ptile.last .lbl { background: var(--ink); color: #fff; } .ptile.last .lbl::before { display: none; }
.ptile.last .hatch { background: var(--lime); border: 0; height: 14px !important; min-height: 14px; }
.dash3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .dash3 { grid-template-columns: 1fr; } }
.dcard { background: #fff; border-radius: 24px; padding: 18px; display: flex; flex-direction: column; }
.dcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.dcard-head h2 { margin: 0; font-size: 19px; } .dcard-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.dcard-head a { font-size: 13px; text-decoration: none; white-space: nowrap; }
.trow { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.trow:last-child { border: 0; }
.trow .tm { width: 56px; font-size: 17px; font-weight: 500; letter-spacing: -.02em; }
.trow .tm small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.trow .tx { flex: 1; min-width: 0; } .trow .tx b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .tx span { font-size: 12.5px; color: var(--muted); }
.slots { background: var(--tile); border-radius: 18px; padding: 12px; margin-top: auto; }
.slots .small { color: var(--muted); margin-bottom: 8px; }
.slot { display: inline-flex; border: 1.5px dashed #c9c6be; border-radius: 99px; padding: 6px 12px; font-size: 12.5px; margin: 0 6px 6px 0; text-decoration: none; }
.rv { background: var(--tile); border-radius: 18px; padding: 12px; margin-bottom: 10px; display: block; text-decoration: none; }
.rv .r1 { display: flex; align-items: center; gap: 10px; }
.rv .avatar { background: #d9d6cf; color: var(--ink); width: 40px; height: 40px; }
.rv .r1 .tx { flex: 1; min-width: 0; } .rv .r1 b { font-weight: 500; } .rv .r1 .muted { font-size: 12px; }
.rv .r1 .q { font-size: 13px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv .r2 { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12.5px; }
.tag-lime { background: var(--lime); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 500; }
.rv .r2 .sp { flex: 1; } .rv .r2 .muted { font-size: 12px; }
.btn-w { background: #fff; border-radius: 99px; padding: 6px 13px; font-size: 12.5px; font-weight: 500; border: 0; }
.stack-card { background: var(--tile); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px; }
.stack-card .h { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-bottom: 6px; }
.stack-card .h .c { margin-left: auto; color: var(--muted); font-weight: 400; }
.stack-card .h .ico { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.stack-card .h .ico.or { background: #f2a46f; }
.stack-card .ln { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; text-decoration: none; font-size: 13.5px; }
.stack-card .ln span:last-child { color: var(--muted); font-size: 12.5px; white-space: nowrap; } .stack-card .ln .warn2 { color: #c2410c !important; }
.dcard .stack-card:last-child { margin-bottom: 0; }

.side { overflow: hidden; }
.side .nav { overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.kpis .stat { min-height: 118px; }
.pipe-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.studio-card b, .side .me b { color: var(--ink); }
.btn.accent::before { content: none; }
.btn.arrow::before { content: '›'; font-size: 18px; line-height: 1; margin-right: 4px; }
.side .nav a { padding: 7px 12px; }
.nav-h { padding: 10px 10px 3px; }
.state-sel { background: var(--tile) !important; color: var(--ink) !important; border-radius: 99px; font-weight: 500 !important; }
.money-box b { font-weight: 500; }
