/* ===== Global app header ===== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;

  width: 100%;

  background:
    linear-gradient(90deg, rgba(76, 29, 149, 0.28), rgba(17, 24, 39, 0.98) 36%),
    #111827;
  border-bottom: 1px solid rgba(75, 85, 99, 0.85);

  backdrop-filter: blur(12px);
}

.app-header-inner {
  width: 100%;
  max-width: 1200px;
  min-height: 62px;
  margin: 0 auto;
  padding: 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* ===== Brand ===== */

.app-brand {
  min-width: 0;

  display: inline-flex;
  align-items: center;
  gap: 12px;

  color: #f9fafb;
  text-decoration: none;
}

.app-brand:hover {
  color: #ffffff;
}

.app-brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #4c1d95;
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 12px;
  overflow: hidden;
}

.app-brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.app-brand-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-brand-title {
  color: #f9fafb;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

/* ===== Navigation ===== */

.app-nav {
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-nav-link {
  min-height: 36px;
  padding: 9px 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #d1d5db;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;

  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.app-nav-link:hover {
  color: #ffffff;
  background: rgba(55, 65, 81, 0.62);
  border-color: rgba(75, 85, 99, 0.7);
}

.app-nav-link.is-active {
  color: #ede9fe;
  background: rgba(109, 40, 217, 0.34);
  border-color: rgba(167, 139, 250, 0.55);
}

.app-nav-separator {
  width: 1px;
  height: 26px;
  background: rgba(75, 85, 99, 0.85);
}

.app-nav-button {
  min-height: 36px;
  padding: 9px 15px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 10px;

  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.app-nav-button:hover {
  transform: translateY(-1px);
}

.app-nav-button-login {
  background: #2563eb;
  border-color: rgba(96, 165, 250, 0.45);
}

.app-nav-button-login:hover {
  background: #1d4ed8;
  border-color: rgba(147, 197, 253, 0.7);
}

.app-nav-button-logout {
  background: #dc2626;
  border-color: rgba(248, 113, 113, 0.45);
}

.app-nav-button-logout:hover {
  background: #b91c1c;
  border-color: rgba(248, 113, 113, 0.7);
}

/* ===== Tablet / mobile ===== */

@media (max-width: 768px) {
  .app-header-inner {
    min-height: auto;
    padding: 7px 10px;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
  }

  .app-brand {
    justify-content: center;
    gap: 8px;
  }

  .app-brand-logo {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
  }

  .app-brand-title {
    font-size: 13px;
    line-height: 1;
  }

  .app-nav {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }

  .app-nav-link {
    width: auto;
    min-height: 28px;
    padding: 6px 8px;

    font-size: 11px;
    border-radius: 8px;
  }

  .app-nav-button,
  .app-header #login-btn,
  .app-header #logout-btn,
  .app-header .app-nav-button-login,
  .app-header .app-nav-button-logout {
    display: none !important;
  }

  .app-nav-separator {
    display: none;
  }
}

/* ===== Small phones ===== */

@media (max-width: 420px) {
  .app-header-inner {
    padding: 6px 8px;
    gap: 5px;
  }

  .app-brand-logo {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
  }

  .app-brand-title {
    font-size: 12px;
  }

  .app-nav {
    gap: 4px;
  }

  .app-nav-link {
    min-height: 27px;
    padding: 6px 7px;
    font-size: 10.5px;
    border-radius: 7px;
  }
}