/* Milestone XProtect Smart Client Authentic Dark Theme */
:root {
  --bg-app: #181818;
  --bg-panel: #202020;
  --bg-card: #272727;
  --bg-card-hover: #2f2f2f;
  --bg-input: #1b1b1b;
  --border-color: #383838;
  --border-highlight: #4a4a4a;
  
  --milestone-blue: #0099ff;
  --milestone-blue-hover: #1aa3ff;
  --milestone-blue-dark: #0066aa;
  
  --accent-cyan: #00b7c3;
  --accent-green: #107c41;
  --accent-red: #e81123;
  --accent-yellow: #ffb900;
  --accent-purple: #881798;
  
  --text-main: #f3f3f3;
  --text-muted: #9e9e9e;
  --text-dim: #707070;
  
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 13px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: #3e3e3e;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555555;
}

/* Header / Title Bar */
.sc-header {
  min-height: 120px;
  height: auto;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 20px;
  flex-shrink: 0;
}

.sc-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sc-logo-badge {
  width: 32px;
  height: 32px;
  background: #0099ff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 0 12px rgba(0,153,255,0.4);
}

.sc-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
}

.sc-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

/* Workspace Tabs */
.sc-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 28px;
  background-color: rgba(0, 0, 0, 0.28);
  padding: 5px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.sc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sc-tab:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.sc-tab.active {
  color: #ffffff;
  background-color: rgba(0, 153, 255, 0.16);
  border-color: rgba(0, 153, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 153, 255, 0.18), inset 0 -2px 0 var(--milestone-blue);
}

/* Header Controls */
.sc-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background-color: rgba(16, 124, 65, 0.2);
  border: 1px solid rgba(16, 124, 65, 0.4);
  border-radius: 12px;
  font-size: 11px;
  color: #4ec9b0;
  font-weight: 500;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #4ec9b0;
  border-radius: 50%;
  box-shadow: 0 0 6px #4ec9b0;
}

/* Main Content Area */
.sc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
  position: relative;
}

.sc-main::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75%;
  max-width: 1000px;
  height: 75%;
  background-image: url('/assets/logo.png?v=13');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}

/* Toolbar */
.sc-toolbar {
  height: 44px;
  background-color: #1e1e1e;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.sc-search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  width: 280px;
}

.sc-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 12px;
  width: 100%;
  margin-left: 8px;
}

.sc-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-filter-btn {
  background-color: #272727;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sc-filter-btn:hover {
  background-color: #333333;
  color: #ffffff;
}

.sc-filter-btn.active {
  background-color: var(--milestone-blue-dark);
  border-color: var(--milestone-blue);
  color: #ffffff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  outline: none;
}

.btn-primary {
  background-color: var(--milestone-blue);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--milestone-blue-hover);
}

.btn-secondary {
  background-color: #333333;
  border-color: #4a4a4a;
  color: var(--text-main);
}
.btn-secondary:hover {
  background-color: #404040;
}

.btn-danger {
  background-color: rgba(232, 17, 35, 0.2);
  border-color: var(--accent-red);
  color: #ff6b6b;
}
.btn-danger:hover {
  background-color: rgba(232, 17, 35, 0.4);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

/* Views & Content */
.sc-view {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: none;
  position: relative;
  z-index: 1;
}
.sc-view.active {
  display: flex;
  flex-direction: column;
}

/* Case Grid */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.case-card {
  background-color: rgba(39, 39, 39, 0.88);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.case-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.case-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.case-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.case-icon-box svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

.case-card-info {
  flex: 1;
  min-width: 0;
}

.case-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--milestone-blue);
  letter-spacing: 0.5px;
}

