/* Стиль в духе интерфейса Битрикс24 */
:root {
    --text: #333;
    --muted: #828b95;
    --line: #e6e9ec;
    --bg-soft: #f5f7f8;
    --accent: #2fc6f6;
    --accent-dark: #11a9d8;
    --old: #c0392b;
    --old-bg: #fdf0ef;
    --new: #1e8e3e;
    --new-bg: #eef8f0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    font: 14px/1.45 "Open Sans", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #fff;
}
h1 { font-size: 22px; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.page { max-width: 760px; padding: 24px; }
.muted { color: var(--muted); }
.error { color: var(--old); }
.card { background: var(--bg-soft); border-radius: 8px; padding: 12px 16px; }
.card p { margin: 4px 0; }

.tab { padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.toolbar .spacer { flex: 1; }
select, input[type=search] {
    height: 34px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 4px;
    font: inherit; background: #fff; color: var(--text); min-width: 150px;
}
input[type=search] { min-width: 200px; }
.btn {
    height: 34px; padding: 0 16px; border: 1px solid #c6cdd3; border-radius: 4px;
    background: #fff; color: var(--text); font: inherit; cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
#summary { margin: 4px 0 10px; font-size: 13px; }
.state { padding: 32px; text-align: center; color: var(--muted); background: var(--bg-soft); border-radius: 8px; }

.small { font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); color: #fff; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.notice { background: #fff6e5; color: #8a5a00; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.ok-msg { background: var(--new-bg); color: var(--new); border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.err-msg { background: var(--old-bg); color: var(--old); border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-top: 12px; }
.page { max-width: 1200px; }
.spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.danger { color: var(--old); border-color: #f1c4c0; }
.danger:hover { color: #fff; background: var(--old); border-color: var(--old); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { border: 0; background: none; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.ava { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; }
.ava.ini { display: inline-flex; align-items: center; justify-content: center; background: #dfe5ea; color: #525c69; font-weight: 600; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 11px; color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.none { background: #f1f3f5; color: var(--muted); font-weight: 400; }
.note { font-size: 12px; color: #525c69; overflow-wrap: anywhere; }

/* история */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.grid .num { text-align: right; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.toolbar input[type=month] { height: 34px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; }
.box { background: var(--bg-soft); border-radius: 10px; padding: 14px 16px; }
.box p { margin: 0 0 8px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 6px 0; }
.check input { width: 16px; height: 16px; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: inherit; color: var(--muted); flex: none; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.toolbar input[type=date], .toolbar select { height: 34px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; }
.warn { color: var(--old); font-weight: 600; }
h3 { font-size: 15px; margin: 22px 0 10px; }
.link { border: 0; background: none; color: #2067b0; font: inherit; font-size: 13px; padding: 4px 0; cursor: pointer; border-bottom: 1px dashed #2067b0; align-self: flex-start; }

.page { max-width: 1500px; }
.box.how ol { margin: 6px 0; padding-left: 20px; }
.box.how li { margin: 3px 0; }
.empty-state { text-align: center; padding: 30px; background: var(--bg-soft); border-radius: 12px; margin: 10px 0; }
.big-emoji { font-size: 48px; }

/* список экранов */
.dlist { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.dcard { display: flex; gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; flex-wrap: wrap; }
.dthumb { width: 160px; height: 90px; border-radius: 8px; display: flex; align-items: flex-end; padding: 10px; font-weight: 700; color: #fff; background: #0b1220; border-bottom: 4px solid var(--acc); flex: none; overflow: hidden; }
.dthumb.theme-blue { background: linear-gradient(135deg, #0a2a66, #1a0b3d); }
.dthumb.theme-light { background: #eef2f6; color: #1c2533; }
.dinfo { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.dlink { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.dlink input { flex: 1; min-width: 200px; height: 30px; padding: 0 8px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; font-size: 12px; color: #525c69; background: var(--bg-soft); }
a.btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.dact { display: flex; flex-direction: column; gap: 6px; }

/* редактор */
.editor-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; margin-top: 12px; }
.form { display: flex; flex-direction: column; gap: 4px; }
.sec { background: var(--bg-soft); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.sec h3 { margin: 0 0 10px; font-size: 14px; }
.fl { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.fl > span { font-size: 12px; color: var(--muted); }
.fl input[type=text], .fl select, .plans input { height: 34px; padding: 0 10px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; box-sizing: border-box; }
.fl small { font-size: 11px; }
.frow2 { display: flex; gap: 10px; }
.frow2 .fl { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 12px; border: 1px solid #c6cdd3; border-radius: 15px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.checks { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; }
.checks .check { margin: 3px 0; font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 2px 4px 2px 10px; font-size: 13px; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; }
.plans { display: flex; flex-direction: column; gap: 6px; }
.prow2 { display: flex; gap: 6px; align-items: center; }
.prow2 input { width: 130px; }
.wlist { display: flex; flex-direction: column; gap: 6px; }
.wrow { display: flex; gap: 6px; align-items: center; }
.wrow select { height: 32px; border: 1px solid #c6cdd3; border-radius: 4px; font: inherit; background: #fff; }
.wrow select:first-child { flex: 1; min-width: 0; }
.themes { display: flex; gap: 6px; }
.th { flex: 1; height: 40px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.th-dark { background: #0b1220; color: #fff; }
.th-blue { background: linear-gradient(135deg, #0a2a66, #1a0b3d); color: #fff; }
.th-light { background: #eef2f6; color: #1c2533; border-color: #dfe5ec; }
.th.on { outline: 3px solid var(--accent); outline-offset: 1px; }
.colors { display: flex; gap: 6px; }
.col { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.col.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff inset; }
.actions.sticky { position: sticky; bottom: 0; background: #fff; padding: 10px 0; }
.pv { position: sticky; top: 10px; }
.pvhead { margin-bottom: 8px; }
.pvbox { border-radius: 12px; overflow: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.pvbox .screen { aspect-ratio: 16 / 9; width: 100%; }
@media (max-width: 1000px) { .editor-grid { grid-template-columns: 1fr; } .pv { position: static; order: -1; } }
