/**
 * Enwrapp Spatial Engine - Styles
 * 
 * Modular CSS for the spatial awareness UI.
 * Edit this file to customize the look and feel.
 */

:root {
  --bg-primary: #0c1017;
  --bg-secondary: #141b24;
  --bg-tertiary: #1c2631;
  --bg-glass: rgba(12, 16, 23, 0.92);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f4f8;
  --text-secondary: #8b99a8;
  --text-muted: #5a6875;
  
  /* Tier colors */
  --tier-1: #5a6875;
  --tier-2: #38bdf8;
  --tier-3: #fbbf24;
  --tier-4: #f87171;
  
  /* Panel backdrop */
  --backdrop-blur: 4px;
  --backdrop-bg: rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#map {
  flex: 1;
  width: 100%;
}

/* ============================================================
   GLASS PANELS
   ============================================================ */

.panel {
  position: absolute;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  z-index: 100;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel h3::before {
  content: '';
  width: 3px;
  height: 12px;
  background: linear-gradient(180deg, var(--tier-2), var(--tier-3));
  border-radius: 2px;
}

/* ============================================================
   CONTEXT PANEL - Upper-left expandable
   ============================================================ */

/* ============================================================
   UNIFIED TOP BAR (Context + Team Controls)
   ============================================================ */

#top-bar {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  /* Leave room for hamburger button (44px + 16px margin + 8px gap) */
  right: max(76px, calc(env(safe-area-inset-right) + 68px));
  z-index: 150;
}

#top-bar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 8px 12px;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#top-bar.has-safety #top-bar-main {
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: 
    0 4px 24px rgba(248, 113, 113, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Context section (left side) */
#context-section {
  flex-shrink: 0;
  max-width: 200px;
}

#context-summary {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.context-primary {
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-location {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.context-section {
  color: #22d3ee;
}

.context-feature {
  color: #4ade80;
}

.context-sep {
  color: var(--text-muted);
  font-weight: 400;
}

.context-outside {
  color: var(--text-muted);
  font-style: italic;
}

.context-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.context-expand-hint {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Expanded context dropdown */
#context-expanded {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-top: 4px;
  padding: 10px 12px;
  backdrop-filter: blur(20px);
  animation: slideDown 0.2s ease;
  max-width: 280px;
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#context-expanded.collapsed {
  display: none;
}

.context-approaching {
  /* No extra margin needed in dropdown */
}

.approaching-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.context-approaching-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}

.context-approaching-item + .context-approaching-item {
  border-top: 1px solid var(--border-subtle);
}

.approaching-name {
  font-weight: 500;
}

.approaching-dist {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
}

.context-approaching-item.safety .approaching-name {
  color: var(--tier-4);
}

.context-approaching-item.safety .approaching-dist {
  color: var(--tier-4);
  opacity: 0.8;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Team controls (to the right of context section) */
#team-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  justify-content: flex-start;
  overflow-x: auto;
}

#team-self {
  flex-shrink: 0;
}

#team-record-toggle {
  flex-shrink: 0;
}

#team-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

/* Team member chips */
.team-member {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  border: 2px solid var(--track-color, #64748b);
  cursor: pointer;
  transition: all 0.2s ease;
}

.team-member:hover {
  background: var(--bg-secondary);
}

/* Self chip - simplified, just avatar */
.team-member.self {
  padding: 4px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  justify-content: center;
}

.team-member.self .team-avatar {
  width: 30px;
  height: 30px;
}

.team-member.self.not-following {
  border-style: dashed;
  animation: pulse-follow 2s ease-in-out infinite;
}

.team-member.self .recenter-icon {
  position: absolute;
  font-size: 10px;
  margin-left: 22px;
  margin-top: -14px;
  color: var(--text-secondary);
}

@keyframes pulse-follow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.team-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--track-color, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--bg-primary);
}

/* Team record toggle button */
.team-record {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}

.team-record.idle {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  color: var(--text-secondary);
}

