/* K697 hub navigation — follows each portal's --accent */

.hub-nav-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.hub-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  border-radius: 4px;
  text-decoration: none;
  color: #e8eef4;
  background: linear-gradient(135deg, #0a1016 0%, #121a22 100%);
  border: 1px solid color-mix(in srgb, var(--accent, #f0a030) 35%, transparent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16), inset 0 1px 0 color-mix(in srgb, var(--accent, #f0a030) 10%, transparent);
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  font-family: "Orbitron", "Cairo", sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  direction: ltr;
}

.hub-back:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent, #f0a030) 60%, transparent);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent, #f0a030) 16%, transparent);
}

.hub-back--static { pointer-events: none; }

.hub-back__icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent, #f0a030) 14%, transparent);
  color: var(--accent, #f0a030);
}

.hub-back__icon svg {
  width: 14px;
  height: 14px;
}

.hub-back__k {
  color: var(--accent, #f0a030);
}

.hub-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted, #6b6254);
  white-space: nowrap;
}

.hub-crumb__link {
  color: var(--primary, #c48a1a);
  text-decoration: none;
  transition: color 0.2s;
}

.hub-crumb__link:hover {
  color: var(--primary-dark, #9a6b10);
  text-decoration: underline;
}

.hub-crumb__sep {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  opacity: 0.45;
}

.hub-crumb__sep svg {
  width: 12px;
  height: 12px;
}

.hub-crumb__here {
  color: var(--text, #1a1610);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hub-sidebar-portal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 12px;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #e4ecf2;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #f0a030) 12%, transparent) 0%, rgba(8, 12, 16, 0.5) 100%);
  border: 1px solid color-mix(in srgb, var(--accent, #f0a030) 24%, transparent);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.hub-sidebar-portal:hover {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #f0a030) 18%, transparent) 0%, rgba(8, 12, 16, 0.65) 100%);
  border-color: color-mix(in srgb, var(--accent, #f0a030) 42%, transparent);
  transform: translateX(-2px);
}

.hub-sidebar-portal__icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, #f0a030) 14%, transparent);
  color: var(--accent, #f0a030);
}

.hub-sidebar-portal__icon svg {
  width: 18px;
  height: 18px;
}

.hub-sidebar-portal__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-sidebar-portal__title {
  font-size: 13px;
  font-weight: 800;
  font-family: "Orbitron", "Cairo", sans-serif;
  letter-spacing: 0.03em;
}

.hub-sidebar-portal__meta {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.65;
}

.hub-sidebar-portal__arrow {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  opacity: 0.5;
  flex-shrink: 0;
}

.hub-sidebar-portal__arrow svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  .hub-crumb { display: none; }

  .hub-sidebar-portal { gap: 8px; margin: 0 8px 8px; padding: 7px 9px; }
  .hub-sidebar-portal__icon { width: 24px; height: 24px; border-radius: 5px; }
  .hub-sidebar-portal__icon svg { width: 14px; height: 14px; }
  .hub-sidebar-portal__title { font-size: 11.5px; }
  .hub-sidebar-portal__meta { display: none; }
  .hub-sidebar-portal__arrow { width: 16px; height: 16px; }
  .hub-sidebar-portal__arrow svg { width: 12px; height: 12px; }
}

@media (max-width: 480px) {
  .hub-back__brand { font-size: 12px; }
  .hub-back { padding: 6px 10px 6px 6px; }
}

@media print {
  .hub-nav-top,
  .hub-sidebar-portal,
  .hub-login-nav,
  .hub-login-link,
  .login-switch { display: none !important; }
}

body.login-page {
  padding-top: 72px;
  justify-content: flex-start;
}

.hub-login-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px clamp(14px, 4vw, 24px);
  min-height: 56px;
  background: rgba(6, 10, 14, 0.92);
  border-bottom: 1px solid color-mix(in srgb, var(--accent, #f0a030) 18%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hub-back--login {
  padding: 7px 14px 7px 10px;
}

.hub-back__text {
  font-family: "Cairo", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: rgba(216, 232, 240, 0.75);
  margin-inline-start: 4px;
  letter-spacing: 0;
}

.login-switch {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 440px);
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto 16px;
  padding: 6px;
  border-radius: 20px;
  background: rgba(8, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.login-switch__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 72px;
  padding: 10px 6px 9px;
  border-radius: 15px;
  text-decoration: none;
  color: rgba(200, 214, 226, 0.72);
  font-family: "Cairo", sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
}

.login-switch__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 22px;
  line-height: 1;
}

.login-switch__icon img,
.login-switch__icon .k697-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.login-switch__name {
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.login-switch__lock {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 11px;
}

.login-switch__item:hover {
  color: #eef4fa;
  background: rgba(255, 255, 255, 0.05);
}

.login-switch__item.is-active {
  color: #fff;
  transform: translateY(-1px);
}

.login-switch__item--canteen.is-active {
  background: color-mix(in srgb, var(--accent-canteen, #f0a030) 22%, #10161c);
  border-color: color-mix(in srgb, var(--accent-canteen, #f0a030) 55%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-canteen, #f0a030) 22%, transparent);
}

.login-switch__item--mess.is-active {
  background: color-mix(in srgb, var(--accent-mess, #40e0a0) 22%, #10161c);
  border-color: color-mix(in srgb, var(--accent-mess, #40e0a0) 55%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-mess, #40e0a0) 22%, transparent);
}

.login-switch__item--battalion.is-active {
  background: color-mix(in srgb, var(--accent-battalion, #5eb0e8) 22%, #10161c);
  border-color: color-mix(in srgb, var(--accent-battalion, #5eb0e8) 55%, transparent);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent-battalion, #5eb0e8) 22%, transparent);
}

.login-switch__item.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.hub-login-link { display: none; }

@media (min-width: 720px) {
  .login-switch {
    max-width: 480px;
    padding: 7px;
    gap: 8px;
  }
  .login-switch__item {
    flex-direction: row;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .login-switch__icon {
    width: 26px;
    height: 26px;
    font-size: 20px;
  }
}

@media (max-width: 520px) {
  .hub-back__text { display: none; }
}

@media (hover: none) {
  .login-switch__item:hover {
    background: transparent;
    color: rgba(200, 214, 226, 0.72);
  }
  .login-switch__item.is-active:hover { color: #fff; }
}
