/* ============================================================
 * Reon Design System — Atomic primitives, molecules, organisms
 * Strict 3-color palette: Cream #F4F4F2 · Slate #2F4F4F · Maroon #7E2217
 * Typography: Space Grotesk (display) · Inter (body) · JetBrains Mono
 * Loaded BEFORE brand-overrides.css to allow page-specific overrides
 * ============================================================ */

/* ════════════════════════════════════════════════════════════
 * ATOMS
 * ════════════════════════════════════════════════════════════ */

/* === Atom: Button ===
 * <button class="atom-btn atom-btn--primary">…</button>
 * Variants: primary | secondary | outline | danger | ghost
 * Sizes:    --sm | (default) | --lg
 */
.atom-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.005em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--canvas-elevated);
  color: var(--slate-900);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.atom-btn:focus-visible { outline: 3px solid var(--accent-200); outline-offset: 2px; }
.atom-btn:active { transform: translateY(0) scale(0.98); }
.atom-btn:disabled, .atom-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

.atom-btn--primary {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #FBFAF8;
  box-shadow: 0 8px 18px -6px rgba(126,34,23,0.40),
              inset 0 1px 0 rgba(255,255,255,0.16);
}
.atom-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -8px rgba(126,34,23,0.55),
              inset 0 1px 0 rgba(255,255,255,0.20);
}

.atom-btn--secondary {
  background: var(--slate-900);
  color: #FBFAF8;
}
.atom-btn--secondary:hover { background: var(--slate-700); transform: translateY(-1px); }

.atom-btn--outline {
  background: transparent;
  color: var(--slate-900);
  border-color: rgba(47,79,79,0.20);
}
.atom-btn--outline:hover {
  background: var(--canvas-muted);
  border-color: var(--slate-700);
}

.atom-btn--danger {
  background: var(--accent-600);
  color: #FBFAF8;
}
.atom-btn--danger:hover { background: var(--accent-500); transform: translateY(-1px); }

.atom-btn--ghost {
  background: transparent;
  color: var(--slate-700);
}
.atom-btn--ghost:hover { background: var(--canvas-muted); color: var(--slate-900); }

.atom-btn--sm { padding: 7px 12px; font-size: 12.5px; gap: 6px; }
.atom-btn--lg { padding: 14px 24px; font-size: 16px; gap: 10px; }
.atom-btn--icon { padding: 9px; aspect-ratio: 1; }
.atom-btn--block { width: 100%; }

.atom-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.atom-btn--lg svg { width: 18px; height: 18px; }
.atom-btn--sm svg { width: 14px; height: 14px; }

/* === Atom: Input === */
.atom-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--canvas-elevated);
  border: 1.5px solid rgba(47,79,79,0.14);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--slate-900);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}
.atom-input::placeholder { color: var(--ink-muted); }
.atom-input:hover { border-color: rgba(47,79,79,0.30); }
.atom-input:focus {
  outline: none;
  border-color: var(--accent-500);
  box-shadow: 0 0 0 3px rgba(126,34,23,0.16);
  background: #FFFFFF;
}
.atom-input--sm { padding: 7px 10px; font-size: 13px; }
.atom-input[type="search"] { padding-left: 36px; }

/* === Atom: Select === */
select.atom-input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232F4F4F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}

