/* Автопостер — оформление «Рабочий стол»: светлое, спокойное, меню по смыслу */

/* Manrope (SIL OFL 1.1, fonts/Manrope-OFL.txt) — свой файл, без обращений к Google */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/manrope-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #f4f6f9; --panel: #fff; --text: #172033; --text-2: #2a3448; --muted: #5b6577; --line: #e3e8ef; --line-2: #eef1f5;
  --accent: #1f5fd6; --accent-hover: #174aa8; --accent-soft: #eaf1fd; --accent-text: #fff;
  --ok: #1c6b3a; --ok-bg: #e7f6ec; --ok-dot: #2e9d5b;
  --bad: #b42318; --bad-bg: #fff1f0; --bad-line: #f1c4c4;
  --warn: #7a4a00; --warn-bg: #fff8eb; --warn-line: #f5d9a8;
  --info: #1f5fd6; --info-bg: #eaf1fd; --code: #f0f2f6; --wait: #98a2b3;
  --radius: 10px; --radius-lg: 14px;
  --font: "Manrope", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1 { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- каркас: меню слева + содержимое ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .logo { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: flex;
  align-items: center; justify-content: center; font-weight: 700; flex: none; }
.brand b { display: block; font-size: 15px; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.side nav { display: flex; flex-direction: column; gap: 16px; }
.navgroup { display: flex; flex-direction: column; gap: 1px; }
.navgroup .title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 5px; }
.navgroup a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.navgroup a:hover { background: var(--bg); color: var(--text); }
.navgroup a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.navgroup a .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.side .bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.side .bottom button { width: 100%; }
.side .who { font-size: 12px; color: var(--muted); padding: 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.content { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.content > .inner { max-width: 1280px; margin: 0 auto; }
.side .navtoggle, .side .navbtn { display: none; }
.inner > h1 { margin-bottom: 18px; }

/* шапка страницы: заголовок + действия справа */
.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 14px; min-height: 42px; }
.chip span { font-size: 12px; color: var(--muted); }

/* ---------- карточки, сетки ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid > .card { margin-bottom: 0; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 18px; }
.cols-3 { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.cols-3 > * > .card:last-child, .cols-3 > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack > .card { margin-bottom: 0; }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 30px 0 12px; }

/* лента дня */
.tl { display: flex; flex-direction: column; }
.tl .item { display: grid; grid-template-columns: 52px 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.tl .item:first-child { border-top: 0; }
.tl .time { font-weight: 700; font-variant-numeric: tabular-nums; }
.tl .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--wait); }
.tl .dot.ok { background: var(--ok-dot); } .tl .dot.info { background: var(--accent); } .tl .dot.bad { background: var(--bad); }
.tl .what { min-width: 0; }
.tl .what > a, .tl .what > b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.tl .what > a:hover { color: var(--accent); }
.tl .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* требует внимания */
.attn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-lg); padding: 18px 20px; }
.attn h2 { color: var(--warn); }
.attn .it { color: #5c3800; font-size: 13px; padding: 8px 0; border-top: 1px solid var(--warn-line); }
.attn .it:first-of-type { border-top: 0; padding-top: 0; }
.attn .it b { display: block; font-size: 14px; }
.allgood { background: var(--ok-bg); border: 1px solid #cdebd7; color: var(--ok); border-radius: var(--radius-lg); padding: 16px 20px; font-weight: 600; }

/* список сайтов */
.sites .row-site { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); color: var(--text); }
.sites .row-site:first-of-type { border-top: 0; }
.sites .row-site b { display: block; }
.sites .row-site span { font-size: 12px; color: var(--muted); }
.light { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--wait); }
.light.ok { background: var(--ok-dot); box-shadow: 0 0 0 4px #2e9d5b1f; } .light.bad { background: var(--bad); box-shadow: 0 0 0 4px #b423181f; }

/* ---------- таблицы ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, table tr:hover td { background: #fafbfd; }
.scroll { overflow-x: auto; }

/* ---------- значки, сообщения ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef2f7; color: #3e4a5e; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.warn { background: #fff1e0; color: #8a4b00; }
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; background: var(--ok-bg); color: var(--ok); border: 1px solid #cdebd7; font-weight: 500; }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
/* тумблер вкл/выкл */
.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 4px; border: 0; background: transparent;
  color: var(--muted); font-weight: 600; cursor: pointer; }
