@font-face { font-family: "Montserrat"; src: url(montserrat-var.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(plex-arabic-regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(plex-arabic-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --green: #006943; --green-d: #00563a; --beige: #F9F0E6; --beige-2: #F1E4D4; --ink: #2B2B2B; --muted: #6b665f;
  --yellow: #F2C230; --white: #fff; --line: #e4dccf; --bad: #B3261E; --bad-bg: #fbe9e7; --warn-bg: #fff4d6; --good-bg: #e3f1ea;
  --r: 10px; --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
[lang=ar], button.link[lang=ar] { font-family: "Plex Arabic", system-ui, Tahoma, sans-serif; }
[dir=rtl] { --font: "Plex Arabic", "Montserrat", system-ui, Tahoma, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--beige); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--green); }
h1 { font-size: clamp(22px, 4vw, 30px); margin: 0; line-height: 1.2; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* top bar */
.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--green); color: var(--white); position: sticky; top: 0; z-index: 5; }
.top a { color: var(--white); text-decoration: none; }
.brand { font-weight: 500; font-size: 18px; white-space: nowrap; }
.brand b { font-weight: 800; }
.brand.big { font-size: 26px; color: var(--green); margin: 0 0 24px; }
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { padding: 6px 10px; border-radius: 6px; white-space: nowrap; opacity: .85; }
.nav a.on, .nav a:hover { background: rgba(255,255,255,.16); opacity: 1; }
.me { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.me form { margin: 0; }
button.link { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 64px; }
main.wide { max-width: 1440px; }
main.narrow { max-width: 440px; padding-top: 48px; }

.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 8px; }
.head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub { margin: 0 0 16px; color: var(--muted); }
.crumb { margin: 0; font-size: 13px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin: 16px 0; }
.card.hl { border: 2px solid var(--green); }
.card.danger { border-color: #f0c9c5; display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.card.danger h2 { width: 100%; }
details.card summary { cursor: pointer; font-weight: 700; }
details.card .pre { margin-top: 12px; }

/* forms */
.stack { display: grid; gap: 12px; }
.grid2, .grid3, .grid4 { display: grid; gap: 12px; align-items: start; }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.add { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.f { display: grid; gap: 4px; margin: 0; border: 0; padding: 0; min-width: 0; }
.f > span, .f legend { font-size: 13px; font-weight: 600; }
.f i { color: var(--bad); font-style: normal; }
.f small { font-size: 12px; }
.f em { color: var(--bad); font-size: 13px; font-style: normal; }
.f.bad input, .f.bad select, .f.bad textarea { border-color: var(--bad); }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 8px 10px; border: 1px solid #cfc6b8; border-radius: 8px; background: var(--white); min-height: 40px; }
textarea { resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }
input[readonly] { background: #f6f3ee; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--white); cursor: pointer; }
.chip input, .check input { width: auto; min-height: 0; }
.check { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { width: auto; }
form.inline { display: inline; margin: 0; }
form.inline.auto { display: inline-flex; gap: 6px; align-items: center; }
form.inline.auto input, form.inline.auto select { width: auto; min-height: 32px; padding: 4px 8px; }
.copy { font-family: ui-monospace, monospace; font-size: 13px; direction: ltr; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 8px; border: 1px solid #cfc6b8;
  background: var(--white); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--white); }
.btn.primary:hover { background: var(--green-d); }
.btn.bad { color: var(--bad); border-color: #e8b4ae; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.flash.ok { background: var(--good-bg); color: #0b4a31; }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.empty { text-align: center; padding: 40px 16px; background: var(--white); border: 1px dashed #cfc6b8; border-radius: var(--r); margin: 16px 0; }
.empty p { color: var(--muted); margin: 0 0 12px; }

/* tables */
.tbl { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.card .tbl { border: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: start; border-bottom: 1px solid #efe8dd; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fcf8f2; white-space: nowrap; }
[dir=rtl] th { text-transform: none; letter-spacing: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
tr.dim { opacity: .55; }
.row-actions { white-space: nowrap; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #efe8dd; white-space: nowrap; }
.badge.good { background: var(--good-bg); color: #0b4a31; }
.badge.warn { background: var(--warn-bg); color: #7a5600; }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.cs-active, .badge.st-live, .badge.ds-live, .badge.ds-client_ok { background: var(--good-bg); color: #0b4a31; }
.badge.st-declined, .badge.ds-changes { background: var(--bad-bg); color: var(--bad); }
.badge.st-content, .badge.ds-draft, .badge.ds-internal_ok { background: var(--warn-bg); color: #7a5600; }

.acc { display: inline-flex; gap: 4px; align-items: baseline; margin-inline-end: 8px; white-space: nowrap; direction: ltr; }
.acc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #999; align-self: center; }
.acc.instagram::before { background: #d6249f; } .acc.tiktok::before { background: #111; } .acc.snapchat::before { background: #f2c230; }
.acc.youtube::before { background: #e00; } .acc.x::before { background: #555; }
.accs { line-height: 1.9; }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 16px 0; }
.stats > div { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; color: var(--muted); }
.stats .neg b { color: var(--bad); }

/* campaign tabs and board */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 8px 0 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.on { color: var(--green); border-color: var(--green); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--beige-2); border-radius: var(--r); padding: 8px; min-height: 120px; }
.col h3 { display: flex; justify-content: space-between; padding: 4px; }
.eng { background: var(--white); border-radius: 8px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line); }
.eng .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin: 6px 0; }
.eng form { margin-top: 6px; }
.stages { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 12px; }
.stages li { padding: 4px 10px; border-radius: 99px; background: #efe8dd; font-size: 12px; color: var(--muted); }
.stages li.past { background: var(--good-bg); color: #0b4a31; }
.stages li.on { background: var(--green); color: var(--white); font-weight: 700; }

.pick { list-style: none; padding: 0; margin: 8px 0 0; }
.pick li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #efe8dd; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #efe8dd; }
.list li:last-child { border-bottom: 0; }
.list .end { margin-inline-start: auto; }
.log { list-style: none; padding: 0; margin: 12px 0 0; }
.log li { padding: 8px 0; border-bottom: 1px solid #efe8dd; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 16px; }
.login h1 { margin-bottom: 16px; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  .me { margin-inline-start: auto; }
  th, td { padding: 8px; }
}

/* content approval */
.deliv { border-top: 1px solid #efe8dd; padding: 14px 0; }
.deliv:first-of-type { border-top: 0; }
.deliv > header { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 8px; }
.draft { display: grid; grid-template-columns: minmax(0, 280px) 1fr; gap: 16px; }
.draft p { margin: 4px 0; }
.media { display: block; max-width: 100%; max-height: 420px; border-radius: 8px; background: #000; }
img.media { background: none; }
.caption { background: #fcf8f2; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.review { margin-top: 8px; }
details > summary { cursor: pointer; font-weight: 600; color: var(--green); padding: 6px 0; }
.badge.rv-ok { background: var(--good-bg); color: #0b4a31; } .badge.rv-changes { background: var(--bad-bg); color: var(--bad); } .badge.rv-pending { background: var(--warn-bg); color: #7a5600; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
.err-text { color: var(--bad); }

/* client report and client pages */
main.report { max-width: 1100px; }
.lang { float: inline-end; }
.rep-head { display: flex; gap: 20px; align-items: center; margin: 8px 0 20px; }
.rep-head .logo { width: 120px; height: auto; }
.stats.big b { font-size: 26px; color: var(--green); }
.small { font-size: 13px; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pcard { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--white); }
.pcard img, .pcard .noimg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; display: block; background: var(--beige-2); }
.pcard .noimg { display: grid; place-items: center; color: var(--muted); }
.pcard > div { padding: 10px; }
.nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; margin: 6px 0; }
.bar { display: grid; grid-template-columns: 90px 1fr 48px; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar i { height: 10px; border-radius: 99px; background: linear-gradient(to var(--end, right), var(--green) var(--w), #efe8dd var(--w)); }
[dir=rtl] .bar i { --end: left; }
.bar b { text-align: end; }
section.preview { border-top: 3px dashed var(--line); margin-top: 24px; padding-top: 8px; }
@media (max-width: 640px) {
  .draft { grid-template-columns: 1fr; }
  .rep-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* compliance card */
.comp summary { display: flex; gap: 8px; align-items: center; }
.comp.ok { border-color: #bfe0cf; }
.comp .list li { align-items: center; }
.comp form.end { margin-inline-start: auto; }

/* pitch, score, comment mood */
.pitch .pcard > div { display: grid; gap: 6px; }
.pitch h3 { margin: 0; font-size: 16px; }
.choices { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
details.score summary { font-weight: 600; }
blockquote { margin: 6px 0; padding: 6px 10px; background: #fcf8f2; border-inline-start: 3px solid var(--green); border-radius: 4px; font-size: 14px; }

/* IMAI parity */
.camp-head { display: flex; gap: 14px; align-items: center; }
.logo-sq { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--beige-2); flex: none; }
.camp-cell { display: flex; gap: 10px; align-items: center; }
.logo-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; background: var(--beige-2); flex: none; display: inline-block; }
.tags { font-family: ui-monospace, monospace; font-size: 13px; color: var(--green); }
.capture { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media print {
  .top, .tabs, .noprint, .filters, .lang, .flash, script { display: none !important; }
  body { background: #fff; }
  .card, .stats > div, .pcard { break-inside: avoid; border-color: #ccc; }
  main { max-width: none; padding: 0; }
}
