/* ============================================================
   NEXTACTIX CLIENT PORTAL — v2.1.0
   Full-viewport standalone SaaS application CSS.
   No WordPress theme. No shortcodes. No headers/footers.
   ============================================================ */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --nx-primary:    #e0163a;
  --nx-primary-d:  #b30f2d;
  --nx-primary-l:  #ff2d55;
  --nx-navy:       #0d1b2e;
  --nx-navy-l:     #15293f;
  --nx-navy-ll:    #1e3553;
  --nx-accent:     #2563eb;
  --nx-accent-l:   #3b82f6;
  --nx-green:      #10b981;
  --nx-amber:      #f59e0b;
  --nx-red:        #ef4444;
  --nx-purple:     #8b5cf6;
  --nx-teal:       #14b8a6;

  /* Sidebar */
  --nx-sidebar-w:  260px;
  --nx-sidebar-bg: #0d1b2e;
  --nx-topbar-h:   64px;

  /* Surface */
  --nx-bg:         #f0f4f8;
  --nx-surface:    #ffffff;
  --nx-surface-2:  #f8fafc;
  --nx-border:     #e2e8f0;
  --nx-border-l:   #f1f5f9;

  /* Text */
  --nx-text:       #0f172a;
  --nx-text-2:     #475569;
  --nx-text-3:     #94a3b8;
  --nx-text-inv:   #ffffff;

  /* Radii */
  --nx-r-sm:  6px;
  --nx-r:     10px;
  --nx-r-lg:  16px;
  --nx-r-xl:  22px;
  --nx-r-full:9999px;

  /* Shadows */
  --nx-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --nx-shadow:    0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --nx-shadow-lg: 0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.06);
  --nx-shadow-xl: 0 24px 60px rgba(0,0,0,.20), 0 8px 24px rgba(0,0,0,.08);

  /* Typography */
  --nx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nx-font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --nx-ease: cubic-bezier(.4,0,.2,1);
  --nx-t:    200ms var(--nx-ease);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--nx-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--nx-text);
  background: var(--nx-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nxcp-body {
  overflow: hidden; /* Portal handles its own scroll */
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ── App Shell ────────────────────────────────────────────── */
.nxcp-shell {
  display: grid;
  grid-template-columns: var(--nx-sidebar-w) 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.nxcp-sidebar {
  background: var(--nx-sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.06);
}

/* Brand */
.nxcp-sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nxcp-sidebar-brand img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

/* Client info strip */
.nxcp-sidebar-client {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nxcp-sidebar-client-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nxcp-sidebar-client-pkg {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nxcp-sidebar-client-pkg span {
  display: inline-block;
  background: rgba(224,22,58,.25);
  color: #ff6b84;
  border: 1px solid rgba(224,22,58,.3);
  border-radius: var(--nx-r-full);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 8px;
  letter-spacing: .4px;
}

/* Navigation */
.nxcp-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.nxcp-nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nxcp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--nx-r);
  color: rgba(255,255,255,.6);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--nx-t);
  margin-bottom: 2px;
  white-space: nowrap;
}
.nxcp-nav-item:hover {
  color: #ffffff;
  background: rgba(255,255,255,.07);
}
.nxcp-nav-item.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(224,22,58,.35), rgba(224,22,58,.15));
  border: 1px solid rgba(224,22,58,.2);
  box-shadow: 0 2px 8px rgba(224,22,58,.15);
}
.nxcp-nav-item.active .nxcp-icon { color: var(--nx-primary); }
.nxcp-nav-item .nxcp-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nxcp-nav-item .nxcp-badge-count {
  margin-left: auto;
  background: var(--nx-primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--nx-r-full);
  min-width: 18px;
  text-align: center;
}