/* === Atom: Badge === */
.atom-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--slate-100);
  color: var(--slate-700);
}
.atom-badge--success { background: var(--slate-100); color: var(--slate-900); border-color: var(--slate-200); }
.atom-badge--warning { background: rgba(126,34,23,0.10); color: var(--accent-500); border-color: rgba(126,34,23,0.25); }
.atom-badge--danger  { background: var(--accent-500); color: #FBFAF8; }
.atom-badge--info    { background: var(--slate-100); color: var(--slate-700); border-color: var(--slate-200); }
.atom-badge--solid   { background: var(--slate-900); color: #FBFAF8; }

.atom-badge .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* === Atom: Avatar === */
.atom-avatar {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
  border: 1.5px solid var(--canvas-elevated);
  box-shadow: 0 0 0 1px rgba(47,79,79,0.06);
  overflow: hidden;
  flex-shrink: 0;
}
.atom-avatar img { width: 100%; height: 100%; object-fit: cover; }
.atom-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.atom-avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.atom-avatar--accent { background: var(--accent-200); color: var(--accent-600); }

/* === Atom: Divider === */
.atom-divider {
  height: 1px;
  width: 100%;
  background: rgba(47,79,79,0.10);
  border: 0;
  margin: 0;
}

/* ════════════════════════════════════════════════════════════
 * MOLECULES
 * ════════════════════════════════════════════════════════════ */

/* === Molecule: Form Field (label + input + hint/error) === */
.mol-field { display: flex; flex-direction: column; gap: 6px; }
.mol-field-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--slate-900);
  letter-spacing: 0.01em;
}
.mol-field-hint { font-size: 11.5px; color: var(--ink-muted); font-weight: 500; }
.mol-field-error { font-size: 11.5px; color: var(--accent-500); font-weight: 700; }

/* === Molecule: City Filter pill group ===
 * <div class="mol-city-filter">
 *   <button class="mol-city-filter-pill is-active">All</button>
 *   <button class="mol-city-filter-pill">Louisville</button> …
 * </div>
 */
.mol-city-filter {
  display: inline-flex;
  background: var(--canvas-elevated);
  border: 1px solid rgba(47,79,79,0.10);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.mol-city-filter-pill {
  padding: 7px 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--slate-700);
  border: 0;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
}
.mol-city-filter-pill:hover { background: var(--canvas-muted); color: var(--slate-900); }
.mol-city-filter-pill.is-active {
  background: var(--slate-900);
  color: #FBFAF8;
}

/* === Molecule: Category Badge (New/Part/Recall) === */
.mol-cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  border-radius: 6px;
  border: 1px solid;
}
.mol-cat-badge--new    { background: var(--slate-100); color: var(--slate-900); border-color: var(--slate-200); }
.mol-cat-badge--part   { background: rgba(126,34,23,0.10); color: var(--accent-500); border-color: rgba(126,34,23,0.30); }
.mol-cat-badge--recall { background: var(--accent-500); color: #FBFAF8; border-color: var(--accent-500); }

/* === Molecule: Attribution Badge (GBP/Yelp/Nextdoor/etc.) === */
.mol-attr-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  border-radius: 6px;
  background: var(--canvas-muted);
  color: var(--slate-900);
  border: 1px solid rgba(47,79,79,0.10);
}
.mol-attr-badge::before {
  content: ''; display: inline-block;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent-500);
}

/* ════════════════════════════════════════════════════════════
 * ORGANISMS
 * ════════════════════════════════════════════════════════════ */

/* === Organism: GlobalSidebar (256px fixed left, desktop only) === */
.org-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 256px;
  background: var(--slate-900);
  color: var(--cream-200);
  display: none;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  padding: 20px 16px 28px;
  box-shadow: 1px 0 0 rgba(0,0,0,0.10);
}
@media (min-width: 1024px) { .org-sidebar { display: flex; } }

.org-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}
.org-sidebar-brand img {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--cream-200);
  padding: 4px;
}
.org-sidebar-brand .meta {
  display: flex; flex-direction: column;
  line-height: 1.15;
}
.org-sidebar-brand .meta strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14.5px;
  color: #FBFAF8;
  letter-spacing: -0.01em;
}
.org-sidebar-brand .meta span {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-200);
  font-weight: 700;
  margin-top: 2px;
}

.org-sidebar-section {
  margin-top: 16px;
}
.org-sidebar-section-title {
  padding: 0 12px 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244,244,242,0.42);
}

