/* layout.css — MB21 c4 consolidation
 *
 * Page-level layout: centered 900px column, grid scaffolding, header/masthead,
 * nav rows, app shell containers. Anything that controls the structural frame
 * of the app (NOT individual surface visuals).
 *
 * Receives migrated rules from styles-additions-v11..v33.css and components.css
 * per the c4 classification rubric.
 */



/* === migrated from components-base.css === */
/* ============================================================
   PAGE HEADER — used by Email Outreach today, replicated for
   Companies / Contacts / Activities standalone pages in MB1
   ============================================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.page-header-back {
  /* uses .btn .btn-ghost .btn-sm */
}

.page-header-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 500;
  margin: 0;
  line-height: var(--leading-tight);
}

.page-header-subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
}

/* === migrated from styles-additions-v24.css === */
/* styles-additions-v24.css — MB8: Dashboard density + Contacts multi-select +
 * batch compose UI + batch history + composer cleanups
 *
 * Loaded AFTER v23.css. Cache buster v=190.
 *
 * Sections:
 *   1. Dashboard two-column layout (≥1100px) + responsive collapse
 *   2. AT A GLANCE density
 *   3. Watched cards grid
 *   4. SUMMARY table density
 *   5. Contacts list — checkbox column + multi-select rows
 *   6. BatchActionBar — sticky bottom action bar
 *   7. Composer batch-mode header (progress + prev/next)
 *   8. Advance prompt overlay
 *   9. Batch History tab UI
 *  10. Composer cleanups (drafts vertical stack)
 *  11. Batch attachment picker
 */
/* =============================================================
 * 1. Dashboard two-column layout (≥1100px)
 * ============================================================= */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4, 16px);
}

/* === migrated from styles-additions-v18.css === */
/* ============================================================
   2. PAGE-HEADER BREATHING ROOM (B6)

   Standalone pages (Companies / Contacts / Activities / Email
   Outreach) sit below the masthead + app-mode-nav. With 5 nav
   tabs after MB1, the spacing felt cramped right above the title.

   Add a margin-top so the header isn't crowding the nav above.
   ============================================================ */
.page-header {
  margin-top: var(--space-6, 24px);
}

@media (max-width: 720px) {
  /* On narrow viewports the nav is now full-width below the
     masthead; the title can sit closer because there's no
     visual collision. */
  .page-header {
    margin-top: var(--space-4, 16px);
  }
}

/* === migrated from styles-additions-v17.css === */
/* ============================================================
   styles-additions-v17.css — Mega-batch 2 feature styles

   Loads AFTER styles-additions-v16.css. Holds MB2-specific feature
   styling that doesn't generalize to a primitive.

   Sections:
     1. Page-header action button (.std-page-header-action)
     2. Activity picker modal (.acp-*)
     3. Contact edit modal account select (.cem-account-section)
     4. Email Outreach page header compose button
   ============================================================ */
/* ============================================================
   1. PAGE-HEADER ACTION BUTTON

   The "+ New" button rendered in the right side of standalone
   page headers (Companies / Contacts / Activities / Email Outreach).
   Sits next to the page title.
   ============================================================ */
.std-page-header-action {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--text-primary);
  color: var(--bg-page);
  border: 0;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: opacity var(--motion-fast) var(--easing-out);
}

.std-page-header-action:hover { opacity: 0.85; }

.std-page-header-action-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.std-page-header-action-secondary:hover {
  background: var(--bg-elev-2);
  opacity: 1;
}

/* Page-header layout adjustment so action button sits on the right */
.page-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.page-header-left {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* === migrated from styles-additions-v16.css === */
/* ============================================================
   2. STANDALONE PAGE CHROME

   Companies / Contacts / Activities pages. Pattern matches Email
   Outreach (which already has its own page-header in styles-additions-v13).
   These three new pages use the .page-header primitive from
   components-base.css plus this feature-specific extra.
   ============================================================ */
.std-page {
  /* MB18 M1: cap the standalone-page column to a centered reading width so
     list cards (Companies/Contacts/Activities) read as dense balanced units
     instead of stretching edge-to-edge on the iPad. Tunable — one value. */
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-7, 28px) var(--space-8) var(--space-16);
}

@media (max-width: 720px) {
  .std-page { padding: var(--space-5) var(--space-4) var(--space-12); }
}

/* Empty state inside a standalone page */
.std-page-empty {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-secondary);
  font-style: italic;
  background: var(--bg-elev-2);
  border-radius: var(--radius-md);
}

.std-page-empty-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text-primary);
  font-style: normal;
  margin-bottom: var(--space-2);
}

/* === migrated from components.css === */
/* ---------- Stream filter chips (dashboard header) ---------- */
.stream-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.stream-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  border: 0.5px solid rgba(0, 0, 0, 0.15);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.stream-filter-chip:hover {
  background: rgba(0, 0, 0, 0.04);
}

.stream-filter-chip.is-active {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.35);
  font-weight: 500;
}

.stream-filter-chip.is-untagged {
  border-style: dashed;
  opacity: 0.7;
}

.stream-filter-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stream-filter-chip-count {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 4px;
}

/* ---------- Optional: dark mode safety ---------- */
@media (prefers-color-scheme: dark) {
  .stream-filter-chip { border-color: rgba(255, 255, 255, 0.2); }
  .stream-filter-chip:hover { background: rgba(255, 255, 255, 0.05); }
  .stream-filter-chip.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
  }
  .stream-chip-empty {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.5);
  }
  .account-card { border-color: rgba(255, 255, 255, 0.1); }
  .account-card .card-stats {
    border-top-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  .ste-chip { border-color: rgba(255, 255, 255, 0.2); }
  .ste-chip:hover { background: rgba(255, 255, 255, 0.05); }
}

/* ============================================================
   SECTION — AI signals UI, AI pill, signal cards (Sprint 4)
   Originally: styles-additions-v9.css
   ============================================================ */
/* ---------- AI status pill in masthead ---------- */
.ai-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
}

.ai-pill:hover { transform: scale(1.03); }

.ai-pill-hidden { display: none !important; }

.ai-pill-icon { margin-right: 2px; }

.ai-pill-spinner {
  display: inline-block;
  margin-right: 4px;
  animation: ai-pill-spin 1.2s linear infinite;
}

@keyframes ai-pill-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}