/* ── Searchboost Opti Dashboard — Futuristic Edition ────────── */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --pink:        #db007f;
  --pink-light:  #ea1e84;
  --pink-glow:   rgba(219, 0, 127, 0.4);
  --pink-soft:   #fdf2f8;
  --pink-pale:   rgba(234, 30, 132, 0.08);
  --neon-pink:   #ff2d9b;
  --neon-blue:   #00d4ff;
  --neon-purple: #a855f7;
  --dark:        #0a0a0f;
  --dark-card:   #12121a;
  --dark-surface: #1a1a25;
  --dark-border: rgba(255, 255, 255, 0.06);
  --gray-700:    #a1a1aa;
  --gray-500:    #71717a;
  --gray-300:    #3f3f46;
  --white:       #fafafa;
  --green:       #22c55e;
  --green-glow:  rgba(34, 197, 94, 0.3);
  --yellow:      #eab308;
  --red:         #ef4444;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(219, 0, 127, 0.15), 0 4px 24px rgba(0, 0, 0, 0.4);
  --glass:       rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  /* Aliases for form styles */
  --border: var(--dark-border);
  --muted: var(--gray-500);
  --accent: var(--pink);
  --bg: var(--dark-surface);
  --text: var(--white);
  --card: var(--dark-card);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  background: var(--dark);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated background ───────────────────────────────────── */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(219, 0, 127, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.04) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* ── Grid lines overlay ────────────────────────────────────── */

/* Grid overlay removed — caused repaint lag on scroll */

/* ── Header ────────────────────────────────────────────────── */

.header {
  background: rgba(10, 10, 15, 0.95);
  border-bottom: 1px solid var(--dark-border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(219, 0, 127, 0.3), rgba(0, 212, 255, 0.2), transparent);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 68px;
  gap: 32px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.logo-img {
  height: 54px;
  width: auto;
  filter: brightness(1.1);
}

.logo-link:hover .logo-img {
  filter: brightness(1.3);
}

.logo-text {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  color: var(--gray-500);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  position: relative;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  animation: pulse 2s infinite;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.5);
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
  animation: none;
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* ── Main ──────────────────────────────────────────────────── */

.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Stats ─────────────────────────────────────────────────── */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 24px 24px 20px;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gray-300), transparent);
  transition: background 0.3s;
}

/* Individual stat card accent colors */
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--neon-pink), transparent); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--neon-blue), transparent); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--green), transparent); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--yellow), transparent); }

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
}

.stat-card:nth-child(1):hover { border-color: rgba(255, 45, 155, 0.3); }
.stat-card:nth-child(2):hover { border-color: rgba(0, 212, 255, 0.3); }
.stat-card:nth-child(3):hover { border-color: rgba(34, 197, 94, 0.3); }
.stat-card:nth-child(4):hover { border-color: rgba(234, 179, 8, 0.3); }

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.stat-card:nth-child(1) .stat-icon { background: rgba(255, 45, 155, 0.12); }
.stat-card:nth-child(2) .stat-icon { background: rgba(0, 212, 255, 0.12); }
.stat-card:nth-child(3) .stat-icon { background: rgba(34, 197, 94, 0.12); }
.stat-card:nth-child(4) .stat-icon { background: rgba(234, 179, 8, 0.12); }

.stat-value {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--white);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 12px;
  font-family: 'IBM Plex Mono', monospace;
}

.stat-trend--up {
  color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.stat-trend--down {
  color: var(--red);
  background: rgba(239, 68, 68, 0.1);
}

.stat-trend--neutral {
  color: var(--gray-500);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Cards ─────────────────────────────────────────────────── */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 18px 24px;
  border-bottom: 1px solid var(--dark-border);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title::before {
  content: '';
  width: 4px;
  height: 18px;
  background: linear-gradient(to bottom, var(--neon-pink), var(--neon-blue));
  border-radius: 2px;
}

.card-body {
  padding: 16px 24px 24px;
}

.empty {
  color: var(--gray-500);
  font-size: 0.88rem;
  text-align: center;
  padding: 40px 0;
  font-family: 'IBM Plex Mono', monospace;
}

/* ── List items ────────────────────────────────────────────── */

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--dark-border);
  transition: background 0.15s;
  border-radius: 8px;
  margin: 0 -14px;
}

.list-item:last-child { border-bottom: none; }

.list-item:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.06);
}

.list-item-left {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-sub {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 3px;
  font-family: 'IBM Plex Mono', monospace;
}

.list-item-right {
  margin-left: 16px;
  flex-shrink: 0;
}

/* ── Tags ──────────────────────────────────────────────────── */

.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

.tag--metadata { background: rgba(219, 0, 127, 0.15); color: var(--neon-pink); border-color: rgba(219, 0, 127, 0.2); }
.tag--links { background: rgba(0, 212, 255, 0.1); color: var(--neon-blue); border-color: rgba(0, 212, 255, 0.2); }
.tag--schema { background: rgba(168, 85, 247, 0.1); color: var(--neon-purple); border-color: rgba(168, 85, 247, 0.2); }
.tag--content { background: rgba(255, 255, 255, 0.05); color: var(--gray-700); border-color: rgba(255, 255, 255, 0.1); }
.tag--high { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.tag--medium { background: rgba(234, 179, 8, 0.15); color: #facc15; border-color: rgba(234, 179, 8, 0.2); }
.tag--low { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-color: rgba(34, 197, 94, 0.2); }
.tag--pending { background: rgba(234, 179, 8, 0.1); color: var(--yellow); border-color: rgba(234, 179, 8, 0.15); }
.tag--completed { background: rgba(34, 197, 94, 0.1); color: var(--green); border-color: rgba(34, 197, 94, 0.15); }

/* ── Customer card ─────────────────────────────────────────── */

.customer-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--dark-border);
  transition: background 0.15s;
  border-radius: var(--radius-sm);
  margin: 0 -14px;
}

.customer-item:last-child { border-bottom: none; }
.customer-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.customer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink), var(--neon-purple));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.customer-info {
  flex: 1;
  min-width: 0;
}

.customer-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
}

.customer-url {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Table ─────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--dark-border);
}

.data-table td {
  font-size: 0.85rem;
  padding: 12px 14px;
  border-bottom: 1px solid var(--dark-border);
  color: var(--gray-700);
}

.data-table tr {
  transition: background 0.2s;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: var(--white);
}

.data-table tbody tr {
  border-left: 3px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.data-table tbody tr:hover {
  border-left-color: var(--neon-pink);
}

.data-table td a {
  color: var(--neon-pink);
  text-decoration: none;
}

.data-table td a:hover {
  text-decoration: underline;
}

/* ── Report card ───────────────────────────────────────────── */

.report-card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.report-card:hover {
  border-color: rgba(219, 0, 127, 0.3);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.report-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--white);
}

.report-meta {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Scrollbar ─────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--dark);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--pink);
}

/* ── Footer ────────────────────────────────────────────────── */

footer {
  text-align: center;
  padding: 40px 24px;
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
  position: relative;
}

.footer-gradient {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-pink), var(--neon-blue), var(--neon-purple), transparent);
  margin-bottom: 0;
}

/* ── Login ─────────────────────────────────────────────────── */

.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--dark);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.login-box {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 360px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-box h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 4px;
}

.login-box h1 .login-brand {
  background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-sub {
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

.login-box input + input {
  margin-top: 12px;
}

.login-box input {
  width: 100%;
  padding: 12px 16px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.9rem;
  font-family: 'IBM Plex Sans', sans-serif;
  outline: none;
  transition: border-color 0.3s;
}

.login-box input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 12px var(--pink-glow);
}

.login-box button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-box button:hover {
  opacity: 0.9;
}

.login-error {
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 12px;
  display: none;
}

/* ── Logout button ────────────────────────────────────────── */

.btn-logout {
  background: none;
  border: 1px solid var(--gray-300);
  color: var(--gray-500);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 12px;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── Customer Detail ───────────────────────────────────────── */

.detail-back {
  margin-bottom: 20px;
}

.detail-back a {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.detail-back a:hover {
  color: var(--neon-pink);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 28px;
}

.detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--pink), var(--neon-purple));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--pink-glow);
}

.detail-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
}

.detail-url {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
  margin: 4px 0 10px;
}

.detail-integrations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.detail-badge {
  font-size: 0.75rem;
  color: var(--gray-700);
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  padding: 3px 10px;
  border-radius: 20px;
}

.stats-row--3 {
  grid-template-columns: repeat(3, 1fr);
}

.customer-item--clickable {
  cursor: pointer;
}

.customer-item--clickable:hover {
  background: rgba(219, 0, 127, 0.04);
  border-radius: var(--radius-sm);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
}

.customer-arrow {
  color: var(--gray-500);
  font-size: 1.4rem;
  font-weight: 300;
  transition: color 0.2s, transform 0.2s;
}

.customer-item--clickable:hover .customer-arrow {
  color: var(--neon-pink);
  transform: translateX(4px);
}

/* ── Rankings ──────────────────────────────────────────────── */

.ranking-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.rank-pos {
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
}

.rank-top3 { color: #22c55e; text-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
.rank-top10 { color: #4ade80; }
.rank-top30 { color: var(--yellow); }

.rank-up {
  color: var(--green);
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

.rank-down {
  color: var(--red);
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
}

.rank-same {
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
}

.ranking-source {
  color: var(--gray-500);
  font-size: 0.8rem;
  margin: -8px 0 12px 0;
}

.rank-cat {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.75rem;
}

.cat-a {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

.cat-b {
  background: rgba(234, 179, 8, 0.2);
  color: var(--yellow);
}

.cat-c {
  background: rgba(156, 163, 175, 0.2);
  color: var(--gray-400);
}

/* ── Pipeline Kanban ──────────────────────────────────────── */

.pipeline-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  min-height: 200px;
}

.kanban-col {
  min-width: 180px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.kanban-header {
  border-top: 3px solid var(--gray-300);
  padding: 10px 12px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--dark-surface);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Pipeline stage accent colors */
.kanban-col:nth-child(1) .kanban-header { border-top-color: var(--gray-500); }
.kanban-col:nth-child(2) .kanban-header { border-top-color: var(--yellow); }
.kanban-col:nth-child(3) .kanban-header { border-top-color: var(--neon-blue); }
.kanban-col:nth-child(4) .kanban-header { border-top-color: var(--neon-pink); }
.kanban-col:nth-child(5) .kanban-header { border-top-color: var(--green); }
.kanban-col:nth-child(6) .kanban-header { border-top-color: var(--neon-purple); }

.kanban-title {
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--white);
}

.kanban-count {
  font-size: 0.72rem;
  background: var(--dark-border);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--gray-700);
}

.kanban-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: rgba(255,255,255,0.01);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid var(--dark-border);
  border-top: none;
}

.kanban-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
  border-color: var(--pink);
}

.kanban-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--white);
  margin-bottom: 2px;
}

.kanban-card-url {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.kanban-empty {
  font-size: 0.78rem;
  color: var(--gray-500);
  text-align: center;
  padding: 20px 0;
}

/* ── Contract bar ────────────────────────────────────────── */

.contract-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(16,185,129,0.06));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
}

.contract-item {
  font-size: 0.85rem;
  color: var(--gray-700);
}
.contract-item strong {
  color: var(--white);
}

/* ── Budget bar ──────────────────────────────────────────── */

.budget-bar {
  margin-bottom: 16px;
  padding: 12px 20px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
}

.budget-label {
  font-size: 0.82rem;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.budget-track {
  height: 8px;
  background: var(--dark-border);
  border-radius: 4px;
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--neon-blue));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ── Action plan ─────────────────────────────────────────── */

.plan-month {
  margin-bottom: 20px;
}

.plan-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.plan-month-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  margin: 0;
}

.plan-progress {
  font-size: 0.78rem;
  color: var(--gray-500);
}

.plan-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.plan-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--dark-surface);
  border-radius: 6px;
  border: 1px solid var(--dark-border);
  font-size: 0.82rem;
}

.plan-task--completed {
  opacity: 0.6;
}

.plan-task-status {
  flex-shrink: 0;
}

.plan-task-desc {
  flex: 1;
  color: var(--gray-700);
}

/* ── Manual Input Forms ────────────────────────────────────── */

.manual-input-card { position: relative; }

.tab-bar {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 10px 20px; border: none; background: none; cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.form-label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); margin-bottom: 6px; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 0.88rem;
  resize: vertical;
}
.form-textarea:focus { outline: none; border-color: var(--accent); }

.form-input, .form-select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-size: 0.82rem;
  font-family: 'IBM Plex Sans', sans-serif;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--accent); }
.form-input { min-width: 0; }

.form-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.radio-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.85rem; cursor: pointer;
}

/* Issue rows */
.issue-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px;
  flex-wrap: wrap;
}
.issue-row .form-input { flex: 1; min-width: 120px; }
.issue-row .form-select { min-width: 100px; }
.issue-row .issue-desc { flex: 2; }

/* Keyword rows */
.kw-group { margin-bottom: 16px; }
.kw-group h4 { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.kw-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 4px;
}
.kw-num {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  width: 28px; text-align: center; flex-shrink: 0;
}
.kw-row .kw-word { flex: 1; }

/* Worklog rows */
.worklog-row {
  margin-bottom: 10px; padding: 8px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg);
}
.worklog-row-top, .worklog-row-bottom {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.worklog-row-top { margin-bottom: 6px; }
.worklog-row .worklog-desc { flex: 2; min-width: 180px; }
.worklog-row .worklog-url { flex: 1; min-width: 120px; }
.worklog-row .form-select { min-width: 100px; }

/* Plan task rows */
.plan-month-group { margin-bottom: 20px; }
.plan-month-group h4 { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.plan-task-row {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px;
  flex-wrap: wrap;
}
.plan-task-row .plan-desc { flex: 2; min-width: 180px; }
.plan-task-row .form-select { min-width: 90px; }

/* Buttons */
.btn-primary {
  padding: 10px 24px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600;
  font-size: 0.88rem; cursor: pointer; transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; }

.btn-secondary {
  padding: 10px 24px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--text); font-weight: 600;
  font-size: 0.88rem; cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-small {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--muted); font-size: 0.78rem;
  cursor: pointer; transition: all 0.2s;
}
.btn-small:hover { border-color: var(--accent); color: var(--accent); }
.btn-add { margin-top: 4px; }
.btn-remove { border-color: #e74c3c; color: #e74c3c; padding: 4px 8px; }
.btn-remove:hover { background: #e74c3c; color: #fff; }

/* Save status */
.save-status { font-size: 0.82rem; margin-left: 8px; }
.save-status.saving { color: var(--muted); }
.save-status.saved { color: #2ecc71; }
.save-status.error { color: #e74c3c; }

/* Audit existing */
.audit-summary-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 16px;
}
.audit-pre {
  white-space: pre-wrap; font-size: 0.85rem; color: var(--text);
  margin: 8px 0 0 0; max-height: 200px; overflow-y: auto;
}

/* Source badges */
.source-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.72rem; padding: 2px 6px; border-radius: 4px;
  font-weight: 600;
}
.source-badge--gsc { background: rgba(66,133,244,0.15); color: #4285f4; }
.source-badge--manual { background: rgba(155,89,182,0.15); color: #9b59b6; }
.source-badge--se_ranking { background: rgba(46,204,113,0.15); color: #27ae60; }
.source-badge--auto { background: rgba(52,152,219,0.15); color: #3498db; }

/* ── Search input ─────────────────────────────────────────── */
.search-input {
  margin-bottom: 12px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  color: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  width: 100%;
  max-width: 320px;
}
.search-input:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(219, 0, 127, 0.2);
}
.search-input::placeholder { color: var(--gray-500); }

/* ── Card title row ──────────────────────────────────────── */
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title-row .card-title { margin-bottom: 0; }

/* ── Prospect form ───────────────────────────────────────── */
.prospect-form {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

/* ── Stage controls ──────────────────────────────────────── */
.stage-controls {
  margin-bottom: 16px;
}
.stage-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.stage-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 600;
  margin-right: 4px;
}
.stage-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--dark-border);
  background: var(--dark-card);
  color: var(--gray-700);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.stage-btn:hover:not(:disabled) {
  border-color: var(--pink);
  color: var(--white);
  background: rgba(219, 0, 127, 0.1);
}
.stage-btn--active {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
  cursor: default;
}
.stage-btn:disabled {
  opacity: 0.9;
}
.stage-contract-fields {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 8px;
}

/* ── Contract expiry warnings ────────────────────────────── */
.contract-bar--expiring {
  border-color: var(--yellow) !important;
  background: rgba(234, 179, 8, 0.08) !important;
}
.contract-bar--expired {
  border-color: var(--red) !important;
  background: rgba(239, 68, 68, 0.08) !important;
}
.text-warning { color: var(--yellow); font-weight: 700; }

/* Kanban card expiry */
.kanban-card--expiring {
  border-left: 3px solid var(--yellow) !important;
}
.kanban-card--expired {
  border-left: 3px solid var(--red) !important;
}

/* ── Save status animation ───────────────────────────────── */
.save-status.saved {
  animation: saveFlash 0.4s ease;
}
@keyframes saveFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── Domain Analysis Card ─────────────────────────────────── */

.domain-analysis-card {
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--dark-card), rgba(219, 0, 127, 0.04));
  border: 1px solid rgba(219, 0, 127, 0.15);
}

.domain-input-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.domain-input-row .form-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-family: 'IBM Plex Mono', monospace;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.domain-input-row .form-input:focus {
  outline: none;
  border-color: var(--neon-pink);
  box-shadow: 0 0 16px var(--pink-glow);
}

.domain-input-row .form-input::placeholder {
  color: var(--gray-500);
  font-family: 'IBM Plex Sans', sans-serif;
}

.domain-input-row .btn-primary {
  padding: 12px 28px;
  font-size: 0.92rem;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
  transition: opacity 0.2s;
}

.domain-input-row .btn-primary:hover {
  opacity: 0.9;
}

/* ── Analysis Loading ─────────────────────────────────────── */

.analysis-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 0;
  font-size: 0.92rem;
  color: var(--gray-700);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--dark-border);
  border-top-color: var(--neon-pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Analysis Result Grid ─────────────────────────────────── */

.analysis-result-grid {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: start;
  padding-top: 16px;
}

@media (max-width: 768px) {
  .analysis-result-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

/* ── Score Circle ─────────────────────────────────────────── */

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  position: relative;
  background: var(--dark-surface);
  border: 3px solid var(--gray-300);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  transition: border-color 0.5s, box-shadow 0.5s;
}

.score-circle small {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.score-circle.score-good {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 24px var(--green-glow);
}

.score-circle.score-ok {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 24px rgba(234, 179, 8, 0.3);
}

.score-circle.score-bad {
  border-color: var(--red);
  color: var(--red);
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.3);
}

/* ── Analysis Pitch ───────────────────────────────────────── */

.analysis-pitch {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-pitch h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.analysis-pitch p {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.6;
  margin: 0;
}

.analysis-issues-summary {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.analysis-issues-summary span {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.issues-critical {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.issues-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.issues-info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ── Analysis Cost Box ────────────────────────────────────── */

.analysis-cost-box {
  text-align: center;
  padding: 16px 20px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  min-width: 160px;
}

.analysis-cost-box small {
  display: block;
  font-size: 0.72rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.analysis-cost-box .cost-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--green);
  text-shadow: 0 0 12px var(--green-glow);
}

.analysis-cost-box .cost-tier {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 4px;
}

.analysis-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.analysis-actions .btn-primary {
  flex: 1;
}

/* ── Next Action Card ─────────────────────────────────────── */

.next-action-card {
  margin-bottom: 24px;
}

.next-action-inner {
  padding: 20px 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(219, 0, 127, 0.06), rgba(0, 212, 255, 0.04));
  border: 1px solid rgba(219, 0, 127, 0.2);
  position: relative;
  overflow: hidden;
}

.next-action-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
}

.next-action-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.next-action-icon {
  font-size: 1.5rem;
}

.next-action-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
}

.next-action-desc {
  font-size: 0.88rem;
  color: var(--gray-700);
  margin-bottom: 16px;
  line-height: 1.5;
}

.next-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.next-action-buttons .btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
  padding: 10px 24px;
}

.next-action-buttons .btn-primary:hover {
  opacity: 0.9;
}

.next-action-buttons .btn-secondary {
  padding: 10px 24px;
}

/* ── Analysis Summary Card ────────────────────────────────── */

.analysis-summary-card {
  margin-bottom: 24px;
}

.analysis-summary-grid {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  align-items: center;
}

.analysis-summary-grid .score-circle {
  width: 80px;
  height: 80px;
  font-size: 1.6rem;
}

.analysis-summary-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.analysis-summary-text h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.analysis-summary-text p {
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin: 0;
}

.analysis-summary-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: 'IBM Plex Mono', monospace;
}

/* ── Cost Editor Card ─────────────────────────────────────── */

.cost-editor-card {
  margin-bottom: 24px;
}

.cost-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.cost-editor-total label,
.cost-editor-tier label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.cost-input-large {
  width: 100%;
  padding: 12px 16px;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-family: 'IBM Plex Mono', monospace;
  text-align: right;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.cost-input-large:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 12px var(--green-glow);
}

.cost-editor-tier .form-select {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.92rem;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--white);
}

.cost-breakdown {
  margin-bottom: 16px;
}

.cost-breakdown h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.cost-line-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cost-line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.cost-line-item span:first-child {
  color: var(--gray-700);
}

.cost-line-item span:last-child {
  font-weight: 600;
  color: var(--white);
  font-family: 'IBM Plex Mono', monospace;
}

.cost-editor-actions {
  display: flex;
  gap: 10px;
}

.cost-editor-actions .btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--pink), var(--pink-light));
}

/* ── Order Form Card ──────────────────────────────────────── */

.order-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.order-form-grid label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.order-form-grid .form-select,
.order-form-grid .form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
}

@media (max-width: 768px) {
  .order-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Startup Form Card ────────────────────────────────────── */

.startup-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.startup-form-grid label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.startup-form-grid .form-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 0.88rem;
}

@media (max-width: 768px) {
  .startup-form-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Activate Card ────────────────────────────────────────── */

.activate-card {
  border: 1px solid var(--green) !important;
  background: linear-gradient(135deg, var(--dark-card), rgba(16, 185, 129, 0.04));
}

.activate-inner {
  text-align: center;
  padding: 12px 0;
}

.activate-inner h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 8px;
}

.activate-inner p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin: 0 0 20px;
}

.activate-inner .btn-primary {
  background: linear-gradient(135deg, var(--green), #059669);
  padding: 14px 40px;
  font-size: 1rem;
  transition: opacity 0.2s;
}

.activate-inner .btn-primary:hover {
  opacity: 0.9;
}

/* ── Salesperson Select ───────────────────────────────────── */

.salesperson-select {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-size: 0.82rem;
  padding: 5px 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s;
}

.salesperson-select:focus {
  outline: none;
  border-color: var(--neon-pink);
}

/* ── Kanban Card Tags ─────────────────────────────────────── */

.kanban-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.kanban-tag {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.kanban-tag--score {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.kanban-tag--score.score-bad {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.15);
}

.kanban-tag--score.score-ok {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border-color: rgba(234, 179, 8, 0.15);
}

.kanban-tag--cost {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.15);
  font-family: 'IBM Plex Mono', monospace;
}

.kanban-tag--salesperson {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.15);
}

/* ── Presentation Card Standalone ─────────────────────────── */

.presentation-standalone {
  margin-bottom: 24px;
}

/* ── General Form Enhancements ────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-group .form-input,
.form-group .form-select {
  width: 100%;
}

/* ── Hidden utility ───────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .stats-row--3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .stat-value { font-size: 2rem; }
  .detail-header { flex-direction: column; text-align: center; }
  .detail-integrations { justify-content: center; }
  .pipeline-kanban { flex-direction: column; }
  .kanban-col { min-width: unset; }
  .contract-bar { flex-direction: column; gap: 8px; }
  .domain-input-row { flex-direction: column; }
  .domain-input-row .btn-primary { width: 100%; }
  .analysis-result-grid { grid-template-columns: 1fr; justify-items: center; }
  .analysis-summary-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .cost-editor-row { grid-template-columns: 1fr; }
  .next-action-buttons { flex-direction: column; }
  .next-action-buttons .btn-primary,
  .next-action-buttons .btn-secondary { width: 100%; text-align: center; }
  .issue-row, .plan-task-row, .worklog-row-top, .worklog-row-bottom { flex-direction: column; align-items: stretch; }
  .issue-row .form-input, .issue-row .form-select { min-width: unset; }
  .tab-bar { overflow-x: auto; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .stage-row { flex-wrap: wrap; }
  .search-input { max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .nav-link { font-size: 0.78rem; padding: 6px 12px; }
}

/* ── Onboarding Status ── */
.health-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

.onboard-summary {
  font-size: 14px;
}

.onboarding-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.onboarding-row td {
  padding: 10px 12px;
  vertical-align: middle;
}

.missing-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin: 1px 3px;
}

/* ── WP Connection Test ── */
.wp-test-ok {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  font-size: 14px;
  line-height: 1.6;
}

.wp-test-fail {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  font-size: 14px;
  line-height: 1.6;
}

.wp-test-fail em {
  color: #94a3b8;
  font-style: normal;
}

/* ── Performance Gauges ───────────────────────────────────── */

.gauge-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.gauge-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.gauge-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.gauge-chart {
  width: 100%;
  min-height: 180px;
}

.gauge-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.gauge-delta {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 6px;
  min-height: 20px;
}

.gauge-delta.positive { color: var(--green); }
.gauge-delta.negative { color: var(--red); }
.gauge-delta.neutral  { color: var(--gray-500); }

@media (max-width: 768px) {
  .gauge-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .gauge-row { grid-template-columns: 1fr; }
  .gauge-chart { min-height: 150px; }
}

/* ── Touchpoints (kontaktytor) ─────────────────────────────── */

.touchpoints-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.touchpoints-row.touchpoints-mock {
  opacity: 0.5;
}

.touchpoint-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.touchpoint-card:hover {
  border-color: var(--pink);
  box-shadow: 0 0 16px rgba(219, 0, 127, 0.1);
}

.touchpoint-card--total {
  border-color: rgba(219, 0, 127, 0.2);
  background: linear-gradient(135deg, var(--dark-card) 0%, rgba(219, 0, 127, 0.05) 100%);
}

