:root {
  --bg: #f5f6f8; --surface: #fff; --text: #1d2330; --muted: #6b7385; --border: #dfe3ea;
  --primary: #2563eb; --primary-text: #fff; --primary-hover: #1d4fd1; --danger: #c0352b; --ok: #1b8a4b; --warn: #b7791f;
  --hover: #eceff4; --border-strong: #c9ced9; --danger-soft: #fbeceb; --danger-border: #efc2be;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171d; --surface: #1c2029; --text: #e7eaf0; --muted: #9aa3b5; --border: #2d3340; --primary: #4b83f0; --danger: #e5675d; --ok: #3ec27a; --warn: #e0a647;
    --primary-hover: #6b97f5; --hover: #252b37; --border-strong: #3d4555; --danger-soft: #3a2224; --danger-border: #6b2f2b; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; box-shadow: 0 1px 3px rgb(0 0 0 / .04); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; margin-inline-end: 8px; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.topbar nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav-link { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--hover); color: var(--text); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar form { margin: 0; }
.container { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 1.5rem; margin: 0 0 16px; } h2 { font-size: 1.1rem; margin: 0 0 12px; }
.page-head h1 { margin: 0; } .page-head { margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.narrow { max-width: 480px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack label { font-weight: 600; margin-top: 8px; }
.stack label:has(input[type=checkbox]) { font-weight: 400; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: inherit; font: inherit; }
textarea { resize: vertical; }
.inline { display: flex; gap: 8px; align-items: center; } .inline input { width: 110px; }
.muted { color: var(--muted); } small.muted { font-size: .85rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none; box-shadow: 0 1px 2px rgb(0 0 0 / .06); transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:hover { text-decoration: none; background: var(--hover); border-color: var(--border-strong); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); box-shadow: 0 1px 2px rgb(0 0 0 / .15); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger-border); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-quiet:hover { background: var(--hover); border-color: transparent; color: var(--text); }
.btn-small { min-height: 28px; padding: 0 10px; border-radius: 6px; font-size: .82rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.actions, .row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .actions form, .row-actions form { margin: 0; }
.actions { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.post-preview { max-width: 420px; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; border: 1px solid currentColor; }
.badge-sent { color: var(--ok); } .badge-failed { color: var(--danger); } .badge-queued, .badge-scheduled, .badge-publishing, .badge-pending, .badge-sending { color: var(--warn); } .badge-draft, .badge-cancelled { color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash-notice { color: var(--ok); } .flash-alert { color: var(--danger); } .flash ul { margin: 0; padding-inline-start: 18px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.filters { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; } .filters .active { font-weight: 700; color: var(--text); }
.dropzone { border: 2px dashed var(--border); border-radius: 8px; padding: 22px; text-align: center; color: var(--muted); }
.dropzone:focus, .dropzone.dragging { border-color: var(--primary); outline: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; } .thumb { display: flex; flex-direction: column; align-items: center; font-size: .8rem; font-weight: 400 !important; }
.thumb img, .thumb video, .thumb-img { width: 110px; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.checks { display: flex; flex-direction: column; gap: 4px; }
.body-text { white-space: pre-wrap; font-size: 1.02rem; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 16px 0 0; } .meta dt { color: var(--muted); } .meta dd { margin: 0; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; z-index: 5; inset-inline-start: 0; top: 100%; margin-top: 4px; min-width: 220px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgb(0 0 0 / .15); }
.menu-panel label { font-weight: 400; margin: 0; }
td:has(.row-actions) { min-width: 260px; }
