/* ================================================================
   ПАЛИТРА АДМИНКИ — берётся из дизайна самого сайта.
   Все цвета интерфейса задаются только здесь, в блоке :root.
   Для нового сайта сюда подставляются его цвета (акцент кнопок,
   тёмный цвет шапки, фон, текст) — и вся админка перекрашивается
   в стиль сайта. Ниже по файлу — только var(--...), без своих hex.
   Текущая палитра: сайт «Аргус» (security-demo.lazalex.ru).
   ================================================================ */
:root {
  --accent: #0977B9;        /* главный цвет сайта: кнопки, активные пункты */
  --accent-hover: #08659D;  /* акцент при наведении */
  --link: #075E91;          /* ссылки */
  --bg: #F2F6FB;            /* фон страниц админки (фон сайта) */
  --ink: #2E3D4E;           /* основной текст */
  --label: #47617A;         /* подписи полей */
  --muted: #5B6B80;         /* второстепенный текст */
  --hint: #7C8DA1;          /* подсказки под полями */
  --side-bg: #123B5C;       /* боковая панель (тёмный цвет сайта) */
  --side-hover: #1D4E74;    /* пункт меню при наведении */
  --side-text: #E7EFF7;     /* текст в боковой панели */
  --side-muted: #9FB9D2;    /* приглушённый текст в боковой панели */
  --side-border: #2A5578;   /* разделитель в боковой панели */
  --login-bg: #0D2C47;      /* фон страницы входа */
  --card-border: #D8E4F0;   /* рамки карточек и блоков */
  --line: #E1EAF6;          /* тонкие линии таблиц и превью */
  --tint: #F7FAFF;          /* светлая подложка */
  --field-bg: #FBFDFF;      /* фон полей ввода */
  --field-border: #BCCFE2;  /* рамка полей ввода */
  --dashed: #A9BED4;        /* пунктирные рамки */
  --placeholder: #9DB2C6;   /* текст примеров в полях */
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--link); }