/* Sidebar footer */
.nxcp-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px;
}
.nxcp-sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--nx-r);
  margin-bottom: 4px;
}
.nxcp-sidebar-user-info strong {
  display: block;
  font-size: 12.5px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.nxcp-sidebar-user-info span {
  font-size: 11px;
  color: rgba(255,255,255,.4);
}
.nxcp-nav-item.nxcp-logout {
  color: rgba(255,255,255,.4);
  font-size: 13px;
}
.nxcp-nav-item.nxcp-logout:hover { color: #ff6b84; background: rgba(239,68,68,.1); }

/* ── Avatar ───────────────────────────────────────────────── */
.nxcp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-d));
  color: white;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  flex-shrink: 0;
  user-select: none;
}
.nxcp-avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.nxcp-avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ── Main Column ──────────────────────────────────────────── */
.nxcp-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--nx-bg);
}

/* ── Topbar ───────────────────────────────────────────────── */
.nxcp-topbar {
  height: var(--nx-topbar-h);
  min-height: var(--nx-topbar-h);
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  box-shadow: var(--nx-shadow-sm);
  z-index: 50;
}

.nxcp-topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r);
  padding: 8px 14px;
  flex: 1;
  max-width: 360px;
}
.nxcp-topbar-search .nxcp-icon { color: var(--nx-text-3); width: 16px; height: 16px; }
.nxcp-topbar-search input {
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--nx-text);
  outline: none;
  width: 100%;
}
.nxcp-topbar-search input::placeholder { color: var(--nx-text-3); }

.nxcp-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nxcp-topbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--nx-r);
  color: var(--nx-text-2);
  transition: var(--nx-t);
  position: relative;
}
.nxcp-topbar-icon-btn:hover { background: var(--nx-surface-2); color: var(--nx-text); }
.nxcp-topbar-icon-btn .nxcp-icon { width: 18px; height: 18px; }

.nxcp-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--nx-primary);
  border-radius: 50%;
  border: 2px solid var(--nx-surface);
}

.nxcp-topbar-pkg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(37,99,235,.05));
  border: 1px solid rgba(37,99,235,.2);
  border-radius: var(--nx-r-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--nx-accent);
}

.nxcp-topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: var(--nx-r);
  cursor: pointer;
  transition: var(--nx-t);
}
.nxcp-topbar-profile:hover { background: var(--nx-surface-2); }
.nxcp-topbar-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--nx-text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Content Area ─────────────────────────────────────────── */
.nxcp-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scroll-behavior: smooth;
}

/* ── Page Header ──────────────────────────────────────────── */
.nxcp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.nxcp-page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--nx-text);
  letter-spacing: -.4px;
}
.nxcp-page-header-sub {
  font-size: 14px;
  color: var(--nx-text-2);
  margin-top: 4px;
}
.nxcp-page-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nxcp-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r-full);
  font-size: 12.5px;
  padding: 5px 12px;
  color: var(--nx-text-2);
}
.nxcp-meta-pill strong { color: var(--nx-text); }

/* ── Preview Banner ───────────────────────────────────────── */
.nxcp-preview-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: var(--nx-r);
  padding: 10px 16px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 20px;
}

/* ── KPI Cards ────────────────────────────────────────────── */
.nxcp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.nxcp-kpi-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--nx-t);
  box-shadow: var(--nx-shadow-sm);
  position: relative;
  overflow: hidden;
}
.nxcp-kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(37,99,235,.02));
  pointer-events: none;
}
.nxcp-kpi-card:hover {
  border-color: rgba(37,99,235,.2);
  box-shadow: var(--nx-shadow);
  transform: translateY(-1px);
}

.nxcp-kpi-card--primary {
  background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-d));
  border-color: transparent;
  color: white;
}
.nxcp-kpi-card--primary .nxcp-kpi-lbl { color: rgba(255,255,255,.7); }
.nxcp-kpi-card--primary .nxcp-kpi-num { color: white; }
.nxcp-kpi-card--primary .nxcp-kpi-icon { background: rgba(255,255,255,.15); color: white; }