.team-record.idle:hover {
  background: var(--bg-secondary);
  border-color: #ef4444;
}

.team-record.idle .record-icon {
  color: #ef4444;
  font-size: 16px;
}

.team-record.recording {
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid #ef4444;
  color: var(--text-primary);
}

.team-record.recording:hover {
  background: rgba(239, 68, 68, 0.3);
}

.team-record .record-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

.team-record .record-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
}

.team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.team-context {
  font-size: 11px;
  color: var(--text-secondary);
}

.team-distance {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

.team-status {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
}

.team-member.active {
  border-color: var(--track-color);
}

.team-member.stale {
  opacity: 0.6;
}

.team-member.offline {
  opacity: 0.4;
  border-style: dashed;
}

.team-waiting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.waiting-text {
  opacity: 0.7;
}

.session-code-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 2px;
}

/* End Recording Modal */
.end-recording-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.end-recording-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.end-recording-modal .modal-content {
  position: relative;
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: 16px;
  width: min(90vw, 320px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.end-recording-modal h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--text-primary);
}

.recording-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.summary-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.summary-points {
  font-size: 13px;
  color: var(--text-secondary);
}

.end-recording-modal .modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.end-recording-modal .modal-btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.end-recording-modal .modal-btn.cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.end-recording-modal .modal-btn.cancel:hover {
  background: var(--bg-primary);
}

.end-recording-modal .modal-btn.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.end-recording-modal .modal-btn.delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

.end-recording-modal .modal-btn.save {
  background: var(--accent-primary);
  color: white;
}

.end-recording-modal .modal-btn.save:hover {
  background: var(--accent-secondary);
}

/* ============================================================
   COLLABORATIVE SESSION MODALS
   ============================================================ */

.collab-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.collab-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.collab-modal-content {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.collab-modal-content h3 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
}

.collab-modal-content .modal-description {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-form label span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-form input[type="text"] {
  padding: 12px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.modal-form input[type="text"]:focus {
  border-color: var(--accent-primary);
}

.modal-form input[type="text"]::placeholder {
  color: var(--text-muted);
}

.color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: white;
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px currentColor;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.modal-btn.cancel {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.modal-btn.cancel:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-btn.primary {
  background: var(--accent-primary);
  color: white;
}

.modal-btn.primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-notification {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 10001;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast-notification.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.toast-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ============================================================
   COLLABORATIVE SESSION CONTROLS STYLING
   ============================================================ */

.session-recording.collaborative {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(16, 185, 129, 0.15));
}

.session-recording.collaborative .recording-dot {
  background: #10b981;
}

.session-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-primary) !important;
  cursor: pointer;
}

.session-code:hover {
  text-decoration: underline;
}

.session-btn.collab-btn {
  background: linear-gradient(135deg, var(--accent-primary), #10b981);
}

.session-btn.collab-btn:hover {
  filter: brightness(1.1);
}

.session-btn.join-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-primary);
}

.session-btn.join-btn:hover {
  background: rgba(99, 102, 241, 0.2);
}

/* ============================================================
   TRACK CONTROLS
   ============================================================ */

#track-controls {
  position: absolute;
  bottom: 24px;
  left: 20px;
  z-index: 100;
}