.org-sidebar-nav {
  display: flex; flex-direction: column;
  gap: 2px;
}
.org-sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  color: rgba(244,244,242,0.78);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-align: left;
  border: 0;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
  position: relative;
}
.org-sidebar-nav-item:hover {
  background: rgba(244,244,242,0.06);
  color: #FBFAF8;
}
.org-sidebar-nav-item.is-active {
  background: linear-gradient(135deg, rgba(126,34,23,0.30), rgba(126,34,23,0.14));
  color: #FBFAF8;
  border: 1px solid rgba(126,34,23,0.40);
  padding: 9px 11px;
}
.org-sidebar-nav-item.is-active::before {
  content: ''; position: absolute;
  left: -16px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px;
  border-radius: 3px;
  background: var(--accent-500);
}
.org-sidebar-nav-item svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  stroke-width: 1.8;
}
.org-sidebar-nav-item .count {
  margin-left: auto;
  background: rgba(126,34,23,0.50);
  color: #FBFAF8;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  min-width: 22px; text-align: center;
}

.org-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.org-sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 140ms ease;
}
.org-sidebar-user:hover { background: rgba(255,255,255,0.08); }
.org-sidebar-user .meta {
  display: flex; flex-direction: column; min-width: 0;
  line-height: 1.15;
}
.org-sidebar-user .meta strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  color: #FBFAF8;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-sidebar-user .meta span {
  font-size: 10.5px;
  color: rgba(244,244,242,0.50);
  margin-top: 1px;
}

/* === Organism: Top bar (desktop) ===
 * Lives inside the content shell, shows search + actions + user
 */
.org-topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(244,244,242,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(47,79,79,0.08);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
}
.org-topbar-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  color: var(--slate-900);
}
.org-topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.org-topbar-search svg {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--ink-muted);
}
.org-topbar-actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}

/* === Organism: Content Shell (everything to the right of sidebar) === */
.org-content-shell {
  min-height: 100vh;
  padding-left: 0;
  background: var(--canvas-base);
}
@media (min-width: 1024px) {
  .org-content-shell { padding-left: 256px; }
}
.org-content-body {
  padding: 24px;
  padding-bottom: 96px;  /* mobile bottom nav clearance */
}
@media (min-width: 1024px) {
  .org-content-body { padding: 28px 32px 40px; }
}

/* === Organism: Bottom nav (mobile only) ===
 * 5 primary items, fixed bottom, slate-900 surface
 */
.org-bottom-nav {
  display: flex;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--slate-900);
  border-top: 1px solid rgba(255,255,255,0.10);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px -12px rgba(0,0,0,0.25);
}
@media (min-width: 1024px) { .org-bottom-nav { display: none; } }
.org-bottom-nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px;
  background: transparent;
  border: 0;
  color: rgba(244,244,242,0.62);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 140ms ease;
  position: relative;
}
.org-bottom-nav-item svg { width: 22px; height: 22px; stroke-width: 1.8; }
.org-bottom-nav-item.is-active { color: var(--accent-200); }
.org-bottom-nav-item.is-active::before {
  content: ''; position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 0 0 4px 4px;
  background: var(--accent-500);
}

/* === Organism: More-tabs sheet (mobile only popover) === */
.org-more-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: #FBFAF8;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 16px 16px 32px;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 -16px 40px -8px rgba(0,0,0,0.30);
  max-height: 70vh; overflow-y: auto;
}
.org-more-sheet.is-open { transform: translateY(0); }
.org-more-sheet-handle {
  width: 40px; height: 4px;
  background: rgba(47,79,79,0.18);
  border-radius: 2px;
  margin: 4px auto 16px;
}
.org-more-sheet h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--slate-900);
  margin-bottom: 12px;
}
.org-more-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}
.org-more-sheet-grid button {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px;
  background: var(--canvas-elevated);
  border: 1px solid rgba(47,79,79,0.10);
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--slate-900);
  cursor: pointer;
  text-align: left;
  transition: background 140ms ease, border-color 140ms ease;
}
.org-more-sheet-grid button:hover { background: var(--canvas-muted); border-color: var(--slate-700); }
.org-more-sheet-grid button svg { width: 18px; height: 18px; flex-shrink: 0; }
.org-more-sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,51,51,0.50);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
  z-index: 55;
}
.org-more-sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }

/* === Hide legacy crm-tabs header (replaced by sidebar/bottom nav) === */
.crm-tabs-legacy { display: none !important; }


/* ════════════════════════════════════════════════════════════
 * SKELETON LOADERS (U-2)
 * Subtle shimmer using the strict palette — no purple/blue.
 * ════════════════════════════════════════════════════════════ */