.nxcp-kpi-card--accent {
  background: linear-gradient(135deg, #1d4ed8, var(--nx-accent));
  border-color: transparent;
  color: white;
}
.nxcp-kpi-card--accent .nxcp-kpi-lbl { color: rgba(255,255,255,.7); }
.nxcp-kpi-card--accent .nxcp-kpi-num { color: white; }
.nxcp-kpi-card--accent .nxcp-kpi-icon { background: rgba(255,255,255,.15); color: white; }

.nxcp-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nxcp-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--nx-surface-2);
  border-radius: var(--nx-r);
  color: var(--nx-accent);
}
.nxcp-kpi-icon .nxcp-icon { width: 20px; height: 20px; }

.nxcp-kpi-num {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--nx-text);
}
.nxcp-kpi-num span { font-size: 16px; font-weight: 500; opacity: .6; }

.nxcp-kpi-lbl {
  font-size: 12.5px;
  color: var(--nx-text-2);
  font-weight: 500;
}

.nxcp-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--nx-r-full);
}
.nxcp-kpi-trend.up   { background: rgba(16,185,129,.1); color: #059669; }
.nxcp-kpi-trend.down { background: rgba(239,68,68,.1); color: #dc2626; }
.nxcp-kpi-trend.flat { background: var(--nx-surface-2); color: var(--nx-text-3); }
.nxcp-kpi-trend .nxcp-icon { width: 13px; height: 13px; }

/* ── Panel / Card ─────────────────────────────────────────── */
.nxcp-panel {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r-lg);
  overflow: hidden;
  box-shadow: var(--nx-shadow-sm);
  margin-bottom: 20px;
}
.nxcp-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--nx-border-l);
}
.nxcp-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--nx-text);
}
.nxcp-panel-header h3 small {
  font-size: 12px;
  color: var(--nx-text-3);
  margin-left: 6px;
  font-weight: 400;
}
.nxcp-panel-body {
  padding: 20px 22px;
}

/* ── Two-column layout ────────────────────────────────────── */
.nxcp-grid-2col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

/* ── Data Table ───────────────────────────────────────────── */
.nxcp-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.nxcp-data-table th {
  text-align: left;
  padding: 12px 22px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--nx-text-3);
  background: var(--nx-surface-2);
  border-bottom: 1px solid var(--nx-border-l);
}
.nxcp-data-table td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--nx-border-l);
  color: var(--nx-text);
  vertical-align: middle;
}
.nxcp-data-table tbody tr:last-child td { border-bottom: none; }
.nxcp-data-table tbody tr:hover td { background: var(--nx-surface-2); }
.nxcp-data-table a { color: var(--nx-accent); }
.nxcp-data-table a:hover { text-decoration: underline; }

/* ── Badge ────────────────────────────────────────────────── */
.nxcp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--nx-r-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: white;
  letter-spacing: .3px;
}

/* ── Rank Change ──────────────────────────────────────────── */
.nxcp-rank-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 13px;
}
.nxcp-rank-change.up   { color: #059669; }
.nxcp-rank-change.down { color: #dc2626; }
.nxcp-rank-change.flat { color: var(--nx-text-3); }
.nxcp-rank-change .nxcp-icon { width: 14px; height: 14px; }

/* ── Progress Bar ─────────────────────────────────────────── */
.nxcp-progress-track {
  height: 6px;
  background: var(--nx-border);
  border-radius: var(--nx-r-full);
  overflow: hidden;
  flex: 1;
}
.nxcp-progress-fill {
  height: 100%;
  border-radius: var(--nx-r-full);
  transition: width .5s var(--nx-ease);
}

/* ── Task List ────────────────────────────────────────────── */
.nxcp-task-list { display: flex; flex-direction: column; }
.nxcp-task-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--nx-border-l);
  transition: var(--nx-t);
}
.nxcp-task-row:last-child { border-bottom: none; }
.nxcp-task-row:hover { background: var(--nx-surface-2); }
.nxcp-task-info { flex: 1; min-width: 0; }
.nxcp-task-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--nx-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nxcp-task-meta { font-size: 12px; color: var(--nx-text-3); margin-top: 2px; }
.nxcp-task-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 160px;
  flex-shrink: 0;
}
.nxcp-progress-pct { font-size: 12px; font-weight: 600; color: var(--nx-text-2); min-width: 30px; text-align: right; }

