/* ════════════════════════════════════════════════════════════
   ABACUS CMS — design system
   brand: primary #00529e · secondary #8abb2a · white background
   ════════════════════════════════════════════════════════════ */
:root {
  --blue: #00529e;
  --blue-dark: #003c74;
  --blue-darker: #002c56;
  --blue-soft: #e8f1f9;
  --green: #8abb2a;
  --green-dark: #6f9a1e;
  --green-soft: #f1f7e4;
  --ink: #14212e;
  --muted: #5b6b7b;
  --line: #e3e9ef;
  --bg: #ffffff;
  --surface: #f6f8fa;
  --red: #cc3344;
  --red-soft: #fbeaec;
  --amber: #b97b0a;
  --amber-soft: #fdf3e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,33,46,.05), 0 6px 22px -8px rgba(0,82,158,.12);
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.01em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--surface); padding: 1px 5px; border-radius: 5px; }

/* ── app shell ─────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: 0 0 232px; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; display: flex; flex-direction: column; padding: 18px 14px;
}
.side__brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; padding: 4px 8px 18px; }
.side__brand b { font-weight: 800; }
.side__brand:hover { text-decoration: none; }
.side__logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--green); color: var(--blue-darker);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.side__nav { display: flex; flex-direction: column; gap: 2px; }
.side__link {
  display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.82);
  padding: 9px 10px; border-radius: 9px; font-weight: 600; font-size: 14px;
}
.side__link:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.side__link.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side__user {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: rgba(0,0,0,.18); border-radius: 10px;
}
.side__avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: var(--blue-darker);
  display: flex; align-items: center; justify-content: center; font-weight: 800; flex: 0 0 32px;
}
.side__who { line-height: 1.25; min-width: 0; }
.side__who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side__who span { font-size: 11.5px; opacity: .7; text-transform: capitalize; }
.side__user form { margin-left: auto; }
.iconbtn {
  background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; padding: 6px; border-radius: 7px;
  display: inline-flex;
}
.iconbtn:hover { background: rgba(255,255,255,.12); color: #fff; }

.main { flex: 1; min-width: 0; padding: 28px 34px 60px; background: var(--bg); }

/* ── page header ───────────────────────────────────────── */
.phead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.phead h1 { font-size: 24px; font-weight: 800; }
.phead .sub { color: var(--muted); margin-top: 3px; }
.phead__actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 14px var(--font); padding: 9px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: var(--green-dark); }
.btn--ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn--danger { background: #fff; color: var(--red); border-color: #eec7cc; }
.btn--danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn--sm { padding: 5px 11px; font-size: 13px; border-radius: 7px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ── cards / stats ─────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__body { padding: 20px; }
.card__head { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card__head h2 { font-size: 15.5px; font-weight: 700; }
.card__head .spacer { margin-left: auto; }
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { font-size: 26px; font-weight: 800; color: var(--blue); display: block; line-height: 1.1; }
.stat b em { font-style: normal; color: var(--green); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .grid2 { grid-template-columns: 1fr; } }

/* ── tables ────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.tbl th {
  text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafcfe; }
.tbl .t-title { font-weight: 700; color: var(--ink); }
.tbl .t-title a { color: var(--ink); }
.tbl .t-title a:hover { color: var(--blue); }
.tbl .t-sub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.tbl .t-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── badges ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.badge--green { background: var(--green-soft); color: var(--green-dark); }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--gray { background: var(--surface); color: var(--muted); }
.badge--red { background: var(--red-soft); color: var(--red); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ── forms ─────────────────────────────────────────────── */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: var(--ink);
}
.field small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 4px; }
.field .req { color: var(--red); }
input[type=text], input[type=search], input[type=password], input[type=date], input[type=url],
input:not([type]), select, textarea {
  width: 100%; font: 500 14px var(--font); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,82,158,.12);
}
textarea { resize: vertical; min-height: 80px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.frow3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
@media (max-width: 900px) { .frow, .frow3 { grid-template-columns: 1fr; } }
.charcount { float: right; font-weight: 600; color: var(--muted); font-size: 11.5px; }
.charcount.over { color: var(--red); }
.charcount.good { color: var(--green-dark); }

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 38px; height: 22px; background: #cdd7e0; border-radius: 999px; transition: .18s; flex: 0 0 38px;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ── alerts / toast ────────────────────────────────────── */
.alert { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; font-weight: 600; font-size: 13.5px; }
.alert--err { background: var(--red-soft); color: var(--red); border: 1px solid #f2d2d7; }
.alert--ok { background: var(--green-soft); color: var(--green-dark); border: 1px solid #dcebbd; }
.alert--info { background: var(--blue-soft); color: var(--blue); border: 1px solid #cfe1f2; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--blue-darker); color: #fff; font-weight: 600; padding: 11px 20px; border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 90; max-width: 90vw;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green-dark); }

/* ── login ─────────────────────────────────────────────── */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(138,187,42,.16), transparent 60%),
    radial-gradient(1100px 700px at -10% 110%, rgba(0,82,158,.14), transparent 60%),
    #fff;
  padding: 20px;
}
.login-card {
  width: 380px; max-width: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 20px 60px -20px rgba(0,44,86,.25); padding: 30px;
}
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 22px; color: var(--blue-darker); }
.login-brand b { font-weight: 800; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-sub { color: var(--muted); margin-bottom: 18px; }

/* ── blog editor ───────────────────────────────────────── */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1200px) { .editor-grid { grid-template-columns: 1fr; } }
.editor-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.ck-editor__editable { min-height: 480px; }
.ck.ck-editor__editable_inline { border-radius: 0 0 9px 9px !important; }
.ck-content h2 { font-size: 1.4em; margin: 1em 0 .5em; }
.ck-content h3 { font-size: 1.15em; margin: 1em 0 .4em; }
/* Make the editor show tables and images the way blog.css renders them on
   the site — first row brand-blue, bold, white — so an editor never needs
   to color the header row by hand and what they see matches what ships. */
.ck-content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ck-content th, .ck-content td { padding: 10px 14px; text-align: left; border: 1px solid #dfe5ec; vertical-align: top; }
/* First row blue whether it holds th OR td: on save the sanitiser promotes
   row one to <th> regardless, so this is what will ship either way. */
.ck-content thead th, .ck-content thead td,
.ck-content table tr:first-child th,
.ck-content table:not(:has(thead)) tr:first-child td { background: #00529e; color: #fff; font-weight: 700; }
.ck-content table tr:first-child th *,
.ck-content table:not(:has(thead)) tr:first-child td * { color: #fff; }
.ck-content tbody tr:nth-child(even) td { background: #f6f8fb; }
.ck-content img { max-width: 100%; height: auto; border-radius: 10px; }
.ck-content figure.image { margin: 1em 0; }
.htmlmode { display: none; }
.htmlmode textarea { min-height: 480px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.5; }
.editing-html .htmlmode { display: block; }
.editing-html .richmode { display: none; }

/* SERP preview */
.serp {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff;
  font-family: arial, sans-serif;
}
.serp__site { display: flex; align-items: center; gap: 8px; }
.serp__fav {
  width: 26px; height: 26px; border-radius: 50%; background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; font-family: var(--font);
}
.serp__name { font-size: 13px; color: #202124; line-height: 1.2; }
.serp__url { font-size: 12px; color: #4d5156; word-break: break-all; }
.serp__title { color: #1a0dab; font-size: 19px; line-height: 1.3; margin: 6px 0 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.serp__desc { color: #4d5156; font-size: 13.5px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

/* OG preview */
.ogprev { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.ogprev__img { aspect-ratio: 1.91 / 1; background: var(--surface) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.ogprev__body { padding: 10px 12px; border-top: 1px solid var(--line); }
.ogprev__domain { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.ogprev__title { font-weight: 700; font-size: 14px; margin: 2px 0; }
.ogprev__desc { font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* featured image picker */
.imgpick { border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.imgpick img { max-width: 100%; border-radius: 7px; display: block; margin: 0 auto 8px; }
.imgpick .imgpick__empty { color: var(--muted); padding: 26px 8px; font-size: 13px; }

/* ── media library ─────────────────────────────────────── */
.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; }
.media-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; transition: .14s; }
.media-item:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.media-item.selected { border-color: var(--green); box-shadow: 0 0 0 3px rgba(138,187,42,.25); }
.media-item__thumb { aspect-ratio: 4/3; background: var(--surface) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.media-item__meta { padding: 7px 9px; font-size: 11.5px; }
.media-item__meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.media-item__meta span { color: var(--muted); }

/* media picker modal */
.modal-back { position: fixed; inset: 0; background: rgba(10,25,40,.5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 30px; }
.modal { background: #fff; border-radius: 14px; width: 980px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal__head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.modal__head h3 { font-size: 15px; }
.modal__body { padding: 16px 18px; overflow: auto; }
.modal__foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; }

/* ── nav manager ───────────────────────────────────────── */
.navlist { list-style: none; }
.navlist li {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px; background: #fff;
}
.navlist li.hidden-item { opacity: .55; background: var(--surface); }
.navlist .nl-move { display: flex; flex-direction: column; gap: 2px; }
.navlist .nl-move button { border: 0; background: var(--surface); border-radius: 5px; cursor: pointer; padding: 1px 6px; color: var(--muted); line-height: 1.2; }
.navlist .nl-move button:hover { background: var(--blue-soft); color: var(--blue); }
.navlist b { font-size: 13.5px; }
.navlist .nl-desc { color: var(--muted); font-size: 12px; }
.navlist .nl-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

/* ── build console ─────────────────────────────────────── */
.console {
  background: var(--blue-darker); color: #cfe3f5; border-radius: 10px; padding: 14px 16px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.6;
  max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.console .ok { color: #a5d46a; }
.console .err { color: #ff9d9d; }

/* ── misc ──────────────────────────────────────────────── */
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; padding: 16px 0 4px; flex-wrap: wrap; }
.pager a, .pager span.cur {
  min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--line); font-weight: 600; font-size: 13px; padding: 0 8px;
}
.pager span.cur { background: var(--blue); color: #fff; border-color: var(--blue); }
.pager a:hover { border-color: var(--blue); text-decoration: none; }
.pager .gap { color: var(--muted); }
.filters { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 15px; }
.filters input[type=search] { width: 300px; max-width: 100%; }
.filters select, .filters input[type=date] { width: auto; }
.empty { text-align: center; color: var(--muted); padding: 46px 20px; }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
  padding: 9px 15px; font-weight: 700; font-size: 13.5px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tabs a:hover { color: var(--blue); text-decoration: none; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--green); }
.help { color: var(--muted); font-size: 12.5px; }
.kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
details.adv { border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; }
details.adv > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; font-size: 13.5px; }
details.adv > div { padding: 4px 14px 14px; }
.jsonarea { font-family: ui-monospace, Menlo, monospace !important; font-size: 12.5px !important; min-height: 320px; }

/* ── blog list: view toggle + thumbnails + grid ─────────── */
.segtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.segtoggle a, .segtoggle button {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; font: 700 13px var(--font);
  color: var(--muted); background: none; border: 0; cursor: pointer; text-decoration: none;
}
.segtoggle a:hover, .segtoggle button:hover { color: var(--blue); text-decoration: none; }
.segtoggle .active { background: var(--blue); color: #fff; }
.t-thumbcell { width: 62px; padding-right: 0 !important; }
.row-thumb {
  width: 54px; height: 40px; border-radius: 7px; background: var(--surface) center/cover no-repeat;
  border: 1px solid var(--line);
}
.row-thumb--empty, .card-thumb--empty { display: flex; align-items: center; justify-content: center; color: #b8c4cf; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.post-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: .15s;
}
.post-card:hover { border-color: var(--blue); }
.post-card__media { display: block; }
.card-thumb { aspect-ratio: 16/9; background: var(--surface) center/cover no-repeat; }
.post-card__body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.post-card__title {
  font-weight: 700; font-size: 14px; line-height: 1.35; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__title:hover { color: var(--blue); text-decoration: none; }
.post-card__sub { color: var(--muted); font-size: 12px; word-break: break-all; }
.post-card__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.linklike { border: 0; background: none; color: var(--blue); font: 600 12px var(--font); cursor: pointer; padding: 0 0 0 6px; }
.linklike:hover { text-decoration: underline; }

/* ── page content form builder ──────────────────────────── */
.fb-field { margin-bottom: 13px; }
.fb-label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.fb-group {
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; background: #fff;
}
.fb-group > summary {
  cursor: pointer; padding: 10px 14px; font-weight: 700; font-size: 13.5px; list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.fb-group > summary::before { content: '▸'; color: var(--muted); transition: .15s; }
.fb-group[open] > summary::before { transform: rotate(90deg); }
.fb-group > summary .fb-count { color: var(--muted); font-weight: 600; font-size: 12px; }
.fb-group > .fb-groupbody { padding: 4px 14px 12px; }
.fb-item {
  border: 1px solid var(--line); border-left: 3px solid var(--blue-soft); border-radius: 9px;
  padding: 11px 12px 4px; margin-bottom: 10px; background: #fcfdfe; position: relative;
}
.fb-item__bar { display: flex; align-items: center; gap: 5px; margin-bottom: 8px; }
.fb-item__bar b { font-size: 12px; color: var(--muted); font-weight: 700; margin-right: auto; }
.fb-item__bar button {
  border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer;
  padding: 2px 8px; font-size: 12px; color: var(--muted);
}
.fb-item__bar button:hover { color: var(--blue); border-color: var(--blue); }
.fb-item__bar button.fb-del:hover { color: var(--red); border-color: var(--red); }
.fb-add {
  border: 1.5px dashed var(--line); background: none; border-radius: 9px; width: 100%;
  padding: 9px; font: 700 13px var(--font); color: var(--blue); cursor: pointer; margin-bottom: 10px;
}
.fb-add:hover { border-color: var(--blue); background: var(--blue-soft); }
.fb-imgrow { display: flex; gap: 8px; align-items: center; }
.fb-imgrow input { flex: 1; }
.fb-imgthumb {
  width: 46px; height: 36px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface) center/cover no-repeat; flex: 0 0 46px;
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
  .side__nav { flex-direction: row; flex-wrap: wrap; }
  .side__foot { margin: 0 0 0 auto; }
  .main { padding: 18px 16px 50px; }
  .editor-side { position: static; }
}

/* ══════════════════════════════════════════════════════════
   RECRUITMENT — jobs board + applications inbox
   ══════════════════════════════════════════════════════════ */
.statgrid--tight { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 0; }
.statgrid--tight .stat { padding: 10px 12px; }
.statgrid--tight .stat b { font-size: 20px; }
.grid2--wide { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid2--wide { grid-template-columns: 1fr; } }

/* share links on the job editor */
.sharelist { display: flex; flex-direction: column; gap: 7px; }
.sharerow { display: flex; align-items: center; gap: 8px; }
.sharerow__name { flex: 0 0 130px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sharerow input {
  flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; background: var(--surface); color: var(--muted);
}

/* source chips + rollup bars */
.chan { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.srcrow {
  display: grid; grid-template-columns: 128px 1fr 34px; align-items: center; gap: 10px;
  padding: 6px 0; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line);
}
.srcrow:last-child { border-bottom: 0; }
.srcrow:hover { text-decoration: none; }
.srcrow:hover span:first-child { color: var(--blue); }
.srcrow b { text-align: right; font-variant-numeric: tabular-nums; }
.srcrow__bar { display: block; height: 7px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.srcrow__bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.pipe { display: grid; grid-template-columns: 104px 1fr 30px; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; }
.pipe b { text-align: right; font-variant-numeric: tabular-nums; }
.pipe__bar { display: block; height: 7px; background: var(--surface); border-radius: 4px; overflow: hidden; }
.pipe__i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.pipe__i--green { background: var(--green-dark); }
.pipe__i--red { background: var(--red); }
.pipe__i--gray { background: #98a6b4; }

/* bulk action bar over the applications table */
.bulkbar {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: var(--blue-soft); border: 1px solid rgba(0,82,158,.18);
  border-radius: 10px; padding: 9px 13px; margin-bottom: 13px;
}
.bulkbar[hidden] { display: none; }        /* the attribute must win over display:flex */
.bulkbar select { width: auto; }

/* application detail */
.facts { display: block; }
.factrow { display: flex; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.factrow:last-child { border-bottom: 0; }
.factrow dt { flex: 0 0 128px; color: var(--muted); }
.factrow dd { flex: 1; min-width: 0; word-break: break-word; font-weight: 600; }
.notebox { margin-top: 14px; background: var(--surface); border-radius: 9px; padding: 12px 14px; }
.notebox b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.notebox p { font-size: 13.5px; line-height: 1.6; }
.cvbox {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.cvframe { width: 100%; height: 520px; margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.rawtrail { margin-top: 10px; }
.rawtrail summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.rawtrail pre {
  margin-top: 8px; background: var(--surface); border-radius: 8px; padding: 10px;
  font-size: 11.5px; line-height: 1.5; overflow: auto; max-height: 260px; color: var(--muted);
}
.timeline { list-style: none; margin-top: 16px; border-left: 2px solid var(--line); padding-left: 14px; }
.timeline li { position: relative; padding: 0 0 14px 4px; }
.timeline li::before {
  content: ''; position: absolute; left: -20px; top: 5px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--line); border: 2px solid #fff;
}
.timeline li.is-note::before { background: var(--green); }
.timeline__meta { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.timeline__text { font-size: 13.5px; margin-top: 2px; }
.rater { display: flex; gap: 3px; align-items: center; }
.rater button {
  background: none; border: 0; cursor: pointer; font-size: 20px; line-height: 1;
  color: var(--line); padding: 0 1px;
}
.rater button.on { color: #f0a825; }
.rater button.clear { font-size: 13px; color: var(--muted); margin-left: 6px; }
.mailq { border-top: 1px solid var(--line); padding-top: 14px; }
