/* ==========================================================================
 * HappyM CRM 4.0 Enterprise Shell & UX Standard for FakeCRM v2.2.2
 * Aligned with HappyM-New-Web (UI-DESIGN-CONTRACT.md & 06-FORMS-VALIDATION.md)
 * Preserves .blueprint-layout / .blueprint-board / .command-deck in #view-tech
 * ========================================================================== */

:root {
  --happym-sidebar-width: 14.25rem; /* 228px */
  --happym-sidebar-collapsed-width: 3.75rem; /* 60px */
  --hm-sidebar-bg: #121e2d;
  --hm-sidebar-top: #0b1727;
  --hm-sidebar-border: #1e2f45;
  --hm-sidebar-active: #2892ff;
  --hm-topbar-h: 40px;
  --hm-footer-h: 30px;
  --hm-frame-matting: #b8c0ca;
  --hm-case-border: #9aa5b4;
  --hm-title-ink: #102a56;
  --hm-primary: #287be0;
  --hm-primary-hover: #1d66c2;
  --hm-zebra-odd: #ffffff;
  --hm-zebra-even: #f3f1ec;
  --hm-row-hover: #eef5ff;
  --hm-row-selected: #eaf3ff;
  --hm-input-h: 31px;
}

/* ==========================================================================
 * 1. ROOT SHELL LAYOUT (SIDEBAR + MAIN COLUMN)
 * ========================================================================== */
.hm-layout-root {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--hm-frame-matting);
}

.hm-layout-root.hidden {
  display: none !important;
}

/* ==========================================================================
 * 2. COLLAPSIBLE INVERTED SIDEBAR (aside#hmSidebar) & FLYOUT
 * ========================================================================== */
.navbar-vertical.navbar-inverted {
  width: var(--happym-sidebar-width);
  min-width: var(--happym-sidebar-width);
  max-width: var(--happym-sidebar-width);
  height: 100dvh;
  background: var(--hm-sidebar-bg);
  border-right: 1px solid var(--hm-sidebar-border);
  color: #dbe7f5;
  display: flex;
  flex-direction: column;
  transition: width 0.16s ease, min-width 0.16s ease, max-width 0.16s ease;
  z-index: 60;
  user-select: none;
}

body.navbar-vertical-collapsed .navbar-vertical.navbar-inverted {
  width: var(--happym-sidebar-collapsed-width);
  min-width: var(--happym-sidebar-collapsed-width);
  max-width: var(--happym-sidebar-collapsed-width);
}

.navbar-vertical__top {
  height: var(--hm-topbar-h);
  min-height: var(--hm-topbar-h);
  background: var(--hm-sidebar-top);
  border-bottom: 1px solid var(--hm-sidebar-border);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
}

body.navbar-vertical-collapsed .navbar-vertical__top {
  justify-content: center;
  padding: 0 6px;
}

.hm-nav-burger {
  width: 32px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.hm-nav-burger:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 2px 7px rgba(40, 146, 255, 0.35);
}

.hm-nav-burger__bar {
  width: 15px;
  height: 2.2px;
  border-radius: 2px;
  display: block;
}
.hm-nav-burger__bar--1 { background: #22c55e; }
.hm-nav-burger__bar--2 { background: #14b8a6; }
.hm-nav-burger__bar--3 { background: #38bdf8; }

.navbar-vertical__brand {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.12;
}

.navbar-vertical__brand-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-vertical__brand-sub {
  font-size: 10px;
  color: #7dd3fc;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.navbar-vertical-collapsed .navbar-vertical__brand {
  display: none;
}

.navbar-vertical__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.navbar-vertical__scroll::-webkit-scrollbar {
  width: 4px;
}
.navbar-vertical__scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 3px;
}

.navbar-vertical-label-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 3px;
}

.navbar-vertical-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  white-space: nowrap;
}

.navbar-vertical-line {
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.16);
}

body.navbar-vertical-collapsed .navbar-vertical-label {
  display: none;
}
body.navbar-vertical-collapsed .navbar-vertical-label-wrapper {
  padding: 6px 4px;
}

.hm-nav-item {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: #cbd5e1;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.hm-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.hm-nav-item.is-active {
  background: rgba(40, 146, 255, 0.18);
  border-color: rgba(40, 146, 255, 0.42);
  color: #ffffff;
  font-weight: 700;
}

.hm-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--hm-sidebar-active);
}

.hm-nav-item__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #94a3b8;
}

.hm-nav-item.is-active .hm-nav-item__icon,
.hm-nav-item:hover .hm-nav-item__icon {
  color: #38bdf8;
}

.hm-nav-item__icon svg {
  width: 16px;
  height: 16px;
}

.hm-nav-item__label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-nav-item__badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: #e2e8f0;
  line-height: 1.3;
}

.hm-nav-item__badge--alarm {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.hm-nav-item__badge--warn {
  background: #d97706;
  color: #ffffff;
}

.hm-nav-item__badge--ok {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}

body.navbar-vertical-collapsed .hm-nav-item {
  justify-content: center;
  padding: 8px 0;
}

body.navbar-vertical-collapsed .hm-nav-item__label {
  display: none;
}

body.navbar-vertical-collapsed .hm-nav-item__badge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  padding: 0 4px;
}

.navbar-vertical__bottom {
  margin-top: auto;
  border-top: 1px solid var(--hm-sidebar-border);
  padding: 6px;
  background: rgba(11, 23, 39, 0.68);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Collapsed sidebar hover flyout */
.hm-nav-flyout {
  position: fixed;
  z-index: 950;
  background: #0b1727;
  color: #f8fafc;
  border: 1px solid #284366;
  border-radius: 7px;
  padding: 7px 11px;
  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.45);
  pointer-events: none;
  min-width: 175px;
  max-width: 260px;
}

.hm-nav-flyout__title {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
}

.hm-nav-flyout__sub {
  font-size: 10.5px;
  color: #93c5fd;
  margin-top: 2px;
}

/* ==========================================================================
 * 3. MAIN COLUMN & CLINICAL-SKY TOPBAR (Gruppo › [Combo] › Tenant › [Combo])
 * ========================================================================== */
.hm-main-column {
  flex: 1;
  min-width: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hm-topbar {
  height: var(--hm-topbar-h);
  min-height: var(--hm-topbar-h);
  background: linear-gradient(180deg, #eaf4ff 0%, #d5e8ff 100%);
  border-bottom: 1px solid #adc4e2;
  color: var(--hm-title-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  z-index: 40;
}

.hm-topbar__scope-chain {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  flex-wrap: nowrap;
}

.hm-topbar__logo {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #b8cce6;
  padding: 1px;
  flex-shrink: 0;
}

.hm-scope-tag {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e3a8a;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #b8cce6;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.hm-scope-arrow {
  font-size: 13px;
  font-weight: 800;
  color: #3b6998;
  line-height: 1;
  flex-shrink: 0;
}

select.hm-scope-select,
.hm-scope-select {
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  line-height: 26px;
  border-radius: 5px;
  border: 1px solid #96b4d8;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.4' 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 7px center;
  background-size: 12px 12px;
  color: var(--hm-title-ink);
  font-size: 12px;
  font-weight: 700;
  padding: 0 26px 0 8px;
  width: 216px;
  min-width: 160px;
  max-width: 238px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer;
  flex: 0 1 auto;
}

select.hm-scope-select--tenant,
.hm-scope-select--tenant {
  width: 244px;
  min-width: 185px;
  max-width: 268px;
  border-color: #6b9bd2;
  background-color: #f8fbff;
}

.hm-scope-select:focus {
  outline: 2px solid rgba(40, 123, 224, 0.32);
  border-color: var(--hm-primary);
}

.hm-vertical-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
  white-space: nowrap;
}

.hm-topbar .hm-vertical-pill {
  display: none;
}

.hm-topbar .op-state-pill {
  border-width: 1px;
  border-style: solid;
}

.hm-topbar .op-state-pill--live {
  background: #dcfce7;
  color: #065f46;
  border-color: #6ee7b7;
}

.hm-topbar .op-state-pill--testing {
  background: #e0f2fe;
  color: #075985;
  border-color: #7dd3fc;
}

.hm-topbar .op-state-pill--offline {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.hm-topbar__right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.hm-engine-pill {
  font-size: 10.5px;
  font-weight: 700;
  color: #0f3d6e;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid #9dbadd;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}

.hm-health-omino {
  height: 27px;
  border-radius: 999px;
  border: 1px solid #9dbadd;
  background: #ffffff;
  color: var(--hm-title-ink);
  font-size: 11px;
  font-weight: 800;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.hm-health-omino:hover {
  background: #f0f7ff;
  border-color: var(--hm-primary);
}

.hm-health-omino--alarm {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.hm-health-omino--warn {
  background: #fffbeb;
  border-color: #fbbf24;
  color: #92400e;
}

.hm-health-omino--ok {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.hm-top-util-btn {
  height: 27px;
  border-radius: 5px;
  border: 1px solid #9bb8dc;
  background: rgba(255, 255, 255, 0.85);
  color: var(--hm-title-ink);
  font-size: 11px;
  font-weight: 700;
  padding: 0 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.hm-top-util-btn:hover {
  background: #ffffff;
  border-color: var(--hm-primary);
}

.hm-top-util-btn--ghost {
  background: transparent;
  border-color: rgba(16, 42, 86, 0.22);
}

/* Adjust existing op-state-pill & ext-chip for light clinical-sky topbar */
.hm-topbar .op-state-pill {
  height: 26px;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 800;
}

.hm-topbar .ext-chip {
  height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  font-size: 10.5px;
  font-weight: 800;
  border-radius: 4px;
}

/* ==========================================================================
 * 4. OUTER MATTING (.hm-list-page__card) & CENTRAL CASE (#hmCentralCase)
 * ========================================================================== */
.hm-list-page__card {
  flex: 1;
  min-height: 0;
  background: var(--hm-frame-matting);
  padding: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hm-central-case {
  flex: 1;
  min-height: 0;
  background: #ffffff;
  border: 1px solid var(--hm-case-border);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

/* Zone 1: Contextual Toolbar */
.hm-zone-toolbar {
  min-height: 38px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  border-bottom: 1px solid #d5dfec;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hm-zone-toolbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.hm-zone-toolbar__heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hm-zone-toolbar__code {
  font-size: 10px;
  font-weight: 800;
  color: #287be0;
  background: #eaf3ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 1px 5px;
}

.hm-zone-toolbar__title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--hm-title-ink);
  margin: 0;
  white-space: nowrap;
}

.hm-scope-segmented {
  display: inline-flex;
  align-items: center;
  background: #e6ecf5;
  border: 1px solid #c7d4e5;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.hm-scope-segmented__btn {
  border: none;
  background: transparent;
  color: #334155;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.hm-scope-segmented__btn:hover:not(:disabled) {
  color: var(--hm-title-ink);
  background: rgba(255, 255, 255, 0.55);
}

.hm-scope-segmented__btn.is-active {
  background: var(--hm-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.hm-scope-segmented__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hm-zone-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hm-archive-action {
  height: 28px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.hm-archive-action:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.hm-archive-action--primary {
  background: var(--hm-primary);
  border-color: #1d66c2;
  color: #ffffff;
}

.hm-archive-action--primary:hover:not(:disabled) {
  background: var(--hm-primary-hover);
  border-color: #1854a3;
}

.hm-archive-action--emerald {
  background: #059669;
  border-color: #047857;
  color: #ffffff;
}

.hm-archive-action--amber {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}

.hm-archive-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Zone Workspace */
.hm-central-case > .workspace {
  flex: 1;
  min-height: 0;
  padding: 8px;
  background: #f3f6fa;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
 * 5. CRM 4.0 ZEBRA GRIDS, COMPACT CONTROLS, SINGLE-LINE ELLIPSIS & STICKY ⋮
 * ========================================================================== */
.view-panel:not(#view-tech) .edit-grid tbody tr:nth-child(odd),
.view-panel:not(#view-tech) .edit-grid tbody tr:nth-child(odd) td {
  background: var(--hm-zebra-odd);
}

.view-panel:not(#view-tech) .edit-grid tbody tr:nth-child(even),
.view-panel:not(#view-tech) .edit-grid tbody tr:nth-child(even) td {
  background: var(--hm-zebra-even);
}

.view-panel:not(#view-tech) .edit-grid tbody tr:hover,
.view-panel:not(#view-tech) .edit-grid tbody tr:hover td {
  background: var(--hm-row-hover);
}

.view-panel:not(#view-tech) .edit-grid tbody tr.row-selected,
.view-panel:not(#view-tech) .edit-grid tbody tr.row-selected td,
.view-panel:not(#view-tech) .edit-grid tbody tr.is-selected-row,
.view-panel:not(#view-tech) .edit-grid tbody tr.is-selected-row td,
.view-panel:not(#view-tech) .edit-grid tbody tr.active,
.view-panel:not(#view-tech) .edit-grid tbody tr.active td {
  background: var(--hm-row-selected) !important;
}

.view-panel:not(#view-tech) .edit-grid th {
  background: #e9eff7;
  color: var(--hm-title-ink);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 8px;
  border-bottom: 1px solid #cbd5e1;
}

.view-panel:not(#view-tech) .edit-grid td {
  padding: 5px 8px;
  font-size: 12px;
  vertical-align: middle;
}

/* Sticky Rightmost Single ⋮ Action Column */
.edit-grid th.hm-col-actions,
.edit-grid td.hm-col-actions {
  position: sticky;
  right: 0;
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  padding: 4px 5px !important;
  text-align: center !important;
  border-left: 1px solid #d5dfec;
  box-shadow: -2px 0 6px rgba(15, 23, 42, 0.05);
}

.edit-grid thead th.hm-col-actions {
  z-index: 9;
  background: #e9eff7 !important;
}

.edit-grid tbody td.hm-col-actions {
  z-index: 5;
  background: #ffffff;
}

.hm-row-dots-btn {
  width: 27px;
  height: 27px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.hm-row-dots-btn svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.hm-row-dots-btn:hover,
.hm-row-dots-btn.is-open {
  background: #eff6ff;
  border-color: #60a5fa;
  color: #1d4ed8;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.16);
}

/* Floating Row Actions Popover Menu */
.hm-row-action-popover {
  position: fixed;
  z-index: 2300;
  min-width: 186px;
  max-width: 265px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2), 0 2px 6px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hm-row-menu__sep {
  height: 1px;
  background: #e2e8f0;
  margin: 3px 4px;
}

.hm-row-menu__item {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: #1e293b;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  text-align: left;
  padding: 6px 9px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease;
}

.hm-row-menu__item:hover:not(:disabled):not(.is-disabled) {
  background: #f1f5f9;
  color: #0f172a;
}

.hm-row-menu__item--danger {
  color: #b91c1c;
}

.hm-row-menu__item--danger:hover:not(:disabled):not(.is-disabled) {
  background: #fef2f2;
  color: #991b1b;
}

.hm-row-menu__item:disabled,
.hm-row-menu__item.is-disabled {
  opacity: 0.5;
  cursor: default;
}

.hm-row-menu__ico {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.82;
}

.hm-row-menu__ico svg {
  width: 13.5px;
  height: 13.5px;
}

.hm-row-menu__lbl {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Global Single-Line Ellipsis (...) & Zero Overflow on Labels and Controls */
.hm-ellipsis {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

form label,
.form-compact label,
.form-stack label,
.compact-field {
  min-width: 0;
  max-width: 100%;
}

form label:not(.checkbox-row):not(.switch-inline):not(.hm-collaudo-choice-card) > span,
.form-compact label:not(.checkbox-row):not(.switch-inline) > span,
.form-stack label:not(.checkbox-row):not(.switch-inline) > span,
.compact-field > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkbox-row {
  min-width: 0;
  max-width: 100%;
}

.checkbox-row > span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact 31px Form Controls with Strict Single-Line Truncation */
form label input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]),
.form-compact input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="range"]),
.cell-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: var(--hm-input-h);
  min-height: var(--hm-input-h);
  max-height: var(--hm-input-h);
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-search {
  height: var(--hm-input-h);
  min-height: var(--hm-input-h);
  max-height: var(--hm-input-h);
  padding: 3px 8px;
  font-size: 12px;
  border-radius: 5px;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

select:not(.hm-scope-select):not(.topbar__client-select):not(.topbar__pharmacy-select) {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: var(--hm-input-h);
  min-height: var(--hm-input-h);
  max-height: var(--hm-input-h);
  line-height: 23px;
  padding: 3px 28px 3px 8px;
  font-size: 12px;
  border-radius: 5px;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.4' 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 8px center;
  background-size: 12px 12px;
}

.filter-bar select.select-compact,
.poll-box select.select-compact,
.panel-subbar select.select-compact,
.btn-row select.select-compact {
  display: inline-block;
  width: auto;
  max-width: 210px;
}

.form-compact textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 5px;
}

/* ==========================================================================
 * 6. FRAMED KPI TOTALIZERS (HOME 01, MONITOR, USERS 07 & SUPERCONTROL 91)
 * ========================================================================== */
.hm-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.hm-kpi-card,
.hm-kpi-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: 2.5px solid #94a3b8;
  border-radius: 8px;
  padding: 7px 10px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.hm-kpi-card--teal { border-top-color: #0d9488; }
.hm-kpi-card--blue { border-top-color: #2563eb; }
.hm-kpi-card--amber { border-top-color: #d97706; }
.hm-kpi-card--purple { border-top-color: #7c3aed; }
.hm-kpi-card--emerald { border-top-color: #16a34a; }
.hm-kpi-card--rose { border-top-color: #e11d48; }

.hm-kpi-card--alarm,
.hm-kpi-box--alarm {
  border-color: #fca5a5;
  border-top-color: #dc2626;
  background: #fef2f2;
}

.hm-kpi-card--warn,
.hm-kpi-box--warn {
  border-color: #fcd34d;
  border-top-color: #d97706;
  background: #fffbeb;
}

.hm-kpi-card--ok,
.hm-kpi-box--ok {
  border-color: #a7f3d0;
  border-top-color: #10b981;
  background: #f8fffb;
}

.hm-kpi-card__lbl,
.hm-kpi-box__lbl {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  color: #475569;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-kpi-lbl-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm-kpi-card__val,
.hm-kpi-box__val {
  font-size: 16.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--hm-title-ink);
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-kpi-val-denom {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}

.hm-kpi-card__sub,
.hm-kpi-box__sub {
  font-size: 10.5px;
  font-weight: 600;
  color: #475569;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hm-kpi-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
  margin-top: 2px;
}

.hm-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 17px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  background: #f1f5f9;
  border: 1px solid #dbe4ef;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.hm-kpi-badge--teal { background: #ecfeff; border-color: #a5f3fc; color: #0f766e; }
.hm-kpi-badge--blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.hm-kpi-badge--amber { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.hm-kpi-badge--purple { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.hm-kpi-badge--emerald { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.hm-kpi-badge--rose { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.hm-kpi-badge--red { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* Engine 3-Tier Banner Card */
.hm-engine-composition-bar {
  background: linear-gradient(90deg, #eff6ff 0%, #f8fafc 60%, #f0fdf4 100%);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.hm-engine-tiers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
}

.hm-tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 2px 8px;
  font-weight: 700;
  color: var(--hm-title-ink);
}

.hm-tier-chip--ext {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

.hm-tier-chip--eng {
  background: #dcfce7;
  border-color: #86efac;
  color: #065f46;
}

/* Split Workspace for Super-Control & Notebook */
.hm-split-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 8px;
  overflow: hidden;
}

.hm-card-fill {
  background: #ffffff;
  border: 1px solid #d5dfec;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.hm-card-fill__head {
  padding: 7px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.hm-card-fill__title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--hm-title-ink);
  margin: 0;
}

.hm-card-fill__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
}

/* Auto-Test 7-Step Stepper */
.hm-autotest-step {
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 6px;
  background: #ffffff;
}
.hm-autotest-step--PASS { border-left-color: #10b981; }
.hm-autotest-step--WARNING { border-left-color: #f59e0b; background: #fffdf7; }
.hm-autotest-step--ALARM { border-left-color: #ef4444; background: #fef2f2; }

.hm-autotest-step__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--hm-title-ink);
}

.hm-autotest-step__url {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px;
  color: #475569;
  margin-top: 2px;
  word-break: break-all;
}

.hm-autotest-step__sum {
  font-size: 11.5px;
  color: #1e293b;
  margin-top: 3px;
}

/* Schema Tecnico Group Overview Matrix inside untouched blueprint aesthetic */
.blueprint-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.blueprint-tenant-mini {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blueprint-tenant-mini__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.blueprint-tenant-mini__title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.blueprint-tenant-mini__dom {
  font-size: 10.5px;
  color: #93c5fd;
  word-break: break-all;
}

.blueprint-tenant-mini__metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.blueprint-tenant-mini__cell {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 5px;
  padding: 3px 5px;
  text-align: center;
}

.blueprint-tenant-mini__cell strong {
  display: block;
  font-size: 12px;
  color: #38bdf8;
}

.blueprint-tenant-mini__cell span {
  font-size: 9.5px;
  color: #cbd5e1;
}

/* ==========================================================================
 * 7. BLURRED FOREGROUND MODALS (FIXED W×H), COMPACT FOOTER & INFO POPOVERS
 * ========================================================================== */
.modal-backdrop {
  background: rgba(15, 23, 42, 0.50) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 900;
}

.modal-card {
  border: 1px solid #94a3b8;
  border-radius: 9px;
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.42);
  width: 600px;
  max-width: 95vw;
  max-height: 90dvh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

/* Fixed-size modal dimensions so switching tabs never changes height or width */
.modal-card--fixed-sm {
  width: 560px !important;
  max-width: 95vw !important;
  height: 425px !important;
  max-height: 88dvh !important;
}

.modal-card--fixed-md,
.modal-card.modal-card--wide {
  width: 760px !important;
  max-width: 95vw !important;
  height: 510px !important;
  max-height: 90dvh !important;
}

.modal-card--fixed-lg,
.modal-card.modal-card--xl {
  width: 960px !important;
  max-width: 96vw !important;
  height: 585px !important;
  max-height: 92dvh !important;
}

.modal-card__head {
  background: linear-gradient(180deg, #eaf4ff 0%, #dcebff 100%);
  border-bottom: 1px solid #b8cce6;
  padding: 8px 12px;
  margin: 0;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.modal-card__head h3 {
  font-size: 13.5px;
  color: var(--hm-title-ink);
}

.modal-card > form {
  padding: 10px 14px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-card > .modal-body-pad,
.modal-card > .sys-tab-pane,
.modal-card > .split-2-modal,
.modal-card > .ub-tab-pane {
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-card > form > .fly-tab-pane,
.modal-card > form > .prod-tab-pane,
.modal-card > form > .ev-tab-pane,
.modal-card > form > .srv-tab-pane,
.modal-card > form > .bp-tab-pane,
.modal-card > form > .bc-tab-pane,
.modal-card > form > .ca-tab-pane,
.modal-card > form > .eng-tab-pane,
.modal-card > form > .cpn-tab-pane,
.modal-card > form > .modal-scroll-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.modal-card__foot {
  padding: 8px 14px;
  margin: auto -14px 0;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-shrink: 0;
}

.modal-card > .modal-card__foot {
  margin: auto 0 0;
}

.hm-modal-dirty-bar {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.hm-modal-dirty-bar.is-visible {
  display: flex;
}

.hm-btn-modal {
  min-width: 78px;
  height: 30px;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hm-btn-modal--danger {
  background: #dc2626;
  border: 1px solid #b91c1c;
  color: #ffffff;
}
.hm-btn-modal--danger:hover {
  background: #b91c1c;
}

.hm-confirm-danger-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  border-radius: 6px;
  padding: 10px 12px;
  color: #7f1d1d;
  font-size: 12px;
}

.hm-confirm-danger-impact {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #fca5a5;
  font-size: 11.5px;
  color: #991b1b;
}

/* Inline Feedback Box inside Test / Action Modals */
.hm-feedback-box {
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.38;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
}
.hm-feedback-box--ok {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}
.hm-feedback-box--err {
  border-color: #fecaca;
  background: #fef2f2;
  color: #7f1d1d;
}

/* Semantic KPI Icon Badges & Concise Info Tip Popover */
.hm-kpi-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  margin-bottom: 1px;
}

.hm-kpi-ico {
  width: 21px;
  height: 21px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hm-kpi-ico svg { width: 12.5px; height: 12.5px; }
.hm-kpi-ico--blue { background: #dbeafe; color: #1d4ed8; }
.hm-kpi-ico--teal { background: #ccfbf1; color: #0f766e; }
.hm-kpi-ico--emerald { background: #dcfce7; color: #15803d; }
.hm-kpi-ico--amber { background: #fef3c7; color: #b45309; }
.hm-kpi-ico--purple { background: #ede9fe; color: #6d28d9; }
.hm-kpi-ico--rose { background: #ffe4e6; color: #be123c; }

.hm-info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  cursor: help;
  vertical-align: middle;
  margin-left: 3px;
  flex-shrink: 0;
}
.hm-info-tip:hover {
  background: #287be0;
  color: #ffffff;
}

.hm-info-popover {
  position: fixed;
  z-index: 1200;
  max-width: 290px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.45);
  pointer-events: none;
}

.pill--coupon {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  font-weight: 800;
}

/* Compact Fixed Bottom Footer (#0b1727, 30px) with Icons & Short Captions */
.app-footer {
  height: var(--hm-footer-h);
  min-height: var(--hm-footer-h);
  max-height: var(--hm-footer-h);
  background: #0b1727;
  border-top: 1px solid #1e2f45;
  color: #cbd5e1;
  font-size: 10.5px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  overflow: hidden;
}

.app-footer__left,
.app-footer__right {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.app-footer__center {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
  color: #94a3b8;
  font-size: 10px;
}

.hm-ft-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.hm-ft-chip svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: #38bdf8;
}

.hm-ft-health {
  cursor: pointer;
  border-radius: 999px;
  padding: 0 8px;
  transition: filter 0.12s ease;
}
.hm-ft-health:hover { filter: brightness(1.12); }
.hm-ft-health--ok { background: rgba(16, 185, 129, 0.2); border-color: rgba(52, 211, 153, 0.45); color: #6ee7b7; }
.hm-ft-health--ok svg { color: #34d399; }
.hm-ft-health--warn { background: rgba(217, 119, 6, 0.25); border-color: rgba(251, 191, 36, 0.5); color: #fde68a; }
.hm-ft-health--warn svg { color: #fbbf24; }
.hm-ft-health--alarm { background: rgba(220, 38, 38, 0.32); border-color: rgba(248, 113, 113, 0.65); color: #fecaca; }
.hm-ft-health--alarm svg { color: #f87171; }

.hm-ft-slot--live { border-color: rgba(52, 211, 153, 0.4); color: #a7f3d0; }
.hm-ft-slot--testing { border-color: rgba(56, 189, 248, 0.45); color: #bae6fd; }
.hm-ft-slot--offline { border-color: rgba(251, 191, 36, 0.5); color: #fde68a; }

@media (max-width: 1180px) {
  .hm-kpi-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hm-split-workspace {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
 * 9. FAKECRM v2.4.0 — TOPBAR LENS SWITCHER, MONITOR & LIVE COLLAUDO UX
 * ========================================================================== */
.hm-viewslot-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.08);
  border: 1px solid #96b4d8;
  border-radius: 6px;
  padding: 1px;
  height: 27px;
  flex-shrink: 0;
}

.hm-viewslot-btn {
  border: none;
  background: transparent;
  color: #334155;
  font-size: 10.5px;
  font-weight: 800;
  height: 23px;
  padding: 0 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.hm-viewslot-btn.is-active[data-admin-view-slot="stage"] {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.35);
}

.hm-viewslot-btn.is-active[data-admin-view-slot="live"] {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 118, 110, 0.35);
}

.hm-top-monitor {
  height: 27px;
  border-radius: 999px;
  border: 1px solid #9dbadd;
  background: #ffffff;
  color: var(--hm-title-ink);
  font-size: 10.5px;
  font-weight: 800;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.hm-top-monitor:hover { filter: brightness(0.97); }
.hm-top-monitor__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.hm-top-monitor--green { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.hm-top-monitor--green .hm-top-monitor__dot { background: #10b981; }
.hm-top-monitor--yellow { background: #fffbeb; border-color: #fbbf24; color: #92400e; }
.hm-top-monitor--yellow .hm-top-monitor__dot { background: #f59e0b; }
.hm-top-monitor--red { background: #fef2f2; border-color: #f87171; color: #991b1b; box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16); }
.hm-top-monitor--red .hm-top-monitor__dot { background: #ef4444; }

/* Synoptic Semaphore Pills */
.hm-sem-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  max-width: 100%;
  text-align: left;
}
.hm-sem-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.hm-sem-pill__txt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hm-sem-pill__lat {
  opacity: 0.78;
  font-size: 9.5px;
  white-space: nowrap;
}
.hm-sem-pill--green { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.hm-sem-pill--green .hm-sem-dot { background: #10b981; }
.hm-sem-pill--yellow { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.hm-sem-pill--yellow .hm-sem-dot { background: #f59e0b; }
.hm-sem-pill--red { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.hm-sem-pill--red .hm-sem-dot { background: #ef4444; }

/* Strict Read-Only LIVE Lens Banner */
.hm-live-lens-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid #cbd5e1;
  font-size: 11.5px;
  flex-shrink: 0;
}
.hm-live-lens-banner--disconnected {
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom-color: #f59e0b;
  color: #78350f;
}
.hm-live-lens-banner--collaudo {
  background: linear-gradient(90deg, #ecfeff 0%, #e0f2fe 100%);
  border-bottom-color: #38bdf8;
  color: #0c4a6e;
}
.hm-live-lens-banner__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Modal Choice Cards for Live Collaudo User Channel */
.hm-collaudo-choice-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
.hm-collaudo-choice-card {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 11px;
  background: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.hm-collaudo-choice-card:has(input:checked) {
  border-color: #2563eb;
  background: #eff6ff;
}
.hm-ft-slot--unpublished {
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}