.case-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.case-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.pill-active { background: rgba(0, 153, 255, 0.2); color: #0099ff; border: 1px solid rgba(0, 153, 255, 0.4); }
.pill-closed { background: rgba(110, 110, 110, 0.2); color: #aaaaaa; border: 1px solid rgba(110, 110, 110, 0.4); }
.pill-review, .pill-underreview { background: rgba(255, 185, 0, 0.2); color: #ffb900; border: 1px solid rgba(255, 185, 0, 0.4); }
.pill-urgent { background: rgba(232, 17, 35, 0.2); color: #ff6b6b; border: 1px solid rgba(232, 17, 35, 0.4); }
.pill-high { background: rgba(255, 140, 0, 0.2); color: #ffa500; border: 1px solid rgba(255, 140, 0, 0.4); }

.case-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
  font-size: 11px;
  color: var(--text-dim);
}

.case-stats {
  display: flex;
  gap: 12px;
}

/* Modals */
.sc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}
.sc-modal-overlay.active {
  display: flex;
}

.sc-modal {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 600px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.sc-modal-header {
  height: 48px;
  background-color: #262626;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.sc-modal-close {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px;
}
.sc-modal-close:hover {
  color: #fff;
}

.sc-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sc-modal-footer {
  padding: 12px 20px;
  background-color: #1e1e1e;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.form-input, .form-select, .form-textarea {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--milestone-blue);
  box-shadow: 0 0 6px rgba(0, 153, 255, 0.4);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Icon Palette Grid */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background-color: var(--bg-input);
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.icon-choice {
  width: 40px;
  height: 40px;
  background-color: #272727;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}
.icon-choice svg {
  width: 20px;
  height: 20px;
  fill: var(--text-muted);
}
.icon-choice:hover {
  background-color: #383838;
}
.icon-choice:hover svg {
  fill: #ffffff;
}
.icon-choice.selected {
  border-color: var(--milestone-blue);
  background-color: rgba(0, 153, 255, 0.2);
}
.icon-choice.selected svg {
  fill: var(--milestone-blue);
}

/* Color Palette Swatches */
.color-swatches {
  display: flex;
  gap: 8px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.selected {
  border-color: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}

/* Drag & Drop Upload Zone */
.dropzone {
  border: 2px dashed #444444;
  border-radius: var(--radius-md);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background-color: rgba(255,255,255,0.015);
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--milestone-blue);
  background-color: rgba(0, 153, 255, 0.05);
}

/* Evidence Gallery & Media Cards */
.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.evidence-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}
.evidence-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-sm);
}

.evidence-preview {
  height: 140px;
  background-color: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.evidence-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.evidence-preview svg {
  width: 48px;
  height: 48px;
  fill: #555555;
}

.evidence-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.evidence-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.evidence-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}
.evidence-hash {
  font-size: 10px;
  font-family: monospace;
  background-color: #1a1a1a;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  color: #707070;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin / Settings Configuration Cards */
.config-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.storage-bar-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.storage-bar {
  height: 14px;
  background-color: #1a1a1a;
  border-radius: 7px;
  overflow: hidden;
  display: flex;
}
.storage-fill {
  background: linear-gradient(90deg, #0099ff, #00d2ff);
  height: 100%;
}

/* Interactive Case & Evidence Location Map */
.case-map-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

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

.case-map-container {
  width: 100%;
  height: 340px;
  border-radius: var(--radius-sm);
  border: 1px solid #3a3a3a;
  background: #14181f;
  position: relative;
  z-index: 1;
}

.modal-map-container {
  width: 100%;
  height: 210px;
  border-radius: var(--radius-sm);
  border: 1px solid #3a3a3a;
  background: #14181f;
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.geo-results-list {
  display: none;
  max-height: 165px;
  overflow-y: auto;
  background: #181818;
  border: 1px solid var(--milestone-blue);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  margin-bottom: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.65);
}

.geo-result-item {
  padding: 8px 12px;
  font-size: 12px;
  color: #e0e0e0;
  border-bottom: 1px solid #2b2b2b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.geo-result-item:last-child {
  border-bottom: none;
}

.geo-result-item:hover {
  background: rgba(0, 153, 255, 0.18);
  color: #ffffff;
}

.map-pin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 14px;
  background: #1f1f1f;
  border: 1px solid #3a3a3a;
  color: #dddddd;
  cursor: pointer;
  transition: all 0.15s ease;
}

.map-pin-pill:hover {
  border-color: var(--milestone-blue);
  background: rgba(0, 153, 255, 0.15);
  color: #ffffff;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #202225 !important;
  color: #f0f0f0 !important;
  border: 1px solid #3a3f47;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7) !important;
}

.leaflet-popup-content {
  margin: 10px 12px !important;
  font-size: 12px;
  line-height: 1.45;
}

.custom-map-pin {
  background: transparent;
  border: none;
}

/* ==========================================================================
   XPROTECT MULTI-VIDEO PLAYBACK STUDIO & EVIDENCE VIDEO PREVIEWS
   ========================================================================== */
.evidence-preview video.evidence-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #0a0a0a;
}

.evidence-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.52) 100%);
  transition: background 0.15s ease;
}