/* ── Timeline ─────────────────────────────────────────────── */
.nxcp-timeline {
  padding: 8px 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nxcp-timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  position: relative;
}
.nxcp-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 30px;
  bottom: -14px;
  width: 1px;
  background: var(--nx-border);
}
.nxcp-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--nx-accent);
  border: 2px solid var(--nx-surface);
  box-shadow: 0 0 0 2px rgba(37,99,235,.2);
  flex-shrink: 0;
  margin-top: 3px;
}
.nxcp-timeline-body { flex: 1; min-width: 0; }
.nxcp-timeline-body strong { font-size: 13.5px; font-weight: 600; color: var(--nx-text); display: block; }
.nxcp-timeline-body p { font-size: 12.5px; color: var(--nx-text-2); margin-top: 2px; line-height: 1.4; }
.nxcp-timeline-time { font-size: 11.5px; color: var(--nx-text-3); margin-top: 4px; display: block; }

/* ── Service List ─────────────────────────────────────────── */
.nxcp-service-list { padding: 8px 22px 14px; display: flex; flex-direction: column; gap: 8px; }
.nxcp-service-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--nx-text);
}
.nxcp-service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Report Grid ──────────────────────────────────────────── */
.nxcp-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px 22px;
}
.nxcp-report-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border-l);
  border-radius: var(--nx-r);
  transition: var(--nx-t);
}
.nxcp-report-tile:hover { border-color: var(--nx-accent-l); box-shadow: var(--nx-shadow); }
.nxcp-report-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(37,99,235,.08);
  color: var(--nx-accent);
  border-radius: var(--nx-r);
  flex-shrink: 0;
}
.nxcp-report-icon .nxcp-icon { width: 22px; height: 22px; }
.nxcp-report-info { flex: 1; min-width: 0; }
.nxcp-report-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--nx-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nxcp-report-meta { font-size: 12px; color: var(--nx-text-3); margin-top: 2px; }
.nxcp-report-download {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--nx-accent);
  color: white;
  border-radius: var(--nx-r);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--nx-t);
}
.nxcp-report-download:hover { background: #1d4ed8; }

/* ── Ticket Thread ────────────────────────────────────────── */
.nxcp-ticket-thread {
  max-height: 340px;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.nxcp-thread-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.nxcp-thread-msg.staff { flex-direction: row-reverse; }
.nxcp-thread-bubble {
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border-l);
  border-radius: var(--nx-r-lg);
  padding: 12px 14px;
  max-width: 80%;
}
.nxcp-thread-msg.staff .nxcp-thread-bubble {
  background: linear-gradient(135deg, var(--nx-accent), #1d4ed8);
  color: white;
  border-color: transparent;
}
.nxcp-thread-sender {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--nx-text-3);
  margin-bottom: 4px;
}
.nxcp-thread-msg.staff .nxcp-thread-sender { color: rgba(255,255,255,.7); }
.nxcp-thread-text { font-size: 13.5px; line-height: 1.5; }
.nxcp-thread-time { font-size: 11px; color: var(--nx-text-3); margin-top: 4px; }
.nxcp-thread-msg.staff .nxcp-thread-time { color: rgba(255,255,255,.5); }

/* ── Empty state ──────────────────────────────────────────── */
.nxcp-empty {
  text-align: center;
  color: var(--nx-text-3);
  font-size: 13.5px;
  padding: 36px 20px;
}
.nxcp-empty strong { display: block; font-size: 15px; color: var(--nx-text-2); margin-bottom: 6px; }

/* ── Buttons ──────────────────────────────────────────────── */
.nxcp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--nx-r);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--nx-t);
  cursor: pointer;
  white-space: nowrap;
}
.nxcp-btn .nxcp-icon { width: 16px; height: 16px; }

