/* Единая шапка Runturu. Все селекторы с префиксом rt-, чтобы не конфликтовать
   со стилями приложений. */
.rt-header,
.rt-header * { box-sizing: border-box; }

.rt-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e6ebe7;
  color: #152018;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

.rt-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.rt-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #152018;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.rt-logo {
  width: 32px;
  height: 32px;
  display: block;
  flex: 0 0 32px;
  filter: drop-shadow(0 5px 12px rgba(46, 125, 50, 0.28));
}

.rt-logo svg { display: block; width: 100%; height: 100%; border-radius: 9px; }

.rt-header-links[hidden] { display: none !important; }
.rt-header-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 6px;
}

.rt-header-links .nav-links { display: flex; align-items: center; gap: 20px; margin: 0; }
.rt-header-links .nav-links a {
  color: #6b7a70;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.rt-header-links .nav-links a:hover { color: #152018; }

.rt-header-spacer { margin-left: auto; }

.rt-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rt-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rt-user-name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: #152018;
}

.rt-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: linear-gradient(135deg, #7CB342, #2E7D32);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  user-select: none;
}

.rt-menu-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid #e6ebe7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rt-menu-btn:hover { background: #f2f7f3; border-color: #d5e6d9; }
.rt-menu-btn:focus-visible { outline: 2px solid #2E7D32; outline-offset: 2px; }
.rt-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #152018;
  transition: transform 0.15s, opacity 0.15s;
}
.rt-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.rt-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.rt-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.rt-menu[hidden] { display: none !important; }
.rt-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 264px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e6ebe7;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(20, 54, 26, 0.18);
  z-index: 100;
}

.rt-menu-section {
  padding: 8px 12px 4px;
  color: #8a968f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.rt-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #152018;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rt-menu-item:hover { background: #f2f7f3; }
.rt-menu-item:focus-visible { outline: 2px solid #2E7D32; outline-offset: -2px; }

.rt-menu-sep {
  height: 1px;
  margin: 6px 4px;
  background: #e6ebe7;
}

.rt-menu-logout { color: #c62828; }
.rt-menu-logout:hover { background: #fdecea; }

.rt-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7CB342 0%, #2E7D32 55%, #12351a 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.28);
  white-space: nowrap;
}
.rt-login:hover { box-shadow: 0 10px 26px rgba(46, 125, 50, 0.38); }

@media (max-width: 760px) {
  .rt-header-inner { height: 60px; gap: 12px; padding: 0 16px; }
  .rt-header-links { display: none !important; }
  .rt-user-name { max-width: 120px; }
}

@media (max-width: 520px) {
  .rt-header-right > .lang-switch { display: none; }
  .rt-brand { font-size: 17px; }
  .rt-logo { width: 30px; height: 30px; flex-basis: 30px; }
  .rt-user-name { max-width: 86px; font-size: 13px; }
  .rt-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .rt-menu-btn { width: 38px; height: 38px; flex-basis: 38px; }
  .rt-menu { min-width: 240px; }
}
