/* panels.css — MB21 c4 consolidation
 *
 * Side panel (.panel, #panel, account-panel-v2 internals), batch action bar
 * (.bab-*), dash-config-drawer. Persistent UI surfaces that aren't modals
 * but live above the page plane.
 *
 * Receives migrated rules per the c4 classification rubric. The #panel
 * !important rescue is documented but DEFERRED (per c3 M4 investigation).
 */



/* === migrated from components-base.css === */
/* ============================================================
   PANEL — right-drawer (account panel, contact detail panel)

   base.css defines .panel with the same semantics; this restates as
   .panel-shell for naming consistency with .modal-shell. base.css's
   .panel rules continue to work for now; migrate at MB1 build time.
   ============================================================ */
.panel-shell.is-open { transform: translateX(0); }

@media (max-width: 540px) {
  .panel-shell { max-width: 100%; padding: var(--space-5); }
}

/* === migrated from styles-additions-v33.css === */
/* Config drawer */
.dash-config-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 90vw);
  background: var(--surface-card, #fff);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  /* MB21 c3: migrated from numeric z=10006 to token. Side-drawer layout uses top/right/height/width — NOT compatible with fmn-modal-overlay's inset:0, so we keep the structural rules and just adopt --z-modal for the layer value. */
  z-index: var(--z-modal, 1010);
  padding: 20px;
  overflow: auto;
  transform: translateX(100%);
  transition: transform 200ms ease-out;
}

.dash-config-drawer[data-open="true"] {
  transform: translateX(0);
}

.dash-config-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.dash-config-drawer-title {
  font-weight: 700;
  font-size: 16px;
}

/* === migrated from styles-additions-v32.css === */
/* =============================================================
 * 3. Contact panels identity (M2a)
 * ============================================================= */
