/* angara-platform: экраны входа, пользователей и прав. Дизайн-система «Реквизит» (токены Angara DB): светлая и тёмная
   тема. Всё — внутри .ap и с приставкой ap-, поэтому не задевает стили продукта (у ИС БОВ свои классы). */

.ap {
  --ap-surface-0: #f6f5f2; --ap-surface: #ffffff; --ap-surface-2: #eeede8; --ap-surface-50: #fbfaf7;
  --ap-line: #dedcd5; --ap-line-strong: #878479;
  --ap-ink: #1d201f; --ap-muted: #5c605d; --ap-faint: #6f736f;
  --ap-brand: #0e5e5b; --ap-brand-hover: #0a4643; --ap-on-brand: #ffffff; --ap-brand-soft: #e1efed;
  --ap-accent: #94600f; --ap-accent-soft: #faf0dd;
  --ap-danger: #b42318; --ap-danger-soft: #fbeae7;
  --ap-success: #1f6b42; --ap-success-soft: #e4f1e8;
  --ap-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --ap-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ap-ink); font: 15px/22px var(--ap-sans);
  display: flex; flex-direction: column; gap: 16px;
}
@media (prefers-color-scheme: dark) {
  .ap {
    --ap-surface-0: #131514; --ap-surface: #1b1e1d; --ap-surface-2: #252928; --ap-surface-50: #1f2221;
    --ap-line: #323735; --ap-line-strong: #7a827e;
    --ap-ink: #eef0ee; --ap-muted: #a7aeaa; --ap-faint: #8f9692;
    --ap-brand: #5fc2b9; --ap-brand-hover: #82d3cb; --ap-on-brand: #0b1f1e; --ap-brand-soft: #1c3432;
    --ap-accent: #e3ad52; --ap-accent-soft: #382d18;
    --ap-danger: #ff8f80; --ap-danger-soft: #3a201c;
    --ap-success: #72cf98; --ap-success-soft: #18321f;
  }
}
.ap h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600; }
.ap h2 { margin: 0 0 12px; font-size: 17px; line-height: 24px; font-weight: 600; }
.ap a { color: var(--ap-brand); }
.ap p { margin: 0; }
.ap-head { display: flex; flex-direction: column; gap: 6px; }
.ap-lead { color: var(--ap-muted); max-width: 820px; }
.ap-meta, .ap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ap-meta { color: var(--ap-muted); font-size: 14px; }
.ap-crumbs { font-size: 13px; }
.ap-card { background: var(--ap-surface); border: 1px solid var(--ap-line); border-radius: 10px; }
.ap-pad { padding: 20px 24px; }
.ap-card-title { padding: 16px 16px 4px; }
.ap-scroll { overflow-x: auto; }
.ap-narrow { max-width: 760px; }
.ap-login { width: 100%; max-width: 420px; margin: 40px auto; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.ap-login form { display: flex; flex-direction: column; gap: 14px; }
.ap-center { text-align: center; }
.ap-doc { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--ap-line); }
.ap-form { display: flex; flex-direction: column; gap: 14px; }
.ap-form.ap-row { flex-direction: row; align-items: flex-end; }   /* форма в строку: поле и кнопка рядом */
.ap-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 16px; }
.ap-span3 { grid-column: span 3; }
.ap-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ap-grow { flex: 1 1 280px; }
.ap-field > label, .ap legend { font-size: 13px; line-height: 18px; font-weight: 500; }
.ap input[type=text], .ap input[type=password], .ap input[type=email], .ap select {
  height: 40px; padding: 0 12px; border: 1px solid var(--ap-line-strong); border-radius: 6px; background: var(--ap-surface);
  color: var(--ap-ink); font: inherit; min-width: 0; }
.ap input:focus-visible, .ap select:focus-visible, .ap-btn:focus-visible { outline: 2px solid var(--ap-brand); outline-offset: 1px; }
.ap-inline { width: 220px; margin-left: 6px; }
.ap fieldset { border: 1px solid var(--ap-line); border-radius: 8px; padding: 10px 14px 12px; margin: 0;
  display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ap-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.ap-check span { display: inline-flex; flex-direction: column; }
.ap-req { color: var(--ap-danger); }
.ap-hint { font-size: 12px; line-height: 16px; color: var(--ap-muted); }
.ap th .ap-hint, .ap td .ap-hint { display: block; font-weight: 400; }
.ap-muted { color: var(--ap-muted); }
.ap-faint { color: var(--ap-faint); }
.ap-small { font-size: 13px; }
.ap-mono { font-family: var(--ap-mono); }
.ap-strong { font-weight: 600; }
.ap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ap-btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 6px;
  border: 1px solid var(--ap-brand); background: var(--ap-brand); color: var(--ap-on-brand); font: 500 14px var(--ap-sans);
  cursor: pointer; text-decoration: none; }
