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

* { 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;
}

/* ------------------------------------------------------------- заявки */

.searchbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.searchbar input[type=text] { flex: 1 1 260px; }
.searchbar .btn-reset { font-size: 13px; color: var(--muted); text-decoration: none; }
.searchbar .btn-reset:hover { color: var(--accent); }
.translate-toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; margin-bottom: 14px; cursor: pointer; }

/* Переведённый текст заявки: сохраняем переносы строк, внизу пометка о языке. */
.req-text.translated { white-space: pre-line; }
.req-lang { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Панель над списком: две строки, кнопки одной ширины друг под другом. */
.reqbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.reqbar-second { margin-bottom: 16px; }
.reqbar .check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; cursor: pointer; width: 130px; }
.reqbar-second::before { content: ""; width: 130px; }       /* пустое место под «Отметить все» */
.reqbar .btn-danger { width: 260px; }
.req-pick { margin: 0 8px 0 0; vertical-align: -1px; }

.reqlist { display: flex; flex-direction: column; gap: 12px; }

.req {
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    background: #fff;
}

.req-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.req-date { color: var(--muted); font-size: 13px; white-space: nowrap; }

.req-contacts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; font-size: 14px; }
.req-contacts a { text-decoration: none; }
.req-contacts a:hover { text-decoration: underline; }

/* Сервисная заявка: пометка в заголовке и список того, что просят. */
.req-badge {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--accent, #2f7fc1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    vertical-align: 1px;
}
.req-svc { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.req-svc li { margin: 2px 0; }
.req-svc code { font-size: 13px; letter-spacing: .04em; }

.req-text {
    margin: 10px 0 6px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
}

.req-meta { color: var(--muted); font-size: 12px; }

.btn-link {
    display: inline-block;
    padding: 9px 20px;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}
.btn-link:hover { filter: brightness(1.08); color: #fff; }


/* ------------------------------------------------- карточки преимуществ */

.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cardslot { margin-bottom: 0; }
.cardslot h2 { margin-bottom: 8px; }

/* Рамка повторяет пропорции блока на сайте - видно, как обрежется. */
.cardprev {
    width: 100%;
    max-width: 246px;
    aspect-ratio: 246 / 225;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}
.cardprev img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cardslot input[type=file] { margin-bottom: 10px; }

/* Кнопки под журналом заявок - одного размера. */
.logbtns { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }

.btn-danger {
    padding: 9px 20px;
    border: 0;
    border-radius: 6px;
    background: var(--danger);
    color: #fff;
    font: inherit;
    cursor: pointer;
}
.btn-danger:hover { filter: brightness(1.08); }

/* ----------------------------------------------- подписи к сертификатам */

.certrow {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.certrow:last-of-type { border-bottom: 0; }
.certrow > img {
    width: 74px;
    height: 98px;
    object-fit: contain;
    background: var(--bg);
    border-radius: 4px;
    flex: 0 0 auto;
}
.certcaps { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.certcaps .field { margin-bottom: 0; }

/* ------------------------------------- настройки формы и чёрный список */

.mailrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mailrow input[type=text] { flex: 1 1 260px; }

.req-foot { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.req-blocked { color: var(--danger); font-size: 12px; }

button.link-danger {
    background: none;
    border: 0;
    padding: 0;
    color: var(--danger);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}
button.link-danger:hover { filter: brightness(1.15); }

/* Больше десяти записей - список не растёт, а прокручивается. */
.blocklist { list-style: none; padding: 0; margin: 0 0 16px; }
.blocklist-scroll { max-height: 380px; overflow-y: auto; padding-right: 8px; border-bottom: 1px solid var(--line); }
.blocklist li {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
}
.blocklist li:last-child { border-bottom: 0; }
.blocklist span { font-family: ui-monospace, "Consolas", monospace; font-size: 14px; }