/* Account panel contact rows get pill treatment for names */
.tcpanel-contacts-row,
.tcpr-contact-row {
  padding: var(--space-2, 8px) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  border-bottom: 1px solid var(--border-subtle, #f0f0f0);
}

.tcpanel-contacts-row:last-child,
.tcpr-contact-row:last-child {
  border-bottom: none;
}

/* === migrated from styles-additions-v24.css === */
/* =============================================================
 * 6. BatchActionBar — sticky bottom action bar
 * ============================================================= */
.bab-mount {
  position: fixed;
  bottom: var(--space-3, 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  pointer-events: none;
  width: max-content;
  max-width: 94vw;
}

.bab-mount.bab-visible { pointer-events: auto; }

.bab-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: 10px 16px;
  background: var(--text-primary, #171717);
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: bab-slide-in 200ms ease-out;
}

@keyframes bab-slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.bab-count-pill {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.bab-action-list {
  display: flex;
  gap: var(--space-2, 8px);
}

.bab-action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1, 4px);
  padding: 8px 14px;
  min-height: 36px;
  background: var(--color-accent, #FFD500);
  color: #000;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.bab-action-btn:hover { background: #f0c700; }

.bab-cancel-btn {
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}

.bab-cancel-btn:hover { color: #fff; }

/* Adjust position when keyboard is up on mobile (avoid overlap) */
@media (max-width: 599px) {
  .bab-mount { bottom: var(--space-2, 8px); width: calc(100vw - 16px); }
  .bab-bar { width: 100%; justify-content: space-between; }
}

/* === migrated from styles-additions-v21.css === */
/* ============================================================
 * Sequence indicator pill on account panel
 * ============================================================ */
.tcpanel-sequence-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  margin-left: 8px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #1e40af;
}

.tcpanel-sequence-pill[hidden] { display: none; }

.tcpanel-sequence-pill.is-paused {
  background: rgba(107,114,128,0.08);
  border-color: rgba(107,114,128,0.3);
  color: #4b5563;
}

/* ============================================================
 * "+ Enroll in sequence" button on action bar
 * ============================================================ */
.tcpanel-action-sequence {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
}

.tcpanel-action-sequence:hover {
  background: var(--surface-hover, rgba(0,0,0,0.04));
  border-color: var(--text-tertiary);
}

/* === migrated from styles-additions-v19.css === */
/* ============================================================
   4. RUBRIC PANEL (rubric-panel.js)
   ============================================================ */
.rp-panel {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ============================================================
   6. SUGGESTED CHANGES PANEL (suggested-changes-panel.js)
   ============================================================ */
.sc-panel {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* === migrated from components.css === */
/* ---------- Config panel ---------- */
.ds-config-panel {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

/* ===== Touch list (in account panel) ===== */
.panel-touch-list {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #ebe7df;
}

.panel-touch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.panel-touch-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #888780;
}

.panel-touch-count {
  display: inline-block;
  margin-left: 6px;
  color: #b3b0a6;
  font-weight: 500;
}

.panel-touch-add {
  background: transparent;
  border: 1px solid #d8d6d0;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
  color: #1a1a1a;
}

.panel-touch-add:hover {
  background: #f7f5f1;
  border-color: #1a1a1a;
}

.panel-touch-empty {
  font-size: 13px;
  color: #b3b0a6;
  padding: 16px;
  text-align: center;
  background: #f7f5f1;
  border-radius: 6px;
}

.panel-touch-row {
  display: flex;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.panel-touch-row:hover {
  background: #f7f5f1;
}

.panel-touch-row-expanded .ptr-line-2 { display: none; }

.panel-touch-row-expanded .ptr-line-full { display: block; }

/* ============================================================
   SECTION — Touch-centric panel, edit modal, account picker (Sprint 2.2)
   Originally: styles-additions-v6.css
   ============================================================ */
/* ===== ROBUST PANEL SHOW/HIDE — fixes regression in 2.1 ===== */
/* Default closed state — panel hidden off-screen, overlay invisible */
/* MB21 c3 M4 investigation: the !important rescue layer on #panel
   and #panel-overlay was added in commit 89c910e ("UI Rework cleanup 1",
   2026-04-30) during a massive consolidation of v2-v10 styles into
   components.css. No surviving competing rule was found in the c3
   archaeology — base.css defines .panel at single-class specificity (0,1,0)
   and the only higher-specificity selectors on this element are these
   #panel rules themselves (1,0,0). The !important declarations are
   technically redundant: ID already beats class in the cascade.

   Additionally, base.css's .panel.is-open transform never activates
   because the JS uses .panel-open (not .is-open) to slide in.

   DEFERRED LIFT: keeping !important block for now since iPad UI test
   isn't available between MB21 commits. Recommend lifting in MB21 c4
   (CSS consolidation) when a fresh iPad QA pass can verify the panel
   still slides correctly without the rescue. Note: also fix the
   .panel.is-open dead rule in base.css at that time. */
#panel {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: -560px;
  width: 540px !important;
  max-width: 90vw !important;
  background: #fdfcf9 !important;
  z-index: 200 !important;
  overflow-y: auto !important;
  transition: right 0.25s cubic-bezier(.2,.7,.3,1) !important;
  box-shadow: -24px 0 48px rgba(0,0,0,0.18) !important;
  /* v0.34.0 - round the left edge (panel is anchored to the right, full height)
     so it stops clashing with the app's rounded, bubbly aesthetic. */
  border-top-left-radius: 18px !important;
  border-bottom-left-radius: 18px !important;
  visibility: visible !important;
  display: block !important;
  transform: none !important;
  opacity: 1 !important;
}

#panel.panel-open {
  right: 0 !important;
}

#panel-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,0.4) !important;
  z-index: 199 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s !important;
  visibility: visible !important;
  display: block !important;
}

#panel-overlay.panel-overlay-open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ===== Touch-centric panel ===== */
.tcpanel {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
}

.tcpanel-header {
  position: relative;
  padding: 28px 24px 20px;
  border-bottom: 1px solid #ebe7df;
}

.tcpanel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 0;
  font-size: 24px;
  color: #888780;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.tcpanel-close:hover { color: #1a1a1a; }

/* Pencil edit icon — small, unobtrusive */
.tcpanel-edit-btn {
  position: absolute;
  top: 22px;
  right: 56px;
  background: transparent;
  border: 0;
  font-size: 15px;
  color: #b3b0a6;
  cursor: pointer;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 4px;
  transition: all 0.12s;
}

.tcpanel-edit-btn:hover {
  color: #1a1a1a;
  background: #f7f5f1;
}

.tcpanel-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;            /* v0.34.1 - badges drop below the name pill
                                rather than squishing when the name is long */
  gap: 8px 10px;
  padding-right: 70px; /* leave room for close + edit buttons */
}

.tcpanel-watched-star {
  background: transparent;
  border: 0;
  font-size: 22px;
  color: #d8d6d0;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  transition: color 0.12s, transform 0.08s;
}

.tcpanel-watched-star:hover { transform: scale(1.1); }

.tcpanel-watched-on { color: #C49B3A; }

.tcpanel-name {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.2;
}

.tcpanel-meta {
  margin-top: 6px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #888780;
}

.tcpanel-meta-extra {
  margin-top: 4px;
  font-size: 12px;
  color: #6b6960;
  font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: 0;
  text-transform: none;
}

.tcpanel-meta-extra a {
  color: #1F5D9D;
  text-decoration: none;
}

.tcpanel-meta-extra a:hover { text-decoration: underline; }

/* Sections */
.tcpanel-section {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f0e9;
}

.tcpanel-section:last-child { border-bottom: 0; }

.tcpanel-section-label {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #888780;
}

/* At a glance — stats grid */
.tcpanel-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .tcpanel-stats { grid-template-columns: repeat(2, 1fr); }
}

.tcpanel-stat label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #b3b0a6;
  margin-bottom: 4px;
}

.tcpanel-stat strong {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.2;
}

.tcpanel-stat span {
  display: block;
  font-size: 11px;
  color: #888780;
  margin-top: 2px;
}

/* Revenue stream pills */
.tcpanel-streams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tcpanel-stream-pill {
  background: transparent;
  border: 1px solid #d8d6d0;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b6960;
  transition: all 0.12s;
}

.tcpanel-stream-pill:hover { border-color: #1a1a1a; }

.tcpanel-stream-on {
  --pill-color: var(--color-ink-700); /* Round 1 fallback when JS doesn't set inline */
  color: #1a1a1a;
  background: rgba(255, 255, 255, 0.6);
  border-color: var(--pill-color);
  box-shadow: inset 0 0 0 1px var(--pill-color);
}

.tcpanel-stream-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tcpanel-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #b3b0a6;
  font-style: italic;
}

/* Touch history section */
.tcpanel-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tcpanel-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tcpanel-history-count {
  display: inline-block;
  margin-left: 6px;
  color: #b3b0a6;
  font-weight: 500;
  font-size: 12px;
}

.tcpanel-history-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tcpanel-empty {
  padding: 32px 24px;
  text-align: center;
  font-size: 13px;
  color: #b3b0a6;
  background: #f7f5f1;
  border-radius: 6px;
}

.tcpanel-touch-row {
  display: flex;
  gap: 12px;
  padding: 12px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #f3f0e9;
}

.tcpanel-touch-row:hover { background: #f7f5f1; }

.tcpanel-touch-row:last-child { border-bottom: 0; }

.tcpanel-touch-row-expanded .tcpr-line-2 { display: none; }

.tcpanel-touch-row-expanded .tcpr-line-full { display: block; }

.tcpanel-touch-row:hover .tcpr-arrow {
  color: #1a1a1a;
  transform: translateX(2px);
}

/* ---------- Account panel: Quotes section ---------- */
.tcpanel-quotes-section {
  border-bottom: 1px solid #e6e1d5;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

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

.tcpanel-quotes-count {
  display: inline-block;
  padding: 1px 8px;
  background: #f3f0e9;
  color: #6b6960;
  border-radius: 10px;
  font-size: 0.78rem;
  margin-left: 6px;
  font-weight: 500;
}

.tcpanel-quotes-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tcpanel-quote-row {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  background: white;
  border: 1px solid #ece7db;
  cursor: pointer;
  transition: all 0.12s;
  align-items: center;
}

.tcpanel-quote-row:hover {
  background: #f7f4ec;
  border-color: #d8d2c4;
}

/* ============================================================
   Sprint 3.1 additions: outcome modal, action bars, interest badges
   ============================================================ */
/* ---------- Top action bar in account panel ---------- */
.tcpanel-action-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(to bottom, #faf6ec, #f7f4ec);
  border-bottom: 1px solid #e6e1d5;
  margin-bottom: 0;
}

.tcpanel-action-touch,
.tcpanel-action-quote {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
  border: 1px solid;
}

.tcpanel-action-touch {
  background: white;
  color: #1F5D9D;
  border-color: #B5D2EE;
}

.tcpanel-action-touch:hover {
  background: #1F5D9D;
  color: white;
  border-color: #1F5D9D;
}

.tcpanel-action-quote {
  background: #1D9E75;
  color: white;
  border-color: #1D9E75;
}

.tcpanel-action-quote:hover {
  background: #18815f;
  border-color: #18815f;
}

/* ============================================================
 * MB18 B1 — Account panel action bar → VAO buttons.
 * Scoped under .tcpanel-action-bar (specificity 0,2,0) so it wins
 * over the base rules here AND the v21 .tcpanel-action-sequence rule
 * regardless of stylesheet load order. CSS-only; markup unchanged.
 * ============================================================ */
.tcpanel-action-bar {
  background: #FFFFFF;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  gap: 8px;
  /* MB21 c8: allow wrap when narrow — "Enroll in sequence" was clipping off
     the right edge of the 540px panel. With flex-wrap + min-basis below, the
     4 buttons wrap to 2 rows of 2 at narrow widths. */
  flex-wrap: wrap;
}

.tcpanel-action-bar > button {
  /* MB21 c8: flex-basis 130px + min-width 130px = no clipping of "Enroll
     in sequence" label. Was `flex: 1` which let buttons squeeze below their
     content width. */
  flex: 1 1 130px;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

/* Compose email = filled-yellow hero */
.tcpanel-action-bar .tcpanel-action-email {
  background: #FFD500; color: #171717; border-color: #FFD500;
}

.tcpanel-action-bar .tcpanel-action-email:hover {
  background: #fcc500; border-color: #fcc500;
}

/* New quote = green accent (positive action) */
.tcpanel-action-bar .tcpanel-action-quote {
  background: #1D9E75; color: #FFFFFF; border-color: #1D9E75;
}

.tcpanel-action-bar .tcpanel-action-quote:hover {
  background: #18815f; border-color: #18815f;
}

/* Log activity + Enroll = outlined dark secondary */
.tcpanel-action-bar .tcpanel-action-touch,
.tcpanel-action-bar .tcpanel-action-sequence {
  background: #FFFFFF; color: #171717; border-color: #171717;
}

.tcpanel-action-bar .tcpanel-action-touch:hover,
.tcpanel-action-bar .tcpanel-action-sequence:hover {
  background: #f8f8f7;
}
/* ============================================================
 * MB25 c3 — contact panel: a few classes unique to ContactPanel.
 * (Stage chip, history rows, stats, ai-summary, action bar all
 * reuse the existing .tcpanel-* company-panel styles.)
 * ============================================================ */
.tcpanel-contact-role {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #FFD500;
  background: #171717;
  border-radius: 4px;
}
.tcpanel-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 7px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  font-size: 13px;
}
.tcpanel-detail-row:last-child { border-bottom: none; }
.tcpanel-detail-label { color: #888780; font-weight: 500; }
.tcpanel-detail-value { color: #171717; text-align: right; word-break: break-word; }
.cpanel-company-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
}
.cpanel-company-sub { color: #888780; font-size: 12px; margin-left: auto; }

/* ============================================================
   MB26 s5 — panel tabs (Overview / Profile & AI) + Profile block
   ============================================================ */
.tcpanel-tabs {
  display: flex;
  gap: 4px;
  justify-content: center;
  border-bottom: 1px solid var(--color-border, #E5E5E5);
  margin: 0 0 4px;
  padding: 0 2px;
}
.tcpanel-profile-edits { display: inline-flex; gap: 6px; }
.tcpanel-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #737373;
  cursor: pointer;
}
.tcpanel-tab:hover { color: #171717; }
.tcpanel-tab-active {
  color: #171717;
  border-bottom-color: #FFD500;
}
.tcpanel-tabpanel { display: none; }
.tcpanel-tabpanel-active { display: block; }

.tcpanel-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tcpanel-profile-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 12px;
}
.tcpanel-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.tcpanel-profile-k { color: #737373; flex: 0 0 auto; }
.tcpanel-profile-v { color: #171717; text-align: right; font-weight: 500; }
.tcpanel-profile-ai {
  background: #FAFAF8;
  border-left: 3px solid #6D28D9;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 8px 0;
}
.tcpanel-profile-ai-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6D28D9;
  margin-bottom: 4px;
}
.tcpanel-profile-ai p { margin: 0; font-size: 13px; line-height: 1.5; color: #404040; }
