/* ═══════════════════════════════════════════════════════════════════
   CAZ Command Center — Mobile Responsive (mobile.css)
   Comprehensive mobile breakpoints for all pages.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hamburger Menu Button ──────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  position: fixed; top: 12px; left: 12px;
  z-index: 200; width: 40px; height: 40px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--navy-2); cursor: pointer;
  align-items: center; justify-content: center;
  transition: background 0.2s;
}
.mobile-menu-btn:hover { background: var(--navy-3); }
.mobile-menu-btn svg { stroke: var(--text-secondary); }

/* ── Mobile overlay for sidebar ─────────────────────────────────── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
}

/* ═══════════════════════════════════════════════════════════════════
   BREAKPOINT: Tablet (≤ 1024px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Pipeline quick stats */
  .quick-stats { flex-wrap: wrap !important; }
  .quick-stat { min-width: 100px; }

  /* Pipeline KPI row */
  .pipeline-kpis > div { flex-wrap: wrap !important; }

  /* Touch cards */
  .touch-body { padding: 12px !important; }
  .touch-text { font-size: 12px !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   BREAKPOINT: Mobile (≤ 768px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Hamburger visible, sidebar hidden ───────────────────────── */
  .mobile-menu-btn { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: var(--nav-width) !important;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar.mobile-open + .sidebar-overlay,
  body.sidebar-open .sidebar-overlay { display: block; }

  .sidebar .sidebar-wordmark,
  .sidebar .sidebar-nav span,
  .sidebar .sidebar-footer span { opacity: 1 !important; width: auto !important; }
  .sidebar .sidebar-collapse-btn { display: none; }

  .main-content {
    margin-left: 0 !important;
    padding-top: 56px; /* room for hamburger */
  }

  /* ── Command Center ─────────────────────────────────────────── */
  .cc-page { padding: 16px 12px; }
  .cc-greeting { font-size: 20px; }
  .cc-kpis { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .cc-kpi { padding: 14px 16px; }
  .cc-kpi-value { font-size: 22px; }
  .cc-grid { grid-template-columns: 1fr !important; }
  .cc-actions { grid-template-columns: 1fr !important; }
  .cc-action { padding: 12px 14px; }

  /* ── Pipeline ───────────────────────────────────────────────── */
  .header-inner { flex-direction: column; gap: 12px; align-items: flex-start !important; }
  .firm-search-wrapper { width: 100% !important; max-width: 100% !important; }
  .firm-search-input { font-size: 14px !important; }
  .firm-dropdown { width: calc(100vw - 24px) !important; left: 0 !important; }
  .quick-stats { gap: 8px !important; }
  .quick-stat { min-width: 80px; padding: 8px 10px !important; }
  .quick-stat-value { font-size: 14px !important; }
  .quick-stat-label { font-size: 9px !important; }
  .stage-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .touch-card { margin-bottom: 8px; }
  .touch-header { padding: 10px 12px !important; }
  .touch-body { padding: 10px 12px !important; }
  .touch-subject { font-size: 12px !important; }
  .touch-text { font-size: 11px !important; white-space: pre-wrap; word-break: break-word; }
  .copy-btn { width: 100%; padding: 10px !important; font-size: 12px !important; }

  /* Stage selector */
  #pipelineStageSelector { flex-wrap: wrap; gap: 6px !important; }
  #pipelineStageSelector button { font-size: 11px !important; padding: 5px 10px !important; }

  /* Contact intel */
  .intel-header { padding: 12px !important; }
  .intel-title { font-size: 14px !important; }
  .firm-type-badge { font-size: 10px !important; padding: 4px 8px !important; }
  .role-grid { grid-template-columns: 1fr !important; }
  .role-card { padding: 10px !important; }

  /* Roster */
  .roster-grid { grid-template-columns: 1fr !important; }

  /* Meeting prep sections */
  .agenda-section { padding: 12px !important; }
  .followup-card { padding: 12px !important; }
  .close-grid { grid-template-columns: 1fr !important; }

  /* ── Intelligence Page ──────────────────────────────────────── */
  .intel-content { grid-template-columns: 1fr !important; }
  .detail-panel { position: static !important; max-height: none !important; border-left: none !important; border-top: 1px solid var(--border); margin-top: 12px; border-radius: var(--radius-lg) !important; }
  .table-panel { border-radius: var(--radius-lg) !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .charts-grid { grid-template-columns: 1fr !important; }
  .filter-bar { flex-direction: column; }
  .filter-group { width: 100%; }

  /* ── Activity Log ───────────────────────────────────────────── */
  .activity-header { flex-direction: column; gap: 8px; }
  .activity-filters { flex-direction: column; width: 100%; }

  /* ── Settings ───────────────────────────────────────────────── */
  .settings-page { padding: 16px 12px; }
  .setting-row { flex-direction: column; gap: 8px; align-items: flex-start !important; }
  .setting-value { font-size: 13px; }

  /* ── Login ───────────────────────────────────────────────────── */
  .login-container { padding: 32px 24px !important; margin: 12px; }

  /* ── Placeholder pages ──────────────────────────────────────── */
  .placeholder-page { padding: 24px 16px !important; }

  /* ── Deals page ────────────────────────────────────────────── */
  .deals-header { flex-direction: column; align-items: flex-start; }
  .deals-stage-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .deals-tools-grid { grid-template-columns: 1fr !important; }

  /* ── Data Health ───────────────────────────────────────────── */
  .sentinel-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
  .sentinel-grid { grid-template-columns: 1fr !important; }

  /* ── Content Library ───────────────────────────────────────── */
  .content-search { flex-direction: column; }
  .content-grid { grid-template-columns: 1fr !important; }

  /* ── Sequences ─────────────────────────────────────────────── */
  .seq-header { flex-direction: column; gap: 8px; align-items: flex-start !important; }
  .seq-grid { grid-template-columns: 1fr !important; }

  /* ── Agent Health ──────────────────────────────────────────── */
  .agents-grid { grid-template-columns: 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   BREAKPOINT: Small Phone (≤ 480px)
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .cc-kpis { grid-template-columns: 1fr !important; }
  .cc-kpi-value { font-size: 20px; }
  .cc-greeting { font-size: 18px; }
  .kpi-grid { grid-template-columns: 1fr !important; }
  .stage-tabs { gap: 0 !important; }
  .stage-tab { font-size: 11px !important; padding: 6px 8px !important; }
  .stage-arrow { display: none; }
  .touch-num { width: 24px; height: 24px; font-size: 11px; }
}
