/* ==========================================================================
   Epodak Asset Vault - Deep Petrol Teal Theme & Design System
   ========================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(20, 32, 56, 0.85);
  --bg-glass: rgba(13, 22, 38, 0.65);
  
  --teal-900: #042f2e;
  --teal-800: #0f4c47;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --teal-300: #5eead4;
  --teal-glow: rgba(20, 184, 166, 0.35);

  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.25);
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-blue: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-teal: rgba(20, 184, 166, 0.3);
  --border-active: rgba(45, 212, 191, 0.6);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-teal: 0 8px 32px rgba(13, 148, 136, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Glow */
body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: 20%;
  width: 60vw;
  height: 60vh;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.15) 0%, rgba(9, 13, 22, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  bottom: -10%;
  right: 10%;
  width: 50vw;
  height: 50vh;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.08) 0%, rgba(9, 13, 22, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   Passcode Gate Modal (Private Multi-Account Auth)
   ========================================================================== */
.gate-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gate-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-card {
  width: 92%;
  max-width: 440px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(9, 13, 22, 0.98));
  border: 1px solid var(--border-teal);
  box-shadow: var(--shadow-teal), 0 24px 48px rgba(0, 0, 0, 0.8);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: translateY(0);
}

.gate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal-600), var(--teal-400), var(--teal-600));
}

.gate-icon {
  width: 64px;
  height: 64px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.2);
}

.gate-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.gate-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gate-input-wrapper {
  position: relative;
}

.gate-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: var(--transition-normal);
}

.gate-input:focus {
  border-color: var(--teal-400);
  background: rgba(20, 184, 166, 0.06);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.25);
}

.gate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  border: none;
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
  margin-top: 4px;
}

.gate-btn:hover {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-400));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

.gate-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.gate-error {
  color: var(--accent-rose);
  font-size: 13px;
  display: none;
}

/* ==========================================================================
   Header & Top Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 24px;
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-badge {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--teal-800), var(--teal-600));
  border: 1px solid var(--teal-400);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 16px var(--teal-glow);
}

.brand-info h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-info p {
  font-size: 11.5px;
  color: var(--teal-400);
}

.header-center {
  flex: 1;
  max-width: 440px;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition-normal);
}

.search-input:focus {
  background: rgba(20, 184, 166, 0.06);
  border-color: var(--teal-500);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-primary-action {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  border: none;
  border-radius: var(--radius-full);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(20, 184, 166, 0.35);
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, var(--teal-500), var(--teal-400));
  transform: translateY(-1px);
}

.view-toggle-group {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 2px;
}

.view-toggle-btn {
  padding: 6px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.view-toggle-btn.active {
  background: var(--teal-600);
  color: #ffffff;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 14px;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ==========================================================================
   Metrics Sub-Header Bar
   ========================================================================== */
.metrics-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  font-size: 12.5px;
}

.metrics-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.metrics-pills {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.metric-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.metric-pill strong {
  color: var(--text-primary);
  font-weight: 600;
}

.metric-pill.tagged strong {
  color: var(--teal-400);
}

.metric-pill.pending strong {
  color: var(--accent-amber);
}

.idle-pipeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-full);
  color: var(--accent-amber);
  font-size: 12px;
  cursor: pointer;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-amber);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ==========================================================================
   Filter Tags Bar
   ========================================================================== */
.tags-bar {
  max-width: 1440px;
  margin: 16px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
  scrollbar-color: var(--teal-700) transparent;
}

.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
}

.tag-filter-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.tag-filter-chip.active {
  background: rgba(20, 184, 166, 0.18);
  border-color: var(--teal-400);
  color: var(--teal-300);
  font-weight: 600;
}

.tag-chip-count {
  font-size: 11px;
  opacity: 0.7;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.app-container {
  max-width: 1440px;
  margin: 18px auto 60px;
  padding: 0 24px;
}

.spatial-view-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.spatial-sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.zone-tree-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zone-tree-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.zone-item-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.zone-item-header:hover {
  background: rgba(20, 184, 166, 0.1);
}

.zone-item-header.active {
  background: rgba(20, 184, 166, 0.18);
  border-color: var(--teal-500);
  color: var(--teal-300);
}

.zone-count-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

.container-sublist {
  list-style: none;
  padding: 4px 0 4px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.container-sub-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.container-sub-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.container-sub-item.active {
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-300);
}

/* ==========================================================================
   Asset Card Grid
   ========================================================================== */
.view-breadcrumb {
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.view-breadcrumb strong {
  color: var(--teal-300);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.asset-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.asset-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-teal);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(13, 148, 136, 0.2);
}

.card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000000;
  overflow: hidden;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  loading: lazy;
}

