/* Shell & TAQA Station Scoring Dashboard Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Shell Identity Tokens */
  --shell-red: #DD1D21;
  --shell-red-glow: rgba(221, 29, 33, 0.4);
  --shell-yellow: #FFD500;
  --shell-yellow-glow: rgba(255, 213, 0, 0.35);
  
  /* Rank & Score Colors — Gold / Silver / Bronze / NC Tier System */
  --rank-gold:   #10B981; /* Emerald Green  – Gold Tier   ≥80%  */
  --rank-silver: #FFD500; /* Shell Yellow   – Silver Tier 60-79% */
  --rank-bronze: #DD1D21; /* Shell Red      – Bronze Tier <60%  */
  --rank-nc:     #CBD5E1; /* Slate White    – Not Classified     */
  /* Legacy aliases kept for map/chart compatibility */
  --rank-a-plus: #10B981;
  --rank-a:      #10B981;
  --rank-b:      #FFD500;
  --rank-c:      #DD1D21;
  
  /* Modern Dark Theme Palettes */
  --bg-dark: #07090E;
  --bg-card: rgba(16, 22, 34, 0.78);
  --bg-card-hover: rgba(24, 32, 48, 0.88);
  --bg-card-solid: #101622;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(255, 213, 0, 0.35);
  
  --accent-cyan: #00F2FE;
  --accent-blue: #3B82F6;
  
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow-red: 0 0 25px rgba(221, 29, 33, 0.25);
  --shadow-glow-gold: 0 0 25px rgba(255, 213, 0, 0.3);
}

[data-theme="light"] {
  --bg-dark: #F8FAFC;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-card-solid: #FFFFFF;
  --border-glass: rgba(15, 23, 42, 0.1);
  --border-glass-bright: rgba(221, 29, 33, 0.4);
  --text-main: #0F172A;
  --text-bright: #0F172A;
  --text-muted: #475569;
  --text-dim: #64748B;
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
}

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

/* Custom Shell Helix Motor Oil Canister Mouse Cursor (Normal State) */
*, *::before, *::after,
html, body, header, section, main, footer, nav,
div, p, span, h1, h2, h3, h4, h5, h6,
table, thead, tbody, tr, th, td,
ul, ol, li, i, canvas, svg, path, img,
.upload-portal-overlay, .modal-card,
.leaflet-container, .leaflet-pane {
  cursor: url('assets/shell-helix-cursor.png?v=20260725_v24') 2 2, auto;
}

/* Custom Shell Helix Motor Oil Canister Mouse Cursor (Hover state on clickable items) */
a, button, select, input, textarea, label,
th, td, tr, canvas, svg, [onclick],
.action-btn, .detail-box, .sheet-tab-btn, .kpi-card, .panel-card, .leadercard, .legend-item,
.modal-close-btn, .map-jump-btn, .photo-folder-card, .status-tag, .filter-select, .search-input,
.upload-dropzone, .upload-btn-large, .custom-score-pin, .leaflet-interactive, .leaflet-marker-icon,
a:hover, button:hover, select:hover, input:hover, label:hover, [onclick]:hover,
.action-btn:hover, .detail-box:hover, .sheet-tab-btn:hover, .kpi-card:hover, .panel-card:hover, .leadercard:hover {
  cursor: url('assets/shell-helix-cursor-hover.png?v=20260725_v24') 2 2, pointer !important;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Ambient Background Glows */
body::before {
  content: '';
  position: fixed;
  top: -150px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--shell-red-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: 40%;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--shell-yellow-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

#app-container {
  position: relative;
  z-index: 1;
  max-width: 1720px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* Header Component */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-main);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shell-logo-img {
  height: 48px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(221, 29, 33, 0.5));
}

