:root {
  --bg: #eef4fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --surface: #edf4ff;
  --surface-2: #e7f2ee;
  --text: #1a2333;
  --muted: #5d6c85;
  --primary: #1a88ad;
  --primary-strong: #0d6882;
  --success: #1d8f6f;
  --shadow: rgba(17, 24, 39, 0.12);
  --border: rgba(148, 163, 184, 0.28);
  --danger: #d95d5d;
  --warning: #f0a33a;
  --eu-blue: #0d90c8;
  --eu-green: #3ab66b;
  --eu-orange: #f39a2d;
}

body.dark {
  --bg: #0b1220;
  --panel: rgba(17, 26, 39, 0.9);
  --panel-strong: #121f30;
  --surface: #16233a;
  --surface-2: #1e2b40;
  --text: #eaf4ff;
  --muted: #aebdd3;
  --primary: #29a7d8;
  --primary-strong: #1587b8;
  --success: #2ed1a3;
  --shadow: rgba(0, 0, 0, 0.35);
  --border: rgba(148, 163, 184, 0.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "Segoe UI", sans-serif; background: linear-gradient(180deg, var(--bg) 0%, #dfeaff 100%); color: var(--text); }
body.dark { background: linear-gradient(180deg, var(--bg) 0%, #0f172a 100%); }
body { display: flex; justify-content: center; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
#app { width: min(100%, 980px); padding: 18px 14px 34px; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top, rgba(25, 147, 205, 0.25), transparent 30%),
    linear-gradient(180deg, #061018 0%, #020d16 100%);
}

.login-card {
  width: min(100%, 480px);
  border-radius: 30px;
  padding: 28px 22px 24px;
  display: grid;
  gap: 18px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 30px 45px rgba(0,0,0,0.28);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.login-brand img {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(12, 123, 183, 0.25);
}

.login-brand h2 {
  margin: 2px 0 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1;
  color: var(--eu-blue);
  letter-spacing: -0.06em;
}

.login-brand small {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.field input {
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255,255,255,0.8);
}

.primary-btn {
  background: linear-gradient(135deg, var(--eu-blue), var(--primary-strong));
}

.secondary-btn {
  background: rgba(29, 143, 111, 0.08);
  color: var(--text);
}

.status-banner.success {
  background: rgba(29, 143, 111, 0.12);
  color: var(--success);
}

.app-shell {
  display: grid;
  gap: 18px;
  padding: 8px 0 0;
}

.topbar {
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
}

.app-shell, .screen { display: grid; gap: 18px; }

.topbar, .card, .list-card, .module-card, .login-card, .detail-panel, .image-strip img, .map-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: 0 16px 28px var(--shadow);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-radius: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 42px; height: 42px; border-radius: 14px; }
.brand h1 { margin: 0; font-size: clamp(1.2rem, 2.4vw, 1.8rem); }
.brand small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
button {
  border: none; border-radius: 999px; cursor: pointer; transition: transform 0.2s ease; padding: 0.72rem 1rem; font-weight: 700;
}
button:hover { transform: translateY(-1px); }
.primary-btn { background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: white; }
.secondary-btn { background: var(--surface); color: var(--text); }
.ghost-btn { background: transparent; color: var(--text); border: 1px solid var(--border); }

.module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.module-card {
  border-radius: 22px; padding: 16px; display: grid; gap: 12px; cursor: pointer; transition: 0.2s ease;
}
.module-card:hover { transform: translateY(-2px); }
.module-card.active { outline: 2px solid var(--primary); box-shadow: 0 0 0 5px rgba(29, 143, 111, 0.15); }
.module-header { display: flex; justify-content: space-between; align-items: center; }
.module-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; color: white; }
.module-badge { padding: 0.3rem 0.5rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: rgba(148, 163, 184, 0.14); color: var(--muted); }
.module-card h3 { margin: 0; font-size: 1.1rem; }
.module-card p { margin: 0; color: var(--muted); line-height: 1.5; }

.hero-card {
  border-radius: 26px; padding: 20px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--panel-strong) 100%);
}
.hero-card h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 2rem); }
.hero-card small { display: block; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.status-chip { padding: 0.45rem 0.7rem; border-radius: 999px; background: rgba(29, 143, 111, 0.12); color: var(--primary-strong); font-size: 0.75rem; font-weight: 700; }

.search-row { display: flex; gap: 10px; align-items: center; }
.search-box {
  width: 100%; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 0.9rem 1rem; color: var(--text);
}
.search-box:focus { outline: 2px solid rgba(29, 143, 111, 0.18); }

.list-card, .detail-panel { border-radius: 24px; padding: 18px; }
.list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.list-header h3 { margin: 0; }
.item-list { display: grid; gap: 12px; }
.item-card {
  display: grid; gap: 10px; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--border);
  cursor: pointer; transition: 0.2s ease;
}
.item-card:hover { transform: translateY(-1px); }
.item-card h4 { margin: 0; }
.item-meta { color: var(--muted); font-size: 0.88rem; }
.item-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.item-thumb { width: 100%; height: 180px; object-fit: cover; border-radius: 14px; background: var(--surface); }

.empty-state { padding: 18px; border-radius: 18px; text-align: center; background: var(--panel); border: 1px dashed var(--border); color: var(--muted); }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-header h2 { margin: 0; }
.detail-tag { display: inline-block; padding: 0.35rem 0.65rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; background: rgba(29, 143, 111, 0.12); color: var(--primary-strong); }
.detail-summary { color: var(--muted); line-height: 1.7; }
.image-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.image-strip img { width: 100%; height: 170px; object-fit: cover; border-radius: 14px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.info-box { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.info-box strong { display: block; margin-bottom: 4px; }
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-list span { display: inline-block; padding: 0.4rem 0.7rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 0.78rem; }
.map-shell { border-radius: 18px; overflow: hidden; }
.map-shell iframe { width: 100%; height: 260px; border: 0; }

.login-screen { min-height: 100vh; display: grid; place-items: center; }
.login-card {
  width: min(100%, 420px); border-radius: 28px; padding: 20px; display: grid; gap: 18px;
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-brand img { width: 52px; height: 52px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.field input { width: 100%; padding: 0.9rem 1rem; border-radius: 12px; border: 1px solid var(--border); background: transparent; color: var(--text); }
.field input:focus { outline: 2px solid rgba(29, 143, 111, 0.18); }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
.status-banner { padding: 0.8rem 0.9rem; border-radius: 12px; background: rgba(217, 93, 93, 0.1); color: var(--danger); font-size: 0.9rem; }
.status-banner.success { background: rgba(29, 143, 111, 0.12); color: var(--primary-strong); }

.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  #app { padding: 12px 10px 26px; }
  .topbar, .hero-card, .detail-header { flex-direction: column; align-items: flex-start; }
  .topbar-actions, .search-row { width: 100%; }
  .search-row { flex-direction: column; }
  .topbar-actions { justify-content: flex-end; }
  .item-card { padding: 12px; }
}