.touchpoint-icon {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.touchpoint-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.touchpoint-card--total .touchpoint-value {
  color: var(--neon-pink);
}

.touchpoint-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.touchpoint-sparkline {
  margin-top: 8px;
  min-height: 35px;
}

@media (max-width: 768px) {
  .touchpoints-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .touchpoints-row { grid-template-columns: 1fr; }
}

/* ── AI Analytics Chat ─────────────────────────────────────── */

.ai-chat-card {
  margin: 16px 0;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 20px;
}

.ai-chat-messages {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
}

.ai-chat-hint {
  color: var(--gray-500);
  font-size: 0.8rem;
  font-style: italic;
  padding: 8px 0;
}

.ai-chat-msg {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 85%;
  word-break: break-word;
}

.ai-chat-msg--user {
  background: rgba(219, 0, 127, 0.12);
  color: var(--white);
  align-self: flex-end;
  border: 1px solid rgba(219, 0, 127, 0.2);
}

.ai-chat-msg--ai {
  background: var(--dark-surface);
  color: var(--white);
  align-self: flex-start;
  border: 1px solid var(--dark-border);
}

.ai-chat-msg--loading {
  background: var(--dark-surface);
  color: var(--gray-500);
  align-self: flex-start;
  border: 1px solid var(--dark-border);
  animation: ai-pulse 1.2s ease-in-out infinite;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.ai-chat-msg--error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--red);
  align-self: flex-start;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 0.8rem;
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-chat-input-row .form-input {
  flex: 1;
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input-row .form-input:focus {
  border-color: var(--pink);
}

.ai-chat-input-row .btn-primary {
  white-space: nowrap;
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* ── Ads Dashboard ─────────────────────────────── */
.ads-dashboard-card {
  margin-top: 16px;
}
.ads-spend-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.ads-platform-card {
  background: var(--dark-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  opacity: 0.5;
}
.ads-platform-card.active {
  opacity: 1;
  border-color: rgba(233,30,140,0.3);
}
.ads-platform-card.active:hover {
  border-color: var(--pink);
  box-shadow: 0 0 16px rgba(233,30,140,0.15);
}
.ads-platform-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4285f4, #34a853);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.ads-platform-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ads-platform-name {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ads-platform-spend {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
}
.ads-platform-metrics {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: #888;
}
.ads-total-bar {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(233,30,140,0.06);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #ccc;
}
.ads-total-bar strong {
  color: var(--pink);
}
@media (max-width: 768px) {
  .ads-spend-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .ads-spend-grid { grid-template-columns: 1fr; }
}

/* ── Role-based UI ──────────────────────────────────────────── */

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-right: 8px;
}

.role-badge--sales {
  background: linear-gradient(135deg, rgba(219, 0, 127, 0.15), rgba(168, 85, 247, 0.15));
  color: var(--neon-pink);
  border: 1px solid rgba(219, 0, 127, 0.25);
}

.role-badge--tech {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(34, 197, 94, 0.15));
  color: var(--neon-blue);
  border: 1px solid rgba(0, 212, 255, 0.25);
}

.nav-link.nav-primary {
  position: relative;
}
.nav-link.nav-primary::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--neon-pink);
}
[data-role="tech"] .nav-link.nav-primary::after {
  background: var(--neon-blue);
}

/* ── Tech overview cards (system health) ────────────────────── */

.system-health-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.health-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.health-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.health-card--ok::before { background: var(--green); }
.health-card--warn::before { background: var(--yellow); }
.health-card--error::before { background: var(--red); }

.health-card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.health-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
}

.health-card-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .system-health-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Sales overview (pipeline summary) ─────────────────────── */

.sales-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.sales-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
}

.sales-card-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.sales-card-value--pink { color: var(--neon-pink); }
.sales-card-value--blue { color: var(--neon-blue); }
.sales-card-value--green { color: var(--green); }

.sales-card-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

@media (max-width: 640px) {
  .sales-summary-row { grid-template-columns: 1fr; }
}