@keyframes reon-skeleton-shimmer {
  0%   { background-position: -240px 0; }
  100% { background-position:  240px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(47, 79, 79, 0.08) 0%,
    rgba(47, 79, 79, 0.15) 50%,
    rgba(47, 79, 79, 0.08) 100%
  );
  background-size: 240px 100%;
  background-repeat: no-repeat;
  border-radius: 6px;
  animation: reon-skeleton-shimmer 1.4s ease-in-out infinite;
  display: inline-block;
  min-height: 12px;
  color: transparent;
  user-select: none;
}
.skeleton-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.skeleton-row + .skeleton-row { border-top: 1px solid rgba(47, 79, 79, 0.08); }
.skeleton-cell { flex: 1; min-height: 14px; border-radius: 4px; }
.skeleton-cell.w-sm { flex: 0 0 80px; }
.skeleton-cell.w-md { flex: 0 0 140px; }
.skeleton-cell.w-pill { flex: 0 0 64px; height: 22px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ════════════════════════════════════════════════════════════
 * ORGANISM · DataTable — responsive
 * Desktop ≥1024px: classic dense table with sticky header.
 * Mobile  <1024px: each <tr> becomes a stacked card; each <td>
 * shows its column label via `data-label` attribute.
 * ════════════════════════════════════════════════════════════ */
.org-data-table { width: 100%; }
.org-data-table table { width: 100%; border-collapse: collapse; }
.org-data-table thead th {
  position: sticky; top: 0; z-index: 4;
  background: var(--cream-100);
  border-bottom: 1px solid rgba(47, 79, 79, 0.12);
}

/* ── Sortable / searchable enhancement (U-3) ── */
.org-data-table thead th.dt-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.org-data-table thead th.dt-sortable::after {
  content: '↕';
  margin-left: 6px;
  font-size: 9px;
  opacity: 0.35;
  font-weight: 900;
  letter-spacing: 0;
}
.org-data-table thead th.dt-sortable[aria-sort="ascending"]::after {
  content: '↑';
  opacity: 1;
  color: #7E2217;
}
.org-data-table thead th.dt-sortable[aria-sort="descending"]::after {
  content: '↓';
  opacity: 1;
  color: #7E2217;
}
.org-data-table-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(47, 79, 79, 0.04);
  border-bottom: 1px solid rgba(47, 79, 79, 0.08);
}
.org-data-table-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(47, 79, 79, 0.18);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  background: #fff;
  color: #2F4F4F;
  outline: none;
}
.org-data-table-toolbar input[type="search"]:focus {
  border-color: #7E2217;
  box-shadow: 0 0 0 3px rgba(126, 34, 23, 0.12);
}
.org-data-table-toolbar .dt-count {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(47, 79, 79, 0.6);
  white-space: nowrap;
}
.org-data-table tbody tr.dt-hidden { display: none !important; }
.org-data-table tbody tr.dt-empty td {
  text-align: center !important;
  padding: 24px 12px !important;
  color: rgba(47, 79, 79, 0.5);
  font-size: 12px;
}
@media (max-width: 1023px) {
  .org-data-table thead th.dt-sortable { display: none; }
}