.track-control-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.track-control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.track-control-btn:not(:disabled):hover {
  background: var(--bg-secondary);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.track-control-btn.has-track {
  background: var(--bg-secondary);
  border-color: var(--tier-3);
  color: var(--text-primary);
}

.track-control-btn .btn-icon {
  font-size: 14px;
}

.track-control-btn .btn-label {
  font-weight: 500;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */

.empty-state {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

/* ============================================================
   SCROLLBARS
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   HAMBURGER MENU
   ============================================================ */

.menu-hamburger {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px;
  backdrop-filter: blur(20px);
  transition: all 0.2s ease;
}

.menu-hamburger:hover {
  border-color: var(--border-accent);
  background: var(--bg-secondary);
}

.menu-hamburger.active {
  background: var(--bg-tertiary);
}

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all 0.2s ease;
}

.menu-hamburger.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-hamburger.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 190;
}

.menu-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: var(--bg-primary);
  border-left: 1px solid var(--border-subtle);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-drawer.open {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.menu-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.menu-venue-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.venue-icon {
  font-size: 16px;
}

.venue-name {
  color: var(--text-secondary);
}

.menu-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
  list-style: none;
}

.menu-item {
  margin: 2px 8px;
}

.menu-item-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.menu-item-button:hover:not(:disabled) {
  background: var(--bg-tertiary);
}

.menu-item.disabled .menu-item-button {
  color: var(--text-muted);
  cursor: not-allowed;
}

.menu-item-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.menu-item-label {
  flex: 1;
}

.menu-item-badge {
  background: var(--tier-2);
  color: var(--bg-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.menu-item-chevron {
  color: var(--text-muted);
  font-size: 18px;
  transition: transform 0.2s ease;
}

.menu-item.expanded .menu-item-chevron {
  transform: rotate(90deg);
}

.menu-subitems {
  list-style: none;
  padding: 4px 0 4px 36px;
  display: none;
}

.menu-item.expanded .menu-subitems {
  display: block;
}

.menu-subitems .menu-item-button {
  padding: 10px 16px;
  font-size: 14px;
}

/* Debug Features Section */
.menu-debug-section {
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  margin-top: auto;
}

.menu-debug-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.debug-icon {
  font-size: 14px;
}

.debug-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.menu-debug-content {
  padding: 0 4px;
}

.debug-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.debug-option-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.position-source-toggle {
  display: flex;
  gap: 4px;
}

.source-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.source-btn:hover:not(:disabled) {
  background: var(--bg-secondary);
}

.source-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--tier-2);
  color: var(--text-primary);
}

.source-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.menu-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.menu-version {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================================
   FLOATING ACTION BUTTON (FAB)
   ============================================================ */

.asset-fab {
  position: absolute;
  bottom: max(80px, calc(env(safe-area-inset-bottom) + 80px));
  right: max(20px, env(safe-area-inset-right));
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 16px;
  color: white;
  font-size: 32px;
  cursor: pointer;
  z-index: 140;
  box-shadow: 
    0 4px 20px rgba(59, 130, 246, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-fab:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 
    0 6px 24px rgba(59, 130, 246, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.asset-fab:active:not(:disabled) {
  transform: scale(0.95);
}

.asset-fab.disabled {
  background: var(--bg-tertiary);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.5;
}

.asset-fab.hidden {
  display: none;
}

.asset-fab.pulse {
  animation: fabPulse 0.6s ease;
}

@keyframes fabPulse {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(0.95); }
  75% { transform: scale(1.05); }
}

.fab-icon {
  line-height: 1;
  font-weight: 300;
}

/* ============================================================
   ASSET TYPE PICKER (Bottom Sheet)
   ============================================================ */

.picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 290;
}

.picker-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.picker-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: var(--bg-primary);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 300;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-sheet.open {
  transform: translateY(0);
}

.picker-handle {
  width: 36px;
  height: 4px;
  background: var(--border-accent);
  border-radius: 2px;
  margin: 12px auto 8px;
}

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.picker-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.picker-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.picker-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.picker-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-secondary);
  font-size: 13px;
}

.picker-context .context-section {
  color: #22d3ee;
  font-weight: 500;
}

.picker-context .context-coords {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.picker-context .context-warning {
  color: var(--tier-3);
  font-style: italic;
}

.picker-types {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.type-category {
  margin-bottom: 20px;
}

.type-category:last-child {
  margin-bottom: 0;
}

.category-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.type-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
}

.type-btn.selected {
  border-color: var(--type-color, var(--tier-2));
  background: rgba(56, 189, 248, 0.1);
}

.type-btn.favorite::before {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: var(--tier-3);
  border-radius: 50%;
}

.type-icon, .type-sprite {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.type-icon {
  font-size: 24px;
}

.type-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.type-btn.selected .type-label {
  color: var(--text-primary);
  font-weight: 500;
}

.type-star {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  color: var(--tier-3);
}

.picker-note {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 0;
}

.picker-note.visible {
  max-height: 120px;
  padding: 16px 20px;
  opacity: 1;
  border-top: 1px solid var(--border-subtle);
}

.note-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.note-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  resize: none;
}

.note-input:focus {
  outline: none;
  border-color: var(--tier-2);
}

.note-input::placeholder {
  color: var(--text-muted);
}

.picker-actions {
  display: flex;
  gap: 12px;
  padding: 0 20px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
}

.picker-actions.visible {
  max-height: 80px;
  padding-top: 16px;
  opacity: 1;
}

.picker-btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.picker-btn-cancel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.picker-btn-cancel:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.picker-btn-submit {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  color: white;
}

.picker-btn-submit:hover:not(:disabled) {
  filter: brightness(1.1);
}

.picker-btn-submit:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.picker-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   ASSET LIST PANEL
   ============================================================ */

.asset-list-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(380px, 90vw);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.asset-list-panel.open {
  transform: translateX(0);
}

.asset-list-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.asset-list-panel .panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.panel-icon {
  font-size: 20px;
}

.asset-count {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

.asset-list-panel .panel-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.asset-list-panel .panel-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Filters */
.asset-filters {
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 12px;
}

.filter-row {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.filter-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--tier-2);
}

/* Sort */
.asset-sort {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.sort-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-label {
  font-size: 11px;
  color: var(--text-muted);
}

.sort-buttons {
  display: flex;
  gap: 6px;
  flex: 1;
}

.sort-btn {
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sort-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
}

.sort-btn.active {
  background: var(--tier-2);
  border-color: var(--tier-2);
  color: var(--bg-primary);
}

.sort-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sort-direction {
  width: 28px;
  height: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sort-direction:hover {
  background: var(--bg-tertiary);
}

/* Asset list content */
.asset-list-content {
  flex: 1;
  overflow-y: auto;
}

.asset-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.asset-list-empty p {
  color: var(--text-muted);
  margin: 4px 0;
}

.empty-hint {
  font-size: 13px;
  font-style: italic;
}

.asset-items {
  list-style: none;
  padding: 12px 16px;
}

.asset-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 6px;
  overflow: hidden;
  transition: all 0.15s ease;
}

.asset-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-tertiary);
}

.asset-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.asset-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid var(--asset-color, var(--border-subtle));
  flex-shrink: 0;
  overflow: hidden;
}

