/* Доступы — строгий светлый стиль: белый фон, тонкие линии, Inter Tight / Inter / JetBrains Mono, один синий акцент. */
:root {
  --bg: #FBFBF9;
  --surface: #FFFFFF;
  --line: #E7E6E1;
  --line-soft: #F0EFEB;
  --ink: #111214;
  --ink-2: #3B3E45;
  --muted: #61646B;
  --accent: #2440E6;
  --accent-ink: #1A2FB0;
  --accent-bg: #F3F5FE;
  --warn-bg: #FEF6EE;
  --warn-line: #F3D7BC;
  --warn-ink: #8A3A05;
  --warn-dot: #D9620B;
  --danger: #B42318;
  --display: 'Inter Tight', Inter, system-ui, sans-serif;
  --ui: Inter, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
button { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.label { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.ta-r { text-align: right; display: flex; justify-content: flex-end; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.brand-mark span { width: 8px; height: 8px; border-radius: 2px; background: var(--bg); }
.brand-name { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }

.field { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 500 16px var(--ui); outline: none; }
.field:focus { border-color: var(--ink); }
.field-mono { font-family: var(--mono); letter-spacing: 1px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-dark { background: var(--ink); color: #FFFFFF; }
.btn-line { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-line:hover { border-color: var(--ink); }
.btn-text { background: transparent; color: var(--accent); padding: 0 10px; }
.btn-text:hover { color: var(--accent-ink); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-wide { width: 100%; min-height: 52px; font-size: 16px; }

/* ---------- вход ---------- */
.lock { max-width: 400px; min-height: 100vh; margin: 0 auto; padding: 64px 24px 32px; display: flex; flex-direction: column; }
.lock-head { margin-top: 88px; display: flex; flex-direction: column; gap: 10px; }
.lock-title { margin: 0; font-family: var(--display); font-size: 40px; font-weight: 600; letter-spacing: -1.6px; line-height: 1.02; }
.lock-form { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.lock-form .label { margin-top: 6px; }
.lock-form .btn-wide { margin-top: 10px; }
.lock-totp { display: flex; flex-direction: column; gap: 10px; }
.lock-error { margin: 4px 0 0; min-height: 20px; font-size: 14px; line-height: 1.5; color: var(--danger); }
.lock-detail { display: block; margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-word; }
.lock-note { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 16px 1fr; gap: 10px; color: var(--accent); }
.lock-note p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }

/* ---------- приложение ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 10px 32px; min-height: 64px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-wrap { position: relative; flex: 1 1 320px; max-width: 520px; display: block; color: var(--muted); }
.search-wrap svg { position: absolute; left: 14px; top: 14px; }
.search { height: 44px; padding-left: 40px; background: var(--bg); font-size: 15px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who { font-size: 14px; color: var(--muted); }

.cols { flex: 1; display: flex; flex-wrap: wrap; align-items: stretch; }
.groups { flex: 1 1 220px; max-width: 280px; padding: 28px 16px 28px 32px; border-right: 1px solid var(--line); }
.group-list { margin-top: 12px; display: flex; flex-direction: column; }
.group { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; min-height: 44px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--ink); text-align: left; font-size: 14px; cursor: pointer; }
.group .num { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.group.is-active .group-name { font-weight: 700; }
.group.is-active .num:first-child { color: var(--accent); }
.group:hover .group-name { text-decoration: underline; text-underline-offset: 3px; }

.list { flex: 999 1 480px; min-width: 0; padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 22px; }
.attention { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--warn-line); border-radius: 12px; background: var(--warn-bg); }
.attention-title { font-size: 14px; font-weight: 600; color: var(--warn-ink); }
.chip { min-height: 32px; padding: 0 10px; border: 1px solid var(--warn-line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.head { display: flex; flex-direction: column; gap: 6px; }
.title { margin: 0; font-family: var(--display); font-size: 44px; font-weight: 600; letter-spacing: -1.6px; line-height: 1; }

.table { border-top: 1px solid var(--ink); }
.row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 160px 110px; gap: 16px; align-items: center; padding: 0 4px; border-bottom: 1px solid var(--line); }
.row-head { padding-top: 10px; padding-bottom: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row.is-selected { background: var(--accent-bg); }
.row.is-selected::before { content: ''; position: absolute; left: -12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 1px; background: var(--accent); }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 14px 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.row-name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--warn-dot); }
.empty { margin: 20px 4px; font-size: 14px; color: var(--muted); }

.detail { flex: 1 1 380px; max-width: 480px; padding: 28px 32px 40px; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 24px; }
.detail-empty { justify-content: center; color: var(--muted); font-size: 14px; }
.detail .back { display: none; align-self: flex-start; }
.detail-head { display: flex; flex-direction: column; gap: 8px; }
.detail-title { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.8px; line-height: 1.1; word-break: break-word; }
.fields { margin: 0; border-top: 1px solid var(--line); }
.field-row { display: flex; align-items: center; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.field-row.is-long { flex-direction: column; align-items: stretch; }
.field-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.field-main dd { margin: 0; min-width: 0; }
.value { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { letter-spacing: 1px; }
.secret-long { margin: 0; max-height: 280px; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
.field-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.field-row.is-long .field-actions { justify-content: flex-end; }
.note { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; }
.history { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.history-grid { display: grid; grid-template-columns: 92px 1fr; gap: 6px 12px; font-size: 13px; }

.toast { position: fixed; right: 32px; bottom: 28px; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #FFFFFF; font-size: 14px; font-weight: 500; box-shadow: 0 12px 32px rgba(17, 18, 20, 0.24); }
.toast-count { font-family: var(--mono); font-size: 12px; color: #B8BAC0; }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .top { padding: 10px 16px; gap: 10px; }
  .who, .hide-sm { display: none; }
  .search-wrap { order: 3; flex-basis: 100%; max-width: none; }
  .cols { align-content: flex-start; }
  .groups { flex-basis: 100%; max-width: none; min-width: 0; padding: 16px 16px 0; border-right: 0; }
  .group-list { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: none; }
  .group { flex: none; grid-template-columns: auto auto auto; gap: 6px; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .group.is-active { border-color: var(--ink); }
  .list { padding: 16px 16px 32px; }
  .title { font-size: 32px; letter-spacing: -1px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .detail { display: none; }
  .has-selected .detail { display: flex; position: fixed; inset: 0; z-index: 5; max-width: none; padding: 16px 16px 32px; border: 0; overflow-y: auto; }
  .detail .back { display: inline-flex; }
  .detail-empty { display: none !important; }
  .toast { left: 16px; right: 16px; bottom: 20px; justify-content: space-between; z-index: 10; }
}
