:root {
  --bg: #050510;
  --text: #E0E6FF;
  --red: #FF4D4D;
  --green: #4DFF88;
  --gold: #FFD700;
  --muted: #8A94C8;
  --card: rgba(10, 10, 32, 0.85);
  --border: rgba(255, 255, 255, 0.1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image: url('pattern-bg.png'); /* Твой общий паттерн */
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  line-height: 1.6;
  padding: 0 20px 40px;
}
a { color: var(--gold); text-decoration: none; transition: 0.2s; }
a:hover { text-decoration: underline; opacity: 0.8; }

header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--border);
  margin-bottom: 30px; flex-wrap: wrap; gap: 10px;
  max-width: 1200px; margin-left: auto; margin-right: auto;
  position: relative; z-index: 10;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--gold); }
.logo img { height: 35px; }

nav { display: flex; gap: 14px; flex-wrap: wrap; }
nav a { color: var(--muted); font-size: 14px; font-weight: 500; }
nav a:hover { color: var(--gold); }
nav a.active { color: var(--gold); border-bottom: 2px solid var(--gold); }

main { max-width: 1200px; margin: 0 auto; position: relative; z-index: 10; }

.hero {
  text-align: center; padding: 100px 20px; margin-bottom: 40px; border-radius: 20px;
  background-image: linear-gradient(rgba(5, 5, 16, 0.75), rgba(5, 5, 16, 0.95)), url('water-hero-bg.png');
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.hero h1 { font-size: 46px; margin-bottom: 15px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.hero .red { color: var(--red); }
.hero .green { color: var(--green); }
.hero p { color: #C0C8F0; max-width: 750px; margin: 0 auto; font-size: 18px; text-shadow: 0 1px 5px rgba(0,0,0,0.8); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 30px 0; }
.stat {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 16px; padding: 24px 18px;
  text-align: center; position: relative; overflow: hidden;
}
.stat .num { display: block; font-size: 28px; font-weight: 700; color: var(--gold); position: relative; z-index: 2; }
.stat .label { font-size: 12px; color: var(--muted); position: relative; z-index: 2; text-transform: uppercase; letter-spacing: 0.5px; }
.stat.loss-icon::before {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100px; height: 100px; background-image: url('water-icon-loss.png');
  background-size: contain; background-repeat: no-repeat; opacity: 0.15; z-index: 1;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 20px 0; }
.card {
  background: var(--card); backdrop-filter: blur(12px);
  border-radius: 16px; padding: 22px; color: var(--text); border: 1px solid var(--border);
  transition: 0.3s; display: flex; flex-direction: column;
}
.card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 8px 25px rgba(255,215,0,0.1); }
.card.red { border-left: 4px solid var(--red); }
.card.green { border-left: 4px solid var(--green); }
.card.gray { border-left: 4px solid var(--muted); }
.card-title { font-weight: 600; margin-bottom: 8px; font-size: 16px; line-height: 1.4; }
.card-meta { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.card-country { font-size: 11px; text-transform: uppercase; color:#5A649A; margin-top: auto; padding-top: 12px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; align-items: center; }
.filters select, .filters input {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 10px; font-size: 14px; outline: none; backdrop-filter: blur(12px);
}
.filters select:focus, .filters input:focus { border-color: var(--gold); }

h1 { font-size: 34px; margin: 20px 0; }
h2 { font-size: 24px; margin: 30px 0 15px; color: var(--gold); }
h3 { font-size: 15px; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
table { width: 100%; border-collapse: collapse; margin: 15px 0; font-size: 14px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }

.detail-block {
  background: var(--card); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin: 20px 0;
}
.detail-block p { margin: 8px 0; }

.status-badge { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; margin: 10px 0; }
.status-badge.red { background: rgba(255,77,77,.15); color: var(--red); border: 1px solid rgba(255,77,77,.3); }
.status-badge.green { background: rgba(77,255,136,.15); color: var(--green); border: 1px solid rgba(77,255,136,.3); }
.status-badge.gray { background: rgba(138,148,200,.15); color: var(--muted); border: 1px solid rgba(138,148,200,.3); }

.btn-primary {
  display: inline-block; background: linear-gradient(135deg, var(--gold), #FFA500);
  color: var(--bg); padding: 12px 28px; border-radius: 30px; font-weight: 700;
  margin-top: 10px; transition: 0.3s; border: none; cursor: pointer;
}
.btn-primary:hover { transform: scale(1.03); box-shadow: 0 0 20px rgba(255,215,0,0.3); text-decoration: none; }

.img-hero { max-width: 350px; width: 100%; margin: 20px auto; display: block; filter: drop-shadow(0 0 30px rgba(255,215,0,0.2)); }
.img-solution { width: 100%; border-radius: 12px; margin: 15px 0; border: 1px solid var(--border); }
.img-satellite { max-width: 400px; width: 100%; margin: 20px auto; display: block; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 0 30px rgba(0,0,0,0.5); }

#map { height: 70vh; border-radius: 16px; border: 1px solid var(--border); background-image: url('water-map-bg.png'); background-size: cover; background-position: center; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.legend { display: flex; gap: 20px; margin: 15px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.red { background: var(--red); box-shadow: 0 0 10px var(--red); }
.dot.green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot.gray { background: var(--muted); }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 30px 0; flex-wrap: wrap; }
.pagination button { background: var(--card); border: 1px solid var(--border); color: var(--text); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.pagination button:hover { border-color: var(--gold); }
.pagination button.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }

footer { margin-top: 60px; padding: 30px 0; border-top: 1px solid var(--border); font-size: 13px; color:#5A649A; text-align: center; max-width: 1200px; margin-left: auto; margin-right: auto; }
code { background: rgba(0,0,0,0.5); padding: 4px 8px; border-radius: 6px; font-size: 13px; color: var(--gold); word-break: break-all; border: 1px solid var(--border); }

@media(max-width: 768px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 32px; }
  .hero { padding: 60px 20px; }
  header { flex-direction: column; align-items: flex-start; }
}
@media(max-width: 480px) { .stats { grid-template-columns: 1fr; } }
