/* Owner dashboard and influencer stats page */
.cvs-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 8px 0 14px; }
.cvs-head .h2 { margin: 0 auto 0 0; }
.cvs-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1.5px solid var(--line); margin-bottom: 18px; }
.cvs-tabs button { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1.5px; background: none; font: 600 15px var(--body); color: var(--ink-2); cursor: pointer; }
.cvs-tabs button.is-on { color: var(--green); border-bottom-color: var(--green); }
.cvs-pane { display: none; padding-bottom: 64px; }
.cvs-pane.is-on { display: block; }
.cvs-h { font: 700 19px/1.2 var(--display); margin: 26px 0 12px; letter-spacing: -.01em; }
.cvs-form .cvs-h, .cvs-dialog .cvs-h, .cvs-empty-card .cvs-h { margin-top: 0; }

.cvs-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cvs-stat { display: grid; gap: 2px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cvs-stat span { font-size: 14px; color: var(--ink-2); }
.cvs-stat strong { font: 800 28px/1.1 var(--display); color: var(--green); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cvs-stat small { font-size: 13px; color: var(--ink-2); }

.cvs-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; height: 170px; padding: 10px 12px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.cvs-bar { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; padding-bottom: 22px; }
.cvs-bar i { display: block; width: 100%; max-width: 34px; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--green); }
.cvs-bar-v { font-size: 10.5px; color: var(--ink-2); white-space: nowrap; margin-bottom: 3px; }
.cvs-bar-d { position: absolute; bottom: 4px; font-size: 12px; color: var(--ink-2); }
@media (max-width: 640px) { .cvs-bar-v { display: none; } }

.cvs-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.cvs-filter input { max-width: 340px; }
.cvs-filter select, .cvs-dialog select { min-height: 46px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font: 400 16px var(--body); color: var(--ink); }

.cvs-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow-x: auto; }
.cvs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.cvs-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 10px 14px; background: var(--paper-2); white-space: nowrap; }
.cvs-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.cvs-table tr.is-hidden td { opacity: .55; }
.cvs-empty { padding: 18px 0; }
@media (max-width: 720px) {
  .cvs-table thead { display: none; }
  .cvs-table tr { display: block; padding: 10px 14px; border-top: 1px solid var(--line); }
  .cvs-table tr:first-child { border-top: 0; }
  .cvs-table td { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 10px; padding: 4px 0; border: 0; }
  .cvs-table td[data-l]::before { content: attr(data-l); color: var(--ink-2); font-size: 13px; }
  .cvs-table td:not([data-l]) { display: block; padding-top: 8px; }
}

