:root {
  --brand: #383086;
  --accent: #e41c26;
  --bg: #f4f5f9;
  --card: #fff;
  --text: #1d1d28;
  --muted: #6b6f80;
  --line: #e1e3ec;
  --ok: #1f8a4c;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 22px; margin: 0 0 16px; }
h3 { margin: 24px 0 8px; }
.muted { color: var(--muted); font-size: 12px; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; flex-shrink: 0; background: var(--brand); color: #fff; display: flex; flex-direction: column; }
.brand { font-weight: 700; font-size: 16px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.15); }
.sidebar nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.sidebar nav a, .sidebar nav .soon { padding: 8px 16px; color: #fff; text-decoration: none; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: rgba(255,255,255,.16); border-left: 3px solid var(--accent); padding-left: 13px; }
.sidebar nav .soon { opacity: .45; cursor: default; }
.me { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.15); }
.me .muted { color: rgba(255,255,255,.7); }
.me .link { color: #fff; padding: 0; margin-top: 6px; }
.content { flex: 1; padding: 24px 28px; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; }
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 14px; font: inherit; cursor: pointer; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn:hover { filter: brightness(.95); }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; text-decoration: underline; padding: 0; }
button.link.danger { color: var(--accent); }
.alert { background: #fdeced; border: 1px solid #f5b5b9; color: #9a1219; padding: 9px 12px; border-radius: 6px; margin-bottom: 12px; }
.ok { background: #e7f6ee; border: 1px solid #a9dcc0; color: var(--ok); padding: 9px 12px; border-radius: 6px; margin-bottom: 12px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #eceef5; color: var(--muted); }
.tag.act-create { background: #e7f6ee; color: var(--ok); }
.tag.act-delete { background: #fdeced; color: #9a1219; }
.tag.act-login { background: #eef0fb; color: var(--brand); }

input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.form label { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: 13px; color: var(--muted); }
.form .row { display: flex; gap: 16px; margin-bottom: 12px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); padding-top: 18px; }
.actions { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { margin-bottom: 12px; }
.narrow { width: 70px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.tabs.sub a { font-size: 13px; padding: 6px 10px; }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { background: #f8f9fc; font-weight: 600; font-size: 12px; color: var(--muted); }
.grid tr.off td { opacity: .55; }
.grid td.changes { font-size: 12px; max-width: 520px; word-break: break-word; }
.nowrap { white-space: nowrap; }
.matrix select { font-size: 12px; padding: 3px 4px; width: 100%; }
.matrix select.scope-none { color: #b0b3c0; }
.matrix select.scope-all { color: var(--ok); font-weight: 600; }
.pager { display: flex; gap: 16px; margin-top: 12px; }

.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--brand); }
.card.login { width: 340px; display: flex; flex-direction: column; gap: 12px; padding: 28px; }
.card.login h1 { color: var(--brand); text-align: center; }
.card.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
