/* ============================================================
   Редактор контента (вкладка «Контент» в admin.html)
   Использует переменные темы из css/theme.css
   ============================================================ */

.ce-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .ce-layout { grid-template-columns: 1fr; } }

.ce-setup-banner {
    border: 1px solid var(--accent-red-bright); background: #2a1412; color: var(--text-main);
    border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; font-size: 16px; line-height: 1.5;
}
.ce-setup-banner code { background: #14181d; padding: 1px 6px; border-radius: 4px; }

/* --- список паков --- */
#ce-pack-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 62vh; overflow-y: auto; }
#ce-pack-list li {
    padding: 12px 14px; margin-bottom: 10px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--btn-slate-border); background: #14181d;
}
#ce-pack-list li:hover { border-color: var(--gold-dark); }
#ce-pack-list li.active { border-color: var(--accent-gold); background: #1c1a12; }
#ce-pack-list li.builtin { border-style: dashed; }
#ce-pack-list li .t { font-weight: 600; font-size: 18px; line-height: 1.25; }
#ce-pack-list li .m { color: var(--text-muted); font-size: 15px; margin-top: 4px; line-height: 1.35; }
.ce-off { opacity: .55; }

/* --- шапка пака --- */
.ce-head { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px 14px; align-items: end; margin-bottom: 14px; }
.ce-head > div { display: flex; flex-direction: column; }
.ce-head label, .ce-field-label { display: block; color: var(--text-muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.ce-head input, .ce-head select { margin: 6px 0 0; height: 46px; }
.ce-games { display: flex; gap: 10px 22px; flex-wrap: wrap; align-items: center; margin: 8px 0 16px; }
.ce-games label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-main); font-size: 17px; cursor: pointer; }
.ce-games input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-gold); flex: none; }
.ce-dim { color: var(--text-muted); font-size: 14px; }
.ce-sync label { background: #14181d; border: 1px solid var(--btn-slate-border); border-radius: 6px; padding: 8px 12px; }
.ce-sync label:hover { border-color: var(--gold-dark); }
.ce-cats { font-family: monospace; font-size: 14px; min-height: 80px; margin: 6px 0 8px; }
#ce-cats-box { margin-bottom: 16px; }
#ce-cats-box summary { padding: 4px 0; }

/* --- панель качества --- */
.ce-quality { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 16px; }
.ce-chip {
    font-size: 14px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--btn-slate-border);
    color: var(--text-muted); background: #14181d; cursor: default;
}
.ce-chip.bad { color: var(--accent-red-bright); border-color: var(--accent-red-bright); cursor: pointer; }
.ce-chip.warn { color: var(--accent-gold); border-color: var(--gold-dark); cursor: pointer; }
.ce-chip.ok { color: var(--accent-green); border-color: var(--accent-green); }
.ce-chip.active-filter { background: #2a1f10; }

/* --- тулбар: все контролы одной высоты --- */
.ce-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.ce-toolbar > input, .ce-toolbar > select, .ce-toolbar > button { height: 46px; margin: 0; font-size: 17px; padding: 0 14px; }
.ce-toolbar > button { white-space: nowrap; }
.ce-toolbar > input { flex: 1 1 240px; min-width: 200px; width: auto; }
.ce-toolbar > select { flex: 0 1 300px; width: auto; min-width: 180px; }
.ce-actions > #ce-btn-fix { margin-left: auto; }
.ce-addbar > #ce-quick { flex: 1 1 320px; }
.ce-addbar > select { flex: 0 1 260px; }
#ce-status { min-height: 22px; margin: 2px 0 12px; }

/* --- таблица слов --- */
.ce-table-wrap { overflow-x: auto; }
table.ce-items { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.ce-items th { text-align: left; color: var(--text-muted); font-size: 13px; letter-spacing: .5px; text-transform: uppercase; padding: 8px 8px; border-bottom: 1px solid var(--btn-slate-border); }
table.ce-items td { padding: 6px 8px; border-bottom: 1px solid #252b33; vertical-align: middle; }
table.ce-items th:first-child, table.ce-items td.n { width: 52px; }
table.ce-items td.n { color: var(--text-muted); font-size: 15px; }
table.ce-items th.cat, table.ce-items td.cat { width: 320px; }
table.ce-items th.img, table.ce-items td.img { width: 72px; }
table.ce-items th.del, table.ce-items td.del { width: 64px; }
table.ce-items input, table.ce-items select { margin: 0; height: 44px; padding: 0 12px; font-size: 18px; }
table.ce-items select { font-size: 16px; }
table.ce-items td.del { text-align: right; }
table.ce-items td.del button { width: 44px; height: 44px; padding: 0; font-size: 16px; }
table.ce-items tr.bad td { background: rgba(192, 57, 43, .10); }
table.ce-items tr.bad input.w { border-color: var(--accent-red-bright); }
table.ce-items tr.warn input.w { border-color: var(--gold-dark); }
.ce-flags { font-size: 13px; color: var(--accent-red-bright); margin-top: 3px; min-height: 0; }
.ce-flags:empty { display: none; }
@media (max-width: 700px) {
    table.ce-items th.cat, table.ce-items td.cat { width: 190px; }
}
.ce-thumb {
    width: 48px; height: 48px; border-radius: 6px; border: 1px dashed var(--btn-slate-border);
    background: #14181d center/cover no-repeat; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 0;
}
.ce-thumb.has { border-style: solid; background-size: contain; }
.ce-thumb.err { border-color: var(--accent-red-bright); color: var(--accent-red-bright); }
.ce-more { text-align: center; padding: 12px; }

/* --- нижняя панель сохранения --- */
.ce-savebar {
    position: sticky; bottom: 10px; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    background: #1c1a12; border: 1px solid var(--accent-gold); border-radius: 8px; padding: 10px 14px; margin-top: 14px;
}
.ce-savebar.clean { display: none; }
.ce-savebar .msg { flex: 1; color: var(--text-main); font-size: 16px; }

/* --- модалки редактора --- */
.ce-modal-bg {
    position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50; display: none;
    align-items: center; justify-content: center; padding: 16px;
}
.ce-modal-bg.open { display: flex; }
.ce-modal {
    width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
    background: var(--panel-bg); border: 1px solid var(--accent-gold); border-radius: 10px; padding: 20px;
}
.ce-modal h3 { margin-top: 0; }
.ce-modal-bg input, .ce-modal-bg select { font-size: 17px; }
.ce-modal textarea { min-height: 200px; }
.ce-preview { width: 100%; height: 190px; border: 1px solid var(--btn-slate-border); border-radius: 8px; background: #14181d center/contain no-repeat; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 15px; }
.ce-progress { height: 8px; border-radius: 6px; background: #14181d; overflow: hidden; margin: 10px 0; }
.ce-progress > div { height: 100%; width: 0; background: var(--accent-gold); transition: width .15s; }
.ce-log { font-size: 14px; color: var(--text-muted); max-height: 140px; overflow-y: auto; white-space: pre-wrap; }
.ce-help { color: var(--text-muted); font-size: 15px; line-height: 1.5; margin: 6px 0 14px; }
.ce-help code { background: #14181d; padding: 1px 5px; border-radius: 4px; }

.ce-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 5px; display: block; }

.ce-report { color: var(--accent-red-bright); font-weight: 600; }
.ce-report-dismiss {
    font-weight: 400; font-size: 13px; padding: 1px 9px; margin-left: 4px; border-radius: 10px;
    border: 1px solid var(--accent-red-bright); background: transparent; color: var(--accent-red-bright); cursor: pointer;
}
.ce-report-dismiss:hover { background: var(--accent-red-bright); color: #fff; }
.ce-report-badge { color: var(--accent-red-bright); font-size: 14px; font-weight: 700; }

/* --- плавающая панель навигации по паку --- */
#ce-float {
    position: fixed; right: 16px; bottom: 90px; z-index: 40; flex-direction: column; gap: 8px;
}
#ce-float button { margin: 0; padding: 10px 14px; font-size: 15px; box-shadow: 0 2px 10px rgba(0,0,0,.6); background: #1c1a12; border: 1px solid var(--accent-gold); white-space: nowrap; }
#ce-editor.ce-collapsed .ce-table-wrap,
#ce-editor.ce-collapsed .ce-more { display: none; }

#ce-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; max-width: min(720px, 92vw); padding: 12px 18px; border-radius: 8px; background: #17140d; border: 1px solid var(--accent-gold); box-shadow: 0 4px 18px rgba(0,0,0,.7); display: none; font-size: 16px; }
#ce-toast.ok { color: var(--accent-green); border-color: var(--accent-green); }
#ce-toast.err { color: var(--accent-red-bright); border-color: var(--accent-red-bright); }
