/* Client Live Dashboard: light neumorphism. */
:root {
  color-scheme: light;
  --bg: #e8edf5;
  --ink: #2f3a52;
  --ink-2: #56617a;
  --muted: #8a94a8;
  --line: #d5dce8;
  --sh-d: #c3cbdb;
  --sh-l: #ffffff;
  --raised: 7px 7px 16px var(--sh-d), -7px -7px 16px var(--sh-l);
  --raised-sm: 3px 3px 7px var(--sh-d), -3px -3px 7px var(--sh-l);
  --inset: inset 3px 3px 6px var(--sh-d), inset -3px -3px 6px var(--sh-l);
  --accent: #2a78d6;
  --grad: linear-gradient(90deg, #c13cf0 0%, #7a5cf5 45%, #3d8bff 100%);
  --s-spend: #2a78d6;
  --good: #11873a;
  --warning: #b77900;
  --serious: #d1592c;
  --critical: #d03b3b;
  --info: #2a78d6;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* header */
.top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap; max-width: 1600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #1d2436; }
.brand .mark { width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--raised-sm); display: grid; place-items: center; background: var(--bg); }
.brand .mark svg { width: 28px; height: 28px; }
.brand .word { font-weight: 300; letter-spacing: .38em; font-size: 15px; }
.client { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; padding-left: 14px; border-left: 1px solid var(--line); }
.client .logo { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--sans); color: #fff; flex: none; box-shadow: var(--raised-sm); }
.client .name { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font: 600 10px var(--sans); letter-spacing: .1em; padding: 4px 10px; border-radius: 999px; box-shadow: var(--raised-sm); color: var(--accent); }
.status { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-weight: 600; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #1fbf5a; box-shadow: 0 0 0 3px rgba(31,191,90,.18); animation: pulse 2s infinite; }
.live.stale { color: var(--warning); } .live.stale i { background: #e2a400; animation: none; }
.live.down { color: var(--critical); } .live.down i { background: var(--critical); animation: none; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* ticker */
.tape-wrap { max-width: 1600px; margin: 0 auto; padding: 0 16px; }
.tape { overflow: hidden; border-radius: var(--r); box-shadow: var(--raised); white-space: nowrap; }
.tape-inner { display: inline-flex; padding: 14px 0; animation: tape 45s linear infinite; }
.tape:hover .tape-inner { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0) } to { transform: translateX(-50%) } }
@media (prefers-reduced-motion: reduce) { .tape-inner, .live i { animation: none; } }
.tk { display: inline-flex; align-items: baseline; gap: 8px; padding: 0 22px; border-right: 1px solid var(--line); }
.tk .v { font-size: 16px; font-weight: 500; color: var(--ink); }
.tk .k { font-size: 12px; color: var(--muted); }
.up-good, .down-good { color: var(--good); } .up-bad, .down-bad { color: var(--critical); } .flat { color: var(--muted); }
.d { font-size: 12px; font-weight: 600; }

.demo-banner { max-width: 1600px; margin: 16px auto 0; padding: 0 16px; }
.demo-banner > div { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; box-shadow: var(--inset); color: var(--ink-2); font-size: 13px; }
.demo-banner .i { width: 26px; height: 26px; border-radius: 50%; box-shadow: var(--raised-sm); display: grid; place-items: center; color: var(--accent); font-weight: 700; flex: none; }
.demo-banner button { margin-left: auto; background: none; border: 0; color: var(--accent); font-size: 18px; cursor: pointer; padding: 0 4px; }

/* grid */
.grid { display: grid; gap: 22px; padding: 22px 16px 28px; grid-template-columns: 1fr; max-width: 1600px; margin: 0 auto; }
.panel { background: var(--bg); border-radius: var(--r); padding: 18px; min-width: 0; box-shadow: var(--raised); }
.panel h2 { margin: 0 0 16px; font-size: 17px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.panel h2 .ico { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--raised-sm); display: grid; place-items: center; color: var(--accent); flex: none; }
.panel h2 .ico svg { width: 20px; height: 20px; }
.panel h2 em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 400; color: var(--muted); }
@media (min-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-camps, .p-hour { grid-column: 1 / -1; }
}
@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .p-pacing { grid-column: span 6; } .p-goals { grid-column: span 6; }
  .p-spend, .p-cpl, .p-hour { grid-column: span 4; }
  .p-camps { grid-column: span 8; } .p-feed { grid-column: span 4; grid-row: span 2; } .p-recs { grid-column: span 8; }
}

