/* Админка: поверх blog.css (токены, кнопки, .prose, .post, .cta). Ниже — имена токенов
   urast-cms, которыми написан этот файл, в палитре Сетки. */
.adm {
  --bg: #f7faff; --bg-deep: #0f1b2d; --card: #fff;
  --ink-soft: #5a6b85; --ink-faint: #8496ae;
  --brand: #0d7bff; --brand-deep: #0b5ed7; --brand-soft: #e9f2ff;
  --accent: #0d7bff; --accent-soft: #e3f7ee; --warn-soft: #fff4e5;
  --shadow-md: 0 12px 32px rgba(15,27,45,.16);
  font-size: 16px;
}
.btn-max { background: linear-gradient(180deg, var(--blue) 0%, var(--blue-600) 100%); color: #fff; box-shadow: var(--sh-blue); }
.btn-light { background: var(--surface); color: var(--ink); }
.btn-light:hover { background: var(--line-soft); }
.btn-sm { padding: 8px 16px; font-size: 14px; font-weight: 600; }
.adm { background: #f4f6fa; }
.adm-noscript { padding: 40px; text-align: center; }

.adm-top { background: var(--bg-deep); color: #fff; position: sticky; top: 0; z-index: 40; }
.adm-top-in { max-width: 1400px; margin: 0 auto; padding: 0 20px; min-height: 56px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.adm-logo { color: #c4d2e6; text-decoration: none; font-size: .95rem; }
.adm-logo b { color: #fff; font-weight: 800; }
.adm-nav { display: flex; gap: 4px; }
.adm-nav a { color: #c4d2e6; text-decoration: none; font-weight: 600; font-size: .92rem; padding: 7px 12px; border-radius: 8px; }
.adm-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.adm-nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.12); }
.adm-top-actions { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: .9rem; }
.adm-top-actions a, .adm-top .linkbtn { color: #c4d2e6; }

.adm-main { max-width: 1400px; margin: 0 auto; padding: 24px 20px 80px; }
.adm-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.adm-head h1 { font-size: 1.6rem; font-weight: 800; }
.adm-note { margin: 16px 0; color: var(--ink-soft); font-size: .92rem; max-width: 760px; }

.linkbtn { background: none; border: none; padding: 0; font: inherit; font-weight: 600; color: var(--brand-deep); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.danger { color: #c0392b; }

.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.is-pub { background: var(--accent-soft); color: #0c7a4f; }
.badge.is-draft { background: #eef0f4; color: var(--ink-soft); }

.adm-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .93rem; }
.adm-table th { text-align: left; font-size: .8rem; color: var(--ink-faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 12px 14px; background: var(--bg); }
.adm-table td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.adm-table .nowrap { white-space: nowrap; }
.row-title { display: block; font-weight: 700; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--brand-deep); text-decoration: underline; }
.row-slug { display: block; color: var(--ink-faint); font-size: .82rem; }
.row-warn { display: inline-block; margin-top: 4px; font-size: .78rem; color: #8a5a1f; background: var(--warn-soft); padding: 1px 8px; border-radius: 6px; cursor: help; }

/* ---------- формы ---------- */
.f { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; position: relative; min-width: 0; }
.f-label { font-weight: 700; font-size: .9rem; }
.f-hint { color: var(--ink-faint); font-size: .82rem; line-height: 1.45; }
.f-count { position: absolute; right: 0; top: 0; font-size: .78rem; color: var(--ink-faint); }
.f-count.is-bad { color: #c0392b; font-weight: 700; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.f input[type="text"], .f input[type="password"], .f input[type="number"], .f input[type="datetime-local"], .f input:not([type]), .f select, .f textarea, .cover-box input {
  font: inherit; font-size: .95rem; color: var(--ink);
  width: 100%; padding: 10px 12px; border: 1px solid #cfd8e5; border-radius: 10px; background: #fff;
}
.f textarea { resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus, textarea.md:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.slug-row { display: flex; align-items: center; gap: 4px; }
.slug-prefix { color: var(--ink-faint); font-weight: 600; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; margin: 6px 0; cursor: pointer; }
.check input { margin-top: 4px; flex-shrink: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 18px; }

.card-sec { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px 8px; margin-bottom: 16px; }
.card-sec h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 12px; }
.card-sec > .f-hint { margin: -6px 0 12px; }
.stack .card-sec { padding-bottom: 16px; }

.form-err { background: #fdecea; border: 1px solid #f5c2bc; color: #8c2a1d; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: .92rem; }
.ed-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 20px 0; }

/* ---------- редактор ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ed-preview { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto; padding: 0 2px 2px; }
.ed-preview .post { padding: 28px 30px; margin: 0; }
.ed-preview .post-head h1 { margin: 0; font-size: 1.9rem; }
.prev-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 8px; }
.prev-stats { font-size: .82rem; color: var(--ink-faint); margin-bottom: 8px; }
.warns { list-style: none; margin: 0 0 10px; padding: 10px 14px; background: var(--warn-soft); border: 1px dashed #e0b07a; border-radius: 12px; color: #8a5a1f; font-size: .86rem; }
.warns li::before { content: "⚠ "; }
.warns li + li { margin-top: 4px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.toolbar button { font: inherit; font-size: .85rem; font-weight: 700; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.toolbar button:hover { border-color: #b9cbe6; background: #fff; }
textarea.md { font: inherit; font-size: .95rem; line-height: 1.6; width: 100%; min-height: 460px; padding: 14px; border: 1px solid #cfd8e5; border-radius: 12px; resize: vertical; color: var(--ink); }
.picker { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.picker-title { font-weight: 800; margin-bottom: 8px; }
.picker-list { max-height: 240px; overflow: auto; display: grid; gap: 4px; }
.picker-item { text-align: left; font: inherit; font-size: .92rem; padding: 7px 10px; border-radius: 8px; border: 1px solid transparent; background: #fff; cursor: pointer; }
.picker-item:hover { border-color: #b9cbe6; }
.picker-actions { display: flex; gap: 14px; align-items: center; margin-top: 10px; }

.snippet { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; background: #fff; }
.snip-title { color: #1a0dab; font-size: 1.05rem; line-height: 1.35; }
.snip-url { color: #006621; font-size: .85rem; }
.snip-desc { color: #4d5156; font-size: .88rem; line-height: 1.45; margin-top: 2px; }

.cover-box { display: grid; gap: 10px; margin-bottom: 14px; justify-items: start; }
.cover-box img { max-width: 100%; max-height: 220px; border-radius: 10px; }
.photo-box { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.photo-box img { width: 120px; height: 150px; object-fit: cover; border-radius: 12px; background: #dfe6f0; flex-shrink: 0; }
.photo-box > div { flex: 1; display: grid; gap: 10px; justify-items: start; }
.photo-box .f { width: 100%; }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(180deg, #3d8bff 0%, #0b57d0 100%); }
.login { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; padding: 28px; }
.login h1 { font-size: 1.6rem; margin: 4px 0 18px; }
.login-brand { color: var(--ink-faint); font-weight: 700; font-size: .85rem; }
.login .btn { width: 100%; }
.login-err { color: #c0392b; font-size: .9rem; min-height: 1.4em; margin: -6px 0 10px; }
.login-note { color: var(--ink-soft, #475569); font-size: .92rem; margin: -8px 0 16px; }
.login-link { display: block; margin: 14px auto 0; background: none; border: 0; padding: 4px; color: var(--accent, #1d4ed8); font: inherit; font-size: .92rem; text-decoration: underline; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow-md); max-width: calc(100% - 32px); }
.toast.is-ok { background: #0c7a4f; }
.toast.is-error { background: #b3261e; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .ed-preview { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .f-row { grid-template-columns: 1fr; }
  .adm-top-actions { margin-left: 0; width: 100%; padding-bottom: 10px; }
  .adm-table th:nth-child(3), .adm-table td:nth-child(3), .adm-table th:nth-child(5), .adm-table td:nth-child(5) { display: none; }
  .photo-box { flex-direction: column; }
}

.launch-warns { background: var(--warn-soft); border: 1px dashed #e0b07a; border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; color: #6b4517; font-size: .92rem; }
.launch-title { font-weight: 800; margin-bottom: 6px; }
.launch-warns ul { margin: 0; padding-left: 20px; }
.login input[type=password] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
