/* Всёреш: общие стили сайта и админ-панели. Цвета — как в окне клиента. */
:root {
  --bg: #000; --surface: #161617; --panel: #1d1d1f; --line: #2a2a2d; --text: #f5f5f7; --muted: #a1a1a6; --dim: #6b6b70;
  --coral: #ef8360; --orange: #ff8c38; --ok: #7fd49a; --warn: #ffb35c; --bad: #ff7a6b; --info: #8fb8ff;
  --mono: Consolas, "Cascadia Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; overflow-x: hidden; }
a { color: var(--coral); text-underline-offset: 2px; }
a:hover { color: #ffa98a; }
code, kbd, .mono { font-family: var(--mono); }
kbd { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--panel); font-size: 13px; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h2 { font-size: 16px; }
p { margin: 0 0 10px; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button, .button {
  font: inherit; font-size: 14px; font-weight: 600; color: #171719; background: var(--coral); border: 1px solid var(--coral);
  border-radius: 18px; padding: 7px 16px; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .button:hover { background: #f59a7c; color: #171719; }
button.secondary, .button.secondary { color: var(--text); background: transparent; border-color: var(--line); }
button.secondary:hover, .button.secondary:hover { background: var(--panel); }
button.danger { color: var(--bad); background: transparent; border-color: #5a2a26; }
button.danger:hover { background: #2a1513; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
input[type=text], input[type=password], input[type=number], input[type=search] {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; min-width: 0;
}
input:focus { border-color: var(--coral); outline: none; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }

/* --- сайт --------------------------------------------------------------- */
.page { max-width: 980px; margin: 0 auto; padding: 14px 16px 28px; display: grid; gap: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
.top b { color: var(--text); }
.tag { border: 1px solid var(--line); border-radius: 12px; padding: 2px 10px; font-size: 12px; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 4px; }
.hero h1 { font-size: clamp(24px, 4.2vw, 34px); max-width: 720px; margin-top: 8px; }
.lead { color: var(--muted); max-width: 680px; font-size: 16px; }
.spirit-home { width: 240px; height: 176px; max-width: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 40px; }
.spirit-home[aria-disabled="true"] { cursor: default; }
.ghost { position: fixed; left: 0; top: 0; width: 240px; height: 176px; pointer-events: none; z-index: 3; transform-origin: 50% 62%; filter: drop-shadow(0 0 10px rgba(255, 98, 40, .32)); }
.status { font-size: 15px; min-height: 44px; }
.status small { display: block; color: var(--muted); font-size: 12.5px; }
.run ol { margin: 0 0 10px; padding-left: 22px; }
.run li { margin-bottom: 4px; }
.command { display: flex; align-items: center; gap: 10px; background: #0d0d0e; border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 10px 16px; }
.command code { flex: 1; font-size: 17px; color: #ffd9c7; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.hint { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid p { color: var(--muted); font-size: 14px; }
.warn { border-color: #4a3416; }
.warn h2 { color: var(--warn); }
.warn p { color: var(--muted); font-size: 14px; margin: 0; }
.foot { text-align: center; color: var(--dim); font-size: 12.5px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { font-size: 28px; margin: 10px 0 14px; }
.prose h2 { margin-top: 22px; }
.prose p, .prose li { color: #d4d4d8; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 4px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } .command { flex-direction: column; align-items: stretch; } }

/* --- админ-панель ------------------------------------------------------- */
.admin { max-width: 1280px; margin: 0 auto; padding: 12px 16px 28px; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 16px; font-size: 13.5px; }
.admin-bar .brand { color: var(--muted); }
.admin-bar .brand b { color: var(--text); }
.admin-bar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.admin-bar nav a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 10px; }
.admin-bar nav a[aria-current="page"] { color: var(--text); background: var(--panel); }
.admin-bar .who { color: var(--muted); display: flex; gap: 10px; align-items: center; }
.login { max-width: 360px; margin: 12vh auto 0; display: grid; gap: 10px; }
.login h1 { font-size: 20px; }
.login label, .form > label { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.error { color: var(--bad); font-size: 13.5px; min-height: 1.2em; margin: 0; }
.ok-text { color: var(--ok); font-size: 13.5px; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.tile b { display: block; font-size: 22px; }
.tile span { color: var(--muted); font-size: 12.5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.toolbar input[type=search] { flex: 1; max-width: 420px; }
.toolbar label { color: var(--muted); font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--surface); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: #121213; }
td.code, .code { font-family: var(--mono); white-space: nowrap; }
td.nowrap { white-space: nowrap; }
.badge { display: inline-block; min-width: 22px; text-align: center; border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 700; margin-right: 4px; }
.badge.critical { background: #3a1714; color: var(--bad); }
.badge.warning { background: #3a2a12; color: var(--warn); }
.badge.info { background: #172438; color: var(--info); }
.badge.zero { background: transparent; color: var(--dim); }
.state { font-size: 12.5px; }
.state.stored { color: var(--ok); }
.state.expired, .state.deleted { color: var(--dim); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; color: var(--muted); font-size: 13px; }
.detail-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.detail-head h1 { font-size: 22px; margin: 0; font-family: var(--mono); }
.detail-head .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.sections { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.sections .wide { grid-column: 1 / -1; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.finding { border-left: 3px solid var(--line); padding: 6px 0 6px 12px; margin-bottom: 10px; }
.finding.critical { border-color: var(--bad); }
.finding.warning { border-color: var(--warn); }
.finding.info { border-color: var(--info); }
.finding h3 { font-size: 14.5px; margin-bottom: 2px; }
.finding p { font-size: 13.5px; color: #d4d4d8; margin: 2px 0; }
.finding p span { color: var(--muted); }
.collector { font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.collector:last-child { border-bottom: 0; }
.collector .note { color: var(--warn); }
.collector .fail { color: var(--bad); }
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.files button { font-size: 12.5px; padding: 4px 10px; font-family: var(--mono); font-weight: 400; }
pre.json { background: #0d0d0e; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; max-height: 70vh; overflow: auto; font: 12.5px/1.5 var(--mono); color: #d4d4d8; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 0; }
.form { display: grid; gap: 14px; max-width: 640px; }
.field { display: grid; grid-template-columns: 1fr 140px; gap: 4px 16px; align-items: center; }
.field label { font-weight: 600; }
.field p { grid-column: 1 / 2; color: var(--muted); font-size: 13px; margin: 0; }
.field input { grid-row: 1 / 3; grid-column: 2; }
.field input[type=checkbox] { width: 20px; height: 20px; justify-self: start; accent-color: var(--coral); }
.form .buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.empty { color: var(--muted); padding: 18px; text-align: center; }
@media (max-width: 900px) { .sections { grid-template-columns: 1fr; } .field { grid-template-columns: 1fr; } .field input { grid-row: auto; grid-column: auto; } }
