/* User Analytics dashboard — scoped to #analytics-root */
body.adm-authed:has(#page-analytics.active) .fl-topbar { display: none; }
body.adm-authed:has(#page-analytics.active) #fl-pages.fl-pad { padding: 0; gap: 0; }

#page-analytics { padding: 0 !important; gap: 0 !important; }
#page-analytics.active { display: block !important; }

.ua-dashboard {
  --bg-base: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2235;
  --bg-input: #1f2937;
  --border: #1f2937;
  --border-subtle: #ffffff0a;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #4b5563;
  --accent-red: #e53935;
  --accent-green: #22c55e;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-purple: #a855f7;
  --accent-teal: #14b8a6;
  --accent-indigo: #6366f1;
  --accent-orange: #f97316;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  font-family: 'DM Sans', var(--font-sans), system-ui, sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: calc(100vh - 48px);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
  overflow-x: hidden;
}

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

@keyframes uaFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes uaLivePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes uaShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes uaShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-12deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
}

.ua-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  transition: box-shadow 0.2s ease;
  animation: uaFadeUp 0.4s ease forwards;
  opacity: 0;
}
.ua-card:hover {
  box-shadow: 0 0 0 1px rgba(229, 57, 53, 0.25), 0 4px 24px rgba(0, 0, 0, 0.4);
}

.ua-skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: uaShimmer 1.5s infinite;
  border-radius: 4px;
}

.ua-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* Header + toolbar */
.ua-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 0 16px 0;
  animation: uaFadeUp 0.4s ease forwards;
}
.ua-header-left h1 {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
}
.ua-header-left p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.ua-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ua-toolbar-item {
  position: relative;
}

.ua-toolbar-pill,
.ua-toolbar-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid #374151;
  background: #1f2937;
  transition: all 0.15s ease;
}

.ua-toolbar-pill {
  padding: 7px 12px;
  color: #9ca3af;
}

.ua-toolbar-pill:hover {
  background: #374151;
}

.ua-toolbar-pill-date {
  color: #fff;
}

.ua-toolbar-date-text {
  font-weight: 500;
  color: #fff;
}

.ua-toolbar-muted {
  color: #9ca3af;
}

.ua-toolbar-ico {
  display: inline-flex;
  color: #9ca3af;
  flex-shrink: 0;
}

.ua-toolbar-ico-white {
  color: #fff;
}

.ua-export-chev {
  opacity: 0.8;
}

.ua-toolbar-clear:hover {
  background: #ef444415;
  border-color: #ef444440;
}

.ua-toolbar-clear:hover .ua-toolbar-ico,
.ua-toolbar-clear:hover .ua-toolbar-muted {
  color: #ef4444;
}

.ua-toolbar-export {
  padding: 7px 14px;
  background: #e53935;
  border: none;
  color: #fff;
  font-weight: 600;
}

.ua-toolbar-export:hover {
  background: #c62828;
}

@keyframes uaSpin {
  to { transform: rotate(360deg); }
}

.ua-refresh-ico.ua-spinning {
  animation: uaSpin 0.5s ease;
}