.nxcp-btn-primary {
  background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-d));
  color: white;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(224,22,58,.25);
}
.nxcp-btn-primary:hover { background: var(--nx-primary-d); box-shadow: 0 4px 14px rgba(224,22,58,.35); }

.nxcp-btn-accent {
  background: linear-gradient(135deg, var(--nx-accent), #1d4ed8);
  color: white;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.nxcp-btn-accent:hover { opacity: .9; }

.nxcp-btn-outline {
  background: transparent;
  color: var(--nx-text-2);
  border: 1px solid var(--nx-border);
}
.nxcp-btn-outline:hover { border-color: var(--nx-text-2); color: var(--nx-text); background: var(--nx-surface-2); }

.nxcp-btn-sm { padding: 6px 13px; font-size: 12.5px; }
.nxcp-btn-danger { background: rgba(239,68,68,.1); color: #dc2626; border: 1px solid rgba(239,68,68,.2); }
.nxcp-btn-danger:hover { background: #dc2626; color: white; }

.nxcp-link-btn {
  color: var(--nx-accent);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.nxcp-link-btn:hover { text-decoration: underline; }

/* ── Quick Links ──────────────────────────────────────────── */
.nxcp-quicklink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--nx-text-2);
  border-bottom: 1px solid var(--nx-border-l);
  transition: var(--nx-t);
}
.nxcp-quicklink:last-child { border-bottom: none; }
.nxcp-quicklink:hover { background: var(--nx-surface-2); color: var(--nx-accent); }
.nxcp-quicklink .nxcp-icon { width: 18px; height: 18px; color: var(--nx-accent); flex-shrink: 0; }
.nxcp-quicklink-arrow { margin-left: auto; color: var(--nx-text-3); }

/* ── Score Chart Legend ───────────────────────────────────── */
.nxcp-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--nx-text-2);
}
.nxcp-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nxcp-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* ── Muted text ───────────────────────────────────────────── */
.nxcp-muted { color: var(--nx-text-3); font-size: 12.5px; }

/* ── Icon SVG ─────────────────────────────────────────────── */
.nxcp-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}

/* ── Modals ───────────────────────────────────────────────── */
.nxcp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.nxcp-modal {
  background: var(--nx-surface);
  border-radius: var(--nx-r-xl);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--nx-shadow-xl);
  position: relative;
}
.nxcp-modal-lg { max-width: 680px; }
.nxcp-modal h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--nx-text);
}
.nxcp-modal-sub { font-size: 13.5px; color: var(--nx-text-2); margin-bottom: 20px; }
.nxcp-modal label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nx-text);
  margin-bottom: 14px;
}
.nxcp-modal input,
.nxcp-modal select,
.nxcp-modal textarea {
  border: 1.5px solid var(--nx-border);
  border-radius: var(--nx-r);
  padding: 9px 13px;
  font-size: 14px;
  color: var(--nx-text);
  background: var(--nx-surface);
  outline: none;
  transition: border-color var(--nx-t);
  width: 100%;
}
.nxcp-modal input:focus,
.nxcp-modal select:focus,
.nxcp-modal textarea:focus { border-color: var(--nx-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.nxcp-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--nx-border-l);
}
.nxcp-modal-close-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--nx-text-3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: var(--nx-t);
}
.nxcp-modal-close-x:hover { background: var(--nx-surface-2); color: var(--nx-text); }

/* ── Form Grid ────────────────────────────────────────────── */
.nxcp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

