@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=Outfit:wght@400;700;900&display=swap');

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: rgba(22, 27, 34, 0.85);
  --border-color: rgba(255,255,255,0.08);
  --accent-green: #00b09b;
  --accent-green-light: #96c93d;
  --accent-amber: #f7971e;
  --accent-amber-light: #ffd200;
  --accent-blue: #4facfe;
  --accent-blue-light: #00f2fe;
  --accent-rose: #f093fb;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --glass: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.08);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 248px;
  --sidebar-icon-w: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg-primary); color: var(--text-primary); font-family: 'IBM Plex Sans', sans-serif; min-height: 100vh; overflow-x: hidden; }

/* Background glows */
.bg-glow { position: fixed; width: 600px; height: 600px; border-radius: 50%; z-index: -1; filter: blur(100px); pointer-events: none; opacity: 0.5; }
.glow-1 { top: -200px; left: -100px; background: radial-gradient(circle, rgba(0,176,155,0.12) 0%, transparent 70%); }
.glow-2 { bottom: -200px; right: -100px; background: radial-gradient(circle, rgba(79,172,254,0.08) 0%, transparent 70%); }

/* === LAYOUT === */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* === SIDEBAR === */
.sidebar {
  width: 64px;
  background: linear-gradient(180deg, #0d1117 0%, #0a0f16 100%);
  border-right: 1px solid rgba(0, 176, 155, 0.15);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 4px;
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200;
}
.sidebar:hover { width: 220px; }

/* Logo wrap */
.sidebar-logo-wrap {
  display: flex; align-items: center; gap: 12px;
  width: calc(100% - 16px); padding: 6px 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 6px; overflow: hidden;
}
.sidebar-icon-logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #00b09b, #96c93d);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand {
  font-size: 0.82rem; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; font-family: 'IBM Plex Sans', sans-serif;
  letter-spacing: 0.3px; opacity: 0; transition: opacity 0.2s ease;
}
.sidebar:hover .sidebar-brand { opacity: 1; }

/* Nav container */
.sidebar-nav {
  width: 100%; display: flex; flex-direction: column;
  gap: 3px; padding: 0 8px; flex: 1;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); }

/* Nav item */
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 8px;
  border-radius: 12px; cursor: pointer;
  transition: all 0.2s ease;
  position: relative; white-space: nowrap;
  border: 1px solid transparent;
}
.sidebar-item:hover {
  background: linear-gradient(135deg, rgba(0,176,155,0.1), rgba(150,201,61,0.05));
  border-color: rgba(0,176,155,0.15);
}
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(0,176,155,0.15), rgba(150,201,61,0.08));
  border-color: rgba(0,176,155,0.25);
}
.sidebar-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 3px;
  background: linear-gradient(180deg, #00b09b, #96c93d);
  border-radius: 0 3px 3px 0;
}

