/* Кабинет в бренде gentlyai.ru (токены — как в landing/index.html): бумага и чернила, лавандовый только акцент,
   подписи моноширинным. Страница добавляет только своё. Старые имена (--accent, --ai, --info, --human…) — синонимы бренда. */
:root {
  --paper: #fbfbfa; --ink: #16151b; --muted: #6b6a73; --line: #e5e4e8; --soft: #f2f1f4; --card: #ffffff;
  --lav: #6f5ff0; --lav-ink: #ffffff; --lav-soft: #eeebff; --peach: #fde3d3; --peach-ink: #7a3f1d;
  --ok: #2c7a4b; --ok-soft: #e4f1e8; --warn: #b8691c; --err: #b4441c; --err-soft: #fbe6dc; --wait: #8a8993; --wait-soft: #f0eff2;
  --body: Onest, -apple-system, "Segoe UI", Roboto, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #111114; --ink: #ececf0; --muted: #94939d; --line: #2a2a31; --soft: #1b1b20; --card: #17171b;
  --lav: #8f84ff; --lav-ink: #111114; --lav-soft: #25213f; --peach: #3a2820; --peach-ink: #ffd2b8;
  --ok: #6cc596; --ok-soft: #17291f; --warn: #f0a85e; --err: #f0956c; --err-soft: #34201a; --wait: #8a8993; --wait-soft: #1f1f24; color-scheme: dark; } }
:root {
  --bg: var(--paper); --panel: var(--card); --fg: var(--ink); --font: var(--body);
  --accent: var(--lav); --accent-soft: var(--lav-soft);
  --ai: var(--ok); --ai-soft: var(--ok-soft); --info: var(--warn); --info-soft: var(--peach); --human: var(--err); --human-soft: var(--err-soft);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--lav); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--lav); outline-offset: 2px; }

/* каркас: меню слева + страница (по содержанию — как консоли сервисов: разделы с иконками, аккаунт внизу) */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 18px 12px 12px; border-right: 1px solid var(--line); background: var(--paper); }
.nav .logo { display: flex; align-items: center; gap: 7px; font: 800 22px/1 Nunito, var(--body); color: var(--ink); text-decoration: none; padding: 2px 10px 22px; }
.nav .logo svg { width: 26px; height: 26px; }
.nav a.item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a.item svg { width: 18px; height: 18px; flex: none; }
.nav a.item .ext { width: 14px; height: 14px; margin-left: auto; opacity: .7; }
.nav a.item:hover { color: var(--ink); background: var(--soft); }
.nav a.item.on { color: var(--ink); background: var(--soft); }
.nav .sep { height: 1px; background: var(--line); margin: 8px 10px; }
.acct { margin-top: auto; position: relative; }
.acct > button { width: 100%; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 10px;
  color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.acct > button:hover { border-color: var(--muted); }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 600 12.5px var(--body); flex: none; }
.acct .who { min-width: 0; flex: 1; line-height: 1.3; } .acct .who b, .acct .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .who b { font-weight: 600; font-size: 13.5px; } .acct .who span { font-size: 12px; color: var(--muted); }
.acct .chev { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; }
.menu .mh { font-size: 12px; color: var(--muted); padding: 6px 8px 4px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: transparent; color: var(--ink); text-align: left; padding: 7px 8px; border-radius: 6px; font: 14px var(--body); cursor: pointer; }
.menu button:hover { background: var(--soft); } .menu button.on::after { content: "✓"; margin-left: auto; color: var(--lav); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.page { min-width: 0; }
.strip { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px; background: var(--peach); color: var(--peach-ink); font-size: 13.5px; }
.strip a { cursor: pointer; font-weight: 600; text-decoration: underline; } .strip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 16px; line-height: 1; margin-left: 6px; }
main { max-width: 1180px; margin: 0 auto; padding: 32px 36px 64px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .nav .logo { padding: 0 8px 0 0; } .nav a.item span.t { display: none; } .nav .sep { display: none; }
  .acct { margin: 0 0 0 auto; } .acct .who, .acct .chev { display: none; } .acct > button { border: 0; padding: 0; background: transparent; }
  .menu { left: auto; right: 0; width: 240px; bottom: auto; top: calc(100% + 6px); }
  main { padding: 20px 16px 48px; }
}

/* шапка страницы: заголовок слева, главное действие справа */
.ph { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.foot-note { color: var(--muted); font-size: 13px; margin-top: 28px; }
/* таблицы сущностей */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--soft); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .mono { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--peach); color: var(--peach-ink); }
.badge.err { background: var(--err-soft); color: var(--err); } .badge.muted { background: var(--soft); color: var(--muted); }
.empty-row { padding: 36px 12px; text-align: center; color: var(--muted); }
.tbl tr:hover td.empty-row { background: transparent; }
/* окно поверх страницы */
.modal { position: fixed; inset: 0; background: rgba(15, 14, 20, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal .box { width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.modal .mt { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal .mt h2 { font-size: 18px; margin: 0; } .modal .x { border: 0; background: transparent; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.choice { display: flex; gap: 12px; align-items: flex-start; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: transparent; padding: 14px; margin-bottom: 8px;
  text-align: left; cursor: pointer; color: var(--ink); font: inherit; }
.choice:hover { border-color: var(--lav); } .choice svg { width: 20px; height: 20px; color: var(--muted); flex: none; margin-top: 1px; }
.choice b { display: block; font-weight: 600; } .choice span { color: var(--muted); font-size: 13.5px; }
/* карточки-цифры */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.kpis > div { padding: 16px 18px; border-right: 1px solid var(--line); } .kpis > div:last-child { border-right: 0; }
.kpis b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; } .kpis span { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpis > div:nth-child(2) { border-right: 0; } }

/* типографика и общие элементы */
h1 { font-size: 26px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 4px; text-wrap: balance; }
.sub { color: var(--muted); max-width: 64ch; margin: 6px 0 22px; }
.lbl { font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.muted, .why { color: var(--muted); font-size: 13.5px; }
h1 + .bar { margin-top: 16px; }
.bar { border-radius: 10px; padding: 9px 14px; margin: 0 0 18px; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bar.info { background: var(--peach); color: var(--peach-ink); } .bar.ok { background: var(--ok-soft); color: var(--ok); }
.bar a { color: inherit; font-weight: 600; cursor: pointer; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.pad { padding: 18px; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 11px; font: 14.5px var(--body); }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--lav); }
button.btn, a.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 8px; padding: 8px 14px; font: 600 14px/1.2 var(--body);
  cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
button.btn:hover, a.btn:hover { background: var(--lav); border-color: var(--lav); color: var(--lav-ink); }
button.ghost, a.ghost { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; padding: 7px 12px; font: 500 13.5px/1.2 var(--body);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
button.ghost:hover, a.ghost:hover { border-color: var(--ink); }
button.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; }
button.btn:disabled:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
pre { background: var(--soft); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; margin: 0; }
/* статус: цветная точка + текст, без эмодзи */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ai { background: var(--ok); } .dot.need_info { background: var(--warn); } .dot.human { background: var(--err); } .dot.checking { background: var(--wait); }
details > summary { cursor: pointer; color: var(--muted); }
