/* ── Header ── */

.app-header {
  background: var(--header-bg);
  color: var(--header-text);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: #fff;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  overflow: hidden;
  padding: 0;
  border: none;
  cursor: pointer;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Sync indicator ── */

.sync-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.sync-btn.synced {
  /* --success matches --header-bg (both moss) and would vanish against it.
     Use the header text color instead so the "all synced" cloud is legible
     while still reading as understated. */
  color: var(--header-text);
  opacity: 0.9;
}

.sync-btn.pending {
  color: var(--accent);
}

.sync-btn.restoring {
  color: var(--accent);
}

@keyframes sync-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

.sync-icon-animated {
  animation: sync-pulse 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .sync-icon-animated {
    animation: none;
  }
}

.sync-badge {
  position: relative;
  display: flex;
  align-items: center;
}

.sync-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--warning);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50%;
  min-width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Tab bar ── */

.tab-bar {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 0;
  min-height: 44px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.tab-btn.active {
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--brand);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Upload button ── */

.upload-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.upload-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  transition: background 0.15s;
}

.upload-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
