* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--sm-surface);
  color: var(--sm-ink);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar — styles moved to src/shared/design-system/sidebar.css ───────
   HTML uses .sm-sidebar and child .sm-sidebar-* classes.
   .sidebar class kept as alias for legacy mobile-overlay JS references.    */
.sidebar {
  /* Layout alias — structural rules are in sidebar.css (.sm-sidebar) */
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: var(--z-sidebar, 100);
}

/* Main Content */
.main-content {
  margin-left: var(--sm-sidebar-width, 260px);
  flex: 1;
  min-width: 0;
  padding: 16px;
  background: var(--sm-surface);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
}

#app {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  min-height: 0;
  min-width: 0;
  padding: 10px 16px 0 16px;
}

/* ── Global Card System ─────────────────────────────────────────────────── */
.card {
  background: var(--sm-surface-alt);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--sm-divider);
  padding: 24px;
  margin: 12px 0;
}

/* ── Global Button System ───────────────────────────────────────────────── */

/* Primary — Sociomonkey ink (globally controlled, not tenant-overridable) */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--sm-ink);
  color: #fff;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.button:hover {
  transform: translateY(-1px);
  background: var(--sm-ink-soft);
  box-shadow: var(--shadow-md);
}

.button:active {
  transform: translateY(0);
  box-shadow: none;
}

.button:disabled,
.button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.button:focus-visible,
.input:focus-visible,
.textarea:focus-visible,
.select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--tenant-accent-soft);
  outline-offset: 2px;
}

/* Secondary — tenant accent color */
.button.secondary {
  background: var(--tenant-accent);
  color: #fff;
}

.button.secondary:hover {
  background: var(--tenant-accent-dark);
}

/* Ghost — transparent with border */
.button.ghost {
  background: transparent;
  color: var(--sm-ink);
  border: 1.5px solid var(--sm-divider);
  box-shadow: none;
}

.button.ghost:hover {
  background: var(--sm-surface);
  border-color: var(--sm-ink);
  box-shadow: none;
}

/* Danger */
.button.danger {
  background: var(--color-error);
  color: #fff;
}

.button.danger:hover {
  background: #b91c1c;
}

/* ── Global Form System ─────────────────────────────────────────────────── */
.input,
.textarea,
.select {
  width: 100%;
  padding: 10px 13px;
  margin: 8px 0;
  border: 1.5px solid var(--sm-divider);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: var(--text-base);
  font-family: var(--font-sans);
  color: var(--sm-ink);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--sm-muted);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--tenant-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--tenant-accent-soft);
}

/* Grid */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: 1fr 1fr;
}

.grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Navigation (inline nav) */
.nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.nav button {
  border-radius: 9999px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--sm-ink);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ── Global Table System ─────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-family: var(--font-sans);
}

.table th {
  padding: 10px 12px;
  border-bottom: 2px solid var(--sm-divider);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--sm-muted);
  background: var(--sm-surface);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid var(--sm-divider-soft);
  font-size: var(--text-base);
  color: var(--sm-body);
  vertical-align: middle;
}

.table tbody tr:hover td {
  background: var(--sm-surface);
}

/* Tags */
.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 9999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 500;
}

/* ── Typography Hierarchy (Desktop/Laptop) ─────────────────────────────── */
@media (min-width: 1024px) {
  :root {
    --typo-l1: 24px;  /* page titles */
    --typo-l2: 17px;  /* section titles */
    --typo-l3: 11px;  /* column headers */
    --typo-l4: 13px;  /* body text */
    --typo-l5: 11px;  /* metadata */
  }

  .sm-page-title,
  .dash-title,
  .ab-page-title,
  .page-title {
    font-size: var(--typo-l1) !important;
  }

  .sm-section-heading,
  .analytics-section-title,
  .ab-list-title,
  .plat-section-title {
    font-size: var(--typo-l2) !important;
  }

  .table th,
  .leads-table thead th,
  .team-table thead th,
  .ab-action-table thead th,
  .rpt-team-table thead th {
    font-size: var(--typo-l3) !important;
  }

  .table td,
  .leads-table td,
  .team-table td,
  .ab-cell-text,
  .pipeline-card-name,
  .pipeline-card-meta,
  .rpt-bar-lbl-source,
  .rpt-bar-lbl-project {
    font-size: var(--typo-l4) !important;
  }

  .sm-small,
  .dash-filter-label,
  .ab-action-name-meta,
  .ab-list-count,
  .leads-name-sub,
  .team-name-sub,
  .pipeline-stage-sub {
    font-size: var(--typo-l5) !important;
  }

  .dash-filter-ctl,
  .dash-filter-sel,
  .pipeline-filter-btn,
  .dash-refresh-btn {
    font-size: 13px;
  }

  .pipeline-stage-name {
    font-size: 12px;
  }

  .pipeline-card-status-chip {
    font-size: 10px;
  }

  .pipeline-card-status-select {
    font-size: 11px;
  }

  .ab-action-name-btn,
  .ab-inline-status-select {
    font-size: 12px;
  }

  .ab-note-preview,
  .ab-list-eyebrow {
    font-size: 11px;
  }

  .analytics-kpi-label,
  .rpt-team-table td,
  .rpt-team-table th {
    font-size: 12px;
  }

  .plat-nav-item {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 900px) {
  .main-content {
    margin-left: 0;
    padding: 12px;
  }

  #app {
    padding: 16px 8px 0 8px;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .header {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Messages */
.message {
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  color: #0c4a6e;
  border: 1px solid #bae6fd;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.message.success {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

/* Footer */
.footer {
  font-size: 13px;
  color: #64748b;
  padding-top: 20px;
  text-align: center;
}

/* Modal overlay */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1200px) {
  .pipeline-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .pipeline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .pipeline-grid { grid-template-columns: 1fr; }
}

.pipeline-col {
  background: var(--sm-surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--sm-divider);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 340px;
}

.pipeline-filter-shell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.pipeline-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.pipeline-filter-row-enterprise {
  flex-wrap: nowrap;
}

.pipeline-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pipeline-filter-search {
  flex: 1 1 320px;
  min-width: 240px;
}

.pipeline-filter-manager,
.pipeline-filter-project {
  flex: 0 0 180px;
}

.pipeline-filter-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pipeline-stage-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: end;
  row-gap: 2px;
}

.pipeline-stage-name {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  grid-column: 1;
  grid-row: 1;
}

.pipeline-stage-count {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  grid-column: 2;
  grid-row: 1 / span 2;
}

.pipeline-stage-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  grid-column: 1;
  grid-row: 2;
}

.pipeline-col-header {
  padding: 10px 14px 12px;
  cursor: pointer;
  user-select: none;
  transition: filter .15s;
}
.pipeline-col-header:hover { filter: brightness(.96); }

.pipeline-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  transition: background .12s ease, box-shadow .12s ease;
}

.pipeline-col-body.pipeline-drop-target {
  background: #eef6ff;
  box-shadow: inset 0 0 0 2px #60a5fa;
}

.pipeline-card {
  background: #fff;
  padding: 7px 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow .15s, transform .12s ease, opacity .12s ease;
}
.pipeline-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }

.pipeline-card.pipeline-card-dragging {
  opacity: .6;
  transform: scale(.98);
  box-shadow: 0 8px 22px rgba(15,23,42,.22);
}

.pipeline-card.pipeline-card-pending {
  opacity: .78;
}

.pipeline-more {
  text-align: center;
  font-size: 12px;
  color: var(--sm-brand);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}
.pipeline-more:hover { background: var(--sm-brand-soft); }

