/* =============================================
   BSC Portal — Design System
   ============================================= */

:root {
  /* Palette */
  --ink:        #1a1a2e;
  --ink-soft:   #4a4a6a;
  --ink-muted:  #8888aa;
  --surface:    #f7f7fb;
  --surface-2:  #eeeef6;
  --white:      #ffffff;
  --accent:     #D01D5A;
  --accent-soft:#fde8ef;
  --accent-dark:#a8164a;
  --success:    #22c55e;
  --success-soft:#dcfce7;
  --warn:       #f59e0b;
  --warn-soft:  #fef3c7;
  --danger:     #ef4444;
  --danger-soft:#fee2e2;

  /* Priority colours */
  --high:       #ef4444;
  --high-soft:  #fee2e2;
  --med:        #f59e0b;
  --med-soft:   #fef3c7;
  --low:        #6b7280;
  --low-soft:   #f3f4f6;

  /* Type */
  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body:    'Poppins', system-ui, sans-serif;

  /* Spacing */
  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 1px 3px rgba(26,26,46,0.08), 0 4px 16px rgba(26,26,46,0.06);
  --shadow-lg:  0 8px 32px rgba(26,26,46,0.12);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--surface); color: var(--ink); line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }

/* =============================================
   LOGIN PAGE
   ============================================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0f2ff 0%, #f7f7fb 60%, #fff0f5 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-body);
}

.brand-mark {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: var(--surface-2);
}

.brand-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.login-card {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  text-align: center;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
}

.login-sub {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--white);
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s ease;
  box-shadow: var(--shadow);
}

.btn-google:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateY(-1px);
}

.btn-google:active { transform: translateY(0); }

.login-note {
  font-size: 0.775rem;
  color: var(--ink-muted);
}

.login-footer {
  display: flex;
  gap: 0.5rem;
  font-size: 0.775rem;
  color: var(--ink-muted);
  align-items: center;
}

.dot { color: var(--surface-2); }

/* =============================================
   PORTAL LAYOUT (post-login)
   ============================================= */

.portal-page { background: var(--surface); min-height: 100vh; }

/* Topbar */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--surface-2);
  padding: 0 2rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 0.75rem; }

.topbar-brand {
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
}

.topbar-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  object-fit: cover;
}

.btn-signout {
  font-size: 0.8rem;
  color: var(--ink-muted);
  background: none;
  border: 1px solid var(--surface-2);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s;
}

.btn-signout:hover { border-color: var(--danger); color: var(--danger); }

/* Main content */
.portal-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* =============================================
   CHECKLIST PAGE
   ============================================= */

/* Product input bar */
.checklist-meta {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 200px;
}

.meta-field label {
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.meta-field input, .meta-field select {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s;
}

.meta-field input:focus, .meta-field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

/* Progress bar */
.progress-bar-wrap {
  background: var(--surface-2);
  border-radius: 999px;
  height: 6px;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #7c9eff);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

/* Section cards */
.checklist-section {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--surface-2);
  transition: background 0.1s;
}

.section-header:hover { background: var(--surface); }

.section-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-num {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.section-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.section-progress {
  font-size: 0.8rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--ink-muted);
  transition: transform 0.2s;
}

.section-header.open .chevron { transform: rotate(180deg); }

.section-body {
  padding: 0.5rem 0;
}

/* Checklist items */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.75rem 1.5rem;
  transition: background 0.1s;
}

.checklist-item:hover { background: var(--surface); }

.checklist-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.item-content { flex: 1; }

.item-text {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.5;
}

.item-text.checked {
  color: var(--ink-muted);
  text-decoration: line-through;
}

.priority-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.priority-badge.high { background: var(--high-soft); color: var(--high); }
.priority-badge.med  { background: var(--med-soft);  color: var(--warn); }
.priority-badge.low  { background: var(--low-soft);  color: var(--low);  }

/* Notes field per section */
.section-notes {
  padding: 0.5rem 1.5rem 1rem;
}

.section-notes textarea {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-family: var(--font-body);
  color: var(--ink);
  resize: vertical;
  min-height: 70px;
  background: var(--surface);
  transition: border-color 0.15s;
}

.section-notes textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

.section-notes label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 0.4rem;
}

/* Action bar */
.action-bar {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 0.75rem 1.75rem;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,110,247,0.3);
}

.btn-secondary {
  padding: 0.75rem 1.75rem;
  background: var(--white);
  color: var(--ink-soft);
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.btn-secondary:hover { border-color: var(--ink-soft); }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: var(--white);
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  transition: transform 0.3s ease;
  z-index: 999;
  max-width: 320px;
}

.toast.show { transform: translateY(0); }
.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }

/* Past assessments table */
.assessments-table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 2.5rem;
}

.assessments-table-wrap h2 {
  font-size: 1rem;
  font-weight: 600;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--surface-2);
  color: var(--ink);
}

.assessments-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.assessments-table th {
  text-align: left;
  padding: 0.6rem 1.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--surface-2);
}

.assessments-table td {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--surface);
  color: var(--ink-soft);
}

.assessments-table tr:last-child td { border-bottom: none; }
.assessments-table tr:hover td { background: var(--surface); }

.score-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.score-pill.good { background: var(--success-soft); color: #15803d; }
.score-pill.fair { background: var(--warn-soft); color: #92400e; }
.score-pill.poor { background: var(--danger-soft); color: #991b1b; }

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.btn-reopen {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: none;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reopen:hover {
  background: var(--accent);
  color: var(--white);
}

/* =============================================
   HOME / LAUNCHPAD
   ============================================= */

.topbar-brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.topbar-brand-link:hover .topbar-brand {
  background: var(--accent);
  color: var(--white);
  transition: all 0.15s;
}

.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.home-header p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.home-date {
  font-size: 0.825rem;
  color: var(--ink-muted);
  text-align: right;
  padding-top: 0.4rem;
}

.launchpad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.launchpad-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  border: 1.5px solid transparent;
  transition: all 0.18s ease;
  position: relative;
}

.launchpad-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.launchpad-card--soon {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-content { flex: 1; }

.card-category {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 0.35rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.825rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.card-arrow {
  color: var(--accent);
  align-self: flex-end;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.18s ease;
}

.launchpad-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

.card-soon-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-2);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* Responsive */
@media (max-width: 600px) {
  .topbar { padding: 0 1rem; }
  .portal-main { padding: 1.5rem 1rem; }
  .checklist-meta { flex-direction: column; }
  .action-bar { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; text-align: center; }
  .launchpad-grid { grid-template-columns: 1fr; }
}

/* =============================================
   SHOPIFY ASSISTANT — CHAT UI
   ============================================= */

.assistant-intake {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.intake-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.intake-sub {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.intake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 600px) {
  .intake-grid { grid-template-columns: 1fr; }
}

/* Chat container */
.chat-container {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  height: calc(100vh - 240px);
  min-height: 500px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--surface-2);
  background: var(--white);
}

.chat-product-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  background: var(--surface);
}

.chat-message {
  display: flex;
  max-width: 85%;
}

.chat-message--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message--assistant {
  align-self: flex-start;
}

.chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink);
}

.chat-message--user .chat-bubble {
  background: var(--accent);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.chat-message--assistant .chat-bubble {
  background: var(--white);
  border: 1px solid var(--surface-2);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}

.chat-bubble code {
  font-family: monospace;
  font-size: 0.8rem;
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.chat-message--user .chat-bubble code {
  background: rgba(255,255,255,0.2);
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 0.875rem 1rem;
}

.chat-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-muted);
  animation: bounce 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* Input bar */
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--surface-2);
  background: var(--white);
}

.chat-input {
  flex: 1;
  padding: 0.65rem 0.875rem;
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--ink);
  resize: none;
  line-height: 1.5;
  background: var(--surface);
  transition: border-color 0.15s;
  max-height: 120px;
  overflow-y: auto;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--white);
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.chat-send-btn:hover { background: var(--accent-dark); transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* =============================================
   MODAL
   ============================================= */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--surface-2);
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.modal-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  padding: 0.25rem;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
}

.modal-close:hover { background: var(--surface-2); color: var(--ink); }

.modal-options { padding: 1rem; }

.modal-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  border: 1.5px solid var(--surface-2);
  transition: all 0.15s;
  margin-bottom: 0.5rem;
}

.modal-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.modal-option-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-option-content { flex: 1; }

.modal-option-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.modal-option-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.modal-divider {
  height: 1px;
  background: var(--surface-2);
  margin: 1rem 0;
}

.modal-option-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}

.modal-loading, .modal-empty {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.modal-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--surface-2);
  text-decoration: none;
  color: inherit;
  margin-bottom: 0.5rem;
  transition: all 0.15s;
}

.modal-session-row:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.session-info { display: flex; flex-direction: column; gap: 0.2rem; }

.session-product {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.session-meta {
  font-size: 0.775rem;
  color: var(--ink-muted);
}

.session-resume {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* Mark complete button */
.btn-complete {
  font-size: 0.8rem;
  font-weight: 600;
  color: #15803d;
  background: var(--success-soft);
  border: none;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-complete:hover { background: var(--success); color: var(--white); }

/* =============================================
   MARKETING DASHBOARD
   ============================================= */

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dash-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.dash-month-select {
  padding: 0.5rem 0.875rem;
  border: 1.5px solid var(--surface-2);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}

.dash-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.875rem;
}

/* Loading */
.dash-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.dash-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--surface-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.dash-error {
  background: var(--danger-soft);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  color: var(--danger);
  font-size: 0.875rem;
}

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border-left: 3px solid transparent;
}

.kpi-card.kpi-good { border-left-color: var(--success); }
.kpi-card.kpi-warn { border-left-color: var(--warn); }
.kpi-card.kpi-bad  { border-left-color: var(--danger); }

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.kpi-value {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

/* ROAS/PAAS bar */
.roas-bar {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

.roas-bar-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.roas-bar-item { display: flex; flex-direction: column; gap: 0.4rem; }

.roas-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--ink);
}

.roas-bar-label small { color: var(--ink-muted); font-weight: 400; }

.roas-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  position: relative;
  overflow: visible;
}

.roas-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.roas-fill.good { background: var(--success); }
.roas-fill.warn { background: var(--warn); }

.roas-target-line {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  background: var(--ink-muted);
  border-radius: 1px;
}

/* Campaign table */
.dash-table-wrap {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  min-width: 900px;
}

.dash-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--surface-2);
  white-space: nowrap;
}

.dash-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface);
  color: var(--ink-soft);
  white-space: nowrap;
}

.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--surface); }

.campaign-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.85rem;
}

.dash-table td.pos { color: #15803d; font-weight: 600; }
.dash-table td.neg { color: var(--danger); font-weight: 600; }

.dash-updated {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-top: 1rem;
  text-align: right;
}

/* Toggle group */
.toggle-group {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  padding: 0.4rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-btn.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.toggle-btn:hover:not(.active) { color: var(--ink); }

/* Growth indicators */
.growth-good { color: #15803d; font-weight: 600; }
.growth-bad  { color: var(--danger); font-weight: 600; }

/* Sub-tab group (inside All Time view) */
.sub-tab-group {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}

.sub-tab-btn {
  padding: 0.45rem 1rem;
  font-size: 0.825rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.sub-tab-btn.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sub-tab-btn:hover:not(.active) { color: var(--ink); }

/* =============================================
   INTEGRATIONS MAP
   ============================================= */

.integrations-section {
  margin-top: 2.5rem;
}

.integrations-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.integrations-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-2);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.legend-line {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 1.5px solid var(--ink-muted);
}

.legend-dashed {
  border-top: 1.5px dashed #c2c0d8;
}

/* =============================================
   INTEGRATIONS MAP PAGE
   ============================================= */

.integrations-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.integrations-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.zoom-hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-left: 0.5rem;
}

.integrations-canvas {
  width: 100%;
  height: 600px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  cursor: grab;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.integrations-viewport {
  width: 900px;
  height: 640px;
  position: relative;
  transform-origin: center center;
  transition: transform 0.05s linear;
  flex-shrink: 0;
}

.integrations-viewport svg {
  width: 100%;
  height: 100%;
  display: block;
}

.map-node:hover rect:first-of-type {
  filter: brightness(0.97);
}

.integrations-legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--surface-2);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.legend-line {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 1.5px solid var(--ink-muted);
}

.legend-dashed {
  border-top: 1.5px dashed #c2c0d8;
}

/* Node info panel */
.node-info-panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-top: 1.25rem;
  position: relative;
}

.node-info-panel h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
  padding-right: 2rem;
}

.node-info-panel p {
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .integrations-canvas { height: 420px; }
}

/* =============================================
   DASHBOARD CHAT WIDGET (floating)
   ============================================= */

.dash-chat-fab {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 150;
  transition: all 0.2s ease;
}

.dash-chat-fab:hover {
  background: var(--accent-dark);
  transform: scale(1.06);
}

.dash-chat-panel {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 6rem);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 160;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: all 0.18s ease;
}

.dash-chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dash-chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.125rem;
  border-bottom: 1px solid var(--surface-2);
  background: var(--white);
  flex-shrink: 0;
}

.dash-chat-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.dash-chat-close {
  background: none;
  border: none;
  color: var(--ink-muted);
  padding: 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
}

.dash-chat-close:hover { background: var(--surface-2); color: var(--ink); }

.dash-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--surface);
}

.dash-chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--surface-2);
  background: var(--white);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .dash-chat-panel {
    right: 1rem;
    bottom: 1rem;
    width: calc(100vw - 2rem);
  }
  .dash-chat-fab {
    right: 1.25rem;
    bottom: 1.25rem;
  }
}
