/* ─ Маркетинг · Соцсети (Сммакс) ─ */

#page-socials { height: 100%; }
.smx-wrap { display: flex; flex-direction: column; height: 100%; padding: 16px 20px; gap: 12px; box-sizing: border-box; }

.smx-topbar { display: flex; align-items: center; justify-content: space-between; }
.smx-title { font-size: 20px; font-weight: 700; }
.smx-top-actions { display: flex; gap: 8px; }

.smx-btn { border: none; background: #2563eb; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.smx-btn:hover { background: #1d4ed8; }
.smx-btn-ghost { background: #eef2f7; color: #334155; }
.smx-btn-ghost:hover { background: #e2e8f0; }

/* ── Настройки ── */
.smx-settings { background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; padding: 16px; }
.smx-set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.smx-set-row { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #64748b; }
.smx-set-row.smx-set-wide { grid-column: 1 / -1; }
.smx-set-row input, .smx-set-row textarea { border: 1px solid #d6dde8; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #1e293b; font-family: inherit; }
.smx-set-row textarea { resize: vertical; }
.smx-set-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.smx-set-hint { font-size: 11px; color: #94a3b8; }

/* ── Сплит чат | график ── */
.smx-split { display: flex; gap: 14px; flex: 1; min-height: 0; }
.smx-chat-pane { flex: 0 0 42%; min-width: 320px; min-height: 0; display: flex; }
.smx-calendar-pane { flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; }

/* ── Чат ── */
.smx-chat { display: flex; flex-direction: column; width: 100%; background: #fff; border: 1px solid #e5e9f0; border-radius: 12px; overflow: hidden; }
.smx-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eef2f7; }
.smx-ava { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg,#7c3aed,#2563eb); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.smx-chat-name { font-weight: 700; font-size: 14px; }
.smx-chat-sub { font-size: 11px; color: #94a3b8; }
.smx-clear { margin-left: auto; border: none; background: #f1f5f9; color: #64748b; font-size: 12px; padding: 6px 10px; border-radius: 7px; cursor: pointer; }
.smx-clear:hover { background: #e2e8f0; }

.smx-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.smx-greeting { color: #64748b; font-size: 13px; line-height: 1.5; background: #f8fafc; border-radius: 10px; padding: 14px; }

.smx-row { display: flex; flex-direction: column; max-width: 86%; }
.smx-row-out { align-self: flex-end; align-items: flex-end; }
.smx-row-in { align-self: flex-start; align-items: flex-start; }
.smx-bubble { padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; white-space: normal; word-wrap: break-word; }
.smx-bubble-out { background: #2563eb; color: #fff; border-bottom-right-radius: 5px; }
.smx-bubble-in { background: #f1f5f9; color: #1e293b; border-bottom-left-radius: 5px; }
.smx-typing { color: #94a3b8; font-style: italic; }

.smx-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.smx-act-btn { border: none; padding: 7px 13px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.smx-act-confirm { background: #16a34a; color: #fff; }
.smx-act-cancel { background: #eef2f7; color: #475569; }
.smx-act-btn:disabled { opacity: .55; cursor: default; }
.smx-act-result { margin-top: 6px; font-size: 12px; color: #475569; }

.smx-input-area { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eef2f7; }
.smx-input { flex: 1; border: 1px solid #d6dde8; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; resize: none; font-family: inherit; max-height: 140px; }
.smx-send { border: none; background: #2563eb; color: #fff; width: 40px; border-radius: 10px; font-size: 16px; cursor: pointer; }
.smx-send:hover { background: #1d4ed8; }

/* ── График постов ── */
.smx-cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #eef2f7; position: sticky; top: 0; background: #fff; z-index: 1; }
.smx-cal-title { font-weight: 700; font-size: 15px; }
.smx-count { display: inline-block; min-width: 18px; text-align: center; background: #eef2f7; color: #475569; border-radius: 9px; font-size: 12px; padding: 1px 7px; margin-left: 6px; }
.smx-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 16px 4px; }
.smx-fchip { border: 1px solid #d6dde8; background: #fff; color: #475569; font-size: 12px; padding: 5px 12px; border-radius: 20px; cursor: pointer; }
.smx-fchip.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.smx-cal-list { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.smx-cal-empty { color: #94a3b8; font-size: 13px; padding: 24px 8px; text-align: center; }
.smx-post { border: 1px solid #e9edf3; border-radius: 10px; padding: 11px 13px; }
.smx-post-top { display: flex; align-items: center; gap: 8px; }
.smx-ch-chip { color: #fff; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 12px; }
.smx-st-badge { font-size: 11px; border: 1px solid; padding: 1px 8px; border-radius: 12px; }
.smx-when { font-size: 12px; color: #64748b; }
.smx-post-del { margin-left: auto; border: none; background: transparent; color: #cbd5e1; font-size: 14px; cursor: pointer; }
.smx-post-del:hover { color: #dc2626; }
.smx-post-title { font-weight: 600; font-size: 13.5px; margin-top: 7px; }
.smx-post-text { font-size: 12.5px; color: #475569; margin-top: 3px; line-height: 1.4; }
.smx-post-tags { font-size: 12px; color: #2563eb; margin-top: 5px; }

/* ── Композер: режимы + референсы ── */
.smx-composer { border-top: 1px solid #eef2f7; }
.smx-modes { display: flex; gap: 6px; padding: 8px 10px 0; }
.smx-mode { border: 1px solid #d6dde8; background: #fff; color: #475569; font-size: 12.5px; padding: 5px 12px; border-radius: 18px; cursor: pointer; }
.smx-mode.active { background: #111827; color: #fff; border-color: #111827; }
.smx-refs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px 0; }
.smx-refs-label { font-size: 11px; color: #94a3b8; }
.smx-refs-empty { font-size: 11px; color: #94a3b8; }
.smx-ref-chip { border: 1px solid #d6dde8; background: #fff; color: #475569; font-size: 11.5px; padding: 4px 10px; border-radius: 14px; cursor: pointer; }
.smx-ref-chip.active { background: #7c3aed; color: #fff; border-color: #7c3aed; }
.smx-input-area { border-top: none; }

/* ── Медиа-пузырь ── */
.smx-media-bubble { max-width: 100%; }
.smx-media { display: block; max-width: 260px; width: 100%; border-radius: 10px; }
.smx-media-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.smx-topost-label { font-size: 11px; color: #94a3b8; margin-left: 2px; }
.smx-topost-btn { border: 1px solid #cbd5e1; background: #fff; color: #334155; font-size: 11.5px; padding: 4px 9px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.smx-topost-btn:hover { background: #f1f5f9; }
.smx-topost-btn:disabled { opacity: .5; }
.smx-dl { color: #2563eb; }

/* ── Библиотека референсов в настройках ── */
.smx-assets-block { margin-top: 18px; border-top: 1px solid #eef2f7; padding-top: 14px; }
.smx-assets-head { font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.smx-assets-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.smx-assets-empty { font-size: 12px; color: #94a3b8; }
.smx-asset-card { position: relative; width: 110px; border: 1px solid #e9edf3; border-radius: 10px; overflow: hidden; }
.smx-asset-card img { width: 100%; height: 90px; object-fit: cover; display: block; background: #f1f5f9; }
.smx-asset-meta { padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.smx-asset-kind { font-size: 10px; color: #7c3aed; text-transform: uppercase; letter-spacing: .3px; }
.smx-asset-name { font-size: 11.5px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smx-asset-del { position: absolute; top: 4px; right: 4px; border: none; background: rgba(0,0,0,.55); color: #fff; width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 11px; line-height: 1; }
.smx-asset-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.smx-asset-upload input[type=text], .smx-asset-upload input:not([type]), .smx-asset-upload select { border: 1px solid #d6dde8; border-radius: 8px; padding: 7px 9px; font-size: 12.5px; }
.smx-asset-upload input[placeholder*="Подсказка"], .smx-asset-upload input[placeholder*="Название"] { flex: 1; min-width: 140px; }

@media (max-width: 900px) {
  .smx-split { flex-direction: column; }
  .smx-chat-pane { flex: none; min-width: 0; height: 60vh; }
  .smx-set-grid { grid-template-columns: 1fr; }
}
