/* IFG Social Engine. Tokens follow the Beastmode eye-friendly palette
   (off-white ground, warm neutrals, soft ink, desaturated status colours);
   brand accents are the IFG placeholder navy + gold. Light mode only. */
:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF1F8;
  --line: #DDE2EE;
  --ink: #333B4F;
  --ink-strong: #0A155A;
  --muted: #6B7385;
  --brand: #23408F;
  --brand-deep: #0A155A;
  --gold: #67B7E1;
  --gold-bg: #E4F2FA;
  --green: #3D8A5A; --green-bg: #E3EEE2;
  --amber: #B88324; --amber-bg: #F5ECD3;
  --red: #B84838;   --red-bg: #F5DFD6;
  --plum: #6C5897;  --plum-bg: #ECE4F1;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(10, 21, 90, .06), 0 2px 8px rgba(10, 21, 90, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--brand); }
h1, h2, h3 { color: var(--ink-strong); line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: .35rem 0 .7rem; }
small, .muted { color: var(--muted); }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* top bar */
.bar { background: var(--brand); color: #fff; }
.bar-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 18px; min-height: 54px; flex-wrap: wrap; }
.bar .logo { font-weight: 700; letter-spacing: .02em; color: #fff; text-decoration: none; white-space: nowrap; }
.bar .logo span { color: var(--gold); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a { color: #DCE7EF; text-decoration: none; padding: 7px 11px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.14); color: #fff; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--gold); color: #0A155A; font-size: 12px; font-weight: 700; text-align: center; margin-left: 4px; }
.bar .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #DCE7EF; }
.bar .who a { color: #fff; }
.bar form { display: inline; }
.bar button.link { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.sw { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.12); color: #DCE7EF; white-space: nowrap; }
.sw.on { background: #E3EEE2; color: #245236; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 16px 60px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.stat { font-size: 1.7rem; font-weight: 700; color: var(--ink-strong); }

/* messages. Banners are for problems only; pending work is a badge. */
.msg { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.msg.ok { background: var(--green-bg); border-color: #B9D5BC; color: #245236; }
.msg.err { background: var(--red-bg); border-color: #E6BBAE; color: #7A2E22; }
.msg.warn { background: var(--amber-bg); border-color: #E6D4A3; color: #6B4C12; }
.msg.info { background: var(--plum-bg); border-color: #D7CBE3; color: #45386A; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.plum { background: var(--plum-bg); color: var(--plum); }
.pill.gold { background: var(--gold-bg); color: #0A155A; }
.pill.test { background: #FFE9A8; color: #6B4C12; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }

/* forms */
label { display: block; font-weight: 600; color: var(--ink-strong); margin: 10px 0 4px; font-size: 14px; }
label.inline { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; margin: 4px 16px 4px 0; }
.hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #C9D0E2; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(35,64,143,.25); border-color: var(--brand); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px 14px; margin: 0 0 16px; background: var(--surface); }
legend { font-weight: 700; color: var(--ink-strong); padding: 0 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 8px; border: 1px solid #C3CBDF; background: #fff; color: var(--ink-strong); font: 600 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-deep); }
.btn.go { background: var(--green); border-color: var(--green); color: #fff; }
.btn.danger { color: var(--red); border-color: #E2B9AE; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }

/* campaign bits */
.cards-preview { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.cards-preview figure { margin: 0; }
.cards-preview img { display: block; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.cards-preview figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checks li { margin: 4px 0; }
.checks .e { color: var(--red); }
.checks .n { color: var(--amber); }
.copy-field { margin-bottom: 14px; }
.copy-field .count { float: right; font-weight: 400; font-size: 12px; color: var(--muted); }
.copy-field textarea { min-height: 110px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos .ph { width: 150px; }
.photos img { width: 150px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--ink); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.on { color: var(--brand); border-color: var(--brand); }
details > summary { cursor: pointer; font-weight: 600; color: var(--ink-strong); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; padding: 6px 0 6px 34px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 5px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--ink-strong); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.steps li.done::before { background: var(--green-bg); color: var(--green); content: "\2713"; }

/* share kit (public, phone-first) */
.kit { max-width: 720px; margin: 0 auto; padding: 16px 16px 60px; }
.kit-head { background: var(--brand); color: #fff; border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.kit-head h1 { color: #fff; margin: 6px 0; }
.kit-img { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.kit-img img { width: 100%; border-radius: 8px; border: 1px solid var(--line); display: block; }
.kit-img figcaption { font-size: 12px; color: var(--muted); margin: 4px 0; }
.copybox { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 14px; margin-bottom: 8px; }
.login { max-width: 380px; margin: 9vh auto; }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .bar-in { gap: 6px 10px; padding: 6px 12px; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .bar .who { margin-left: auto; gap: 6px; }
  .bar .who .name { display: none; }
  th, td { padding: 7px 6px; }
}
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 16px; }