.pipeline-empty {
  text-align: center;
  color: #cbd5e1;
  font-size: 12px;
  padding: 12px 0;
}

.pipeline-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pipeline-card-name {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-card-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.pipeline-card-status-select {
  border: none;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  min-width: 0;
  width: 100%;
  outline: none;
  cursor: pointer;
}

.pipeline-card-meta {
  font-size: 10.5px;
  line-height: 1.25;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-card-actions {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.pipeline-card-action-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.pipeline-card-action-btn:hover {
  background: #f8fafc;
}

.pipeline-modal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .12s;
}
.pipeline-modal-row:last-child { border-bottom: none; }
.pipeline-modal-row:hover { background: #f8fafc; }

.pipeline-modal-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  position: relative;
}

.modal-box h3 {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: var(--weight-extrabold);
  color: var(--sm-ink);
  letter-spacing: -0.01em;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #64748b;
  line-height: 1;
}

.modal-close:hover { color: var(--sm-ink); }

/* Statistics */
.stat-card {
  background: var(--sm-surface-alt);
  border: 1px solid var(--sm-divider);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--sm-muted);
  font-weight: var(--weight-semibold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: var(--weight-extrabold);
  color: var(--sm-ink);
  line-height: 1;
}

/* Bulk action bar */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--sm-brand-soft);
  border: 1px solid rgba(222,46,46,.22);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
}

.bulk-count {
  font-weight: var(--weight-bold);
  color: var(--sm-brand);
  font-size: var(--text-base);
  flex-shrink: 0;
  margin-right: 4px;
}

.bulk-bar-divider {
  width: 1px;
  height: 28px;
  background: rgba(222,46,46,.22);
  flex-shrink: 0;
  margin: 0 4px;
}

.lead-row-selected {
  background: var(--sm-brand-soft) !important;
}

.lead-row-selected td {
  border-color: rgba(222,46,46,.18);
}

.leads-workbench {
  border-radius: 16px;
  padding: 16px 16px 14px;
}

