/* Owner portal — follow system theme; compact chrome; map readable */

/* Do NOT override sidebar colors — inherit theme (light/dark) like main system */

.app-shell.owner-shell .page-body {
  background: var(--bg, #f5f7fb);
}

.app-shell.owner-shell .top-title-wrap {
  max-width: min(52vw, 28rem);
}

.app-shell.owner-shell .top-title {
  font-size: 1.05rem !important;
  line-height: 1.25 !important;
  font-weight: 750 !important;
  margin: 0 !important;
}

.app-shell.owner-shell .top-greeting {
  font-size: 0.72rem !important;
  opacity: 0.75;
}

.app-shell.owner-shell .owner-portal-card {
  background: var(--card, #fff);
  border: 1px solid var(--panel-border, rgba(15, 23, 42, 0.08));
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  padding: 1rem 1.1rem 1.15rem;
}

.app-shell.owner-shell .cf-pair-lab,
.app-shell.owner-shell .field-label,
.app-shell.owner-shell .section-title,
.app-shell.owner-shell .owner-vr-section-title,
.app-shell.owner-shell .owner-vr-map-title {
  color: var(--text, #0f172a);
  opacity: 1;
}

.app-shell.owner-shell .muted,
.app-shell.owner-shell .workflow-hint,
.app-shell.owner-shell .owner-vr-section-hint {
  color: var(--text-muted, #64748b);
  opacity: 1;
}

.owner-vr-stage {
  position: relative;
  max-width: 960px;
}

.owner-vr-stage.owner-vr-stage--wide {
  max-width: none;
}

.owner-vr-scene {
  display: none !important;
}

.owner-vr-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Match PageHeader → panel rhythm used on org/staff forms */
.app-shell.owner-shell .page-body > .owner-panel-stack,
.app-shell.owner-shell .page-body > .owner-vr-stage {
  margin-top: 0.15rem;
  position: relative;
  z-index: 2;
}
.app-shell.owner-shell .page-body > .owner-vr-stage:has(.owner-org-sub-alert:hover),
.app-shell.owner-shell .page-body > .owner-vr-stage:has(.owner-org-sub-alert:focus-within) {
  z-index: 100;
}

.app-shell.owner-shell .owner-portal-card .workflow-hint.muted {
  margin-top: -0.15rem;
}

.app-shell.owner-shell .owner-portal-card .modal-actions {
  margin-top: 0.75rem;
}

.app-shell.owner-shell .data-table th,
.app-shell.owner-shell .data-table td {
  text-align: start;
}

.app-shell.owner-shell .data-table td.row-actions {
  text-align: end;
  white-space: nowrap;
}

/* Compact hero — matches light theme, not a second dark sidebar */
.owner-vr-hero {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--card, #fff);
  border: 1px solid var(--panel-border, rgba(15, 23, 42, 0.1));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  color: var(--text, #0f172a);
}

.owner-vr-hero-shine {
  display: none !important;
}

.owner-vr-hero-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #0284c7) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #0284c7) 22%, transparent);
  flex-shrink: 0;
}

.owner-vr-hero-copy {
  flex: 1 1 auto;
  min-width: 0;
}

/* Pills sit in the empty side of the hero (left in RTL) — not under the lead */
.owner-vr-hero-meta {
  flex: 0 0 auto;
  margin-inline-start: auto;
  align-self: center;
  max-width: 42%;
}

.owner-vr-kicker {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #0284c7);
}

.owner-vr-title {
  margin: 0;
  font-size: 1.05rem !important;
  font-weight: 780;
  line-height: 1.3;
  color: var(--text, #0f172a) !important;
}

.owner-vr-lead {
  margin: 0.2rem 0 0;
  max-width: 36rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted, #64748b) !important;
  font-weight: 500;
}

.owner-vr-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.28rem;
  margin: 0;
}

.owner-vr-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  max-width: 14rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  color: var(--text, #0f172a) !important;
  background: color-mix(in srgb, var(--accent, #0284c7) 8%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, var(--accent, #0284c7) 18%, transparent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-vr-pill-ico {
  font-size: 0.8rem;
}

.owner-vr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  width: 100%;
  padding: 0;
  margin: 0;
  border-top: 0;
}

.owner-vr-map-block {
  margin-top: 0;
  padding: 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--panel-border, #e2e8f0);
  background: var(--bg-alt, #f8fafc);
}

.owner-vr-tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--panel-border, rgba(15, 23, 42, 0.12));
  background: var(--bg-alt, #f8fafc);
  color: var(--text, #0f172a) !important;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.owner-vr-tab:hover {
  background: color-mix(in srgb, var(--accent, #0284c7) 10%, transparent);
}

.owner-vr-tab.is-on {
  background: var(--accent, #0284c7) !important;
  border-color: transparent;
  color: #fff !important;
}

.owner-vr-tab-ico {
  font-size: 0.9rem;
}

.owner-vr-section-head {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.owner-vr-section-ico {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 0.95rem;
  background: color-mix(in srgb, var(--accent, #0284c7) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #0284c7) 18%, transparent);
  flex-shrink: 0;
}

.owner-vr-section-title {
  margin: 0;
  font-size: 0.98rem !important;
  font-weight: 780;
}

.owner-vr-section-hint {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.owner-vr-map-title {
  margin: 0 0 0.35rem;
  font-size: 0.92rem !important;
  font-weight: 750;
}

.owner-vr-map-block .org-map-section {
  margin-top: 0.35rem;
}

.owner-vr-map-block .org-map {
  min-height: 300px !important;
  height: 300px;
  border-radius: 10px;
  border: 1px solid var(--panel-border, #cbd5e1);
  overflow: hidden;
  background: #e2e8f0;
}

.owner-vr-jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #0284c7) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent, #0284c7) 28%, transparent);
  font-size: 0.82rem;
  font-weight: 600;
}

.owner-vr-actions {
  margin-top: 0.9rem;
}

.owner-vr-panel--narrow {
  max-width: 420px;
}

@media (max-width: 720px) {
  .owner-vr-hero {
    flex-wrap: wrap;
  }
  .owner-vr-hero-meta {
    max-width: 100%;
    width: 100%;
    margin-inline-start: 0;
  }
  .owner-vr-pills {
    justify-content: flex-start;
  }
  .owner-vr-title { font-size: 1.05rem !important; }
  .owner-vr-map-block .org-map { min-height: 240px !important; height: 240px; }
}

.locale-date {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  align-items: center;
  min-width: 0;
}
.locale-date .locale-date-part {
  min-width: 4.75rem;
  flex: 1 1 auto;
  max-width: 8rem;
}
.locale-date .locale-date-year {
  width: 4.75rem;
  flex: 0 0 4.75rem;
}
.locale-date .locale-date-time {
  width: 6.5rem;
  flex: 0 0 6.5rem;
}
.cf-pair .locale-date { max-width: 22rem; }

/* Owner chrome filters: wrap instead of clipping off-screen */
.app-shell.owner-shell .page-context-filters {
  min-width: 0;
  width: 100%;
  overflow: visible;
}
/* Filters must not paint above org-card tooltips (compact-filter-bar defaults to z-index: 20). */
.app-shell.owner-shell .owner-org-filters.compact-filter-bar,
.app-shell.owner-shell .page-context-filters .compact-filter-bar {
  z-index: 1 !important;
}
.app-shell.owner-shell .owner-org-filters .searchable-select-panel {
  z-index: 300;
}
.app-shell.owner-shell .compact-filter-bar.chrome-filter-bar.owner-chrome-filter {
  flex-wrap: wrap !important;
  width: 100%;
  min-width: 0;
  padding: 0.35rem 0.45rem;
}
.app-shell.owner-shell .owner-chrome-filter .compact-filter-fields {
  flex-wrap: wrap !important;
  flex: 1 1 14rem;
  min-width: 0;
}
.app-shell.owner-shell .owner-chrome-filter .cf-pair {
  max-width: 13.5rem;
}
.app-shell.owner-shell .owner-chrome-filter .cf-pair-ctrl {
  min-width: 5.25rem;
  max-width: 8.25rem;
}
.app-shell.owner-shell .owner-chrome-filter .cf-search {
  flex: 1 1 11rem;
  min-width: 9rem;
  max-width: 16rem;
}
.app-shell.owner-shell .owner-chrome-filter .cf-end-cluster,
.app-shell.owner-shell .owner-chrome-filter .cf-trail-row {
  flex: 0 0 auto;
  margin-inline-start: 0;
}

/* Owner org list — 2-row filter layout (override global chrome single-row rules) */
.app-shell.owner-shell .page-context-row.has-filters .owner-org-filters.compact-filter-bar.chrome-filter-bar {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100%;
  gap: 0.45rem;
}
.app-shell.owner-shell .page-context-row.has-filters .owner-org-filters .compact-filter-fields {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0.45rem;
  flex: 1 1 100% !important;
  width: 100% !important;
  min-width: 0;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
}
.owner-org-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  width: 100%;
  min-width: 0;
}
.owner-org-filter-row--primary {
  flex-wrap: wrap;
}
.owner-org-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.owner-org-filter-row--geo {
  display: flex !important;
  flex-direction: row;
  flex-wrap: nowrap !important;
  align-items: stretch;
  gap: 0.4rem 0.55rem;
  width: 100%;
  min-width: 0;
}
.app-shell.owner-shell .owner-org-filters .country-city-fields,
.app-shell.owner-shell .owner-org-filters .country-city-fields--compact {
  display: inline-flex !important;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}
.app-shell.owner-shell .owner-org-filters .owner-org-search-inline {
  flex: 1 1 0 !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  align-self: stretch;
}
.app-shell.owner-shell .page-context-row.has-filters .owner-org-filters .owner-org-search-inline.cf-search,
.app-shell.owner-shell .owner-chrome-filter .owner-org-search-inline.cf-search {
  max-width: none !important;
  min-width: 0 !important;
}
.app-shell.owner-shell .owner-org-filters .owner-org-search-inline .cf-search-input {
  width: 100%;
  min-width: 0;
}
@media (max-width: 760px) {
  .owner-org-filter-row--geo {
    flex-wrap: wrap !important;
  }
  .app-shell.owner-shell .owner-org-filters .owner-org-search-inline {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}

/* Owner header — notification bell layout (theme colors scoped below) */
.app-shell.owner-shell header.top-bar .notification-bell-wrap {
  display: inline-flex;
  align-items: center;
}
.app-shell.owner-shell header.top-bar .notification-bell-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 0 !important;
}
.app-shell.owner-shell header.top-bar .notification-bell-btn svg {
  display: block !important;
  width: 15px !important;
  height: 15px !important;
  margin: 0 !important;
  flex-shrink: 0;
}
/* Light themes — keep bell readable when empty (no badge) */
html.theme-zad-light .app-shell.owner-shell header.top-bar .notification-bell-btn,
body.theme-zad-light .app-shell.owner-shell header.top-bar .notification-bell-btn,
html.theme-zad .app-shell.owner-shell header.top-bar .notification-bell-btn,
body.theme-zad .app-shell.owner-shell header.top-bar .notification-bell-btn,
html.theme-copper .app-shell.owner-shell header.top-bar .notification-bell-btn,
body.theme-copper .app-shell.owner-shell header.top-bar .notification-bell-btn {
  color: var(--magenta, #7c1d4a) !important;
  background: var(--bg-alt, #f8fafc) !important;
  border-color: color-mix(in srgb, var(--magenta, #7c1d4a) 18%, transparent) !important;
}
html.theme-zad-light .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
body.theme-zad-light .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
html.theme-zad .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
body.theme-zad .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
html.theme-copper .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
body.theme-copper .app-shell.owner-shell header.top-bar .notification-bell-btn:hover {
  color: #fff !important;
  background: var(--gradient, linear-gradient(135deg, #800040, #c0267a)) !important;
  border-color: transparent !important;
}
/* Dark owner chrome */
html.theme-obsidian .app-shell.owner-shell header.top-bar .notification-bell-btn,
body.theme-obsidian .app-shell.owner-shell header.top-bar .notification-bell-btn,
html.theme-midnight .app-shell.owner-shell header.top-bar .notification-bell-btn,
body.theme-midnight .app-shell.owner-shell header.top-bar .notification-bell-btn {
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
html.theme-obsidian .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
body.theme-obsidian .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
html.theme-midnight .app-shell.owner-shell header.top-bar .notification-bell-btn:hover,
body.theme-midnight .app-shell.owner-shell header.top-bar .notification-bell-btn:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(129, 140, 248, 0.45) !important;
}
.app-shell.owner-shell header.top-bar .notification-bell-btn.is-ringing svg {
  animation: owner-bell-ring 1.25s ease-in-out infinite;
  transform-origin: 50% 0%;
}
@keyframes owner-bell-ring {
  0%, 100% { transform: rotate(0deg); }
  12%, 36%, 60% { transform: rotate(14deg); }
  24%, 48% { transform: rotate(-14deg); }
  72% { transform: rotate(8deg); }
  84% { transform: rotate(-8deg); }
}

/* Org row subscription alert bell + glass tooltip */
.owner-org-sub-alert {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.35rem;
  vertical-align: middle;
}
.owner-org-sub-alert__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border-radius: 999px;
  border: 1.5px solid #d97706;
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 48%, #fdba74 100%);
  color: #c2410c;
  box-shadow:
    0 2px 10px rgba(234, 88, 12, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: default;
  line-height: 0;
}
.owner-org-sub-alert__btn.is-trial {
  border-color: #5b21b6;
  background: linear-gradient(145deg, #ede9fe 0%, #a78bfa 50%, #7c3aed 100%);
  color: #3b0764;
  box-shadow:
    0 3px 14px rgba(109, 40, 217, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.owner-org-sub-alert__btn.is-trial svg {
  stroke: #3b0764;
  filter: none;
}
.owner-org-sub-alert__btn.is-ringing svg {
  animation: owner-bell-ring 1.25s ease-in-out infinite;
  transform-origin: 50% 0%;
}
.owner-org-sub-alert__btn svg {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
  stroke-width: 2.35;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.65));
}
.owner-org-sub-alert__tip {
  position: absolute;
  z-index: 200;
  inset-inline-end: 0;
  top: calc(100% + 0.45rem);
  min-width: 13rem;
  max-width: 18rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(30, 27, 75, 0.94), rgba(49, 46, 129, 0.88));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.owner-org-sub-alert__tip--fixed {
  display: none !important;
}
.owner-org-sub-alert:hover .owner-org-sub-alert__tip,
.owner-org-sub-alert:focus-within .owner-org-sub-alert__tip {
  opacity: 1;
}
.owner-org-sub-alert:not(.owner-org-sub-alert--corner):not(.owner-org-sub-alert--row-end):hover .owner-org-sub-alert__tip,
.owner-org-sub-alert:not(.owner-org-sub-alert--corner):not(.owner-org-sub-alert--row-end):focus-within .owner-org-sub-alert__tip {
  transform: translateY(0);
}
.owner-org-sub-alert__tip strong {
  display: block;
  font-size: 0.76rem;
  margin-bottom: 0.2rem;
  color: #e0e7ff;
}
.owner-org-sub-alert__countdown {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fde68a;
}
.owner-org-sub-alert:has(.is-trial) .owner-org-sub-alert__countdown {
  color: #ddd6fe;
}

/* Header bell subscription tooltip */
.notification-bell-wrap.has-sub-tip {
  position: relative;
}
.notification-bell-wrap .notification-bell-btn.is-ringing svg {
  animation: owner-bell-ring 1.25s ease-in-out infinite;
  transform-origin: 50% 0%;
}
.notification-bell-sub-tip {
  position: absolute;
  z-index: 200;
  inset-inline-end: 0;
  top: calc(100% + 0.45rem);
  min-width: 11rem;
  max-width: 16rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(30, 27, 75, 0.94), rgba(49, 46, 129, 0.88));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.notification-bell-wrap.has-sub-tip:hover .notification-bell-sub-tip,
.notification-bell-wrap.has-sub-tip:focus-within .notification-bell-sub-tip {
  opacity: 1;
  transform: translateY(0);
}
.notification-bell-sub-tip strong {
  display: block;
  font-size: 0.76rem;
  margin-bottom: 0.15rem;
  color: #e0e7ff;
}
.notification-item.type-subscription-expiring.unread,
.notification-item.type-trial-active.unread,
.notification-item.type-subscription-grace.unread,
.notification-item.type-trial-grace.unread {
  border-inline-start: 3px solid #f59e0b;
}

.app-shell.owner-shell .page-context-row.has-tools {
  justify-content: flex-end;
}
.app-shell.owner-shell .page-context-tools {
  display: inline-flex;
  align-items: center;
  margin-inline-start: auto;
}
.app-shell.owner-shell .nav-link {
  overflow: hidden;
}
.app-shell.owner-shell .nav-link.active {
  box-shadow: inset -4px 0 0 var(--nav-active-edge, #0078d4) !important;
}
.app-shell.ltr.owner-shell .nav-link.active {
  box-shadow: inset 4px 0 0 var(--nav-active-edge, #0078d4) !important;
}

.owner-help-screen-btn {
  display: flex;
  width: 100%;
  text-align: start;
  margin-bottom: 0.25rem;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #0078d4) 6%, var(--card, #fff));
  color: var(--text, #0f172a);
  cursor: pointer;
  font: inherit;
}
.owner-help-screen-btn:hover {
  background: color-mix(in srgb, var(--accent, #0078d4) 14%, var(--card, #fff));
}

/* Owner organizations — VR glass row cards */
.owner-org-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
}

.owner-org-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.owner-org-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(180px, 1.4fr) auto minmax(220px, 1.2fr) auto;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  cursor: pointer;
  overflow: visible;
  color: var(--text, #0f172a);
  background:
    linear-gradient(155deg,
      color-mix(in srgb, var(--accent, #0284c7) 12%, var(--card, #fff)) 0%,
      var(--card, #fff) 38%,
      color-mix(in srgb, var(--bg-alt, #f1f5f9) 40%, var(--card, #fff)) 100%);
  border: 1px solid color-mix(in srgb, var(--accent, #0284c7) 22%, transparent);
  border-inline-start: 4px solid var(--accent, #0284c7);
  box-shadow:
    0 12px 32px color-mix(in srgb, #000 10%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 35%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.owner-org-row:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 40px color-mix(in srgb, #000 16%, transparent),
    0 0 24px color-mix(in srgb, var(--accent, #0284c7) 18%, transparent);
}

.owner-org-row:has(.owner-org-sub-alert:hover),
.owner-org-row:has(.owner-org-sub-alert:focus-within) {
  z-index: 80;
  overflow: visible;
}

.owner-org-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent, #0284c7) 65%, transparent);
  outline-offset: 2px;
}

.owner-org-row.is-trial { border-inline-start-color: #a78bfa; }
.owner-org-row.is-warn { border-inline-start-color: #f59e0b; }
.owner-org-row.is-expired,
.owner-org-row.is-disabled { border-inline-start-color: #ef4444; }
.owner-org-row.is-ok { border-inline-start-color: #22c55e; }

.owner-org-row__glow {
  position: absolute;
  inset: -40% auto auto 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, #0284c7) 22%, transparent) 0%, transparent 68%);
  pointer-events: none;
  opacity: 0.55;
}

.owner-org-row__rail {
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent, #0284c7) 35%, transparent), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.owner-org-row__id-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 3.2rem;
  z-index: 1;
}

.owner-org-row__trial-tag {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: 1px solid #4c1d95;
  box-shadow: 0 2px 10px rgba(91, 33, 182, 0.4);
  white-space: nowrap;
}

.owner-org-row__id {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent, #0284c7);
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #0284c7) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #0284c7) 25%, transparent);
}

.owner-org-row__identity {
  min-width: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.owner-org-row__name {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text, #0f172a);
  word-break: break-word;
}

.owner-org-row__meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.owner-org-row__meta,
.owner-org-row__place {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted, #64748b);
  max-width: 100%;
  word-break: break-word;
}

.owner-org-row__ico {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Inline subscription / trial countdown (always visible in card) */
.owner-org-sub-countdown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0.45rem;
  margin-top: 0.35rem;
  padding: 0.32rem 0.5rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, #7c3aed 35%, transparent);
  background: linear-gradient(135deg,
    color-mix(in srgb, #7c3aed 14%, var(--card, #fff)) 0%,
    color-mix(in srgb, #6366f1 8%, var(--card, #fff)) 100%);
  box-shadow: 0 4px 16px color-mix(in srgb, #7c3aed 12%, transparent);
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}
.owner-org-sub-countdown.is-warn {
  border-color: color-mix(in srgb, #f59e0b 45%, transparent);
  background: linear-gradient(135deg,
    color-mix(in srgb, #f59e0b 16%, var(--card, #fff)) 0%,
    color-mix(in srgb, #ea580c 10%, var(--card, #fff)) 100%);
  box-shadow: 0 4px 16px color-mix(in srgb, #f59e0b 14%, transparent);
}
.owner-org-sub-countdown__lab {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #5b21b6;
  flex-shrink: 0;
}
.owner-org-sub-countdown.is-warn .owner-org-sub-countdown__lab {
  color: #9a3412;
}
.owner-org-sub-countdown__units {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-variant-numeric: tabular-nums;
}
.owner-org-sub-countdown__unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  padding: 0.18rem 0.35rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #4c1d95;
  background: color-mix(in srgb, #a78bfa 28%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, #7c3aed 35%, transparent);
}
.owner-org-sub-countdown.is-warn .owner-org-sub-countdown__unit {
  color: #9a3412;
  background: color-mix(in srgb, #fbbf24 35%, var(--card, #fff));
  border-color: color-mix(in srgb, #f59e0b 40%, transparent);
}

html.theme-obsidian .owner-org-sub-countdown,
body.theme-obsidian .owner-org-sub-countdown,
html.theme-midnight .owner-org-sub-countdown,
body.theme-midnight .owner-org-sub-countdown {
  border-color: rgba(167, 139, 250, 0.45);
  background: linear-gradient(135deg, rgba(91, 33, 182, 0.45) 0%, rgba(49, 46, 129, 0.35) 100%);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.25);
}
html.theme-obsidian .owner-org-sub-countdown.is-warn,
body.theme-obsidian .owner-org-sub-countdown.is-warn,
html.theme-midnight .owner-org-sub-countdown.is-warn,
body.theme-midnight .owner-org-sub-countdown.is-warn {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.4) 0%, rgba(120, 53, 15, 0.35) 100%);
}
html.theme-obsidian .owner-org-sub-countdown__lab,
body.theme-obsidian .owner-org-sub-countdown__lab,
html.theme-midnight .owner-org-sub-countdown__lab,
body.theme-midnight .owner-org-sub-countdown__lab {
  color: #ddd6fe;
}
html.theme-obsidian .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__lab,
body.theme-obsidian .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__lab,
html.theme-midnight .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__lab,
body.theme-midnight .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__lab {
  color: #fde68a;
}
html.theme-obsidian .owner-org-sub-countdown__unit,
body.theme-obsidian .owner-org-sub-countdown__unit,
html.theme-midnight .owner-org-sub-countdown__unit,
body.theme-midnight .owner-org-sub-countdown__unit {
  color: #faf5ff;
  background: rgba(124, 58, 237, 0.55);
  border-color: rgba(196, 181, 253, 0.5);
}
html.theme-obsidian .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__unit,
body.theme-obsidian .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__unit,
html.theme-midnight .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__unit,
body.theme-midnight .owner-org-sub-countdown.is-warn .owner-org-sub-countdown__unit {
  color: #fffbeb;
  background: rgba(217, 119, 6, 0.55);
  border-color: rgba(251, 191, 36, 0.55);
}

.owner-org-row__metrics {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  z-index: 1;
}

.owner-org-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-alt, #f8fafc) 65%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, var(--border, #e2e8f0) 80%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent);
}

.owner-org-metric__lab {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.owner-org-metric__val {
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text, #0f172a);
}

.owner-org-row__status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
  z-index: 1;
}

.owner-org-status-block {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}
.owner-org-status-chip-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 0.35rem;
  min-width: 0;
}

.owner-org-status-lab {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.owner-org-status-block .owner-status-chip {
  width: fit-content;
  max-width: 100%;
  white-space: normal;
  text-align: start;
  line-height: 1.25;
  font-size: 0.7rem;
}

/* Action column — end of row: bell on top, open below */
.owner-org-row__action {
  z-index: 5;
  align-self: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-width: 2.65rem;
  padding-block: 0.35rem;
  overflow: visible;
}

.owner-org-sub-alert--row-end {
  margin: 0;
  flex-shrink: 0;
  overflow: visible;
}
.owner-org-sub-alert--row-end .owner-org-sub-alert__btn {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  cursor: pointer;
}
.owner-org-sub-alert--row-end .owner-org-sub-alert__tip {
  display: none !important;
}

.owner-org-open-btn {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  background: color-mix(in srgb, var(--accent, #0284c7) 14%, var(--card, #fff));
  border: 1px solid color-mix(in srgb, var(--accent, #0284c7) 30%, transparent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent, #0284c7) 18%, transparent);
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease;
}

.owner-org-open-btn:hover {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--accent, #0284c7) 22%, var(--card, #fff));
}

html.theme-obsidian .owner-org-row,
body.theme-obsidian .owner-org-row {
  background:
    linear-gradient(155deg,
      rgba(99, 102, 241, 0.14) 0%,
      rgba(22, 22, 32, 0.92) 42%,
      rgba(12, 12, 20, 0.96) 100%);
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html.theme-obsidian .owner-org-row__name,
body.theme-obsidian .owner-org-row__name {
  color: #f8fafc;
}

html.theme-obsidian .owner-org-row__meta,
html.theme-obsidian .owner-org-row__place,
body.theme-obsidian .owner-org-row__meta,
body.theme-obsidian .owner-org-row__place {
  color: #cbd5e1;
}

html.theme-obsidian .owner-org-metric,
body.theme-obsidian .owner-org-metric {
  background: rgba(0, 0, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.1);
}

html.theme-obsidian .owner-org-metric__val,
body.theme-obsidian .owner-org-metric__val {
  color: #f1f5f9;
}

html.theme-obsidian .owner-org-status-lab,
html.theme-obsidian .owner-org-metric__lab,
body.theme-obsidian .owner-org-status-lab,
body.theme-obsidian .owner-org-metric__lab {
  color: #94a3b8;
}

/* Dark theme — high-contrast bell on cards */
html.theme-obsidian .owner-org-sub-alert__btn,
body.theme-obsidian .owner-org-sub-alert__btn,
html.theme-midnight .owner-org-sub-alert__btn,
body.theme-midnight .owner-org-sub-alert__btn {
  border: 2px solid #fbbf24;
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.55) 0%, rgba(217, 119, 6, 0.4) 100%);
  color: #fffbeb;
  box-shadow:
    0 0 16px rgba(251, 191, 36, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
html.theme-obsidian .owner-org-sub-alert__btn.is-trial,
body.theme-obsidian .owner-org-sub-alert__btn.is-trial,
html.theme-midnight .owner-org-sub-alert__btn.is-trial,
body.theme-midnight .owner-org-sub-alert__btn.is-trial {
  border: 2px solid #ddd6fe;
  background: linear-gradient(145deg, rgba(196, 181, 253, 0.65) 0%, rgba(124, 58, 237, 0.5) 100%);
  color: #faf5ff;
  box-shadow:
    0 0 18px rgba(167, 139, 250, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
html.theme-obsidian .owner-org-sub-alert__btn svg,
body.theme-obsidian .owner-org-sub-alert__btn svg,
html.theme-midnight .owner-org-sub-alert__btn svg,
body.theme-midnight .owner-org-sub-alert__btn svg {
  stroke: currentColor;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}
html.theme-obsidian .owner-org-sub-alert__btn.is-trial svg,
body.theme-obsidian .owner-org-sub-alert__btn.is-trial svg,
html.theme-midnight .owner-org-sub-alert__btn.is-trial svg,
body.theme-midnight .owner-org-sub-alert__btn.is-trial svg {
  stroke: #faf5ff;
  filter: drop-shadow(0 0 8px rgba(221, 214, 254, 0.85));
}
html.theme-obsidian .owner-org-row__trial-tag,
body.theme-obsidian .owner-org-row__trial-tag,
html.theme-midnight .owner-org-row__trial-tag,
body.theme-midnight .owner-org-row__trial-tag {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-color: #c4b5fd;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.45);
}

@media (max-width: 1100px) {
  .owner-org-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "id identity action"
      "metrics metrics metrics"
      "status status status";
  }
  .owner-org-row__id-col { grid-area: id; }
  .owner-org-row__identity { grid-area: identity; }
  .owner-org-row__action { grid-area: action; justify-self: end; }
  .owner-org-row__metrics { grid-area: metrics; justify-content: flex-start; }
  .owner-org-row__status-grid { grid-area: status; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .owner-org-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "identity action"
      "id id"
      "metrics metrics"
      "status status";
  }
  .owner-org-row__id-col {
    grid-area: id;
    flex-direction: row;
    justify-content: flex-start;
  }
  .owner-org-row__status-grid {
    grid-template-columns: 1fr;
  }
}