/* Icon tile */
.sidebar-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Label */
.sidebar-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px; font-weight: 500; color: #8b949e;
  opacity: 0; transform: translateX(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.sidebar:hover .sidebar-label { opacity: 1; transform: translateX(0); }

/* Dropdown */
.nav-dropdown { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; width: 100%; }
.nav-dropdown.open { max-height: 220px; }
.nav-sub-item {
  display: flex; align-items: center;
  padding: 7px 8px 7px 52px; cursor: pointer;
  color: var(--text-secondary); font-size: 0.8rem; white-space: nowrap;
  transition: color 0.2s; border-radius: 8px;
}
.nav-sub-item:hover { color: var(--accent-green); background: rgba(255,255,255,0.03); }
.nav-sub-item.active { color: var(--accent-green); font-weight: 600; }
.nav-sub-label { opacity: 0; transition: opacity 0.2s; }
.sidebar:hover .nav-sub-label { opacity: 1; }

/* === MAIN AREA === */
.main-area {
  margin-left: var(--sidebar-icon-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh; overflow: hidden;
}

/* === TOP NAV === */
.top-nav {
  background: rgba(22,27,34,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100; flex-shrink: 0;
}
.top-nav-title { font-family: 'DM Serif Display', serif; font-size: 1.05rem; color: var(--text-primary); line-height: 1.2; }
.top-nav-title small { font-family: 'IBM Plex Sans', sans-serif; font-size: 0.72rem; color: var(--text-secondary); display: block; font-weight: 400; margin-top: 3px; }
.top-nav-right { display: flex; align-items: center; gap: 16px; }
.export-group { display: flex; align-items: center; gap: 8px; }
.export-wrapper { position: relative; }
.export-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 180px; background: rgba(22, 27, 34, 0.95);
  backdrop-filter: blur(20px); border: 1px solid var(--border-color);
  border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  display: none; flex-direction: column; padding: 6px; z-index: 1000;
  animation: dropdownFade 0.2s ease;
}
.export-dropdown.show { display: flex; }
.export-item {
  padding: 10px 14px; font-size: 0.82rem; color: var(--text-primary);
  border-radius: 8px; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 10px;
}
.export-item:hover { background: rgba(255,255,255,0.06); color: var(--accent-blue); }

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

.nav-timestamp { font-size: 0.75rem; color: var(--text-muted); background: var(--glass); border: 1px solid var(--glass-border); border-radius: 8px; padding: 5px 12px; }
.nav-bell { font-size: 1.15rem; cursor: pointer; color: var(--text-secondary); position: relative; }
.nav-bell::after { content: ''; position: absolute; top: -1px; right: -2px; width: 7px; height: 7px; background: var(--accent-amber); border-radius: 50%; }
.nav-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-green), var(--accent-blue)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; color: #fff; cursor: pointer; }

/* === CONTENT === */
.content-area { flex: 1; overflow-y: auto; padding: 28px 32px; }
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

/* === SECTIONS === */
.section { display: none; animation: fadeIn 0.3s ease; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.section-title { font-family: 'DM Serif Display', serif; font-size: 1.5rem; color: var(--text-primary); margin-bottom: 6px; }
.section-sub { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 24px; }

/* === CARDS === */
.card {
  background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--text-secondary); margin-bottom: 16px;
}

/* === SCORECARD === */
.scorecard-long {
  background: linear-gradient(135deg, rgba(0,176,155,0.07), rgba(79,172,254,0.04));
  border: 1px solid rgba(0,176,155,0.2);
  border-radius: var(--radius); padding: 20px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.scorecard-metric {
  font-family: 'DM Serif Display', serif; font-size: 3rem;
  color: var(--accent-green); text-shadow: 0 0 24px rgba(0,176,155,0.45);
  line-height: 1; letter-spacing: -0.5px;
}
.scorecard-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 6px; font-weight: 500; }
.scorecard-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.premium-select {
  background: rgba(13,17,23,0.8);
  border: 1.5px solid transparent;
  background-image: linear-gradient(rgba(22,27,34,0.95), rgba(22,27,34,0.95)),
    linear-gradient(135deg, var(--accent-green), var(--accent-blue));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  -webkit-background-clip: padding-box, border-box;
  color: var(--text-primary); padding: 11px 20px;
  border-radius: 12px; font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.9rem; font-weight: 600; min-width: 260px;
  cursor: pointer; outline: none;
  box-shadow: 0 4px 20px rgba(0,176,155,0.15); transition: box-shadow 0.3s;
}
.premium-select:hover { box-shadow: 0 4px 30px rgba(0,176,155,0.3); }

/* === GAUGE === */
.gauge-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding-top: 8px; }
.gauge-pct { font-family: 'DM Serif Display', serif; font-size: 2.6rem; color: var(--accent-green); text-shadow: 0 0 20px rgba(0,176,155,0.5); margin-top: -30px; }
.gauge-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-top: 4px; }

/* === FORECAST TABLE === */
.forecast-table { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
.forecast-table thead th {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-secondary); padding: 8px 10px; text-align: left;
  background: rgba(0,176,155,0.06); border-bottom: 1px solid rgba(0,176,155,0.1);
}
.forecast-table thead th:first-child { border-radius: 8px 0 0 8px; }
.forecast-table thead th:last-child { border-radius: 0 8px 8px 0; }
.forecast-table tbody td { padding: 10px 10px; background: rgba(255,255,255,0.02); font-size: 0.84rem; }
.forecast-table tbody tr:hover td { background: rgba(255,255,255,0.04); }
.forecast-table tbody td:first-child { font-weight: 600; color: var(--text-primary); border-radius: 8px 0 0 8px; }
.forecast-table tbody td:last-child { border-radius: 0 8px 8px 0; }
.f-days { color: var(--accent-blue); font-weight: 700; }
.f-target { color: var(--accent-green); font-weight: 700; }
.f-warn { color: var(--accent-amber); font-weight: 700; }
.warn-badge { background: rgba(247,151,30,0.12); color: var(--accent-amber); border: 1px solid rgba(247,151,30,0.25); border-radius: 5px; padding: 1px 7px; font-size: 0.7rem; font-weight: 700; margin-left: 6px; }

