:root {
  --bg: #f5f6f8; --panel: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ea;
  --accent: #2457d6; --accent-ink: #fff; --side: #f0f2f6; --side-text: #2b3242; --error: #b42318; --ok: #067647;
  color-scheme: light;
}
/* Лише світла тема: так краще читається (рішення Дмитра). */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
code { background: var(--bg); padding: .1rem .35rem; border-radius: 4px; }
code.big { font-size: 1.2rem; letter-spacing: .05em; }
.muted { color: var(--muted); font-size: .9em; }

body.center main { min-height: 100%; display: grid; place-items: center; padding: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.5rem; width: 100%; max-width: 30rem; }
body.with-side .card { max-width: 46rem; }
.error { color: var(--error); }
.note { color: var(--ok); }
label { display: block; margin: 0 0 .9rem; font-weight: 500; }
label.row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-weight: 400; }
input, select { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; color: inherit;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
label.row select { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .8rem 1rem .2rem; }
button, .button { display: inline-block; padding: .6rem 1.1rem; font: inherit; font-weight: 600; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
button.link { background: none; color: var(--side-text); padding: 0; font-weight: 400; text-decoration: underline; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.steps { padding-left: 1.2rem; }
.qr svg { width: 220px; height: 220px; background: #fff; border-radius: 8px; }

body.with-side { display: flex; }
.side { width: 240px; flex: none; background: var(--side); border-right: 1px solid var(--line); color: var(--side-text); padding: 1.2rem 1rem;
  display: flex; flex-direction: column; gap: .15rem; min-height: 100vh; }
.side a { color: var(--side-text); text-decoration: none; padding: .45rem .6rem; border-radius: 6px; }
.side a:hover { background: #e3e7ef; }
.side a.active { background: #dfe7fb; color: var(--accent); font-weight: 600; }
.side .brand { color: var(--text); font-weight: 700; font-size: 1.1rem; margin-bottom: 1rem; }
.nav-title { text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; opacity: .6; margin: 1rem .6rem .3rem; }
.side .who { margin-top: auto; padding: .6rem; font-size: .9rem; }
.side .muted { color: var(--side-text); opacity: .7; }
.soon { font-size: .7rem; background: #e3e6ea; border-radius: 4px; padding: 0 .3rem; margin-left: .3rem; }
body.with-side main { flex: 1; min-width: 0; padding: 1.5rem; }
iframe.app { border: 0; width: 100%; height: calc(100vh - 3rem); background: var(--panel); border-radius: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; text-decoration: none;
  color: var(--text); display: flex; flex-direction: column; gap: .3rem; }
.tile:hover { border-color: var(--accent); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.head h1 { margin: 0; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--panel); font-size: .9rem; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
td.path { font-family: ui-monospace, monospace; font-size: .82rem; word-break: break-all; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters select, .filters input { width: auto; margin: 0; }
.pager { display: flex; gap: 1rem; }

@media (max-width: 720px) {
  body.with-side { flex-direction: column; }
  .side { width: auto; min-height: 0; }
  .side .who { margin-top: .5rem; }
  iframe.app { height: 80vh; }
}
.ok { color: var(--ok); font-weight: 600; }
form.keyform { display: flex; gap: .4rem; margin-bottom: .4rem; }
form.keyform input { margin: 0; min-width: 12rem; }
.scope { margin: -.3rem 0 1rem 1rem; padding: .6rem .8rem; border-left: 3px solid var(--line); }
.scope-title { font-weight: 600; margin-bottom: .3rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .2rem .8rem; }
label.check { display: flex; align-items: center; gap: .4rem; font-weight: 400; margin: 0 0 .2rem; }
label.check input { width: auto; margin: 0; }
label.check.all { font-weight: 600; margin-bottom: .4rem; }
.geo-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 720px) { .geo-form .two { grid-template-columns: 1fr; } }
textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; font-family: ui-monospace, monospace; font-size: .9rem;
  color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
button.danger { color: var(--error); border-color: var(--error); }
td.actions { white-space: nowrap; }
.side a.sub { padding-left: 1.4rem; font-size: .93rem; }
.crumb { color: var(--muted); font-weight: 500; }