.leads-header-row {
  margin-bottom: 14px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leads-header-row .sm-page-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.leads-header-count {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

.leads-action-btn {
  height: 35px;
  padding: 0 11px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}

.leads-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.leads-action-btn-primary {
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.leads-action-icon {
  font-size: 12px;
  line-height: 1;
}

.leads-command-shell {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.leads-search-row {
  display: block;
  margin-bottom: 8px;
}

.leads-search-main {
  width: 100%;
  min-width: 0;
}

.leads-search-inline {
  display: flex;
  align-items: center;
  gap: 9px;
}

.leads-search-inline input {
  flex: 1;
}

.leads-filter-aux-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leads-search-inline .dash-refresh-btn,
.leads-search-inline .leads-reset-btn,
.leads-page-actions .leads-action-btn {
  height: 34px;
}

.leads-priority-primary {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}

.leads-priority-secondary {
  margin-top: 8px;
}

.leads-advanced-filters .dash-filter-group,
.leads-command-shell .dash-filter-group {
  min-width: 0;
}

.leads-advanced-filters .dash-filter-ctl,
.leads-command-shell .dash-filter-ctl {
  width: 100%;
}

.leads-quick-strip {
  margin-top: 0;
  margin-bottom: 2px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1;
}

.leads-quick-chip {
  height: 29px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 11px;
}

.leads-quick-chip.is-active {
  border-color: #bfdbfe;
  background: #eaf2ff;
  color: #1e40af;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.leads-reset-btn {
  height: 34px;
}

.leads-advanced-toggle-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.leads-advanced-toggle-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  min-width: 154px;
}

.leads-sort-select {
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
  min-width: 110px;
  max-width: 130px;
}

.leads-advanced-filters {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.leads-table-wrap {
  width: 100%;
}

.leads-table {
  margin-top: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.leads-table th,
.leads-table td {
  padding: 7px 5px;
  font-size: 11px;
  vertical-align: middle;
  text-align: center;
}

.leads-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.leads-table tbody tr:nth-child(2n) {
  background: #fbfdff;
}

.leads-table tbody tr:hover {
  background: #f1f7ff;
}

.ta-center {
  text-align: center;
}

.ta-left {
  text-align: left;
}

.leads-name-sub {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.leads-phone-link {
  border: none;
  background: transparent;
  color: #0f4c81;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.leads-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 2px 5px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 9px;
  font-weight: 700;
  color: #334155;
}

.lead-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
}

.lead-inline-status {
  height: 30px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leads-cell-text {
  display: inline-block;
  max-width: 100%;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.leads-cell-text-center {
  text-align: center;
}

.leads-note-col {
  width: 170px;
}

.leads-note-cell {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 4px;
}

.leads-note-preview {
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.25;
  color: #475569;
  cursor: help;
  vertical-align: middle;
}

.leads-note-empty {
  color: #cbd5e1;
}

.leads-icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 4px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.leads-icon-action:hover {
  background: #f8fafc;
  color: #0f172a;
}

.leads-callback-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Lead Detail Card layout */
.ld-sidebar-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}
.ld-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(2,6,23,.05);
}
.ld-card-hd {
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
.ld-card-bd {
  padding: 16px 18px;
}
.ld-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #f8fafc;
}
.ld-field:last-child { border-bottom: none; }
.ld-field-k {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  flex-shrink: 0;
}
.ld-field-v {
  font-size: 12.5px;
  color: #1e293b;
  text-align: right;
}
.ld-action-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
@media (max-width: 900px) {
  .ld-sidebar-grid { grid-template-columns: 1fr; }
}


.leads-callback-value {
  font-size: 12px;
  font-weight: 700;
}

.leads-actions-col {
  width: 128px;
}

.leads-actions-cell {
  position: relative;
}

.leads-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.leads-row-action-btn {
  height: 26px;
  padding: 0 5px;
  font-size: 10px;
}

.leads-row-icon-btn {
  width: 26px;
  min-width: 26px;
  padding: 0;
  border-radius: 6px;
}

.leads-row-action-icon {
  font-size: 11px;
  line-height: 1;
}

.leads-more-btn {
  min-width: 30px;
}

.leads-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 6px 4px;
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
}

.leads-pagination-summary,
.leads-pagination-size {
  font-size: 13px;
  color: #64748b;
}

.leads-pagination-controls,
.leads-pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
}

.leads-page-btn,
.leads-page-size-select {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.leads-page-btn {
  padding: 4px 10px;
}

.leads-page-size-select {
  padding: 4px 8px;
  color: #374151;
  cursor: pointer;
}

.leads-menu-item {
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  font-size: 12px;
  color: #334155;
  border-radius: 6px;
  padding: 7px 9px;
  cursor: pointer;
}

.leads-menu-item:hover {
  background: #f8fafc;
}

.rq-filter-shell {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.rq-filter-row {
  display: grid;
  grid-template-columns: 150px 150px minmax(240px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.rq-filter-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rq-filter-search {
  min-width: 0;
}

.rq-filter-btn {
  height: 34px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 14px;
  border-radius: 7px;
  white-space: nowrap;
}

.rq-custom-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.rq-bulk-main-row {
  display: grid;
  grid-template-columns: auto minmax(230px, 270px) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.rq-bulk-count {
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  white-space: nowrap;
}

.rq-bulk-strategy,
.rq-bulk-reason-wrap {
  min-width: 0;
}

.rq-bulk-strategy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rq-bulk-strategy .select,
.rq-bulk-reason-wrap .select {
  margin: 0;
}

.rq-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.rq-bulk-help-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed #bae6fd;
}

.rq-bulk-help-label {
  font-size: 11px;
  font-weight: 700;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.rq-bulk-help-text {
  font-size: 12px;
  color: #0f172a;
  line-height: 1.4;
}

.team-table {
  table-layout: fixed;
}

.team-table th,
.team-table td {
  vertical-align: middle;
}

.team-table th:nth-child(1),
.team-table td:nth-child(1) { width: 20%; }
.team-table th:nth-child(2),
.team-table td:nth-child(2) { width: 24%; }
.team-table th:nth-child(3),
.team-table td:nth-child(3) { width: 14%; }
.team-table th:nth-child(4),
.team-table td:nth-child(4) { width: 12%; }
.team-table th:nth-child(5),
.team-table td:nth-child(5) { width: 14%; }
.team-table th:nth-child(6),
.team-table td:nth-child(6) { width: 16%; text-align: right; }

.team-name-sub {
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}

.team-actions-cell {
  white-space: nowrap;
}

/* Analytics */
.analytics-kpi {
  background: var(--sm-surface-alt);
  border: 1px solid var(--sm-divider);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.analytics-kpi-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--sm-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.analytics-kpi-value {
  font-size: 32px;
  font-weight: var(--weight-extrabold);
  color: var(--sm-ink);
  line-height: 1.1;
}

.analytics-section-title {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--sm-ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── Scrollbar ───────────────────────────────────────────────── */
.sidebar {
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar {
  display: none;
}

/* ─── Mobile Top Bar ──────────────────────────────────────────── */
.mobile-topbar {
  display: none;
}

.hamburger-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  padding: 0 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  line-height: 1;
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.1);
}

.mobile-brand {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

/* ─── Mobile Overlay ──────────────────────────────────────────── */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.mobile-overlay.active {
  display: block;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Mobile top bar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--tenant-sidebar-bg);
    z-index: 100;
    padding: 0 16px;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  /* Sidebar drawer — rules moved to sidebar.css (.sm-sidebar) */

  /* Main content: full width, shifted down below top bar */
  .main-content {
    margin-left: 0 !important;
    padding: 72px 12px 16px 12px;
  }

  #app {
    padding: 0;
  }

  /* Grids collapse to single column */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Header */
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header h2 {
    font-size: 20px;
  }

  /* Cards */
  .card {
    padding: 16px;
    border-radius: 12px;
    margin: 8px 0;
  }

  /* Tables — horizontal scroll */
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    white-space: nowrap;
  }

  .table th,
  .table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  /* Buttons — touch-friendly */
  .button {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Inputs — font-size 16px prevents iOS auto-zoom */
  .input,
  .select,
  .textarea {
    min-height: 44px;
    font-size: 16px !important;
  }

  /* Nav pills */
  .nav {
    gap: 6px;
  }

  .nav button {
    font-size: 13px;
    padding: 8px 12px;
    min-height: 40px;
  }

  /* Pipeline grid */
  .pipeline-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .pipeline-filter-row-enterprise {
    flex-wrap: wrap;
  }

  .pipeline-filter-search,
  .pipeline-filter-manager,
  .pipeline-filter-project {
    flex: 1 1 46%;
    min-width: 0;
  }

  .pipeline-filter-btn {
    flex: 1 1 46%;
  }

  /* Stats */
  .stat-card .stat-value {
    font-size: 24px;
  }

  .analytics-kpi-value {
    font-size: 24px;
  }

  /* Modals */
  .modal-box {
    padding: 20px 16px;
    border-radius: 12px;
    max-height: 85vh;
    width: 95vw;
  }

  /* Bulk action bar */
  .bulk-bar {
    padding: 8px 12px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .leads-header-row {
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }

  .leads-page-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .leads-page-actions .sm-btn {
    flex: 1 1 46%;
  }

  .leads-search-inline {
    flex-wrap: wrap;
  }

  .leads-search-inline input {
    min-width: 0;
    width: 100%;
  }

  .leads-filter-aux-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .leads-advanced-toggle-btn {
    width: 100%;
    min-width: 0;
  }

  .leads-quick-strip {
    gap: 6px;
  }

  .leads-advanced-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rq-filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rq-bulk-main-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rq-bulk-count {
    grid-column: span 2;
  }

  .rq-bulk-reason-wrap {
    grid-column: span 2;
  }

  .rq-bulk-actions {
    grid-column: span 2;
    width: 100%;
  }

  .rq-bulk-actions .button,
  .rq-bulk-actions button {
    flex: 1 1 48%;
  }

  .rq-bulk-help-row {
    flex-direction: column;
    gap: 5px;
  }

  .rq-filter-row .rq-filter-search {
    grid-column: span 2;
  }

  .rq-filter-row .rq-filter-btn {
    width: 100%;
  }

  .leads-table-wrap {
    overflow-x: visible;
  }

  .leads-table,
  .leads-table thead,
  .leads-table tbody,
  .leads-table tr,
  .leads-table th,
  .leads-table td {
    display: block;
    width: 100%;
    white-space: normal;
  }

  .leads-table thead {
    display: none;
  }

  .leads-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #fff;
  }

  .leads-table td {
    border: none;
    padding: 5px 0;
    text-align: left;
  }

  .lead-status-chip {
    justify-content: flex-start;
    max-width: 100%;
  }

  .lead-inline-status {
    font-size: 12px;
  }

  .leads-name-sub {
    text-align: left;
  }

  .leads-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .leads-actions-cell {
    position: static;
  }

  .leads-actions-menu {
    position: static !important;
    margin-top: 6px;
    width: 100%;
  }

  .team-table,
  .team-table thead,
  .team-table tbody,
  .team-table tr,
  .team-table th,
  .team-table td {
    display: block;
    width: 100%;
  }

  .team-table thead {
    display: none;
  }

  .team-table tr {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 8px;
    background: #fff;
  }

  .team-table td:nth-child(6) {
    text-align: left;
  }
}

@media (max-width: 1440px) {
  .leads-row-action-label {
    display: none;
  }

  .leads-row-action-btn {
    min-width: 30px;
    padding: 0 6px;
  }

  .leads-more-btn {
    min-width: 30px;
  }
}

@media (max-width: 480px) {
  .pipeline-grid {
    grid-template-columns: 1fr !important;
  }

  .mobile-brand {
    font-size: 14px;
  }

  .header h2 {
    font-size: 18px;
  }
}

/* ─── Dashboard Classes ───────────────────────────────────────── */
.dash-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dash-title {
  margin: 0 0 2px;
  /* font-size and color governed by sm-page-title class */
}

.dash-filters {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: flex-end;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(2,6,23,0.04);
}

.dash-filters .dash-filter-group {
  flex: 0 0 auto;
}

.dash-filters .dash-filter-ctl {
  min-width: 132px;
}

.dash-filters #dashCustomRange {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.dash-filter-sel {
  min-width: 150px;
  font-size: 13px;
}

.dash-filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dash-filter-label {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dash-filter-ctl {
  height: 34px;
  min-width: 150px;
  font-size: 12.5px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  padding: 0 10px;
  color: #334155;
  background: #f8fafc;
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font-sans);
}

.dash-filter-ctl:focus {
  border-color: #94a3b8;
  background: #fff;
}

.dash-refresh-btn {
  height: 34px;
  padding: 0 16px;
  background: #1e293b;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background 0.15s;
}

.dash-refresh-btn:hover {
  background: #334155;
}

.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 7px;
  margin-bottom: 8px;
}

.dash-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.dash-charts-row .dash-accordion-item {
  margin: 0;
}

.dash-status-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dash-funnel-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 4px;
}

.dash-funnel-svg {
  flex-shrink: 0;
  width: 168px;
  height: 194px;
}

.dash-funnel-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  padding-left: 4px;
  justify-content: center;
}

.dash-source-inner {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.dash-source-svg {
  flex-shrink: 0;
  width: 192px;
  height: 192px;
}

.dash-source-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-left: 34px;
  justify-content: center;
}

.dash-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 8px;
  padding: 2px 0;
}

.dash-legend-key {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.dash-legend-label {
  color: #334155;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-legend-metric {
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ab-search-group {
  flex: 1 1 320px;
  min-width: 260px;
}

.ab-search-input {
  min-width: 280px;
}

.ab-root-shell {
  width: 100%;
}

.ab-header-shell {
  justify-content: space-between;
}

.ab-page-title {
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.ab-header-meta {
  font-size: 12px !important;
  line-height: 1.35;
  color: #64748b !important;
}

.ab-header-date {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding-top: 3px;
}

.ab-filter-bar {
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-start;
}

.ab-custom-range {
  flex-wrap: nowrap;
}

.ab-workspace-shell {
  margin-top: 2px;
}

.ab-kpi-strip,
.ab-kpi-strip-skeleton {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  margin-bottom: 6px;
}

.ab-kpi-skeleton-tile,
.ab-panel-skeleton {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(2,6,23,0.04);
}

.ab-kpi-tab {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--ab-kpi-color) 18%, #dbe4f0);
  border-left: 3px solid color-mix(in srgb, var(--ab-kpi-color) 42%, #dbe4f0);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(2,6,23,0.04);
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  min-height: 62px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease;
}

.ab-kpi-tab:hover {
  border-color: color-mix(in srgb, var(--ab-kpi-color) 38%, #d1d9e6);
  transform: translateY(-1px);
}

.ab-kpi-tab.is-active {
  border-color: color-mix(in srgb, var(--ab-kpi-color) 82%, #9fb4cb);
  border-left-color: color-mix(in srgb, var(--ab-kpi-color) 94%, #6b7280);
  background: color-mix(in srgb, var(--ab-kpi-color) 18%, #ffffff);
  box-shadow: 0 8px 20px rgba(15,23,42,0.14);
}

.ab-kpi-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  justify-content: center;
}

.ab-kpi-title {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ab-kpi-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ab-kpi-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ab-kpi-color) 18%, #fff);
}

.ab-kpi-sub {
  font-size: 9px;
  color: #475569;
  font-weight: 600;
}

.ab-kpi-count {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  min-width: 0;
}

.ab-active-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15,23,42,0.05);
  overflow: hidden;
}

.ab-panel-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ab-panel-meta {
  font-size: 11px;
  color: #94a3b8;
}

.ab-panel-page-state {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.ab-page-label {
  font-size: 11px;
  color: #64748b;
}

.ab-page-select {
  height: 30px;
  min-width: 62px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  padding: 0 8px;
}

.ab-size-select {
  height: 30px;
  min-width: 92px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  padding: 0 8px;
}

.ab-page-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ab-page-btn[disabled] {
  color: #cbd5e1;
  cursor: default;
}

.ab-active-panel-body {
  padding: 8px 10px 4px;
  display: block;
  min-height: 0;
}

.ab-list-shell {
  min-height: 0;
}

.ab-list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 8px;
}

.ab-list-eyebrow {
  margin: 0 0 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ab-list-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.ab-list-count {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.ab-table-wrap {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}

.ab-action-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: fixed;
}

.ab-action-table th,
.ab-action-table td {
  padding: 5px 6px;
  vertical-align: middle;
  text-align: center;
}

.ab-action-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
}

.ab-action-row {
  outline: none;
  cursor: pointer;
}

.ab-action-row + .ab-action-row td {
  border-top: 1px solid #eef2f7;
}

.ab-action-row:hover td,
.ab-action-row:focus td {
  background: #fbfdff;
}

.ab-action-name-cell {
  min-width: 0;
}

.ab-action-name-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.ab-action-name-meta {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  margin-top: 1px;
  text-align: center;
}

.ab-cell-text {
  display: inline-block;
  max-width: 100%;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-action-status {
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.ab-status-chip {
  display: inline-flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ab-inline-status-select {
  display: block;
  height: 28px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
  padding: 0 14px 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.ab-note-cell,
.ab-callback-cell {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
  min-width: 0;
}

.ab-note-preview {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: #475569;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-note-edit-btn,
.ab-callback-icon-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.ab-action-buttons {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  flex-wrap: nowrap;
}

.ab-row-action-btn {
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 5px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ab-row-action-btn.is-primary {
  border-color: #c7d2fe;
  color: #4338ca;
  background: #eef2ff;
}

.ab-row-action-icon {
  line-height: 1;
}

.ab-row-action-label {
  line-height: 1;
}

.ab-empty-state {
  color: #94a3b8;
  font-size: 13px;
  margin: 14px 0;
  text-align: center;
  font-style: italic;
}

.ab-utility-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  padding: 6px 10px 8px;
  border-top: 1px solid #f1f5f9;
  background: #fbfdff;
}

.ab-utility-left,
.ab-utility-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.ab-utility-right {
  justify-content: flex-end;
}

.ab-page-size-select {
  min-width: 70px;
}

/* ─── Dashboard Mobile ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .dash-title {
    font-size: 1.3rem;
  }

  .dash-filters {
    width: 100%;
    padding: 10px;
    gap: 6px;
    flex-wrap: wrap;
  }

  .ab-filter-bar,
  .ab-custom-range {
    flex-wrap: wrap;
  }

  .ab-header-shell {
    flex-wrap: wrap;
  }

  .ab-header-date {
    width: 100%;
    padding-top: 0;
  }

  .dash-filter-sel {
    min-width: 0;
    width: 100%;
    font-size: 14px !important;
  }

  .dash-filter-ctl {
    min-width: 0;
    width: 100%;
    font-size: 14px !important;
  }

  .ab-search-group,
  .ab-search-input {
    min-width: 0;
    width: 100%;
  }

  .ab-search-actions {
    width: 100%;
  }

  .ab-search-actions > div {
    width: 100%;
  }

  .ab-search-actions .dash-refresh-btn,
  .ab-search-actions .sm-btn {
    flex: 1;
    justify-content: center;
  }

  .ab-kpi-strip,
  .ab-kpi-strip-skeleton {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ab-kpi-tab {
    min-height: 64px;
    align-items: flex-start;
  }

  .ab-list-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ab-table-wrap {
    overflow-x: auto;
  }

  .ab-status-chip {
    padding: 0 6px;
  }

  .ab-inline-status-select {
    font-size: 10px;
  }

  .ab-kpi-count {
    font-size: 18px;
  }

  .ab-panel-pager {
    justify-content: flex-start;
  }

  .ab-utility-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ab-panel-page-state,
  .ab-page-label {
    width: auto;
  }

  .ab-utility-left,
  .ab-utility-right {
    flex-wrap: wrap;
  }

  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .dash-status-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .dash-funnel-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .dash-funnel-svg {
    width: 160px;
    height: 184px;
  }

  .dash-funnel-legend {
    width: 100%;
    padding-top: 4px;
  }

  .dash-source-inner {
    flex-direction: column;
    align-items: center;
  }

  .dash-source-svg {
    width: 130px;
    height: 130px;
  }

  .dash-source-legend {
    width: 100%;
    padding-left: 0;
    padding-top: 10px;
  }
}

@media (max-width: 1280px) {
  .ab-row-action-label {
    display: none;
  }

  .ab-row-action-btn {
    min-width: 28px;
    padding: 0 5px;
  }
}

@media (max-width: 480px) {
  .dash-status-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ab-kpi-strip,
  .ab-kpi-strip-skeleton {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ab-utility-right {
    justify-content: flex-start;
  }
}

/* ─── Reports Classes ─────────────────────────────────────────── */
.rpt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.rpt-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

.rpt-team-table {
  table-layout: fixed;
  width: 100%;
}

.rpt-team-table td,
.rpt-team-table th {
  height: 42px;
}

.rpt-bar-lbl-status {
  width: 140px;
  flex-shrink: 0;
}

.rpt-bar-lbl-source {
  width: 130px;
  flex-shrink: 0;
  font-size: 13px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpt-bar-lbl-project {
  width: 180px;
  flex-shrink: 0;
  font-size: 13px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Reports Mobile ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .rpt-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .rpt-two-col {
    grid-template-columns: 1fr;
  }

  .rpt-bar-lbl-status {
    width: 80px;
  }

  .rpt-bar-lbl-source {
    width: 80px;
  }

  .rpt-bar-lbl-project {
    width: 90px;
  }

  .analytics-kpi {
    padding: 12px 14px;
  }

  .analytics-kpi-value {
    font-size: 22px;
  }

  #recycleRoot,
  #actionBoardRoot {
    padding: 12px 8px 40px !important;
  }
}

/* ============================================================
   PLATFORM LAYER — SocioMonkey Platform Admin UI
   ============================================================ */

/* Platform root container (replaces tenant layout when in platform mode) */
#platformRoot {
  display: none;
  height: 100vh;
  overflow: hidden;
  width: 100%;
}

/* Dark charcoal sidebar — Sociomonkey brand */
.plat-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #111111 0%, #1a1a1a 100%);
  color: #c8c8c8;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  overflow-y: auto;
}

.plat-sidebar-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.plat-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.plat-sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--sm-brand);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
  font-size: 18px;
  flex-shrink: 0;
}

.plat-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.01em;
}

.plat-sidebar-subtitle {
  font-size: 10px;
  color: var(--sm-brand);
  letter-spacing: .04em;
  line-height: 1.5;
  padding-left: 46px;
}

.plat-nav {
  padding: 10px 8px;
  flex: 1;
}

.plat-nav-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--sm-brand);
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 10px 12px 5px;
}

.plat-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: #aaaaaa;
  font-weight: 500;
  transition: background .12s, color .12s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  margin-bottom: 2px;
}

.plat-nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #ffffff;
}

.plat-nav-item.active {
  background: rgba(222,46,46,.18);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--sm-brand);
}

.plat-nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.plat-sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.07);
}