/* ── Profile Page ─────────────────────────────────────────── */
.nxcp-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.nxcp-profile-hero {
  background: linear-gradient(135deg, var(--nx-navy), var(--nx-navy-l));
  border-radius: var(--nx-r-xl);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  color: white;
  margin-bottom: 24px;
}
.nxcp-profile-hero-name { font-size: 20px; font-weight: 700; }
.nxcp-profile-hero-company { font-size: 14px; color: rgba(255,255,255,.6); }
.nxcp-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--nx-border-l);
}
.nxcp-info-row:last-child { border-bottom: none; }
.nxcp-info-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--nx-text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  min-width: 130px;
}
.nxcp-info-value {
  font-size: 13.5px;
  color: var(--nx-text);
  font-weight: 500;
  flex: 1;
}

/* ── Campaign Progress ─────────────────────────────────────── */
.nxcp-progress-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 20px 22px;
}
.nxcp-progress-stage {
  text-align: center;
}
.nxcp-stage-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: conic-gradient(var(--nx-accent) calc(var(--pct) * 1%), var(--nx-border) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--nx-text);
  position: relative;
}
.nxcp-stage-circle::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--nx-surface);
  border-radius: 50%;
  z-index: 0;
}
.nxcp-stage-circle span { position: relative; z-index: 1; }
.nxcp-stage-name { font-size: 12px; color: var(--nx-text-2); font-weight: 500; }

/* ── Backlinks filter bar ─────────────────────────────────── */
.nxcp-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--nx-border-l);
  flex-wrap: wrap;
}
.nxcp-filter-bar input,
.nxcp-filter-bar select {
  border: 1.5px solid var(--nx-border);
  border-radius: var(--nx-r);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--nx-text);
  background: var(--nx-surface);
  outline: none;
}
.nxcp-filter-bar input:focus,
.nxcp-filter-bar select:focus { border-color: var(--nx-accent); }
.nxcp-filter-bar input { width: 220px; }

/* ── DR badge ─────────────────────────────────────────────── */
.nxcp-dr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 8px;
  background: var(--nx-navy);
  color: white;
  border-radius: var(--nx-r-full);
  font-size: 11.5px;
  font-weight: 700;
}
.nxcp-dr-badge.high   { background: #059669; }
.nxcp-dr-badge.medium { background: #d97706; }
.nxcp-dr-badge.low    { background: #94a3b8; }

/* ── Score circle ─────────────────────────────────────────── */
.nxcp-score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 800;
  color: white;
}

/* ── LOGIN PAGE ───────────────────────────────────────────── */
.nxcp-login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: var(--nx-surface);
}

/* Left: Visual / Brand */
.nxcp-login-visual {
  background: linear-gradient(155deg, #0d1b2e 0%, #0f2748 45%, #0e1f3d 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}
.nxcp-login-visual-content {
  position: relative;
  z-index: 2;
  max-width: 420px;
}
.nxcp-login-visual-logo {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
  margin-bottom: 48px;
}
.nxcp-login-visual h1 {
  font-size: 38px;
  font-weight: 800;
  color: white;
  line-height: 1.15;
  letter-spacing: -.8px;
  margin-bottom: 16px;
}
.nxcp-login-visual h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #ff6b84, var(--nx-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nxcp-login-visual p {
  font-size: 15.5px;
  color: rgba(255,255,255,.6);
  line-height: 1.65;
  margin-bottom: 40px;
}
.nxcp-login-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.nxcp-login-stat {
  text-align: center;
}
.nxcp-login-stat-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: white;
}
.nxcp-login-stat-lbl {
  font-size: 11.5px;
  color: rgba(255,255,255,.45);
  margin-top: 3px;
  display: block;
}
.nxcp-login-benefits {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nxcp-login-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255,255,255,.7);
}
.nxcp-login-benefit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nx-primary);
  flex-shrink: 0;
}

/* Glows */
.nxcp-login-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .35;
  pointer-events: none;
}
.nxcp-login-glow-1 {
  width: 400px; height: 400px;
  background: var(--nx-primary);
  top: -120px; right: -120px;
}
.nxcp-login-glow-2 {
  width: 300px; height: 300px;
  background: #4f46e5;
  bottom: -80px; left: -80px;
}

