/* Jajeer Times Desk */
:root {
  --brand: #bd2e32; --brand-dark: #9a2328; --brand-tint: #fbefef;
  --ink: #141414; --ink-2: #3a3a3a; --muted: #6b6b6b; --faint: #9a9a9a;
  --rule: #e4e2de; --rule-2: #d3d0ca; --bg: #f6f5f2; --panel: #ffffff;
  --side: #151515; --side-2: #222; --side-ink: #d9d9d9;
  --ok: #1f7a4d; --ok-bg: #e8f5ee; --warn: #9a6400; --warn-bg: #fff4dc; --bad: #a3262a; --bad-bg: #fbeaea; --info: #2556a3; --info-bg: #e9f0fb;
  --serif: "Source Serif 4", Georgia, serif; --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif; --display: "Cinzel", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--sans); font-size: 14px; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-brand { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand .mark { width: 64px; height: auto; }
.auth-brand h1 { font-family: var(--display); font-weight: 700; font-size: 44px; letter-spacing: .06em; margin: 26px 0 8px; line-height: 1.05; }
.auth-brand p { font-family: var(--serif); font-size: 18px; opacity: .9; margin: 0; max-width: 380px; line-height: 1.5; }
.auth-brand small { font-size: 12px; opacity: .75; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-col { width: 100%; max-width: 420px; }
.auth-card { background: var(--panel); border: 1px solid var(--rule); padding: 30px; }
.auth-card + .auth-card { margin-top: 18px; }
.auth-card h2 { font-family: var(--serif); font-size: 26px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); margin: 0 0 20px; line-height: 1.5; }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-foot button { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; }
.success-block { text-align: center; padding: 12px 0; }
.success-block .tick { width: 54px; height: 54px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; }
.pw-rules { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.pw-rules li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rule-2); margin-right: 7px; }
.pw-rules li.ok { color: var(--ok); }
.pw-rules li.ok::before { background: var(--ok); }
.meter { height: 4px; background: var(--rule); margin: -6px 0 12px; }
.meter span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }

/* ---------- Forms ---------- */
.f { display: block; margin-bottom: 14px; }
.f > span { display: block; font-weight: 600; font-size: 12px; margin-bottom: 6px; color: var(--ink-2); }
.f > span em { font-style: normal; font-weight: 400; color: var(--faint); }
.input, .f input[type=text], .f input[type=email], .f input[type=password], .f input[type=url], .f input[type=number], .f input[type=date], .f input[type=datetime-local], .f select, .f textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--rule-2); background: #fff; border-radius: 0; font-size: 14px;
}
.f textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.f input:focus, .f select:focus, .f textarea:focus, .input:focus { outline: none; border-color: var(--ink); }
.f .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.f input[type=color] { width: 100%; height: 38px; padding: 2px; border: 1px solid var(--rule-2); background: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; cursor: pointer; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.45; }
.note { background: var(--info-bg); color: var(--info); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.45; }
.warnbox { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; line-height: 1.45; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 700; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; padding: 10px 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #000; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.brand { background: var(--brand); border-color: var(--brand); }
.btn.brand:hover { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--rule-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e7b9bb; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { padding: 6px 10px; font-size: 11px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; color: var(--brand-dark); cursor: pointer; padding: 0; text-decoration: underline; font-size: inherit; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid #2a2a2a; text-decoration: none; }
.side-brand .sq { width: 32px; height: 32px; background: var(--brand); display: grid; place-items: center; flex: none; }
.side-brand .sq img { width: 18px; }
.side-brand b { font-family: var(--display); color: #fff; font-size: 17px; letter-spacing: .05em; display: block; line-height: 1.1; }
.side-brand small { color: #8f8f8f; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.side nav { padding: 12px 10px; flex: 1; }
.side h6 { margin: 16px 10px 6px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: #777; font-weight: 700; }
.side nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; text-decoration: none; color: var(--side-ink); font-weight: 500; border-left: 2px solid transparent; }
.side nav a:hover { background: var(--side-2); color: #fff; }
.side nav a.on { background: var(--side-2); color: #fff; border-left-color: var(--brand); }
.side nav a .pill { background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.side-user { border-top: 1px solid #2a2a2a; padding: 14px 18px; font-size: 12px; }
.side-user b { color: #fff; display: block; font-size: 13px; }
.side-user .role { color: #9a9a9a; }
.side-user .acts { margin-top: 10px; display: flex; gap: 12px; }
.side-user .acts a, .side-user .acts button { color: #bdbdbd; background: none; border: 0; padding: 0; cursor: pointer; font-size: 12px; text-decoration: underline; }
.topbar { display: none; }
.main { min-width: 0; }
.page { padding: 28px 34px 60px; max-width: 1280px; }
.ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font-family: var(--serif); font-size: 30px; margin: 0; line-height: 1.1; }
.ph p { margin: 6px 0 0; color: var(--muted); }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--panel); border: 1px solid var(--rule); }
.card + .card { margin-top: 18px; }
.card-h { padding: 14px 18px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-h h2, .card-h h3 { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; }
.card-b { padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--rule); padding: 16px 18px; text-decoration: none; display: block; }
.stat:hover { border-color: var(--ink-2); }
.stat b { font-family: var(--serif); font-size: 30px; display: block; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--rule); font-weight: 700; background: #fbfaf8; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #fbfaf8; }
.tbl .t { font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.3; }
.tbl .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .btn { margin-left: 4px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; background: #eee; color: #555; white-space: nowrap; }
.badge.published, .badge.approved, .badge.active { background: var(--ok-bg); color: var(--ok); }
.badge.submitted, .badge.pending { background: var(--warn-bg); color: var(--warn); }
.badge.rejected, .badge.disabled { background: var(--bad-bg); color: var(--bad); }
.badge.draft { background: #efefef; color: #555; }
.badge.scheduled, .badge.invited { background: var(--info-bg); color: var(--info); }
.badge.admin { background: var(--ink); color: #fff; }
.badge.editor { background: var(--brand-tint); color: var(--brand-dark); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs a .c { color: var(--faint); font-weight: 500; margin-left: 4px; }
.toolbar-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-row .input { max-width: 320px; }

/* ---------- Editor layout ---------- */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.ed-main .headline { width: 100%; border: 0; border-bottom: 1px solid var(--rule-2); background: transparent; font-family: var(--serif); font-weight: 700; font-size: 32px; line-height: 1.15; padding: 6px 0 10px; resize: none; overflow: hidden; }
.ed-main .headline:focus { outline: none; border-bottom-color: var(--ink); }
.ed-main .dek { width: 100%; border: 0; border-bottom: 1px solid var(--rule); background: transparent; font-family: var(--serif); font-size: 18px; color: var(--ink-2); padding: 10px 0; resize: none; line-height: 1.45; margin-bottom: 18px; }
.ed-main .dek:focus { outline: none; border-bottom-color: var(--ink); }
.ed-side .card-b { padding: 16px; }
.ed-side .card + .card { margin-top: 14px; }
.ed-side .actions { display: grid; gap: 8px; }
.statusline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.imgbox { border: 1px dashed var(--rule-2); background: #fbfaf8; aspect-ratio: 16/9; display: grid; place-items: center; overflow: hidden; position: relative; cursor: pointer; margin-bottom: 10px; }
.imgbox img { width: 100%; height: 100%; object-fit: cover; }
.imgbox span { color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
.imgbox .rm { position: absolute; top: 6px; right: 6px; }

/* rich text */
.rte { border: 1px solid var(--rule-2); background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--rule); background: #fbfaf8; position: sticky; top: 0; z-index: 2; }
.rte-bar button { background: none; border: 1px solid transparent; padding: 5px 8px; min-width: 30px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.rte-bar button:hover { border-color: var(--rule-2); background: #fff; }
.rte-bar button.on { background: var(--ink); color: #fff; }
.rte-bar .sep { width: 1px; background: var(--rule-2); margin: 3px 4px; }
.rte-area { min-height: 380px; padding: 18px 22px; font-family: var(--serif); font-size: 18px; line-height: 1.65; outline: none; }
.rte-area p { margin: 0 0 1em; }
.rte-area h2 { font-size: 24px; margin: 1.2em 0 .5em; }
.rte-area h3 { font-size: 20px; margin: 1.2em 0 .5em; }
.rte-area blockquote { margin: 1em 0; padding-left: 18px; border-left: 3px solid var(--brand); font-style: italic; }
.rte-area a { color: var(--brand-dark); }
.rte-area img { max-width: 100%; height: auto; }
.rte-area table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 14px; }
.rte-area th, .rte-area td { border: 1px solid var(--rule); padding: 6px 8px; text-align: left; }
.rte-area .callout, .rte-area .placeholder-block { background: #f5f3ef; padding: 12px 14px; border-left: 3px solid var(--brand); margin: 1em 0; }
.rte-area:empty::before { content: attr(data-ph); color: var(--faint); }
.rte-src { width: 100%; min-height: 380px; border: 0; padding: 16px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; resize: vertical; outline: none; }

/* preview */
.preview { font-family: var(--serif); max-width: 700px; margin: 0 auto; }
.preview .k { font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.preview h1 { font-size: 36px; line-height: 1.1; margin: 6px 0 10px; }
.preview .dk { font-size: 19px; color: var(--ink-2); margin: 0 0 16px; }
.preview .bd { font-size: 18px; line-height: 1.7; }
.preview img.hero { width: 100%; margin-bottom: 18px; }

/* ads */
.adprev { display: flex; flex-direction: column; gap: 22px; }
.adprev h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.adprev .row { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.scale-box { overflow: hidden; }
.scale-box > a { transform-origin: 0 0; pointer-events: none; }
.adthumb { width: 150px; height: 125px; overflow: hidden; border: 1px solid var(--rule); }
.adthumb > a { transform: scale(.5); transform-origin: 0 0; pointer-events: none; }

/* modal */
.m-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.m-box { background: #fff; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.m-box.wide { max-width: 860px; }
.m-h { padding: 16px 20px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.m-h h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.m-h button { background: none; border: 0; font-size: 22px; cursor: pointer; line-height: 1; color: var(--muted); }
.m-b { padding: 18px 20px; line-height: 1.55; }
.m-f { padding: 14px 20px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: 8px; }

.d-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; font-size: 13px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 60; }
.d-toast.on { opacity: 1; transform: translateX(-50%); }
.d-toast.bad { background: var(--bad); }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.muted { color: var(--muted); }
.mt { margin-top: 18px; }
.right { text-align: right; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 10px; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain a { text-decoration: none; font-weight: 600; }
.list-plain a:hover { color: var(--brand-dark); }
code.sc { background: #f1efeb; padding: 1px 5px; font-size: 12px; }

@media (max-width: 1100px) {
  .ed { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; }
  .auth-brand h1 { font-size: 30px; margin-top: 14px; }
  .auth-brand .foot { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }
  .topbar b { font-family: var(--display); letter-spacing: .05em; }
  .page { padding: 20px 16px 50px; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .tbl .hide-sm { display: none; }
  .pw-rules { grid-template-columns: 1fr; }
}

/* Bylines, submissions, visitors */
.byl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.byl { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-2); padding: 11px 12px; cursor: pointer; background: #fff; font-size: 14px; }
.byl:hover { border-color: var(--ink); }
.byl input { accent-color: var(--brand); }
.byl:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.byl.off { opacity: .45; cursor: not-allowed; }
.byl em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.static { padding: 9px 10px; background: var(--panel-2, #f4f2ee); border: 1px solid var(--rule); font-size: 14px; }
.subtext { white-space: normal; line-height: 1.6; font-size: 14px; max-height: 340px; overflow: auto; border-left: 3px solid var(--brand); padding: 4px 0 4px 14px; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .bt { background: #eee; height: 10px; display: block; }
.bar .bt i { display: block; height: 100%; background: var(--brand); }
.bar b { text-align: right; font-weight: 600; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.spark div { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.spark i { display: block; width: 100%; background: var(--brand); min-height: 3px; }
.spark-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
@media (max-width: 520px) { .byl-grid { grid-template-columns: minmax(0, 1fr); } }
.byl { padding: 11px 10px; font-size: 13px; }
.byl span { white-space: nowrap; }
.grid2.eq { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; margin-bottom: 18px; }
.grid2.eq .card + .card { margin-top: 0; }
.page > .card { margin-bottom: 18px; }
@media (max-width: 900px) { .grid2.eq { grid-template-columns: minmax(0, 1fr); } }
.spark div { max-width: 56px; }
