/* ============ AdStudio prototype — bento theme ============ */
:root {
  --bg: #EEEEEE;
  --card: #FFFFFF;
  --ink: #1B1913;
  --muted: #8A8474;
  --line: #EAE4D6;
  --accent: #DA251D;          /* UIP brand red */
  --accent-soft: #FBEBE9;
  --accent-ink: #9E120C;
  --dark: #1C1A17;
  --dark-2: #26241F;
  --ok: #2E9E5B;
  --radius: 26px;
  --shadow: 0 2px 10px rgba(27,25,19,.05), 0 18px 44px rgba(27,25,19,.07);
  --font: "SF Pro Display", -apple-system, Inter, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; }

.shell { min-height: 100vh; }

/* ---------- top nav (flat, per reference) ---------- */
.topnav {
  position: relative;
  width: 100%;
  padding: 20px 30px 18px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 10px 24px rgba(27,25,19,.08), 0 1px 0 rgba(27,25,19,.06);
  margin-bottom: 4px;
}
.topnav-logo { display: flex; align-items: center; }
.topnav-logo img { height: 42px; display: block; }
.topnav nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
}
.topnav nav a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px;
  border-radius: 99px; text-decoration: none; color: var(--ink);
  font-weight: 600; font-size: 13.5px; transition: background .15s; white-space: nowrap;
}
.topnav nav a .ico { font-size: 14px; }
.topnav nav a:hover { background: #E2E0DA; }
.topnav nav a.active { background: var(--dark); color: #fff; }
.topnav nav a .badge { background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; border-radius: 8px; padding: 2px 7px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.lang-toggle { display: flex; background: #E2E0DA; border-radius: 99px; padding: 3px; }
.lang-toggle button {
  border: 0; background: none; padding: 6px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.lang-toggle button.on { background: var(--dark); color: #fff; }
.userchip { display: flex; align-items: center; gap: 9px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 14px 5px 5px; font-size: 13px; font-weight: 600; }
.userchip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.userchip .dot.on { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

/* ---------- main ---------- */
#app { max-width: 1500px; margin: 0 auto; padding: 22px 30px 40px; }

@media (max-width: 1100px) {
  .topnav { flex-wrap: wrap; row-gap: 8px; padding: 14px 18px 4px; }
  .topnav nav { position: static; transform: none; order: 3; flex-basis: 100%; justify-content: center; }
  #app { padding: 18px 18px 40px; }
}

/* ---------- generic ---------- */
h1.display { font-size: 44px; font-weight: 800; letter-spacing: -1.6px; line-height: 1.02; margin: 6px 0 8px; }
.lede { color: var(--muted); font-size: 14px; max-width: 520px; line-height: 1.5; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; font-style: normal; }

.grid { display: grid; gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(234,228,214,.6); }
.card.dark { background: var(--dark); color: #fff; border-color: transparent; }
.card.dark .eyebrow, .card.dark .muted { color: #9d9789; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-title h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title h3 i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); font-style: normal; }
.chip { font-size: 11px; font-weight: 700; background: #F2EEE3; color: var(--muted); padding: 4px 11px; border-radius: 99px; }
.chip.ok { background: #E8F5EC; color: var(--ok); }
.chip.red { background: var(--accent-soft); color: var(--accent-ink); }
.muted { color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 700;
  padding: 11px 20px; border-radius: 99px; background: var(--dark); color: #fff;
  transition: transform .1s, opacity .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.accent { background: var(--accent); }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.sm { padding: 8px 14px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- stat pills ---------- */
.stat-row { display: flex; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px 26px; }
.stat-row .stat { padding: 0 26px; border-right: 1px solid var(--line); }
.stat-row .stat:last-child { border-right: 0; }
.stat-row .num { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-row .lbl { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* ---------- segment pills (funnel) ---------- */
.segbar { display: flex; gap: 8px; }
.seg { flex: 1; border-radius: 99px; padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.seg.dark { background: var(--dark); color: #fff; }
.seg.accent { background: var(--accent); color: #fff; }
.seg .pct { font-size: 15px; font-weight: 800; }
.seg .ico { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; margin-right: 7px; }

/* ---------- tables / list rows ---------- */
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; }
.trow:hover { background: #FBF9F4; }
.dark .trow:hover { background: var(--dark-2); }
.match { margin-left: auto; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 99px; }
.match.hi { background: #EAF7EE; color: var(--ok); }
.dark .match.hi { background: rgba(218,37,29,.25); color: #ffb4ad; }
.match.mid { background: #FFF4DC; color: #A9700A; }
.match.hold { background: #F2EEE3; color: var(--muted); }
.dark .match.hold { background: var(--dark-2); color: #9d9789; }

.list-row { display: flex; align-items: center; justify-content: space-between; background: #FBF9F4; border-radius: 14px; padding: 13px 16px; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.list-row .r { font-size: 11px; font-weight: 700; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* ---------- bars chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 120px; padding: 10px 6px 0; }
.bars .b { flex: 1; border-radius: 10px 10px 6px 6px; background: #EDEAE0; min-height: 18px; position: relative; }
.bars .b.hi { background: var(--accent); }
.bars .lbl { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 700; color: var(--muted); }
.kpi-big { font-size: 46px; font-weight: 800; letter-spacing: -2px; }
.kpi-sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.delta { font-size: 11px; font-weight: 800; background: #E8F5EC; color: var(--ok); padding: 3px 8px; border-radius: 99px; }
.delta.neg { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- campaigns table ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.tbl th { font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 4px 16px; }
.tbl td { background: #fff; padding: 15px 16px; font-size: 13.5px; font-weight: 600; }
.tbl tbody tr td:first-child { border-radius: 16px 0 0 16px; }
.tbl tbody tr td:last-child { border-radius: 0 16px 16px 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: #FBF7EF; }
.status { font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 5px 10px; border-radius: 99px; text-transform: uppercase; }
.status.published { background: #E8F5EC; color: var(--ok); }
.status.generated { background: #EAF1FB; color: #2B6CB0; }
.status.draft { background: #F2EEE3; color: var(--muted); }

/* ---------- studio ---------- */
.studio-grid { display: grid; grid-template-columns: 1fr 620px; gap: 16px; align-items: start; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; font-size: 13.5px; font-family: var(--font);
  border: 1.5px solid var(--line); border-radius: 14px; background: #FCFBF7; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); background: #fff; }
.field .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
textarea { resize: vertical; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs button { border: 0; background: #EFEBE0; padding: 8px 16px; border-radius: 99px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.on { background: var(--dark); color: #fff; }

/* phone mocks (reuse POC look, tuned to theme) */
.phone { width: 340px; margin: 0 auto; background: #000; color: #fff; border-radius: 20px; overflow: hidden; font-size: 13px; box-shadow: var(--shadow); }
.phone .ph-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.ph-avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: #fff; overflow: hidden; }
.ph-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ph-avatar.ring { padding: 2px; background: linear-gradient(45deg,#f9ce34,#ee2a7b,#6228d7); }
.ph-avatar.ring > span { width: 100%; height: 100%; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ph-avatar.ring > span img { width: 100%; height: 100%; object-fit: cover; }
.ph-name { font-weight: 700; font-size: 12.5px; line-height: 1.2; }
.ph-sub { font-size: 11px; color: #a8a8a8; }
.phone .img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #222; }
.ph-cta { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #1c1c1e; }
.ph-cta .t { font-size: 12px; font-weight: 600; color: #e4e4e4; }
.ph-cta .b { background: #3a3b3c; border-radius: 6px; padding: 6px 13px; font-size: 12px; font-weight: 800; }
.ph-cap { padding: 9px 12px 13px; font-size: 12.5px; line-height: 1.45; }
.phone.fb { background: #fff; color: #050505; }
.phone.fb .ph-sub { color: #65676b; }
.phone.fb .ph-cta { background: #f0f2f5; }
.phone.fb .ph-cta .t { color: #333; }
.phone.fb .ph-cta .b { background: #dfe3e8; color: #111; }

/* thumbnails */
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; cursor: pointer; outline: 1.5px solid var(--line); }
.thumbs img.sel { outline: 3px solid var(--accent); }

/* progress */
.prog-wrap { padding: 20px 4px; }
.prog-line { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 5px 0; opacity: .4; }
.prog-line.on { color: var(--ink); opacity: 1; }
.prog-line.done { color: var(--ok); opacity: 1; }
.prog-line .tick { width: 18px; text-align: center; }

/* quiz preview */
.q-card { background: #FBF9F4; border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.q-card .qt { font-size: 13px; font-weight: 700; margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start; }
.q-card .qt .tag { font-size: 9px; font-weight: 800; background: var(--dark); color: #fff; border-radius: 6px; padding: 2px 7px; letter-spacing: .5px; flex: none; margin-top: 1px; }
.q-card .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.q-card .opt { font-size: 11.5px; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; font-weight: 600; }
.q-card .opt.ok { border-color: var(--ok); background: #EAF7EE; color: var(--ok); }

/* ---------- modal & toast ---------- */
.modal-veil { position: fixed; inset: 0; background: rgba(20,18,14,.5); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.modal { background: var(--bg); border-radius: 30px; padding: 26px; max-height: 88vh; overflow: auto; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 13px 22px; border-radius: 99px; font-size: 13px; font-weight: 600; z-index: 99; box-shadow: var(--shadow); animation: pop .2s ease; }
@keyframes pop { from { transform: translate(-50%, 8px); opacity: 0; } }

/* applicant phone (apply funnel preview) */
.apply-ph { width: 340px; margin: 0 auto; background: #fff; color: var(--ink); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); }
.apply-ph .hero { position: relative; }
.apply-ph .hero img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.apply-ph .hero .bbar { position: absolute; top: 0; left: 0; right: 0; padding: 12px 14px; display: flex; gap: 10px; align-items: center; background: linear-gradient(rgba(0,0,0,.55), transparent); color: #fff; }
.apply-ph .body { padding: 18px 18px 26px; }
.apply-ph h1 { font-size: 19px; font-weight: 800; letter-spacing: -.4px; margin-bottom: 7px; }
.apply-ph .sub { font-size: 12.5px; color: #555; line-height: 1.5; margin-bottom: 14px; }
.apply-ph .step-lbl { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin: 16px 0 10px; }
.apply-ph .fld { margin-bottom: 10px; }
.apply-ph .fld label { display: block; font-size: 11px; font-weight: 700; color: #444; margin-bottom: 4px; }
.apply-ph .fld input { width: 100%; padding: 9px 11px; border: 1px solid #ddd; border-radius: 9px; font-size: 13px; }
.apply-ph .qo { display: flex; align-items: center; gap: 8px; border: 1px solid #e6e6e6; border-radius: 9px; padding: 8px 11px; margin-bottom: 6px; font-size: 12.5px; }
.apply-ph .qo.sel { border-color: var(--accent); background: var(--accent-soft); }
.big-cta { width: 100%; padding: 13px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; cursor: pointer; font-family: var(--font); }
.step-note { text-align: center; font-size: 10.5px; color: #999; margin-top: 10px; }
.check-circle { width: 58px; height: 58px; margin: 30px auto 16px; border-radius: 50%; background: #EAF7EE; border: 2px solid var(--ok); color: var(--ok); font-size: 26px; display: flex; align-items: center; justify-content: center; }

/* footer strip */
.proto-foot { display: flex; align-items: center; gap: 14px; margin-top: 16px; background: #fff; border-radius: 22px; border: 1px solid var(--line); padding: 14px 20px; font-size: 12px; color: var(--muted); }
.proto-foot img { height: 30px; border-radius: 6px; }
.proto-foot .sp { flex: 1; }
.proto-foot .chip { cursor: default; }

.mt { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