.plat-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.plat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.plat-status-label {
  font-size: 12px;
  font-weight: 600;
  color: #aaaaaa;
}

.plat-status-uptime {
  font-size: 11px;
  color: var(--sm-brand);
  margin-bottom: 2px;
}

.plat-status-link {
  font-size: 11px;
  color: var(--sm-brand);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(222,46,46,.4);
}

.plat-sidebar-copy {
  font-size: 10px;
  color: #555;
  margin-top: 10px;
}

/* Platform main wrapper (right of sidebar) */
.plat-wrapper {
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top navigation bar */
.plat-topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.plat-topbar-title {
  flex: 1;
}

.plat-topbar-title h2 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1;
}

.plat-topbar-title p {
  font-size: 12px;
  color: #64748b;
  margin: 3px 0 0;
}

.plat-search {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 14px;
  gap: 8px;
  min-width: 260px;
}

.plat-search-icon {
  color: #94a3b8;
  font-size: 14px;
}

.plat-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #0f172a;
  width: 100%;
}

.plat-search input::placeholder {
  color: #94a3b8;
}

.plat-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plat-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #64748b;
  position: relative;
  transition: background .1s;
}

.plat-icon-btn:hover {
  background: #f8fafc;
}

.plat-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plat-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: background .1s;
}

