/* ============================================================
   Alerts 2.0 module (/alerts) — dashboard, rules, event catalog.
   Builds on zone-alerts.css / unified-popup.css; only module-specific
   pieces live here. Prefix: alm-
   ============================================================ */

.realtime-theme .alm-page {
  /* Fill the space next to the sidebar — a centered max-width cap left a
     dead gap on wide screens and shrank the module at every resolution. */
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 20px 28px 80px;
}

/* ── Tabs ── */
.realtime-theme .alm-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.realtime-theme .alm-tab {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6d6c6c;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.realtime-theme .alm-tab:hover { background: #f3f4f6; color: #1a1a1a; }
.realtime-theme .alm-tab.active {
  background: #fce6e8;
  border-color: #e12424;
  color: #e12424;
}

/* ── KPI tiles ── */
.realtime-theme .alm-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.realtime-theme .alm-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.realtime-theme .alm-kpi:hover { border-color: #9a9a9a; }
.realtime-theme .alm-kpi.selected {
  border-color: #e12424;
  box-shadow: 0 0 0 1px #e12424;
}
.realtime-theme .alm-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #6d6c6c;
  display: flex;
  align-items: center;
  gap: 6px;
}
.realtime-theme .alm-kpi-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.realtime-theme .alm-kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

/* ── Pills ── */
.realtime-theme .alm-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.realtime-theme .alm-sev-critical { background: #fee2e2; color: #b91c1c; }
.realtime-theme .alm-sev-high     { background: #ffedd5; color: #c2410c; }
.realtime-theme .alm-sev-medium   { background: #fff3c0; color: #8a7107; }
.realtime-theme .alm-sev-low      { background: #e2e8f0; color: #475569; }
.realtime-theme .alm-st-active       { background: #fee2e2; color: #b91c1c; }
.realtime-theme .alm-st-acknowledged { background: #dbeafe; color: #1d4ed8; }
.realtime-theme .alm-st-resolved     { background: #e2e8f0; color: #475569; }
.realtime-theme .alm-st-failed       { background: #fee2e2; color: #b91c1c; }
.realtime-theme .alm-st-suppressed   { background: #fff3c0; color: #8a7107; }
.realtime-theme .alm-st-sent         { background: #dcf1e4; color: #16a34a; }
.realtime-theme .alm-cond-pos { background: #dcf1e4; color: #16a34a; }
.realtime-theme .alm-cond-neg { background: #ede9fe; color: #6d28d9; }
.realtime-theme .alm-badge-live    { background: #dcf1e4; color: #16a34a; }
.realtime-theme .alm-badge-planned { background: #f3f4f6; color: #6d6c6c; }
.realtime-theme .alm-badge-soon    { background: #fff3c0; color: #8a7107; }

/* ── Feed filters ── */
.realtime-theme .alm-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 4px 0 14px;
}
.realtime-theme .alm-filters input,
.realtime-theme .alm-filters select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #1a1a1a;
}
.realtime-theme .alm-filters input { flex: 1 1 200px; max-width: 300px; }

/* ── Row helpers ── */
.realtime-theme .alm-cell-sub { font-size: 11.5px; color: #6d6c6c; margin-top: 1px; }
.realtime-theme .alm-rowlink { cursor: pointer; }
.realtime-theme .alm-rowlink:hover td { background: #f6f6f6; }

/* ── Drawer ── */
.realtime-theme .alm-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.35);
  z-index: 70;
}
.realtime-theme .alm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(520px, 100vw);
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}
.realtime-theme .alm-drawer-head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.realtime-theme .alm-drawer-head h3 { margin: 0 0 2px; font-size: 16px; font-weight: 700; }
.realtime-theme .alm-drawer-body { overflow-y: auto; padding: 16px 22px 26px; flex: 1; }
.realtime-theme .alm-drawer-actions {
  display: flex;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid #e5e7eb;
}
.realtime-theme .alm-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 16px;
}
.realtime-theme .alm-detail-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9a9a9a;
}
.realtime-theme .alm-detail-value { font-size: 13px; font-weight: 600; margin-top: 1px; }

/* Evidence placeholder */
.realtime-theme .alm-evidence {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: linear-gradient(160deg, #2a2f36, #171a1f);
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.realtime-theme .alm-evidence span { color: #8b929b; font-size: 12px; font-weight: 600; }
.realtime-theme .alm-evidence img { width: 100%; height: 100%; object-fit: contain; }

/* Audit timeline */
.realtime-theme .alm-audit { list-style: none; margin: 0; padding: 0; }
.realtime-theme .alm-audit li {
  display: flex;
  gap: 10px;
  position: relative;
  padding-bottom: 14px;
  font-size: 12.5px;
}
.realtime-theme .alm-audit li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e5e7eb;
}
.realtime-theme .alm-audit li:last-child::before { display: none; }
.realtime-theme .alm-audit-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e12424;
  margin-top: 2px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.realtime-theme .alm-audit-time { font-size: 10.5px; color: #9a9a9a; }

/* ── Event Catalog ── */
.realtime-theme .alm-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.realtime-theme .alm-activity-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.realtime-theme .alm-activity-card.ghost {
  border-style: dashed;
  background: transparent;
  color: #6d6c6c;
}
.realtime-theme .alm-activity-name { font-weight: 700; font-size: 14px; }
.realtime-theme .alm-activity-desc { color: #6d6c6c; font-size: 12.5px; }

/* ── Form extras (condition/severity segments, checkbox groups) ── */
.realtime-theme .alm-seg-group { display: flex; gap: 6px; flex-wrap: wrap; }
.realtime-theme .alm-seg {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: #6d6c6c;
  cursor: pointer;
}
.realtime-theme .alm-seg.on         { background: #fce6e8; color: #e12424; border-color: currentColor; }
.realtime-theme .alm-seg.on-pos      { background: #dcf1e4; color: #16a34a; border-color: currentColor; }
.realtime-theme .alm-seg.on-neg      { background: #ede9fe; color: #6d28d9; border-color: currentColor; }
.realtime-theme .alm-seg.on-critical { background: #fee2e2; color: #b91c1c; border-color: currentColor; }
.realtime-theme .alm-seg.on-high     { background: #ffedd5; color: #c2410c; border-color: currentColor; }
.realtime-theme .alm-seg.on-medium   { background: #fff3c0; color: #8a7107; border-color: currentColor; }
.realtime-theme .alm-seg.on-low      { background: #e2e8f0; color: #475569; border-color: currentColor; }
.realtime-theme .alm-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f6f6f6;
  max-height: 150px;
  overflow-y: auto;
}
.realtime-theme .alm-check-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  cursor: pointer;
}
.realtime-theme .alm-check-group input { accent-color: #e12424; }
.realtime-theme .alm-recipients-note { font-size: 11.5px; color: #6d6c6c; margin-top: 6px; }
.realtime-theme .alm-custom-shift-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.realtime-theme .alm-time-input { max-width: 130px; }
.realtime-theme .alm-help { font-size: 11.5px; color: #6d6c6c; margin-top: 4px; }

/* Pagination */
.realtime-theme .alm-paging {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 0 0;
  font-size: 12.5px;
  color: #6d6c6c;
}
.realtime-theme .alm-paging button {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.realtime-theme .alm-paging button:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 720px) {
  .realtime-theme .alm-page { padding: 14px 12px 60px; }
  .realtime-theme .alm-detail-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Rule form modal — ported 1:1 from the approved demo design.
   Self-contained (does not use unified-popup).
   ============================================================ */
.realtime-theme .alm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  z-index: 60;
  overflow-y: auto;
}
.realtime-theme .alm-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.realtime-theme .alm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.realtime-theme .alm-modal-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: #1a1a1a; }
.realtime-theme .alm-modal-close {
  border: none;
  background: #f3f4f6;
  color: #6d6c6c;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.realtime-theme .alm-modal-close:hover { background: #e5e7eb; color: #1a1a1a; }
.realtime-theme .alm-modal-body {
  padding: 18px 24px 8px;
}
.realtime-theme .alm-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.realtime-theme .alm-form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.realtime-theme .alm-form-field.full { grid-column: 1 / -1; }
.realtime-theme .alm-form-label { font-size: 12px; font-weight: 600; color: #6d6c6c; }
.realtime-theme .alm-input,
.realtime-theme .alm-select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  background: #fff;
  color: #1a1a1a;
  width: 100%;
  box-sizing: border-box;
}
.realtime-theme .alm-input:focus,
.realtime-theme .alm-select:focus { outline: 2px solid #e12424; outline-offset: 1px; }
.realtime-theme .alm-select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236d6c6c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.realtime-theme .alm-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid #e5e7eb;
  margin-top: 10px;
}
.realtime-theme .alm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.realtime-theme .alm-btn:hover { background: #f3f4f6; }
.realtime-theme .alm-btn-primary { background: #e12424; border-color: #e12424; color: #fff; }
.realtime-theme .alm-btn-primary:hover { background: #c11d1d; }

/* Multi-select dropdown (zones, roles) — same as the demo */
.realtime-theme .alm-mselect { position: relative; }
.realtime-theme .alm-ms-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #1a1a1a;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.realtime-theme .alm-ms-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.realtime-theme .alm-ms-label.placeholder { color: #9a9a9a; }
.realtime-theme .alm-ms-caret { color: #6d6c6c; font-size: 11px; flex-shrink: 0; }
.realtime-theme .alm-ms-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  z-index: 75;
  max-height: 210px;
  overflow-y: auto;
  padding: 6px;
}
.realtime-theme .alm-ms-opt {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}
.realtime-theme .alm-ms-opt:hover { background: #f3f4f6; }
.realtime-theme .alm-ms-opt input { accent-color: #e12424; }

/* Destination row + chips — same as the demo */
.realtime-theme .alm-dest-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.realtime-theme .alm-dest-row .alm-select { max-width: 180px; }
.realtime-theme .alm-dest-row .alm-input { flex: 1; min-width: 180px; }
.realtime-theme .alm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.realtime-theme .alm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}
.realtime-theme .alm-chip-x {
  border: none;
  background: none;
  color: #6d6c6c;
  font-size: 13px;
  cursor: pointer;
  padding: 0 0 0 2px;
  line-height: 1;
}
.realtime-theme .alm-chip-x:hover { color: #e12424; }
.realtime-theme .alm-error { color: #b91c1c; font-size: 12px; margin-top: 4px; }

/* Toggle switch (self-contained) */
.realtime-theme .alm-switch { position: relative; display: inline-block; width: 38px; height: 21px; }
.realtime-theme .alm-switch input { opacity: 0; width: 0; height: 0; }
.realtime-theme .alm-switch .alm-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.15s ease;
  cursor: pointer;
}
.realtime-theme .alm-switch .alm-track::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.realtime-theme .alm-switch input:checked + .alm-track { background: #16a34a; }
.realtime-theme .alm-switch input:checked + .alm-track::before { transform: translateX(17px); }

@media (max-width: 640px) {
  .realtime-theme .alm-form-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Prototype shell: left sidebar + module topbar (visbi-alerts-prototype)
   ============================================================ */
.realtime-theme .alm-shell { display: flex; min-height: 100vh; background: #f5f6f8; }
.realtime-theme .alm-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.realtime-theme .alm-side-logo {
  height: 64px;
  flex-shrink: 0;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.realtime-theme .alm-logo-row { display: flex; align-items: center; gap: 7px; }
.realtime-theme .alm-logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #e12424;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.realtime-theme .alm-logo-row .alm-logo-name { font-weight: 800; font-size: 15px; color: #1a1a1a; }
.realtime-theme .alm-side-tagline { font-size: 10px; font-weight: 500; color: #6d6c6c; }
.realtime-theme .alm-side-nav { display: flex; flex-direction: column; gap: 4px; padding: 16px 12px; }
.realtime-theme .alm-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  font-family: inherit;
  cursor: pointer;
}
.realtime-theme .alm-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; color: #6d6c6c; }
.realtime-theme .alm-nav-item:hover { background: #f3f4f6; }
.realtime-theme .alm-nav-item.active { background: #fce6e8; color: #e12424; }
.realtime-theme .alm-nav-item.active svg { color: #e12424; }
.realtime-theme .alm-side-foot {
  margin-top: auto;
  padding: 14px 16px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #9a9a9a;
  border-top: 1px solid #e5e7eb;
}
.realtime-theme .alm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.realtime-theme .alm-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
}
.realtime-theme .alm-topbar-crumb { font-size: 13px; font-weight: 600; color: #6d6c6c; }
.realtime-theme .alm-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.realtime-theme .alm-bell {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6d6c6c;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.realtime-theme .alm-bell:hover { background: #f3f4f6; color: #1a1a1a; }
.realtime-theme .alm-store-select {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 7px 30px 7px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #1a1a1a;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236d6c6c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.realtime-theme .alm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e12424, #1a1a1a);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.realtime-theme .alm-logout {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #1a1a1a;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.realtime-theme .alm-logout:hover { background: #f3f4f6; }

/* Page heading (h1 + subtitle) */
.realtime-theme .alm-page-head { margin-bottom: 16px; }
.realtime-theme .alm-page-head h1 { margin: 0; font-size: 22px; font-weight: 700; color: #1a1a1a; line-height: 1.2; }
.realtime-theme .alm-page-sub { font-size: 12px; color: #6d6c6c; margin-top: 3px; }

/* KPI hint line */
.realtime-theme .alm-kpi-hint { font-size: 11px; color: #9a9a9a; }

/* Feed card header with actions + subtitle */
.realtime-theme .alm-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.realtime-theme .alm-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; color: #1a1a1a; }
.realtime-theme .alm-card-sub { font-size: 12px; color: #6d6c6c; margin-top: 2px; }
.realtime-theme .alm-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.realtime-theme .alm-clear-filters {
  border: none;
  background: none;
  color: #e12424;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* Status pill dot */
.realtime-theme .alm-pill .alm-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Channel tags */
.realtime-theme .alm-chan-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 7px;
  background: #f3f4f6;
  color: #475569;
  margin-right: 4px;
  white-space: nowrap;
}

/* Recipients box (dashed panel with avatar chips + add row) */
.realtime-theme .alm-recip-box {
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f6f6f6;
}
.realtime-theme .alm-recip-note { font-size: 11.5px; color: #6d6c6c; margin-bottom: 8px; }
.realtime-theme .alm-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 2px 10px 2px 3px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}
.realtime-theme .alm-user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}
.realtime-theme .alm-recip-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.realtime-theme .alm-recip-add .alm-select { max-width: 230px; }
.realtime-theme .alm-recip-add .alm-input { max-width: 230px; }

/* Channel cards */
.realtime-theme .alm-channel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.realtime-theme .alm-channel-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  background: #fff;
}
.realtime-theme .alm-channel-card input { margin-top: 2px; accent-color: #e12424; }
.realtime-theme .alm-channel-card .alm-chan-name {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  color: #1a1a1a;
}
.realtime-theme .alm-channel-card .alm-chan-sub { font-size: 11.5px; color: #6d6c6c; margin-top: 1px; }
.realtime-theme .alm-channel-card.checked { border-color: #e12424; background: #fce6e8; }
.realtime-theme .alm-channel-card.disabled { opacity: 0.62; cursor: not-allowed; background: #f6f6f6; }

/* Routing preview */
.realtime-theme .alm-preview-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f6f6f6;
  padding: 12px 14px;
}
.realtime-theme .alm-preview-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 8px;
}
.realtime-theme .alm-preview-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; font-weight: 600; }
.realtime-theme .alm-preview-step { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 3px 10px; color: #1a1a1a; }
.realtime-theme .alm-preview-step.final { border-color: #e12424; background: #fce6e8; color: #e12424; }
.realtime-theme .alm-preview-arrow { color: #9a9a9a; }

@media (max-width: 900px) {
  .realtime-theme .alm-shell { flex-direction: column; }
  .realtime-theme .alm-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
  .realtime-theme .alm-side-nav { flex-direction: row; padding: 10px 12px; overflow-x: auto; }
  .realtime-theme .alm-nav-item { width: auto; white-space: nowrap; }
  .realtime-theme .alm-side-foot { display: none; }
  .realtime-theme .alm-channel-grid { grid-template-columns: 1fr; }
}

/* Self-contained card + table (prototype look, no dependency on alz- scopes) */
.realtime-theme .alm-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px 22px;
}
.realtime-theme .alm-table-wrap { overflow-x: auto; }
.realtime-theme .alm-table { border-collapse: collapse; width: 100%; min-width: 900px; }
.realtime-theme .alm-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6d6c6c;
  padding: 11px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f6f6f6;
  white-space: nowrap;
}
.realtime-theme .alm-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
  font-size: 13.5px;
  color: #1a1a1a;
}
.realtime-theme .alm-table tbody tr:last-child td { border-bottom: none; }
.realtime-theme .alm-empty { text-align: center; color: #6d6c6c; padding: 28px 0 !important; }
.realtime-theme .alm-zone-chip {
  display: inline-block;
  background: #f3f4f6;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.realtime-theme .alm-icon-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6d6c6c;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 6px;
}
.realtime-theme .alm-icon-btn:hover { background: #f3f4f6; color: #1a1a1a; }
.realtime-theme .alm-icon-btn.danger:hover { color: #e12424; }

/* Real VisBi logo in the module sidebar (same asset as the analytics shell) */
.realtime-theme .alm-side-logo-img { height: 19px; width: auto; }

/* ── Store Zones popup (zone group floor-plan previews) ─────────────── */
.realtime-theme .alm-zones-overlay {
  position: fixed; inset: 0; background: rgba(15, 18, 24, 0.55);
  z-index: 1200; display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.realtime-theme .alm-zones-modal {
  background: #fff; border-radius: 16px; width: min(1060px, 96vw);
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.35);
}
.realtime-theme .alm-zones-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.realtime-theme .alm-zones-head h3 { margin: 0; font-size: 16px; font-weight: 800; flex: none; }
.realtime-theme .alm-zones-select {
  margin-left: auto; padding: 8px 12px; font-size: 14px; font-weight: 600;
  border: 1.5px solid #e5e7eb; border-radius: 9px; background: #fff;
  min-width: 240px; cursor: pointer;
}
.realtime-theme .alm-zones-nav {
  width: 34px; height: 34px; border-radius: 9px; border: 1.5px solid #e5e7eb;
  background: #fff; font-size: 15px; cursor: pointer; flex: none;
}
.realtime-theme .alm-zones-nav:hover { border-color: #e12424; color: #e12424; }
.realtime-theme .alm-zones-body { overflow: auto; background: #0f1218; }
.realtime-theme .alm-zones-body img { display: block; width: 100%; height: auto; }

/* Drawer link to the zone preview */
.realtime-theme .alm-zone-loc-link {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  font-weight: 700; color: #1d4ed8; cursor: pointer; user-select: none;
  margin: 2px 0 16px; background: none; border: none; padding: 0;
}
.realtime-theme .alm-zone-loc-link:hover { text-decoration: underline; }
.realtime-theme .alm-zone-loc-link .alm-zl-pin {
  width: 18px; height: 18px; border-radius: 50%; background: #1d4ed8;
  color: #fff; font-size: 10px; display: inline-flex; align-items: center;
  justify-content: center; flex: none;
}
