/* Цвета — как в админке кассы (app/lib/admin/look.dart) */
:root {
  --bg: #f5f5f7; --card: #fff; --side: #fbfbfd; --ink: #1d1d1f; --ink2: #6e6e73; --ink3: #a1a1a6;
  --line: rgba(0,0,0,.08); --accent: #0071e3; --accent-soft: #e8f1fc; --green: #248a3d; --green-soft: #e7f5eb;
  --red: #d70015; --red-soft: #fce9eb; --orange: #c25e00; --orange-soft: #fff1e0;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 20px;
  background: rgba(251,251,253,.9); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(#2b8cff, #0071e3); color: #fff; margin-right: 6px; }
.muted { color: var(--ink2); font-weight: 400; }
.burger { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; padding: 6px; }
.search { position: relative; margin-left: auto; width: min(420px, 50vw); }
.search input { width: 100%; height: 38px; border: 0; border-radius: 10px; background: #ececf0; padding: 0 14px; font: inherit; font-size: 15px; }
.search input:focus { outline: 2px solid var(--accent); background: #fff; }
.hits { position: absolute; top: 44px; right: 0; width: min(560px, 92vw); max-height: 70vh; overflow: auto; background: var(--card);
  border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 12px 40px rgba(0,0,0,.14); padding: 6px; }
.hits a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.hits a:hover, .hits a.sel { background: var(--accent-soft); text-decoration: none; }
.hits b { display: block; font-size: 15px; }
.hits small { color: var(--ink2); }
.hits mark { background: #fff3b0; color: inherit; border-radius: 3px; }
.hits .none { padding: 12px; color: var(--ink2); }

.wrap { display: flex; max-width: 1280px; margin: 0 auto; }
.side { position: sticky; top: 60px; align-self: flex-start; width: 270px; flex: none; height: calc(100vh - 60px); overflow: auto;
  padding: 20px 12px 40px; border-right: 1px solid var(--line); background: var(--side); }
.side a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--ink); font-size: 15px; line-height: 1.35; }
.side a:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-group { margin: 18px 12px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); }

main { flex: 1; min-width: 0; padding: 32px 48px 80px; max-width: 900px; }
.crumb { color: var(--ink2); font-size: 14px; margin-bottom: 4px; }
h1 { font-size: 34px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 16px; }
h2 { font-size: 24px; letter-spacing: -.01em; margin: 44px 0 10px; padding-top: 8px; }
h3 { font-size: 18px; margin: 28px 0 6px; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
code { background: #ececf0; padding: 1px 6px; border-radius: 6px; font-size: .92em; }
table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; background: var(--card); border-radius: 12px; overflow: hidden; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fafafc; font-weight: 600; }
figure { margin: 18px 0 26px; }
figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.06); background: #fff; }
figcaption { color: var(--ink2); font-size: 14px; margin-top: 8px; text-align: center; }
.note { margin: 16px 0; padding: 14px 18px; border-radius: 12px; background: var(--accent-soft); }
.note.warn { background: var(--orange-soft); }
.note p:last-child { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0 28px; }
.cards a { display: block; padding: 20px; background: var(--card); border-radius: 16px; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05); }
.cards a:hover { text-decoration: none; outline: 2px solid var(--accent); }
.cards b { display: block; font-size: 19px; margin-bottom: 4px; }
.cards span { color: var(--ink2); font-size: 15px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 15px; }
.pager .next { text-align: right; margin-left: auto; }

@media (max-width: 900px) {
  .burger { display: block; }
  .muted { display: none; }
  .side { position: fixed; top: 60px; left: 0; z-index: 9; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  body.menu-open .side { transform: none; }
  main { padding: 20px 16px 60px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .search { width: auto; flex: 1; }
  table { display: block; overflow-x: auto; }
}
@media print { .top, .side, .pager { display: none; } main { padding: 0; } }