.plat-user-chip:hover {
  background: #f8fafc;
}

.plat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sm-brand), var(--sm-brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.plat-user-info {
  line-height: 1.2;
}

.plat-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.plat-user-role {
  font-size: 11px;
  color: #64748b;
}

/* Platform content area */
.plat-main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f8fafc;
}

/* Page header inside plat-main */
.plat-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.plat-page-header-left h1 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.plat-page-header-left p {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
}

.plat-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Stats grid */
.plat-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.plat-stat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.plat-stat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.plat-stat-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  line-height: 1.3;
}

.plat-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.plat-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  margin-bottom: 6px;
}

.plat-stat-change {
  font-size: 12px;
  font-weight: 600;
}

.plat-stat-change.up { color: #16a34a; }
.plat-stat-change.down { color: #dc2626; }

.plat-stat-vs {
  font-size: 11px;
  color: #94a3b8;
}

/* Applications Suite */
.plat-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.plat-section-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.plat-section-link {
  font-size: 13px;
  color: var(--sm-brand);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
}

.plat-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.plat-app-tile {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  cursor: pointer;
  transition: box-shadow .18s, transform .18s, border-color .18s;
  position: relative;
}

.plat-app-tile:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.1);
  transform: translateY(-2px);
  border-color: var(--sm-divider);
}

.plat-app-tile-menu {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 4px;
}

.plat-app-tile-menu:hover { background: #f1f5f9; color: #374151; }

.plat-app-icon {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 14px;
}

.plat-app-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 5px;
}

.plat-app-desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 14px;
  min-height: 34px;
}