.ua-toolbar-drop {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 14px;
  width: 240px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.ua-toolbar-drop.open {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ua-toolbar-drop-sm {
  width: 200px;
  padding: 12px 14px;
}

.ua-toolbar-drop-export {
  width: 180px;
  padding: 6px;
  gap: 0;
}

.ua-drop-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ua-drop-input {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  width: 100%;
}

.ua-drop-apply {
  width: 100%;
  margin-top: 4px;
  background: #e53935;
  border: none;
  border-radius: 6px;
  padding: 7px;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.ua-drop-apply:hover {
  background: #c62828;
}

.ua-filters-empty {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #9ca3af;
}

.ua-export-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
}

.ua-export-item:hover {
  background: #374151;
}

/* Clear modal */
.ua-modal-overlay[hidden] {
  display: none !important;
}

.ua-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ua-modal {
  position: relative;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 14px;
  padding: 28px 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.ua-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #4b5563;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.ua-modal-close:hover {
  color: #fff;
}

.ua-modal-icon {
  display: flex;
  justify-content: center;
  color: #ef4444;
}

.ua-modal-title {
  margin: 12px 0 0;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.ua-modal-body {
  margin: 8px 0 0;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: #9ca3af;
  line-height: 1.6;
}

.ua-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.ua-modal-cancel,
.ua-modal-confirm {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.ua-modal-cancel {
  background: transparent;
  border: 1px solid #374151;
  color: #9ca3af;
}

.ua-modal-cancel:hover {
  background: #1f2937;
}

.ua-modal-confirm {
  background: #ef4444;
  border: none;
  color: #fff;
}

.ua-modal-confirm:hover {
  background: #dc2626;
}

/* Toast */
.ua-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.ua-toast span {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #fff;
}

.ua-toast.ua-toast-visible {
  transform: translateY(0);
  opacity: 1;
}

/* After first paint — disable entry animations on background refresh */
.ua-dashboard.ua-ready .ua-metric-card,
.ua-dashboard.ua-ready .ua-card,
.ua-dashboard.ua-ready .ua-header {
  animation: none;
  opacity: 1;
}

.ua-dashboard.ua-ready .ua-table tbody tr {
  animation: none;
}

/* Metrics row */
.ua-metrics-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.ua-metric-card {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 16px 14px;
  animation: uaFadeUp 0.4s ease forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ua-metric-card:hover {
  border-color: color-mix(in srgb, var(--metric-accent, #3b82f6) 35%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--metric-accent, #3b82f6) 12%, transparent),
              0 8px 28px rgba(0, 0, 0, 0.35);
}

.ua-metric-accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--metric-accent, #3b82f6), transparent 85%);
  opacity: 0.85;
  pointer-events: none;
}

.ua-metric-watermark {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-58%);
  opacity: 0.06;
  pointer-events: none;
  line-height: 0;
}

.ua-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.ua-metric-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ua-metric-spark {
  width: 72px;
  height: 32px;
  flex-shrink: 0;
  opacity: 0.9;
}

.ua-metric-body {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
  min-height: 52px;
}

.ua-metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--metric-color, #3b82f6) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--metric-color, #3b82f6) 28%, transparent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--metric-color, #3b82f6) 18%, transparent);
}

.ua-metric-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 28px;
  color: var(--text-primary);
  line-height: 1;
  flex: 1;
  min-width: 0;
}

.ua-metric-footer {
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  min-height: 16px;
}

.ua-trend {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.ua-trend.up { color: var(--accent-green); }
.ua-trend.down { color: var(--danger); }

/* Two-column rows */
.ua-row-2 { display: flex; gap: 16px; width: 100%; }
.ua-row-2 .ua-panel-left-58 { flex: 0 0 58%; min-width: 0; }
.ua-row-2 .ua-panel-right-42 { flex: 0 0 calc(42% - 16px); min-width: 0; }
.ua-row-2 .ua-panel-left-52 { flex: 0 0 52%; min-width: 0; }
.ua-row-2 .ua-panel-right-48 { flex: 0 0 calc(48% - 16px); min-width: 0; }

.ua-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ua-card-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.ua-card-head-center { display: flex; align-items: center; gap: 8px; }
.ua-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #22c55e15;
  border: 1px solid #22c55e40;
  color: #22c55e;
}
.ua-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: uaLivePulse 1.2s infinite;
}
.ua-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ua-tab {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: var(--bg-input);
  color: var(--text-secondary);
}
.ua-tab.active { background: var(--accent-red); color: #fff; }
.ua-link {
  font-size: 11px;
  color: var(--accent-red);
  text-decoration: none;
  white-space: nowrap;
}
.ua-link:hover { text-decoration: underline; }
.ua-fail-pill {
  font-size: 11px;
  color: var(--accent-amber);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
}

/* Tables */
.ua-table-wrap {
  max-height: 240px;
  overflow-y: auto;
  overflow-x: auto;
}
.ua-table-wrap::-webkit-scrollbar { width: 2px; }
.ua-table-wrap::-webkit-scrollbar-thumb { background: var(--border); }
.ua-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.ua-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-card);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.ua-table tbody td {
  font-size: 12px;
  color: var(--text-primary);
  padding: 8px 6px;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.ua-table tbody tr { animation: uaFadeUp 0.35s ease forwards; }
.ua-table tbody tr:hover { background: var(--bg-card-hover); }
.ua-table tbody tr.ua-flash-new { background: #22c55e10; transition: background 1s ease; }
.ua-table tbody tr.ua-row-done { background: rgba(34, 197, 94, 0.15); transition: opacity 0.5s; }
.ua-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }

/* Badges */
.ua-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid;
  background: transparent;
}
.ua-badge.uploading { border-color: #3b82f6; color: #3b82f6; }
.ua-badge.completed { border-color: #22c55e; color: #22c55e; }
.ua-badge.downloading { border-color: #06b6d4; color: #06b6d4; }
.ua-badge.failed { background: #ef444420; border-color: #ef4444; color: #ef4444; }
.ua-badge.verified { border-color: #14b8a6; color: #14b8a6; }
.ua-badge.opened { border-color: #a855f7; color: #a855f7; }
.ua-badge.stalled { background: #ef444420; border-color: #ef4444; color: #ef4444; }
.ua-badge.completing { border-color: #f59e0b; color: #f59e0b; }
.ua-badge.type-upload { border-color: #3b82f6; color: #3b82f6; }
.ua-badge.type-download { border-color: #22c55e; color: #22c55e; }
.ua-badge.critical { background: #ef444420; color: #ef4444; border: none; border-radius: 4px; }
.ua-badge.warning { background: #f59e0b20; color: #f59e0b; border: none; border-radius: 4px; }
.ua-badge.info { background: #3b82f620; color: #3b82f6; border: none; border-radius: 4px; }

/* Progress */
.ua-progress-cell { display: flex; align-items: center; gap: 8px; }
.ua-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  min-width: 40px;
}
.ua-progress-fill {
  height: 100%;
  border-radius: 3px;
  width: 0;
  transition: width 0.8s ease;
}
.ua-progress-fill.green { background: var(--accent-green); }
.ua-progress-fill.amber { background: var(--accent-amber); }
.ua-progress-fill.red { background: var(--danger); }
.ua-progress-pct { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-secondary); min-width: 32px; }

/* Heatmap + funnel row (compact charts) */
.ua-row-charts {
  display: grid;
  grid-template-columns: 52fr 48fr;
  gap: 16px;
  align-items: stretch;
  width: 100%;
}

.ua-chart-card {
  padding: 16px 20px;
  max-height: 280px;
  min-height: 0;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ua-chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.ua-chart-card-head-funnel { margin-bottom: 14px; }

.ua-chart-card-head-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
}

.ua-chart-card-head-left svg { width: 14px; height: 14px; color: var(--text-secondary); flex-shrink: 0; }

.ua-chart-muted {
  font-weight: 400;
  color: var(--text-muted);
}

.ua-chart-info {
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

/* Heatmap */
.ua-heatmap-grid {
  display: grid;
  grid-template-columns: 32px repeat(7, 1fr);
  grid-template-rows: 20px repeat(7, 1fr);
  gap: 3px;
  height: 190px;
  width: 100%;
  flex-shrink: 0;
}

.ua-heatmap-corner { min-height: 0; }

.ua-heatmap-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  align-self: center;
  min-height: 0;
}

.ua-heatmap-day {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-secondary);
  width: 32px;
  align-self: center;
  text-align: right;
  padding-right: 6px;
  min-height: 0;
}

.ua-heatmap-cell {
  border-radius: 3px;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
  position: relative;
}

.ua-heatmap-cell:hover {
  transform: scale(1.15);
  z-index: 10;
}

.ua-heatmap-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ua-heatmap-gradient {
  width: 140px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #1e3a5f, #1d4ed8, #f59e0b, #ef4444);
}

.ua-tooltip {
  position: fixed;
  pointer-events: none;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 5px 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  z-index: 9999;
  display: none;
}

/* Funnel */
.ua-funnel {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
}

.ua-funnel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  flex-shrink: 0;
}

.ua-funnel-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.ua-funnel-bar-track {
  flex: 1;
  position: relative;
  height: 32px;
  min-width: 0;
}

.ua-funnel-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  min-width: 0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 12px;
  overflow: hidden;
  transition: width 0.8s ease;
}

.ua-funnel-bar-label {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}

.ua-funnel-stats {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}

.ua-funnel-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.ua-funnel-pct {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
}

/* Bottom 5-col */
.ua-row-5 { display: flex; gap: 16px; width: 100%; }
.ua-col-users { flex: 1.8; min-width: 0; }
.ua-col-companies { flex: 1.8; min-width: 0; }
.ua-col-donut { flex: 1; min-width: 0; }

.ua-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ua-rank-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.ua-rank-dot.gold { background: #fbbf24; }
.ua-rank-dot.silver { background: #9ca3af; }
.ua-rank-dot.bronze { background: #d97706; }
.ua-company-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #22c55e20;
  z-index: 0;
  pointer-events: none;
}
.ua-company-cell { position: relative; z-index: 1; }
.ua-company-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.ua-donut-wrap {
  position: relative;
  width: 100%;
  max-width: 120px;
  margin: 0 auto;
}
.ua-donut-wrap canvas { width: 100% !important; height: auto !important; }
.ua-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 22px;
  pointer-events: none;
}
.ua-donut-trend {
  text-align: center;
  font-size: 11px;
  margin-top: 6px;
}

/* Health snapshot */
.ua-health-bar .ua-card-head { margin-bottom: 16px; }
.ua-health-items {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  flex-wrap: wrap;
}
.ua-health-item {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
  border-right: 1px solid var(--border);
}
.ua-health-item:first-child { padding-left: 0; }
.ua-health-item:last-child { border-right: none; padding-right: 0; }
.ua-health-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}
.ua-health-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
}
.ua-health-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Alerts */
.ua-alert-tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; padding-bottom: 0; }
.ua-alert-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: -1px;
}
.ua-alert-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-red); }
.ua-alert-tab .ua-count { margin-left: 4px; font-size: 10px; }
.ua-alert-tab .ua-count.critical { color: var(--danger); }
.ua-alert-tab .ua-count.warning { color: var(--warning); }
.ua-alert-tab .ua-count.info { color: var(--info); }
.ua-alert-list { display: flex; flex-direction: column; }
.ua-alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.ua-alert-row:hover { background: var(--bg-card-hover); }
.ua-alert-row.critical { border-left: 2px solid var(--danger); padding-left: 8px; }
.ua-alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ua-alert-dot.critical { background: var(--danger); }
.ua-alert-dot.warning { background: var(--warning); }
.ua-alert-dot.info { background: var(--info); }
.ua-alert-msg {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.ua-alert-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.ua-bell-shake { animation: uaShake 0.5s ease; }

/* Storage quota bars */
.ua-quota-cell { display: flex; align-items: center; gap: 8px; }
.ua-quota-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
  min-width: 50px;
}
.ua-quota-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.ua-spark-mini { width: 40px; height: 20px; }

/* Link intelligence */
.ua-link-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ua-link-pill {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.ua-link-pill.amber { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3); }
.ua-link-pill.red { box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3); }
.ua-link-pill.green { box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3); }
.ua-link-pill-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.ua-link-pill-val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 18px;
}
.ua-divider { height: 1px; background: var(--border); margin: 12px 0; }

.ua-row-3 { display: flex; gap: 16px; width: 100%; }
.ua-row-3 > * { flex: 1; min-width: 0; }

@media (max-width: 1400px) {
  .ua-metrics-row { flex-wrap: wrap; }
  .ua-metric-card { flex: 1 1 calc(25% - 12px); }
  .ua-row-2, .ua-row-5, .ua-row-charts { flex-wrap: wrap; }
  .ua-row-2 > *, .ua-row-5 > *, .ua-row-charts > * { flex: 1 1 100% !important; }
  .ua-row-charts { grid-template-columns: 1fr; }
}
