/* ════════════════════════════════════════════════════════════
   work-overview.css — Work Overview Page (Approach 3)
   Full-screen groups+map entry point for a selected work.
   ════════════════════════════════════════════════════════════ */

#workOverviewPage {
  display: flex;
  flex-direction: column;
  margin: -14px -28px -28px;   /* top: partial cancel of topbar margin-bottom, leaving ~10px gap */
  height: calc(100vh - 48px);  /* 48px ≈ topbar area; fills remaining viewport */
  overflow: hidden;
  background: var(--bg);
}

/* ── Header ── */
.ov-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card);
  gap: 12px;
}

.ov-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ov-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green, #22c55e);
  flex-shrink: 0;
}

.ov-work-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ov-work-meta {
  font-size: 10px;
  color: var(--muted2);
  margin-top: 1px;
}

/* ── Group filter tabs ── */
.ov-tabs-bar {
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  flex-shrink: 0;
  overflow-x: auto;
  background: var(--sidebar);
  scrollbar-width: none;
}
.ov-tabs-bar::-webkit-scrollbar { display: none; }

.ov-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 0;
  white-space: nowrap;
}

.ov-tab {
  --tab-color: var(--accent);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.ov-tab:hover {
  background: rgba(100, 116, 139, 0.08);
  color: var(--text);
}

.ov-tab.active {
  background: color-mix(in srgb, var(--tab-color) 12%, transparent);
  border-color: color-mix(in srgb, var(--tab-color) 35%, transparent);
  color: var(--tab-color);
}

.ov-tab-count {
  background: var(--border);
  color: var(--muted2);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 400;
  transition: inherit;
}

.ov-tab.active .ov-tab-count {
  background: color-mix(in srgb, var(--tab-color) 18%, transparent);
  color: var(--tab-color);
}

/* ── Body: left panel + map ── */
.ov-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Left panel ── */
.ov-left-panel {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  overflow: hidden;
}

.ov-device-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ov-all-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted2);
  padding: 8px 8px 4px;
  text-transform: uppercase;
  font-family: 'DM Mono', monospace;
}

.ov-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 10px 6px;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}
.ov-group-header:first-child { margin-top: 0; border-top: none; }

.ov-group-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ov-group-title {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text);
  font-family: 'DM Mono', monospace;
}

.ov-group-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted2);
  font-family: 'DM Mono', monospace;
}

.ov-device-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 22px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  user-select: none;
  margin-bottom: 4px;
}

.ov-device-row:hover,
.ov-device-row.highlighted {
  background: rgba(100, 116, 139, 0.15);
  border-color: rgba(100, 116, 139, 0.4);
}

.ov-device-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ov-device-info {
  flex: 1;
  min-width: 0;
}

.ov-device-type {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted2);
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.ov-device-name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.ov-device-ago {
  font-size: 10px;
  color: var(--muted2);
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
}

.ov-hint {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--muted2);
  border-top: 1px solid var(--border);
  background: var(--sidebar);
  flex-shrink: 0;
  line-height: 1.4;
}

.ov-loading,
.ov-empty,
.ov-error {
  padding: 24px 16px;
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
}
.ov-error { color: var(--red, #f87171); }

/* ── Map panel ── */
.ov-map-panel {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

#ovMap {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ov-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted2);
  font-size: 13px;
  background: var(--bg);
  padding: 24px;
  text-align: center;
}

/* ── Map pins (Leaflet DivIcon) ── */
.ov-map-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}

.ov-map-pin:hover {
  transform: scale(1.18);
}

/* ── Map legend ── */
.ov-map-legend {
  position: absolute;
  bottom: 20px;
  left: 12px;
  z-index: 500;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.ov-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
}

.ov-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