.plat-app-open {
  font-size: 13px;
  font-weight: 600;
  color: var(--sm-brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.plat-app-open:hover { color: var(--sm-brand-dark); }
.plat-app-open.inactive { color: #f59e0b; }

/* Dashboard two-column grid */
.plat-dash-grid {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 20px;
}

/* Charts */
.plat-charts-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.plat-chart-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.plat-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.plat-chart-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.plat-chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: #64748b;
}

.plat-chart-filter {
  padding: 4px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

.plat-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

/* Right panels */
.plat-right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plat-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.plat-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.plat-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.plat-panel-viewall {
  font-size: 12px;
  color: var(--sm-brand);
  cursor: pointer;
  font-weight: 600;
  background: none;
  border: none;
}

/* Alert list */
.plat-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
}

.plat-alert-item:last-child { border-bottom: none; }

.plat-alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.plat-alert-body { flex: 1; }
.plat-alert-title { font-weight: 600; color: #0f172a; font-size: 12.5px; }
.plat-alert-desc { color: #64748b; font-size: 11.5px; margin-top: 2px; }
.plat-alert-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; white-space: nowrap; }

/* Activity list */
.plat-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
}

.plat-activity-item:last-child { border-bottom: none; }

.plat-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: #f1f5f9;
}

.plat-activity-body { flex: 1; }
.plat-activity-title { font-weight: 600; color: #0f172a; font-size: 12.5px; }
.plat-activity-desc { color: #64748b; font-size: 11.5px; margin-top: 2px; }
.plat-activity-time { font-size: 11px; color: #94a3b8; flex-shrink: 0; white-space: nowrap; }

/* Product stats bottom row */
.plat-product-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 0;
}

.plat-product-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.plat-product-stat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.plat-product-stat-icon { font-size: 18px; }
.plat-product-stat-name { font-size: 12px; font-weight: 600; color: #64748b; }
.plat-product-stat-metric { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.plat-product-stat-value { font-size: 22px; font-weight: 800; color: #0f172a; }
.plat-product-stat-change { font-size: 12px; color: #16a34a; font-weight: 600; margin-top: 4px; }

/* Platform badge / pill */
.plat-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.plat-badge-active   { background: #dcfce7; color: #16a34a; }
.plat-badge-inactive { background: #f1f5f9; color: #94a3b8; }
.plat-badge-trial    { background: #fef3c7; color: #92400e; }
.plat-badge-warning  { background: #fff7ed; color: #c2410c; }
.plat-badge-info     { background: #eff6ff; color: #1d4ed8; }

/* Platform table */
.plat-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.plat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}

.plat-table th {
  background: #f8fafc;
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: .05em;
  text-transform: uppercase;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.plat-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  vertical-align: middle;
}

.plat-table tr:last-child td { border-bottom: none; }
.plat-table tr:hover td { background: #f8fafc; }

/* Platform button */
.plat-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .12s;
}

.plat-btn-primary {
  background: var(--sm-brand);
  color: #fff;
}

.plat-btn-primary:hover { background: var(--sm-brand-dark); }

.plat-btn-outline {
  background: #fff;
  color: #374151;
  border: 1px solid #e2e8f0;
}

.plat-btn-outline:hover { background: #f8fafc; }

.plat-btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.plat-btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.plat-btn-danger:hover { background: #fecaca; }

/* Platform card (generic) */
.plat-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  margin-bottom: 20px;
}

/* Platform tabs */
.plat-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}

.plat-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .12s;
}

.plat-tab:hover { color: #374151; }

.plat-tab.active {
  color: var(--sm-brand);
  font-weight: 700;
  border-bottom-color: var(--sm-brand);
}

/* Platform empty state */
.plat-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.plat-empty-icon { font-size: 40px; margin-bottom: 12px; }
.plat-empty-title { font-size: 16px; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.plat-empty-desc { font-size: 13px; }

/* Responsive platform layout */
@media (max-width: 1100px) {
  .plat-dash-grid { grid-template-columns: 1fr; }
  .plat-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .sm-sidebar { display: none; }
  .plat-wrapper { margin-left: 0; }
}


/* ============================================================
   PLATFORM LAYER v2 — Sidebar migrated to sidebar.css (.sm-sidebar)
   Topbar, wrapper, and all non-sidebar .plat-* rules remain here.
   ============================================================ */

/* -- Wrapper / Topbar v2 ----------------------------------- */
.plat-wrapper {
  margin-left: var(--sm-sidebar-width, 260px);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.plat-topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  display: flex; align-items: center; padding: 0 24px; gap: 14px; flex-shrink: 0;
}

.plat-topbar-title h2 { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; line-height: 1.2; }
.plat-topbar-title p  { font-size: 11.5px; color: #64748b; margin: 2px 0 0; }
.plat-topbar-title    { flex: 1; min-width: 0; }

.plat-search {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 8px 14px; min-width: 260px; max-width: 320px;
}
.plat-search-icon { color: #94a3b8; font-size: 13px; }
.plat-search input { border: none; background: transparent; outline: none; font-size: 13px; color: #0f172a; width: 100%; }
.plat-search input::placeholder { color: #94a3b8; font-size: 12px; }

.plat-topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.plat-icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid #e8ecf0;
  background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #64748b; position: relative; transition: background .1s;
}
.plat-icon-btn:hover { background: #f8fafc; }
.plat-notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: #fff; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.plat-user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  border-radius: 9px; cursor: pointer; border: 1px solid #e8ecf0; transition: background .1s;
}
.plat-user-chip:hover { background: #f8fafc; }
.plat-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sm-brand), var(--sm-brand-dark));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.plat-user-name { font-size: 13px; font-weight: 600; color: #0f172a; }
.plat-user-role { font-size: 11px; color: #64748b; }

/* -- Main content ------------------------------------------- */
.plat-main { flex: 1; overflow-y: auto; padding: 24px; background: #f8fafc; }

/* -- Stats cards v2 ---------------------------------------- */
.plat-stats-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; margin-bottom: 24px; }
.plat-stat-card {
  background: #fff; border: 1px solid #e8ecf0; border-radius: 14px;
  padding: 18px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: box-shadow .18s;
}
.plat-stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.plat-stat-top-row  { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.plat-stat-label    { font-size: 12px; color: #64748b; font-weight: 500; line-height: 1.4; max-width: calc(100% - 52px); }
.plat-stat-icon-badge { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.plat-stat-value    { font-size: 28px; font-weight: 800; color: #0f172a; line-height: 1; letter-spacing: -.02em; margin-bottom: 8px; }
.plat-stat-footer   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plat-stat-pill     { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.plat-stat-pill.up  { background: #dcfce7; color: #15803d; }
.plat-stat-pill.dn  { background: #fee2e2; color: #dc2626; }
.plat-stat-vs       { font-size: 11px; color: #94a3b8; }

/* -- App tiles v2 ------------------------------------------ */
.plat-apps-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; margin-bottom: 28px; }
.plat-app-tile {
  background: #fff; border: 1px solid #e8ecf0; border-radius: 16px;
  padding: 24px 18px 20px; text-align: center; cursor: pointer;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  position: relative; display: flex; flex-direction: column; align-items: center; min-height: 210px;
}
.plat-app-tile:hover { box-shadow: 0 8px 28px rgba(0,0,0,.1); transform: translateY(-3px); border-color: #c7d2fe; }
.plat-app-tile-menu { position: absolute; top: 12px; right: 12px; background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 18px; padding: 2px 4px; border-radius: 5px; line-height: 1; }
.plat-app-tile-menu:hover { background: #f1f5f9; color: #374151; }
.plat-app-icon-area { margin-bottom: 12px; margin-top: 6px; }
.plat-app-icon-area i { font-size: 38px; }
.plat-app-name    { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
.plat-app-fullname { font-size: 11.5px; color: #64748b; line-height: 1.45; margin-bottom: 14px; flex: 1; }
.plat-app-open-btn {
  font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer;
  padding: 0; display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: auto;
}
.plat-app-open-btn:hover { opacity: .75; }
.plat-app-open-btn.inactive { color: #94a3b8 !important; cursor: default; }

/* Full-width apps grid (for Applications page � 4 cols) */
.plat-apps-grid-full { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 18px; margin-bottom: 28px; }

/* -- Dashboard grid ---------------------------------------- */
.plat-dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.plat-charts-row { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; margin-bottom: 20px; }
.plat-chart-card {
  background: #fff; border: 1px solid #f1f5f9; border-radius: 14px;
  padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.plat-chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.plat-chart-title  { font-size: 14px; font-weight: 700; color: #0f172a; }
.plat-chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: #64748b; }
.plat-legend-dot   { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
.plat-chart-filter { padding: 4px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; font-size: 12px; color: #374151; cursor: pointer; }

/* -- Right panels v2 --------------------------------------- */
.plat-right-col   { display: flex; flex-direction: column; gap: 16px; }
.plat-panel       { background: #fff; border: 1px solid #f1f5f9; border-radius: 14px; padding: 18px 20px; box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.plat-panel-header{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.plat-panel-title { font-size: 14px; font-weight: 700; color: #0f172a; }
.plat-panel-viewall { font-size: 12px; color: #6366f1; cursor: pointer; font-weight: 600; background: none; border: none; }
.plat-alert-item  { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f8fafc; }
.plat-alert-item:last-child { border-bottom: none; }
.plat-alert-icon  { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.plat-alert-body  { flex: 1; }
.plat-alert-title { font-weight: 600; color: #0f172a; font-size: 12.5px; }
.plat-alert-desc  { color: #64748b; font-size: 11.5px; margin-top: 2px; line-height: 1.4; }
.plat-alert-time  { font-size: 11px; color: #94a3b8; flex-shrink: 0; white-space: nowrap; }
.plat-activity-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f8fafc; }
.plat-activity-item:last-child { border-bottom: none; }
.plat-activity-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.plat-activity-body { flex: 1; }
.plat-activity-title { font-weight: 600; color: #0f172a; font-size: 12.5px; }
.plat-activity-desc  { color: #64748b; font-size: 11.5px; margin-top: 2px; }
.plat-activity-time  { font-size: 11px; color: #94a3b8; flex-shrink: 0; white-space: nowrap; }

/* -- Product stat cards (bottom row) ----------------------- */
.plat-product-stats { display: grid; grid-template-columns: repeat(5,1fr); gap: 16px; }
.plat-prod-stat-card {
  background: #fff; border: 1px solid #e8ecf0; border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.plat-prod-stat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #f8fafc; }
.plat-prod-stat-head i { font-size: 17px; }
.plat-prod-stat-name   { font-size: 12px; font-weight: 600; color: #64748b; }
.plat-prod-stat-metric { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.plat-prod-stat-value  { font-size: 22px; font-weight: 800; color: #0f172a; letter-spacing: -.01em; }
.plat-prod-stat-change { font-size: 12px; color: #15803d; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 3px; }

/* -- Product Hub ------------------------------------------- */
.plat-back-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #374151;
  font-size: 13px; font-weight: 500; cursor: pointer; margin-bottom: 20px; transition: background .1s;
}
.plat-back-btn:hover { background: #f8fafc; }
.plat-product-hub-header {
  display: flex; align-items: center; gap: 18px;
  background: #fff; border: 1px solid #e8ecf0; border-radius: 16px;
  padding: 24px 28px; margin-bottom: 24px; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.plat-product-hub-icon {
  width: 70px; height: 70px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; font-size: 34px; flex-shrink: 0;
}
.plat-product-hub-info h2 { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0 0 4px; }
.plat-product-hub-info p  { font-size: 13px; color: #64748b; margin: 0 0 10px; }
.plat-product-hub-actions { margin-left: auto; display: flex; gap: 10px; flex-shrink: 0; }

/* Client cards */
.plat-client-grid  { display: flex; flex-direction: column; gap: 10px; }
.plat-client-card  {
  background: #fff; border: 1px solid #e8ecf0; border-radius: 13px;
  padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04); transition: box-shadow .15s;
}
.plat-client-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.plat-client-avatar {
  width: 44px; height: 44px; border-radius: 11px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.plat-client-info  { flex: 1; }
.plat-client-name  { font-size: 15px; font-weight: 600; color: #0f172a; }
.plat-client-meta  { font-size: 12px; color: #64748b; margin-top: 3px; }
.plat-client-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* -- Shared extras ----------------------------------------- */
.plat-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.plat-section-title  { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0; }
.plat-section-link   { font-size: 13px; color: #6366f1; font-weight: 600; cursor: pointer; background: none; border: none; }
.plat-date-badge     { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid #e2e8f0; border-radius: 9px; background: #fff; font-size: 13px; color: #374151; cursor: pointer; font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.plat-card           { background: #fff; border: 1px solid #e8ecf0; border-radius: 14px; padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.04); margin-bottom: 20px; }
.plat-empty          { text-align: center; padding: 48px 24px; color: #94a3b8; }
.plat-empty-icon     { font-size: 40px; margin-bottom: 12px; }
.plat-empty-title    { font-size: 16px; font-weight: 600; color: #64748b; margin-bottom: 6px; }
.plat-empty-desc     { font-size: 13px; }
.plat-btn            { padding: 8px 18px; border-radius: 9px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .12s; display: inline-flex; align-items: center; gap: 6px; }

/* ── Notification Bell FAB ──────────────────────────────────────────────────
   Floating action button fixed at bottom-right of the viewport.             */
.notif-bell-container {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 9999;
}
.notif-bell-btn {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(
    150deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(199, 220, 255, 0.52) 55%,
    rgba(255, 235, 180, 0.38) 100%
  );
  backdrop-filter: blur(18px) saturate(200%);
  -webkit-backdrop-filter: blur(18px) saturate(200%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  /* top-edge highlight = key glass refraction trick */
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px rgba(100, 120, 200, 0.12),
    0 8px 28px rgba(99, 102, 241, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.09);
  transition: transform .15s, box-shadow .15s;
  flex-shrink: 0;
}
.notif-bell-btn:hover {
  transform: scale(1.1);
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.95),
    inset 0 -1px 2px rgba(100, 120, 200, 0.15),
    0 10px 32px rgba(99, 102, 241, 0.28),
    0 3px 10px rgba(0, 0, 0, 0.12);
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
  border: 2px solid #fff;
}
.notif-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  z-index: 9999;
  overflow: hidden;
  width: 300px;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}
.notif-mark-read-btn {
  font-size: 11px;
  font-weight: 500;
  color: #6366f1;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.notif-mark-read-btn:hover { background: #f0f0ff; }
.notif-list {
  max-height: 320px;
  overflow-y: auto;
}
.notif-empty {
  padding: 24px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid #f8fafc;
  cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}
.notif-item-msg {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  margin-bottom: 4px;
}
.notif-item-time {
  font-size: 11px;
  color: #94a3b8;
}
.notif-item--callback .notif-item-title { color: #d97706; }
.notif-item--lead_assigned .notif-item-title { color: #0284c7; }
.plat-btn-primary    { background: #6366f1; color: #fff; }
.plat-btn-primary:hover { background: #4f46e5; }
.plat-btn-outline    { background: #fff; color: #374151; border: 1px solid #e2e8f0; }
.plat-btn-outline:hover { background: #f8fafc; }
.plat-btn-sm         { padding: 5px 12px; font-size: 12px; }
.plat-btn-danger     { background: #fee2e2; color: #dc2626; }
.plat-btn-danger:hover { background: #fecaca; }
.plat-badge          { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.plat-badge-active   { background: #dcfce7; color: #16a34a; }
.plat-badge-inactive { background: #f1f5f9; color: #94a3b8; }
.plat-badge-trial    { background: #fef3c7; color: #92400e; }
.plat-badge-coming   { background: #f3e8ff; color: #7c3aed; }
.plat-tabs           { display: flex; gap: 4px; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.plat-tab            { padding: 10px 18px; border: none; background: none; cursor: pointer; font-size: 14px; color: #64748b; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .12s; }
.plat-tab:hover      { color: #374151; }
.plat-tab.active     { color: #6366f1; font-weight: 700; border-bottom-color: #6366f1; }
.plat-table-wrap     { overflow-x: auto; border-radius: 12px; border: 1px solid #e8ecf0; }
.plat-table          { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
.plat-table th       { background: #f8fafc; padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 700; color: #64748b; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid #e8ecf0; white-space: nowrap; }
.plat-table td       { padding: 12px 14px; border-bottom: 1px solid #f8fafc; color: #0f172a; vertical-align: middle; }
.plat-table tr:last-child td { border-bottom: none; }
.plat-table tr:hover td      { background: #fafbfc; }

/* -- Responsive -------------------------------------------- */
@media (max-width: 1280px) {
  .plat-stats-grid   { grid-template-columns: repeat(3, 1fr); }
  .plat-apps-grid    { grid-template-columns: repeat(3, 1fr); }
  .plat-product-stats{ grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .plat-dash-grid    { grid-template-columns: 1fr; }
  .plat-charts-row   { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .plat-sidebar      { width: 200px; }
  .plat-wrapper      { margin-left: 200px; }
}
@media (max-width: 760px) {
  .plat-sidebar      { display: none; }
  .plat-wrapper      { margin-left: 0; }
  .plat-stats-grid   { grid-template-columns: repeat(2,1fr); }
  .plat-apps-grid    { grid-template-columns: repeat(2,1fr); }
}

/* ============================================================
   CRM Responsive Redesign Layer (Mobile + Tablet)
   ============================================================ */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.tablet-sidebar-toggle {
  display: none;
  position: fixed;
  top: 86px;
  left: 248px;
  z-index: 160;
  width: 34px;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: #ffffff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.dash-accordion-item {
  padding: 14px;
}

.dash-accordion-summary {
  list-style: none;
  cursor: default;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  padding: 0 0 10px;
  margin-bottom: 10px;
}

.dash-accordion-summary::-webkit-details-marker {
  display: none;
}

.dash-accordion-body {
  padding: 0;
}

@media (min-width: 769px) and (max-width: 1180px) {
  .layout.sidebar-collapsed .sm-sidebar {
    width: 74px;
  }

  .layout.sidebar-collapsed .sm-sidebar-company,
  .layout.sidebar-collapsed .sm-sidebar-product,
  .layout.sidebar-collapsed .sm-sidebar-user,
  .layout.sidebar-collapsed .sm-sidebar-copy {
    display: none !important;
  }

  .layout.sidebar-collapsed .sm-sidebar-nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .layout.sidebar-collapsed .main-content {
    margin-left: 74px;
  }

  .layout.sidebar-collapsed .tablet-sidebar-toggle {
    left: 62px;
  }

  .dash-charts-row,
  .rpt-two-col {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .sm-btn,
  .button,
  .dash-refresh-btn,
  .ab-row-action-btn,
  .pipeline-card-action-btn,
  .leads-row-action-btn,
  .leads-advanced-toggle-btn,
  .leads-reset-btn,
  .leads-search-inline .dash-refresh-btn {
    min-height: 44px;
  }
}

@media (max-width: 768px) {
  .dash-filters {
    flex-wrap: wrap;
  }

  .dash-filters .dash-filter-ctl {
    min-width: 150px;
  }

  .dash-accordion-item {
    padding: 12px;
  }

  .dash-accordion-summary {
    cursor: pointer;
    position: relative;
    padding-right: 22px;
  }

  .dash-accordion-summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: -1px;
    font-size: 18px;
    color: #64748b;
  }

  .dash-accordion-item[open] .dash-accordion-summary::after {
    content: '-';
  }

  .main-content {
    margin-left: 0 !important;
    width: 100%;
  }

  .dash-kpi-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    grid-template-columns: none;
  }

  .dash-kpi-grid > * {
    min-width: 220px;
    scroll-snap-align: start;
  }

  .dash-status-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    grid-template-columns: none;
    padding-bottom: 4px;
  }

  .dash-status-grid > * {
    min-width: 138px;
    flex: 0 0 auto;
  }

  .ab-kpi-strip,
  .ab-kpi-strip-skeleton {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    grid-template-columns: none;
  }

  .ab-kpi-tab {
    min-width: 165px;
    flex: 0 0 auto;
  }

  .ab-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .ab-row-shell {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 10px;
    background: #fff;
  }

  .ab-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ab-row-actions button,
  .ab-row-status-cell select {
    min-height: 44px;
  }

  .pipeline-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    grid-template-columns: none !important;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
  }

  .pipeline-col {
    min-width: 88vw;
    flex: 0 0 88vw;
    scroll-snap-align: start;
  }

  .leads-table,
  .team-table {
    border: none;
  }

  .leads-table tr,
  .team-table tr {
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
  }

  .leads-table td,
  .team-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
  }

  .leads-table td::before,
  .team-table td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .05em;
    min-width: 94px;
  }

  .leads-table td[data-label="Select"]::before {
    content: '';
    min-width: 0;
  }

  .leads-row-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .leads-row-action-btn,
  .team-actions-cell .button {
    min-height: 44px;
  }

  .projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .project-card {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    padding: 12px;
  }

  .project-card-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
  }

  .project-card-meta {
    font-size: 12px;
    color: #334155;
    margin-bottom: 5px;
  }

  .project-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  #rqBulkBar {
    position: sticky;
    bottom: 10px;
    z-index: 30;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  }

  .rq-bulk-main-row {
    grid-template-columns: 1fr;
  }

  .rq-bulk-count,
  .rq-bulk-reason-wrap,
  .rq-bulk-actions {
    grid-column: auto;
  }

  .rq-bulk-actions {
    width: 100%;
  }

  .rq-bulk-actions .button,
  .rq-bulk-actions button {
    flex: 1 1 auto;
  }

  #rqLeadList > div[id^="rqRow_"] {
    align-items: flex-start !important;
    flex-wrap: wrap;
    gap: 10px !important;
  }

  #rqLeadList > div[id^="rqRow_"] button {
    min-height: 44px;
  }
}


/* ============================================================
   v2 EDITORIAL DESIGN SYSTEM � Typography & UI Components
   Matches sociomonkey-v2.vercel.app design language.
   ============================================================ */

/* -- Section Label ------------------------------------------- */
/* Usage: <p class="section-label">WHO WE WORK WITH</p>       */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sm-muted);
  margin-bottom: 10px;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sm-brand);
  flex-shrink: 0;
}

/* -- Page Titles (editorial) -------------------------------- */
.page-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  color: var(--sm-ink);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-2);
}

.page-title .brand-dot {
  color: var(--sm-brand);
}

.page-subtitle {
  font-size: var(--text-md);
  color: var(--sm-body);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  margin: 0;
}

/* -- Eyebrow / Overline -------------------------------------- */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--sm-brand);
  display: block;
  margin-bottom: var(--space-2);
}

/* -- Kicker number (like "01", "02" service cards) ----------- */
.kicker-num {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--sm-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* -- Clean Data Card ----------------------------------------- */
/* Minimal v2-style card � border only, no shadow on default  */
.data-card {
  background: var(--sm-surface-alt);
  border: 1px solid var(--sm-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}

.data-card-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sm-muted);
  margin-bottom: var(--space-2);
}

.data-card-value {
  font-size: 28px;
  font-weight: var(--weight-extrabold);
  color: var(--sm-ink);
  line-height: 1;
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}

.data-card-sub {
  font-size: var(--text-sm);
  color: var(--sm-muted);
}

/* -- Red accent badge ---------------------------------------- */
.badge-brand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--sm-brand-soft);
  color: var(--sm-brand);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* -- Ink badge (dark label pill) ----------------------------- */
.badge-ink {
  display: inline-flex;
  align-items: center;
  background: var(--sm-ink);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* -- Divider with label -------------------------------------- */
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--sm-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: var(--space-5) 0;
}

.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sm-divider);
}

/* -- Link with arrow (v2 style inline links) ----------------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--sm-ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--sm-ink);
  padding-bottom: 1px;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}

.link-arrow:hover {
  color: var(--sm-brand);
  border-color: var(--sm-brand);
}

/* -- Empty state --------------------------------------------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--sm-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--sm-ink);
  margin: 0 0 var(--space-2);
}

.empty-state-desc {
  font-size: var(--text-base);
  color: var(--sm-muted);
  max-width: 360px;
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-5);
}

/* -- Page header row (section above content) ----------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--sm-divider);
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* -- Text utilities ------------------------------------------ */
.text-brand  { color: var(--sm-brand); }
.text-ink    { color: var(--sm-ink); }
.text-body   { color: var(--sm-body); }
.text-muted  { color: var(--sm-muted); }
.text-bold   { font-weight: var(--weight-bold); }
.text-xbold  { font-weight: var(--weight-extrabold); }
.text-upper  { text-transform: uppercase; letter-spacing: 0.06em; }
.text-tight  { line-height: var(--leading-tight); }