/* === MINI SCORECARDS === */
.mini-scorecard {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); padding: 16px;
}
.mini-score-icon { font-size: 1.3rem; margin-bottom: 6px; }
.mini-score-val { font-family: 'DM Serif Display', serif; font-size: 1.7rem; color: var(--text-primary); line-height: 1; }
.mini-score-label { font-size: 0.73rem; color: var(--text-secondary); font-weight: 500; margin-top: 4px; }

/* === RANKING TABLE === */
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0 7px; }
.rank-table th { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); padding: 8px 14px; letter-spacing: 1px; }
.rank-table td { padding: 12px 14px; background: rgba(255,255,255,0.02); font-size: 0.86rem; }
.rank-table tr:hover td { background: rgba(255,255,255,0.05); cursor: pointer; }
.rank-table td:first-child { border-radius: 10px 0 0 10px; }
.rank-table td:last-child { border-radius: 0 10px 10px 0; }
.pill { display: inline-block; height: 6px; border-radius: 10px; background: linear-gradient(90deg, var(--accent-green), var(--accent-green-light)); vertical-align: middle; margin-right: 8px; }
.trend-up { color: var(--accent-green); font-weight: 700; }
.trend-dn { color: #f85149; font-weight: 700; }

/* === GRID UTILITIES === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }

/* === CHART CONTAINERS === */
.chart-wrap { position: relative; width: 100%; }

/* === LOADER === */
.loader-overlay {
  position: fixed; inset: 0; background: rgba(13,17,23,0.97);
  backdrop-filter: blur(20px); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.loader-overlay.hidden { display: none; }
.loader-ring { width: 56px; height: 56px; border: 4px solid rgba(0,176,155,0.15); border-top-color: var(--accent-green); border-radius: 50%; animation: spin 1s linear infinite; }
.loader-status { font-size: 0.88rem; color: var(--text-secondary); letter-spacing: 0.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === REFRESH BTN === */
.btn-refresh {
  background: transparent; border: 1px solid var(--glass-border);
  color: var(--text-secondary); padding: 7px 16px;
  border-radius: 8px; cursor: pointer; font-size: 0.8rem;
  font-family: 'IBM Plex Sans', sans-serif;
  transition: all 0.2s;
}
.btn-refresh:hover { background: var(--glass); color: var(--text-primary); }
.btn-export { border-color: rgba(79, 172, 254, 0.3); color: var(--accent-blue); }
.btn-export:hover { background: rgba(79, 172, 254, 0.1); border-color: var(--accent-blue); }

/* === LEVEL SELECTOR TABS === */
.level-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.level-tab {
  padding: 7px 18px; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--glass-border); color: var(--text-secondary);
  background: var(--glass); transition: all 0.2s;
}
.level-tab.active { background: rgba(0,176,155,0.12); color: var(--accent-green); border-color: rgba(0,176,155,0.3); }

@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .content-area { padding: 16px 14px; }
  .scorecard-long { flex-direction: column; align-items: flex-start; }
}


/* =========================================
   NEW SECTIONS: GALLERY & VRC
   ========================================= */

/* --- GALLERY --- */
.gallery-filters {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.gallery-filter-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(0,176,155,0.25);
  color: #e6edf3;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.gallery-filter-select:focus {
  border-color: #00b09b;
  box-shadow: 0 0 0 3px rgba(0,176,155,0.15);
}

.gallery-count-badge {
  background: linear-gradient(135deg, #00b09b, #96c93d);
  color: #0d1117;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  margin-left: auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.gallery-card {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  break-inside: avoid;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,176,155,0.2);
  border-color: rgba(0,176,155,0.3);
}

.gallery-card-img-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-card:hover img {
  transform: scale(1.04);
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,176,155,0.8), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

.gallery-card-overlay svg {
  width: 32px;
  height: 32px;
  stroke: #fff;
}

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

.gallery-card-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-date {
  color: #8b949e;
  font-size: 12px;
}

.stage-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  width: fit-content;
}

/* Stage badge colors */
.badge-plinth        { background: rgba(0,176,155,0.2);  color: #00b09b; border: 1px solid rgba(0,176,155,0.3); }
.badge-lintel        { background: rgba(247,151,30,0.2);  color: #f7971e; border: 1px solid rgba(247,151,30,0.3); }
.badge-greyStructure { background: rgba(79,172,254,0.2);  color: #4facfe; border: 1px solid rgba(79,172,254,0.3); }
.badge-completion    { background: rgba(240,147,251,0.2); color: #f093fb; border: 1px solid rgba(240,147,251,0.3); }

/* Stats Row */
.gallery-stats-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.gallery-stat-pill {
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 140px;
}

.gallery-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.gallery-stat-label {
  font-size: 12px;
  color: #8b949e;
  max-width: 80px;
  line-height: 1.2;
}

/* Lightbox Modal */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lightboxIn 0.25s ease;
}

@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox-img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 100px rgba(0,0,0,0.6);
  animation: imgPop 0.25s ease;
}

@keyframes imgPop {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 20px;
}

.lightbox-nav:hover {
  background: rgba(0,176,155,0.3);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #8b949e;
  grid-column: 1 / -1;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  stroke: rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* --- VRC --- */
.vrc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
}

.vrc-table thead th {
  background: linear-gradient(135deg, rgba(0,176,155,0.15), rgba(150,201,61,0.08));
  color: #00b09b;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(0,176,155,0.2);
  white-space: nowrap;
}

.vrc-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  cursor: pointer;
}

.vrc-table tbody tr:hover {
  background: rgba(0,176,155,0.05);
}

.vrc-table tbody td {
  padding: 11px 14px;
  color: #c9d1d9;
  vertical-align: middle;
}

.training-yes {
  background: rgba(0,176,155,0.15);
  color: #00b09b;
  border: 1px solid rgba(0,176,155,0.25);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}

.training-no {
  background: rgba(240,87,87,0.12);
  color: #f05757;
  border: 1px solid rgba(240,87,87,0.2);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}

/* VRC Drawer */
.vrc-drawer {
  position: fixed;
  right: -420px;
  top: 0; bottom: 0;
  width: 400px;
  background: #161b22;
  border-left: 1px solid rgba(0,176,155,0.2);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  z-index: 5000;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 24px;
}

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

.vrc-drawer-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.vrc-drawer-pill {
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: #8b949e;
  border: 1px solid rgba(255,255,255,0.08);
}

.vrc-drawer-training-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.vrc-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.vrc-page-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
}

.vrc-page-btn:hover {
  background: rgba(255,255,255,0.1);
}

.vrc-page-btn.active {
  background: linear-gradient(135deg, #00b09b, #96c93d);
  color: #0d1117;
  font-weight: 700;
  border-color: transparent;
}

/* === USER MANAGEMENT & AUTH === */
#auth-gate {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0d1117 0%, #0a0f16 50%, #0d1117 100%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid rgba(0, 176, 155, 0.2);
  border-radius: 24px;
  padding: 48px;
  width: 420px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.6),
              0 0 80px rgba(0,176,155,0.05);
  backdrop-filter: blur(20px);
}

