/* Оформление админки. Намеренно простое: важна читаемость форм, а не украшения. */
:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --line: #dfe4ea;
    --text: #1f2933;
    --muted: #6b7785;
    --accent: #359ece;
    --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

a { color: var(--accent); }

/* ------------------------------------------------------------ вход в админку */

.gate {
    max-width: 420px;
    margin: 10vh auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 32px;
}
.gate h1 { margin: 0 0 20px; font-size: 20px; }
.gate label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.gate input { width: 100%; margin-top: 6px; }
.gate .back { margin: 20px 0 0; font-size: 14px; }

/* ------------------------------------------------------------------- шапка */

.top {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.top .brand { font-weight: 600; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a, .langbar a {
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--muted);
}
.tabs a:hover, .langbar a:hover { background: var(--bg); }
.tabs a.on, .langbar a.on { background: var(--accent); color: #fff; }

.langbar { display: flex; gap: 4px; margin-bottom: 8px; }

/* ----------------------------------------------------------------- контент */

main { max-width: 900px; margin: 0 auto; padding: 24px; }

.group {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 18px;
}
.group h2 {
    margin: 0 0 16px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
}
.group h2 .count {
    background: var(--bg);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 13px;
    letter-spacing: 0;
}

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); }
.radio { display: block; margin: 14px 0 6px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 130px; }

input[type=text], input[type=password], input[type=number], textarea, select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    background: #fff;
    color: var(--text);
}
textarea { resize: vertical; min-height: 44px; line-height: 1.45; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
    padding: 9px 20px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
button:hover { filter: brightness(1.08); }
button:disabled { background: var(--line); color: var(--muted); cursor: default; filter: none; }
button.del { background: var(--danger); padding: 5px 12px; font-size: 13px; }
button.link { background: none; color: var(--accent); padding: 0; }

.inline { display: inline; }

.save {
    position: sticky;
    bottom: 0;
    padding: 14px 0;
    background: linear-gradient(to top, var(--bg) 60%, transparent);
}

.hint { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.msg { padding: 12px 16px; border-radius: 8px; margin: 0 0 18px; }
.msg.ok { background: #e6f6ec; color: #1e6b3a; }
.msg.err { background: #fdecea; color: #a32a1c; }

/* ------------------------------------------------------- изображения */

.uploader button { margin-top: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid figure {
    margin: 0;
    background: var(--bg);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
}
.grid img { width: 100%; height: 150px; object-fit: cover; display: block; }
.grid.wide img { height: 130px; }
.grid figure form { padding: 8px; }
.grid .tools { display: flex; gap: 6px; justify-content: center; padding: 8px; }
.grid .tools button { padding: 5px 10px; font-size: 13px; }

.mappreview { margin-top: 18px; }
.mappreview span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.mappreview iframe { width: 100%; height: 260px; border: 1px solid var(--line); border-radius: 8px; }

/* ------------------------------------------------- подсказки по изображениям */

.tip {
    background: var(--bg);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text);
}
.tip strong { display: block; margin-bottom: 8px; }
.tip ul { margin: 0; padding-left: 18px; }
.tip li { margin-bottom: 7px; line-height: 1.5; }
.tip li:last-child { margin-bottom: 0; }
.tip b { color: var(--text); }

/* --------------------------------------------------------- строки ссылок */

.linkrow {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.linkrow:first-of-type { padding-top: 0; }
.linkrow .field { margin-bottom: 0; flex: 0 0 170px; }
.linkrow .field.wide { flex: 1 1 260px; }
.linktools { display: flex; gap: 5px; padding-bottom: 1px; }
.linktools button { padding: 8px 11px; font-size: 14px; line-height: 1; }

button.ghost {
    margin-top: 16px;
    background: none;
    color: var(--accent);
    border: 1px dashed var(--line);
}
button.ghost:hover { background: var(--bg); filter: none; }

.tip code {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    word-break: break-all;
}