/* ── Mobile card layout ── */
@media (max-width: 1023px) {
  .org-data-table table,
  .org-data-table thead,
  .org-data-table tbody,
  .org-data-table tr,
  .org-data-table td { display: block; width: 100%; }
  .org-data-table thead { display: none; }
  .org-data-table tr {
    background: #fff;
    border: 1px solid rgba(47, 79, 79, 0.12);
    border-radius: 14px;
    margin: 0 0 10px;
    padding: 12px 14px 14px;
    box-shadow: 0 2px 0 rgba(47, 79, 79, 0.03);
    position: relative;
  }
  .org-data-table tr:not(.skeleton-tr):hover {
    border-color: rgba(126, 34, 23, 0.35);
  }
  .org-data-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: none !important;
    text-align: right;
    min-height: 22px;
  }
  .org-data-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(47, 79, 79, 0.55);
    font-weight: 800;
    text-align: left;
  }
  /* The "Open →" hint cell becomes a full-width footer */
  .org-data-table td.dt-action {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed rgba(47, 79, 79, 0.15) !important;
    justify-content: flex-end;
  }
  .org-data-table td.dt-action::before { display: none; }
  /* Hide truly-empty cells on mobile to keep cards tight */
  .org-data-table td:empty { display: none; }
  /* Filter bar above the table — let inputs wrap nicely */
  .org-data-table-filterbar { flex-wrap: wrap; }
  /* TOTAL summary row (e.g. payroll run) — emphasize on mobile */
  .org-data-table tr.dt-total-row {
    background: #2F4F4F !important;
    color: #F4F4F2;
    border: 1px solid #2F4F4F !important;
  }
  .org-data-table tr.dt-total-row td::before { color: rgba(244,244,242,.65); }
  .org-data-table tr.dt-total-row td:first-child {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 900;
    border-bottom: 1px solid rgba(244,244,242,.18) !important;
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
}

/* ════════════════════════════════════════════════════════════
 * ORGANISM · VoIP ScreenPop toast
 * Top-right floating card that auto-appears when SSE call.ringing
 * fires AND we have an open job for the caller.
 * ════════════════════════════════════════════════════════════ */
.org-screenpop {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 70;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid rgba(47, 79, 79, 0.16);
  border-left: 4px solid var(--maroon-500, #7E2217);
  border-radius: 14px;
  box-shadow: 0 18px 40px -8px rgba(47, 79, 79, 0.28);
  padding: 14px 16px 12px;
  transform: translateX(380px);
  transition: transform 280ms cubic-bezier(.4, 1.4, .4, 1);
  font-family: inherit;
}
.org-screenpop.is-open { transform: translateX(0); }
.org-screenpop-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.org-screenpop-pulse {
  width: 10px; height: 10px;
  background: var(--maroon-500, #7E2217);
  border-radius: 999px;
  animation: screenpop-pulse 1.1s ease-in-out infinite;
}
@keyframes screenpop-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.35); }
}
.org-screenpop-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--maroon-500, #7E2217);
  font-weight: 900;
  flex: 1;
}
.org-screenpop-close {
  appearance: none;
  background: transparent;
  border: 0;
  font-size: 20px;
  line-height: 1;
  color: rgba(47, 79, 79, 0.55);
  cursor: pointer;
  padding: 0 4px;
}
.org-screenpop-close:hover { color: var(--maroon-500, #7E2217); }
.org-screenpop-name {
  font-weight: 900;
  font-size: 17px;
  letter-spacing: -0.2px;
  color: #2F4F4F;
  margin-bottom: 2px;
}
.org-screenpop-phone {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  color: rgba(47, 79, 79, 0.7);
  margin-bottom: 8px;
}
.org-screenpop-meta {
  font-size: 11.5px;
  color: rgba(47, 79, 79, 0.7);
  line-height: 1.5;
  margin-bottom: 10px;
}
.org-screenpop-meta strong { color: #2F4F4F; font-weight: 800; }
.org-screenpop-actions {
  display: flex; gap: 8px;
}
.org-screenpop-actions .atom-btn { flex: 1; justify-content: center; }
.org-screenpop-sse {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.18em;
  font-weight: 800;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
}
.org-screenpop-sse[data-state="connecting"] { background: rgba(126, 34, 23, .1); color: #7E2217; }
.org-screenpop-sse[data-state="live"]       { background: rgba(47, 79, 79, .08); color: #2F4F4F; }
.org-screenpop-sse[data-state="error"]      { background: rgba(126, 34, 23, .12); color: #7E2217; }
.org-screenpop-sse-dot {
  width: 6px; height: 6px; border-radius: 999px; background: currentColor;
}
.org-screenpop-sse[data-state="live"] .org-screenpop-sse-dot {
  animation: screenpop-pulse 1.8s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .org-screenpop { transition: none; }
  .org-screenpop-pulse,
  .org-screenpop-sse[data-state="live"] .org-screenpop-sse-dot { animation: none; }
}