.auth-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 16px;
  color: #e6edf3;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  margin-bottom: 14px;
}

.auth-input:focus {
  border-color: rgba(0,176,155,0.5);
  box-shadow: 0 0 0 3px rgba(0,176,155,0.12);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #00b09b, #96c93d);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}

.auth-btn:hover  { opacity: 0.92; }
.auth-btn:active { transform: scale(0.99); }
.auth-btn.loading { opacity: 0.7; pointer-events: none; }

.role-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-block;
}

.role-admin {
  background: rgba(0,176,155,0.2);
  color: #00b09b;
  border: 1px solid rgba(0,176,155,0.3);
}

.role-viewer {
  background: rgba(79,172,254,0.2);
  color: #4facfe;
  border: 1px solid rgba(79,172,254,0.3);
}

.add-user-card {
  background: rgba(22,27,34,0.85);
  border: 1px solid rgba(0,176,155,0.15);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00b09b, #96c93d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #0d1117;
  flex-shrink: 0;
  text-transform: uppercase;
}

.btn-edit-role {
  background: rgba(79,172,254,0.12);
  border: 1px solid rgba(79,172,254,0.25);
  color: #4facfe;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-edit-role:hover { background: rgba(79,172,254,0.22); }

.btn-remove-user {
  background: rgba(240,87,87,0.12);
  border: 1px solid rgba(240,87,87,0.25);
  color: #f05757;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-remove-user:hover { background: rgba(240,87,87,0.22); }

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

.confirm-card {
  background: #161b22;
  border: 1px solid rgba(240,87,87,0.3);
  border-radius: 16px;
  padding: 32px;
  width: 380px;
  text-align: center;
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(4px); }
}

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

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

/* ================================= */
/* GEO-MAP & HIGH DENSITY STYLINGS   */
/* ================================= */

/* Leaflet Dark Mode Overrides */
.leaflet-container { background: transparent !important; }
.leaflet-bar a { background-color: var(--bg-secondary) !important; color: var(--text-primary) !important; border-color: rgba(255,255,255,0.1) !important; }
.leaflet-bar a:hover { background-color: rgba(255,255,255,0.1) !important; }
.leaflet-control-attribution { background: rgba(0,0,0,0.5) !important; color: #8b949e !important; }
.leaflet-control-attribution a { color: var(--accent-blue) !important; }

/* Glowing Map Node Pulse Animations */
@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(0, 176, 155, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(0, 176, 155, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 176, 155, 0); }
}
@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(247, 151, 30, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(247, 151, 30, 0); }
  100% { box-shadow: 0 0 0 0 rgba(247, 151, 30, 0); }
}

