.sidebar-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 16, 0.42);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 220ms ease;
}

.sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.country-sidebar {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(400px, 92vw);
  z-index: 32;
  transform: translateX(108%);
  transition: transform 260ms ease;
  border-left: 1px solid rgba(195, 216, 255, 0.28);
  background: rgba(8, 18, 38, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: -24px 0 38px rgba(0, 0, 0, 0.42);
  overflow-y: auto;
  padding: 14px 14px 22px;
}

.country-sidebar.open {
  transform: translateX(0);
}

.sidebar-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #c8dbff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.sidebar-head {
  padding-right: 24px;
  margin-bottom: 12px;
}

.sidebar-head h2 {
  margin: 0;
  font-size: 1.4rem;
}

.status-badge {
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.33rem 0.54rem;
}

.status-badge.allowed {
  color: #8ff9b5;
  background: rgba(34, 197, 94, 0.22);
}

.status-badge.restricted {
  color: #ffe89a;
  background: rgba(234, 179, 8, 0.2);
}

.status-badge.banned {
  color: #ffacac;
  background: rgba(239, 68, 68, 0.2);
}

.status-badge.unknown {
  color: #d6d9df;
  background: rgba(107, 114, 128, 0.3);
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #d6e6ff;
  border-radius: 8px;
  padding: 0.42rem 0.38rem;
  font-size: 0.73rem;
  cursor: pointer;
}

.tab-btn.active {
  background: rgba(120, 162, 255, 0.3);
  border-color: rgba(120, 162, 255, 0.6);
  color: #f4f8ff;
}

.tab-panel {
  display: none;
  animation: fadeIn 200ms ease;
}

.tab-panel.active {
  display: block;
}

.tab-panel h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.tab-panel p,
.tab-panel li {
  color: #d2def4;
  line-height: 1.46;
  font-size: 0.86rem;
}

.summary-block {
  margin-top: 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stat-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.6rem;
  background: rgba(255, 255, 255, 0.05);
}

.country-edit-form {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.country-edit-form h3 {
  margin: 0 0 6px;
}

.edit-label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  color: #9cb2d9;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.edit-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(5, 10, 22, 0.72);
  color: #f1f6ff;
  padding: 0.5rem 0.56rem;
  font: inherit;
  font-size: 0.82rem;
}

.edit-input:focus {
  outline: none;
  border-color: rgba(120, 162, 255, 0.75);
  box-shadow: 0 0 0 2px rgba(120, 162, 255, 0.22);
}

.edit-textarea {
  min-height: 120px;
  resize: vertical;
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.edit-action-btn {
  border: 1px solid rgba(120, 162, 255, 0.5);
  border-radius: 8px;
  background: rgba(120, 162, 255, 0.28);
  color: #eff6ff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
}

.edit-action-btn.subtle {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.edit-hint {
  margin: 0 0 8px;
  color: #96abce;
  font-size: 0.75rem;
}

.stat-label {
  display: block;
  color: #9cb2d9;
  font-size: 0.7rem;
  margin-bottom: 3px;
}

.stat-value {
  color: #f2f7ff;
  font-size: 0.82rem;
  font-weight: 600;
}

.link-list,
.simple-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.link-list a {
  color: #99bdff;
  text-decoration: none;
  word-break: break-word;
}

.link-list a:hover {
  text-decoration: underline;
}

.contact-card,
.resource-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.62rem;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.contact-label,
.resource-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #90a8d3;
  margin-bottom: 3px;
}

.muted {
  color: #91a4c8;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