.cvs-tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--paper-2); color: var(--ink); white-space: nowrap; }
.cvs-tag.is-paid { background: #e6f2ea; color: var(--green); }
.cvs-tag.is-pending { background: #fff3cd; color: #7a5200; }
.cvs-tag.is-cancelled, .cvs-tag.is-failed { background: #fbe9e7; color: var(--danger); }
.cvs-tag.is-test { background: #eaf5fe; color: #7a5200; border: 1px solid #b8dcf6; }
.cvs-tag.is-code { background: var(--sun); color: var(--green); font-size: 14px; letter-spacing: .04em; }

.cvs-split { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .cvs-split { grid-template-columns: 1fr; } }
.cvs-form { display: grid; gap: 12px; padding: 20px; position: sticky; top: 12px; }
@media (max-width: 900px) { .cvs-form { position: static; } }
.cvs-form-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cvs-empty-card { padding: 22px; }

#influencers { display: grid; gap: 14px; }
.cvs-inf { display: grid; gap: 10px; padding: 18px 20px; }
.cvs-inf.is-off { opacity: .7; }
.cvs-inf header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cvs-inf h3 { margin: 0; font: 700 19px var(--display); }
.cvs-inf header p { margin: 2px 0 0; }
.cvs-inf-code { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cvs-inf > p { margin: 0; }
.cvs-inf-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; }
@media (max-width: 560px) { .cvs-inf-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cvs-inf-nums div { padding: 8px 10px; border-radius: 10px; background: var(--paper-2); }
.cvs-inf-nums dt { font-size: 12.5px; color: var(--ink-2); }
.cvs-inf-nums dd { margin: 0; font: 700 18px var(--display); font-variant-numeric: tabular-nums; }
.cvs-inf-nums dd small { font: 400 12px var(--body); color: var(--ink-2); }
.cvs-inf-nums .is-owed { background: var(--sun); }
.cvs-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .cvs-links { grid-template-columns: 1fr; } }
.cvs-links label { display: grid; gap: 4px; color: var(--ink-2); }
.cvs-links input { font-size: 13.5px; padding: 8px 10px; }
.cvs-payouts { margin: 6px 0 0; padding-left: 18px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; cursor: pointer; font: inherit; }

.cvs-dialog { width: min(420px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.cvs-dialog form { display: grid; gap: 12px; }
.cvs-dialog::backdrop { background: rgba(14, 27, 44, .4); }

.cvs-invite { display: grid; gap: 12px; padding: 18px 20px; margin-bottom: 8px; border: 2px solid var(--green); }
.cvs-invite h2 { margin: 0; }
.cvs-invite p { margin: 0; }
.cvs-invite-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cvs-invite-row input[readonly] { flex: 1 1 320px; font-size: 14px; }
.cvs-invite-deal { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.cvs-invite-deal .field { width: 190px; }
.cvs-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cvs-owed { font-weight: 700; color: var(--green); }
.cvs-table tfoot td { font-weight: 700; background: var(--paper-2); }
@media (max-width: 720px) { .cvs-table tfoot tr { display: block; } .cvs-num { text-align: left; } }

.cvs-code-row { display: flex; gap: 8px; }
.cvs-code-row input { letter-spacing: .06em; font-weight: 600; }
.cvs-seg { display: flex; gap: 0; margin: 0; padding: 0; border: 0; }
.cvs-seg label { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; min-height: 42px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; cursor: pointer; }
.cvs-seg label:first-of-type { border-radius: 10px 0 0 10px; }
.cvs-seg label:last-of-type { border-radius: 0 10px 10px 0; border-left: 0; }
.cvs-seg label:has(input:checked) { background: var(--green); border-color: var(--green); color: #fff; }
.cvs-seg input { accent-color: var(--sun); }
input[type=date] { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; font: 400 16px var(--body); color: var(--ink); background: #fff; }

.pay-setup { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 16px; }
.pay-setup .ad-tag, .pay-setup .cvs-tag { margin-left: 6px; }

/* Analytics tab */
.an-badge:not(:empty) { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; padding: 0 6px; border-radius: 99px; background: var(--sun); color: var(--green); font-size: 12px; font-weight: 800; }
.an-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.an-livepill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 99px; background: #0b2a20; color: #fff; font-size: 16px; }
.an-livepill strong { font: 800 22px var(--display); color: var(--sun); }
.an-pulse { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 12px var(--sun); }
.an-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--sun); animation: an-ping 2s infinite; }
@keyframes an-ping { from { transform: scale(1); opacity: .9; } to { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .an-pulse::after { animation: none; } }
.an-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; align-items: start; }
@media (max-width: 980px) { .an-grid { grid-template-columns: minmax(0, 1fr); } }
.an-mapcard { margin: 0; border-radius: 20px; overflow: hidden; background: #05140f; border: 1px solid #0f3b2d; box-shadow: var(--shadow); }
#an-map { display: block; width: 100%; height: auto; }
#an-map .an-nb path { fill: #0a2a20; stroke: #154434; stroke-width: 1; }
#an-map .an-coastglow { fill: none; stroke: #2fa57c; stroke-width: 8; opacity: .35; }
#an-map .an-prov path { fill: url(#an-land); stroke: #3a9a77; stroke-width: 1.2; stroke-linejoin: round; transition: fill .2s; }
#an-map .an-prov path:hover { fill: #1d7558; }
#an-map .an-encl path { fill: #0a2a20; stroke: #3a9a77; stroke-width: 1; }
#an-map .an-plabels text { fill: #8fd3b8; opacity: .55; font: 600 15px "Atkinson Hyperlegible Next", sans-serif; letter-spacing: .06em; text-anchor: middle; pointer-events: none; }
#an-map .an-plabels text.sm { font-size: 11px; }
#an-map .an-cities circle { fill: #e8f5ee; }
#an-map .an-cities text { fill: #e8f5ee; font: 600 12.5px "Atkinson Hyperlegible Next", sans-serif; paint-order: stroke; stroke: #0b2a20; stroke-width: 3px; pointer-events: none; }
#an-map .an-cities .r1 text { font-size: 14px; font-weight: 700; }
#an-map .an-cities .r3 text { font-size: 11px; opacity: .8; }
#an-map .an-cities .r3 circle { opacity: .7; }
#an-map .an-recentdot { fill: #5fe3a1; fill-opacity: .28; stroke: #5fe3a1; stroke-opacity: .7; stroke-width: 1.5; }
#an-map .an-live-dot .halo { fill: #9bd4f7; opacity: .35; }
#an-map .an-live-dot .core { fill: #9bd4f7; }
#an-map .an-live-dot .hot { fill: #fffbe6; }
#an-map .an-live-dot .ring { fill: none; stroke: #9bd4f7; stroke-width: 2.5; }
.an-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 16px; background: #0b2a20; color: #cfe8dc; font-size: 14px; }
.an-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 50%; vertical-align: -1px; }
.an-legend .lv { background: #9bd4f7; box-shadow: 0 0 10px #9bd4f7; }
.an-legend .rc { background: rgba(95, 227, 161, .35); border: 1.5px solid #5fe3a1; }
.an-outside { margin-left: auto; color: var(--sun); }
.an-side { padding: 18px 20px; border-radius: 20px; background: #fff; border: 1px solid var(--line); }
.an-side .cvs-h { margin-top: 0; }
.an-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 520px; overflow: auto; }
.an-people li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); }
.an-people strong { display: block; }
.an-people span { font-size: 14px; color: var(--ink-2); }
.an-dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #9bd4f7; box-shadow: 0 0 10px #9bd4f7; }
.an-chart { grid-template-columns: repeat(30, 1fr); gap: 4px; }
.an-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.an-tables > div { padding: 4px 18px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.an-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-list li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.an-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-b { height: 10px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.an-b i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.an-list b { font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.an-note { margin-top: 18px; max-width: 80ch; }

/* Influencer stats page */
.pt-wrap { max-width: 720px; margin: 0 auto; padding: 8px 0 64px; }
.pt-code { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 20px; margin: 18px 0; }
.pt-code strong { font: 800 30px var(--display); letter-spacing: .04em; color: var(--green); background: var(--sun); padding: 2px 14px; border-radius: 10px; }
.pt-code input { flex: 1 1 260px; }

/* An affiliate's own rates: rewrite / brand-new CV / design change. */
.cvs-rates { margin: 4px 0 12px; padding: 12px 14px 4px; border: 1px solid var(--line, #d4e2f0); border-radius: 12px; }
.cvs-rates legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }
/* The influencer form sits in a narrow column, so stack the three rates there. */
.cvs-rates .grid-3 { grid-template-columns: 1fr; gap: 0; }
