/* Admin dashboard layout */
@import url('shell.css');

.user-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--shell-panel);
  border: 1px solid var(--shell-border);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--shell-text-secondary);
}
.site-pill {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--shell-panel);
  border: 1px solid var(--shell-border);
  font-size: 0.72rem;
  color: var(--shell-muted);
}

.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-border);
  background: var(--shell-panel);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--shell-text-secondary);
  cursor: pointer;
  transition: border-color 0.12s;
}
.live-toggle:hover {
  border-color: var(--line-strong);
}
.live-toggle input { accent-color: var(--accent); }

.page-content {
  flex: 1;
  width: 100%;
  max-width: none;
  padding: 16px 18px 32px;
  box-sizing: border-box;
}

.main-area {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  padding: 10px 12px;
  background: var(--shell-panel);
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.stat-card::before {
  display: none;
}
.stat-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--shell-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--shell-text);
  line-height: 1.1;
}
.stat-spark {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 58px;
  opacity: 0.92;
  z-index: 0;
}

.fluid-analytics-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  background: var(--shell-panel);
  box-shadow: none;
}
.fluid-analytics-panel::before {
  display: none;
}
.fluid-analytics-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 200px;
}
.eyebrow {
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--shell-active);
  border: 1px solid var(--accent-muted);
  color: var(--shell-accent);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fluid-analytics-copy h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}
.fluid-analytics-copy p {
  max-width: 340px;
  margin: 6px 0 12px;
  color: var(--shell-muted);
  font-size: 0.72rem;
}
.fluid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fluid-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--shell-border);
  background: var(--shell-elevated);
  color: var(--shell-text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.blue { background: #4f46e5; }
.legend-dot.violet { background: #a855f7; }
.legend-dot.rose { background: #fb7185; }
.legend-dot.cyan { background: #06b6d4; }
.fluid-graph-wrap {
  position: relative;
  z-index: 1;
  min-height: 320px;
  padding: 10px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--shell-border);
  background: var(--shell-panel);
  box-shadow: none;
}
.fluid-graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.fluid-graph-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fluid-control-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-border);
  background: var(--shell-panel);
  color: var(--shell-accent);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}
.fluid-control-btn:hover {
  border-color: rgba(79, 70, 229, 0.45);
  background: #fff;
}
.fluid-range-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: default;
  user-select: none;
}
.fluid-range-label[title] {
  cursor: help;
}
.fluid-replay-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(79, 70, 229, 0.2);
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.fluid-replay-pill:hover {
  border-color: rgba(79, 70, 229, 0.42);
  background: rgba(79, 70, 229, 0.12);
}
.fluid-graph-wrap.is-paused .fluid-replay-dot {
  background: #f59e0b;
  animation: none;
}
.fluid-replay-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  animation: fluid-replay-pulse 1.8s ease infinite;
}
@keyframes fluid-replay-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.fluid-graph-main {
  position: relative;
  min-height: 240px;
  border-radius: var(--radius-sm);
  overflow: visible;
  background: var(--shell-elevated);
  border: 1px solid var(--shell-border);
}
.fluid-graph-main canvas {
  display: block;
  width: 100%;
  height: 260px;
}
.fluid-graph-axis {
  position: absolute;
  left: 34px;
  right: 18px;
  bottom: 8px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.fluid-graph-axis span {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(100, 116, 139, 0.85);
}
.fluid-playhead {
  position: absolute;
  top: 28px;
  bottom: 28px;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(79,70,229,0.05), rgba(79,70,229,0.85), rgba(79,70,229,0.05));
  box-shadow: 0 0 14px rgba(79, 70, 229, 0.35);
  pointer-events: none;
  z-index: 3;
}
.fluid-event-markers {
  position: absolute;
  inset: 0;
  z-index: 4;
}
.fluid-event-pin {
  position: absolute;
  transform: translate(-50%, -100%) scale(0.6);
  opacity: 0;
  pointer-events: auto;
  cursor: pointer;
  transition: left 0.15s ease, top 0.15s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
}
.fluid-event-pin.is-visible {
  transform: translate(-50%, -100%) scale(1);
  opacity: 1;
}
.fluid-event-pin.is-hovered,
.fluid-event-pin.is-selected {
  z-index: 6;
}
.fluid-event-pin.is-hovered .fluid-event-bubble,
.fluid-event-pin.is-selected .fluid-event-bubble {
  transform: scale(1.12);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2), 0 0 0 5px var(--pin-ring, rgba(79,70,229,0.16));
}
.fluid-event-pin.is-selected .fluid-event-bubble {
  border-width: 3px;
}
.fluid-event-bubble {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--pin-color, #4f46e5);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.95), rgba(255,255,255,0.72)),
    var(--pin-ring, rgba(79,70,229,0.2));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14), 0 0 0 4px var(--pin-ring, rgba(79,70,229,0.12));
  color: var(--pin-color, #4f46e5);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-width 0.18s ease;
}
.fluid-event-tail {
  display: block;
  width: 2px;
  height: 10px;
  margin: 0 auto;
  background: var(--pin-color, #4f46e5);
  border-radius: 2px;
  opacity: 0.85;
}
.fluid-event-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  background: #10b981;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}
.fluid-event-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 14px));
}
.fluid-event-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: rgba(255, 255, 255, 0.97);
  border-right: 1px solid rgba(203, 213, 225, 0.9);
  border-bottom: 1px solid rgba(203, 213, 225, 0.9);
  transform: rotate(45deg);
}
.fluid-event-tooltip strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  color: var(--text);
}
.fluid-event-tooltip span {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.45;
}
.fluid-event-detail {
  position: absolute;
  z-index: 9;
  width: min(300px, calc(100% - 24px));
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-border);
  background: var(--shell-panel);
  box-shadow: var(--shadow-md);
}
.fluid-event-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.fluid-event-detail-head strong {
  font-size: 0.92rem;
  line-height: 1.3;
}
.fluid-event-detail-close {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.fluid-event-detail-close:hover {
  background: rgba(148, 163, 184, 0.24);
  color: var(--text);
}
.fluid-event-detail-meta {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.fluid-event-detail-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.fluid-event-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 160px;
  overflow: auto;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}
.fluid-event-detail-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.fluid-event-detail-list li:last-child {
  border-bottom: none;
}
.fluid-event-detail-hint {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--muted);
}
.fluid-timeline-shell {
  position: relative;
  height: 58px;
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.75);
  background: rgba(248, 250, 252, 0.92);
  cursor: grab;
}
.fluid-timeline-shell canvas {
  display: block;
  width: 100%;
  height: 58px;
}
.fluid-timeline-window {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border: 2px solid rgba(79, 70, 229, 0.75);
  border-radius: 10px;
  background: rgba(79, 70, 229, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65);
  pointer-events: auto;
  touch-action: none;
}
.fluid-timeline-window.is-dragging {
  cursor: grabbing;
  border-color: #4f46e5;
}
.fluid-timeline-handle {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45);
  cursor: ew-resize;
}
.fluid-timeline-handle.left { left: -7px; }
.fluid-timeline-handle.right { right: -7px; }
.fluid-timeline-playhead {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  margin-left: -1px;
  background: rgba(16, 185, 129, 0.9);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45);
  pointer-events: none;
  z-index: 2;
}
.fluid-timeline-playhead::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #fff;
}