.evidence-card:hover .evidence-video-overlay {
  background: radial-gradient(circle, rgba(0,153,255,0.16) 0%, rgba(0,0,0,0.45) 100%);
}

.evidence-video-play-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 20, 26, 0.85);
  border: 2px solid var(--milestone-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 153, 255, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}

.evidence-card:hover .evidence-video-play-circle {
  transform: scale(1.08);
  background: var(--milestone-blue);
}

.evidence-video-play-circle svg {
  width: 22px !important;
  height: 22px !important;
  fill: #ffffff !important;
  margin-left: 2px;
}

.evidence-multiview-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(18, 22, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e0e0e0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.evidence-multiview-pill:hover {
  border-color: var(--milestone-blue);
  color: #ffffff;
}

.evidence-multiview-pill.selected {
  background: rgba(0, 153, 255, 0.9);
  border-color: #7cc7ff;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 153, 255, 0.45);
}

/* Case Detail Multi-Video Launch Bar */
.case-multivideo-bar {
  background: linear-gradient(90deg, rgba(0, 153, 255, 0.14) 0%, rgba(28, 32, 38, 0.95) 45%, rgba(28, 32, 38, 0.98) 100%);
  border: 1px solid rgba(0, 153, 255, 0.45);
  border-left: 4px solid var(--milestone-blue);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

/* Full Studio Modal */
.xp-vp-modal {
  width: 96vw !important;
  max-width: 1720px !important;
  height: 92vh !important;
  max-height: 94vh !important;
  background: #111316 !important;
  border: 1px solid #353b45 !important;
  border-radius: 6px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9) !important;
}

.xp-vp-modal:fullscreen,
.xp-vp-modal:-webkit-full-screen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border: none !important;
  border-radius: 0 !important;
}

.xp-vp-header {
  height: 48px;
  background: #191c21;
  border-bottom: 1px solid #2e333d;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.xp-vp-layout-group {
  display: inline-flex;
  align-items: center;
  background: #101215;
  border: 1px solid #2f3540;
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
}

.xp-vp-layout-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #9aa3b0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.xp-vp-layout-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.xp-vp-layout-btn.active {
  background: rgba(0, 153, 255, 0.22);
  border-color: rgba(0, 153, 255, 0.65);
  color: #ffffff;
}

/* Main Stage + Right Camera Drawer */
.xp-vp-workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  background: #0a0b0d;
  overflow: hidden;
}

.xp-vp-grid {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 4px;
  padding: 6px;
  background: #090a0c;
}

.xp-vp-grid.layout-1x1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.xp-vp-grid.layout-2x1 { grid-template-columns: repeat(2, 1fr); grid-template-rows: 1fr; }
.xp-vp-grid.layout-2x2 { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.xp-vp-grid.layout-3x2 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); }
.xp-vp-grid.layout-3x3 { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.xp-vp-grid.layout-4x3 { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); }

.xp-vp-tile {
  position: relative;
  background: #040506;
  border: 2px solid #262a32;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  transition: border-color 0.12s ease;
}

.xp-vp-tile.focused {
  border-color: var(--milestone-blue);
  box-shadow: 0 0 0 1px rgba(0, 153, 255, 0.35);
}

.xp-vp-tile.vp-tile-hidden {
  display: none !important;
}

.xp-vp-tile-header {
  height: 30px;
  background: linear-gradient(180deg, rgba(24, 28, 34, 0.96) 0%, rgba(18, 21, 26, 0.88) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  z-index: 5;
}

.xp-vp-tile-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: #e6ebf2;
}