.asset-card:hover .card-thumb {
  transform: scale(1.04);
}

.card-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.card-status-badge.completed {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.card-status-badge.pending {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.card-category-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(4, 7, 14, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-primary);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-location {
  font-size: 12px;
  color: var(--teal-400);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
}

.card-tag-pill {
  font-size: 11px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: var(--text-muted);
}

/* ==========================================================================
   Mobile Floating Action Button (FAB)
   ========================================================================== */
.mobile-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-400));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.5), 0 4px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-fab:hover {
  transform: scale(1.08);
}

/* ==========================================================================
   Upload Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10005;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  width: 92%;
  max-width: 560px;
  max-height: 90vh;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-teal);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), var(--shadow-teal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.upload-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

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

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.location-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-select, .form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}

.form-select:focus, .form-input:focus {
  border-color: var(--teal-500);
}

.upload-dropzone {
  position: relative;
  border: 2px dashed rgba(20, 184, 166, 0.4);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  background: rgba(20, 184, 166, 0.03);
  cursor: pointer;
  transition: var(--transition-normal);
}

.upload-dropzone:hover {
  background: rgba(20, 184, 166, 0.08);
  border-color: var(--teal-400);
}

.file-picker-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.dropzone-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-300);
}

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

.upload-preview-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0;
}

.preview-chip {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.preview-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.btn-secondary {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  cursor: pointer;
}

.btn-primary {
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-500));
  border: none;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Admin Drawer Panel
   ========================================================================== */
.admin-drawer {
  position: fixed;
  top: 0;
  right: -520px;
  width: 500px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid var(--border-teal);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7);
  z-index: 10002;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 24px;
}

.admin-drawer.open {
  right: 0;
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--teal-300);
}

.admin-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.admin-users-table {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.user-row:last-child {
  border-bottom: none;
}

.user-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(20, 184, 166, 0.15);
  color: var(--teal-300);
}

.add-user-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   Idle Drawer & Lightbox (Existing)
   ========================================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-container {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
}

.lightbox-media-panel {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
}

.lightbox-info-panel {
  width: 420px;
  height: 100%;
  background: rgba(15, 23, 42, 0.95);
  border-left: 1px solid var(--border-subtle);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 20px;
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-nav-btn.prev { left: 24px; }
.lightbox-nav-btn.next { right: 24px; }

.lightbox-header-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lightbox-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.lightbox-path {
  font-size: 13px;
  color: var(--teal-300);
  padding: 8px 12px;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: var(--radius-sm);
}

.lightbox-desc-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.lightbox-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.lightbox-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lightbox-tag-chip {
  padding: 5px 12px;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: var(--radius-full);
  color: var(--teal-300);
  font-size: 12px;
}

.lightbox-meta-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.lightbox-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.lightbox-meta-row span:first-child {
  color: var(--text-muted);
}

.idle-drawer {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  height: 100vh;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid var(--border-teal);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7);
  z-index: 10001;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 28px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 20px;
}

.idle-drawer.open {
  right: 0;
}

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

.drawer-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
}

.drawer-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-300);
}

.drawer-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.code-snippet {
  background: #050810;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--teal-300);
  overflow-x: auto;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

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

@media (max-width: 960px) {
  .spatial-view-wrapper {
    grid-template-columns: 1fr;
  }
  .spatial-sidebar {
    position: static;
    max-height: none;
  }
  .lightbox-container {
    flex-direction: column;
  }
  .lightbox-info-panel {
    width: 100%;
    height: auto;
    max-height: 40vh;
  }
  .lightbox-nav-btn {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 10px 14px;
  }
  .header-inner {
    flex-wrap: wrap;
  }
  .header-center {
    order: 3;
    max-width: 100%;
  }
  .idle-drawer, .admin-drawer {
    width: 100%;
    right: -100%;
  }
  .location-select-grid {
    grid-template-columns: 1fr;
  }
}