/* Right: Login Form */
.nxcp-login-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--nx-surface);
}
.nxcp-login-box {
  width: 100%;
  max-width: 420px;
}
.nxcp-login-box-header {
  text-align: center;
  margin-bottom: 36px;
}
.nxcp-login-box-logo {
  height: 38px;
  width: auto;
  margin: 0 auto 20px;
}
.nxcp-login-box-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--nx-text);
}
.nxcp-login-box-header p {
  font-size: 14px;
  color: var(--nx-text-2);
  margin-top: 6px;
}

.nxcp-login-form-body { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }

.nxcp-input-group { display: flex; flex-direction: column; gap: 6px; }
.nxcp-input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--nx-text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nxcp-input-group label .nxcp-icon { width: 15px; height: 15px; color: var(--nx-text-3); }
.nxcp-input-group input {
  border: 1.5px solid var(--nx-border);
  border-radius: var(--nx-r);
  padding: 11px 15px;
  font-size: 14.5px;
  color: var(--nx-text);
  background: var(--nx-surface);
  outline: none;
  transition: border-color var(--nx-t), box-shadow var(--nx-t);
  width: 100%;
}
.nxcp-input-group input:focus {
  border-color: var(--nx-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.nxcp-login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.nxcp-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--nx-text-2);
}
.nxcp-link {
  color: var(--nx-accent);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.nxcp-link:hover { text-decoration: underline; }
.nxcp-link-center { display: block; text-align: center; margin-top: 14px; }

.nxcp-form-alert {
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: var(--nx-r);
  color: #b91c1c;
  font-size: 13px;
  padding: 10px 14px;
  display: none;
}
.nxcp-form-alert.visible { display: block; }
.nxcp-form-success {
  background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--nx-r);
  color: #065f46;
  font-size: 13px;
  padding: 10px 14px;
  display: none;
}
.nxcp-form-success.visible { display: block; }

.nxcp-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--nx-primary), var(--nx-primary-d));
  color: white;
  border: none;
  border-radius: var(--nx-r);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--nx-t);
  box-shadow: 0 4px 14px rgba(224,22,58,.25);
  margin-top: 4px;
}
.nxcp-login-submit:hover { background: var(--nx-primary-d); box-shadow: 0 6px 20px rgba(224,22,58,.35); }
.nxcp-login-submit:disabled { opacity: .6; cursor: not-allowed; }
.nxcp-login-submit .nxcp-icon { width: 18px; height: 18px; }

.nxcp-access-card {
  background: var(--nx-surface-2);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-r-lg);
  padding: 20px;
  margin-top: 24px;
  text-align: center;
}
.nxcp-access-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.nxcp-access-card p { font-size: 12.5px; color: var(--nx-text-2); line-height: 1.5; margin-bottom: 14px; }
.nxcp-access-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--nx-navy);
  color: white;
  border-radius: var(--nx-r);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  transition: var(--nx-t);
}
.nxcp-access-btn:hover { background: #1e3553; }

.nxcp-login-footer {
  text-align: center;
  font-size: 12px;
  color: var(--nx-text-3);
  margin-top: 24px;
}

.nxcp-form-sub { font-size: 13.5px; color: var(--nx-text-2); margin-bottom: 16px; }

/* ── Scrollbar styling ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nx-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--nx-text-3); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .nxcp-grid-2col { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  :root { --nx-sidebar-w: 200px; }
  .nxcp-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .nxcp-profile-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nxcp-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .nxcp-sidebar { display: none; } /* Mobile: add hamburger menu later */
  .nxcp-main { height: 100vh; }
  .nxcp-login-page { grid-template-columns: 1fr; }
  .nxcp-login-visual { display: none; }
  .nxcp-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .nxcp-content { padding: 16px; }
  .nxcp-form-grid { grid-template-columns: 1fr; }
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes nx-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nxcp-content > * {
  animation: nx-fade-in .25s var(--nx-ease) both;
}

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

/* ── Utility ──────────────────────────────────────────────── */
.nxcp-d-none { display: none !important; }