.xp-vp-tile-title span.name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-vp-led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb900;
  flex-shrink: 0;
}

.xp-vp-led.playing {
  background: #10c469;
  box-shadow: 0 0 6px #10c469;
}

.xp-vp-led.ended {
  background: #777;
}

.xp-vp-tile-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.xp-vp-icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd3df;
  border-radius: 3px;
  height: 22px;
  min-width: 22px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.12s ease;
  text-decoration: none;
}

.xp-vp-icon-btn:hover {
  background: rgba(0, 153, 255, 0.25);
  border-color: var(--milestone-blue);
  color: #ffffff;
}

.xp-vp-icon-btn.active {
  background: rgba(0, 153, 255, 0.3);
  border-color: var(--milestone-blue);
  color: #7cc7ff;
}

.xp-vp-icon-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.xp-vp-tile-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000000;
  cursor: pointer;
}

.xp-vp-tile-viewport.zoomed {
  cursor: grab;
}

.xp-vp-tile-viewport.zoomed.panning {
  cursor: grabbing;
}

.xp-vp-tile-viewport video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  pointer-events: none;
}

.xp-vp-osd-bottom {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 4;
}

.xp-vp-osd-pill {
  background: rgba(10, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e4eaf2;
  padding: 2px 7px;
  border-radius: 3px;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11px;
  pointer-events: auto;
}

.xp-vp-tile-scrub {
  height: 6px;
  background: #181c22;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.xp-vp-tile-scrub:hover {
  height: 9px;
}

.xp-vp-tile-scrub-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0077cc, #00aaff);
  pointer-events: none;
}

/* Right-Hand Case Video Selector Sidebar */
.xp-vp-sidebar {
  width: 290px;
  background: #16191e;
  border-left: 1px solid #2c313b;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.xp-vp-sidebar.collapsed {
  display: none;
}

.xp-vp-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid #282d36;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #1b1f26;
}

.xp-vp-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xp-vp-stream-item {
  background: #1f232b;
  border: 1px solid #303642;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.xp-vp-stream-item:hover {
  border-color: #4f596b;
  background: #252a34;
}

.xp-vp-stream-item.in-grid {
  border-color: rgba(0, 153, 255, 0.65);
  background: rgba(0, 153, 255, 0.1);
}

/* Bottom Synchronized Playback Deck */
.xp-vp-deck {
  background: #181b20;
  border-top: 1px solid #2e333d;
  padding: 10px 16px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.xp-vp-timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xp-vp-timecode {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #e8eef7;
  min-width: 92px;
  text-align: center;
  background: #101216;
  border: 1px solid #2b303a;
  padding: 3px 8px;
  border-radius: 3px;
}

.xp-vp-scrubber-wrap {
  flex: 1;
  position: relative;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.xp-vp-scrubber-track {
  width: 100%;
  height: 8px;
  background: #0e1014;
  border: 1px solid #2e3440;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.xp-vp-scrubber-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0077cc, #00b7ff);
  border-radius: 4px;
}

.xp-vp-scrubber-head {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--milestone-blue);
  box-shadow: 0 0 8px rgba(0, 153, 255, 0.8);
  pointer-events: none;
}

.xp-vp-transport-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.xp-vp-play-btn {
  width: 40px;
  height: 34px;
  border-radius: 4px;
  background: var(--milestone-blue);
  border: 1px solid #4dc3ff;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 153, 255, 0.4);
  transition: all 0.12s ease;
}

.xp-vp-play-btn:hover {
  background: var(--milestone-blue-hover);
  transform: translateY(-1px);
}

.xp-vp-play-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.xp-vp-speed-btn {
  background: #111317;
  border: 1px solid #2f3540;
  color: #a5afbd;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 3px;
  cursor: pointer;
}

.xp-vp-speed-btn:hover {
  color: #fff;
  border-color: #4f5969;
}

.xp-vp-speed-btn.active {
  background: rgba(0, 153, 255, 0.22);
  border-color: var(--milestone-blue);
  color: #ffffff;
}
