/* ═══════════════════════════════════════════════════════
   Burdur Gölü POC - Dark Futuristic Theme
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #06090f;
  --bg-secondary: #0d1117;
  --bg-card: rgba(13, 17, 23, 0.85);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-hover: rgba(255, 255, 255, 0.06);

  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.15);
  --accent-glow: rgba(0, 212, 255, 0.4);
  --purple: #a855f7;
  --blue: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --orange: #f59e0b;
  --cyan: #06b6d4;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Animated Background ────────────────────────────── */
.bg-grid {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}

.bg-glow-1 {
  top: -200px; left: -100px;
  background: var(--accent);
  animation: floatGlow 15s ease-in-out infinite;
}

.bg-glow-2 {
  bottom: -200px; right: -100px;
  background: var(--purple);
  animation: floatGlow 18s ease-in-out infinite reverse;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ── Login Page ─────────────────────────────────────── */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: rgba(255, 255, 255, 0.06);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent), #0099cc);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.login-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 16px;
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ── Dashboard Layout ───────────────────────────────── */
.dashboard {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(6, 9, 15, 0.9);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.header-title {
  font-size: 1rem;
  font-weight: 600;
}

.header-title span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
  display: block;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.btn-summary {
  padding: 7px 16px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-summary:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.22), rgba(168, 85, 247, 0.22));
  border-color: rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.15);
}

.btn-logout {
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

/* ── Main Content ───────────────────────────────────── */
.main {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── KPI Cards ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
  animation: fadeInUp 0.5s ease-out both;
}

.kpi-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.kpi-card:nth-child(1) { animation-delay: 0.1s; }
.kpi-card:nth-child(2) { animation-delay: 0.2s; }
.kpi-card:nth-child(3) { animation-delay: 0.3s; }
.kpi-card:nth-child(4) { animation-delay: 0.4s; }
.kpi-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.kpi-icon.cyan { background: rgba(0, 212, 255, 0.12); color: var(--accent); }
.kpi-icon.red { background: rgba(239, 68, 68, 0.12); color: var(--red); }
.kpi-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.kpi-icon.orange { background: rgba(245, 158, 11, 0.12); color: var(--orange); }
.kpi-icon.purple { background: rgba(168, 85, 247, 0.12); color: var(--purple); }
.kpi-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.kpi-value .unit {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 8px;
}

.kpi-trend.down {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.kpi-trend.up {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}

.kpi-trend.neutral {
  background: rgba(245, 158, 11, 0.12);
  color: var(--orange);
}

/* ── Tab Navigation ─────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius-lg) - 4px);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(168, 85, 247, 0.10));
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 212, 255, 0.1);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Content Grid ───────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.content-grid > .card:nth-child(odd):last-child {
  grid-column: 1 / -1;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out both;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.card-badge {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

.card-badge.ip4 { background: rgba(59, 130, 246, 0.12); color: var(--blue); }
.card-badge.ip5 { background: rgba(168, 85, 247, 0.12); color: var(--purple); }
.card-badge.ip6 { background: rgba(16, 185, 129, 0.12); color: var(--green); }

.card-full {
  grid-column: 1 / -1;
}

/* ── Map ────────────────────────────────────────────── */
#map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-sm);
  z-index: 1;
}

.map-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.year-slider {
  flex: 1;
  min-width: 150px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
}

.year-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
}

.year-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
}

.map-legend {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Charts ─────────────────────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

/* ── Stats Table ────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.stat-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
}

.stat-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.stat-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.stat-table .value {
  color: var(--text-primary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-table .significant {
  color: var(--red);
  font-weight: 700;
}

.stat-table .not-significant {
  color: var(--text-muted);
}

/* ── Image Gallery ──────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.gallery-item:hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-item .caption {
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── Summary Modal ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.25s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.06);
  animation: slideUp 0.35s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--red);
}

.modal-body {
  padding: 24px;
}

.summary-section {
  margin-bottom: 22px;
}

.summary-section:last-child {
  margin-bottom: 0;
}

.summary-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.summary-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary-section li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 14px;
  position: relative;
}

.summary-section li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.summary-section li strong {
  color: var(--text-primary);
}

.summary-section .ref {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

.lib-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lib-tag {
  padding: 4px 10px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--purple);
  font-family: 'SF Mono', 'Consolas', monospace;
}

/* scrollbar for modal */
.modal-content::-webkit-scrollbar {
  width: 5px;
}
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 95%;
  max-height: 95vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ── Section Headers ────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  margin-top: 8px;
}

.section-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--glass-border), transparent);
}

/* ── Footer ─────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 24px;
  margin-top: 20px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Trophic Status ─────────────────────────────────── */
.trophic-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.trophic-bar .segment {
  flex: 1;
  transition: var(--transition);
}

.trophic-bar .oligo { background: #3b82f6; }
.trophic-bar .meso { background: #10b981; }
.trophic-bar .eutro { background: #f59e0b; }
.trophic-bar .hyper { background: #ef4444; }

.trophic-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.trophic-wrapper {
  position: relative;
}

.trophic-marker {
  position: relative;
  height: 20px;
  margin-bottom: 4px;
}

.trophic-marker .dot {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  border: 3px solid var(--accent);
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  box-shadow: 0 0 10px var(--accent-glow);
  transition: left 0.8s ease;
}

.trophic-marker .dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: var(--accent);
}

/* ── Pulse Animation ────────────────────────────────── */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
  70% { box-shadow: 0 0 0 12px rgba(0, 212, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
  }

  .header-badge {
    display: none;
  }

  .btn-summary {
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .modal-content {
    width: 95%;
    max-height: 80vh;
  }

  .modal-body {
    padding: 16px;
  }

  .summary-section li {
    font-size: 0.78rem;
  }

  .header-title {
    font-size: 0.85rem;
  }

  .header-title span {
    font-size: 0.7rem;
  }

  .main {
    padding: 12px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .tab-nav {
    margin-bottom: 16px;
  }

  .tab-btn {
    padding: 8px 8px;
    font-size: 0.78rem;
  }

  .kpi-card {
    padding: 14px;
  }

  .kpi-value {
    font-size: 1.3rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  #map {
    height: 280px;
  }

  .chart-container {
    height: 220px;
  }

  .card {
    padding: 16px;
  }

  .stat-table {
    font-size: 0.75rem;
  }

  .stat-table th,
  .stat-table td {
    padding: 8px 6px;
  }

  .trophic-labels {
    font-size: 0.6rem;
  }

  .section-header h2 {
    font-size: 0.95rem;
  }

  .login-card {
    padding: 32px 20px;
  }

  .login-title {
    font-size: 1.3rem;
  }

  .login-subtitle {
    font-size: 0.78rem;
  }

  .map-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .year-label {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
  }

  .kpi-icon {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .kpi-value {
    font-size: 1.1rem;
  }

  .kpi-label {
    font-size: 0.72rem;
  }

  .kpi-trend {
    font-size: 0.68rem;
  }

  #map {
    height: 240px;
  }

  .chart-container {
    height: 200px;
  }

  .header-logo {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
  }

  .btn-logout {
    padding: 5px 10px;
    font-size: 0.72rem;
  }

  .gallery-item .caption {
    font-size: 0.75rem;
    padding: 10px 12px;
  }

  .trophic-labels {
    font-size: 0.55rem;
  }

  .footer {
    font-size: 0.68rem;
  }
}

/* ── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Loading ────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Tooltip ────────────────────────────────────────── */
.info-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed var(--text-muted);
}

.info-tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  z-index: 10;
  margin-bottom: 6px;
}