.panel-head { margin-bottom: 14px; }

.install-box {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-secondary);
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.attention-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--shell-border);
  background: var(--shell-elevated);
  box-shadow: none;
}
.attention-card.incident { border-color: var(--danger-border); background: var(--danger-soft); }
.attention-card.rage { border-color: var(--warn-border); background: var(--warn-soft); }
.attention-card.dead { border-color: #ddd6fe; background: var(--purple-soft); }
.attention-card.probe { border-color: #c4b5fd; background: #f5f3ff; }
.attention-card.live { border-color: var(--success-border); background: var(--success-soft); }
.attention-card strong { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.attention-card small { color: var(--muted); display: block; margin-bottom: 10px; line-height: 1.45; font-size: 0.8rem; }
.attention-card .btn { padding: 7px 12px; font-size: 0.8rem; }

.live-banner {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--success-border);
  background: var(--success-soft);
  box-shadow: none;
}
.live-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--success);
  background: #fff;
  border: 1px solid var(--success-border);
}
.live-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: livePulse 1.4s ease-in-out infinite;
}
.live-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.live-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--success-border);
  background: #fff;
}
.live-card-info {
  flex: 1;
  min-width: 0;
}
.live-card-info small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-card .watch-btn {
  flex-shrink: 0;
}
.live-row-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--success);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.search-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  font-family: inherit;
  font-size: 0.78rem;
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  background: var(--shell-panel);
  color: var(--shell-text);
  box-shadow: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.toolbar-select {
  width: auto;
  min-width: 180px;
  padding-left: 14px;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent-muted);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.journey-flows {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.journey-chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  border: 1px solid var(--line);
  background: var(--surface-inset);
  color: var(--text-secondary);
}

.table-card {
  background: var(--shell-panel);
  border: 1px solid var(--shell-border);
  border-radius: var(--radius-sm);
  box-shadow: none;
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--shell-border);
  background: var(--shell-elevated);
}
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
thead { background: var(--shell-elevated); }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--shell-border);
  vertical-align: middle;
}
th {
  color: var(--shell-muted);
  font-weight: 600;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-subtle); }
tr.is-live td { background: var(--success-soft); }

.session-id {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  word-break: break-all;
}
.page-url { font-size: 0.82rem; color: var(--text-secondary); word-break: break-all; }
.browser-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.browser-cell span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.incident-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.incident-actions select {
  min-height: 32px;
  padding: 5px 30px 5px 10px;
  font-size: 0.8rem;
  background-position: right 8px center;
}
.watch-btn { padding: 7px 12px !important; font-size: 0.8rem !important; }
.watch-btn.is-disabled,
.watch-btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.mobile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.poll-status { font-size: 0.78rem; color: var(--muted); }
.empty-cta { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.mobile-cards { display: none; gap: 12px; }
.mobile-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.mobile-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

@media (max-width: 960px) {
  .page-content { padding: 16px; }
  .fluid-analytics-panel { grid-template-columns: 1fr; }
  .fluid-analytics-copy { min-height: auto; }
  .fluid-graph-wrap { min-height: 280px; }
  .table-card { display: none; }
  .mobile-cards { display: grid; }
  .search-wrap { min-width: 0; }
  .toolbar { flex-wrap: wrap; }
}

.recording-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
}
.recording-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.recording-field input, .recording-field textarea { color: var(--text); }
.recording-check { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; color: var(--text-secondary); }
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.analytics-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 16px; background: var(--surface-inset); }
.analytics-card h3 { margin: 0 0 10px; font-size: 0.88rem; }
.analytics-output { font-size: 0.8rem; line-height: 1.55; color: var(--text-secondary); display: grid; gap: 6px; }