.ap-btn:hover { background: var(--ap-brand-hover); }
.ap-btn.ap-secondary { background: var(--ap-surface); color: var(--ap-brand); }
.ap-btn.ap-secondary:hover { background: var(--ap-brand-soft); }
.ap-btn.ap-danger { background: var(--ap-danger); border-color: var(--ap-danger); color: #fff; }
.ap-btn[disabled] { opacity: .5; cursor: not-allowed; }
.ap-status, .ap-error { padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.ap-status { background: var(--ap-success-soft); color: var(--ap-success); }
.ap-error { background: var(--ap-danger-soft); color: var(--ap-danger); }
.ap-notice { padding: 10px 14px; border-radius: 8px; background: var(--ap-accent-soft); color: var(--ap-ink);
  border: 1px solid var(--ap-accent); font-size: 14px; }
.ap-notice-bar { margin-bottom: 16px; }
.ap-rules ul { margin: 2px 0 0; padding-left: 18px; }
.ap-password .ap-rules { flex-basis: 100%; }
.ap-secret { padding: 14px 18px; border-radius: 8px; background: var(--ap-accent-soft); color: var(--ap-ink);
  border: 1px solid var(--ap-accent); display: flex; flex-direction: column; gap: 6px; }
.ap-secret-value { font-size: 20px; letter-spacing: .04em; user-select: all; }
.ap-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 13px; line-height: 18px; font-weight: 500;
  background: var(--ap-surface-2); color: var(--ap-ink); }
.ap-chip.ap-ok { background: var(--ap-success-soft); color: var(--ap-success); }
.ap-chip.ap-warn { background: var(--ap-accent-soft); color: var(--ap-accent); }
.ap-chip.ap-bad { background: var(--ap-danger-soft); color: var(--ap-danger); }
.ap-chip.ap-off { color: var(--ap-faint); text-decoration: line-through; }
.ap-warn-text { color: var(--ap-accent); }
.ap-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--ap-line); }
.ap-tabs a { height: 44px; display: inline-flex; align-items: center; padding: 0 16px; color: var(--ap-muted); text-decoration: none;
  border-bottom: 2px solid transparent; font-weight: 500; }
.ap-tabs a:hover { color: var(--ap-ink); }
.ap-tabs a[aria-current="page"] { color: var(--ap-brand); border-bottom-color: var(--ap-brand); }
.ap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ap-table th, .ap-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--ap-line); vertical-align: top; }
.ap-table thead th { font-size: 12px; line-height: 16px; color: var(--ap-muted); font-weight: 500; background: var(--ap-surface-50); }
.ap-table tbody tr:last-child td, .ap-table tbody tr:last-child th { border-bottom: 0; }
.ap-empty { padding: 32px; text-align: center; color: var(--ap-muted); }
.ap-note { padding: 12px 16px; border-top: 1px solid var(--ap-line); font-size: 13px; color: var(--ap-muted); }
.ap-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ap form[data-ap-rights] { display: flex; flex-direction: column; gap: 16px; }
.ap-rights th[scope="col"] { min-width: 120px; vertical-align: bottom; }
.ap-rights th[scope="row"] { white-space: nowrap; font-weight: 500; }
.ap-rc .ap-check { display: flex; font-size: 13px; white-space: nowrap; }
.ap-rc.ap-locked { color: var(--ap-muted); }
.ap-rc.ap-changed { background: var(--ap-accent-soft); }
.ap-old { color: var(--ap-muted); text-decoration: line-through; }
.ap-new { font-weight: 600; }
.ap-danger-zone { border-color: var(--ap-danger); }
@media (max-width: 720px) {
  .ap-grid { grid-template-columns: minmax(0, 1fr); }
  .ap-span3 { grid-column: auto; }
  .ap-pad { padding: 16px; }
  .ap-login { margin: 16px auto; padding: 20px; }
}
