:root {
  --bg: #f2f1ed;
  --panel: #ffffff;
  --soft: #faf8f4;
  --ink: #191713;
  --muted: #8c867c;
  --faint: #a8a298;
  --line: #e4e0d8;
  --hair: #eeebe4;
  --field: #ddd9d1;
  --accent: #8a4b2a;
  --accent-dark: #743d21;
  --ember: #d98452;
  --bad: #b3261e;
  --good: #2f6b3a;
  --leaf: #6a8f5f;
  --warn: #c98b2e;
  --amber: #7a5b12;
  --grey: #c7c1b6;
  --dark: #1c1a17;
  --dark-2: #2a2723;
}
* { box-sizing: border-box; }
/* авторские display переигрывают браузерный [hidden] — возвращаем ему силу */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font-family: inherit; color: inherit; }
h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
.num, .money { font-variant-numeric: tabular-nums; }

/* ——— каркас ——— */
.shell { display: flex; min-height: 100vh; align-items: stretch; }
.side {
  width: 236px; flex: none; background: var(--dark); color: var(--bg);
  padding: 20px 16px; display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; flex-direction: column; gap: 3px; }
.brand-row { display: flex; align-items: center; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ember); flex: none; }
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: rgba(242,241,237,.45); padding-left: 18px; }
.field-block { display: flex; flex-direction: column; gap: 7px; }
.eyebrow { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.eyebrow.dim { color: rgba(242,241,237,.4); }
.side select {
  font-size: 14px; color: var(--bg); background: var(--dark-2);
  border: 1px solid rgba(242,241,237,.14); border-radius: 9px; padding: 9px 10px; width: 100%;
}
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; font-size: 13.5px; padding: 9px 11px;
  border: none; border-radius: 9px; cursor: pointer;
  background: transparent; color: rgba(242,241,237,.68);
}
#nav button:hover { background: var(--dark-2); color: var(--bg); }
#nav button.active { background: var(--bg); color: var(--ink); }
#nav .badge { font-size: 11px; font-variant-numeric: tabular-nums; color: rgba(242,241,237,.4); }
#nav button.active .badge { color: var(--muted); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.cover-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: var(--dark-2); border-radius: 11px; }
.cover-label { font-size: 11px; color: rgba(242,241,237,.5); }
.cover-value { display: flex; align-items: baseline; gap: 6px; }
.cover-value b { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.cover-value span { font-size: 11px; color: rgba(242,241,237,.5); }
.cover-bar { height: 4px; background: rgba(242,241,237,.14); border-radius: 3px; overflow: hidden; }
.cover-bar i { display: block; height: 100%; background: var(--ember); }
.side-btn {
  font-size: 13px; color: var(--bg); background: transparent;
  border: 1px solid rgba(242,241,237,.18); border-radius: 9px; padding: 9px; cursor: pointer;
}
.side-btn:hover { background: var(--dark-2); }

main { flex: 1; min-width: 0; padding: 28px 34px 64px; max-width: 1260px; }
.tab { display: none; }
.tab.active { display: block; }
.stack { display: flex; flex-direction: column; gap: 26px; }
.stack.tight { gap: 20px; }

/* ——— заголовки экранов ——— */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-head .titles { display: flex; flex-direction: column; gap: 4px; }
.page-head .eyebrow { font-size: 12px; letter-spacing: .08em; }
.page-head .lede { font-size: 13px; color: var(--muted); }
.acts { display: flex; gap: 10px; flex-wrap: wrap; }

button.btn, a.btn {
  font-size: 13px; background: #fff; border: 1px solid var(--field); border-radius: 9px;
  padding: 8px 13px; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-block;
}
button.btn:hover, a.btn:hover { border-color: #c4bfb5; }
button.btn.primary, a.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn.primary:hover { background: var(--accent-dark); }
button.btn.ghost { background: var(--soft); }
button.btn.small { padding: 6px 11px; font-size: 12.5px; }

/* ——— карточки ——— */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; }
.card.pad-s { padding: 16px 18px; border-radius: 14px; }
.hero { display: flex; flex-direction: column; gap: 20px; }
.hero-stats { display: flex; align-items: flex-start; gap: 34px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat + .stat { padding-left: 34px; border-left: 1px solid var(--line); }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .big { font-size: 44px; line-height: 1.05; font-weight: 600; letter-spacing: -0.03em; color: var(--bad); font-variant-numeric: tabular-nums; }
.stat .mid { font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .mid.good { color: var(--good); }
.stat .note { font-size: 12px; color: var(--muted); }

.blame { display: flex; flex-direction: column; gap: 10px; }
.blame-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; }
.blame-legend { display: flex; gap: 22px; flex-wrap: wrap; }
.blame-legend > div { display: flex; align-items: baseline; gap: 8px; }
.blame-legend .sq { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.blame-legend .who { font-size: 13px; font-weight: 500; }
.blame-legend .sum { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.blame-legend .cnt { font-size: 12px; color: var(--muted); }

.teams { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.team { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.team.off { background: var(--soft); opacity: .62; }
.team-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.team-top .name { font-size: 15px; font-weight: 600; }
.team-top .chef { font-size: 12px; color: var(--muted); }
.team .big { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--bad); }
.team.off .big { color: var(--faint); }
.track { height: 5px; background: var(--hair); border-radius: 3px; overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--bad); }
.team.off .track i { background: #ddd9d1; }
.team .sub { font-size: 12px; color: var(--muted); }

/* ——— строки-карточки ——— */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 14px 18px;
  display: grid; grid-template-columns: minmax(170px, 2.1fr) minmax(104px, 1fr) minmax(112px, 1.05fr) minmax(88px, .8fr);
  gap: 18px; align-items: center;
}
.row:hover { border-color: #cfc9be; }
.row .who { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.row .title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row .title span.name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.row .why { font-size: 12px; color: var(--muted); }
.row .src { font-size: 11px; color: var(--faint); }
.cell { display: flex; flex-direction: column; gap: 4px; }
.cell .label { font-size: 11px; color: var(--muted); }
.cell .pair { font-size: 14px; font-variant-numeric: tabular-nums; }
.cell .pair b { font-weight: 600; }
.cell .pair .plan { color: var(--faint); }
.cell .delta { font-size: 12px; color: var(--bad); font-variant-numeric: tabular-nums; }
.cell .delta.good { color: var(--good); }
.right { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.right .label { font-size: 11px; color: var(--muted); }
.right .money { font-size: 19px; font-weight: 600; color: var(--bad); letter-spacing: -0.01em; }
.right .money.good { color: var(--good); }
.right .note { font-size: 11px; color: var(--faint); }

.markup { display: flex; align-items: center; gap: 8px; }
.markup .bar { flex: 1; height: 6px; background: var(--hair); border-radius: 3px; position: relative; overflow: hidden; }
.markup .bar i.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--bad); }
.markup .val { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ——— теги ——— */
.tag { font-size: 11.5px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; border: 1px solid var(--line); background: #f4f3f0; color: #77726b; }
.tag.buy { background: #fdefee; border-color: #e0a9a4; color: var(--bad); }
.tag.plan { background: #fdf6e6; border-color: #d8c08a; color: var(--amber); }
.tag.kitchen { background: #f0f6ee; border-color: #a8c0a0; color: var(--good); }
.tag.new { background: #f4f3f0; border-color: #e0dcd4; color: #77726b; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 6px 13px; border-radius: 20px; cursor: pointer; border: 1px solid var(--field); background: #fff; color: var(--ink); }
.chip.active { border-color: var(--ink); background: var(--ink); color: #fff; }

.callout {
  background: var(--soft); border: 1px dashed var(--field); border-radius: 13px; padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.callout .t { font-size: 14px; font-weight: 500; }
.callout .s { font-size: 12px; color: var(--muted); }

.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head .count { font-size: 13px; color: var(--muted); }

/* ——— сопоставление ——— */
.match-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.wizard-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.wizard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subject-facts { display: flex; gap: 26px; flex-wrap: wrap; }
.subject-facts > div { display: flex; flex-direction: column; }
.subject-facts .label { font-size: 11px; color: var(--muted); }
.subject-facts b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rule { height: 1px; background: var(--hair); }
.option {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: 15px 17px; cursor: pointer; display: block; color: var(--ink); text-align: left;
}
.option:hover { border-color: #cfc9be; }
.option.best { background: #fdfaf7; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.option-top { display: flex; align-items: flex-start; gap: 14px; }
.option .oname { font-size: 15.5px; font-weight: 500; letter-spacing: -0.01em; }
.option .osheet { font-size: 12px; color: var(--muted); }
.option .ocost { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.option-bars { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.option-bars .bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.bars-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.bars-row { display: flex; gap: 8px; }
.bar-track { flex: 1; height: 5px; background: var(--hair); border-radius: 3px; overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 3px; }
.pick { font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 9px; white-space: nowrap; background: var(--bg); color: var(--muted); }
.option.best .pick { background: var(--accent); color: #fff; }
.search-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.search-row input {
  flex: 1; min-width: 220px; font-size: 14px; padding: 10px 13px;
  border: 1px solid var(--field); border-radius: 10px; background: var(--soft);
}
.rail { display: flex; flex-direction: column; gap: 14px; }
.rail-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.rail-head { display: flex; align-items: center; gap: 8px; }
.rail-head .t { font-size: 13px; font-weight: 600; }
.rail-head .s { font-size: 12px; color: var(--muted); margin-left: auto; }
.qitem { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; cursor: pointer; background: transparent; border: none; width: 100%; text-align: left; }
.qitem:hover { background: var(--soft); }
.qitem.current { background: var(--bg); }
.qitem .qdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--grey); }
.qitem .qdot.need { background: var(--bad); }
.qitem .qtext { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.qitem .qname { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem .qsub { font-size: 11px; color: var(--muted); }
.qitem .qsum { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pinned-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-top: 1px solid var(--hair); }
.pinned-row .pn { font-size: 12.5px; font-weight: 500; }
.pinned-row .pw { font-size: 11px; color: var(--muted); }
.pinned-row .x { border: none; background: none; color: var(--faint); cursor: pointer; font-size: 14px; padding: 0 2px; }
.pinned-row .x:hover { color: var(--bad); }
.modes { display: inline-flex; border: 1px solid var(--field); border-radius: 9px; overflow: hidden; }
.modes button { border: none; padding: 7px 15px; background: #fff; color: var(--muted); cursor: pointer; font-size: 13px; }
.modes button.active { background: var(--ink); color: #fff; }
.mrow { display: grid; grid-template-columns: minmax(180px, 1.7fr) minmax(120px, .9fr) minmax(180px, 1.5fr) minmax(120px, .8fr); gap: 16px; align-items: center; }
.mrow.resolved { background: var(--soft); }
.mrow.resolved .who, .mrow.resolved .cell { opacity: .62; }
.stackacts { display: flex; flex-direction: column; gap: 5px; align-items: stretch; }

/* ——— сообщения ——— */
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.msg header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--hair); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #f0eae2; color: var(--accent); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.msg .who { display: flex; flex-direction: column; }
.msg .who .n { font-size: 15px; font-weight: 600; }
.msg .who .s { font-size: 12px; color: var(--muted); }
.msg pre { margin: 0; padding: 18px; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.55; color: #33302a; }

/* ——— месяц ——— */
.heat { width: 100%; border-collapse: separate; border-spacing: 4px; min-width: 640px; }
.heat th { font-size: 11px; color: var(--muted); font-weight: 500; padding-bottom: 4px; }
.heat th.first { text-align: left; padding: 0 6px 4px 0; }
.heat th.last { text-align: right; }
.heat td.cat { font-size: 13.5px; font-weight: 500; padding-right: 10px; white-space: nowrap; }
.heat td.c { text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 9px 6px; border-radius: 8px; }
.heat td.total { text-align: right; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 8px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.spark { display: inline-flex; gap: 3px; align-items: flex-end; height: 24px; }
.spark i { width: 7px; display: block; border-radius: 2px; background: #ddd7cc; }
.spark i.last { background: var(--bad); }
.wdots { display: inline-flex; gap: 4px; }
.wdots i { width: 22px; height: 8px; border-radius: 3px; display: block; background: var(--line); }
.wdots i.hit { background: var(--bad); }

/* ——— настройки ——— */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.card.form { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.card.form h2 { margin-bottom: 8px; }
.field {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--hair);
}
.field:last-of-type { border-bottom: none; }
.field label { font-size: 13.5px; display: flex; flex-direction: column; gap: 1px; }
.field label span { color: var(--muted); font-size: 11.5px; }
.field input[type=number] {
  width: 104px; padding: 7px 10px; border: 1px solid var(--field); border-radius: 9px;
  text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; background: var(--soft);
}
select.plain { font-size: 14px; padding: 9px 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; }

.empty { padding: 26px; text-align: center; color: var(--muted); background: var(--soft); border: 1px dashed var(--field); border-radius: 13px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(30px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px;
  opacity: 0; transition: all .2s; pointer-events: none; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.scroll { overflow-x: auto; }

@media (max-width: 1080px) {
  .match-grid { grid-template-columns: 1fr; }
  .row, .mrow { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; gap: 14px; align-items: center; }
  #nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0; flex-direction: row; align-items: center; }
  .cover-card { display: none; }
  main { padding: 20px 16px 50px; }
  .row, .mrow { grid-template-columns: 1fr; }
  .stat + .stat { padding-left: 0; border-left: none; }
}

/* фильтры и сортировка на экране отклонений */
.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 2px; }
.filters .divider { width: 1px; height: 20px; background: var(--line); }
.filters .flabel { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
select.plain.small { font-size: 13px; padding: 6px 10px; border-radius: 9px; }

/* галочки «включить в сообщение» и ретро */
.pickbox { display: inline-flex; align-items: center; cursor: pointer; }
.pickbox input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.pickbar {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 11px;
  background: var(--soft); border: 1px dashed var(--field); font-size: 13px; color: var(--muted);
}
.pickbar.armed { border-style: solid; border-color: var(--accent); background: #fdfaf7; color: var(--ink); }
.retro { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.retro-note { font-size: 11px; color: var(--faint); }
.retro-week {
  font-size: 11px; font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: 5px;
  background: var(--hair); color: var(--faint);
}
.retro-week.hit { background: #fdefee; color: var(--bad); }
.retro-week.now { background: var(--ink); color: #fff; }

/* ——— вход ——— */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 30px 26px; display: flex; flex-direction: column; gap: 6px;
}
.auth-brand { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); }
.auth-card h1 { margin-top: 12px; font-size: 23px; }
.auth-sub { margin: 0 0 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.auth-form { display: flex; flex-direction: column; gap: 13px; margin-top: 6px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field label { font-size: 11.5px; color: var(--muted); }
.auth-field input {
  padding: 10px 12px; border: 1px solid var(--field); border-radius: 10px;
  background: var(--soft); font-size: 14.5px; width: 100%;
}
.auth-field input:focus { outline: none; border-color: var(--accent); background: #fff; }
.auth-error {
  margin: 0; font-size: 12.5px; color: var(--bad); background: #fdf1f0;
  border: 1px solid #f2d9d7; border-radius: 9px; padding: 8px 11px;
}
.auth-submit { width: 100%; padding: 11px; font-size: 14px; margin-top: 2px; }
.auth-submit:disabled { opacity: .55; cursor: default; }
.auth-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--faint); line-height: 1.5; }

/* ——— пользователь в боковой панели ——— */
.side-who {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--dark-2); border-radius: 11px;
}
.who-name { font-size: 13px; font-weight: 600; }
.who-role { font-size: 11px; color: rgba(242,241,237,.5); }
.who-acts { display: flex; gap: 6px; }
.who-acts button {
  flex: 1; font-size: 11.5px; padding: 6px; cursor: pointer; color: rgba(242,241,237,.75);
  background: transparent; border: 1px solid rgba(242,241,237,.18); border-radius: 8px;
}
.who-acts button:hover { background: var(--dark); color: var(--bg); }

/* ——— пользователи ——— */
.users-table td .tag { margin-right: 5px; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: var(--soft); border: 1px solid var(--line); color: var(--muted);
}
.tag.admin { background: #f4ece6; border-color: #e6d5c8; color: var(--accent); }
.tag.off { background: #fdf1f0; border-color: #f2d9d7; color: var(--bad); }
.user-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.user-form .auth-field input, .user-form .auth-field select {
  padding: 9px 11px; border: 1px solid var(--field); border-radius: 9px;
  background: var(--soft); font-size: 14px; width: 100%;
}
.teams-pick { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.teams-pick label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); }
.user-row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 14px 18px;
  display: grid; gap: 8px 16px; align-items: center;
  grid-template-columns: minmax(150px, 1.5fr) minmax(110px, .9fr) minmax(120px, 1fr) auto;
}
.user-row .u-name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.user-row .u-login { font-size: 12px; color: var(--muted); }
.user-row .u-seen { font-size: 12px; color: var(--faint); }
.user-row .acts { justify-content: flex-end; }
.user-edit {
  grid-column: 1 / -1; border-top: 1px solid var(--hair); margin-top: 6px; padding-top: 14px;
  display: flex; flex-direction: column; gap: 12px;
}
@media (max-width: 900px) { .user-row { grid-template-columns: 1fr 1fr; } .user-row .acts { justify-content: flex-start; } }
dialog { border: none; box-shadow: 0 20px 60px rgba(25,23,19,.18); }
/* Классы вроде .auth-card задают display:flex и перебивают правило браузера,
   по которому закрытый <dialog> не показывается. Без этой строки закрытый
   диалог остаётся в потоке, добавляет пустую прокрутку под .shell — и боковая
   панель, будучи sticky, не может выйти за пределы .shell и «повисает». */
dialog:not([open]) { display: none; }
dialog[open] { margin: auto; }
dialog::backdrop { background: rgba(25,23,19,.32); }
dialog h2 { margin-bottom: 4px; }
