/* County Courier — admin stylesheet */
:root {
  --ink: #1a1a1a;
  --side: #0f2d4a;
  --side-text: #b9cede;
  --paper: #f0f4f8;
  --card: #ffffff;
  --line: #dbe3ea;
  --accent: #006cb7; /* theneighborhoodnews.com blue */
  --accent-soft: #e5f1fa;
  --danger: #b3261e;
  --danger-soft: #f9e9e8;
  --ok: #2e6b3f;
  --ok-soft: #e6f1e9;
  --warn: #9a6a12;
  --warn-soft: #f8f0dd;
  --muted: #5f6b76;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); font-size: 14.5px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.admin-shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.side { background: var(--side); color: var(--side-text); padding: 22px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 0 22px 18px; border-bottom: 1px solid #24466b; margin-bottom: 14px; }
.side .brand .nameplate { font-family: var(--serif); font-weight: 700; font-size: 19px; color: #ffffff; line-height: 1.2; }
.side .brand .sub { font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: #7db9e3; font-weight: 700; margin-top: 3px; }
.side nav { display: flex; flex-direction: column; }
.side .nav-group { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #7f9ab5; padding: 16px 22px 6px; }
.side a.item { display: flex; gap: 10px; align-items: center; padding: 8px 22px; font-size: 13.5px; border-left: 3px solid transparent; }
.side a.item:hover { color: #fff; background: #16395e; }
.side a.item.active { color: #fff; border-left-color: #7db9e3; background: #16395e; }
.side .beta { font-size: 9px; font-weight: 700; letter-spacing: .1em; background: var(--warn); color: #fff; border-radius: 3px; padding: 1px 5px; }
.side .foot { margin-top: auto; padding: 18px 22px 0; font-size: 12px; color: #7f9ab5; }
.side .foot a { color: var(--side-text); text-decoration: underline; }

/* ---------- Main ---------- */
.main { padding: 26px 34px 60px; max-width: 1220px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title h1 { font-family: var(--serif); font-size: 27px; font-weight: 700; }
.page-title .hint { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- Flash ---------- */
.flash { padding: 11px 16px; border-radius: 6px; margin-bottom: 18px; font-weight: 600; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: #bdd8c4; }
.flash.err { background: var(--danger-soft); color: var(--danger); border-color: #e3c0c1; }

/* ---------- Cards, tables ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin-bottom: 20px; }
.card h2 { font-family: var(--serif); font-size: 18px; margin-bottom: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.stat .n { font-family: var(--serif); font-size: 32px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.stat.pub .n { color: var(--ok); } .stat.draft .n { color: var(--warn); } .stat.dec .n { color: var(--accent); }

table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.grid td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:hover td { background: #f5f9fc; }

/* status pills */
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 9px; border-radius: 20px; text-transform: uppercase; }
.pill.published, .pill.parsed { background: var(--ok-soft); color: var(--ok); }
.pill.draft, .pill.uploaded, .pill.review, .pill.parsing { background: var(--warn-soft); color: var(--warn); }
.pill.declined, .pill.failed { background: var(--danger-soft); color: var(--danger); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-block; font-family: var(--sans); font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; }
.btn:hover { background: #000; }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { background: #00518a; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--paper); }
.btn.small { font-size: 12px; padding: 5px 11px; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

label.f { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 5px; }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font-family: var(--sans); font-size: 14.5px; padding: 9px 12px;
  border: 1px solid #c3cdd6; border-radius: 6px; background: #ffffff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc8e8; border-color: var(--accent); }
textarea.body { min-height: 220px; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 22px; }
.inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed #9cb4c9; border-radius: 10px; background: #f7fafc;
  padding: 44px 20px; text-align: center; cursor: pointer; transition: all .15s ease;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .big { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.dropzone .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.dropzone .picked { margin-top: 10px; font-weight: 700; color: var(--ok); }
.dropzone input[type=file] { display: none; }
.parse-note { display: none; margin-top: 14px; color: var(--warn); font-weight: 600; }

/* ---------- Review cards ---------- */
.review-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.review-card.declined { border-left-color: var(--danger); }
.review-card .meta-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.review-card .confidence { font-weight: 700; }
.review-card textarea { min-height: 140px; }
.review-card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- Editor ---------- */
.editor-toolbar { display: flex; gap: 4px; border: 1px solid #c3cdd6; border-bottom: 0; border-radius: 6px 6px 0 0; background: #eef3f7; padding: 6px; }
.editor-toolbar button { font-family: var(--sans); font-size: 13px; min-width: 32px; padding: 5px 9px; border: 1px solid transparent; background: transparent; border-radius: 4px; cursor: pointer; font-weight: 700; color: var(--ink); }
.editor-toolbar button:hover { background: #fff; border-color: #cfc8b6; }
.editor-surface {
  min-height: 320px; border: 1px solid #c3cdd6; border-radius: 0 0 6px 6px;
  background: #ffffff; padding: 16px 18px; font-family: var(--serif); font-size: 16px; line-height: 1.7;
}
.editor-surface:focus { outline: 2px solid #9cc8e8; }
.editor-surface p { margin-bottom: .9em; }
.editor-surface img { max-width: 100%; }

/* ---------- Media grid ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.media-item { background: var(--card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.media-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-item .m-meta { padding: 8px 10px; font-size: 11.5px; color: var(--muted); word-break: break-all; }

/* ---------- Settings flags ---------- */
.flag-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.flag-row:last-child { border-bottom: 0; }
.flag-row .t { font-weight: 700; }
.flag-row .d { color: var(--muted); font-size: 13px; }
.toggle { position: relative; width: 44px; height: 24px; background: #cfc8b6; border-radius: 20px; opacity: .55; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.soon { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 2px 7px; }

.help-text { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.thumb-s { width: 46px; height: 46px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .main { padding: 20px 16px 40px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ---- Quill editor + advertiser picker (2026-07-12 round 2) -------------- */
[data-editor] .ql-toolbar.ql-snow { border-radius: 6px 6px 0 0; background: #eef3f7; border-color: #c3cdd6; }
[data-editor] .ql-container.ql-snow { border-radius: 0 0 6px 6px; border-color: #c3cdd6; background: #fff; }
[data-editor] .ql-editor { min-height: 170px; font-family: var(--serif, Georgia, serif); font-size: 15.5px; line-height: 1.6; }
[data-editor] .ql-editor h2 { font-size: 1.25em; }
[data-editor] .ql-editor h3 { font-size: 1.1em; }
.review-card [data-editor] .ql-editor { min-height: 120px; max-height: 340px; overflow-y: auto; }
.adv-status { font-size: 12px; color: var(--muted, #6c7a87); margin-top: 5px; }
.adv-status.ok { color: #1e7d38; font-weight: 700; }
.bulk-bar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; position: sticky; top: 8px; z-index: 30; box-shadow: 0 2px 8px rgba(0,40,80,.08); }
.bulk-bar .bulk-actions { margin-left: auto; display: flex; gap: 8px; }
.bulk-all-label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.bulk-pick { display: flex; align-items: center; gap: 5px; font-weight: 700; cursor: pointer; color: var(--ink, #1e2933); }
.tab-nav { display: flex; gap: 4px; border-bottom: 2px solid #c3cdd6; margin-bottom: 18px; }
.tab-btn { font-family: var(--sans, sans-serif); font-size: 14px; font-weight: 700; padding: 9px 18px; border: 0; background: transparent; color: var(--muted, #5c6a76); cursor: pointer; border-radius: 6px 6px 0 0; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn:hover { background: #eef3f7; color: var(--ink, #1e2933); }
.tab-btn.active { color: #006cb7; border-bottom-color: #006cb7; background: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.prov-radio { display:flex; align-items:center; gap:8px; padding:9px 11px; border:1px solid #d9dee3; border-radius:7px; cursor:pointer; font-size:13px; }
.prov-radio input { margin:0; }
.prov-radio:has(input:checked) { border-color:#006cb7; background:#f0f7fc; box-shadow:0 0 0 1px #006cb7 inset; }
