/* LetWorkBeDone - Site header | Dark charcoal, mobile first */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #222222;
  border-bottom: 1px solid #111111;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

/* Logo */
.brand { display: flex; flex-shrink: 0; }
.brand img {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

/* Search */
.search {
  position: relative;
  flex: 1 1 100%;
  order: 3;
  height: 44px;
}
.search .lens {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 100%;
  padding: 0 96px 0 44px;
  font-size: 16px;
  font-family: inherit;
  color: #0f172a;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
}
.search input::placeholder { color: #94a3b8; }
.search input:focus { border-color: #00664e; box-shadow: 0 0 0 3px rgba(0, 102, 78, 0.15); }
.search button {
  position: absolute;
  right: 5px;
  top: 5px;
  height: 34px;
  padding: 0 14px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: #00664e;
  border: none;
  border-radius: 9px;
  cursor: pointer;
}
.search button:active { background: #00523f; }

/* Right side: icons, avatar, balance */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  order: 2;
}

.icon-btn {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #e5e7eb;
  text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:active { background: #333; }

.badge {
  position: absolute;
  top: 4px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid #222222;
}
.badge.green { background: #00664e; }

/* Profile picture in the header (photo, or initial if no photo) */
.avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #00664e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.balance {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 12px;
  background: #333;
  border: 1px solid #444;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
}
.balance small { font-size: 0.72rem; font-weight: 600; color: #9ca3af; }
.balance strong { font-size: 1rem; font-weight: 800; }

/* Buying / Selling switch: full row on phones */
.mode {
  order: 4;
  flex: 1 1 100%;
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #333;
  border: 1px solid #444;
  border-radius: 12px;
}
.mode a {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  border-radius: 9px;
}
.mode a.active { background: #00664e; color: #fff; }

/* Logged-out buttons */
.nav .link,
.btn-outline,
.btn-solid {
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  white-space: nowrap;
}
.nav .link { color: #e5e7eb; }
.btn-outline { color: #fff; border: 1.5px solid #fff; }
.btn-solid { color: #fff; background: #00664e; }

/* Tablet and laptop: one row, search in the middle, switch in the header */
@media (min-width: 760px) {
  .header-inner { flex-wrap: nowrap; padding: 12px 24px; gap: 20px; }
  .brand img { width: 48px; height: 48px; }
  .search { order: 0; flex: 1; max-width: 520px; height: 46px; }
  .search input { padding-right: 110px; }
  .search button { height: 36px; top: 5px; padding: 0 18px; font-size: 0.95rem; }
  .nav { gap: 6px; }
  .mode { order: 0; flex: 0 0 auto; gap: 12px; padding: 4px; }
  .mode a { flex: 0 0 auto; padding: 7px 20px; font-size: 0.98rem; }
}

/* Very small phones */
@media (max-width: 360px) {
  .header-inner { padding: 8px 10px; }
  .balance { padding: 3px 8px; }
  .balance strong { font-size: 0.9rem; }
  .icon-btn { width: 38px; height: 38px; }
  .avatar { width: 38px; height: 38px; }
  .btn-outline { display: none; }
}