/* Jed blog dashboard */
:root {
  --navy: #343877;
  --navy-dark: #262a5e;
  --gold: #efc940;
  --red: #e5405e;
  --green: #2ec774;
  --bg: #f4f5fa;
  --card: #fff;
  --text: #2a2a3a;
  --muted: #6b6d85;
  --line: #e1e3ee;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Quicksand", system-ui, sans-serif;
}
a { color: var(--navy); }
h1 { font-size: 26px; margin: 0 0 4px; color: var(--navy); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* top bar */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  padding: 10px 24px;
  background: var(--navy);
  color: #fff;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.topbar__brand img { height: 36px; background: #fff; border-radius: 6px; padding: 2px; }
.topbar__nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.topbar__nav a, .topbar__user a {
  padding: 7px 12px;
  border-radius: 6px;
  font-weight: 600;
  opacity: 0.85;
}
.topbar__nav a:hover, .topbar__user a:hover, .topbar a.is-active {
  background: rgba(255,255,255,0.12);
  opacity: 1;
}
.topbar a.is-active { color: var(--gold); }
.topbar__user { display: flex; align-items: center; gap: 8px; }
.topbar__user form { margin: 0; }
.topbar__user .linklike { color: #fff; opacity: 0.85; font-weight: 600; }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
.page--narrow { max-width: 460px; padding-top: 60px; }
.page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.back { display: inline-block; font-size: 14px; font-weight: 600; margin-bottom: 6px; text-decoration: none; }

/* cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(52,56,119,0.07);
  padding: 22px;
  margin-bottom: 20px;
}
.card__title { font-size: 16px; color: var(--navy); margin: 0 0 14px; }
.card.narrow { max-width: 560px; }
.empty { text-align: center; padding: 50px 20px; }
.empty p { margin: 0 0 16px; font-size: 17px; }

/* auth */
.auth { text-align: center; padding: 34px 30px; }
.auth__logo { height: 64px; margin-bottom: 10px; }
.auth .form { text-align: left; margin-top: 22px; }
.auth > .small { margin-top: 18px; }

/* notices */
.notice { border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; font-weight: 600; }
.notice ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }
.notice--ok { background: #e3f8ec; color: #17683b; border: 1px solid #b5e8cb; }
.notice--error { background: #fdecef; color: #9b1c33; border: 1px solid #f6c2cc; }

/* forms */
.form label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.form label small { font-weight: 500; color: var(--muted); }
.form label > small { display: block; margin-top: 4px; }
.form input[type=text], .form input[type=password], .form input[type=datetime-local],
.form textarea, .form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus, .form select:focus, .field-title input:focus {
  outline: 2px solid rgba(52,56,119,0.25);
  border-color: var(--navy);
}
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); margin: 12px 0 0; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--navy); }
.btn--primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-dark); }
.btn--block { width: 100%; }
.btn--small { padding: 6px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.linklike {
  background: none; border: 0; padding: 4px; font: inherit; cursor: pointer; color: var(--navy);
}
.danger { color: var(--red); }

/* tabs */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a {
  padding: 7px 14px; border-radius: 999px; text-decoration: none; font-weight: 600;
  background: #fff; border: 1px solid var(--line);
}
.tabs a.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* table */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafbfe; }
.table tr:last-child td { border-bottom: 0; }
.table__post { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.table__post > span:last-child { display: flex; flex-direction: column; }
.table__title { font-weight: 700; text-decoration: none; color: var(--navy); }
.table__title:hover { color: var(--red); }
.thumb { flex: none; width: 64px; height: 44px; border-radius: 6px; overflow: hidden; background: #e8eaf4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.table__actions { white-space: nowrap; text-align: right; }
.table__actions > * { display: inline-block; vertical-align: middle; margin-left: 6px; }
.table__actions a, .table__actions .linklike, .table__actions summary { font-size: 17px; padding: 4px 6px; }
.table__actions form { margin: 0; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill--published { background: #e3f8ec; color: #17683b; }
.pill--draft { background: #eceef6; color: var(--muted); }
.pill--scheduled { background: #fff6d6; color: #8a6a00; }

.reset { position: relative; }
.reset summary { list-style: none; cursor: pointer; color: var(--navy); }
.reset summary::-webkit-details-marker { display: none; }
.reset__form {
  position: absolute; right: 0; top: 100%; z-index: 5; display: flex; gap: 6px;
  background: #fff; padding: 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.reset__form input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; width: 170px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.field-title input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--line);
  padding: 6px 0 12px;
  margin-bottom: 16px;
  font: inherit;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  outline: none;
}
#editor { min-height: 420px; font-family: inherit; font-size: 16px; }
.ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; border-color: var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.ql-container.ql-snow { border-radius: 0 0 6px 6px; border-color: var(--line); font-family: inherit; }
.ql-editor { min-height: 420px; line-height: 1.7; }
.ql-editor img { max-width: 100%; height: auto; }
.editor__hint { margin-top: 10px; }

.cover-preview {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: #eceef6;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview span { display: none; color: var(--muted); font-weight: 600; }
.cover-preview.is-empty span { display: block; }
.file-btn { position: relative; overflow: hidden; margin: 0 !important; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

@media (max-width: 960px) {
  .editor, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page { padding: 20px 16px 50px; }
  .topbar { padding: 10px 16px; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 4px 0; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 13px; }
  .table__actions { text-align: left; }
  .table__actions > * { margin: 0 8px 0 0; }
}