/* pacing */
.pace { display: grid; grid-template-columns: 62px 1fr; gap: 6px 14px; align-items: center; margin-bottom: 16px; }
.pace:last-child { margin-bottom: 0; }
.pace .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pace .nums { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pace .nums b { font-size: 22px; font-weight: 500; }
.pace .nums small { color: var(--muted); font-size: 13px; margin-left: 6px; }
.bar { grid-column: 2; position: relative; height: 10px; border-radius: 999px; box-shadow: var(--inset); }
.bar .fill { position: absolute; inset: 2px auto 2px 2px; border-radius: 999px; background: var(--grad); max-width: calc(100% - 4px); }
.bar .exp { position: absolute; top: -5px; bottom: -5px; width: 2px; border-radius: 1px; background: var(--ink); }
.pace .note { grid-column: 2; font-size: 12px; color: var(--muted); }
.pace .note b { color: var(--ink-2); font-weight: 600; }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { border-radius: 14px; padding: 14px; min-width: 0; box-shadow: var(--raised-sm); position: relative; }
.tile .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.tile .v { font-size: 26px; font-weight: 500; line-height: 1.2; margin: 10px 0 6px; }
.tile .g { font-size: 12px; color: var(--muted); }
.tile .ti { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--raised-sm); display: grid; place-items: center; color: var(--accent); }
.tile .ti svg { width: 16px; height: 16px; }
.st { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; }
.st.good { color: var(--good); } .st.warning { color: var(--warning); } .st.serious { color: var(--serious); } .st.critical { color: var(--critical); } .st.info { color: var(--info); } .st.muted { color: var(--muted); }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-l { stroke: #d9dfea; stroke-width: 1; }
.chart .base { stroke: #c3cbdb; stroke-width: 1; }
.chart text { fill: var(--muted); font: 11px var(--sans); }
.chart .ref { stroke: #6b7590; stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.chart .ref-lbl { fill: var(--ink-2); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hl { fill: rgba(42,120,214,.07); }
.legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.dash { width: 16px; height: 0; border-top: 2px dashed #6b7590; border-radius: 0; vertical-align: 3px; }

/* tooltip */
.tip { position: fixed; z-index: 50; pointer-events: none; background: #f4f7fb; border-radius: 12px; padding: 9px 11px; font-size: 12px; color: var(--ink); box-shadow: 6px 6px 18px rgba(120,135,165,.45), -4px -4px 12px #fff; max-width: 260px; }
.tip .t { color: var(--muted); margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; }
.tip .r span:first-child { color: var(--ink-2); }
.tip .r span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }

/* campaigns: table on wide screens, cards on phones */
.ctable { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13px; }
.ctable th { font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); text-align: right; padding: 0 10px; white-space: nowrap; }
.ctable th:nth-child(2) { text-align: left; }
.ctable td { padding: 9px 10px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctable td.nm { text-align: left; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.ctable tr.c { cursor: pointer; }
.ctable tr.c td { border-top: 1px solid var(--line); }
.ctable tr.c:hover td { background: rgba(255,255,255,.35); }
.ctable td.chev { width: 22px; color: var(--accent); text-align: center; transition: transform .15s; }
.ctable tr.open td.chev { transform: rotate(90deg); }
.ctable tr.ads td { padding: 0 0 8px; text-align: left; white-space: normal; }
.ctable tr.ads[hidden] { display: none; }
.ctable tr.c:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pill { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .08em; padding: 5px 12px; border-radius: 999px; text-transform: uppercase; box-shadow: var(--inset); min-width: 84px; text-align: center; }
.pill.active { color: var(--accent); } .pill.learning { color: #5b4fd6; } .pill.limited { color: var(--warning); } .pill.paused { color: var(--muted); }
.ads-grid { display: grid; gap: 12px; padding: 4px 8px 6px; }
@media (min-width: 900px) { .ads-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ad { display: grid; grid-template-columns: 72px 1fr; gap: 12px; border-radius: 14px; padding: 10px; box-shadow: var(--inset); min-width: 0; }
.ad img { width: 72px; height: 72px; border-radius: 10px; display: block; box-shadow: var(--raised-sm); }
.ad .an { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad .as { font-size: 11px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; font-size: 12px; }
.metrics small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.metrics span { font-variant-numeric: tabular-nums; font-weight: 500; }
.ccards { display: none; }
@media (max-width: 759px) {
  .ctable { display: none; }
  .ccards { display: grid; gap: 14px; }
  .ccard { border-radius: 14px; box-shadow: var(--raised-sm); padding: 12px; }
  .ccard > button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; gap: 10px; }
  .ccard .row1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .ccard .cname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
  .ccard .ads-grid { padding: 12px 0 0; }
  .ccard:not(.open) .ads-grid { display: none; }
}

/* feed */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 1px; }
.feed li { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 0 0 16px; }
.feed .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: var(--raised-sm); display: grid; place-items: center; margin-top: 1px; }
.feed .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.feed time { display: block; font-size: 12px; color: var(--muted); }
.feed p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }

/* recs */
.recs-wrap { display: grid; gap: 18px; }
@media (min-width: 900px) { .recs-wrap { grid-template-columns: 3fr 2fr; } }
.recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.recs li { border-radius: 14px; padding: 12px 14px; box-shadow: var(--raised-sm); }
.recs p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.plan-box { border-radius: 14px; padding: 14px 16px; box-shadow: var(--inset); }
.plan-h { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.plan { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; }
.plan li { margin-bottom: 6px; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 4px 16px 28px; font-size: 12px; color: var(--muted); max-width: 1600px; margin: 0 auto; }
.foot .fl { display: inline-flex; align-items: center; gap: 8px; }
.foot svg { width: 16px; height: 16px; }

/* sign-in */
body.auth { display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; text-align: center; padding: 32px 24px; }
.auth-mark { border-radius: 12px; box-shadow: var(--raised-sm); }
.auth-card h1 { font-size: 22px; font-weight: 500; margin: 18px 0 8px; }
.auth-card p { color: var(--ink-2); margin: 0 0 20px; }
.auth-card form { display: grid; gap: 12px; text-align: left; }
.auth-card label { font-size: 12px; color: var(--muted); }
.auth-card input { font: inherit; border: 0; border-radius: 12px; padding: 12px 14px; background: var(--bg); box-shadow: var(--inset); color: var(--ink); outline: none; }
.auth-card input:focus-visible { box-shadow: var(--inset), 0 0 0 2px var(--accent); }
.auth-card button { border: 0; border-radius: 12px; padding: 12px; background: var(--bg); box-shadow: var(--raised-sm); color: var(--accent); font-weight: 600; cursor: pointer; }
.auth-card button:active { box-shadow: var(--inset); }
.auth-card small { display: block; margin-top: 14px; color: var(--muted); }
.auth-card a { color: var(--accent); }
.empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }
