/* ============================================================
   Retina Dashboard demo + shared product-expand panel
   ============================================================ */

:root {
  --retina-bg:         #f5f5f5;
  --retina-card:       #ffffff;
  --retina-sidebar:    #fbfbfb;
  --retina-sidebar-border: #ececec;
  --retina-border:     #e4e4e4;
  --retina-text:       #222;
  --retina-text-muted: #7a7a7a;
  --retina-text-dim:   #a0a0a0;
  --retina-yellow:     #F4C430;
  --retina-green:      #5FB95F;
  --retina-accent:     #1e89c0;
  --retina-highlight:  #8ed3ff;
  --retina-alert:      #3AAA35;
}

/* ============================================================
   Shared product expand panel (works for Iris and Retina kinds)
   ============================================================ */
.product-expand {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: block;
  pointer-events: none;
}

.product-expand:not([hidden]) {
  pointer-events: auto;
}

.product-expand__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 40, 42, 0.62);
  /* backdrop-filter removed for perf */
  opacity: 0;
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-expand--open .product-expand__backdrop {
  opacity: 1;
}

.product-expand__window {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(320px, 80vw, 1100px);
  height: clamp(400px, 70vh, 680px);
  transform: translate(-50%, -50%) scale(0.95);
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition:
    opacity 400ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.product-expand--open .product-expand__window {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Iris variant: dark background so the fake chat reads like the hero demo */
.product-expand[data-kind="iris"] .product-expand__window {
  background: #0a0a12;
}

/* Retina variant: light warm-neutral bg like the real dashboard */
.product-expand[data-kind="retina"] .product-expand__window {
  background: var(--retina-bg);
}

.product-expand__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  border: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: background 200ms ease, transform 200ms ease;
}

.product-expand__close:hover {
  background: #ffffff;
  transform: scale(1.05);
}

.product-expand[data-kind="iris"] .product-expand__close {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: none;
}

.product-expand[data-kind="iris"] .product-expand__close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.product-expand__content {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Mobile: fullscreen */
@media (max-width: 768px) {
  .product-expand__window {
    width: 95vw;
    height: 90vh;
  }
}

/* ============================================================
   Iris content inside the expand panel
   ============================================================ */
.product-expand[data-kind="iris"] .product-expand__content {
  flex-direction: column;
  padding: 0;
}

/* The fake chat mount takes the full panel minus a 56px header */
.pe-iris {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #0a0a18 0%, #12121f 100%);
  position: relative;
  overflow: hidden;
}

.pe-iris__header {
  height: 56px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.pe-iris__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 111, 216, 0.9) 0%, rgba(59, 47, 201, 0.4) 60%, transparent 100%);
  box-shadow: 0 0 28px rgba(123, 111, 216, 0.45);
  animation: peIrisLogoPulse 2.8s ease-in-out infinite;
}

@keyframes peIrisLogoPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.pe-iris__title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}

.pe-iris__subtitle {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pe-iris__body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ============================================================
   Retina dashboard — full mode
   ============================================================ */
.retina-dashboard {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--retina-bg);
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--retina-text);
  overflow: hidden;
}

.retina-dashboard *,
.retina-dashboard *::before,
.retina-dashboard *::after {
  box-sizing: border-box;
}

/* ---------- Topbar ---------- */
.retina__topbar {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid var(--retina-border);
  flex-shrink: 0;
}

.retina__topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--retina-text);
  letter-spacing: 0.01em;
}

.retina__topbar-brand b { font-weight: 700; }

.retina__topbar-brand-mark {
  display: inline-flex;
}

.retina__topbar-brand-mark img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.retina__sidebar-brand-mark img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.retina__breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--retina-text);
}

.retina__breadcrumb svg {
  color: var(--retina-accent);
}

.retina__breadcrumb-sep {
  color: var(--retina-text-dim);
  font-size: 14px;
}

.retina__topbar-spacer {
  flex: 1;
}

.retina__topbar-user {
  display: flex;
  align-items: center;
  font-size: 12px;
  text-align: right;
  line-height: 1.2;
}

.retina__topbar-user strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.retina__topbar-user small {
  display: block;
  font-size: 10px;
  color: var(--retina-text-muted);
}

/* ---------- Body split (sidebar + main) ---------- */
.retina__body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* ---------- Sidebar ---------- */
.retina__sidebar {
  width: 198px;
  background: var(--retina-sidebar);
  border-right: 1px solid var(--retina-sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.retina__sidebar::-webkit-scrollbar { width: 5px; }
.retina__sidebar::-webkit-scrollbar-track { background: transparent; }
.retina__sidebar::-webkit-scrollbar-thumb { background: #d4d4d4; border-radius: 3px; }

.retina__sidebar-brand {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  border-bottom: 1px solid var(--retina-sidebar-border);
}

.retina__sidebar-brand strong { font-weight: 700; }

.retina__sidebar-brand-mark {
  display: inline-flex;
}

.retina__sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.retina__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--retina-text);
  text-align: left;
  cursor: not-allowed;
  opacity: 0.78;
  transition: background 120ms ease, color 120ms ease;
}

.retina__nav-item[disabled] {
  pointer-events: none;
}

.retina__nav-icon {
  width: 16px;
  display: inline-flex;
  justify-content: center;
  color: var(--retina-text-muted);
  flex-shrink: 0;
}

.retina__nav-icon--sub {
  opacity: 0.4;
  width: 10px;
}

.retina__nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.retina__nav-chevron {
  display: inline-flex;
  color: var(--retina-text-dim);
}

.retina__nav-item--active {
  background: rgba(30, 137, 192, 0.10);
  color: var(--retina-accent);
  border-left: 3px solid var(--retina-accent);
  padding-left: 13px;
  opacity: 1;
  font-weight: 500;
}

.retina__nav-item--active .retina__nav-icon {
  color: var(--retina-accent);
}

.retina__nav-item--sub {
  padding-left: 42px;
  font-size: 11.5px;
  color: var(--retina-text-muted);
  background: rgba(30, 137, 192, 0.04);
}

.retina__sidebar-footer {
  padding: 12px 16px;
  font-size: 10px;
  color: var(--retina-text-dim);
  border-top: 1px solid var(--retina-sidebar-border);
  text-align: center;
}

/* ---------- Main ---------- */
.retina__main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px 28px;
  background: var(--retina-bg);
}

.retina__main::-webkit-scrollbar { width: 8px; }
.retina__main::-webkit-scrollbar-track { background: transparent; }
.retina__main::-webkit-scrollbar-thumb { background: #cfcfcf; border-radius: 4px; }

.retina__crumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.retina__crumb-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--retina-text);
}

.retina__crumb-left b { font-weight: 700; }

.retina__crumb-sep {
  color: var(--retina-text-dim);
  margin: 0 4px;
}

.retina__crumb-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.retina__crumb-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--retina-text-muted);
}

.retina__edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--retina-border);
  color: var(--retina-text);
  font-family: inherit;
  font-size: 11.5px;
  cursor: not-allowed;
  opacity: 0.85;
}

.retina__icon-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--retina-border);
  background: #ffffff;
  border-radius: 4px;
  cursor: not-allowed;
  opacity: 0.75;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--retina-text-muted);
}

/* ---------- Stats grid ---------- */
.retina__stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.4fr;
  gap: 12px;
  margin-bottom: 20px;
}

.retina__stat {
  background: #ffffff;
  border: 1px solid var(--retina-border);
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.retina__stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.retina__stat-icon--alert    { background: #e4f5e0; color: #3AAA35; }
.retina__stat-icon--active   { background: #e4f5e0; color: #3AAA35; }
.retina__stat-icon--inactive { background: #fde6e1; color: #D43A21; }
.retina__stat-icon--total    { background: #e8f0fe; color: #1e89c0; }

.retina__stat-label {
  font-size: 11.5px;
  color: var(--retina-text-muted);
  line-height: 1.3;
  font-weight: 400;
}

.retina__stat-value {
  font-size: 22px;
  font-weight: 500;
  color: var(--retina-text);
  line-height: 1.1;
  margin-top: 2px;
}

.retina__stat--highlight {
  background: linear-gradient(135deg, #7cc8e8 0%, #6fb9e0 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  justify-content: space-between;
  border: none;
  letter-spacing: 0.02em;
}

.retina__stat-map {
  color: #ffffff;
  opacity: 0.9;
}

/* ---------- Section header ---------- */
.retina__section-header {
  background: var(--retina-accent);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.retina__section-header h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Panels grid ---------- */
.retina__panels {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
  margin-bottom: 16px;
}

.retina__panel {
  background: #ffffff;
  border: 1px solid var(--retina-border);
  border-radius: 4px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.retina__panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #E8901C;
  margin: 0 0 2px;
}

.retina__panel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.retina__panel-dot--donut { background: #E8901C; }
.retina__panel-dot--line  { background: #E8901C; }

.retina__panel-sub {
  font-size: 10px;
  color: var(--retina-text-muted);
  margin: 2px 0 6px;
}

.retina__chart {
  flex: 1;
  min-height: 160px;
  width: 100%;
}

/* ---------- Legends ---------- */
.retina__legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--retina-text);
  padding-top: 8px;
  border-top: 1px solid var(--retina-border);
  margin-top: 8px;
}

.retina__legend strong {
  font-weight: 700;
  margin-left: 4px;
}

.retina__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.retina__dot--total {
  background: #cfcfcf;
}

.retina__legend--table {
  display: grid;
  grid-template-columns: 1.3fr repeat(4, 1fr);
  gap: 6px 14px;
  font-size: 11px;
  padding-top: 10px;
  margin-top: 10px;
}

.retina__legend--table > div {
  white-space: nowrap;
}

.retina__legend-cell {
  display: flex;
  align-items: center;
}

/* ============================================================
   Retina dashboard — MINI mode (for the product card background)
   Compact snapshot of the full dashboard: topbar + stats + 2 charts.
   No sidebar (saves horizontal space).
   ============================================================ */
.retina-dashboard--mini {
  background: var(--retina-bg);
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-size: 10px;
  color: var(--retina-text);
  overflow: hidden;
}

/* ---- Mini topbar ---- */
.retina__mini-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--retina-border);
  flex-shrink: 0;
}

.retina__mini-topbar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--retina-text);
}

.retina__mini-topbar-brand img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.retina__mini-topbar-crumb {
  font-size: 9.5px;
  color: var(--retina-text-muted);
}

/* ---- Mini stats row ---- */
.retina__mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.4fr;
  gap: 6px;
  padding: 6px 10px;
  flex-shrink: 0;
}

.retina__mini-stat {
  background: #ffffff;
  border: 1px solid var(--retina-border);
  border-radius: 3px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.retina__mini-stat-icon {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.retina__mini-stat-label {
  font-size: 8px;
  color: var(--retina-text-muted);
  line-height: 1.1;
}

.retina__mini-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--retina-text);
  line-height: 1.1;
}

.retina__mini-stat--highlight {
  background: linear-gradient(135deg, #7cc8e8 0%, #6fb9e0 100%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  justify-content: space-between;
  border: none;
}

/* ---- Mini panels (charts side by side) ---- */
.retina__mini-panels {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 6px;
  padding: 0 10px 8px;
  flex: 1;
  min-height: 0;
}

.retina-dashboard--mini .retina__panel {
  min-height: 0;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--retina-border);
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.retina-dashboard--mini .retina__panel-title {
  font-size: 9px;
  margin-bottom: 2px;
}

.retina-dashboard--mini .retina__panel-sub {
  font-size: 8px;
  margin-bottom: 2px;
}

.retina-dashboard--mini .retina__chart {
  flex: 1;
  min-height: 0;
}

.retina-dashboard--mini .retina__legend,
.retina-dashboard--mini .retina__legend--table {
  font-size: 8px;
  padding-top: 3px;
  margin-top: 3px;
  gap: 2px 6px;
}

.retina-dashboard--mini .retina__legend strong {
  margin-left: 2px;
}