.brand-title h1 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 40%, var(--shell-yellow) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-title h1 {
  background: linear-gradient(135deg, #0F172A 40%, var(--shell-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-title .subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.dataset-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(255, 213, 0, 0.15);
  border: 1px solid rgba(255, 213, 0, 0.35);
  color: var(--shell-yellow);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

/* 3D Background Scene with Moving Shell Logo Watermark & Perspective Grid */
.bg-3d-scene {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  perspective: 1000px;
}

.bg-3d-grid {
  position: absolute;
  inset: -50%;
  background-image: 
    linear-gradient(to right, rgba(255, 213, 0, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 213, 0, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: rotateX(60deg) translateY(-100px);
  transform-origin: 50% 0%;
  mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 80%);
  animation: bgGridPerspective 24s linear infinite;
  will-change: transform;
}

@keyframes bgGridPerspective {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 60px 60px;
  }
}

.bg-3d-shell-container {
  position: absolute;
  top: 8%;
  right: -2%;
  width: 780px;
  height: 780px;
  perspective: 1200px;
  transform-style: preserve-3d;
}

.bg-3d-shell-logo {
  width: 100%;
  height: auto;
  opacity: 0.18;
  filter: drop-shadow(0 30px 60px rgba(221, 29, 33, 0.7)) drop-shadow(0 0 100px rgba(255, 213, 0, 0.5));
  transform: rotateX(25deg) rotateY(-20deg) rotateZ(10deg) translateZ(40px);
  animation: float3dShellDynamic 7s ease-in-out infinite alternate;
  will-change: transform;
}

[data-theme="light"] .bg-3d-shell-logo {
  opacity: 0.12;
  filter: drop-shadow(0 20px 40px rgba(221, 29, 33, 0.4));
}

@keyframes float3dShellDynamic {
  0% {
    transform: rotateX(24deg) rotateY(-22deg) rotateZ(8deg) translateY(0px) translateZ(30px) scale(1);
  }
  50% {
    transform: rotateX(32deg) rotateY(-14deg) rotateZ(16deg) translateY(-40px) translateZ(80px) scale(1.04);
  }
  100% {
    transform: rotateX(20deg) rotateY(-28deg) rotateZ(4deg) translateY(-70px) translateZ(120px) scale(1.08);
  }
}

.bg-3d-glow-red {
  position: absolute;
  top: -120px;
  left: -120px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(221, 29, 33, 0.25) 0%, transparent 70%);
  filter: blur(40px);
  animation: pulseGlowRed 6s ease-in-out infinite alternate;
}

@keyframes pulseGlowRed {
  0% { transform: scale(1) translateY(0); opacity: 0.8; }
  100% { transform: scale(1.25) translateY(30px); opacity: 1; }
}

.bg-3d-glow-gold {
  position: absolute;
  bottom: -150px;
  right: 8%;
  width: 750px;
  height: 750px;
  background: radial-gradient(circle, rgba(255, 213, 0, 0.20) 0%, transparent 70%);
  filter: blur(50px);
  animation: pulseGlowGold 8s ease-in-out infinite alternate;
}

@keyframes pulseGlowGold {
  0% { transform: scale(1) translateX(0); opacity: 0.8; }
  100% { transform: scale(1.3) translateX(-40px); opacity: 1; }
}

/* Header Controls & iOS Frosted Glass Buttons */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-select, .action-btn, .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  padding: 9px 16px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

[data-theme="light"] .filter-select,
[data-theme="light"] .action-btn,
[data-theme="light"] .icon-btn {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.12);
  color: #0F172A;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 4px 14px rgba(0, 0, 0, 0.08);
}

.filter-select option {
  background: var(--bg-card-solid);
  color: var(--text-main);
}

.filter-select:hover, .action-btn:hover, .icon-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--shell-yellow);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 6px 20px rgba(255, 213, 0, 0.25);
}

[data-theme="light"] .filter-select:hover,
[data-theme="light"] .action-btn:hover,
[data-theme="light"] .icon-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--shell-red);
  box-shadow: 0 6px 20px rgba(221, 29, 33, 0.2);
}

.action-btn.active {
  background: linear-gradient(135deg, var(--shell-red) 0%, #B91C1C 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 6px 20px rgba(221, 29, 33, 0.45);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glass-bright);
  box-shadow: var(--shadow-main);
}

.kpi-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
  line-height: 1;
}

.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 5px;
  font-weight: 500;
}

/* Top 5 Leaderboard Section */
.leaderboard-section {
  margin-bottom: 24px;
}

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.leadercard {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: all 0.25s ease;
  cursor: pointer;
}

.leadercard:hover {
  transform: translateY(-4px);
  border-color: var(--shell-yellow);
  box-shadow: var(--shadow-glow-gold);
}

.leadercard-rank {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 213, 0, 0.15);
  border: 1px solid var(--shell-yellow);
  color: var(--shell-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.leadercard-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  padding-right: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leadercard-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-progress-bar {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.score-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #FFD500, #10B981);
}

/* Dashboard Layout Grid */
.dashboard-grid-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Glass Card Panel */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-glass);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Map Quick Jump Controls */
.map-jump-controls {
  display: flex;
  gap: 6px;
}

.map-jump-btn {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-jump-btn:hover {
  color: var(--shell-yellow);
  border-color: var(--shell-yellow);
}

/* Map Legend */
.map-footer-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.gold { background: var(--rank-a-plus); box-shadow: 0 0 8px var(--rank-a-plus); }
.dot.green { background: var(--rank-a); box-shadow: 0 0 8px var(--rank-a); }
.dot.amber { background: var(--rank-b); box-shadow: 0 0 8px var(--rank-b); }
.dot.red { background: var(--rank-c); box-shadow: 0 0 8px var(--rank-c); }

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 260px;
  overflow: hidden;
}

.chart-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  z-index: 1;
}

.visual-chart-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  box-sizing: border-box;
  z-index: 2;
  background: var(--bg-card-solid);
}

/* High Clarity Leaflet Map Canvas */
#map-container {
  width: 100%;
  height: 500px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-glass-bright);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  z-index: 1;
}

/* Custom Interactive Score Pin */
.custom-score-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-score-pin:hover {
  transform: scale(1.35) translateY(-4px);
  z-index: 9999 !important;
}