.switch:hover { background: transparent; color: var(--text); }
.switch .track { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #cfd6e0; transition: background .15s; flex: none; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px #17203340; transition: left .15s; }
.switch.on { color: var(--ok); }
.switch.on .track { background: var(--ok-dot); }
.switch.on .knob { left: 23px; }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
label.switch input { position: absolute; opacity: 0; pointer-events: none; }
label.switch:has(input:checked) { color: var(--ok); }
label.switch:has(input:checked) .track { background: var(--ok-dot); }
label.switch:has(input:checked) .knob { left: 23px; }

/* ---------- формы ---------- */
form.inline { display: inline; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 13px; color: var(--text-2); }
label.check { font-weight: 500; display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 14px; color: var(--text); cursor: pointer; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=number], input[type=password], input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #d5dbe4; border-radius: var(--radius); background: var(--panel);
  color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #1f5fd626; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }
textarea { min-height: 120px; font-family: var(--mono); font-size: 13px; line-height: 1.5; }
textarea.plain { font-family: var(--font); font-size: 14px; }
textarea.tall { min-height: 360px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.checks { display: grid; gap: 2px 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); max-height: 280px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: #fbfcfd; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid #d5dbe4; background: var(--panel); color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
button:hover, .btn:hover { border-color: #b8c1ce; color: var(--text); background: #fafbfd; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
button.danger, .btn.danger { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
button.danger:hover { background: #ffe4e1; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--bg); color: var(--text); }
button.small, .btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
button.big, .btn.big { min-height: 44px; padding: 0 20px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
pre, code { background: var(--code); border-radius: 6px; font-family: var(--mono); }
pre { padding: 12px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 13px; max-height: 420px; }
code { padding: 1px 6px; font-size: 12.5px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }

/* ---------- форма кампании ---------- */
.summary { background: var(--accent-soft); border: 1px solid #cddcf7; border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 18px;
  font-size: 15px; line-height: 1.6; color: #16305f; }
.summary .label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.summary b { color: #0f2550; }
.form-cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.form-cols .aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; }
.form-cols .aside .card { margin-bottom: 0; }
.sec { position: relative; padding-left: 64px; }
.sec .n { position: absolute; left: 20px; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; }
.sec > h2 { margin-top: 4px; }
.sec .lead { color: var(--muted); margin: -6px 0 6px; font-size: 13px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg label { margin: 0; font-weight: 600; font-size: 13px; color: var(--muted); padding: 7px 14px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px #17203326; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.options { display: flex; flex-direction: column; gap: 8px; }
.option { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; font-weight: 500; cursor: pointer; }
.option:has(input:checked) { border-color: var(--accent); background: #f6f9ff; }
.option input { margin-top: 3px; }
.option b { display: block; }
.option .hint { margin-top: 2px; }
.option .more { margin-top: 10px; display: none; }
.option:has(input:checked) .more { display: block; }

/* карточки «где картинки» */
.picks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick { margin: 0; border: 2px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; background: var(--panel); font-weight: 500; display: block; }
.pick:hover { border-color: #c5cfdc; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { border-color: var(--accent); background: #f6f9ff; }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pick b { display: block; margin-top: 8px; font-size: 13px; }
.pick small { display: block; color: var(--muted); font-size: 12px; }
.mini { height: 86px; background: #f7f8fa; border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.mini i { display: block; height: 5px; border-radius: 3px; background: #d8dde6; flex: none; }
.mini i.h { height: 7px; width: 50%; background: #9aa4b5; }
.mini i.t:nth-child(even) { width: 78%; }
.mini i.i { height: 24px; background: #bcd0f2; }
.mini i.s { height: 12px; background: repeating-linear-gradient(90deg, #bcd0f2 0 22%, transparent 22% 26%); }
.mini.custom { align-items: center; justify-content: center; font-size: 22px; color: var(--muted); font-weight: 700; }
.mini.custom i { display: none; }
.pool-opts { margin-top: 4px; }
.when-images-off .needs-images { opacity: .45; pointer-events: none; }

.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { margin: 0; width: 46px; height: 40px; border: 1px solid #d5dbe4; border-radius: var(--radius); display: flex; align-items: center;
  justify-content: center; font-weight: 600; color: var(--muted); cursor: pointer; background: var(--panel); }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.days label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.window-bar { position: relative; height: 26px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); margin-top: 10px; overflow: hidden; }
.window-bar .fill { position: absolute; top: 0; bottom: 0; background: #cddcf7; border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.window-bar .ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; padding: 0 6px; align-items: center; font-size: 10.5px; color: var(--muted); }
.upcoming { display: flex; flex-direction: column; }
.upcoming div { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.upcoming div:first-child { border-top: 0; }
.savebar { position: sticky; bottom: 0; z-index: 5; background: #f4f6f9e6; backdrop-filter: blur(6px); border-top: 1px solid var(--line);
  margin: 0 -32px; padding: 12px 32px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* кампании — список */
.camp-list { display: flex; flex-direction: column; gap: 12px; }
.camp { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 16px 20px; align-items: center; }
.camp h3 { font-size: 16px; margin: 0; }
.camp h3 a { color: var(--text); }
.camp h3 a:hover { color: var(--accent); }
.camp .desc { color: var(--text-2); margin-top: 4px; }
.camp .facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 8px; }
.camp .facts b { color: var(--text); font-weight: 600; }
.camp.off { opacity: .72; }

/* ---------- картинки, календарь, прочее ---------- */
.pics { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pic { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.pic img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--code); }
.pic form { padding: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal .head { color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; text-transform: uppercase; }
.cal .day { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; min-height: 104px; padding: 8px; font-size: 12px; }
.cal .day.other { opacity: .45; }
.cal .day.today { border-color: var(--accent); box-shadow: 0 0 0 2px #1f5fd626; }
.cal .day .n { font-weight: 700; font-size: 13px; }
.cal .ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 6px; background: #eef2f7; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.ok { background: var(--ok-bg); color: var(--ok); }
.cal .ev.bad { background: var(--bad-bg); color: var(--bad); }
.cal .ev.info { background: var(--info-bg); color: var(--info); }
iframe.preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.wrap { max-width: 1280px; margin: 0 auto; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { padding: 0 0 18px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 1100px) {
  .form-cols, .cols-3 { grid-template-columns: 1fr; }
  .form-cols .aside { position: static; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .side { width: auto; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 0; }
  .side .head { display: flex; align-items: center; justify-content: space-between; }
  .side .navbtn { display: inline-flex; }
  .side nav, .side .bottom { display: none; }
  .navtoggle:checked ~ nav, .navtoggle:checked ~ .bottom { display: flex; }
  .side nav { margin-top: 14px; }
  .side .bottom { margin-top: 14px; }
  .content { padding: 18px 16px 40px; }
  .savebar { margin: 0 -16px; padding: 12px 16px; }
  .sec { padding-left: 20px; }
  .sec .n { position: static; margin-bottom: 8px; }
  .cal { grid-template-columns: 1fr; }
  .cal .head { display: none; }
  .cal .day.other { display: none; }
  .tl .item { grid-template-columns: 46px 10px minmax(0, 1fr); }
  .tl .item > :last-child { grid-column: 3; justify-self: start; }
}
