/* ============================================================================
   CreativeLaunch AI — Core Design System
   Premium dark-mode SaaS. Brand gradient #175CF7 -> #9A3CFC.
   Used by: creativelaunch.ai (marketing), app.creativelaunch.ai, admin.creativelaunch.ai
   ========================================================================== */

/* ----------------------------- Tokens ----------------------------------- */
:root {
  /* Brand */
  --brand-blue: #175CF7;
  --brand-violet: #9A3CFC;
  --grad-brand: linear-gradient(135deg, #175CF7 0%, #9A3CFC 100%);
  --grad-brand-soft: linear-gradient(135deg, rgba(23,92,247,.18) 0%, rgba(154,60,252,.18) 100%);
  --grad-brand-text: linear-gradient(120deg, #5B8CFF 0%, #B36BFF 100%);

  /* Base surfaces */
  --bg: #0B0F1A;
  --bg-2: #0E1322;
  --panel: #0E1322;
  --panel-2: #121829;
  --panel-3: #161E33;
  --glass: rgba(255,255,255,.035);
  --glass-2: rgba(255,255,255,.05);
  --border: rgba(255,255,255,.08);
  --border-2: rgba(255,255,255,.12);
  --border-strong: rgba(255,255,255,.18);

  /* Text */
  --text: #EAEEF7;
  --text-dim: #93A0B8;
  --text-faint: #7C8AA6;

  /* States */
  --green: #38E08A;
  --green-dim: rgba(56,224,138,.14);
  --red: #FF6B6B;
  --red-dim: rgba(255,107,107,.14);
  --amber: #FFC24B;
  --amber-dim: rgba(255,194,75,.14);
  --cyan: #3AD8E0;

  /* Sizing */
  --sidebar-w: 248px;
  --topbar-h: 68px;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
  --shadow: 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 28px 60px rgba(0,0,0,.5);
  --glow-brand: 0 8px 30px rgba(99,80,255,.45);
  --glow-green: 0 0 24px rgba(56,224,138,.35);

  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* Admin skin: shift accent slightly cooler/indigo to signal the back end */
body.admin {
  --bg: #080B14;
  --bg-2: #0B1020;
  --panel: #0B1020;
  --panel-2: #0F1526;
  --panel-3: #141C32;
  --grad-brand: linear-gradient(135deg, #2D6BFF 0%, #7A4DFF 100%);
}

/* ----------------------------- Reset ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
ul { list-style: none; }
canvas { display: block; }
::selection { background: rgba(123,92,255,.4); color: #fff; }

/* Page ambient background glow */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 75% -10%, rgba(154,60,252,.16), transparent 60%),
    radial-gradient(1000px 500px at 0% 10%, rgba(23,92,247,.14), transparent 55%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.18); background-clip: padding-box; }

/* ----------------------------- Typography ------------------------------- */
h1,h2,h3,h4,h5 { font-weight: 700; letter-spacing: -.02em; color: var(--text); line-height: 1.15; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.gradient-text {
  background: var(--grad-brand-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.mono { font-family: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }

/* ----------------------------- App Shell -------------------------------- */
.app-shell { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(14,19,34,.92), rgba(9,12,22,.96));
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
  transition: transform .3s var(--ease);
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px 14px; }
.sidebar__brand img { height: 30px; width: auto; }
.sidebar__brand .badge { margin-left: auto; }
.sidebar__scroll { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sidebar__group-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 16px 12px 8px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-weight: 500; font-size: 13.5px;
  position: relative; transition: all .18s var(--ease); margin-bottom: 2px;
}
.nav-item svg, .nav-item .ico { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item.active { color: #fff; background: var(--grad-brand-soft); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: var(--grad-brand);
}
.nav-item.active svg, .nav-item.active .ico { opacity: 1; }
.nav-item .nav-badge { margin-left: auto; }

.sidebar__user {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 8px;
  border-top: 1px solid var(--border); border-radius: var(--radius-sm);
}
.sidebar__user:hover { background: var(--glass); }
.sidebar__user .meta { min-width: 0; }
.sidebar__user .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user .sub { font-size: 11.5px; color: var(--text-dim); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  background: rgba(11,15,26,.72); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 21px; }
.topbar .page-sub { font-size: 12.5px; color: var(--text-dim); }
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }

.view { padding: 26px; flex: 1; }
.view--narrow { max-width: 1120px; margin: 0 auto; width: 100%; }

/* Mobile sidebar toggle */
.menu-btn { display: none; }
.scrim { display: none; }

/* ----------------------------- Company Switcher ------------------------- */
.company-switch { position: relative; }
.company-switch__btn {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  background: var(--glass); border: 1px solid var(--border); border-radius: 12px;
  transition: all .18s var(--ease); max-width: 230px;
}
.company-switch__btn:hover { border-color: var(--border-strong); background: var(--glass-2); }
.company-switch__logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; flex: none; }
.company-switch__name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-switch__name small { display: block; font-weight: 500; color: var(--text-dim); font-size: 11px; }
.company-switch__caret { color: var(--text-dim); transition: transform .2s; }
.company-switch.open .company-switch__caret { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 280px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 8px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .18s var(--ease);
}
.dropdown.right { left: auto; right: 0; }
.company-switch.open .dropdown, .has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown__label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); padding: 8px 10px 4px; }
.dropdown__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13px; transition: background .15s; }
.dropdown__item:hover { background: var(--glass); }
.dropdown__item .check { margin-left: auto; color: var(--brand-violet); }
.dropdown__divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ----------------------------- Cards ------------------------------------ */
.card {
  background: var(--glass); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; position: relative; transition: border-color .2s, transform .2s;
}
.card--hover:hover { border-color: var(--border-2); transform: translateY(-2px); }
.card--solid { background: var(--panel-2); }
.card--pad-lg { padding: 24px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card__title { font-size: 15px; font-weight: 650; }
.card__head .spacer { flex: 1; }
.card-grad-border { position: relative; background: var(--panel-2); border: 1px solid transparent; }
.card-grad-border::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--grad-brand);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}