.pin-inner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #0D131F;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 11px;
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), 0 0 14px var(--pin-color);
  border: 3px solid var(--pin-color, #FFD500);
}

/* Tooltip Styling */
.leaflet-tooltip.map-tooltip {
  background: #101622 !important;
  color: #FFFFFF !important;
  border: 1px solid var(--shell-yellow) !important;
  border-radius: 6px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 0.78rem !important;
  padding: 6px 10px !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6) !important;
}

.leaflet-popup-content-wrapper {
  background: #101622 !important;
  color: #FFFFFF !important;
  border: 1px solid var(--shell-yellow) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8) !important;
}

.leaflet-popup-tip {
  background: #101622 !important;
}

/* Score Status Badges */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

/* ── New Tier System: Gold / Silver / Bronze / NC ──────────────── */
.status-gold   { background: rgba(16, 185, 129, 0.18); color: var(--rank-gold);   border: 1px solid rgba(16, 185, 129, 0.45); }
.status-silver { background: rgba(255, 213, 0,  0.18); color: var(--rank-silver); border: 1px solid rgba(255, 213, 0,  0.45); }
.status-bronze { background: rgba(221, 29,  33, 0.18); color: var(--rank-bronze); border: 1px solid rgba(221, 29,  33, 0.45); }
.status-nc     { background: rgba(203, 213, 225,0.12); color: var(--rank-nc);     border: 1px solid rgba(203, 213, 225,0.35); }
/* Legacy aliases — so hardcoded old class names in data.js still render with new colors */
.status-a-plus { background: rgba(16, 185, 129, 0.18); color: var(--rank-gold);   border: 1px solid rgba(16, 185, 129, 0.45); }
.status-a      { background: rgba(16, 185, 129, 0.18); color: var(--rank-gold);   border: 1px solid rgba(16, 185, 129, 0.45); }
.status-b      { background: rgba(255, 213, 0,  0.18); color: var(--rank-silver); border: 1px solid rgba(255, 213, 0,  0.45); }
.status-c      { background: rgba(221, 29,  33, 0.18); color: var(--rank-bronze); border: 1px solid rgba(221, 29,  33, 0.45); }

/* Table Styling */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.custom-table th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-glass);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
}

.custom-table tbody tr {
  transition: background 0.2s ease;
  cursor: pointer;
}

.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.search-input {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  width: 220px;
  outline: none;
}

.search-input:focus {
  border-color: var(--shell-yellow);
}

/* Modal Drawer */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

/* Sticky header inside modal */
.modal-header {
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border-glass);
  flex-shrink: 0;
}

/* Scrollable body */
.modal-body {
  overflow-y: auto;
  padding: 16px 22px 20px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,213,0,0.4) transparent;
}

.modal-body::-webkit-scrollbar { width: 5px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,213,0,0.35); border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: var(--shell-yellow); }

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  background: var(--shell-red);
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.detail-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.detail-val {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--shell-yellow); }

/* Executive Navigation Tabs */
.sheet-tabs-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass-bright);
  padding: 6px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sheet-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

.sheet-tab-btn.active {
  background: linear-gradient(135deg, var(--shell-red) 0%, #B91C1C 100%);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(221, 29, 33, 0.45);
}

.sheet-tab-btn i {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.sheet-tab-btn.active i {
  color: var(--shell-yellow);
  transform: scale(1.1);
}

.sheet-view {
  display: none;
}

.sheet-view.active {
  display: block;
}

.census-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1200px) {
  .census-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 1100px) {
  .dashboard-grid-main { grid-template-columns: 1fr; }
}

/* Upload Dataset Welcome Portal Overlay */
.upload-portal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.upload-portal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.upload-portal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 580px;
  padding: 36px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
  text-align: center;
  position: relative;
}

.upload-dropzone {
  border: 2px dashed rgba(255, 213, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  background: rgba(255, 213, 0, 0.03);
  margin: 22px 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--shell-yellow);
  background: rgba(255, 213, 0, 0.08);
  box-shadow: 0 0 20px rgba(255, 213, 0, 0.2);
}

.upload-btn-large {
  background: linear-gradient(135deg, var(--shell-red), #B91C1C);
  color: #FFFFFF;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(221, 29, 33, 0.4);
  transition: all 0.25s ease;
  width: 100%;
}

.upload-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(221, 29, 33, 0.6);
}

/* Login / Authentication Gate Inputs */
.login-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass-bright);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.login-input:focus {
  outline: none;
  border-color: var(--shell-yellow);
  background: rgba(255, 213, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.12);
}

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

.login-input.input-error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Photos Explorer — Folder Cards */
.photo-folder-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.photo-folder-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glass-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow-main);
}

.photo-folder-card .folder-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 213, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--shell-yellow);
  flex-shrink: 0;
}

.photo-folder-card .folder-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.photo-folder-card .folder-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: monospace;
}

.preset-data-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.preset-data-btn:hover {
  color: var(--shell-yellow);
}

/* Loading spinner used in upload portal */
@keyframes spin {
  to { transform: rotate(360deg); }
}
