/* Кабинет One Flume — тема «Нар». */
:root {
  --bg: #f3f3f0;
  --card: #ffffff;
  --field: #fafaf8;
  --line: #e4e3de;
  --text: #141417;
  --muted: #5f5f66;
  --accent: #b3202e;
  --accent-hover: #9c1b27;
  --on-accent: #ffffff;
  --sel: #f7ecec;
  --sel-text: #8e1622;
  --ok-bg: #e2f0ec;
  --ok: #0e5a4e;
  --warn-bg: #fbefd8;
  --warn: #7a4a00;
  --gray-bg: #ecece7;
  --gray: #4f4f56;
  --bad-bg: #f7e6e7;
  --bad: #8e1622;
  --font: Onest, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: inherit; }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.3; margin: 0; font-weight: 650; }
h3 { font-size: 14px; margin: 20px 0 8px; font-weight: 650; }
p { margin: 0 0 12px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.bad-text { color: var(--bad); }
.offscreen { position: fixed; left: -9999px; top: 0; }

/* Каркас: меню слева, содержимое справа. */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--line); padding: 20px 12px;
}
.brand { display: block; padding: 0 12px 20px; font-weight: 700; font-size: 16px; text-decoration: none; color: var(--text); }
.brand span { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.nav a {
  display: block; padding: 9px 12px; margin-bottom: 2px; border-radius: 10px;
  text-decoration: none; color: var(--text);
}
.nav a:hover { background: var(--field); }
.nav a[aria-current="page"] { background: var(--sel); color: var(--sel-text); font-weight: 600; }
.me {
  margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.me .who { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me form { margin: 0; }
.main { padding: 28px 32px 48px; max-width: 1320px; }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sub { color: var(--muted); margin: 0; max-width: 720px; }

/* Кнопки — 40 px. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: var(--field); }
.btn:focus-visible, .linkbtn:focus-visible, .nav a:focus-visible, .row:focus-visible, .filters a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.wide { width: 100%; }
.btn.small-btn { height: 32px; padding: 0 12px; border-radius: 10px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.empty { color: var(--muted); }

/* Плашки и сообщения. */
.tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap;
}
.tag.ok, .notice.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn, .notice.warn { background: var(--warn-bg); color: var(--warn); }
.tag.gray, .notice.gray { background: var(--gray-bg); color: var(--gray); }
.tag.bad, .notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: 1px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

/* Демо-доступы. */
.stand { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; margin-bottom: 16px; }
.confirm { border-color: var(--accent); margin-bottom: 16px; }
.confirm p { margin: 6px 0 14px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.filters a {
  display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); text-decoration: none;
}
.filters a:hover { background: var(--field); }
.filters a[aria-current="true"] { background: var(--sel); color: var(--sel-text); border-color: var(--sel); font-weight: 600; }
.filters .n { margin-left: 8px; color: var(--muted); font-weight: 400; }
.filters a[aria-current="true"] .n { color: var(--sel-text); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px); gap: 16px; align-items: start; }
.rows { padding: 6px; }
.row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 110px 128px; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 10px; text-decoration: none;
}
.row:hover { background: var(--field); }
.row[aria-current="true"] { background: var(--sel); }
.row .who { display: flex; flex-direction: column; min-width: 0; }
.row .who b, .row .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who b { font-weight: 600; }
.row .tag { justify-self: start; }
.access-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.props { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px 12px; margin: 18px 0; }
.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }
.secret { letter-spacing: 0.04em; margin-right: 8px; }
textarea.msg {
  display: block; width: 100%; margin-bottom: 10px; padding: 12px; resize: vertical;
  border: 1px solid var(--line); border-radius: 10px; background: var(--field);
  font: 13px/1.5 var(--font); color: var(--text);
}

/* Формы. */
.form { max-width: 760px; }
.form label, .entry label { display: block; font-weight: 500; margin-bottom: 14px; }
.form input[type="text"], .form input:not([type]), .form input[type="tel"], .form input[type="email"],
.entry input {
  display: block; width: 100%; height: 40px; margin-top: 6px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--field);
  font: inherit; color: var(--text);
}
.form input:focus, .entry input:focus, textarea.msg:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--card); }
.req { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 500; padding: 0; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; margin: 0 !important; font-weight: 400 !important; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--field); cursor: pointer;
}
.chip input:checked + span { background: var(--sel); color: var(--sel-text); border-color: var(--sel-text); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 16px; }
.quote { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 0 0 16px; white-space: pre-wrap; }

/* Таблицы. */
.table-wrap { padding: 4px 8px; overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.grid td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tr:last-child td { border-bottom: 0; }
.grid .tag { margin: 0 2px 4px 0; }
.clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }

/* Вход. */
/* Класс страницы — entry-page, у карточки — entry: раньше оба были entry, и тело страницы сжималось до 380 px. */
.entry-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.card.entry { width: min(100%, 380px); padding: 28px; }
.entry .brand { padding: 0 0 18px; }
.entry h1 { margin-bottom: 14px; }
.entry input.code { font-family: var(--mono); font-size: 20px; letter-spacing: 0.3em; text-align: center; }
.entry .back { display: block; margin-top: 14px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 1080px) {
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .main { padding: 20px 16px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr auto; }
  .row > :nth-child(3) { display: none; }
  .head { flex-direction: column; }
}