/* Stat / KPI card */
.stat {
  background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden;
}
.stat__label { font-size: 12.5px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.stat__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-brand-soft); color: #cdd6ff; }
.stat__value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.stat__value.sm { font-size: 24px; }
.stat__foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.stat__spark { position: absolute; right: 0; bottom: 0; width: 56%; height: 46px; opacity: .8; }

/* Delta pill */
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 12px; padding: 2px 8px; border-radius: 999px; }
.delta.up { color: var(--green); background: var(--green-dim); }
.delta.down { color: var(--red); background: var(--red-dim); }
.delta.flat { color: var(--text-dim); background: var(--glass-2); }

/* ----------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 13.5px;
  transition: all .18s var(--ease); white-space: nowrap; border: 1px solid transparent; line-height: 1;
}
.btn svg { width: 17px; height: 17px; }
.btn--primary { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(99,80,255,.35); }
.btn--primary:hover { box-shadow: var(--glow-brand); transform: translateY(-1px); }
.btn--ghost { background: var(--glass); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--glass-2); border-color: var(--border-strong); }
.btn--outline { border-color: var(--border-2); color: var(--text); }
.btn--outline:hover { border-color: var(--brand-violet); color: #fff; }
.btn--danger { background: var(--red-dim); color: var(--red); border-color: rgba(255,107,107,.3); }
.btn--danger:hover { background: rgba(255,107,107,.22); }
.btn--success { background: var(--green-dim); color: var(--green); border-color: rgba(56,224,138,.3); }
.btn--sm { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }
.btn--lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn--block { width: 100%; }
.btn--icon { padding: 9px; border-radius: 10px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ----------------------------- Badges / Pills / Chips ------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; text-transform: uppercase; }
.badge--brand { background: var(--grad-brand); color: #fff; }
.badge--ghost { background: var(--glass-2); color: var(--text-dim); border: 1px solid var(--border); }
.badge--green { background: var(--green-dim); color: var(--green); }
.badge--red { background: var(--red-dim); color: var(--red); }
.badge--amber { background: var(--amber-dim); color: var(--amber); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--border); color: var(--text); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill--green .dot { background: var(--green); box-shadow: var(--glow-green); }
.pill--green { color: var(--green); border-color: rgba(56,224,138,.3); background: var(--green-dim); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--glass); border: 1px solid var(--border); font-size: 12.5px; font-weight: 550; color: var(--text-dim); transition: all .15s var(--ease); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active, .chip[aria-pressed="true"] { background: var(--grad-brand-soft); border-color: rgba(154,60,252,.5); color: #fff; }
.chip--add { border-style: dashed; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.green { background: var(--green); box-shadow: var(--glow-green); }
.status-dot.red { background: var(--red); }
.status-dot.amber { background: var(--amber); }
.status-dot.grey { background: var(--text-faint); }

/* ----------------------------- Toggle switch ---------------------------- */
.switch { position: relative; display: inline-flex; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 44px; height: 25px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--border-2); transition: all .22s var(--ease); position: relative; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #cfd6e6; transition: all .22s var(--ease); }
.switch input:checked + .track { background: var(--grad-brand); border-color: transparent; }
.switch input:checked + .track::after { left: 21px; background: #fff; }
.switch.green input:checked + .track { background: linear-gradient(135deg,#1fae6a,#38E08A); box-shadow: var(--glow-green); }

/* Pill toggle (Autopilot / Manual) */
.segmented { display: inline-flex; padding: 3px; background: var(--panel-3); border: 1px solid var(--border); border-radius: 12px; gap: 2px; }
.segmented button { padding: 7px 16px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); transition: all .18s var(--ease); }
.segmented button.active { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 12px rgba(99,80,255,.4); }

/* ----------------------------- Inputs ----------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.input, .select, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text);
  transition: all .18s var(--ease); font-size: 14px;
}
.input::placeholder, textarea.input::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--brand-violet); box-shadow: 0 0 0 3px rgba(154,60,252,.18); background: var(--panel); }
.input-group { position: relative; }
.input-group .icon-left { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.input-group .icon-right { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.input-group .input { padding-left: 40px; }
.search { background: var(--glass); border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; min-width: 200px; }
.search input { background: none; border: none; outline: none; width: 100%; font-size: 13px; }
.search svg { color: var(--text-faint); width: 17px; }

.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--text-dim); border-bottom: 2px solid var(--text-dim); transform: translateY(-65%) rotate(45deg); pointer-events: none; }
select.select { appearance: none; padding-right: 36px; cursor: pointer; }

/* Strength meter */
.strength { height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; margin-top: 6px; }
.strength > span { display: block; height: 100%; border-radius: 999px; transition: width .3s var(--ease), background .3s; }

/* ----------------------------- Progress / Loading ---------------------- */
.progress { height: 8px; border-radius: 999px; background: var(--panel-3); overflow: hidden; position: relative; }
.progress > .bar { height: 100%; border-radius: 999px; background: var(--grad-brand); width: 0%; transition: width .35s var(--ease); position: relative; }
.progress > .bar.animated::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shimmer 1.4s infinite;
}
.progress--thin { height: 5px; }
.progress--lg { height: 12px; }
.progress.indeterminate > .bar { width: 35% !important; animation: indet 1.3s var(--ease) infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.usage-bar { height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.usage-bar > span { display: block; height: 100%; background: var(--grad-brand); border-radius: 999px; }

/* Spinner */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .7s linear infinite; }
.spinner--lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loader */
.skeleton { background: linear-gradient(100deg, var(--panel-2) 30%, var(--panel-3) 50%, var(--panel-2) 70%); background-size: 200% 100%; animation: skel 1.3s infinite; border-radius: 8px; }
@keyframes skel { to { background-position: -200% 0; } }

/* progress ring (circular) */
.ring { transform: rotate(-90deg); }
.ring__bg { fill: none; stroke: var(--panel-3); }
.ring__fg { fill: none; stroke: url(#gradRing); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }

/* ----------------------------- Gauge ------------------------------------ */
.gauge { position: relative; display: inline-grid; place-items: center; }
.gauge__num { position: absolute; text-align: center; }
.gauge__num b { font-size: 26px; font-weight: 750; display: block; line-height: 1; }
.gauge__num span { font-size: 11px; color: var(--text-dim); }

/* ----------------------------- Tables ----------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--glass); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.highlight { background: var(--grad-brand-soft); }
.tbl tr.highlight td:first-child { box-shadow: inset 3px 0 0 var(--brand-violet); }

.rank-badge { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--panel-3); color: var(--text-dim); }
.rank-badge.gold { background: var(--grad-brand); color: #fff; }

/* ----------------------------- Avatars ---------------------------------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--panel-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--bg); margin-left: -10px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* Logo tile (brand initial) */
.logo-tile { border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }

/* ----------------------------- Tabs ------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab { padding: 12px 16px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); position: relative; white-space: nowrap; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: #fff; }
.tab.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2.5px; border-radius: 3px; background: var(--grad-brand); }

/* ----------------------------- Platform icon tiles ---------------------- */
.platform-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.platform-ico svg { width: 20px; height: 20px; }
.pf-tiktok { background: #010101; color: #fff; }
.pf-instagram { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.pf-x { background: #000; color: #fff; }
.pf-youtube { background: #FF0000; color: #fff; }
.pf-facebook { background: #1877F2; color: #fff; }
.pf-linkedin { background: #0A66C2; color: #fff; }
.pf-google { background: #fff; color: #4285F4; }
.pf-gbp { background: #34A853; color: #fff; }
.pf-meta { background: #0866FF; color: #fff; }

/* ----------------------------- Misc layout ------------------------------ */
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2,1fr); }
.g-3 { grid-template-columns: repeat(3,1fr); }
.g-4 { grid-template-columns: repeat(4,1fr); }
.row { display: flex; gap: 16px; }
.row--wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center { align-items: center; }
.middle { align-items: center; justify-content: center; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.flex-1 { flex: 1; } .flex-none { flex: none; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 16px 0; border: none; }
.hidden { display: none !important; }
.text-c { text-align: center; }
.cols-span-2 { grid-column: span 2; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr 360px; gap: 18px; align-items: start; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.two-col--even { grid-template-columns: 1fr 1fr; }

/* checklist */
.checklist { display: flex; flex-direction: column; gap: 10px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; }
.check-row .ic { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; margin-top: 1px; }
.check-row .ic.ok { background: var(--green-dim); color: var(--green); }
.check-row .ic.bad { background: var(--red-dim); color: var(--red); }
.check-row .ic.warn { background: var(--amber-dim); color: var(--amber); }
.check-row .fix { margin-left: auto; color: var(--brand-violet); font-weight: 600; font-size: 12px; }

/* priority list */
.prio { display: flex; flex-direction: column; gap: 10px; }
.prio__item { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--border); transition: border-color .15s; }
.prio__item:hover { border-color: var(--border-2); }
.prio__num { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--grad-brand-soft); color: #cdd6ff; font-weight: 700; font-size: 12px; flex: none; }
.prio__t { font-weight: 600; font-size: 13px; }
.prio__d { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* activity feed */
.feed { display: flex; flex-direction: column; }
.feed__item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.feed__item:last-child { border-bottom: none; }
.feed__dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--grad-brand-soft); color: #cdd6ff; }
.feed__t { font-size: 13px; font-weight: 550; }
.feed__time { font-size: 11.5px; color: var(--text-faint); }

/* post preview card */
.post-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.post-card__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.post-card__media { aspect-ratio: 1/1; background: var(--panel-3); position: relative; overflow: hidden; }
.post-card__body { padding: 12px 14px; }

/* map */
.mini-map { border-radius: var(--radius); overflow: hidden; position: relative; background:
  linear-gradient(0deg, rgba(11,15,26,.4), rgba(11,15,26,.4)),
  repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 40px),
  repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 40px),
  linear-gradient(135deg, #10203a, #0c1426); min-height: 240px; }
.map-pin { position: absolute; transform: translate(-50%,-100%); }
.map-pin .pin-dot { width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--grad-brand); box-shadow: var(--glow-brand); }
.map-pin.me .pin-dot { animation: pulse 1.8s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(123,92,255,.5);} 50% { box-shadow: 0 0 0 12px rgba(123,92,255,0);} }

/* donut center label */
.donut-wrap { position: relative; display: grid; place-items: center; }
.donut-center { position: absolute; text-align: center; }
.donut-center b { font-size: 22px; font-weight: 750; }

/* ----------------------------- Toasts ----------------------------------- */
.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 12px; min-width: 280px; max-width: 380px; padding: 14px 16px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); animation: toastIn .3s var(--ease); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast__ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.toast__ic.ok { background: var(--green-dim); color: var(--green); }
.toast__ic.info { background: var(--grad-brand-soft); color: #cdd6ff; }
.toast__ic.err { background: var(--red-dim); color: var(--red); }
.toast__t { font-weight: 650; font-size: 13.5px; }
.toast__d { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ----------------------------- Modals ----------------------------------- */
.modal-scrim { position: fixed; inset: 0; z-index: 150; background: rgba(5,8,15,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 24px; opacity: 0; visibility: hidden; transition: opacity .2s; }
.modal-scrim.open { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 520px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); transform: translateY(12px) scale(.98); transition: transform .25s var(--ease); max-height: 88vh; overflow-y: auto; }
.modal-scrim.open .modal { transform: none; }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal__body { padding: 22px; }
.modal__foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.modal__close { margin-left: auto; color: var(--text-dim); width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.modal__close:hover { background: var(--glass); color: #fff; }
.modal--wide { max-width: 720px; }

/* ----------------------------- Animations ------------------------------- */
.fade-in { animation: fadeIn .5s var(--ease) both; }
.rise-in { animation: riseIn .55s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } }
.stagger > * { animation: riseIn .5s var(--ease) both; }
.stagger > *:nth-child(1){animation-delay:.04s}.stagger > *:nth-child(2){animation-delay:.09s}.stagger > *:nth-child(3){animation-delay:.14s}.stagger > *:nth-child(4){animation-delay:.19s}.stagger > *:nth-child(5){animation-delay:.24s}.stagger > *:nth-child(6){animation-delay:.29s}.stagger > *:nth-child(7){animation-delay:.34s}.stagger > *:nth-child(8){animation-delay:.39s}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .01ms !important; } }

/* pulse glow used on "AI working" nodes */
.glow-pulse { animation: glowPulse 2s infinite; }
@keyframes glowPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(154,60,252,.5); } 50% { box-shadow: 0 0 24px 6px rgba(154,60,252,.25); } }

/* ----------------------------- Responsive ------------------------------- */
@media (max-width: 1240px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid > .span-right { grid-column: span 2; }
}
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2,1fr); }
  .two-col, .two-col--even { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 248px; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.5); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--glass); border: 1px solid var(--border); }
  .dashboard-grid, .g-3 { grid-template-columns: 1fr; }
  .dashboard-grid > .span-right { grid-column: auto; }
}
@media (max-width: 680px) {
  .g-2, .g-4 { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar { padding: 0 14px; }
  .hide-sm { display: none !important; }
}

/* ===================== Marketing site ===================== */
.mkt-nav { position: sticky; top: 0; z-index: 40; display:flex; align-items:center; justify-content:space-between; gap:20px; padding: 14px 28px; background: rgba(11,15,26,.72); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border); }
.mkt-nav__brand img { height: 32px; }
.mkt-nav__links { display:flex; gap:22px; }
.mkt-nav__links a { color: var(--text-dim); font-size: 14px; font-weight: 500; transition:.15s; }
.mkt-nav__links a:hover { color:#fff; }
/* Marketing page sections (.mkt-hero/.mkt-section/.mkt-features/.mkt-pricing/…)
   are styled by each marketing view's own <style> block — only the shared
   nav + footer chrome lives here. */
.mkt-footer { border-top:1px solid var(--border); margin-top: 40px; padding: 44px 28px 28px; position:relative; z-index:1; }
.mkt-footer__cols { max-width:1180px; margin:0 auto; display:grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; }
.mkt-footer h4 { font-size:13px; margin-bottom:12px; }
.mkt-footer a { display:block; color: var(--text-dim); font-size:13px; padding: 4px 0; }
.mkt-footer a:hover { color:#fff; }
.mkt-footer__bar { max-width:1180px; margin: 28px auto 0; padding-top: 18px; border-top:1px solid var(--border); font-size:12px; }
@media (max-width: 920px){ .mkt-footer__cols{grid-template-columns:1fr 1fr;} }
@media (max-width: 600px){ .mkt-footer__cols{grid-template-columns:1fr;} }

/* Injected inline icons (<i data-ico="…">) — keep text-sized, never balloon.
   Fixes loose icons expanding to fill their container (global svg{display:block}). */
[data-ico]{display:inline-flex;align-items:center;justify-content:center;line-height:0;vertical-align:middle}
[data-ico]>svg{width:1em;height:1em;display:block}
.stat__icon[data-ico]>svg,.feed__dot[data-ico]>svg,.prio__num[data-ico]>svg{width:1.1em;height:1.1em}

/* ===== Responsive hardening (override inline grid-template-columns) ===== */
.view{overflow-x:clip}
.main,.view>*,.grid>*,.dash-cols>*,.two-col>*,.two-col--even>*{min-width:0}
.table-wrap{overflow-x:auto}
@media (max-width:1180px){ .dash-cols{grid-template-columns:1fr !important} }
@media (max-width:1024px){ .two-col,.two-col--even{grid-template-columns:1fr !important} }
@media (max-width:900px){ [style*="grid-template-columns"]{grid-template-columns:1fr !important} }

/* ============================================================================
   Skill-guided UX / accessibility pass (ui-ux-pro-max)
   ========================================================================== */
/* Visible keyboard focus rings (High: Focus States, Keyboard Navigation) */
a:focus-visible, button:focus-visible, .btn:focus-visible, .chip:focus-visible,
.nav-item:focus-visible, .tab:focus-visible, .segmented button:focus-visible,
[tabindex]:focus-visible, summary:focus-visible, [data-toggle-company]:focus-visible,
[data-modal-open]:focus-visible {
  outline: 2px solid #9AB4FF; outline-offset: 2px; border-radius: 10px;
}
.switch input:focus-visible + .track { outline: 2px solid #9AB4FF; outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
/* Pressed feedback (Medium: Active States) */
.btn:active { transform: translateY(1px); }
/* Skip link (Medium: Skip Links) */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 300; background: var(--panel-2);
  color: #fff; border: 1px solid var(--border-2); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.skip-link:focus { left: 12px; }
/* Anchor targets clear the sticky nav (Medium: Sticky Navigation) */
:target { scroll-margin-top: 88px; }
/* Mobile: 16px inputs (prevent iOS zoom), 44px tap targets, readable body
   (High: Readable Font Size, Touch Target Size, Touch Friendly) */
@media (max-width: 680px) {
  .input, .select, select.select, textarea.input, .search input { font-size: 16px; }
  .btn, .btn--icon, .chip, .nav-item, .tab, .segmented button, .dropdown__item { min-height: 44px; }
  body { font-size: 15px; }
}

/* Spacing utilities that were referenced in views but missing (fixes cramped boxes) */
.gap-2 { gap: 2px; }
.gap-14 { gap: 14px; }
.gap-18 { gap: 18px; }
.mt-4 { margin-top: 4px; }
.mt-18 { margin-top: 18px; }
.mb-4 { margin-bottom: 4px; }
.mb-18 { margin-bottom: 18px; }
/* ============================================================================
   LIVE DATA — connect state (shown when a source has no real credential)
   ========================================================================== */
.connect-hero{ position:relative; max-width:640px; margin:32px auto; padding:40px 34px; text-align:center;
  background:var(--panel); border:1px solid var(--border); border-radius:20px; overflow:hidden; }
.connect-hero__glow{ position:absolute; inset:-1px -1px auto -1px; height:130px; pointer-events:none;
  background:radial-gradient(420px 130px at 50% -30%, rgba(23,92,247,.30), transparent 70%),
             radial-gradient(360px 120px at 70% -20%, rgba(154,60,252,.22), transparent 70%); }
.connect-hero__icon{ position:relative; width:62px; height:62px; margin:0 auto 16px; display:grid; place-items:center;
  border-radius:16px; color:#fff; background:var(--grad-brand); box-shadow:0 10px 30px rgba(23,92,247,.35); }
.connect-hero__title{ position:relative; font-size:22px; font-weight:700; letter-spacing:-.01em; }
.connect-hero__desc{ position:relative; margin:8px auto 0; max-width:460px; color:var(--text-dim); font-size:14px; line-height:1.55; }
.connect-hero__points{ position:relative; list-style:none; margin:20px auto 4px; padding:0; max-width:420px;
  display:grid; gap:10px; text-align:left; }
.connect-hero__points li{ display:flex; align-items:flex-start; gap:10px; font-size:13.5px; color:var(--text); }
.connect-hero__check{ flex:none; width:20px; height:20px; margin-top:1px; display:grid; place-items:center; border-radius:6px;
  color:var(--green); background:var(--green-dim); }
.connect-hero__cta{ position:relative; margin-top:24px; display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
.connect-hero__note{ position:relative; margin-top:16px; font-size:12px; color:var(--text-faint); }

/* Partial "connect to unlock" banner (used when some cards are live, others need a source) */
.connect-banner{ display:flex; align-items:center; gap:12px; padding:12px 14px; border-radius:12px;
  background:linear-gradient(90deg, rgba(23,92,247,.12), rgba(154,60,252,.10)); border:1px solid rgba(23,92,247,.25);
  color:var(--text); font-size:13px; margin-bottom:16px; }
.connect-banner .btn{ margin-left:auto; }

/* "Live" / "Stale" data pills for connected pages */
.live-pill{ display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; padding:3px 9px;
  border-radius:999px; background:var(--green-dim); color:var(--green); }
.live-pill::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--green); box-shadow:0 0 0 0 rgba(56,224,138,.6); animation:livePulse 2s infinite; }
.live-pill--stale{ background:rgba(255,194,75,.14); color:var(--amber); }
.live-pill--stale::before{ background:var(--amber); animation:none; }
@keyframes livePulse{ 0%{box-shadow:0 0 0 0 rgba(56,224,138,.55)} 70%{box-shadow:0 0 0 6px rgba(56,224,138,0)} 100%{box-shadow:0 0 0 0 rgba(56,224,138,0)} }