.map-node-good {
  background: var(--accent-green);
  border: 2px solid #fff;
  border-radius: 50%;
  border-radius: 50%;
  animation: pulseGreen 2s infinite;
  box-shadow: 0 0 15px var(--accent-green);
}

.map-node-warn {
  background: var(--accent-amber);
  border: 2px solid #fff;
  border-radius: 50%;
  animation: pulseAmber 2s infinite;
  box-shadow: 0 0 15px var(--accent-amber);
}

/* Sparklines */
canvas.sparkline {
  background: transparent;
  vertical-align: middle;
  border-radius: 2px;
}

/* Premium Map Popups (Glassmorphic) */
.leaflet-popup-content-wrapper {
  background: rgba(22, 27, 34, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
  border-radius: 12px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.leaflet-popup-tip {
  background: rgba(22, 27, 34, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: none !important;
  border-left: none !important;
}

.premium-map-popup .popup-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.premium-map-popup .popup-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.0rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.premium-map-popup .popup-header p {
  margin: 0;
  font-size: 0.75rem;
  color: #8b949e;
  font-family: 'IBM Plex Sans', sans-serif;
}

.premium-map-popup .stage-badge {
  position: absolute;
  top: 14px;
  right: 18px;
  padding: 4px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.premium-map-popup .popup-body {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.premium-map-popup .date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-family: 'IBM Plex Sans', sans-serif;
}

.premium-map-popup .date-row .step {
  color: #8b949e;
}

.premium-map-popup .date-row .date {
  color: #e6edf3;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Close Button Override */
.leaflet-popup-close-button {
  color: #8b949e !important;
  padding-top: 5px !important;
  padding-right: 5px !important;
}
.leaflet-popup-close-button:hover {
  color: #fff !important;
  background: transparent !important;
}

/* === GIS INTELLIGENCE OVERLAYS === */
.hazard-legend {
  position: absolute; bottom: 20px; left: 20px;
  background: rgba(22, 27, 34, 0.95); backdrop-filter: blur(12px);
  border: 1px solid var(--border-color); border-radius: 12px;
  padding: 14px; z-index: 1000; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.legend-header { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary); margin-bottom: 10px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-primary); margin-bottom: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; }

.safety-pill {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  background: rgba(13, 17, 23, 0.9); backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 200, 81, 0.4); border-radius: 50px;
  padding: 8px 20px; z-index: 1000; pointer-events: none;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem; font-weight: 600; color: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.pulse-small {
  width: 8px; height: 8px; background: #00C851; border-radius: 50%;
  box-shadow: 0 0 0 rgba(0, 200, 81, 0.4);
  animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(0, 200, 81, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(0, 200, 81, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 200, 81, 0); }
}

.pulse-icon {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #fff; animation: pulse-flood 1.5s infinite;
}
@keyframes pulse-flood {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* === SAFETY ANALYST POPUP === */
.safety-check-loader {
  padding: 10px; font-size: 0.75rem; color: var(--accent-blue);
  text-align: center; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 10px;
}
.safety-analyst-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.05); margin-top: 10px; padding-top: 12px;
}
.safety-item { display: flex; flex-direction: column; align-items: center; }
.safety-item span { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.safety-item strong { font-size: 0.85rem; color: var(--text-primary); }

/* Leaflet Layer Control Styling */
.leaflet-control-layers {
  background: rgba(22, 27, 34, 0.95) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 12px !important;
  color: var(--text-primary) !important;
  font-family: 'IBM Plex Sans', sans-serif !important;
  padding: 8px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
.leaflet-control-layers-list label { margin-bottom: 4px; border-radius: 6px; padding: 4px; cursor: pointer; }
.leaflet-control-layers-list label:hover { background: rgba(255,255,255,0.05); }
