:root {
  --bg: #eef1f8;
  --bg-soft: #f7f9fe;
  --ink: #0f213f;
  --muted: #4b5e80;
  --card: #ffffff;
  --line: #d8dfec;
  --accent: #1ab3d6;
  --accent-2: #354f95;
  --shadow: 0 12px 28px rgba(29, 54, 112, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans Condensed", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(132, 179, 255, 0.16) 0, transparent 36%),
    radial-gradient(circle at 100% 12%, rgba(155, 224, 244, 0.2) 0, transparent 34%),
    linear-gradient(180deg, #f6f8fe 0%, #edf1f9 100%);
  position: relative;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(0.2px);
  pointer-events: none;
  z-index: 0;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  background: rgba(118, 146, 224, 0.12);
  top: -120px;
  right: -40px;
}

.bg-shape-b {
  width: 260px;
  height: 260px;
  background: rgba(26, 179, 214, 0.12);
  bottom: -80px;
  left: -60px;
}

.container {
  width: min(1120px, 94vw);
  margin: 0 auto;
  padding: 22px 0 60px;
  position: relative;
  z-index: 1;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: clamp(140px, 16vw, 230px);
  height: auto;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.template-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #a8d5b5;
  background: linear-gradient(135deg, #e8f7ed 0%, #d4f0de 100%);
  color: #1b5e35;
  font-weight: 600;
  font-size: 0.93rem;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
}

.template-btn:hover {
  background: linear-gradient(135deg, #d4f0de 0%, #bde8cc 100%);
  box-shadow: 0 4px 12px rgba(27, 94, 53, 0.12);
}

.template-btn svg {
  flex-shrink: 0;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #afc4ec;
  background: linear-gradient(135deg, #e9f3ff 0%, #dbeeff 100%);
  color: #1e3d72;
  font-weight: 600;
  font-size: 0.93rem;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
}

.import-btn:hover {
  background: linear-gradient(135deg, #d8ecff 0%, #c6e2ff 100%);
  box-shadow: 0 4px 12px rgba(29, 80, 180, 0.12);
}

.import-btn svg {
  flex-shrink: 0;
}

.import-status {
  font-size: 0.88rem;
  color: #2a6e38;
  background: #e4f6ea;
  border: 1px solid #b3dfc0;
  border-radius: 8px;
  padding: 5px 10px;
}

.stats {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #d8e2f1;
  border-radius: 12px;
  padding: 10px 12px;
}

.stat-label {
  color: var(--muted);
  display: block;
}

.stat-card strong {
  font-size: 1.45rem;
  font-family: "Space Grotesk", sans-serif;
}

.panel {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.filters-panel {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 12px;
  align-items: end;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  color: #42577f;
}

input,
select,
button {
  font-family: inherit;
  font-size: 1rem;
}

input,
select {
  width: 100%;
  border: 1px solid #c9d6eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f9fbff;
  color: #193053;
}

.select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.secondary-btn {
  border: 1px solid #b6c7e6;
  background: #edf4ff;
  color: #2f4976;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.secondary-btn:hover {
  filter: brightness(0.97);
}

.cards {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.contacts-header {
  margin-top: 18px;
}

.contacts-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: #162f5d;
}

.contacts-header p {
  margin: 4px 0 0;
  color: #5a6f94;
}

.card {
  border: 1px solid #d6e0f0;
  border-radius: 16px;
  background: #ffffff;
  padding: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  animation: reveal 360ms ease forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card h2 {
  margin: 0;
  font-size: 1.2rem;
  font-family: "Space Grotesk", sans-serif;
}

.tag-row {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.8rem;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eaf1ff;
  color: #2f4f83;
}

.tag.ok {
  background: #dff5f5;
  color: #1c5d63;
}

.info {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.info p {
  margin: 0;
  color: #2a2a2a;
}

.info span {
  color: var(--muted);
  display: inline-block;
  min-width: 72px;
}

.actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  border: 1px solid #c9d7ee;
  text-decoration: none;
  border-radius: 10px;
  padding: 8px 10px;
  color: #2b4d7d;
  background: #f2f7ff;
}

.action-btn:hover {
  background: #e7f0ff;
}

.empty-state {
  border: 1px dashed #adc2e6;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(247, 251, 255, 0.92);
}

@media (max-width: 920px) {
  .topbar-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .brand {
    justify-content: center;
  }

  .topbar-actions {
    justify-content: center;
    margin-left: 0;
  }

  .filters-panel {
    grid-template-columns: 1fr;
  }

  .select-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .brand-logo {
    width: min(66vw, 220px);
  }

  .nav-chip {
    padding: 6px 10px;
    font-size: 0.88rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}