.asset-sprite {
  width: 24px;
  height: 24px;
  display: block;
}

.asset-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.asset-type {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.asset-section {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.asset-distance {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--tier-2);
  white-space: nowrap;
}

.asset-date {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.asset-time {
  display: none; /* Hide time in compact view */
}

.asset-notes {
  padding: 6px 10px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-style: italic;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-primary);
}

/* Inline actions */
.asset-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 8px;
}

.asset-action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asset-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.asset-action-btn.delete:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--tier-4);
}

/* Body states */
body.menu-open,
body.picker-open,
body.asset-panel-open {
  overflow: hidden;
}

/* ============================================================
   ASSET MAP MARKERS
   ============================================================ */

.asset-marker {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.asset-marker:hover {
  transform: scale(1.15);
  z-index: 10;
}

.asset-marker-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--marker-color, #64748b);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.asset-marker-icon {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

/* Asset visibility toggle in list panel */
.asset-visibility-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.asset-visibility-toggle:hover {
  background: var(--bg-hover);
}

.asset-visibility-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--tier-2);
}

.asset-visibility-toggle label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Type filter chips */
.type-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.5rem 0;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-chip:hover {
  background: var(--bg-hover);
}

.type-chip.active {
  background: var(--tier-2);
  border-color: var(--tier-2);
  color: #fff;
}

