/* Views C: client portal, connections, add brand flow, team, 404. */

/* Client portal preview (agency-branded, own chrome) */
.portal-root { min-height: 100dvh; background: var(--bg); }
.pt-banner { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); padding-top: calc(8px + env(safe-area-inset-top)); background: var(--ink); color: var(--on-ink); font-size: 13px; }
.pt-banner > span { display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.pt-banner .btn { background: transparent; color: var(--on-ink); border-color: color-mix(in srgb, var(--on-ink) 40%, transparent); box-shadow: none; }
.pt-banner .btn:hover { background: color-mix(in srgb, var(--on-ink) 12%, transparent); }
.portal { max-width: 1040px; margin-inline: auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.pt-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pt-brand { display: flex; align-items: center; gap: 10px; }
.pt-name { font-weight: 600; font-size: 16px; }
.pt-nav { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; }
.pt-nl { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.pt-nl.on { background: var(--agency); color: var(--agency-ink); }
.pt-main { display: grid; gap: 16px; padding-top: 24px; }
.pt-kpis { display: grid; gap: 12px; grid-template-columns: 1fr; }
.pt-kpis .card { display: grid; gap: 4px; padding: 14px; min-width: 0; }
.pt-kpis .fig { font-size: 22px; }
@media (min-width: 560px) { .pt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pt-kpis .fig { font-size: clamp(16px, 3.4vw, 22px); } }
.pt-row { display: grid; gap: 16px; }
.pt-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; margin-top: 12px; }
.pt-bars li { display: grid; justify-items: center; gap: 4px; }
.ptb-track { position: relative; width: 100%; max-width: 72px; height: 120px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.ptb-bar { position: absolute; inset-inline: 0; background: var(--agency); border-radius: 6px 6px 0 0; }
.ptb-bar.is-down { border-radius: 0 0 6px 6px; }
.ptb-bar.is-loss { background: var(--loss); }
.ptb-zero { position: absolute; inset-inline: 0; height: 1px; background: var(--line-2); }
.ptb-v { font-weight: 600; font-size: 13px; }
.ptb-m { font-size: 12px; color: var(--text-3); }
.pt-reports { display: grid; margin-top: 8px; }
.pt-reports li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pt-contact { display: grid; gap: 2px; margin-top: 16px; }
.pt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-3); }
.pt-foot .wordmark { color: var(--logo-ink); }
@media (min-width: 720px) { .pt-row { grid-template-columns: 1fr 1fr; } .pt-kpis .fig { font-size: 26px; } .portal { padding-inline: 32px; } }

/* Connections */
.srcs { display: grid; gap: 12px; }
.src { display: grid; gap: 12px; align-items: center; }
.src-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.src-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--text-2); }
.src-text { display: grid; gap: 4px; min-width: 0; }
.src-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.progress { display: grid; gap: 4px; margin-top: 6px; }
.progress[hidden] { display: none; }
.bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left center; }
[dir="rtl"] .bar > span { transform-origin: right center; }
.progress.run .bar > span { animation: fill 1.5s ease-out forwards; }
@keyframes fill { to { transform: scaleX(1); } }
.file-btn { position: relative; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.vh-file { cursor: pointer; }
@media (min-width: 720px) { .src { grid-template-columns: minmax(0, 1fr) auto; } }

/* Add brand flow */
.steps { display: flex; gap: 8px; padding: 4px 20px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.steps li { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; font-size: 13px; color: var(--text-3); white-space: nowrap; }
.steps li.on { color: var(--text); font-weight: 600; }
.steps li.done { color: var(--text-2); }
.st-n { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; }
.steps li.on .st-n { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.steps li.done .st-n { background: var(--profit-bg); color: var(--profit); border-color: transparent; }
.ab-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.ab-box .field { margin: 0; }
.ab-box .h4 { flex-wrap: wrap; }
.ab-done { display: grid; justify-items: start; gap: 8px; padding: 8px 0; }
.ab-done-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }

/* Team */
.roles { display: grid; gap: 12px; }
.roles .card { display: grid; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.tbl-team .mks { max-width: 360px; }
@media (min-width: 900px) { .roles { grid-template-columns: repeat(3, 1fr); } }

/* 404 */
.nf { display: grid; justify-items: start; gap: 12px; padding: 48px 0; }
.nf-ic { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--surface-2); color: var(--text-2); }