/* ---------- вход ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--login-bg); }
.login-card { background: #fff; border-radius: 16px; padding: 36px 38px; width: min(400px, 92vw); box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.login-logo { width: 58px; height: 58px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.login-card h1 { margin: 0 0 4px; font-size: 24px; }

/* ---------- каркас ---------- */
.layout { display: flex; min-height: 100vh; }
.side { width: 232px; flex: 0 0 232px; background: var(--side-bg); color: var(--side-text); padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-logo { width: 46px; height: 46px; border-radius: 11px; background: var(--accent); color: #fff; font-weight: 800; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.side-title { font-weight: 700; font-size: 17px; margin: 12px 0 20px; line-height: 1.25; }
.side-title span { font-weight: 400; font-size: 12.5px; color: var(--side-muted); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: var(--side-text); text-decoration: none; padding: 10px 12px; border-radius: 9px; font-size: 15px; }
.side nav a:hover { background: var(--side-hover); }
.side nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--side-border); padding-top: 14px; }
.side-foot a { color: var(--side-muted); text-decoration: none; font-size: 14px; }
.side-foot a:hover { color: #fff; }

.main { flex: 1; padding: 28px 34px 60px; max-width: 920px; }
.main h1 { font-size: 26px; margin: 0 0 18px; }
.card { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; padding: 20px 22px; margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; font-size: 18px; }
fieldset.sub { background: #fff; border: 1px solid var(--card-border); border-radius: 14px; padding: 18px 20px; margin: 0 0 16px; }
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--label); margin-bottom: 13px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
input[type=text], input[type=password], textarea, select { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; font-size: 15.5px; font-family: inherit; color: var(--ink); background: var(--field-bg); border: 1px solid var(--field-border); border-radius: 9px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type=file] { display: block; margin-top: 6px; font-size: 14px; }
input[type=checkbox] { width: 17px; height: 17px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; margin-bottom: 6px; }
.row3 { display: grid; grid-template-columns: 2.2fr 1fr 1.2fr auto; gap: 10px; align-items: end; margin-bottom: 4px; }
.imgrow { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
img.preview { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; border: 1px solid var(--card-border); background: #eee; }
img.preview.big { width: 150px; height: 110px; }
.imgrow select { flex: 1; margin-top: 0; }

.btn { border: 0; border-radius: 10px; padding: 10px 18px; font-size: 15px; cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--accent); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.big { padding: 14px 28px; font-size: 16.5px; margin-top: 8px; }
.btn.ghost { background: transparent; border: 1.5px dashed var(--dashed); color: var(--label); margin: 2px 10px 18px 0; }
.btn.ghost:hover { border-color: var(--accent); color: var(--link); }
.btn.danger { background: #f7e8e2; color: #b0341f; }
.btn.danger.small { padding: 7px 12px; font-size: 13.5px; margin-top: 8px; }
.row2 .btn.danger.small, .row3 .btn.danger.small { margin-top: 0; margin-bottom: 13px; }

.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 15px; }
.alert.ok { background: #e6f4e3; border: 1px solid #a9d3a2; color: #2d5a27; }
.alert.error { background: #fbe9e4; border: 1px solid #eba38f; color: #8c2b18; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; }
  .main { padding: 20px 16px 50px; }
  .row2, .row3 { grid-template-columns: 1fr; }
}

/* --- конструктор страниц (Аргус) --- */
.pages-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(9,64,116,.06); margin-bottom: 22px; }
.pages-table th, .pages-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14.5px; vertical-align: middle; }
.pages-table th { background: var(--tint); color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.pages-table tr:last-child td { border-bottom: 0; }
.pages-table td.actions { white-space: nowrap; text-align: right; }
form.inline { display: inline; }
.blk-editor { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 16px 18px; margin: 0 0 16px; }
.blk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.blk-head b { font-size: 16px; }
.blk-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.blocks-title { margin-top: 26px; }
.add-block label { margin: 0; }

/* --- пакет «Понятная админка» --- */
.hint { display: block; font-weight: 400; font-size: 12.5px; color: var(--hint); margin-top: 5px; line-height: 1.45; }
.hint .count { color: var(--label); font-weight: 600; }
::placeholder { color: var(--placeholder); }

.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.step-dot { padding: 8px 14px; border-radius: 999px; background: #DCE9F5; color: var(--label); font-size: 14px; font-weight: 600; }
.step-dot.active { background: var(--accent); color: #fff; }
.step-dot.done { background: #d8ecd2; color: #2d5a27; }
.stepnav { display: flex; gap: 10px; align-items: center; margin: 4px 0 20px; }
.stepnav .btn.ghost { margin: 0; }

.empty-note { border: 1.5px dashed var(--dashed); border-radius: 14px; padding: 22px; text-align: center; color: var(--muted); background: var(--tint); margin-bottom: 16px; font-size: 15px; }
[data-items]:empty::after { content: 'Пока пусто — нажмите «+ Добавить элемент» ниже'; display: block; color: var(--hint); font-size: 13.5px; padding: 6px 0 12px; }

.block-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.bcard { text-align: left; background: var(--field-bg); border: 1.5px solid var(--card-border); border-radius: 12px; padding: 12px; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; gap: 7px; }
.bcard:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(9,64,116,.12); }
.bcard b { font-size: 15px; color: var(--ink); }
.bcard-desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.bp { display: block; height: 62px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; overflow: hidden; }
.bp i { display: block; border-radius: 3px; }
.bp-tag { width: 34%; height: 5px; background: #F5A300; margin-bottom: 5px; }
.bp-h { width: 72%; height: 9px; background: #33475B; margin-bottom: 5px; }
.bp-h.sm { width: 55%; height: 7px; }
.bp-line { width: 92%; height: 5px; background: #C9D6E8; margin-bottom: 4px; }
.bp-line.short { width: 55%; }
.bp-btn { width: 34%; height: 10px; background: #0977B9; margin-top: 6px; }
.bp-row { display: flex; gap: 6px; height: 100%; }
.bp-cell { flex: 1; background: #EDF3FA; border: 1px solid #D5E2F0; border-radius: 5px; }
.bp-cell.img { background: linear-gradient(#BFD7EE 55%, #EDF3FA 55%); }
.bp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; height: 100%; }
.bp-grid i { background: #BFD7EE; border-radius: 4px; }
.bp-price { height: 6px; background: repeating-linear-gradient(90deg, #33475B 0 34%, transparent 34% 88%, #0977B9 88% 100%); margin-bottom: 9px; opacity: .75; }
.bp-quote { font-size: 26px; line-height: .6; color: #F5A300; font-style: normal; margin-bottom: 6px; }
.bp-faq { height: 11px; background: #EDF3FA; border: 1px solid #D5E2F0; border-radius: 4px; margin-bottom: 5px; }
.bp-cta { display: block; background: #123B5C; border-radius: 6px; padding: 9px; height: 100%; }
.bp-cta .bp-h { background: #fff; }
.bp-contact { height: 9px; background: #EDF3FA; border-left: 9px solid #F5A300; border-radius: 3px; margin-bottom: 6px; }

.snippet { background: #fff; border: 1px solid #dfe3e8; border-radius: 12px; padding: 14px 16px; margin-top: 6px; max-width: 560px; }
.sn-url { font-size: 13px; color: #3c4043; margin-bottom: 3px; }
.sn-title { font-size: 19px; color: #1a0dab; line-height: 1.3; margin-bottom: 3px; }
.sn-desc { font-size: 13.5px; color: #4d5156; line-height: 1.5; }

.dropzone { border: 2px dashed var(--dashed); border-radius: 14px; padding: 26px 18px; text-align: center; cursor: pointer; background: var(--field-bg); margin-bottom: 14px; }
.dropzone.over { border-color: var(--accent); background: #eef5fc; }
.dropzone .dz-text { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.dropzone img { max-width: 180px; max-height: 120px; border-radius: 10px; margin-bottom: 10px; }
.undo-row { display: flex; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--card-border); }
.undo-row:last-child { border-bottom: 0; }
.undo-row span { font-size: 15px; }
.undo-row .btn.ghost { margin: 0; }
.add-block h3 { margin: 0 0 6px; font-size: 16px; }

/* ================================================================
   СТРУКТУРА «ВАРИАНТ А» (стандарт LAZALEX для всех админок):
   дерево страниц с поиском слева, «Общее» по разделам, редактор
   страницы вкладками, блоки компактными сворачивающимися строками,
   кнопка сохранения закреплена внизу экрана.
   ================================================================ */
.btn.small { padding: 7px 12px; font-size: 13.5px; }

.side { overflow-y: auto; }
.side-search { width: 100%; margin: 2px 0 6px; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--side-border); background: rgba(255,255,255,.08); color: #fff; font-size: 14px; font-family: inherit; }
.side-search::placeholder { color: var(--side-muted); }
.nav-group { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-muted); margin: 16px 4px 7px; display: flex; justify-content: space-between; align-items: center; }
.nav-group-link { color: var(--side-muted); text-decoration: none; }
.nav-group-link:hover { color: #fff; }
.nav-group .plus { background: var(--accent); color: #fff; width: 20px; height: 20px; border-radius: 6px; font-size: 14px; line-height: 20px; text-align: center; text-decoration: none; }
.tree { display: flex; flex-direction: column; gap: 2px; }
.tree a { color: var(--side-text); text-decoration: none; padding: 8px 11px; border-radius: 8px; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tree a:hover { background: var(--side-hover); }
.tree a.active { background: var(--accent); color: #fff; font-weight: 600; }
.tree .kids { margin-left: 14px; border-left: 1px solid var(--side-border); padding-left: 8px; display: none; flex-direction: column; gap: 2px; }
.tree .kids.open { display: flex; }
.tree .kids a { font-size: 13.5px; padding: 7px 10px; }
.tree .chev { font-size: 11px; color: var(--side-muted); padding: 2px 4px; }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 18px; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button:hover { color: var(--link); }
.tabs button.active { color: var(--link); border-bottom-color: var(--accent); }

.blk-kind { color: var(--muted); font-size: 13px; font-weight: 400; margin-right: auto; }
/* Кнопки в шапке блока: строго одного размера и в одну линию. */
.blk-tools { display: flex; gap: 6px; align-items: center; }
.blk-tools .btn { height: 34px; padding: 0 12px; display: inline-flex; align-items: center; margin: 0; font-size: 13.5px; line-height: 1; }
.blk-tools .btn.danger.small { margin-top: 0; }
/* Парные поля в ряд: чекбокс встаёт на высоту поля соседа, подсказка уходит под него. */
.row2 label.check { margin-top: 23px; flex-wrap: wrap; }
label.check .hint { flex-basis: 100%; }
.kid-tag { font-size: 11.5px; color: var(--side-muted); font-weight: 400; }
.blk-body { display: none; }
.blk-editor.open .blk-body { display: block; }
.blk-editor.open { border-color: var(--accent); box-shadow: 0 4px 16px rgba(9,64,116,.10); }

.savebar { position: sticky; bottom: 0; background: rgba(255,255,255,.94); border-top: 1px solid var(--line); padding: 12px 4px; display: flex; gap: 14px; align-items: center; margin-top: 18px; z-index: 5; }
.savebar .btn.big { margin-top: 0; }

.pages-table td.actions { width: 336px; }
.pages-table td.actions a.btn { min-width: 112px; text-align: center; }
.pages-table td.actions .btn.danger { min-width: 78px; }