.type-chip .chip-icon {
  font-size: 0.875rem;
}

/* Sprite support in chips - first section */
.type-chip .chip-sprite {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.type-chip .chip-count {
  font-size: 0.6875rem;
  opacity: 0.8;
}

/* Asset controls row */
.asset-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.proximity-indicator {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.proximity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.375rem;
  background: var(--tier-2);
  color: #fff;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.proximity-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Type filter section */
.type-filter-section {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.filter-header .filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clear-filter-btn {
  background: none;
  border: none;
  color: var(--tier-2);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.clear-filter-btn:hover {
  background: var(--bg-tertiary);
}

.type-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-chip:hover {
  background: var(--bg-hover);
  border-color: var(--chip-color, var(--text-muted));
}

.type-chip.active {
  background: var(--chip-color, var(--tier-2));
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 0 2px var(--chip-color, var(--tier-2)), 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

.type-chip .chip-icon {
  font-size: 0.875rem;
}

.type-chip .chip-sprite {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.type-chip .chip-label {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-chip .chip-count {
  font-size: 0.6875rem;
  opacity: 0.8;
  margin-left: 0.125rem;
}

/* Section filter */
.section-filter {
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ============================================================
   SESSION CONTROLS
   ============================================================ */

#track-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#session-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-recording {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recording-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

@keyframes pulse-recording {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.recording-label {
  font-size: 12px;
  font-weight: 600;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recording-duration {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}

.recording-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.session-buttons {
  display: flex;
  gap: 8px;
}

.session-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.session-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.session-btn .btn-icon {
  font-size: 14px;
}

.session-btn.start-btn:hover {
  border-color: #22c55e;
  color: #22c55e;
}

.session-btn.end-btn {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.session-btn.end-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.session-btn.clear-btn:hover {
  border-color: var(--tier-3);
  color: var(--tier-3);
}

/* Collaborative session info (bottom-left during active session) */
.session-collab-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  backdrop-filter: blur(12px);
}

.session-collab-info .session-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
}

.session-collab-info .participant-count {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ============================================================
   SESSION LIST PANEL
   ============================================================ */

.session-active-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(239, 68, 68, 0.1);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 13px;
  color: #ef4444;
}

.session-active-banner .active-duration {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.session-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.session-list-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.session-list-empty p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.session-list-empty .empty-hint {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.7;
}

.session-list-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.session-list-header .list-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.session-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.session-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s ease;
}

.session-item:hover {
  background: var(--bg-secondary);
}

.session-item.visible {
  background: rgba(99, 102, 241, 0.08);
}

.session-visibility {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.session-item.visible .session-visibility {
  opacity: 1;
}

.session-visibility:hover {
  opacity: 1;
}

.visibility-icon {
  font-size: 16px;
}

.color-indicator {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  opacity: 0.3;
}

.session-item.visible .color-indicator {
  opacity: 1;
}

.session-item-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-width: 0;
}

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

.session-date {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.session-sections {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.session-duration {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.session-points {
  font-size: 10px;
  color: var(--text-muted);
}

.session-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.session-item:hover .session-actions {
  opacity: 1;
}

.session-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.session-action-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-accent);
}

.session-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Menu recording indicator */
.menu-item-indicator.recording {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

/* ============================================================
   LEFT PANEL BACKDROP (shared by field data, team members, etc.)
   ============================================================ */

.panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--backdrop-bg);
  backdrop-filter: blur(var(--backdrop-blur));
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   LEFT PANEL BASE (shared styling for left-slide panels)
   ============================================================ */

.left-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 80px;  /* Leave space for session controls */
  width: min(380px, 90vw);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.left-panel.open {
  transform: translateX(0);
}

.left-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.left-panel .panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.left-panel .panel-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.left-panel .panel-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ============================================================
   FIELD DATA PANEL (Assets or Sessions)
   ============================================================ */

.field-data-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 80px;  /* Leave space for session controls */
  width: min(380px, 90vw);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.field-data-panel.open {
  transform: translateX(0);
}

.field-data-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.field-data-panel .panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.field-data-panel .panel-title .header-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 15px;
}

.field-data-panel .panel-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.field-data-panel .panel-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Tab Switcher */
.tab-switcher {
  display: flex;
  padding: 12px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.tab-btn.active {
  background: var(--bg-primary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.tab-icon {
  font-size: 16px;
}

.tab-label {
  font-weight: 500;
}

.tab-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 8px;
}

.tab-btn.active .tab-badge {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.tab-recording-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-recording 1.5s ease-in-out infinite;
}

/* Tab Content */
.tab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ============================================================
   VENUE PICKER
   ============================================================ */

.venue-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.venue-picker-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.venue-picker-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.venue-picker-panel.open {
  transform: translateY(0);
}

.venue-picker-handle {
  width: 36px;
  height: 4px;
  background: var(--border-accent);
  border-radius: 2px;
  margin: 12px auto 8px;
}

.venue-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.venue-picker-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.venue-picker-close {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.venue-picker-close:hover {
  background: var(--border-accent);
}

.venue-list {
  list-style: none;
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}

.venue-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
}
.venue-item:last-child {
  margin-bottom: 0;
}
.venue-item:hover {
  border-color: var(--border-accent);
}
.venue-item.active {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.1);
}
.venue-item.loading {
  opacity: 0.7;
  pointer-events: none;
}

.venue-item .venue-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 10px;
}

.venue-item .venue-info {
  flex: 1;
}

.venue-item .venue-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.venue-item .venue-description {
  font-size: 13px;
  color: var(--text-secondary);
}

.venue-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #22d3ee;
  color: #000;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.venue-item.active .venue-check {
  opacity: 1;
}

/* Venue Loading Overlay */
.venue-loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.venue-loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.venue-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-accent);
  border-top-color: #22d3ee;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.venue-loading-text {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ============================================================
   ACCOUNT PANEL
   ============================================================ */

.account-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.account-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.account-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--bg-primary);
  border-radius: 20px 20px 0 0;
  z-index: 1550;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}
.account-panel.open {
  transform: translateY(0);
}

.account-panel-handle {
  width: 40px;
  height: 4px;
  background: var(--border-muted);
  border-radius: 2px;
  margin: 12px auto;
}

.account-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border-muted);
}

.account-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.account-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-secondary);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
}

.account-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-muted);
}
.account-section:last-child {
  border-bottom: none;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.account-notice {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 16px;
}
.account-notice.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.notice-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.notice-content strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.notice-content p,
.notice-content ul {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}
.notice-content ul {
  padding-left: 20px;
  margin-top: 8px;
}
.notice-content li {
  margin-bottom: 4px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info {
  flex: 1;
}

.user-id {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.user-uid {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.storage-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.storage-status.cloud {
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
}
.storage-icon {
  font-size: 18px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}
.auth-input:focus {
  border-color: #22d3ee;
}
.auth-input::placeholder {
  color: var(--text-muted);
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-muted);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.account-btn:hover {
  border-color: var(--border-accent);
}
.account-btn.primary {
  background: #22d3ee;
  border-color: #22d3ee;
  color: #000;
  font-weight: 600;
}
.account-btn.primary:hover {
  background: #06b6d4;
  border-color: #06b6d4;
}
.account-btn.danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}
.account-btn.danger:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: #f87171;
}
.account-btn .btn-icon {
  font-size: 18px;
}
.account-btn .btn-label {
  flex: 1;
  text-align: left;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-muted);
}

.auth-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Menu storage indicator */
.menu-storage-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.menu-item-meta {
  font-size: 14px;
  margin-left: auto;
}

/* ============================================================
   POSITION MODE TOGGLE
   ============================================================ */

#position-mode-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.position-mode-toggle {
  display: flex;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:first-child {
  border-right: 1px solid var(--border-subtle);
}

.mode-btn:hover:not(.active):not(:disabled) {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.mode-btn.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.mode-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mode-icon {
  font-size: 14px;
}

.mode-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* GPS Status Indicator */
.gps-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

.gps-status.idle {
  background: rgba(100, 116, 139, 0.2);
  color: var(--text-muted);
}

.gps-status.acquiring {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.gps-status.acquiring .status-icon {
  animation: gps-spin 1.5s linear infinite;
}

@keyframes gps-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gps-status.tracking {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}

.gps-status.tracking .status-icon {
  animation: pulse-gps 2s ease-in-out infinite;
}

@keyframes pulse-gps {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.gps-status.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.status-icon {
  font-size: 14px;
}

.status-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3px;
}

/* ============================================================
   UI REDESIGN v0.6.1 - Additional Styles
   ============================================================ */

/* Consolidated venue row with switch button */
.menu-venue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.menu-venue-row .venue-icon {
  font-size: 16px;
}

.menu-venue-row .venue-name {
  color: var(--text-secondary);
  flex: 1;
}

.venue-switch-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.venue-switch-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* Menu item meta text */
.menu-item-meta-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

/* Position mode panel in menu */
.menu-position-panel {
  display: none;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin: 8px 16px;
}

.menu-item.expanded .menu-position-panel {
  display: block;
}

.position-mode-selector,
.position-sharing-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-position-panel .position-mode-btn,
.menu-position-panel .position-sharing-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.menu-position-panel .position-mode-btn:hover:not(:disabled),
.menu-position-panel .position-sharing-btn:hover:not(:disabled) {
  background: var(--bg-primary);
}

.menu-position-panel .position-mode-btn.active,
.menu-position-panel .position-sharing-btn.active {
  border-color: var(--tier-2);
  background: rgba(56, 189, 248, 0.1);
}

.menu-position-panel .position-mode-btn:disabled,
.menu-position-panel .position-sharing-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.menu-position-panel .position-mode-btn .mode-icon,
.menu-position-panel .position-sharing-btn .mode-icon {
  font-size: 20px;
}

.menu-position-panel .position-mode-btn .mode-text,
.menu-position-panel .position-sharing-btn .mode-text {
  display: flex;
  flex-direction: column;
}

.menu-position-panel .position-mode-btn .mode-name,
.menu-position-panel .position-sharing-btn .mode-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.menu-position-panel .position-mode-btn .mode-desc,
.menu-position-panel .position-sharing-btn .mode-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Recording indicator in menu */
.menu-item-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.menu-item-indicator.recording {
  background: #ef4444;
  animation: menuRecordingPulse 1.5s ease-in-out infinite;
}

@keyframes menuRecordingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Team bar self and list containers */
#team-self {
  flex-shrink: 0;
}

#team-list {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Self chip in team bar */
.team-member.self {
  background: rgba(59, 130, 246, 0.15);
}

/* Recording indicator in team bar */
.team-recording-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

.team-recording-indicator.recording {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.recording-dot-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.team-recording-indicator.recording .recording-dot-mini {
  animation: recordingPulseMini 1.5s ease-in-out infinite;
}

@keyframes recordingPulseMini {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

.recording-time {
  min-width: 36px;
}

/* Modal danger button */
.modal-btn.danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.modal-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Venue switch dialog actions */
.venue-switch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.venue-switch-actions .modal-btn {
  flex: 1;
  min-width: 80px;
}

/* Menu footer storage status */
.menu-storage-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 12px;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */

#login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

#login-screen.hidden {
  display: none;
}

.login-container {
  width: 100%;
  max-width: 380px;
  animation: loginFadeIn 0.3s ease-out;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-icon {
  font-size: 36px;
}

.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 600;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  color: var(--text-secondary);
  font-size: 15px;
}

.login-form {
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.login-error {
  color: #f87171;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 20px;
}

.login-error:empty {
  display: none;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* Test Users Section */
.test-users-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-subtle);
}

.test-users-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

.test-users-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.test-user-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.test-user-btn:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.test-user-btn:active {
  transform: translateY(0);
}

.test-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.test-user-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   PROFILE & ACCOUNT PANEL ENHANCEMENTS
   ============================================================ */

/* Account user display - enhanced */
.account-user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 16px;
  position: relative;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.user-email {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-phone {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.edit-profile-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.edit-profile-btn:hover {
  background: var(--bg-primary);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* Profile form */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Color picker */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-option {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #000;
  transition: all 0.15s ease;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

/* Button row for form actions */
.button-row {
  display: flex;
  gap: 12px;
}

.button-row .account-btn {
  flex: 1;
}

/* Profile modal specific */
.profile-modal .welcome-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Responsive adjustments for form */
@media (max-width: 400px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .color-option {
    width: 36px;
    height: 36px;
  }
}

/* ============================================================
   TEAM MEMBERS PANEL (Left panel style)
   ============================================================ */

.team-members-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 80px;
  width: min(380px, 90vw);
  background: var(--bg-primary);
  border-right: 1px solid var(--border-subtle);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.team-members-panel.open {
  transform: translateX(0);
}

.team-members-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.team-members-panel .panel-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.team-members-panel .panel-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.team-members-panel .panel-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Action buttons row */
.team-panel-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.team-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-action-btn:hover {
  border-color: var(--border-accent);
  background: var(--bg-tertiary);
}

.team-action-btn .action-icon {
  font-size: 18px;
}

/* Sort bar */
.team-sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-secondary);
}

.sort-label {
  font-size: 13px;
  color: var(--text-muted);
}

.sort-options {
  display: flex;
  gap: 4px;
}

.sort-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sort-btn:hover {
  color: var(--text-primary);
}

.sort-btn.active {
  background: var(--bg-tertiary);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

/* Members list */
.team-members-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.team-member-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.team-member-card:hover {
  background: var(--bg-tertiary);
}

.team-member-card:last-child {
  margin-bottom: 0;
}

.member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #000;
  flex-shrink: 0;
}

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

.member-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.member-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.member-options-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-options-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Empty state */
.team-empty-state {
  text-align: center;
  padding: 40px 20px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Panel footer */
.team-panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}

.my-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.my-label {
  color: var(--text-muted);
}

.my-name {
  color: var(--text-primary);
  font-weight: 500;
}

.my-phone {
  color: var(--text-secondary);
}

/* ============================================================
   TEAM MEMBER MODALS (Add by Phone, QR Code)
   ============================================================ */

.add-phone-modal,
.qr-code-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.add-phone-modal .modal-backdrop,
.qr-code-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.add-phone-modal .modal-content,
.qr-code-modal .modal-content {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--bg-primary);
  border-radius: 16px;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 0 20px 20px;
}

.modal-footer .account-btn {
  flex: 1;
}

/* Phone search results */
.phone-search-result {
  margin-top: 16px;
}

.search-error {
  color: #f87171;
  font-size: 13px;
}

.search-found {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  margin-bottom: 12px;
}

.found-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.found-info {
  flex: 1;
}

.found-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}

.found-status {
  font-size: 13px;
  color: #34d399;
}

.search-not-found {
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  text-align: center;
}

.search-not-found p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

.search-not-found p:last-child {
  margin-bottom: 0;
}

.search-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* QR Code modal */
.qr-body {
  text-align: center;
}

.qr-placeholder {
  padding: 20px;
  background: white;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 16px;
}

.qr-fake {
  width: 180px;
  height: 180px;
}

.qr-svg {
  width: 100%;
  height: 100%;
}

.qr-name {
  font-size: 14px;
  font-weight: 500;
  color: #000;
  margin-top: 12px;
}

.qr-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
